version 5.7.6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 34b2771..c4a6826 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+## V 5.7.6
+- FIX: es6 support on export
+- IMPROVEMENT: added linting rules
+- FIX: seedrandom and main fix
+- FIX: image export fix
+
 ## V 5.7.5
 - FIX: Enable HImageElement to use preloaded images thanks @dbettini
 - FIX: lottie-light effects breaking on destroy
diff --git a/History.md b/History.md
index 555dbcb..360df3f 100644
--- a/History.md
+++ b/History.md
@@ -1,3 +1,9 @@
+## V 5.7.6
+- FIX: es6 support on export
+- IMPROVEMENT: added linting rules
+- FIX: seedrandom and main fix
+- FIX: image export fix
+
 ## V 5.7.5
 - FIX: Enable HImageElement to use preloaded images thanks @dbettini
 - FIX: lottie-light effects breaking on destroy
diff --git a/build/extension/bodymovin.zxp b/build/extension/bodymovin.zxp
index 570c6d7..b70ef23 100644
--- a/build/extension/bodymovin.zxp
+++ b/build/extension/bodymovin.zxp
Binary files differ
diff --git a/build/player/lottie.js b/build/player/lottie.js
index 82dd570..c0bfadd 100644
--- a/build/player/lottie.js
+++ b/build/player/lottie.js
@@ -10,364 +10,407 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";
-var svgNS = "http://www.w3.org/2000/svg";
+	/* global locationHref:writable, animationManager, subframeEnabled:writable, defaultCurveSegments:writable, roundValues,
+expressionsPlugin:writable, PropertyFactory, ShapePropertyFactory, Matrix */
+/* exported locationHref, subframeEnabled, expressionsPlugin */
+
+'use strict';
+
+/* exported svgNS, locationHref, initialDefaultFrame */
+
+var svgNS = 'http://www.w3.org/2000/svg';
 
 var locationHref = '';
 
 var initialDefaultFrame = -999999;
 
+/* global createSizedArray */
+/* exported subframeEnabled, expressionsPlugin, isSafari, cachedColors, bmPow, bmSqrt, bmFloor, bmMax, bmMin, ProjectInterface,
+defaultCurveSegments, degToRads, roundCorner, bmRnd, styleDiv, BMEnterFrameEvent, BMCompleteEvent, BMCompleteLoopEvent,
+BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, BMAnimationConfigErrorEvent, createElementID,
+addSaturationToRGB, addBrightnessToRGB, addHueToRGB, rgbToHex */
+
 var subframeEnabled = true;
 var expressionsPlugin;
 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
+var bmRnd;
+var bmPow = Math.pow;
+var bmSqrt = Math.sqrt;
+var bmFloor = Math.floor;
+var bmMax = Math.max;
+var bmMin = Math.min;
 
 var BMMath = {};
-(function(){
-    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"];
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
+(function () {
+  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'];
+  var i;
+  var len = propertyNames.length;
+  for (i = 0; i < len; i += 1) {
+    BMMath[propertyNames[i]] = Math[propertyNames[i]];
+  }
 }());
 
-function ProjectInterface(){return {};}
+function ProjectInterface() { return {}; }
 
 BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = createSizedArray(val.length);
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
+BMMath.abs = function (val) {
+  var tOfVal = typeof val;
+  if (tOfVal === 'object' && val.length) {
+    var absArr = createSizedArray(val.length);
+    var i;
+    var len = val.length;
+    for (i = 0; i < len; i += 1) {
+      absArr[i] = Math.abs(val[i]);
     }
-    return Math.abs(val);
-
+    return absArr;
+  }
+  return Math.abs(val);
 };
 var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
+var degToRads = Math.PI / 180;
 var roundCorner = 0.5519;
 
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
+function roundValues(flag) {
+  if (flag) {
+    bmRnd = Math.round;
+  } else {
+    bmRnd = function (val) {
+      return val;
+    };
+  }
 }
 roundValues(false);
 
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
+function styleDiv(element) {
+  element.style.position = 'absolute';
+  element.style.top = 0;
+  element.style.left = 0;
+  element.style.display = 'block';
+  element.style.transformOrigin = '0 0';
+  element.style.webkitTransformOrigin = '0 0';
+  element.style.backfaceVisibility = 'visible';
+  element.style.webkitBackfaceVisibility = 'visible';
+  element.style.transformStyle = 'preserve-3d';
+  element.style.webkitTransformStyle = 'preserve-3d';
+  element.style.mozTransformStyle = 'preserve-3d';
 }
 
-function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
-    this.type = type;
-    this.currentTime = currentTime;
-    this.totalTime = totalTime;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
+  this.type = type;
+  this.currentTime = currentTime;
+  this.totalTime = totalTime;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteEvent(type, frameMultiplier){
-    this.type = type;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteEvent(type, frameMultiplier) {
+  this.type = type;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
-    this.type = type;
-    this.currentLoop = currentLoop;
-    this.totalLoops = totalLoops;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
+  this.type = type;
+  this.currentLoop = currentLoop;
+  this.totalLoops = totalLoops;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMSegmentStartEvent(type, firstFrame, totalFrames){
-    this.type = type;
-    this.firstFrame = firstFrame;
-    this.totalFrames = totalFrames;
+function BMSegmentStartEvent(type, firstFrame, totalFrames) {
+  this.type = type;
+  this.firstFrame = firstFrame;
+  this.totalFrames = totalFrames;
 }
 
-function BMDestroyEvent(type, target){
-    this.type = type;
-    this.target = target;
+function BMDestroyEvent(type, target) {
+  this.type = type;
+  this.target = target;
 }
 
 function BMRenderFrameErrorEvent(nativeError, currentTime) {
-    this.type = 'renderFrameError';
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = 'renderFrameError';
+  this.nativeError = nativeError;
+  this.currentTime = currentTime;
 }
 
 function BMConfigErrorEvent(nativeError) {
-    this.type = 'configError';
-    this.nativeError = nativeError;
+  this.type = 'configError';
+  this.nativeError = nativeError;
 }
 
 function BMAnimationConfigErrorEvent(type, nativeError) {
-    this.type = type;
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = type;
+  this.nativeError = nativeError;
 }
 
-var createElementID = (function(){
-    var _count = 0;
-    return function createID() {
-        return '__lottie_element_' + ++_count
-    }
-}())
+var createElementID = (function () {
+  var _count = 0;
+  return function createID() {
+    _count += 1;
+    return '__lottie_element_' + _count;
+  };
+}());
 
 function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v; g = t; b = p; break;
-        case 1: r = q; g = v; b = p; break;
-        case 2: r = p; g = v; b = t; break;
-        case 3: r = p; g = q; b = v; break;
-        case 4: r = t; g = p; b = v; break;
-        case 5: r = v; g = p; b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
+  var r;
+  var g;
+  var b;
+  var i;
+  var f;
+  var p;
+  var q;
+  var t;
+  i = Math.floor(h * 6);
+  f = h * 6 - i;
+  p = v * (1 - s);
+  q = v * (1 - f * s);
+  t = v * (1 - (1 - f) * s);
+  switch (i % 6) {
+    case 0: r = v; g = t; b = p; break;
+    case 1: r = q; g = v; b = p; break;
+    case 2: r = p; g = v; b = t; break;
+    case 3: r = p; g = q; b = v; break;
+    case 4: r = t; g = p; b = v; break;
+    case 5: r = v; g = p; b = q; break;
+    default: break;
+  }
+  return [r,
+    g,
+    b];
 }
 
 function RGBtoHSV(r, g, b) {
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
+  var max = Math.max(r, g, b);
+  var min = Math.min(r, g, b);
+  var d = max - min;
+  var h;
+  var s = (max === 0 ? 0 : d / max);
+  var v = max / 255;
 
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
+  switch (max) {
+    case min: h = 0; break;
+    case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break;
+    case g: h = (b - r) + d * 2; h /= 6 * d; break;
+    case b: h = (r - g) + d * 4; h /= 6 * d; break;
+    default: break;
+  }
 
-    return [
-         h,
-         s,
-         v
-    ];
+  return [
+    h,
+    s,
+    v,
+  ];
 }
 
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addSaturationToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[1] += offset;
+  if (hsv[1] > 1) {
+    hsv[1] = 1;
+  } else if (hsv[1] <= 0) {
+    hsv[1] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addBrightnessToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[2] += offset;
+  if (hsv[2] > 1) {
+    hsv[2] = 1;
+  } else if (hsv[2] < 0) {
+    hsv[2] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addHueToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[0] += offset / 360;
+  if (hsv[0] > 1) {
+    hsv[0] -= 1;
+  } else if (hsv[0] < 0) {
+    hsv[0] += 1;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
+var rgbToHex = (function () {
+  var colorMap = [];
+  var i;
+  var hex;
+  for (i = 0; i < 256; i += 1) {
+    hex = i.toString(16);
+    colorMap[i] = hex.length === 1 ? '0' + hex : hex;
+  }
 
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
+  return function (r, g, b) {
+    if (r < 0) {
+      r = 0;
+    }
+    if (g < 0) {
+      g = 0;
+    }
+    if (b < 0) {
+      b = 0;
+    }
+    return '#' + colorMap[r] + colorMap[g] + colorMap[b];
+  };
 }());
-function BaseEvent(){}
-BaseEvent.prototype = {
-	triggerEvent: function (eventName, args) {
-	    if (this._cbs[eventName]) {
-	        var len = this._cbs[eventName].length;
-	        for (var i = 0; i < len; i++){
-	            this._cbs[eventName][i](args);
-	        }
-	    }
-	},
-	addEventListener: function (eventName, callback) {
-	    if (!this._cbs[eventName]){
-	        this._cbs[eventName] = [];
-	    }
-	    this._cbs[eventName].push(callback);
 
-		return function() {
-			this.removeEventListener(eventName, callback);
-		}.bind(this);
-	},
-	removeEventListener: function (eventName,callback){
-	    if (!callback){
-	        this._cbs[eventName] = null;
-	    }else if(this._cbs[eventName]){
-	        var i = 0, len = this._cbs[eventName].length;
-	        while(i<len){
-	            if(this._cbs[eventName][i] === callback){
-	                this._cbs[eventName].splice(i,1);
-	                i -=1;
-	                len -= 1;
-	            }
-	            i += 1;
-	        }
-	        if(!this._cbs[eventName].length){
-	            this._cbs[eventName] = null;
-	        }
-	    }
-	}
+function BaseEvent() {}
+BaseEvent.prototype = {
+  triggerEvent: function (eventName, args) {
+    if (this._cbs[eventName]) {
+      var len = this._cbs[eventName].length;
+      for (var i = 0; i < len; i += 1) {
+        this._cbs[eventName][i](args);
+      }
+    }
+  },
+  addEventListener: function (eventName, callback) {
+    if (!this._cbs[eventName]) {
+      this._cbs[eventName] = [];
+    }
+    this._cbs[eventName].push(callback);
+
+    return function () {
+      this.removeEventListener(eventName, callback);
+    }.bind(this);
+  },
+  removeEventListener: function (eventName, callback) {
+    if (!callback) {
+      this._cbs[eventName] = null;
+    } else if (this._cbs[eventName]) {
+      var i = 0;
+      var len = this._cbs[eventName].length;
+      while (i < len) {
+        if (this._cbs[eventName][i] === callback) {
+          this._cbs[eventName].splice(i, 1);
+          i -= 1;
+          len -= 1;
+        }
+        i += 1;
+      }
+      if (!this._cbs[eventName].length) {
+        this._cbs[eventName] = null;
+      }
+    }
+  },
 };
-var createTypedArray = (function(){
-	function createRegularArray(type, len){
-		var i = 0, arr = [], value;
-		switch(type) {
-			case 'int16':
-			case 'uint8c':
-				value = 1;
-				break;
-			default:
-				value = 1.1;
-				break;
-		}
-		for(i = 0; i < len; i += 1) {
-			arr.push(value);
-		}
-		return arr;
-	}
-	function createTypedArray(type, len){
-		if(type === 'float32') {
-			return new Float32Array(len);
-		} else if(type === 'int16') {
-			return new Int16Array(len);
-		} else if(type === 'uint8c') {
-			return new Uint8ClampedArray(len);
-		}
-	}
-	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
-		return createTypedArray;
-	} else {
-		return createRegularArray;
-	}
+
+/* exported createTypedArray, createSizedArray */
+
+var createTypedArray = (function () {
+  function createRegularArray(type, len) {
+    var i = 0;
+    var arr = [];
+    var value;
+    switch (type) {
+      case 'int16':
+      case 'uint8c':
+        value = 1;
+        break;
+      default:
+        value = 1.1;
+        break;
+    }
+    for (i = 0; i < len; i += 1) {
+      arr.push(value);
+    }
+    return arr;
+  }
+  function createTypedArrayFactory(type, len) {
+    if (type === 'float32') {
+      return new Float32Array(len);
+    } if (type === 'int16') {
+      return new Int16Array(len);
+    } if (type === 'uint8c') {
+      return new Uint8ClampedArray(len);
+    }
+    return createRegularArray(type, len);
+  }
+  if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+    return createTypedArrayFactory;
+  }
+  return createRegularArray;
 }());
 
 function createSizedArray(len) {
-	return Array.apply(null,{length:len});
+  return Array.apply(null, { length: len });
 }
+
+/* global svgNS */
+/* exported createNS */
+
 function createNS(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElementNS(svgNS, type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElementNS(svgNS, type);
 }
+
+/* exported createTag */
+
 function createTag(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElement(type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElement(type);
 }
-function DynamicPropertyContainer(){};
+
+function DynamicPropertyContainer() {}
 DynamicPropertyContainer.prototype = {
-	addDynamicProperty: function(prop) {
-		if(this.dynamicProperties.indexOf(prop) === -1) {
-	        this.dynamicProperties.push(prop);
-	        this.container.addDynamicProperty(this);
-	    	this._isAnimated = true;
-	    }
-	},
-	iterateDynamicProperties: function(){
-	    this._mdf = false;
-	    var i, len = this.dynamicProperties.length;
-	    for(i=0;i<len;i+=1){
-	        this.dynamicProperties[i].getValue();
-	        if(this.dynamicProperties[i]._mdf) {
-	            this._mdf = true;
-	        }
-	    }
-	},
-	initDynamicPropertyContainer: function(container){
-	    this.container = container;
-	    this.dynamicProperties = [];
-	    this._mdf = false;
-	    this._isAnimated = false;
-	}
-}
-var getBlendMode = (function() {
-
-	var blendModeEnums = {
-        0:'source-over',
-        1:'multiply',
-        2:'screen',
-        3:'overlay',
-        4:'darken',
-        5:'lighten',
-        6:'color-dodge',
-        7:'color-burn',
-        8:'hard-light',
-        9:'soft-light',
-        10:'difference',
-        11:'exclusion',
-        12:'hue',
-        13:'saturation',
-        14:'color',
-        15:'luminosity'
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+      this.container.addDynamicProperty(this);
+      this._isAnimated = true;
     }
+  },
+  iterateDynamicProperties: function () {
+    this._mdf = false;
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      this.dynamicProperties[i].getValue();
+      if (this.dynamicProperties[i]._mdf) {
+        this._mdf = true;
+      }
+    }
+  },
+  initDynamicPropertyContainer: function (container) {
+    this.container = container;
+    this.dynamicProperties = [];
+    this._mdf = false;
+    this._isAnimated = false;
+  },
+};
 
-	return function(mode) {
-		return blendModeEnums[mode] || '';
-	}
-}())
+/* exported getBlendMode */
+
+var getBlendMode = (function () {
+  var blendModeEnums = {
+    0: 'source-over',
+    1: 'multiply',
+    2: 'screen',
+    3: 'overlay',
+    4: 'darken',
+    5: 'lighten',
+    6: 'color-dodge',
+    7: 'color-burn',
+    8: 'hard-light',
+    9: 'soft-light',
+    10: 'difference',
+    11: 'exclusion',
+    12: 'hue',
+    13: 'saturation',
+    14: 'color',
+    15: 'luminosity',
+  };
+
+  return function (mode) {
+    return blendModeEnums[mode] || '';
+  };
+}());
+
+/* global createTypedArray */
+
 /*!
  Transformation Matrix v2.0
  (c) Epistemex 2014-2015
@@ -397,394 +440,399 @@
  * @constructor
  */
 
-var Matrix = (function(){
+var Matrix = (function () {
+  var _cos = Math.cos;
+  var _sin = Math.sin;
+  var _tan = Math.tan;
+  var _rnd = Math.round;
 
-    var _cos = Math.cos;
-    var _sin = Math.sin;
-    var _tan = Math.tan;
-    var _rnd = Math.round;
+  function reset() {
+    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;
+    return this;
+  }
 
-    function reset(){
-        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;
-        return this;
+  function rotate(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function rotateX(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateY(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateZ(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function shear(sx, sy) {
+    return this._t(1, sy, sx, 1, 0, 0);
+  }
+
+  function skew(ax, ay) {
+    return this.shear(_tan(ax), _tan(ay));
+  }
+
+  function skewFromAxis(ax, angle) {
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    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);
+  }
+
+  function scale(sx, sy, sz) {
+    if (!sz && sz !== 0) {
+      sz = 1;
+    }
+    if (sx === 1 && sy === 1 && sz === 1) {
+      return this;
+    }
+    return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
+  }
+
+  function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
+    this.props[0] = a;
+    this.props[1] = b;
+    this.props[2] = c;
+    this.props[3] = d;
+    this.props[4] = e;
+    this.props[5] = f;
+    this.props[6] = g;
+    this.props[7] = h;
+    this.props[8] = i;
+    this.props[9] = j;
+    this.props[10] = k;
+    this.props[11] = l;
+    this.props[12] = m;
+    this.props[13] = n;
+    this.props[14] = o;
+    this.props[15] = p;
+    return this;
+  }
+
+  function translate(tx, ty, tz) {
+    tz = tz || 0;
+    if (tx !== 0 || ty !== 0 || tz !== 0) {
+      return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
+    }
+    return this;
+  }
+
+  function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
+    var _p = this.props;
+
+    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) {
+      // NOTE: commenting this condition because TurboFan deoptimizes code when present
+      // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+      _p[12] = _p[12] * a2 + _p[15] * m2;
+      _p[13] = _p[13] * f2 + _p[15] * n2;
+      _p[14] = _p[14] * k2 + _p[15] * o2;
+      _p[15] *= p2;
+      // }
+      this._identityCalculated = false;
+      return this;
     }
 
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
+    var a1 = _p[0];
+    var b1 = _p[1];
+    var c1 = _p[2];
+    var d1 = _p[3];
+    var e1 = _p[4];
+    var f1 = _p[5];
+    var g1 = _p[6];
+    var h1 = _p[7];
+    var i1 = _p[8];
+    var j1 = _p[9];
+    var k1 = _p[10];
+    var l1 = _p[11];
+    var m1 = _p[12];
+    var n1 = _p[13];
+    var o1 = _p[14];
+    var p1 = _p[15];
 
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(_tan(ax), _tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        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);
-    }
-
-    function scale(sx, sy, sz) {
-        if(!sz && sz !== 0) {
-            sz = 1;
-        }
-        if(sx === 1 && sy === 1 && sz === 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        var _p = this.props;
-
-        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){
-            //NOTE: commenting this condition because TurboFan deoptimizes code when present
-            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-                _p[12] = _p[12] * a2 + _p[15] * m2;
-                _p[13] = _p[13] * f2 + _p[15] * n2;
-                _p[14] = _p[14] * k2 + _p[15] * o2;
-                _p[15] = _p[15] * p2;
-            //}
-            this._identityCalculated = false;
-            return this;
-        }
-
-        var a1 = _p[0];
-        var b1 = _p[1];
-        var c1 = _p[2];
-        var d1 = _p[3];
-        var e1 = _p[4];
-        var f1 = _p[5];
-        var g1 = _p[6];
-        var h1 = _p[7];
-        var i1 = _p[8];
-        var j1 = _p[9];
-        var k1 = _p[10];
-        var l1 = _p[11];
-        var m1 = _p[12];
-        var n1 = _p[13];
-        var o1 = _p[14];
-        var p1 = _p[15];
-
-        /* matrix order (canvas compatible):
+    /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+    _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+    _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
+    _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
+    _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
 
-        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+    _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
+    _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
+    _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
+    _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
 
-        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+    _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
+    _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
+    _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
+    _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
 
-        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+    _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
+    _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
+    _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
+    _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
 
-        this._identityCalculated = false;
-        return this;
+    this._identityCalculated = false;
+    return this;
+  }
+
+  function isIdentity() {
+    if (!this._identityCalculated) {
+      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);
+      this._identityCalculated = true;
     }
+    return this._identity;
+  }
 
-    function isIdentity() {
-        if(!this._identityCalculated){
-            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);
-            this._identityCalculated = true;
-        }
-        return this._identity;
+  function equals(matr) {
+    var i = 0;
+    while (i < 16) {
+      if (matr.props[i] !== this.props[i]) {
+        return false;
+      }
+      i += 1;
     }
+    return true;
+  }
 
-    function equals(matr){
-        var i = 0;
-        while (i < 16) {
-            if(matr.props[i] !== this.props[i]) {
-                return false;
-            }
-            i+=1;
-        }
-        return true;
+  function clone(matr) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      matr.props[i] = this.props[i];
     }
+    return matr;
+  }
 
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-        return matr;
+  function cloneFromProps(props) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      this.props[i] = props[i];
     }
+  }
 
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
+  function applyToPoint(x, y, z) {
+    return {
+      x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
+      y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
+      z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14],
+    };
+    /* return {
          x: x * me.a + y * me.c + me.e,
          y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
+         }; */
+  }
+  function applyToX(x, y, z) {
+    return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
+  }
+  function applyToY(x, y, z) {
+    return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
+  }
+  function applyToZ(x, y, z) {
+    return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
+  }
 
-    function getInverseMatrix() {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        var inverseMatrix = new Matrix();
-        inverseMatrix.props[0] = a;
-        inverseMatrix.props[1] = b;
-        inverseMatrix.props[4] = c;
-        inverseMatrix.props[5] = d;
-        inverseMatrix.props[12] = e;
-        inverseMatrix.props[13] = f;
-        return inverseMatrix;
-    }
+  function getInverseMatrix() {
+    var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
+    var a = this.props[5] / determinant;
+    var b = -this.props[1] / determinant;
+    var c = -this.props[4] / determinant;
+    var d = this.props[0] / determinant;
+    var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
+    var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
+    var inverseMatrix = new Matrix();
+    inverseMatrix.props[0] = a;
+    inverseMatrix.props[1] = b;
+    inverseMatrix.props[4] = c;
+    inverseMatrix.props[5] = d;
+    inverseMatrix.props[12] = e;
+    inverseMatrix.props[13] = f;
+    return inverseMatrix;
+  }
 
-    function inversePoint(pt) {
-        var inverseMatrix = this.getInverseMatrix();
-        return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
-    }
+  function inversePoint(pt) {
+    var inverseMatrix = this.getInverseMatrix();
+    return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
+  }
 
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
+  function inversePoints(pts) {
+    var i;
+    var len = pts.length;
+    var retPts = [];
+    for (i = 0; i < len; i += 1) {
+      retPts[i] = inversePoint(pts[i]);
     }
+    return retPts;
+  }
 
-    function applyToTriplePoints(pt1, pt2, pt3) {
-        var arr = createTypedArray('float32', 6);
-        if(this.isIdentity()) {
-            arr[0] = pt1[0];
-            arr[1] = pt1[1];
-            arr[2] = pt2[0];
-            arr[3] = pt2[1];
-            arr[4] = pt3[0];
-            arr[5] = pt3[1];
-        } else {
-            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
-            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
-            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
-            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
-            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
-            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
-            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
-        }
-        return arr;
+  function applyToTriplePoints(pt1, pt2, pt3) {
+    var arr = createTypedArray('float32', 6);
+    if (this.isIdentity()) {
+      arr[0] = pt1[0];
+      arr[1] = pt1[1];
+      arr[2] = pt2[0];
+      arr[3] = pt2[1];
+      arr[4] = pt3[0];
+      arr[5] = pt3[1];
+    } else {
+      var p0 = this.props[0];
+      var p1 = this.props[1];
+      var p4 = this.props[4];
+      var p5 = this.props[5];
+      var p12 = this.props[12];
+      var p13 = this.props[13];
+      arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+      arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+      arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+      arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+      arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+      arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
     }
+    return arr;
+  }
 
-    function applyToPointArray(x,y,z){
-        var arr;
-        if(this.isIdentity()) {
-            arr = [x,y,z];
-        } else {
-            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]
-            ];
-        }
-        return arr;
+  function applyToPointArray(x, y, z) {
+    var arr;
+    if (this.isIdentity()) {
+      arr = [x, y, z];
+    } else {
+      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],
+      ];
     }
+    return arr;
+  }
 
-    function applyToPointStringified(x, y) {
-        if(this.isIdentity()) {
-            return x + ',' + y;
-        }
-        var _p = this.props;
-        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;
+  function applyToPointStringified(x, y) {
+    if (this.isIdentity()) {
+      return x + ',' + y;
     }
+    var _p = this.props;
+    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;
+  }
 
-    function toCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function toCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var i = 0;
-        var props = this.props;
-        var cssValue = 'matrix3d(';
-        var v = 10000;
-        while(i<16){
-            cssValue += _rnd(props[i]*v)/v;
-            cssValue += i === 15 ? ')':',';
-            i += 1;
-        }
-        return cssValue;
+        } */
+    var i = 0;
+    var props = this.props;
+    var cssValue = 'matrix3d(';
+    var v = 10000;
+    while (i < 16) {
+      cssValue += _rnd(props[i] * v) / v;
+      cssValue += i === 15 ? ')' : ',';
+      i += 1;
     }
+    return cssValue;
+  }
 
-    function roundMatrixProperty(val) {
-        var v = 10000;
-        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
-            return _rnd(val * v) / v;
-        }
-        return val;
+  function roundMatrixProperty(val) {
+    var v = 10000;
+    if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+      return _rnd(val * v) / v;
     }
+    return val;
+  }
 
-    function to2dCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function to2dCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var props = this.props;
-        var _a = roundMatrixProperty(props[0]);
-        var _b = roundMatrixProperty(props[1]);
-        var _c = roundMatrixProperty(props[4]);
-        var _d = roundMatrixProperty(props[5]);
-        var _e = roundMatrixProperty(props[12]);
-        var _f = roundMatrixProperty(props[13]);
-        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
-    }
+        } */
+    var props = this.props;
+    var _a = roundMatrixProperty(props[0]);
+    var _b = roundMatrixProperty(props[1]);
+    var _c = roundMatrixProperty(props[4]);
+    var _d = roundMatrixProperty(props[5]);
+    var _e = roundMatrixProperty(props[12]);
+    var _f = roundMatrixProperty(props[13]);
+    return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
+  }
 
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToTriplePoints = applyToTriplePoints;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.equals = equals;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this.getInverseMatrix = getInverseMatrix;
-        this._t = this.transform;
-        this.isIdentity = isIdentity;
-        this._identity = true;
-        this._identityCalculated = false;
+  return function () {
+    this.reset = reset;
+    this.rotate = rotate;
+    this.rotateX = rotateX;
+    this.rotateY = rotateY;
+    this.rotateZ = rotateZ;
+    this.skew = skew;
+    this.skewFromAxis = skewFromAxis;
+    this.shear = shear;
+    this.scale = scale;
+    this.setTransform = setTransform;
+    this.translate = translate;
+    this.transform = transform;
+    this.applyToPoint = applyToPoint;
+    this.applyToX = applyToX;
+    this.applyToY = applyToY;
+    this.applyToZ = applyToZ;
+    this.applyToPointArray = applyToPointArray;
+    this.applyToTriplePoints = applyToTriplePoints;
+    this.applyToPointStringified = applyToPointStringified;
+    this.toCSS = toCSS;
+    this.to2dCSS = to2dCSS;
+    this.clone = clone;
+    this.cloneFromProps = cloneFromProps;
+    this.equals = equals;
+    this.inversePoints = inversePoints;
+    this.inversePoint = inversePoint;
+    this.getInverseMatrix = getInverseMatrix;
+    this._t = this.transform;
+    this.isIdentity = isIdentity;
+    this._identity = true;
+    this._identityCalculated = false;
 
-        this.props = createTypedArray('float32', 16);
-        this.reset();
-    };
+    this.props = createTypedArray('float32', 16);
+    this.reset();
+  };
 }());
 
+/* eslint-disable */
 /*
  Copyright 2014 David Bau.
 
@@ -1018,8 +1066,9 @@
     [],     // pool: entropy pool starts empty
     BMMath    // math: package containing random, pow, and seedrandom
 );
-var BezierFactory = (function(){
-    /**
+/* eslint-disable */
+var BezierFactory = (function () {
+  /**
      * BezierEasing - use bezier curve for transition easing function
      * by Gaëtan Renaudeau 2014 - 2015 – MIT License
      *
@@ -1030,7445 +1079,7896 @@
      *
      */
 
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
+  var ob = {};
+  ob.getBezierEasing = getBezierEasing;
+  var beziers = {};
 
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
+  function getBezierEasing(a, b, c, d, nm) {
+    var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
+    if (beziers[str]) {
+      return beziers[str];
     }
+    var bezEasing = new BezierEasing([a, b, c, d]);
+    beziers[str] = bezEasing;
+    return bezEasing;
+  }
 
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
+  // These values are established by empiricism with tests (tradeoff: performance VS precision)
+  var NEWTON_ITERATIONS = 4;
+  var NEWTON_MIN_SLOPE = 0.001;
+  var SUBDIVISION_PRECISION = 0.0000001;
+  var SUBDIVISION_MAX_ITERATIONS = 10;
 
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+  var kSplineTableSize = 11;
+  var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
 
-    var float32ArraySupported = typeof Float32Array === "function";
+  var float32ArraySupported = typeof Float32Array === 'function';
 
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
+  function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+  function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+  function C(aA1) { return 3.0 * aA1; }
 
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
+  // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+  function calcBezier(aT, aA1, aA2) {
+    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
+  }
+
+  // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+  function getSlope(aT, aA1, aA2) {
+    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
+  }
+
+  function binarySubdivide(aX, aA, aB, mX1, mX2) {
+    var currentX,
+      currentT,
+      i = 0;
+    do {
+      currentT = aA + (aB - aA) / 2.0;
+      currentX = calcBezier(currentT, mX1, mX2) - aX;
+      if (currentX > 0.0) {
+        aB = currentT;
+      } else {
+        aA = currentT;
+      }
+    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+    return currentT;
+  }
+
+  function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
+    for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+      var currentSlope = getSlope(aGuessT, mX1, mX2);
+      if (currentSlope === 0.0) return aGuessT;
+      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+      aGuessT -= currentX / currentSlope;
     }
+    return aGuessT;
+  }
 
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
+  /**
      * points is an array of [ mX1, mY1, mX2, mY2 ]
      */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
+  function BezierEasing(points) {
+    this._p = points;
+    this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+    this._precomputed = false;
 
-        this.get = this.get.bind(this);
-    }
+    this.get = this.get.bind(this);
+  }
 
-    BezierEasing.prototype = {
+  BezierEasing.prototype = {
 
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
+    get: function (x) {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      if (!this._precomputed) this._precompute();
+      if (mX1 === mY1 && mX2 === mY2) return x; // linear
+      // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+      if (x === 0) return 0;
+      if (x === 1) return 1;
+      return calcBezier(this._getTForX(x), mY1, mY2);
+    },
 
-        // Private part
+    // Private part
 
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
+    _precompute: function () {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      this._precomputed = true;
+      if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); }
+    },
 
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
+    _calcSampleValues: function () {
+      var mX1 = this._p[0],
+        mX2 = this._p[2];
+      for (var i = 0; i < kSplineTableSize; ++i) {
+        this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+      }
+    },
 
-        /**
+    /**
          * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
          */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
+    _getTForX: function (aX) {
+      var mX1 = this._p[0],
+        mX2 = this._p[2],
+        mSampleValues = this._mSampleValues;
 
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
+      var intervalStart = 0.0;
+      var currentSample = 1;
+      var lastSample = kSplineTableSize - 1;
 
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
+      for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
+        intervalStart += kSampleStepSize;
+      }
+      --currentSample;
 
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
+      // Interpolate to provide an initial guess for t
+      var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
+      var guessForT = intervalStart + dist * kSampleStepSize;
 
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
+      var initialSlope = getSlope(guessForT, mX1, mX2);
+      if (initialSlope >= NEWTON_MIN_SLOPE) {
+        return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+      } if (initialSlope === 0.0) {
+        return guessForT;
+      }
+      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+    },
+  };
 
-    return ob;
-
+  return ob;
 }());
+
 (function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
+  var lastTime = 0;
+  var vendors = ['ms', 'moz', 'webkit', 'o'];
+  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { // eslint-disable-line no-plusplus
+    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
+    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
+  }
+  if (!window.requestAnimationFrame) {
+    window.requestAnimationFrame = function (callback) {
+      var currTime = new Date().getTime();
+      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+      var id = setTimeout(function () {
+        callback(currTime + timeToCall);
+      },
+      timeToCall);
+      lastTime = currTime + timeToCall;
+      return id;
+    };
+  }
+  if (!window.cancelAnimationFrame) {
+    window.cancelAnimationFrame = function (id) {
+      clearTimeout(id);
+    };
+  }
 }());
 
-function extendPrototype(sources,destination){
-    var i, len = sources.length, sourcePrototype;
-    for (i = 0;i < len;i += 1) {
-        sourcePrototype = sources[i].prototype;
-        for (var attr in sourcePrototype) {
-            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
-        }
+/* exported extendPrototype, getDescriptor, createProxyFunction */
+
+function extendPrototype(sources, destination) {
+  var i;
+  var len = sources.length;
+  var sourcePrototype;
+  for (i = 0; i < len; i += 1) {
+    sourcePrototype = sources[i].prototype;
+    for (var attr in sourcePrototype) {
+      if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
     }
+  }
 }
 
 function getDescriptor(object, prop) {
-    return Object.getOwnPropertyDescriptor(object, prop);
+  return Object.getOwnPropertyDescriptor(object, prop);
 }
 
 function createProxyFunction(prototype) {
-	function ProxyFunction(){}
-	ProxyFunction.prototype = prototype;
-	return ProxyFunction;
+  function ProxyFunction() {}
+  ProxyFunction.prototype = prototype;
+  return ProxyFunction;
 }
-function bezFunction(){
 
-    var easingFunctions = [];
-    var math = Math;
+/* global segmentsLengthPool, defaultCurveSegments, createSizedArray, bmPow, bmSqrt, bmFloor, createTypedArray, bezierLengthPool */
+/* exported bez */
 
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.001 && det1 < 0.001;
+function bezFunction() {
+  var math = Math;
+
+  function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
+    var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1);
+    return det1 > -0.001 && det1 < 0.001;
+  }
+
+  function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
+    if (z1 === 0 && z2 === 0 && z3 === 0) {
+      return pointOnLine2D(x1, y1, x2, y2, x3, y3);
     }
+    var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
+    var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
+    var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
+    var diffDist;
+    if (dist1 > dist2) {
+      if (dist1 > dist3) {
+        diffDist = dist1 - dist2 - dist3;
+      } else {
+        diffDist = dist3 - dist2 - dist1;
+      }
+    } else if (dist3 > dist2) {
+      diffDist = dist3 - dist2 - dist1;
+    } else {
+      diffDist = dist2 - dist1 - dist3;
+    }
+    return diffDist > -0.0001 && diffDist < 0.0001;
+  }
 
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        if(z1 === 0 && z2 === 0 && z3 === 0) {
-            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+  var getBezierLength = (function () {
+    return function (pt1, pt2, pt3, pt4) {
+      var curveSegments = defaultCurveSegments;
+      var k;
+      var i;
+      var len;
+      var ptCoord;
+      var perc;
+      var addedLength = 0;
+      var ptDistance;
+      var point = [];
+      var lastPoint = [];
+      var lengthData = bezierLengthPool.newElement();
+      len = pt3.length;
+      for (k = 0; k < curveSegments; k += 1) {
+        perc = k / (curveSegments - 1);
+        ptDistance = 0;
+        for (i = 0; i < len; i += 1) {
+          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];
+          point[i] = ptCoord;
+          if (lastPoint[i] !== null) {
+            ptDistance += bmPow(point[i] - lastPoint[i], 2);
+          }
+          lastPoint[i] = point[i];
         }
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
+        if (ptDistance) {
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
         }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    var getBezierLength = (function(){
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = bezier_length_pool.newElement();
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.percents[k] = perc;
-                lengthData.lengths[k] = addedLength;
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function getSegmentsLength(shapeData) {
-        var segmentsLength = segments_length_pool.newElement();
-        var closed = shapeData.c;
-        var pathV = shapeData.v;
-        var pathO = shapeData.o;
-        var pathI = shapeData.i;
-        var i, len = shapeData._length;
-        var lengths = segmentsLength.lengths;
-        var totalLength = 0;
-        for(i=0;i<len-1;i+=1){
-            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-            totalLength += lengths[i].addedLength;
-        }
-        if(closed && len){
-            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-            totalLength += lengths[i].addedLength;
-        }
-        segmentsLength.totalLength = totalLength;
-        return segmentsLength;
-    }
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (pt1, pt2, pt3, pt4){
-            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
-            if(!storedData[bezierName]){
-                var curveSegments = defaultCurveSegments;
-                var k, i, len;
-                var ptCoord,perc,addedLength = 0;
-                var ptDistance;
-                var point,lastPoint = null;
-                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])){
-                    curveSegments = 2;
-                }
-                var bezierData = new BezierData(curveSegments);
-                len = pt3.length;
-                for (k = 0; k < curveSegments; k += 1) {
-                    point = createSizedArray(len);
-                    perc = k / (curveSegments - 1);
-                    ptDistance = 0;
-                    for (i = 0; i < len; i += 1){
-                        ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                        point[i] = ptCoord;
-                        if(lastPoint !== null){
-                            ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                        }
-                    }
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                    bezierData.points[k] = new PointData(ptDistance, point);
-                    lastPoint = point;
-                }
-                bezierData.segmentLength = addedLength;
-                storedData[bezierName] = bezierData;
-            }
-            return storedData[bezierName];
-        };
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var percents = bezierData.percents;
-        var lengths = bezierData.lengths;
-        var len = percents.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
-            return percents[initPos];
-        }else{
-            var dir = lengths[initPos] > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
-                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    //FIX for TypedArrays that don't store floating point values with enough accuracy
-                    if(initPos === len - 1) {
-                        return percents[initPos];
-                    }
-                    flag = false;
-                }
-            }
-            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
-        }
-    }
-
-    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
-        var t1 = getDistancePerc(percent,bezierData);
-        var u0 = 1;
-        var u1 = 1 - t1;
-        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;
-        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;
-        return [ptX, ptY];
-    }
-
-    function getSegmentArray() {
-
-    }
-
-    var bezier_segment_points = createTypedArray('float32', 8);
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        var u0u0u0 = u0*u0*u0;
-        var t0u0u0_3 = t0*u0*u0*3;
-        var t0t0u0_3 = t0*t0*u0*3;
-        var t0t0t0 = t0*t0*t0;
-        //
-        var u0u0u1 = u0*u0*u1;
-        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
-        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
-        var t0t0t1 = t0*t0*t1;
-        //
-        var u0u1u1 = u0*u1*u1;
-        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
-        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
-        var t0t1t1 = t0*t1*t1;
-        //
-        var u1u1u1 = u1*u1*u1;
-        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
-        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
-        var t1t1t1 = t1*t1*t1;
-        for(i=0;i<len;i+=1){
-            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
-        }
-
-        return bezier_segment_points;
-    }
-
-    return {
-        getSegmentsLength : getSegmentsLength,
-        getNewSegment : getNewSegment,
-        getPointInSegment : getPointInSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
+        lengthData.percents[k] = perc;
+        lengthData.lengths[k] = addedLength;
+      }
+      lengthData.addedLength = addedLength;
+      return lengthData;
     };
+  }());
+
+  function getSegmentsLength(shapeData) {
+    var segmentsLength = segmentsLengthPool.newElement();
+    var closed = shapeData.c;
+    var pathV = shapeData.v;
+    var pathO = shapeData.o;
+    var pathI = shapeData.i;
+    var i;
+    var len = shapeData._length;
+    var lengths = segmentsLength.lengths;
+    var totalLength = 0;
+    for (i = 0; i < len - 1; i += 1) {
+      lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
+      totalLength += lengths[i].addedLength;
+    }
+    if (closed && len) {
+      lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
+      totalLength += lengths[i].addedLength;
+    }
+    segmentsLength.totalLength = totalLength;
+    return segmentsLength;
+  }
+
+  function BezierData(length) {
+    this.segmentLength = 0;
+    this.points = new Array(length);
+  }
+
+  function PointData(partial, point) {
+    this.partialLength = partial;
+    this.point = point;
+  }
+
+  var buildBezierData = (function () {
+    var storedData = {};
+
+    return function (pt1, pt2, pt3, pt4) {
+      var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
+      if (!storedData[bezierName]) {
+        var curveSegments = defaultCurveSegments;
+        var k;
+        var i;
+        var len;
+        var ptCoord;
+        var perc;
+        var addedLength = 0;
+        var ptDistance;
+        var point;
+        var lastPoint = null;
+        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])) {
+          curveSegments = 2;
+        }
+        var bezierData = new BezierData(curveSegments);
+        len = pt3.length;
+        for (k = 0; k < curveSegments; k += 1) {
+          point = createSizedArray(len);
+          perc = k / (curveSegments - 1);
+          ptDistance = 0;
+          for (i = 0; i < len; i += 1) {
+            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];
+            point[i] = ptCoord;
+            if (lastPoint !== null) {
+              ptDistance += bmPow(point[i] - lastPoint[i], 2);
+            }
+          }
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
+          bezierData.points[k] = new PointData(ptDistance, point);
+          lastPoint = point;
+        }
+        bezierData.segmentLength = addedLength;
+        storedData[bezierName] = bezierData;
+      }
+      return storedData[bezierName];
+    };
+  }());
+
+  function getDistancePerc(perc, bezierData) {
+    var percents = bezierData.percents;
+    var lengths = bezierData.lengths;
+    var len = percents.length;
+    var initPos = bmFloor((len - 1) * perc);
+    var lengthPos = perc * bezierData.addedLength;
+    var lPerc = 0;
+    if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
+      return percents[initPos];
+    }
+    var dir = lengths[initPos] > lengthPos ? -1 : 1;
+    var flag = true;
+    while (flag) {
+      if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
+        lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
+        flag = false;
+      } else {
+        initPos += dir;
+      }
+      if (initPos < 0 || initPos >= len - 1) {
+        // FIX for TypedArrays that don't store floating point values with enough accuracy
+        if (initPos === len - 1) {
+          return percents[initPos];
+        }
+        flag = false;
+      }
+    }
+    return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
+  }
+
+  function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+    var t1 = getDistancePerc(percent, bezierData);
+    var u1 = 1 - t1;
+    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;
+    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;
+    return [ptX, ptY];
+  }
+
+  var bezierSegmentPoints = createTypedArray('float32', 8);
+
+  function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
+    if (startPerc < 0) {
+      startPerc = 0;
+    } else if (startPerc > 1) {
+      startPerc = 1;
+    }
+    var t0 = getDistancePerc(startPerc, bezierData);
+    endPerc = endPerc > 1 ? 1 : endPerc;
+    var t1 = getDistancePerc(endPerc, bezierData);
+    var i;
+    var len = pt1.length;
+    var u0 = 1 - t0;
+    var u1 = 1 - t1;
+    var u0u0u0 = u0 * u0 * u0;
+    var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0t0 = t0 * t0 * t0;
+    //
+    var u0u0u1 = u0 * u0 * u1;
+    var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0t1 = t0 * t0 * t1;
+    //
+    var u0u1u1 = u0 * u1 * u1;
+    var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1t1 = t0 * t1 * t1;
+    //
+    var u1u1u1 = u1 * u1 * u1;
+    var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1t1 = t1 * t1 * t1;
+    for (i = 0; i < len; i += 1) {
+      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
+      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
+      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
+      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
+    }
+
+    return bezierSegmentPoints;
+  }
+
+  return {
+    getSegmentsLength: getSegmentsLength,
+    getNewSegment: getNewSegment,
+    getPointInSegment: getPointInSegment,
+    buildBezierData: buildBezierData,
+    pointOnLine2D: pointOnLine2D,
+    pointOnLine3D: pointOnLine3D,
+  };
 }
 
 var bez = bezFunction();
-function dataFunctionManager(){
 
-    //var tCanvasHelper = createTag('canvas').getContext('2d');
+/* exported dataManager */
 
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
+function dataFunctionManager() {
+  // var tCanvasHelper = createTag('canvas').getContext('2d');
+
+  function completeLayers(layers, comps, fontManager) {
+    var layerData;
+    var i;
+    var len = layers.length;
+    var j;
+    var jLen;
+    var k;
+    var kLen;
+    for (i = 0; i < len; i += 1) {
+      layerData = layers[i];
+      if (('ks' in layerData) && !layerData.completed) {
+        layerData.completed = true;
+        if (layerData.tt) {
+          layers[i - 1].td = layerData.tt;
         }
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              convertPathsToAbsoluteValues(maskProps[j].pt.k);
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
+                }
+              }
+            }
+          }
+        }
+        if (layerData.ty === 0) {
+          layerData.layers = findCompLayers(layerData.refId, comps);
+          completeLayers(layerData.layers, comps, fontManager);
+        } else if (layerData.ty === 4) {
+          completeShapes(layerData.shapes);
+        } else if (layerData.ty === 5) {
+          completeText(layerData, fontManager);
+        }
+      }
+    }
+  }
+
+  function findCompLayers(id, comps) {
+    var i = 0;
+    var len = comps.length;
+    while (i < len) {
+      if (comps[i].id === id) {
+        if (!comps[i].layers.__used) {
+          comps[i].layers.__used = true;
+          return comps[i].layers;
+        }
+        return JSON.parse(JSON.stringify(comps[i].layers));
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function completeShapes(arr) {
+    var i;
+    var len = arr.length;
+    var j;
+    var jLen;
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (arr[i].ty === 'sh') {
+        if (arr[i].ks.k.i) {
+          convertPathsToAbsoluteValues(arr[i].ks.k);
+        } else {
+          jLen = arr[i].ks.k.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (arr[i].ks.k[j].s) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
+            }
+            if (arr[i].ks.k[j].e) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
+            }
+          }
+        }
+      } else if (arr[i].ty === 'gr') {
+        completeShapes(arr[i].it);
+      }
+    }
+  }
+
+  function convertPathsToAbsoluteValues(path) {
+    var i;
+    var len = path.i.length;
+    for (i = 0; i < len; i += 1) {
+      path.i[i][0] += path.v[i][0];
+      path.i[i][1] += path.v[i][1];
+      path.o[i][0] += path.v[i][0];
+      path.o[i][1] += path.v[i][1];
+    }
+  }
+
+  function checkVersion(minimum, animVersionString) {
+    var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
+    if (minimum[0] > animVersion[0]) {
+      return true;
+    } if (animVersion[0] > minimum[0]) {
+      return false;
+    }
+    if (minimum[1] > animVersion[1]) {
+      return true;
+    } if (animVersion[1] > minimum[1]) {
+      return false;
+    }
+    if (minimum[2] > animVersion[2]) {
+      return true;
+    } if (animVersion[2] > minimum[2]) {
+      return false;
+    }
+    return null;
+  }
+
+  var checkText = (function () {
+    var minimumVersion = [4, 4, 14];
+
+    function updateTextLayer(textLayer) {
+      var documentData = textLayer.t.d;
+      textLayer.t.d = {
+        k: [
+          {
+            s: documentData,
+            t: 0,
+          },
+        ],
+      };
     }
 
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                if(!comps[i].layers.__used) {
-                    comps[i].layers.__used = true;
-                    return comps[i].layers;
-                }
-                return JSON.parse(JSON.stringify(comps[i].layers));
-            }
-            i += 1;
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 5) {
+          updateTextLayer(layers[i]);
         }
+      }
     }
 
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
             }
+          }
         }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
+      }
+    };
+  }());
+
+  var checkChars = (function () {
+    var minimumVersion = [4, 7, 99];
+    return function (animationData) {
+      if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
+        var i;
+        var len = animationData.chars.length;
+        var j;
+        var jLen;
+        var pathData;
+        var paths;
+        for (i = 0; i < len; i += 1) {
+          if (animationData.chars[i].data && animationData.chars[i].data.shapes) {
+            paths = animationData.chars[i].data.shapes[0].it;
+            jLen = paths.length;
+
+            for (j = 0; j < jLen; j += 1) {
+              pathData = paths[j].ks.k;
+              if (!pathData.__converted) {
+                convertPathsToAbsoluteValues(paths[j].ks.k);
+                pathData.__converted = true;
+              }
+            }
+          }
+        }
+      }
+    };
+  }());
+
+  var checkColors = (function () {
+    var minimumVersion = [4, 1, 9];
+
+    function iterateShapes(shapes) {
+      var i;
+      var len = shapes.length;
+      var j;
+      var jLen;
+      for (i = 0; i < len; i += 1) {
+        if (shapes[i].ty === 'gr') {
+          iterateShapes(shapes[i].it);
+        } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
+          if (shapes[i].c.k && shapes[i].c.k[0].i) {
+            jLen = shapes[i].c.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (shapes[i].c.k[j].s) {
+                shapes[i].c.k[j].s[0] /= 255;
+                shapes[i].c.k[j].s[1] /= 255;
+                shapes[i].c.k[j].s[2] /= 255;
+                shapes[i].c.k[j].s[3] /= 255;
+              }
+              if (shapes[i].c.k[j].e) {
+                shapes[i].c.k[j].e[0] /= 255;
+                shapes[i].c.k[j].e[1] /= 255;
+                shapes[i].c.k[j].e[2] /= 255;
+                shapes[i].c.k[j].e[3] /= 255;
+              }
+            }
+          } else {
+            shapes[i].c.k[0] /= 255;
+            shapes[i].c.k[1] /= 255;
+            shapes[i].c.k[2] /= 255;
+            shapes[i].c.k[3] /= 255;
+          }
+        }
+      }
     }
 
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 4) {
+          iterateShapes(layers[i].shapes);
         }
+      }
     }
 
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
+      }
+    };
+  }());
+
+  var checkShapes = (function () {
+    var minimumVersion = [4, 4, 18];
+
+    function completeClosingShapes(arr) {
+      var i;
+      var len = arr.length;
+      var j;
+      var jLen;
+      for (i = len - 1; i >= 0; i -= 1) {
+        if (arr[i].ty === 'sh') {
+          if (arr[i].ks.k.i) {
+            arr[i].ks.k.c = arr[i].closed;
+          } else {
+            jLen = arr[i].ks.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (arr[i].ks.k[j].s) {
+                arr[i].ks.k[j].s[0].c = arr[i].closed;
+              }
+              if (arr[i].ks.k[j].e) {
+                arr[i].ks.k[j].e[0].c = arr[i].closed;
+              }
+            }
+          }
+        } else if (arr[i].ty === 'gr') {
+          completeClosingShapes(arr[i].it);
         }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
+      }
     }
 
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            };
+    function iterateLayers(layers) {
+      var layerData;
+      var i;
+      var len = layers.length;
+      var j;
+      var jLen;
+      var k;
+      var kLen;
+      for (i = 0; i < len; i += 1) {
+        layerData = layers[i];
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              maskProps[j].pt.k.c = maskProps[j].cl;
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
+                }
+              }
+            }
+          }
         }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
+        if (layerData.ty === 4) {
+          completeClosingShapes(layerData.shapes);
         }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkChars = (function() {
-        var minimumVersion = [4,7,99];
-        return function (animationData){
-            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
-                var i, len = animationData.chars.length, j, jLen, k, kLen;
-                var pathData, paths;
-                for(i = 0; i < len; i += 1) {
-                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
-                        paths = animationData.chars[i].data.shapes[0].it;
-                        jLen = paths.length;
-
-                        for(j = 0; j < jLen; j += 1) {
-                            pathData = paths[j].ks.k;
-                            if(!pathData.__converted) {
-                                convertPathsToAbsoluteValues(paths[j].ks.k);
-                                pathData.__converted = true;
-                            }
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkChars(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
+      }
     }
 
-    function completeText(data, fontManager){
-        if(data.t.a.length === 0 && !('m' in data.t.p)){
-            data.singleShape = true;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
+      }
+    };
+  }());
+
+  function completeData(animationData, fontManager) {
+    if (animationData.__complete) {
+      return;
     }
+    checkColors(animationData);
+    checkText(animationData);
+    checkChars(animationData);
+    checkShapes(animationData);
+    completeLayers(animationData.layers, animationData.assets, fontManager);
+    animationData.__complete = true;
+  }
 
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-    moduleOb.checkColors = checkColors;
-    moduleOb.checkChars = checkChars;
-    moduleOb.checkShapes = checkShapes;
-    moduleOb.completeLayers = completeLayers;
+  function completeText(data) {
+    if (data.t.a.length === 0 && !('m' in data.t.p)) {
+      data.singleShape = true;
+    }
+  }
 
-    return moduleOb;
+  var moduleOb = {};
+  moduleOb.completeData = completeData;
+  moduleOb.checkColors = checkColors;
+  moduleOb.checkChars = checkChars;
+  moduleOb.checkShapes = checkShapes;
+  moduleOb.completeLayers = completeLayers;
+
+  return moduleOb;
 }
 
 var dataManager = dataFunctionManager();
 
-var FontManager = (function(){
+/* exported getFontProperties */
 
-    var maxWaitingTime = 5000;
-    var emptyChar = {
-        w: 0,
-        size:0,
-        shapes:[]
-    };
-    var combinedCharacters = [];
-    //Hindi characters
-    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]);
+function getFontProperties(fontData) {
+  var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
 
-    function trimFontOptions(font) {
-        var familyArray = font.split(',');
-        var i, len = familyArray.length;
-        var enabledFamilies = [];
-        for (i = 0; i < len; i += 1) {
-            if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
-                enabledFamilies.push(familyArray[i]);
-            }
-        }
-        return enabledFamilies.join(',');
+  var fWeight = 'normal'; var
+    fStyle = 'normal';
+  var len = styles.length;
+  var styleName;
+  for (var i = 0; i < len; i += 1) {
+    styleName = styles[i].toLowerCase();
+    switch (styleName) {
+      case 'italic':
+        fStyle = 'italic';
+        break;
+      case 'bold':
+        fWeight = '700';
+        break;
+      case 'black':
+        fWeight = '900';
+        break;
+      case 'medium':
+        fWeight = '500';
+        break;
+      case 'regular':
+      case 'normal':
+        fWeight = '400';
+        break;
+      case 'light':
+      case 'thin':
+        fWeight = '200';
+        break;
+      default:
+        break;
     }
+  }
 
-    function setUpNode(font, family){
-        var parentNode = createTag('span');
-        parentNode.style.fontFamily    = family;
-        var node = createTag('span');
-        // Characters that vary significantly among different fonts
-        node.innerText = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = trimFontOptions(font) + ', ' + family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(this.checkLoadedFontsBinded, 20);
-        }else{
-            setTimeout(this.setIsLoadedBinded, 10);
-
-        }
-    }
-
-    function createHelper(def, fontData){
-        var tHelper = createNS('text');
-        tHelper.style.fontSize = '100px';
-        //tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.setAttribute('font-family', fontData.fFamily);
-        tHelper.setAttribute('font-style', fontData.fStyle);
-        tHelper.setAttribute('font-weight', fontData.fWeight);
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.setAttribute('class', fontData.fClass);
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = createTag('canvas').getContext('2d');
-        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
-        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.isLoaded = true;
-            return;
-        }
-        if(this.chars){
-            this.isLoaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        var _pendingFonts = len;
-        for(i=0; i<len; i+= 1){
-            var shouldLoadFont = true;
-            var loadedSelector;
-            var j;
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-                _pendingFonts -= 1;
-            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
-                loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
-
-                if (loadedSelector.length > 0) {
-                    shouldLoadFont = false;
-                }
-
-                if (shouldLoadFont) {
-                    var s = createTag('style');
-                    s.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    s.setAttribute('f-origin', fontArr[i].origin);
-                    s.setAttribute('f-family', fontArr[i].fFamily);
-                    s.type = "text/css";
-                    s.innerText = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                    defs.appendChild(s);
-                }
-            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
-                loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var l = createTag('link');
-                    l.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    l.setAttribute('f-origin', fontArr[i].origin);
-                    l.type = "text/css";
-                    l.rel = "stylesheet";
-                    l.href = fontArr[i].fPath;
-                    document.body.appendChild(l);
-                }
-            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
-                loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (fontArr[i].fPath === loadedSelector[j].src) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var sc = createTag('link');
-                    sc.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    sc.setAttribute('f-origin', fontArr[i].origin);
-                    sc.setAttribute('rel','stylesheet');
-                    sc.setAttribute('href',fontArr[i].fPath);
-                    defs.appendChild(sc);
-                }
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            fontArr[i].cache = {};
-            this.fonts.push(fontArr[i]);
-        }
-        if (_pendingFonts === 0) {
-            this.isLoaded = true;
-        } else {
-            //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
-            //Adding this timeout seems to fix it
-           setTimeout(this.checkLoadedFonts.bind(this), 100);
-        }
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-        if ((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char)
-            && console
-            && console.warn
-            && !this._warned
-           ) {
-            this._warned = true
-            console.warn('Missing character from exported characters list: ', char, style, font);
-        }
-        return emptyChar;
-    }
-
-    function measureText(char, fontName, size) {
-        var fontData = this.getFontByName(fontName);
-        var index = char.charCodeAt(0);
-        if(!fontData.cache[index + 1]) {
-            var tHelper = fontData.helper;
-            //Canvas version
-            //fontData.cache[index] = tHelper.measureText(char).width / 100;
-            //SVG version
-            //console.log(tHelper.getBBox().width)
-            if (char === ' ') {
-                tHelper.textContent = '|' + char + '|';
-                var doubleSize = tHelper.getComputedTextLength();
-                tHelper.textContent = '||';
-                var singleSize = tHelper.getComputedTextLength();
-                fontData.cache[index + 1] = (doubleSize - singleSize)/100;
-            } else {
-                tHelper.textContent = char;
-                fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
-            }
-        }
-        return fontData.cache[index + 1] * size;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return this.fonts[0];
-    }
-
-    function getCombinedCharacterCodes() {
-        return combinedCharacters;
-    }
-
-    function setIsLoaded() {
-        this.isLoaded = true
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this._warned = false;
-        this.initTime = Date.now();
-        this.setIsLoadedBinded = this.setIsLoaded.bind(this)
-        this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)
-    };
-    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
-    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
-
-    var fontPrototype = {
-        addChars: addChars,
-        addFonts: addFonts,
-        getCharData: getCharData,
-        getFontByName: getFontByName,
-        measureText: measureText,
-        checkLoadedFonts: checkLoadedFonts,
-        setIsLoaded: setIsLoaded,
-    }
-
-    Font.prototype = fontPrototype;
-
-    return Font;
-
-}());
-
-var PropertyFactory = (function(){
-
-    var initFrame = initialDefaultFrame;
-    var math_abs = Math.abs;
-
-    function interpolateValue(frameNum, caching) {
-        var offsetTime = this.offsetTime;
-        var newValue;
-        if (this.propType === 'multidimensional') {
-            newValue = createTypedArray('float32', this.pv.length);
-        }
-        var iterationIndex = caching.lastIndex;
-        var i = iterationIndex;
-        var len = this.keyframes.length - 1, flag = true;
-        var keyData, nextKeyData;
-
-        while (flag) {
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i + 1];
-            if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                iterationIndex = 0;
-                break;
-            }
-            if ((nextKeyData.t - offsetTime) > frameNum){
-                iterationIndex = i;
-                break;
-            }
-            if (i < len - 1){
-                i += 1;
-            } else {
-                iterationIndex = 0;
-                flag = false;
-            }
-        }
-
-        var k, kLen, perc, jLen, j, fnc;
-        var nextKeyTime = nextKeyData.t - offsetTime;
-        var keyTime = keyData.t - offsetTime;
-        var endValue;
-        if (keyData.to) {
-            if (!keyData.bezierData) {
-                keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyTime || frameNum < keyTime) {
-                var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for (k = 0; k < kLen; k += 1) {
-                    newValue[k] = bezierData.points[ind].point[k];
-                }
-                // caching._lastKeyframeIndex = -1;
-            } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
-                } else {
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
-                }
-                perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
-                var distanceInLine = bezierData.segmentLength*perc;
-
-                var segmentPerc;
-                var addedLength =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
-                j =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
-                flag = true;
-                jLen = bezierData.points.length;
-                while (flag) {
-                    addedLength += bezierData.points[j].partialLength;
-                    if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
-                        segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1){
-                        j += 1;
-                    } else {
-                        flag = false;
-                    }
-                }
-                caching._lastPoint = j;
-                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                caching._lastKeyframeIndex = i;
-            }
-        } else {
-            var outX, outY, inX, inY, keyValue;
-            len = keyData.s.length;
-            endValue = nextKeyData.s || keyData.e;
-            if (this.sh && keyData.h !== 1) {
-                if (frameNum >= nextKeyTime) {
-                    newValue[0] = endValue[0];
-                    newValue[1] = endValue[1];
-                    newValue[2] = endValue[2];
-                } else if (frameNum <= keyTime) {
-                    newValue[0] = keyData.s[0];
-                    newValue[1] = keyData.s[1];
-                    newValue[2] = keyData.s[2];
-                } else {
-                    var quatStart = createQuaternion(keyData.s);
-                    var quatEnd = createQuaternion(endValue);
-                    var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
-                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
-                }
-                
-            } else {
-                for(i = 0; i < len; i += 1) {
-                    if (keyData.h !== 1) {
-                        if (frameNum >= nextKeyTime) {
-                            perc = 1;
-                        } else if(frameNum < keyTime) {
-                            perc = 0;
-                        } else {
-                            if(keyData.o.x.constructor === Array) {
-                                if (!keyData.__fnct) {
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
-                                    outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
-                                    inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
-                                    inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct = fnc;
-                                } else {
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
-                        }
-                    }
-
-                    endValue = nextKeyData.s || keyData.e;
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
-
-                    if (this.propType === 'multidimensional') {
-                        newValue[i] = keyValue;
-                    } else {
-                        newValue = keyValue;
-                    }
-                }
-            }
-        }
-        caching.lastIndex = iterationIndex;
-        return newValue;
-    }
-
-    //based on @Toji's https://github.com/toji/gl-matrix/
-    function slerp(a, b, t) {
-        var out = [];
-        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
-        bx = b[0], by = b[1], bz = b[2], bw = b[3]
-
-        var omega, cosom, sinom, scale0, scale1;
-
-        cosom = ax * bx + ay * by + az * bz + aw * bw;
-        if (cosom < 0.0) {
-            cosom = -cosom;
-            bx = -bx;
-            by = -by;
-            bz = -bz;
-            bw = -bw;
-        }
-        if ((1.0 - cosom) > 0.000001) {
-            omega = Math.acos(cosom);
-            sinom = Math.sin(omega);
-            scale0 = Math.sin((1.0 - t) * omega) / sinom;
-            scale1 = Math.sin(t * omega) / sinom;
-        } else {
-            scale0 = 1.0 - t;
-            scale1 = t;
-        }
-        out[0] = scale0 * ax + scale1 * bx;
-        out[1] = scale0 * ay + scale1 * by;
-        out[2] = scale0 * az + scale1 * bz;
-        out[3] = scale0 * aw + scale1 * bw;
-
-        return out;
-    }
-
-    function quaternionToEuler(out, quat) {
-        var qx = quat[0];
-        var qy = quat[1];
-        var qz = quat[2];
-        var qw = quat[3];
-        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
-        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
-        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
-        out[0] = heading/degToRads;
-        out[1] = attitude/degToRads;
-        out[2] = bank/degToRads;
-    }
-
-    function createQuaternion(values) {
-        var heading = values[0] * degToRads;
-        var attitude = values[1] * degToRads;
-        var bank = values[2] * degToRads;
-        var c1 = Math.cos(heading / 2);
-        var c2 = Math.cos(attitude / 2);
-        var c3 = Math.cos(bank / 2);
-        var s1 = Math.sin(heading / 2);
-        var s2 = Math.sin(attitude / 2);
-        var s3 = Math.sin(bank / 2);
-        var w = c1 * c2 * c3 - s1 * s2 * s3;
-        var x = s1 * s2 * c3 + c1 * c2 * s3;
-        var y = s1 * c2 * c3 + c1 * s2 * s3;
-        var z = c1 * s2 * c3 - s1 * c2 * s3;
-
-        return [x,y,z,w];
-    }
-
-    function getValueAtCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
-        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
-            if(this._caching.lastFrame >= frameNum) {
-                this._caching._lastKeyframeIndex = -1;
-                this._caching.lastIndex = 0;
-            }
-
-            var renderResult = this.interpolateValue(frameNum, this._caching);
-            this.pv = renderResult;
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
-    }
-
-    function setVValue(val) {
-        var multipliedValue;
-        if(this.propType === 'unidimensional') {
-            multipliedValue = val * this.mult;
-            if(math_abs(this.v - multipliedValue) > 0.00001) {
-                this.v = multipliedValue;
-                this._mdf = true;
-            }
-        } else {
-            var i = 0, len = this.v.length;
-            while (i < len) {
-                multipliedValue = val[i] * this.mult;
-                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
-                    this.v[i] = multipliedValue;
-                    this._mdf = true;
-                }
-                i += 1;
-            }
-        }
-    }
-
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
-            return;
-        }
-        if(this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = this._isFirstFrame;
-        var multipliedValue;
-        var i, len = this.effectsSequence.length;
-        var finalValue = this.kf ? this.pv : this.data.k;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this._isFirstFrame = false;
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
-    }
-
-    function ValueProperty(elem, data, mult, container){
-        this.propType = 'unidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.effectsSequence = [];
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function MultiDimensionalProperty(elem, data, mult, container) {
-        this.propType = 'multidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        var i, len = data.k.length;
-        this.v = createTypedArray('float32', len);
-        this.pv = createTypedArray('float32', len);
-        var arr = createTypedArray('float32', len);
-        this.vel = createTypedArray('float32', len);
-        for (i = 0; i < len; i += 1) {
-            this.v[i] = data.k[i] * this.mult;
-            this.pv[i] = data.k[i];
-        }
-        this._isFirstFrame = true;
-        this.effectsSequence = [];
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedValueProperty(elem, data, mult, container) {
-        this.propType = 'unidimensional';
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.frameId = -1;
-        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.v = initFrame;
-        this.pv = initFrame;
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult, container){
-        this.propType = 'multidimensional';
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for (i = 0; i < len - 1; i += 1) {
-            if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
-                s = data.k[i].s;
-                e = data.k[i + 1].s;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                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]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
-                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
-                        data.k[i].to = null;
-                        data.k[i].ti = null;
-                    }
-                }
-            }
-        }
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.data = data;
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this._isFirstFrame = true;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.frameId = -1;
-        var arrLen = data.k[0].s.length;
-        this.v = createTypedArray('float32', arrLen);
-        this.pv = createTypedArray('float32', arrLen);
-        for (i = 0; i < arrLen; i += 1) {
-            this.v[i] = initFrame;
-            this.pv[i] = initFrame;
-        }
-        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
-        this.addEffect = addEffect;
-    }
-
-    function getProp(elem,data,type, mult, container) {
-        var p;
-        if(!data.k.length){
-            p = new ValueProperty(elem,data, mult, container);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult, container);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult, container);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
-                    break;
-            }
-        }
-        if(p.effectsSequence.length){
-            container.addDynamicProperty(p);
-        }
-        return p;
-    }
-
-    var ob = {
-        getProp: getProp
-    };
-    return ob;
-}());
-var TransformPropertyFactory = (function() {
-
-    var defaultVector = [0,0]
-
-    function applyToMatrix(mat) {
-        var _mdf = this._mdf;
-        this.iterateDynamicProperties();
-        this._mdf = this._mdf || _mdf;
-        if (this.a) {
-            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-        }
-        if (this.s) {
-            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-        }
-        if (this.sk) {
-            mat.skewFromAxis(-this.sk.v, this.sa.v);
-        }
-        if (this.r) {
-            mat.rotate(-this.r.v);
-        } else {
-            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]);
-        }
-        if (this.data.p.s) {
-            if (this.data.p.z) {
-                mat.translate(this.px.v, this.py.v, -this.pz.v);
-            } else {
-                mat.translate(this.px.v, this.py.v, 0);
-            }
-        } else {
-            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-        }
-    }
-    function processKeys(forceRender){
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        }
-        if(this._isDirty) {
-            this.precalculateMatrix();
-            this._isDirty = false;
-        }
-
-        this.iterateDynamicProperties();
-
-        if (this._mdf || forceRender) {
-            this.v.cloneFromProps(this.pre.props);
-            if (this.appliedTransformations < 1) {
-                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if(this.appliedTransformations < 2) {
-                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.sk && this.appliedTransformations < 3) {
-                this.v.skewFromAxis(-this.sk.v, this.sa.v);
-            }
-            if (this.r && this.appliedTransformations < 4) {
-                this.v.rotate(-this.r.v);
-            } else if (!this.r && this.appliedTransformations < 4){
-                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]);
-            }
-            if (this.autoOriented) {
-                var v1,v2, frameRate = this.elem.globalData.frameRate;
-                if(this.p && this.p.keyframes && this.p.getValueAtTime) {
-                    if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
-                    } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
-                    }
-                } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
-                    v1 = [];
-                    v2 = [];
-                    var px = this.px, py = this.py, frameRate;
-                    if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
-                        v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
-                        v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
-                    } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
-                        v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
-                        v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
-                    } else {
-                        v1 = [px.pv, py.pv];
-                        v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
-                        v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
-                    }
-                } else {
-                    v1 = v2 = defaultVector
-                }
-                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-            }
-            if(this.data.p && this.data.p.s){
-                if(this.data.p.z) {
-                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    this.v.translate(this.px.v, this.py.v, 0);
-                }
-            }else{
-                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-            }
-        }
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function precalculateMatrix() {
-        if(!this.a.k) {
-            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            this.appliedTransformations = 1;
-        } else {
-            return;
-        }
-        if(!this.s.effectsSequence.length) {
-            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            this.appliedTransformations = 2;
-        } else {
-            return;
-        }
-        if(this.sk) {
-            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
-                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
-            this.appliedTransformations = 3;
-            } else {
-                return;
-            }
-        }
-        if (this.r) {
-            if(!this.r.effectsSequence.length) {
-                this.pre.rotate(-this.r.v);
-                this.appliedTransformations = 4;
-            } else {
-                return;
-            }
-        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
-            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]);
-            this.appliedTransformations = 4;
-        }
-    }
-
-    function autoOrient(){
-        //
-        //var prevP = this.getValueAtTime();
-    }
-
-    function addDynamicProperty(prop) {
-        this._addDynamicProperty(prop);
-        this.elem.addDynamicProperty(prop);
-        this._isDirty = true;
-    }
-
-    function TransformProperty(elem,data,container){
-        this.elem = elem;
-        this.frameId = -1;
-        this.propType = 'transform';
-        this.data = data;
-        this.v = new Matrix();
-        //Precalculated matrix with non animated properties
-        this.pre = new Matrix();
-        this.appliedTransformations = 0;
-        this.initDynamicPropertyContainer(container || elem);
-        if(data.p && data.p.s){
-            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
-            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
-            if(data.p.z){
-                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
-            }
-        }else{
-            this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
-        }
-        if(data.rx) {
-            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
-            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
-            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
-            if(data.or.k[0].ti) {
-                var i, len = data.or.k.length;
-                for(i=0;i<len;i+=1) {
-                    data.or.k[i].to = data.or.k[i].ti = null;
-                }
-            }
-            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
-            //sh Indicates it needs to be capped between -180 and 180
-            this.or.sh = true;
-        } else {
-            this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
-        }
-        if(data.sk){
-            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
-            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
-        }
-        this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},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.
-        if(data.o){
-            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
-        } else {
-            this.o = {_mdf:false,v:1};
-        }
-        this._isDirty = true;
-        if(!this.dynamicProperties.length){
-            this.getValue(true);
-        }
-    }
-
-    TransformProperty.prototype = {
-        applyToMatrix: applyToMatrix,
-        getValue: processKeys,
-        precalculateMatrix: precalculateMatrix,
-        autoOrient: autoOrient
-    }
-
-    extendPrototype([DynamicPropertyContainer], TransformProperty);
-    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
-    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
-
-    function getTransformProperty(elem,data,container){
-        return new TransformProperty(elem,data,container);
-    }
-
-    return {
-        getTransformProperty: getTransformProperty
-    };
-
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = createSizedArray(this._maxLength);
-	this.o = createSizedArray(this._maxLength);
-	this.i = createSizedArray(this._maxLength);
+  return {
+    style: fStyle,
+    weight: fontData.fWeight || fWeight,
+  };
 }
 
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	this.setLength(len);
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newElement();
-		this.o[i] = point_pool.newElement();
-		this.i[i] = point_pool.newElement();
-		i += 1;
-	}
-};
+/* global createNS, createTag, getFontProperties */
+/* exported FontManager */
 
-ShapePath.prototype.setLength = function(len) {
-	while(this._maxLength < len) {
-		this.doubleArrayLength();
-	}
-	this._length = len;
-};
+var FontManager = (function () {
+  var maxWaitingTime = 5000;
+  var emptyChar = {
+    w: 0,
+    size: 0,
+    shapes: [],
+  };
+  var combinedCharacters = [];
+  // Hindi characters
+  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]);
 
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(createSizedArray(this._maxLength));
-	this.i = this.i.concat(createSizedArray(this._maxLength));
-	this.o = this.o.concat(createSizedArray(this._maxLength));
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newElement();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-
-ShapePath.prototype.reverse = function() {
-	var newPath = new ShapePath();
-	newPath.setPathData(this.c, this._length);
-	var vertices = this.v, outPoints = this.o, inPoints = this.i;
-	var init = 0;
-	if (this.c) {
-		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
-        init = 1;
-    }
-    var cnt = this._length - 1;
-    var len = this._length;
-
+  function trimFontOptions(font) {
+    var familyArray = font.split(',');
     var i;
-    for (i = init; i < len; i += 1) {
-    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
-        cnt -= 1;
+    var len = familyArray.length;
+    var enabledFamilies = [];
+    for (i = 0; i < len; i += 1) {
+      if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
+        enabledFamilies.push(familyArray[i]);
+      }
     }
-    return newPath;
+    return enabledFamilies.join(',');
+  }
+
+  function setUpNode(font, family) {
+    var parentNode = createTag('span');
+    parentNode.style.fontFamily = family;
+    var node = createTag('span');
+    // Characters that vary significantly among different fonts
+    node.innerText = 'giItT1WQy@!-/#';
+    // Visible - so we can measure it - but not on the screen
+    parentNode.style.position = 'absolute';
+    parentNode.style.left = '-10000px';
+    parentNode.style.top = '-10000px';
+    // Large font size makes even subtle changes obvious
+    parentNode.style.fontSize = '300px';
+    // Reset any font properties
+    parentNode.style.fontVariant = 'normal';
+    parentNode.style.fontStyle = 'normal';
+    parentNode.style.fontWeight = 'normal';
+    parentNode.style.letterSpacing = '0';
+    parentNode.appendChild(node);
+    document.body.appendChild(parentNode);
+
+    // Remember width with no applied web font
+    var width = node.offsetWidth;
+    node.style.fontFamily = trimFontOptions(font) + ', ' + family;
+    return { node: node, w: width, parent: parentNode };
+  }
+
+  function checkLoadedFonts() {
+    var i;
+    var len = this.fonts.length;
+    var node;
+    var w;
+    var loadedCount = len;
+    for (i = 0; i < len; i += 1) {
+      if (this.fonts[i].loaded) {
+        loadedCount -= 1;
+      } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
+        this.fonts[i].loaded = true;
+      } else {
+        node = this.fonts[i].monoCase.node;
+        w = this.fonts[i].monoCase.w;
+        if (node.offsetWidth !== w) {
+          loadedCount -= 1;
+          this.fonts[i].loaded = true;
+        } else {
+          node = this.fonts[i].sansCase.node;
+          w = this.fonts[i].sansCase.w;
+          if (node.offsetWidth !== w) {
+            loadedCount -= 1;
+            this.fonts[i].loaded = true;
+          }
+        }
+        if (this.fonts[i].loaded) {
+          this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
+          this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
+        }
+      }
+    }
+
+    if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
+      setTimeout(this.checkLoadedFontsBinded, 20);
+    } else {
+      setTimeout(this.setIsLoadedBinded, 10);
+    }
+  }
+
+  function createHelper(def, fontData) {
+    var tHelper = createNS('text');
+    tHelper.style.fontSize = '100px';
+    // tHelper.style.fontFamily = fontData.fFamily;
+
+    var fontProps = getFontProperties(fontData);
+    tHelper.setAttribute('font-family', fontData.fFamily);
+    tHelper.setAttribute('font-style', fontProps.style);
+    tHelper.setAttribute('font-weight', fontProps.weight);
+    tHelper.textContent = '1';
+    if (fontData.fClass) {
+      tHelper.style.fontFamily = 'inherit';
+      tHelper.setAttribute('class', fontData.fClass);
+    } else {
+      tHelper.style.fontFamily = fontData.fFamily;
+    }
+    def.appendChild(tHelper);
+    var tCanvasHelper = createTag('canvas').getContext('2d');
+    tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px ' + fontData.fFamily;
+    // tCanvasHelper.font = ' 100px '+ fontData.fFamily;
+    return tHelper;
+  }
+
+  function addFonts(fontData, defs) {
+    if (!fontData) {
+      this.isLoaded = true;
+      return;
+    }
+    if (this.chars) {
+      this.isLoaded = true;
+      this.fonts = fontData.list;
+      return;
+    }
+
+    var fontArr = fontData.list;
+    var i;
+    var len = fontArr.length;
+    var _pendingFonts = len;
+    for (i = 0; i < len; i += 1) {
+      var shouldLoadFont = true;
+      var loadedSelector;
+      var j;
+      fontArr[i].loaded = false;
+      fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
+      fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
+      if (!fontArr[i].fPath) {
+        fontArr[i].loaded = true;
+        _pendingFonts -= 1;
+      } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
+        loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
+
+        if (loadedSelector.length > 0) {
+          shouldLoadFont = false;
+        }
+
+        if (shouldLoadFont) {
+          var s = createTag('style');
+          s.setAttribute('f-forigin', fontArr[i].fOrigin);
+          s.setAttribute('f-origin', fontArr[i].origin);
+          s.setAttribute('f-family', fontArr[i].fFamily);
+          s.type = 'text/css';
+          s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
+          defs.appendChild(s);
+        }
+      } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
+        loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var l = createTag('link');
+          l.setAttribute('f-forigin', fontArr[i].fOrigin);
+          l.setAttribute('f-origin', fontArr[i].origin);
+          l.type = 'text/css';
+          l.rel = 'stylesheet';
+          l.href = fontArr[i].fPath;
+          document.body.appendChild(l);
+        }
+      } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
+        loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (fontArr[i].fPath === loadedSelector[j].src) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var sc = createTag('link');
+          sc.setAttribute('f-forigin', fontArr[i].fOrigin);
+          sc.setAttribute('f-origin', fontArr[i].origin);
+          sc.setAttribute('rel', 'stylesheet');
+          sc.setAttribute('href', fontArr[i].fPath);
+          defs.appendChild(sc);
+        }
+      }
+      fontArr[i].helper = createHelper(defs, fontArr[i]);
+      fontArr[i].cache = {};
+      this.fonts.push(fontArr[i]);
+    }
+    if (_pendingFonts === 0) {
+      this.isLoaded = true;
+    } else {
+      // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
+      // Adding this timeout seems to fix it
+      setTimeout(this.checkLoadedFonts.bind(this), 100);
+    }
+  }
+
+  function addChars(chars) {
+    if (!chars) {
+      return;
+    }
+    if (!this.chars) {
+      this.chars = [];
+    }
+    var i;
+    var len = chars.length;
+    var j;
+    var jLen = this.chars.length;
+    var found;
+    for (i = 0; i < len; i += 1) {
+      j = 0;
+      found = false;
+      while (j < jLen) {
+        if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
+          found = true;
+        }
+        j += 1;
+      }
+      if (!found) {
+        this.chars.push(chars[i]);
+        jLen += 1;
+      }
+    }
+  }
+
+  function getCharData(char, style, font) {
+    var i = 0;
+    var len = this.chars.length;
+    while (i < len) {
+      if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) {
+        return this.chars[i];
+      }
+      i += 1;
+    }
+    if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char)
+            && console
+            && console.warn // eslint-disable-line no-console
+            && !this._warned
+    ) {
+      this._warned = true;
+      console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console
+    }
+    return emptyChar;
+  }
+
+  function measureText(char, fontName, size) {
+    var fontData = this.getFontByName(fontName);
+    var index = char.charCodeAt(0);
+    if (!fontData.cache[index + 1]) {
+      var tHelper = fontData.helper;
+      // Canvas version
+      // fontData.cache[index] = tHelper.measureText(char).width / 100;
+      // SVG version
+      // console.log(tHelper.getBBox().width)
+      if (char === ' ') {
+        tHelper.textContent = '|' + char + '|';
+        var doubleSize = tHelper.getComputedTextLength();
+        tHelper.textContent = '||';
+        var singleSize = tHelper.getComputedTextLength();
+        fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
+      } else {
+        tHelper.textContent = char;
+        fontData.cache[index + 1] = (tHelper.getComputedTextLength()) / 100;
+      }
+    }
+    return fontData.cache[index + 1] * size;
+  }
+
+  function getFontByName(name) {
+    var i = 0;
+    var len = this.fonts.length;
+    while (i < len) {
+      if (this.fonts[i].fName === name) {
+        return this.fonts[i];
+      }
+      i += 1;
+    }
+    return this.fonts[0];
+  }
+
+  function getCombinedCharacterCodes() {
+    return combinedCharacters;
+  }
+
+  function setIsLoaded() {
+    this.isLoaded = true;
+  }
+
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this._warned = false;
+    this.initTime = Date.now();
+    this.setIsLoadedBinded = this.setIsLoaded.bind(this);
+    this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
+  };
+    // TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
+  Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
+  var fontPrototype = {
+    addChars: addChars,
+    addFonts: addFonts,
+    getCharData: getCharData,
+    getFontByName: getFontByName,
+    measureText: measureText,
+    checkLoadedFonts: checkLoadedFonts,
+    setIsLoaded: setIsLoaded,
+  };
+
+  Font.prototype = fontPrototype;
+
+  return Font;
+}());
+
+/* global initialDefaultFrame, BezierFactory, degToRads, bez, createTypedArray */
+/* exported PropertyFactory */
+
+var PropertyFactory = (function () {
+  var initFrame = initialDefaultFrame;
+  var mathAbs = Math.abs;
+
+  function interpolateValue(frameNum, caching) {
+    var offsetTime = this.offsetTime;
+    var newValue;
+    if (this.propType === 'multidimensional') {
+      newValue = createTypedArray('float32', this.pv.length);
+    }
+    var iterationIndex = caching.lastIndex;
+    var i = iterationIndex;
+    var len = this.keyframes.length - 1;
+    var flag = true;
+    var keyData;
+    var nextKeyData;
+
+    while (flag) {
+      keyData = this.keyframes[i];
+      nextKeyData = this.keyframes[i + 1];
+      if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
+        if (keyData.h) {
+          keyData = nextKeyData;
+        }
+        iterationIndex = 0;
+        break;
+      }
+      if ((nextKeyData.t - offsetTime) > frameNum) {
+        iterationIndex = i;
+        break;
+      }
+      if (i < len - 1) {
+        i += 1;
+      } else {
+        iterationIndex = 0;
+        flag = false;
+      }
+    }
+
+    var k;
+    var kLen;
+    var perc;
+    var jLen;
+    var j;
+    var fnc;
+    var nextKeyTime = nextKeyData.t - offsetTime;
+    var keyTime = keyData.t - offsetTime;
+    var endValue;
+    if (keyData.to) {
+      if (!keyData.bezierData) {
+        keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
+      }
+      var bezierData = keyData.bezierData;
+      if (frameNum >= nextKeyTime || frameNum < keyTime) {
+        var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
+        kLen = bezierData.points[ind].point.length;
+        for (k = 0; k < kLen; k += 1) {
+          newValue[k] = bezierData.points[ind].point[k];
+        }
+        // caching._lastKeyframeIndex = -1;
+      } else {
+        if (keyData.__fnct) {
+          fnc = keyData.__fnct;
+        } else {
+          fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
+          keyData.__fnct = fnc;
+        }
+        perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+        var distanceInLine = bezierData.segmentLength * perc;
+
+        var segmentPerc;
+        var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+        j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
+        flag = true;
+        jLen = bezierData.points.length;
+        while (flag) {
+          addedLength += bezierData.points[j].partialLength;
+          if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k];
+            }
+            break;
+          } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
+            segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
+            }
+            break;
+          }
+          if (j < jLen - 1) {
+            j += 1;
+          } else {
+            flag = false;
+          }
+        }
+        caching._lastPoint = j;
+        caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+        caching._lastKeyframeIndex = i;
+      }
+    } else {
+      var outX;
+      var outY;
+      var inX;
+      var inY;
+      var keyValue;
+      len = keyData.s.length;
+      endValue = nextKeyData.s || keyData.e;
+      if (this.sh && keyData.h !== 1) {
+        if (frameNum >= nextKeyTime) {
+          newValue[0] = endValue[0];
+          newValue[1] = endValue[1];
+          newValue[2] = endValue[2];
+        } else if (frameNum <= keyTime) {
+          newValue[0] = keyData.s[0];
+          newValue[1] = keyData.s[1];
+          newValue[2] = keyData.s[2];
+        } else {
+          var quatStart = createQuaternion(keyData.s);
+          var quatEnd = createQuaternion(endValue);
+          var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
+          quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+        }
+      } else {
+        for (i = 0; i < len; i += 1) {
+          if (keyData.h !== 1) {
+            if (frameNum >= nextKeyTime) {
+              perc = 1;
+            } else if (frameNum < keyTime) {
+              perc = 0;
+            } else {
+              if (keyData.o.x.constructor === Array) {
+                if (!keyData.__fnct) {
+                  keyData.__fnct = [];
+                }
+                if (!keyData.__fnct[i]) {
+                  outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+                  outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+                  inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+                  inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
+                  fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                  keyData.__fnct[i] = fnc;
+                } else {
+                  fnc = keyData.__fnct[i];
+                }
+              } else if (!keyData.__fnct) {
+                outX = keyData.o.x;
+                outY = keyData.o.y;
+                inX = keyData.i.x;
+                inY = keyData.i.y;
+                fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                keyData.__fnct = fnc;
+              } else {
+                fnc = keyData.__fnct;
+              }
+              perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+            }
+          }
+
+          endValue = nextKeyData.s || keyData.e;
+          keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
+
+          if (this.propType === 'multidimensional') {
+            newValue[i] = keyValue;
+          } else {
+            newValue = keyValue;
+          }
+        }
+      }
+    }
+    caching.lastIndex = iterationIndex;
+    return newValue;
+  }
+
+  // based on @Toji's https://github.com/toji/gl-matrix/
+  function slerp(a, b, t) {
+    var out = [];
+    var ax = a[0];
+    var ay = a[1];
+    var az = a[2];
+    var aw = a[3];
+    var bx = b[0];
+    var by = b[1];
+    var bz = b[2];
+    var bw = b[3];
+
+    var omega;
+    var cosom;
+    var sinom;
+    var scale0;
+    var scale1;
+
+    cosom = ax * bx + ay * by + az * bz + aw * bw;
+    if (cosom < 0.0) {
+      cosom = -cosom;
+      bx = -bx;
+      by = -by;
+      bz = -bz;
+      bw = -bw;
+    }
+    if ((1.0 - cosom) > 0.000001) {
+      omega = Math.acos(cosom);
+      sinom = Math.sin(omega);
+      scale0 = Math.sin((1.0 - t) * omega) / sinom;
+      scale1 = Math.sin(t * omega) / sinom;
+    } else {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+    out[0] = scale0 * ax + scale1 * bx;
+    out[1] = scale0 * ay + scale1 * by;
+    out[2] = scale0 * az + scale1 * bz;
+    out[3] = scale0 * aw + scale1 * bw;
+
+    return out;
+  }
+
+  function quaternionToEuler(out, quat) {
+    var qx = quat[0];
+    var qy = quat[1];
+    var qz = quat[2];
+    var qw = quat[3];
+    var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
+    var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
+    var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
+    out[0] = heading / degToRads;
+    out[1] = attitude / degToRads;
+    out[2] = bank / degToRads;
+  }
+
+  function createQuaternion(values) {
+    var heading = values[0] * degToRads;
+    var attitude = values[1] * degToRads;
+    var bank = values[2] * degToRads;
+    var c1 = Math.cos(heading / 2);
+    var c2 = Math.cos(attitude / 2);
+    var c3 = Math.cos(bank / 2);
+    var s1 = Math.sin(heading / 2);
+    var s2 = Math.sin(attitude / 2);
+    var s3 = Math.sin(bank / 2);
+    var w = c1 * c2 * c3 - s1 * s2 * s3;
+    var x = s1 * s2 * c3 + c1 * c2 * s3;
+    var y = s1 * c2 * c3 + c1 * s2 * s3;
+    var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+    return [x, y, z, w];
+  }
+
+  function getValueAtCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) {
+      if (this._caching.lastFrame >= frameNum) {
+        this._caching._lastKeyframeIndex = -1;
+        this._caching.lastIndex = 0;
+      }
+
+      var renderResult = this.interpolateValue(frameNum, this._caching);
+      this.pv = renderResult;
+    }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
+
+  function setVValue(val) {
+    var multipliedValue;
+    if (this.propType === 'unidimensional') {
+      multipliedValue = val * this.mult;
+      if (mathAbs(this.v - multipliedValue) > 0.00001) {
+        this.v = multipliedValue;
+        this._mdf = true;
+      }
+    } else {
+      var i = 0;
+      var len = this.v.length;
+      while (i < len) {
+        multipliedValue = val[i] * this.mult;
+        if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
+          this.v[i] = multipliedValue;
+          this._mdf = true;
+        }
+        i += 1;
+      }
+    }
+  }
+
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+      return;
+    }
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
+    }
+    this.lock = true;
+    this._mdf = this._isFirstFrame;
+    var i;
+    var len = this.effectsSequence.length;
+    var finalValue = this.kf ? this.pv : this.data.k;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this._isFirstFrame = false;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
+
+  function ValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this.v = mult ? data.k * mult : data.k;
+    this.pv = data.k;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.vel = 0;
+    this.effectsSequence = [];
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function MultiDimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.frameId = -1;
+    var i;
+    var len = data.k.length;
+    this.v = createTypedArray('float32', len);
+    this.pv = createTypedArray('float32', len);
+    this.vel = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      this.v[i] = data.k[i] * this.mult;
+      this.pv[i] = data.k[i];
+    }
+    this._isFirstFrame = true;
+    this.effectsSequence = [];
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.frameId = -1;
+    this._caching = {
+      lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1,
+    };
+    this.k = true;
+    this.kf = true;
+    this.data = data;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.v = initFrame;
+    this.pv = initFrame;
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedMultidimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    var i;
+    var len = data.k.length;
+    var s;
+    var e;
+    var to;
+    var ti;
+    for (i = 0; i < len - 1; i += 1) {
+      if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
+        s = data.k[i].s;
+        e = data.k[i + 1].s;
+        to = data.k[i].to;
+        ti = data.k[i].ti;
+        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]))) {
+          data.k[i].to = null;
+          data.k[i].ti = null;
+        }
+        if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+          if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+            data.k[i].to = null;
+            data.k[i].ti = null;
+          }
+        }
+      }
+    }
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.data = data;
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.k = true;
+    this.kf = true;
+    this._isFirstFrame = true;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.frameId = -1;
+    var arrLen = data.k[0].s.length;
+    this.v = createTypedArray('float32', arrLen);
+    this.pv = createTypedArray('float32', arrLen);
+    for (i = 0; i < arrLen; i += 1) {
+      this.v[i] = initFrame;
+      this.pv[i] = initFrame;
+    }
+    this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) };
+    this.addEffect = addEffect;
+  }
+
+  function getProp(elem, data, type, mult, container) {
+    var p;
+    if (!data.k.length) {
+      p = new ValueProperty(elem, data, mult, container);
+    } else if (typeof (data.k[0]) === 'number') {
+      p = new MultiDimensionalProperty(elem, data, mult, container);
+    } else {
+      switch (type) {
+        case 0:
+          p = new KeyframedValueProperty(elem, data, mult, container);
+          break;
+        case 1:
+          p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
+          break;
+        default:
+          break;
+      }
+    }
+    if (p.effectsSequence.length) {
+      container.addDynamicProperty(p);
+    }
+    return p;
+  }
+
+  var ob = {
+    getProp: getProp,
+  };
+  return ob;
+}());
+
+/* global Matrix, degToRads, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+/* exported TransformPropertyFactory */
+
+var TransformPropertyFactory = (function () {
+  var defaultVector = [0, 0];
+
+  function applyToMatrix(mat) {
+    var _mdf = this._mdf;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || _mdf;
+    if (this.a) {
+      mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+    }
+    if (this.s) {
+      mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+    }
+    if (this.sk) {
+      mat.skewFromAxis(-this.sk.v, this.sa.v);
+    }
+    if (this.r) {
+      mat.rotate(-this.r.v);
+    } else {
+      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]);
+    }
+    if (this.data.p.s) {
+      if (this.data.p.z) {
+        mat.translate(this.px.v, this.py.v, -this.pz.v);
+      } else {
+        mat.translate(this.px.v, this.py.v, 0);
+      }
+    } else {
+      mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+    }
+  }
+  function processKeys(forceRender) {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    }
+    if (this._isDirty) {
+      this.precalculateMatrix();
+      this._isDirty = false;
+    }
+
+    this.iterateDynamicProperties();
+
+    if (this._mdf || forceRender) {
+      var frameRate;
+      this.v.cloneFromProps(this.pre.props);
+      if (this.appliedTransformations < 1) {
+        this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      }
+      if (this.appliedTransformations < 2) {
+        this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      }
+      if (this.sk && this.appliedTransformations < 3) {
+        this.v.skewFromAxis(-this.sk.v, this.sa.v);
+      }
+      if (this.r && this.appliedTransformations < 4) {
+        this.v.rotate(-this.r.v);
+      } else if (!this.r && this.appliedTransformations < 4) {
+        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]);
+      }
+      if (this.autoOriented) {
+        var v1;
+        var v2;
+        frameRate = this.elem.globalData.frameRate;
+        if (this.p && this.p.keyframes && this.p.getValueAtTime) {
+          if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
+            v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
+          } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
+            v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
+          } else {
+            v1 = this.p.pv;
+            v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
+          }
+        } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
+          v1 = [];
+          v2 = [];
+          var px = this.px;
+          var py = this.py;
+          if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
+            v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
+            v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0);
+          } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0);
+            v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0);
+            v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
+          } else {
+            v1 = [px.pv, py.pv];
+            v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
+            v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
+          }
+        } else {
+          v2 = defaultVector;
+          v1 = v2;
+        }
+        this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+      }
+      if (this.data.p && this.data.p.s) {
+        if (this.data.p.z) {
+          this.v.translate(this.px.v, this.py.v, -this.pz.v);
+        } else {
+          this.v.translate(this.px.v, this.py.v, 0);
+        }
+      } else {
+        this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+      }
+    }
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function precalculateMatrix() {
+    if (!this.a.k) {
+      this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      this.appliedTransformations = 1;
+    } else {
+      return;
+    }
+    if (!this.s.effectsSequence.length) {
+      this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      this.appliedTransformations = 2;
+    } else {
+      return;
+    }
+    if (this.sk) {
+      if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+        this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+        this.appliedTransformations = 3;
+      } else {
+        return;
+      }
+    }
+    if (this.r) {
+      if (!this.r.effectsSequence.length) {
+        this.pre.rotate(-this.r.v);
+        this.appliedTransformations = 4;
+      }
+    } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+      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]);
+      this.appliedTransformations = 4;
+    }
+  }
+
+  function autoOrient() {
+    //
+    // var prevP = this.getValueAtTime();
+  }
+
+  function addDynamicProperty(prop) {
+    this._addDynamicProperty(prop);
+    this.elem.addDynamicProperty(prop);
+    this._isDirty = true;
+  }
+
+  function TransformProperty(elem, data, container) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.propType = 'transform';
+    this.data = data;
+    this.v = new Matrix();
+    // Precalculated matrix with non animated properties
+    this.pre = new Matrix();
+    this.appliedTransformations = 0;
+    this.initDynamicPropertyContainer(container || elem);
+    if (data.p && data.p.s) {
+      this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
+      this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
+      if (data.p.z) {
+        this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
+      }
+    } else {
+      this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this);
+    }
+    if (data.rx) {
+      this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+      this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+      this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+      if (data.or.k[0].ti) {
+        var i;
+        var len = data.or.k.length;
+        for (i = 0; i < len; i += 1) {
+          data.or.k[i].to = null;
+          data.or.k[i].ti = null;
+        }
+      }
+      this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+      // sh Indicates it needs to be capped between -180 and 180
+      this.or.sh = true;
+    } else {
+      this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this);
+    }
+    if (data.sk) {
+      this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+      this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+    }
+    this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 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.
+    if (data.o) {
+      this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
+    } else {
+      this.o = { _mdf: false, v: 1 };
+    }
+    this._isDirty = true;
+    if (!this.dynamicProperties.length) {
+      this.getValue(true);
+    }
+  }
+
+  TransformProperty.prototype = {
+    applyToMatrix: applyToMatrix,
+    getValue: processKeys,
+    precalculateMatrix: precalculateMatrix,
+    autoOrient: autoOrient,
+  };
+
+  extendPrototype([DynamicPropertyContainer], TransformProperty);
+  TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+  TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+  function getTransformProperty(elem, data, container) {
+    return new TransformProperty(elem, data, container);
+  }
+
+  return {
+    getTransformProperty: getTransformProperty,
+  };
+}());
+
+/* global createSizedArray, createSizedArray, pointPool */
+
+function ShapePath() {
+  this.c = false;
+  this._length = 0;
+  this._maxLength = 8;
+  this.v = createSizedArray(this._maxLength);
+  this.o = createSizedArray(this._maxLength);
+  this.i = createSizedArray(this._maxLength);
+}
+
+ShapePath.prototype.setPathData = function (closed, len) {
+  this.c = closed;
+  this.setLength(len);
+  var i = 0;
+  while (i < len) {
+    this.v[i] = pointPool.newElement();
+    this.o[i] = pointPool.newElement();
+    this.i[i] = pointPool.newElement();
+    i += 1;
+  }
 };
-var ShapePropertyFactory = (function(){
 
-    var initFrame = -999999;
+ShapePath.prototype.setLength = function (len) {
+  while (this._maxLength < len) {
+    this.doubleArrayLength();
+  }
+  this._length = len;
+};
 
-    function interpolateShape(frameNum, previousValue, caching) {
-        var iterationIndex = caching.lastIndex;
-        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
-        var kf = this.keyframes;
-        if(frameNum < kf[0].t-this.offsetTime){
-            keyPropS = kf[0].s[0];
-            isHold = true;
-            iterationIndex = 0;
-        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
-            keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
-            /*if(kf[kf.length - 1].s){
+ShapePath.prototype.doubleArrayLength = function () {
+  this.v = this.v.concat(createSizedArray(this._maxLength));
+  this.i = this.i.concat(createSizedArray(this._maxLength));
+  this.o = this.o.concat(createSizedArray(this._maxLength));
+  this._maxLength *= 2;
+};
+
+ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
+  var arr;
+  this._length = Math.max(this._length, pos + 1);
+  if (this._length >= this._maxLength) {
+    this.doubleArrayLength();
+  }
+  switch (type) {
+    case 'v':
+      arr = this.v;
+      break;
+    case 'i':
+      arr = this.i;
+      break;
+    case 'o':
+      arr = this.o;
+      break;
+    default:
+      arr = [];
+      break;
+  }
+  if (!arr[pos] || (arr[pos] && !replace)) {
+    arr[pos] = pointPool.newElement();
+  }
+  arr[pos][0] = x;
+  arr[pos][1] = y;
+};
+
+ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
+  this.setXYAt(vX, vY, 'v', pos, replace);
+  this.setXYAt(oX, oY, 'o', pos, replace);
+  this.setXYAt(iX, iY, 'i', pos, replace);
+};
+
+ShapePath.prototype.reverse = function () {
+  var newPath = new ShapePath();
+  newPath.setPathData(this.c, this._length);
+  var vertices = this.v;
+  var outPoints = this.o;
+  var inPoints = this.i;
+  var init = 0;
+  if (this.c) {
+    newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+    init = 1;
+  }
+  var cnt = this._length - 1;
+  var len = this._length;
+
+  var i;
+  for (i = init; i < len; i += 1) {
+    newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+    cnt -= 1;
+  }
+  return newPath;
+};
+
+/* global extendPrototype, roundCorner, BezierFactory, shapePool, degToRads,
+  shapeCollectionPool, PropertyFactory, bmMin, DynamicPropertyContainer */
+/* exported ShapePropertyFactory */
+
+var ShapePropertyFactory = (function () {
+  var initFrame = -999999;
+
+  function interpolateShape(frameNum, previousValue, caching) {
+    var iterationIndex = caching.lastIndex;
+    var keyPropS;
+    var keyPropE;
+    var isHold;
+    var j;
+    var k;
+    var jLen;
+    var kLen;
+    var perc;
+    var vertexValue;
+    var kf = this.keyframes;
+    if (frameNum < kf[0].t - this.offsetTime) {
+      keyPropS = kf[0].s[0];
+      isHold = true;
+      iterationIndex = 0;
+    } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
+      keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
+      /* if(kf[kf.length - 1].s){
                 keyPropS = kf[kf.length - 1].s[0];
             }else{
                 keyPropS = kf[kf.length - 2].e[0];
-            }*/
-            isHold = true;
-        }else{
-            var i = iterationIndex;
-            var len = kf.length- 1,flag = true,keyData,nextKeyData;
-            while(flag){
-                keyData = kf[i];
-                nextKeyData = kf[i+1];
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-            isHold = keyData.h === 1;
-            iterationIndex = i;
-            if(!isHold){
-                if(frameNum >= nextKeyData.t-this.offsetTime){
-                    perc = 1;
-                }else if(frameNum < keyData.t-this.offsetTime){
-                    perc = 0;
-                }else{
-                    var fnc;
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                }
-                keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
-            }
-            keyPropS = keyData.s[0];
+            } */
+      isHold = true;
+    } else {
+      var i = iterationIndex;
+      var len = kf.length - 1;
+      var flag = true;
+      var keyData;
+      var nextKeyData;
+      while (flag) {
+        keyData = kf[i];
+        nextKeyData = kf[i + 1];
+        if ((nextKeyData.t - this.offsetTime) > frameNum) {
+          break;
         }
-        jLen = previousValue._length;
-        kLen = keyPropS.i[0].length;
-        caching.lastIndex = iterationIndex;
-
-        for(j=0;j<jLen;j+=1){
-            for(k=0;k<kLen;k+=1){
-                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                previousValue.i[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                previousValue.o[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                previousValue.v[j][k] = vertexValue;
-            }
+        if (i < len - 1) {
+          i += 1;
+        } else {
+          flag = false;
         }
+      }
+      isHold = keyData.h === 1;
+      iterationIndex = i;
+      if (!isHold) {
+        if (frameNum >= nextKeyData.t - this.offsetTime) {
+          perc = 1;
+        } else if (frameNum < keyData.t - this.offsetTime) {
+          perc = 0;
+        } else {
+          var fnc;
+          if (keyData.__fnct) {
+            fnc = keyData.__fnct;
+          } else {
+            fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
+            keyData.__fnct = fnc;
+          }
+          perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime)));
+        }
+        keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
+      }
+      keyPropS = keyData.s[0];
     }
+    jLen = previousValue._length;
+    kLen = keyPropS.i[0].length;
+    caching.lastIndex = iterationIndex;
 
-    function interpolateShapeCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
-        var lastFrame = this._caching.lastFrame;
-        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
-            ////
-            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
-            this.interpolateShape(frameNum, this.pv, this._caching);
-            ////
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
+    for (j = 0; j < jLen; j += 1) {
+      for (k = 0; k < kLen; k += 1) {
+        vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
+        previousValue.i[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
+        previousValue.o[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
+        previousValue.v[j][k] = vertexValue;
+      }
     }
+  }
 
-    function resetShape(){
-        this.paths = this.localShapeCollection;
+  function interpolateShapeCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    var lastFrame = this._caching.lastFrame;
+    if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) {
+      /// /
+      this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+      this.interpolateShape(frameNum, this.pv, this._caching);
+      /// /
     }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            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] 
+  function resetShape() {
+    this.paths = this.localShapeCollection;
+  }
+
+  function shapesEqual(shape1, shape2) {
+    if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
+      return false;
+    }
+    var i;
+    var len = shape1._length;
+    for (i = 0; i < len; i += 1) {
+      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]) {
-                return false;
-            }
-        }
-        return true;
+        return false;
+      }
     }
+    return true;
+  }
 
-    function setVValue(newPath) {
-        if(!shapesEqual(this.v, newPath)) {
-            this.v = shape_pool.clone(newPath);
-            this.localShapeCollection.releaseShapes();
-            this.localShapeCollection.addShape(this.v);
-            this._mdf = true;
-            this.paths = this.localShapeCollection;
-        }
+  function setVValue(newPath) {
+    if (!shapesEqual(this.v, newPath)) {
+      this.v = shapePool.clone(newPath);
+      this.localShapeCollection.releaseShapes();
+      this.localShapeCollection.addShape(this.v);
+      this._mdf = true;
+      this.paths = this.localShapeCollection;
     }
+  }
 
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        } else if (!this.effectsSequence.length) {
-            this._mdf = false;
-            return;
-        }
-        if (this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = false;
-        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
-        var i, len = this.effectsSequence.length;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    };
-
-    function ShapeProperty(elem, data, type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.container = elem;
-        this.elem = elem;
-        this.data = data;
-        this.k = false;
-        this.kf = false;
-        this._mdf = false;
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v = shape_pool.clone(pathData);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-        this.effectsSequence = [];
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    } if (!this.effectsSequence.length) {
+      this._mdf = false;
+      return;
     }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
     }
-
-    ShapeProperty.prototype.interpolateShape = interpolateShape;
-    ShapeProperty.prototype.getValue = processEffectsSequence;
-    ShapeProperty.prototype.setVValue = setVValue;
-    ShapeProperty.prototype.addEffect = addEffect;
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.container = elem;
-        this.offsetTime = elem.data.st;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newElement();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-        this._caching = {lastFrame: initFrame, lastIndex: 0};
-        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+    this.lock = true;
+    this._mdf = false;
+    var finalValue;
+    if (this.kf) {
+      finalValue = this.pv;
+    } else if (this.data.ks) {
+      finalValue = this.data.ks.k;
+    } else {
+      finalValue = this.data.pt.k;
     }
-    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
-    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
-    KeyframedShapeProperty.prototype.setVValue = setVValue;
-    KeyframedShapeProperty.prototype.addEffect = addEffect;
+    var i;
+    var len = this.effectsSequence.length;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
 
-    var EllShapeProperty = (function(){
+  function ShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.container = elem;
+    this.elem = elem;
+    this.data = data;
+    this.k = false;
+    this.kf = false;
+    this._mdf = false;
+    var pathData = type === 3 ? data.pt.k : data.ks.k;
+    this.v = shapePool.clone(pathData);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.reset = resetShape;
+    this.effectsSequence = [];
+  }
 
-        var cPoint = roundCorner;
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
 
-        function EllShapeProperty(elem,data) {
-            /*this.v = {
+  ShapeProperty.prototype.interpolateShape = interpolateShape;
+  ShapeProperty.prototype.getValue = processEffectsSequence;
+  ShapeProperty.prototype.setVValue = setVValue;
+  ShapeProperty.prototype.addEffect = addEffect;
+
+  function KeyframedShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.elem = elem;
+    this.container = elem;
+    this.offsetTime = elem.data.st;
+    this.keyframes = type === 3 ? data.pt.k : data.ks.k;
+    this.k = true;
+    this.kf = true;
+    var len = this.keyframes[0].s[0].i.length;
+    this.v = shapePool.newElement();
+    this.v.setPathData(this.keyframes[0].s[0].c, len);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.lastFrame = initFrame;
+    this.reset = resetShape;
+    this._caching = { lastFrame: initFrame, lastIndex: 0 };
+    this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+  }
+  KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+  KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+  KeyframedShapeProperty.prototype.setVValue = setVValue;
+  KeyframedShapeProperty.prototype.addEffect = addEffect;
+
+  var EllShapeProperty = (function () {
+    var cPoint = roundCorner;
+
+    function EllShapePropertyFactory(elem, data) {
+      /* this.v = {
                 v: createSizedArray(4),
                 i: createSizedArray(4),
                 o: createSizedArray(4),
                 c: true
-            };*/
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertEllToPath();
-            }
-        };
+            }; */
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 4);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.paths = this.localShapeCollection;
+      this.localShapeCollection.addShape(this.v);
+      this.d = data.d;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertEllToPath();
+      }
+    }
 
-        EllShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function (){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-
-                if(this._mdf){
-                    this.convertEllToPath();
-                }
-            },
-            convertEllToPath: function() {
-                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-                var _cw = this.d !== 3;
-                var _v = this.v;
-                _v.v[0][0] = p0;
-                _v.v[0][1] = p1 - s1;
-                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.v[1][1] = p1;
-                _v.v[2][0] = p0;
-                _v.v[2][1] = p1 + s1;
-                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.v[3][1] = p1;
-                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.i[0][1] = p1 - s1;
-                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.i[1][1] = p1 - s1 * cPoint;
-                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.i[2][1] = p1 + s1;
-                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.i[3][1] = p1 + s1 * cPoint;
-                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.o[0][1] = p1 - s1;
-                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.o[1][1] = p1 + s1 * cPoint;
-                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.o[2][1] = p1 + s1;
-                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.o[3][1] = p1 - s1 * cPoint;
-            }
+    EllShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
         }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
 
-        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+        if (this._mdf) {
+          this.convertEllToPath();
+        }
+      },
+      convertEllToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var s0 = this.s.v[0] / 2;
+        var s1 = this.s.v[1] / 2;
+        var _cw = this.d !== 3;
+        var _v = this.v;
+        _v.v[0][0] = p0;
+        _v.v[0][1] = p1 - s1;
+        _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.v[1][1] = p1;
+        _v.v[2][0] = p0;
+        _v.v[2][1] = p1 + s1;
+        _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.v[3][1] = p1;
+        _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.i[0][1] = p1 - s1;
+        _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.i[1][1] = p1 - s1 * cPoint;
+        _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.i[2][1] = p1 + s1;
+        _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.i[3][1] = p1 + s1 * cPoint;
+        _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.o[0][1] = p1 - s1;
+        _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.o[1][1] = p1 + s1 * cPoint;
+        _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.o[2][1] = p1 + s1;
+        _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.o[3][1] = p1 - s1 * cPoint;
+      },
+    };
 
-        return EllShapeProperty;
-    }());
+    extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
 
-    var StarShapeProperty = (function() {
+    return EllShapePropertyFactory;
+  }());
 
-        function StarShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
-                this.convertToPath = this.convertStarToPath;
-            } else {
-                this.convertToPath = this.convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertToPath();
-            }
-        };
+  var StarShapeProperty = (function () {
+    function StarShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 0);
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.data = data;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      if (data.sy === 1) {
+        this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
+        this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
+        this.convertToPath = this.convertStarToPath;
+      } else {
+        this.convertToPath = this.convertPolygonToPath;
+      }
+      this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+      this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
+      this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertToPath();
+      }
+    }
 
-        StarShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function() {
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertToPath();
-                }
-            },
-            convertStarToPath: function() {
-                var numPts = Math.floor(this.pt.v)*2;
-                var angle = Math.PI*2/numPts;
-                /*this.v.v.length = numPts;
+    StarShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertToPath();
+        }
+      },
+      convertStarToPath: function () {
+        var numPts = Math.floor(this.pt.v) * 2;
+        var angle = (Math.PI * 2) / numPts;
+        /* this.v.v.length = numPts;
                 this.v.i.length = numPts;
-                this.v.o.length = numPts;*/
-                var longFlag = true;
-                var longRad = this.or.v;
-                var shortRad = this.ir.v;
-                var longRound = this.os.v;
-                var shortRound = this.is.v;
-                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-                currentAng += this.r.v;
-                var dir = this.data.d === 3 ? -1 : 1;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    rad = longFlag ? longRad : shortRad;
-                    roundness = longFlag ? longRound : shortRound;
-                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
+                this.v.o.length = numPts; */
+        var longFlag = true;
+        var longRad = this.or.v;
+        var shortRad = this.ir.v;
+        var longRound = this.os.v;
+        var shortRound = this.is.v;
+        var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2);
+        var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2);
+        var i;
+        var rad;
+        var roundness;
+        var perimSegment;
+        var currentAng = -Math.PI / 2;
+        currentAng += this.r.v;
+        var dir = this.data.d === 3 ? -1 : 1;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          rad = longFlag ? longRad : shortRad;
+          roundness = longFlag ? longRound : shortRound;
+          perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
 
-                    /*this.v.v[i] = [x,y];
+          /* this.v.v[i] = [x,y];
                     this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
                     this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                    this.v._length = numPts;*/
-                    longFlag = !longFlag;
-                    currentAng += angle*dir;
-                }
-            },
-            convertPolygonToPath: function() {
-                var numPts = Math.floor(this.pt.v);
-                var angle = Math.PI*2/numPts;
-                var rad = this.or.v;
-                var roundness = this.os.v;
-                var perimSegment = 2*Math.PI*rad/(numPts*4);
-                var i, currentAng = -Math.PI/ 2;
-                var dir = this.data.d === 3 ? -1 : 1;
-                currentAng += this.r.v;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
-                    currentAng += angle*dir;
-                }
-                this.paths.length = 0;
-                this.paths[0] = this.v;
-            }
-
+                    this.v._length = numPts; */
+          longFlag = !longFlag;
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
-
-        return StarShapeProperty;
-    }());
-
-    var RectShapeProperty = (function() {
-
-         function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertRectToPath();
-            }
-        };
-
-        RectShapeProperty.prototype = {
-            convertRectToPath: function (){
-                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-                var round = bm_min(v0,v1,this.r.v);
-                var cPoint = round*(1-roundCorner);
-                this.v._length = 0;
-
-                if(this.d === 2 || this.d === 1) {
-                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                    }
-                }else{
-                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                    }
-                }
-            },
-            getValue: function(frameNum){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertRectToPath();
-                }
-
-            },
-            reset: resetShape
+      },
+      convertPolygonToPath: function () {
+        var numPts = Math.floor(this.pt.v);
+        var angle = (Math.PI * 2) / numPts;
+        var rad = this.or.v;
+        var roundness = this.os.v;
+        var perimSegment = (2 * Math.PI * rad) / (numPts * 4);
+        var i;
+        var currentAng = -Math.PI * 0.5;
+        var dir = this.data.d === 3 ? -1 : 1;
+        currentAng += this.r.v;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+        this.paths.length = 0;
+        this.paths[0] = this.v;
+      },
 
-        return RectShapeProperty;
-    }());
+    };
+    extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
 
-    function getShapeProp(elem,data,type){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    }
+    return StarShapePropertyFactory;
+  }());
 
-    function getConstructorFunction() {
-        return ShapeProperty;
-    }
-
-    function getKeyframedConstructorFunction() {
-        return KeyframedShapeProperty;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    ob.getConstructorFunction = getConstructorFunction;
-    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data){
-        return new modifiers[nm](elem, data);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if (!this.closed) {
-        // 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.
-        data.sh.container.addDynamicProperty(data.sh);
-        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
-        this.shapes.push(shapeData);
-        this.addShapeToModifier(shapeData);
-        if (this._isAnimated) {
-            data.setAsAnimated();
-        }
-    }
-};
-ShapeModifier.prototype.init = function(elem,data){
-    this.shapes = [];
-    this.elem = elem;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,data);
-    this.frameId = initialDefaultFrame;
-    this.closed = false;
-    this.k = false;
-    if(this.dynamicProperties.length){
+  var RectShapeProperty = (function () {
+    function RectShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.c = true;
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
+      if (this.dynamicProperties.length) {
         this.k = true;
-    }else{
-        this.getValue(true);
+      } else {
+        this.k = false;
+        this.convertRectToPath();
+      }
     }
+
+    RectShapePropertyFactory.prototype = {
+      convertRectToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var v0 = this.s.v[0] / 2;
+        var v1 = this.s.v[1] / 2;
+        var round = bmMin(v0, v1, this.r.v);
+        var cPoint = round * (1 - roundCorner);
+        this.v._length = 0;
+
+        if (this.d === 2 || this.d === 1) {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
+          this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
+          }
+        } else {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
+          }
+        }
+      },
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertRectToPath();
+        }
+      },
+      reset: resetShape,
+    };
+    extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
+
+    return RectShapePropertyFactory;
+  }());
+
+  function getShapeProp(elem, data, type) {
+    var prop;
+    if (type === 3 || type === 4) {
+      var dataProp = type === 3 ? data.pt : data.ks;
+      var keys = dataProp.k;
+      if (keys.length) {
+        prop = new KeyframedShapeProperty(elem, data, type);
+      } else {
+        prop = new ShapeProperty(elem, data, type);
+      }
+    } else if (type === 5) {
+      prop = new RectShapeProperty(elem, data);
+    } else if (type === 6) {
+      prop = new EllShapeProperty(elem, data);
+    } else if (type === 7) {
+      prop = new StarShapeProperty(elem, data);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  }
+
+  function getConstructorFunction() {
+    return ShapeProperty;
+  }
+
+  function getKeyframedConstructorFunction() {
+    return KeyframedShapeProperty;
+  }
+
+  var ob = {};
+  ob.getShapeProp = getShapeProp;
+  ob.getConstructorFunction = getConstructorFunction;
+  ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
+  return ob;
+}());
+
+/* global shapeCollectionPool, initialDefaultFrame, extendPrototype, DynamicPropertyContainer */
+/* exported ShapeModifiers */
+
+var ShapeModifiers = (function () {
+  var ob = {};
+  var modifiers = {};
+  ob.registerModifier = registerModifier;
+  ob.getModifier = getModifier;
+
+  function registerModifier(nm, factory) {
+    if (!modifiers[nm]) {
+      modifiers[nm] = factory;
+    }
+  }
+
+  function getModifier(nm, elem, data) {
+    return new modifiers[nm](elem, data);
+  }
+
+  return ob;
+}());
+
+function ShapeModifier() {}
+ShapeModifier.prototype.initModifierProperties = function () {};
+ShapeModifier.prototype.addShapeToModifier = function () {};
+ShapeModifier.prototype.addShape = function (data) {
+  if (!this.closed) {
+    // 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.
+    data.sh.container.addDynamicProperty(data.sh);
+    var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() };
+    this.shapes.push(shapeData);
+    this.addShapeToModifier(shapeData);
+    if (this._isAnimated) {
+      data.setAsAnimated();
+    }
+  }
 };
-ShapeModifier.prototype.processKeys = function(){
-    if(this.elem.globalData.frameId === this.frameId){
-        return;
-    }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
+ShapeModifier.prototype.init = function (elem, data) {
+  this.shapes = [];
+  this.elem = elem;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, data);
+  this.frameId = initialDefaultFrame;
+  this.closed = false;
+  this.k = false;
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
+};
+ShapeModifier.prototype.processKeys = function () {
+  if (this.elem.globalData.frameId === this.frameId) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 extendPrototype([DynamicPropertyContainer], ShapeModifier);
-function TrimModifier(){
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, segmentsLengthPool, bez, shapePool, ShapeModifiers */
+
+function TrimModifier() {
 }
 extendPrototype([ShapeModifier], TrimModifier);
-TrimModifier.prototype.initModifierProperties = function(elem, data) {
-    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
-    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
-    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
-    this.sValue = 0;
-    this.eValue = 0;
-    this.getValue = this.processKeys;
-    this.m = data.m;
-    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
+TrimModifier.prototype.initModifierProperties = function (elem, data) {
+  this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
+  this.sValue = 0;
+  this.eValue = 0;
+  this.getValue = this.processKeys;
+  this.m = data.m;
+  this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.addShapeToModifier = function(shapeData){
-    shapeData.pathsData = [];
+TrimModifier.prototype.addShapeToModifier = function (shapeData) {
+  shapeData.pathsData = [];
 };
 
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
+TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
+  var segments = [];
+  if (e <= 1) {
+    segments.push({
+      s: s,
+      e: e,
+    });
+  } else if (s >= 1) {
+    segments.push({
+      s: s - 1,
+      e: e - 1,
+    });
+  } else {
+    segments.push({
+      s: s,
+      e: 1,
+    });
+    segments.push({
+      s: 0,
+      e: e - 1,
+    });
+  }
+  var shapeSegments = [];
+  var i;
+  var len = segments.length;
+  var segmentOb;
+  for (i = 0; i < len; i += 1) {
+    segmentOb = segments[i];
+    if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
+      var shapeS;
+      var shapeE;
+      if (segmentOb.s * totalModifierLength <= addedLength) {
+        shapeS = 0;
+      } else {
+        shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
+      }
+      if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
+        shapeE = 1;
+      } else {
+        shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
+      }
+      shapeSegments.push([shapeS, shapeE]);
+    }
+  }
+  if (!shapeSegments.length) {
+    shapeSegments.push([0, 0]);
+  }
+  return shapeSegments;
+};
+
+TrimModifier.prototype.releasePathsData = function (pathsData) {
+  var i;
+  var len = pathsData.length;
+  for (i = 0; i < len; i += 1) {
+    segmentsLengthPool.release(pathsData[i]);
+  }
+  pathsData.length = 0;
+  return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function (_isFirstFrame) {
+  var s;
+  var e;
+  if (this._mdf || _isFirstFrame) {
+    var o = (this.o.v % 360) / 360;
+    if (o < 0) {
+      o += 1;
+    }
+    if (this.s.v > 1) {
+      s = 1 + o;
+    } else if (this.s.v < 0) {
+      s = 0 + o;
+    } else {
+      s = this.s.v + o;
+    }
+    if (this.e.v > 1) {
+      e = 1 + o;
+    } else if (this.e.v < 0) {
+      e = 0 + o;
+    } else {
+      e = this.e.v + o;
+    }
+
+    if (s > e) {
+      var _s = s;
+      s = e;
+      e = _s;
+    }
+    s = Math.round(s * 10000) * 0.0001;
+    e = Math.round(e * 10000) * 0.0001;
+    this.sValue = s;
+    this.eValue = e;
+  } else {
+    s = this.sValue;
+    e = this.eValue;
+  }
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var pathsData;
+  var pathData;
+  var totalShapeLength;
+  var totalModifierLength = 0;
+
+  if (e === s) {
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].localShapeCollection.releaseShapes();
+      this.shapes[i].shape._mdf = true;
+      this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+      if (this._mdf) {
+        this.shapes[i].pathsData.length = 0;
+      }
+    }
+  } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) {
     var segments = [];
-    if (e <= 1) {
-        segments.push({
-            s: s,
-            e: e
-        });
-    } else if (s >= 1) {
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        });
-    } else {
-        segments.push({
-            s: s,
-            e: 1
-        });
-        segments.push({
-            s: 0,
-            e: e - 1
-        });
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
+    var shapeData;
+    var localShapeCollection;
     for (i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
+      shapeData = this.shapes[i];
+      // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+      if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
+        shapeData.shape.paths = shapeData.localShapeCollection;
+      } else {
+        shapePaths = shapeData.shape.paths;
+        jLen = shapePaths._length;
+        totalShapeLength = 0;
+        if (!shapeData.shape._mdf && shapeData.pathsData.length) {
+          totalShapeLength = shapeData.totalShapeLength;
         } else {
-            var shapeS, shapeE;
-            if (segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
+          pathsData = this.releasePathsData(shapeData.pathsData);
+          for (j = 0; j < jLen; j += 1) {
+            pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
+            pathsData.push(pathData);
+            totalShapeLength += pathData.totalLength;
+          }
+          shapeData.totalShapeLength = totalShapeLength;
+          shapeData.pathsData = pathsData;
         }
+
+        totalModifierLength += totalShapeLength;
+        shapeData.shape._mdf = true;
+      }
     }
-    if (!shapeSegments.length) {
-        shapeSegments.push([0, 0]);
-    }
-    return shapeSegments;
-};
-
-TrimModifier.prototype.releasePathsData = function(pathsData) {
-    var i, len = pathsData.length;
-    for (i = 0; i < len; i += 1) {
-        segments_length_pool.release(pathsData[i]);
-    }
-    pathsData.length = 0;
-    return pathsData;
-};
-
-TrimModifier.prototype.processShapes = function(_isFirstFrame) {
-    var s, e;
-    if (this._mdf || _isFirstFrame) {
-        var o = (this.o.v % 360) / 360;
-        if (o < 0) {
-            o += 1;
-        }
-        s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
-        e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
-        if (s === e) {
-
-        }
-        if (s > e) {
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        s = Math.round(s * 10000) * 0.0001;
-        e = Math.round(e * 10000) * 0.0001;
-        this.sValue = s;
-        this.eValue = e;
-    } else {
-        s = this.sValue;
-        e = this.eValue;
-    }
-    var shapePaths;
-    var i, len = this.shapes.length, j, jLen;
-    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
-
-    if (e === s) {
-        for (i = 0; i < len; i += 1) {
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape._mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-            if (this._mdf) {
-                this.shapes[i].pathsData.length = 0;
-            }
-        }
-    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for (i = 0; i < len; i += 1) {
-            shapeData = this.shapes[i];
-            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
-            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = this.releasePathsData(shapeData.pathsData);
-                    for (j = 0; j < jLen; j += 1) {
-                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape._mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0, edges;
-        for (i = len - 1; i >= 0; i -= 1) {
-            shapeData = this.shapes[i];
-            if (shapeData.shape._mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
-                if (this.m === 2 && len > 1) {
-                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]];
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if (shapeE <= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        });
-                    } else if (shapeS >= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    } else {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        });
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        if (segments.length > 1) {
-                            var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
-                            if (lastShapeInCollection.c) {
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if (this._mdf) {
-        for (i = 0; i < len; i += 1) {
-            //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
-            //Don't remove this even if it's losing cached info.
-            this.shapes[i].pathsData.length = 0;
-            this.shapes[i].shape._mdf = true;
-        }
-    }
-};
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for (i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i]);
-    }
-};
-
-TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
-    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
-    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
-    }
-    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
-    shapePath.setXYAt(points[1], points[5], 'o', pos);
-    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(points[0], points[4], 'v', pos);
-    }
-    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
+    var shapeS = s;
+    var shapeE = e;
     var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if (!shapePath) {
-        shapePath = shape_pool.newElement();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
+    var edges;
+    for (i = len - 1; i >= 0; i -= 1) {
+      shapeData = this.shapes[i];
+      if (shapeData.shape._mdf) {
+        localShapeCollection = shapeData.localShapeCollection;
+        localShapeCollection.releaseShapes();
+        // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+        if (this.m === 2 && len > 1) {
+          edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+          addedLength += shapeData.totalShapeLength;
+        } else {
+          edges = [[shapeS, shapeE]];
+        }
+        jLen = edges.length;
+        for (j = 0; j < jLen; j += 1) {
+          shapeS = edges[j][0];
+          shapeE = edges[j][1];
+          segments.length = 0;
+          if (shapeE <= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength * shapeE,
+            });
+          } else if (shapeS >= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * (shapeS - 1),
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          } else {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength,
+            });
+            segments.push({
+              s: 0,
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          }
+          var newShapesData = this.addShapes(shapeData, segments[0]);
+          if (segments[0].s !== segments[0].e) {
+            if (segments.length > 1) {
+              var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
+              if (lastShapeInCollection.c) {
+                var lastShape = newShapesData.pop();
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
+              } else {
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1]);
+              }
+            }
+            this.addPaths(newShapesData, localShapeCollection);
+          }
+        }
+        shapeData.shape.paths = localShapeCollection;
+      }
     }
-    shapes.push(shapePath);
+  } else if (this._mdf) {
     for (i = 0; i < len; i += 1) {
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for (j = 1; j < jLen; j +=1) {
-            currentLengthData = lengths[j-1];
-            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e) {
-                shapePath.c = false;
-                break;
-            } else {
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if (shapePaths[i].c && lengths.length) {
-            currentLengthData = lengths[j - 1];
-            if (addedLength <= shapeSegment.e) {
-                var segmentLength = lengths[j - 1].addedLength;
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if (shapePath._length) {
-            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
-        }
-        if (addedLength > shapeSegment.e) {
-            break;
-        }
-        if (i < len - 1) {
-            shapePath = shape_pool.newElement();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
+      // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
+      // Don't remove this even if it's losing cached info.
+      this.shapes[i].pathsData.length = 0;
+      this.shapes[i].shape._mdf = true;
     }
-    return shapes;
+  }
 };
 
+TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
+  var i;
+  var len = newPaths.length;
+  for (i = 0; i < len; i += 1) {
+    localShapeCollection.addShape(newPaths[i]);
+  }
+};
+
+TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+  shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+  shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
+  }
+  shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
+  shapePath.setXYAt(points[1], points[5], 'o', pos);
+  shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(points[0], points[4], 'v', pos);
+  }
+  shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
+  var pathsData = shapeData.pathsData;
+  var shapePaths = shapeData.shape.paths.shapes;
+  var i;
+  var len = shapeData.shape.paths._length;
+  var j;
+  var jLen;
+  var addedLength = 0;
+  var currentLengthData;
+  var segmentCount;
+  var lengths;
+  var segment;
+  var shapes = [];
+  var initPos;
+  var newShape = true;
+  if (!shapePath) {
+    shapePath = shapePool.newElement();
+    segmentCount = 0;
+    initPos = 0;
+  } else {
+    segmentCount = shapePath._length;
+    initPos = shapePath._length;
+  }
+  shapes.push(shapePath);
+  for (i = 0; i < len; i += 1) {
+    lengths = pathsData[i].lengths;
+    shapePath.c = shapePaths[i].c;
+    jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
+    for (j = 1; j < jLen; j += 1) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
+        addedLength += currentLengthData.addedLength;
+        shapePath.c = false;
+      } else if (addedLength > shapeSegment.e) {
+        shapePath.c = false;
+        break;
+      } else {
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+        addedLength += currentLengthData.addedLength;
+        segmentCount += 1;
+      }
+    }
+    if (shapePaths[i].c && lengths.length) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength <= shapeSegment.e) {
+        var segmentLength = lengths[j - 1].addedLength;
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+      } else {
+        shapePath.c = false;
+      }
+      addedLength += currentLengthData.addedLength;
+      segmentCount += 1;
+    }
+    if (shapePath._length) {
+      shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+      shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
+    }
+    if (addedLength > shapeSegment.e) {
+      break;
+    }
+    if (i < len - 1) {
+      shapePath = shapePool.newElement();
+      newShape = true;
+      shapes.push(shapePath);
+      segmentCount = 0;
+    }
+  }
+  return shapes;
+};
 
 ShapeModifiers.registerModifier('tm', TrimModifier);
-function RoundCornersModifier(){}
-extendPrototype([ShapeModifier],RoundCornersModifier);
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
-    this._isAnimated = !!this.rd.effectsSequence.length;
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, roundCorner, ShapeModifiers */
+
+function RoundCornersModifier() {}
+extendPrototype([ShapeModifier], RoundCornersModifier);
+RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
+  this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-            }
+RoundCornersModifier.prototype.processPath = function (path, round) {
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var i;
+  var len = path._length;
+  var currentV;
+  var currentI;
+  var currentO;
+  var closerV;
+  var distance;
+  var newPosPerc;
+  var index = 0;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < len; i += 1) {
+    currentV = path.v[i];
+    currentO = path.o[i];
+    currentI = path.i[i];
+    if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
+      if ((i === 0 || i === len - 1) && !path.c) {
+        clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
+        /* clonedPath.v[index] = currentV;
+                clonedPath.o[index] = currentO;
+                clonedPath.i[index] = currentI; */
+        index += 1;
+      } else {
+        if (i === 0) {
+          closerV = path.v[len - 1];
         } else {
-            cloned_path.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);
-            index += 1;
+          closerV = path.v[i - 1];
         }
-    }
-    return cloned_path;
-};
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = iX;
+        iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
+        vY = iY;
+        oX = vX - (vX - currentV[0]) * roundCorner;
+        oY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
 
-RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+        if (i === len - 1) {
+          closerV = path.v[0];
+        } else {
+          closerV = path.v[i + 1];
         }
-
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = oX;
+        oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
+        vY = oY;
+        iX = vX - (vX - currentV[0]) * roundCorner;
+        iY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
+      }
+    } else {
+      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);
+      index += 1;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  return clonedPath;
 };
 
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function PuckerAndBloatModifier(){}
-extendPrototype([ShapeModifier],PuckerAndBloatModifier);
-PuckerAndBloatModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.amount = PropertyFactory.getProp(elem,data.a,0,null,this);
-    this._isAnimated = !!this.amount.effectsSequence.length;
-};
+RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var rd = this.rd.v;
 
-PuckerAndBloatModifier.prototype.processPath = function(path, amount){
-    var percent = amount / 100;
-    var centerPoint = [0, 0];
-    var pathLength = path._length, i = 0;
-    for (i = 0; i < pathLength; i += 1) {
-        centerPoint[0] += path.v[i][0];
-        centerPoint[1] += path.v[i][1];
-    }
-    centerPoint[0] /= pathLength;
-    centerPoint[1] /= pathLength;
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var vX, vY, oX, oY, iX, iY;
-    for(i = 0; i < pathLength; i += 1) {
-        vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
-        vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
-        oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
-        oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
-        iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
-        iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
-        cloned_path.setTripleAt(vX, vY, oX, oY, iX, iY, i);
-    }
-    return cloned_path;
-};
-
-PuckerAndBloatModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var amount = this.amount.v;
-
-    if(amount !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+  if (rd !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
         }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
 };
-ShapeModifiers.registerModifier('pb',PuckerAndBloatModifier);
-function RepeaterModifier(){}
+
+ShapeModifiers.registerModifier('rd', RoundCornersModifier);
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, ShapeModifiers */
+
+function PuckerAndBloatModifier() {}
+extendPrototype([ShapeModifier], PuckerAndBloatModifier);
+PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
+  this._isAnimated = !!this.amount.effectsSequence.length;
+};
+
+PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
+  var percent = amount / 100;
+  var centerPoint = [0, 0];
+  var pathLength = path._length;
+  var i = 0;
+  for (i = 0; i < pathLength; i += 1) {
+    centerPoint[0] += path.v[i][0];
+    centerPoint[1] += path.v[i][1];
+  }
+  centerPoint[0] /= pathLength;
+  centerPoint[1] /= pathLength;
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < pathLength; i += 1) {
+    vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
+    vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
+    oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
+    oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
+    iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
+    iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
+    clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
+  }
+  return clonedPath;
+};
+
+PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var amount = this.amount.v;
+
+  if (amount !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
+        }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
+    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
+};
+ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
+
+/* global extendPrototype, ShapeModifier, TransformPropertyFactory, PropertyFactory, Matrix, ShapeModifiers */
+
+function RepeaterModifier() {}
 extendPrototype([ShapeModifier], RepeaterModifier);
 
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
-    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
-    this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
-    this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
-    this.data = data;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this._isAnimated = !!this.dynamicProperties.length;
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
+RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
+  this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
+  this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
+  this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
+  this.data = data;
+  if (!this.dynamicProperties.length) {
+    this.getValue(true);
+  }
+  this._isAnimated = !!this.dynamicProperties.length;
+  this.pMatrix = new Matrix();
+  this.rMatrix = new Matrix();
+  this.sMatrix = new Matrix();
+  this.tMatrix = new Matrix();
+  this.matrix = new Matrix();
 };
 
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
+  var dir = inv ? -1 : 1;
+  var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
+  var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
+  pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
+  rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  rMatrix.rotate(-transform.r.v * dir * perc);
+  rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+  sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
+  sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
 };
 
-RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
-    this.elem = elem;
-    this.arr = arr;
-    this.pos = pos;
-    this.elemsData = elemsData;
-    this._currentCopies = 0;
-    this._elements = [];
-    this._groups = [];
-    this.frameId = -1;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,arr[pos]);
-    var cont = 0;
-    while(pos>0){
-        pos -= 1;
-        //this._elements.unshift(arr.splice(pos,1)[0]);
-        this._elements.unshift(arr[pos]);
-        cont += 1;
-    }
-    if(this.dynamicProperties.length){
-        this.k = true;
-    }else{
-        this.getValue(true);
-    }
+RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
+  this.elem = elem;
+  this.arr = arr;
+  this.pos = pos;
+  this.elemsData = elemsData;
+  this._currentCopies = 0;
+  this._elements = [];
+  this._groups = [];
+  this.frameId = -1;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, arr[pos]);
+  while (pos > 0) {
+    pos -= 1;
+    // this._elements.unshift(arr.splice(pos,1)[0]);
+    this._elements.unshift(arr[pos]);
+  }
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
 };
 
-RepeaterModifier.prototype.resetElements = function(elements){
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._processed = false;
-        if(elements[i].ty === 'gr'){
-            this.resetElements(elements[i].it);
+RepeaterModifier.prototype.resetElements = function (elements) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._processed = false;
+    if (elements[i].ty === 'gr') {
+      this.resetElements(elements[i].it);
+    }
+  }
+};
+
+RepeaterModifier.prototype.cloneElements = function (elements) {
+  var newElements = JSON.parse(JSON.stringify(elements));
+  this.resetElements(newElements);
+  return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._render = renderFlag;
+    if (elements[i].ty === 'gr') {
+      this.changeGroupRender(elements[i].it, renderFlag);
+    }
+  }
+};
+
+RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
+  var items;
+  var itemsTransform;
+  var i;
+  var dir;
+  var cont;
+  if (this._mdf || _isFirstFrame) {
+    var copies = Math.ceil(this.c.v);
+    if (this._groups.length < copies) {
+      while (this._groups.length < copies) {
+        var group = {
+          it: this.cloneElements(this._elements),
+          ty: 'gr',
+        };
+        group.it.push({
+          a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr',
+        });
+
+        this.arr.splice(0, 0, group);
+        this._groups.splice(0, 0, group);
+        this._currentCopies += 1;
+      }
+      this.elem.reloadShapes();
+    }
+    cont = 0;
+    var renderFlag;
+    for (i = 0; i <= this._groups.length - 1; i += 1) {
+      renderFlag = cont < copies;
+      this._groups[i]._render = renderFlag;
+      this.changeGroupRender(this._groups[i].it, renderFlag);
+      cont += 1;
+    }
+
+    this._currentCopies = copies;
+    /// /
+
+    var offset = this.o.v;
+    var offsetModulo = offset % 1;
+    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+    var pProps = this.pMatrix.props;
+    var rProps = this.rMatrix.props;
+    var sProps = this.sMatrix.props;
+    this.pMatrix.reset();
+    this.rMatrix.reset();
+    this.sMatrix.reset();
+    this.tMatrix.reset();
+    this.matrix.reset();
+    var iteration = 0;
+
+    if (offset > 0) {
+      while (iteration < roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+        iteration += 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+        iteration += offsetModulo;
+      }
+    } else if (offset < 0) {
+      while (iteration > roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+        iteration -= 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
+        iteration -= offsetModulo;
+      }
+    }
+    i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+    dir = this.data.m === 1 ? 1 : -1;
+    cont = this._currentCopies;
+    var j;
+    var jLen;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      jLen = itemsTransform.length;
+      items[items.length - 1].transform.mProps._mdf = true;
+      items[items.length - 1].transform.op._mdf = true;
+      items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
+      if (iteration !== 0) {
+        if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
+          this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
         }
-    }
-};
+        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]);
+        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]);
+        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]);
 
-RepeaterModifier.prototype.cloneElements = function(elements){
-    var i, len = elements.length;
-    var newElements = JSON.parse(JSON.stringify(elements));
-    this.resetElements(newElements);
-    return newElements;
-};
-
-RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._render = renderFlag;
-        if(elements[i].ty === 'gr') {
-            this.changeGroupRender(elements[i].it, renderFlag);
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-    }
-};
-
-RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
-    var items, itemsTransform, i, dir, cont;
-    if(this._mdf || _isFirstFrame){
-        var copies = Math.ceil(this.c.v);
-        if(this._groups.length < copies){
-            while(this._groups.length < copies){
-                var group = {
-                    it:this.cloneElements(this._elements),
-                    ty:'gr'
-                };
-                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
-                
-                this.arr.splice(0,0,group);
-                this._groups.splice(0,0,group);
-                this._currentCopies += 1;
-            }
-            this.elem.reloadShapes();
-        }
-        cont = 0;
-        var renderFlag;
-        for(i = 0; i  <= this._groups.length - 1; i += 1){
-            renderFlag = cont < copies;
-            this._groups[i]._render = renderFlag;
-            this.changeGroupRender(this._groups[i].it, renderFlag);
-            cont += 1;
-        }
-        
-        this._currentCopies = copies;
-        ////
-
-        var offset = this.o.v;
-        var offsetModulo = offset%1;
-        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-        var k;
-        var tMat = this.tr.v.props;
-        var pProps = this.pMatrix.props;
-        var rProps = this.rMatrix.props;
-        var sProps = this.sMatrix.props;
-        this.pMatrix.reset();
-        this.rMatrix.reset();
-        this.sMatrix.reset();
-        this.tMatrix.reset();
         this.matrix.reset();
-        var iteration = 0;
-
-        if(offset > 0) {
-            while(iteration<roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                iteration += 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                iteration += offsetModulo;
-            }
-        } else if(offset < 0) {
-            while(iteration>roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                iteration -= 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                iteration -= offsetModulo;
-            }
+      } else {
+        this.matrix.reset();
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
-        dir = this.data.m === 1 ? 1 : -1;
-        cont = this._currentCopies;
-        var j, jLen;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            jLen = itemsTransform.length;
-            items[items.length - 1].transform.mProps._mdf = true;
-            items[items.length - 1].transform.op._mdf = true;
-            items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
-            if(iteration !== 0){
-                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                }
-                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]);
-                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]);
-                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]);
-                
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-                this.matrix.reset();
-            } else {
-                this.matrix.reset();
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-            }
-            iteration += 1;
-            cont -= 1;
-            i += dir;
-        }
-    } else {
-        cont = this._currentCopies;
-        i = 0;
-        dir = 1;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            items[items.length - 1].transform.mProps._mdf = false;
-            items[items.length - 1].transform.op._mdf = false;
-            cont -= 1;
-            i += dir;
-        }
+      }
+      iteration += 1;
+      cont -= 1;
+      i += dir;
     }
+  } else {
+    cont = this._currentCopies;
+    i = 0;
+    dir = 1;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      items[items.length - 1].transform.mProps._mdf = false;
+      items[items.length - 1].transform.op._mdf = false;
+      cont -= 1;
+      i += dir;
+    }
+  }
 };
 
-RepeaterModifier.prototype.addShape = function(){};
+RepeaterModifier.prototype.addShape = function () {};
 
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = createSizedArray(this._maxLength);
+ShapeModifiers.registerModifier('rp', RepeaterModifier);
+
+/* global createSizedArray, shapePool */
+
+function ShapeCollection() {
+  this._length = 0;
+  this._maxLength = 4;
+  this.shapes = createSizedArray(this._maxLength);
 }
 
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
+ShapeCollection.prototype.addShape = function (shapeData) {
+  if (this._length === this._maxLength) {
+    this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
+    this._maxLength *= 2;
+  }
+  this.shapes[this._length] = shapeData;
+  this._length += 1;
 };
 
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
+ShapeCollection.prototype.releaseShapes = function () {
+  var i;
+  for (i = 0; i < this._length; i += 1) {
+    shapePool.release(this.shapes[i]);
+  }
+  this._length = 0;
 };
+
+/* global createSizedArray, createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
 function DashProperty(elem, data, renderer, container) {
-    this.elem = elem;
-    this.frameId = -1;
-    this.dataProps = createSizedArray(data.length);
-    this.renderer = renderer;
-    this.k = false;
-    this.dashStr = '';
-    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
-    this.dashoffset = createTypedArray('float32',  1);
-    this.initDynamicPropertyContainer(container);
-    var i, len = data.length || 0, prop;
-    for(i = 0; i < len; i += 1) {
-        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
-        this.k = prop.k || this.k;
-        this.dataProps[i] = {n:data[i].n,p:prop};
-    }
-    if(!this.k){
-        this.getValue(true);
-    }
-    this._isAnimated = this.k;
+  this.elem = elem;
+  this.frameId = -1;
+  this.dataProps = createSizedArray(data.length);
+  this.renderer = renderer;
+  this.k = false;
+  this.dashStr = '';
+  this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
+  this.dashoffset = createTypedArray('float32', 1);
+  this.initDynamicPropertyContainer(container);
+  var i;
+  var len = data.length || 0;
+  var prop;
+  for (i = 0; i < len; i += 1) {
+    prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
+    this.k = prop.k || this.k;
+    this.dataProps[i] = { n: data[i].n, p: prop };
+  }
+  if (!this.k) {
+    this.getValue(true);
+  }
+  this._isAnimated = this.k;
 }
 
-DashProperty.prototype.getValue = function(forceRender) {
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
+DashProperty.prototype.getValue = function (forceRender) {
+  if (this.elem.globalData.frameId === this.frameId && !forceRender) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
+  this._mdf = this._mdf || forceRender;
+  if (this._mdf) {
+    var i = 0;
+    var len = this.dataProps.length;
+    if (this.renderer === 'svg') {
+      this.dashStr = '';
     }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
-    this._mdf = this._mdf || forceRender;
-    if (this._mdf) {
-        var i = 0, len = this.dataProps.length;
-        if(this.renderer === 'svg') {
-            this.dashStr = '';
+    for (i = 0; i < len; i += 1) {
+      if (this.dataProps[i].n !== 'o') {
+        if (this.renderer === 'svg') {
+          this.dashStr += ' ' + this.dataProps[i].p.v;
+        } else {
+          this.dashArray[i] = this.dataProps[i].p.v;
         }
-        for(i=0;i<len;i+=1){
-            if(this.dataProps[i].n != 'o'){
-                if(this.renderer === 'svg') {
-                    this.dashStr += ' ' + this.dataProps[i].p.v;
-                }else{
-                    this.dashArray[i] = this.dataProps[i].p.v;
-                }
-            }else{
-                this.dashoffset[0] = this.dataProps[i].p.v;
-            }
-        }
+      } else {
+        this.dashoffset[0] = this.dataProps[i].p.v;
+      }
     }
+  }
 };
 extendPrototype([DynamicPropertyContainer], DashProperty);
-function GradientProperty(elem,data,container){
-    this.data = data;
-    this.c = createTypedArray('uint8c', data.p*4);
-    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-    this.o = createTypedArray('float32', cLength);
-    this._cmdf = false;
-    this._omdf = false;
-    this._collapsable = this.checkCollapsable();
-    this._hasOpacity = cLength;
-    this.initDynamicPropertyContainer(container);
-    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
-    this.k = this.prop.k;
-    this.getValue(true);
+
+/* global createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+function GradientProperty(elem, data, container) {
+  this.data = data;
+  this.c = createTypedArray('uint8c', data.p * 4);
+  var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;
+  this.o = createTypedArray('float32', cLength);
+  this._cmdf = false;
+  this._omdf = false;
+  this._collapsable = this.checkCollapsable();
+  this._hasOpacity = cLength;
+  this.initDynamicPropertyContainer(container);
+  this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
+  this.k = this.prop.k;
+  this.getValue(true);
 }
 
-GradientProperty.prototype.comparePoints = function(values, points) {
-    var i = 0, len = this.o.length/2, diff;
-    while(i < len) {
-        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
-        if(diff > 0.01){
-            return false;
-        }
-        i += 1;
+GradientProperty.prototype.comparePoints = function (values, points) {
+  var i = 0;
+  var len = this.o.length / 2;
+  var diff;
+  while (i < len) {
+    diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
+    if (diff > 0.01) {
+      return false;
     }
-    return true;
+    i += 1;
+  }
+  return true;
 };
 
-GradientProperty.prototype.checkCollapsable = function() {
-    if (this.o.length/2 !== this.c.length/4) {
+GradientProperty.prototype.checkCollapsable = function () {
+  if (this.o.length / 2 !== this.c.length / 4) {
+    return false;
+  }
+  if (this.data.k.k[0].s) {
+    var i = 0;
+    var len = this.data.k.k.length;
+    while (i < len) {
+      if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
         return false;
+      }
+      i += 1;
     }
-    if (this.data.k.k[0].s) {
-        var i = 0, len = this.data.k.k.length;
-        while (i < len) {
-            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
-                return false;
-            }
-            i += 1;
-        }
-    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
-        return false;
-    }
-    return true;
+  } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
+    return false;
+  }
+  return true;
 };
 
-GradientProperty.prototype.getValue = function(forceRender){
-    this.prop.getValue();
-    this._mdf = false;
-    this._cmdf = false;
-    this._omdf = false;
-    if(this.prop._mdf || forceRender){
-        var i, len = this.data.p*4;
-        var mult, val;
-        for(i=0;i<len;i+=1){
-            mult = i%4 === 0 ? 100 : 255;
-            val = Math.round(this.prop.v[i]*mult);
-            if(this.c[i] !== val){
-                this.c[i] = val;
-                this._cmdf = !forceRender;
-            }
-        }
-        if(this.o.length){
-            len = this.prop.v.length;
-            for(i=this.data.p*4;i<len;i+=1){
-                mult = i%2 === 0 ? 100 : 1;
-                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                if(this.o[i-this.data.p*4] !== val){
-                    this.o[i-this.data.p*4] = val;
-                    this._omdf = !forceRender;
-                }
-            }
-        }
-        this._mdf = !forceRender;
+GradientProperty.prototype.getValue = function (forceRender) {
+  this.prop.getValue();
+  this._mdf = false;
+  this._cmdf = false;
+  this._omdf = false;
+  if (this.prop._mdf || forceRender) {
+    var i;
+    var len = this.data.p * 4;
+    var mult;
+    var val;
+    for (i = 0; i < len; i += 1) {
+      mult = i % 4 === 0 ? 100 : 255;
+      val = Math.round(this.prop.v[i] * mult);
+      if (this.c[i] !== val) {
+        this.c[i] = val;
+        this._cmdf = !forceRender;
+      }
     }
+    if (this.o.length) {
+      len = this.prop.v.length;
+      for (i = this.data.p * 4; i < len; i += 1) {
+        mult = i % 2 === 0 ? 100 : 1;
+        val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
+        if (this.o[i - this.data.p * 4] !== val) {
+          this.o[i - this.data.p * 4] = val;
+          this._omdf = !forceRender;
+        }
+      }
+    }
+    this._mdf = !forceRender;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], GradientProperty);
-var buildShapeString = function(pathNodes, length, closed, mat) {
-	if(length === 0) {
-            return '';
-        }
-        var _o = pathNodes.o;
-        var _i = pathNodes.i;
-        var _v = pathNodes.v;
-        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
-        for(i = 1; i < length; i += 1) {
-            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]);
-        }
-        if (closed && length) {
-            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]);
-            shapeString += 'z';
-        }
-        return shapeString;
-}
-var audioControllerFactory = (function() {
 
-	function AudioController(audioFactory) {
-		this.audios = [];
-		this.audioFactory = audioFactory;
-		this._volume = 1;
-		this._isMuted = false;
-	}
+/* exported buildShapeString */
 
-	AudioController.prototype = {
-		addAudio: function(audio) {
-			this.audios.push(audio);
-		},
-		pause: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].pause()
-			}
-		},
-		resume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].resume()
-			}
-		},
-		setRate: function(rateValue) {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].setRate(rateValue)
-			}
-		},
-		createAudio: function(assetPath) {
-			if (this.audioFactory) {
-				return this.audioFactory(assetPath);
-			} else if (Howl) {
-				return new Howl({
-					src: [assetPath]
-				})
-			} else {
-				return {
-					isPlaying: false,
-					play: function(){this.isPlaying = true},
-					seek: function(){this.isPlaying = false},
-					playing: function(){},
-					rate: function(){},
-					setVolume: function(){},
-				}
-			}
-		},
-		setAudioFactory: function(audioFactory) {
-			this.audioFactory = audioFactory;
-		},
-		setVolume: function(value) {
-			this._volume = value;
-			this._updateVolume();
-		},
-		mute: function() {
-			this._isMuted = true;
-			this._updateVolume();
-		},
-		unmute: function() {
-			this._isMuted = false;
-			this._updateVolume();
-		},
-		getVolume: function(value) {
-			return this._volume;
-		},
-		_updateVolume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1))
-			}
-		}
-	}
-
-	return function() {
-		return new AudioController()
-	}
-
-}())
-var ImagePreloader = (function(){
-
-    var proxyImage = (function(){
-        var canvas = createTag('canvas');
-        canvas.width = 1;
-        canvas.height = 1;
-        var ctx = canvas.getContext('2d');
-        ctx.fillStyle = 'rgba(0,0,0,0)';
-        ctx.fillRect(0, 0, 1, 1);
-        return canvas;
-    }())
-
-    function imageLoaded(){
-        this.loadedAssets += 1;
-        if(this.loadedAssets === this.totalImages){
-            if(this.imagesLoadedCb) {
-                this.imagesLoadedCb(null);
-            }
-        }
-    }
-
-    function getAssetsPath(assetData, assetsPath, original_path) {
-        var path = '';
-        if (assetData.e) {
-            path = assetData.p;
-        } else if(assetsPath) {
-            var imagePath = assetData.p;
-            if (imagePath.indexOf('images/') !== -1) {
-                imagePath = imagePath.split('/')[1];
-            }
-            path = assetsPath + imagePath;
-        } else {
-            path = original_path;
-            path += assetData.u ? assetData.u : '';
-            path += assetData.p;
-        }
-        return path;
-    }
-
-    function testImageLoaded(img) {
-        var _count = 0;
-        var intervalId = setInterval(function() {
-            var box = img.getBBox();
-            if (box.width || _count > 500) {
-                this._imageLoaded();
-                clearInterval(intervalId);
-            }
-            _count += 1;
-        }.bind(this), 50)
-    }
-
-    function createImageData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createNS('image');
-        if (isSafari) {
-            this.testImageLoaded(img)
-        } else {
-            img.addEventListener('load', this._imageLoaded, false);
-        }
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.setAttributeNS('http://www.w3.org/1999/xlink','href', path);
-        this._elementHelper.append(img);
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function createImgData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createTag('img');
-        img.crossOrigin = 'anonymous';
-        img.addEventListener('load', this._imageLoaded, false);
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.src = path;
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function loadAssets(assets, cb){
-        this.imagesLoadedCb = cb;
-        var i, len = assets.length;
-        for (i = 0; i < len; i += 1) {
-            if(!assets[i].layers){
-                this.totalImages += 1;
-                this.images.push(this._createImageData(assets[i]));
-            }
-        }
-    }
-
-    function setPath(path){
-        this.path = path || '';
-    }
-
-    function setAssetsPath(path){
-        this.assetsPath = path || '';
-    }
-
-    function getImage(assetData) {
-        var i = 0, len = this.images.length;
-        while (i < len) {
-            if (this.images[i].assetData === assetData) {
-                return this.images[i].img;
-            }
-            i += 1;
-        }
-    }
-
-    function destroy() {
-        this.imagesLoadedCb = null;
-        this.images.length = 0;
-    }
-
-    function loaded() {
-        return this.totalImages === this.loadedAssets;
-    }
-
-    function setCacheType(type, elementHelper) {
-        if (type === 'svg') {
-            this._elementHelper = elementHelper;
-            this._createImageData = this.createImageData.bind(this);
-        } else {
-            this._createImageData = this.createImgData.bind(this);
-        }
-    }
-
-    function ImagePreloader(type){
-        this._imageLoaded = imageLoaded.bind(this);
-        this.testImageLoaded = testImageLoaded.bind(this);
-        this.assetsPath = '';
-        this.path = '';
-        this.totalImages = 0;
-        this.loadedAssets = 0;
-        this.imagesLoadedCb = null;
-        this.images = [];
-    };
-
-    ImagePreloader.prototype = {
-        loadAssets: loadAssets,
-        setAssetsPath: setAssetsPath,
-        setPath: setPath,
-        loaded: loaded,
-        destroy: destroy,
-        getImage: getImage,
-        createImgData: createImgData,
-        createImageData: createImageData,
-        imageLoaded: imageLoaded,
-        setCacheType: setCacheType,
-    }
-
-    return ImagePreloader;
-}());
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	};
-	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)) {
-	   ob.maskType = false;
-	}
-	return ob;
-}());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
-
-	function createFilter(filId){
-        	var fil = createNS('filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
-
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = createNS('feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
-                return feColorMatrix;
-	}
-
-	return ob;
-}());
-var assetLoader = (function(){
-
-	function formatResponse(xhr) {
-		if(xhr.response && typeof xhr.response === 'object') {
-			return xhr.response;
-		} else if(xhr.response && typeof xhr.response === 'string') {
-			return JSON.parse(xhr.response);
-		} else if(xhr.responseText) {
-			return JSON.parse(xhr.responseText);
-		}
-	}
-
-	function loadAsset(path, callback, errorCallback) {
-		var response;
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', path, true);
-		// set responseType after calling open or IE will break.
-		try {
-		    // This crashes on Android WebView prior to KitKat
-		    xhr.responseType = "json";
-		} catch (err) {}
-	    xhr.send();
-	    xhr.onreadystatechange = function () {
-	        if (xhr.readyState == 4) {
-	            if(xhr.status == 200){
-	            	response = formatResponse(xhr);
-	            	callback(response);
-	            }else{
-	                try{
-	            		response = formatResponse(xhr);
-	            		callback(response);
-	                }catch(err){
-	                	if(errorCallback) {
-	                		errorCallback(err);
-	                	}
-	                }
-	            }
-	        }
-	    };
-	}
-	return {
-		load: loadAsset
-	}
-}())
-
-function TextAnimatorProperty(textData, renderType, elem){
-    this._isFirstFrame = true;
-	this._hasMaskedPath = false;
-	this._frameId = -1;
-	this._textData = textData;
-	this._renderType = renderType;
-    this._elem = elem;
-	this._animatorsData = createSizedArray(this._textData.a.length);
-	this._pathData = {};
-	this._moreOptions = {
-		alignment: {}
-	};
-	this.renderedLetters = [];
-    this.lettersChangedFlag = false;
-    this.initDynamicPropertyContainer(elem);
-
-}
-
-TextAnimatorProperty.prototype.searchProperties = function(){
-    var i, len = this._textData.a.length, animatorProps;
-    var getProp = PropertyFactory.getProp;
-    for(i=0;i<len;i+=1){
-        animatorProps = this._textData.a[i];
-        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
-    }
-    if(this._textData.p && 'm' in this._textData.p){
-        this._pathData = {
-            f: getProp(this._elem,this._textData.p.f,0,0,this),
-            l: getProp(this._elem,this._textData.p.l,0,0,this),
-            r: this._textData.p.r,
-            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
-        };
-        this._hasMaskedPath = true;
-    } else {
-        this._hasMaskedPath = false;
-    }
-    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+var buildShapeString = function (pathNodes, length, closed, mat) {
+  if (length === 0) {
+    return '';
+  }
+  var _o = pathNodes.o;
+  var _i = pathNodes.i;
+  var _v = pathNodes.v;
+  var i;
+  var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+  for (i = 1; i < length; i += 1) {
+    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]);
+  }
+  if (closed && length) {
+    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]);
+    shapeString += 'z';
+  }
+  return shapeString;
 };
 
-TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
-    this.lettersChangedFlag = lettersChangedFlag;
-    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
-        return;
+/* global Howl */
+/* exported audioControllerFactory */
+
+var audioControllerFactory = (function () {
+  function AudioController(audioFactory) {
+    this.audios = [];
+    this.audioFactory = audioFactory;
+    this._volume = 1;
+    this._isMuted = false;
+  }
+
+  AudioController.prototype = {
+    addAudio: function (audio) {
+      this.audios.push(audio);
+    },
+    pause: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].pause();
+      }
+    },
+    resume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].resume();
+      }
+    },
+    setRate: function (rateValue) {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].setRate(rateValue);
+      }
+    },
+    createAudio: function (assetPath) {
+      if (this.audioFactory) {
+        return this.audioFactory(assetPath);
+      } if (Howl) {
+        return new Howl({
+          src: [assetPath],
+        });
+      }
+      return {
+        isPlaying: false,
+        play: function () { this.isPlaying = true; },
+        seek: function () { this.isPlaying = false; },
+        playing: function () {},
+        rate: function () {},
+        setVolume: function () {},
+      };
+    },
+    setAudioFactory: function (audioFactory) {
+      this.audioFactory = audioFactory;
+    },
+    setVolume: function (value) {
+      this._volume = value;
+      this._updateVolume();
+    },
+    mute: function () {
+      this._isMuted = true;
+      this._updateVolume();
+    },
+    unmute: function () {
+      this._isMuted = false;
+      this._updateVolume();
+    },
+    getVolume: function () {
+      return this._volume;
+    },
+    _updateVolume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
+      }
+    },
+  };
+
+  return function () {
+    return new AudioController();
+  };
+}());
+
+/* global createTag, createNS, isSafari */
+/* exported ImagePreloader */
+
+var ImagePreloader = (function () {
+  var proxyImage = (function () {
+    var canvas = createTag('canvas');
+    canvas.width = 1;
+    canvas.height = 1;
+    var ctx = canvas.getContext('2d');
+    ctx.fillStyle = 'rgba(0,0,0,0)';
+    ctx.fillRect(0, 0, 1, 1);
+    return canvas;
+  }());
+
+  function imageLoaded() {
+    this.loadedAssets += 1;
+    if (this.loadedAssets === this.totalImages) {
+      if (this.imagesLoadedCb) {
+        this.imagesLoadedCb(null);
+      }
     }
-    this._isFirstFrame = false;
-    var alignment = this._moreOptions.alignment.v;
-    var animators = this._animatorsData;
-    var textData = this._textData;
-    var matrixHelper = this.mHelper;
-    var renderType = this._renderType;
-    var renderedLettersCount = this.renderedLetters.length;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
-    if(this._hasMaskedPath) {
-        mask = this._pathData.m;
-        if(!this._pathData.n || this._pathData._mdf){
-            var paths = mask.v;
-            if(this._pathData.r){
-                paths = paths.reverse();
-            }
-            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
-            pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths._length - 1;
-            var bezierData;
-            totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            this._pathData.pi = pathInfo;
-        }
-        pathInfo = this._pathData.pi;
+  }
 
-        currentLength = this._pathData.f.v;
-        segmentInd = 0;
-        pointInd = 1;
-        segmentLength = 0;
-        flag = true;
-        segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].points;
-                    pointInd = points.length - 1;
-                }
-            }
+  function getAssetsPath(assetData, assetsPath, originalPath) {
+    var path = '';
+    if (assetData.e) {
+      path = assetData.p;
+    } else if (assetsPath) {
+      var imagePath = assetData.p;
+      if (imagePath.indexOf('images/') !== -1) {
+        imagePath = imagePath.split('/')[1];
+      }
+      path = assetsPath + imagePath;
+    } else {
+      path = originalPath;
+      path += assetData.u ? assetData.u : '';
+      path += assetData.p;
+    }
+    return path;
+  }
 
+  function testImageLoaded(img) {
+    var _count = 0;
+    var intervalId = setInterval(function () {
+      var box = img.getBBox();
+      if (box.width || _count > 500) {
+        this._imageLoaded();
+        clearInterval(intervalId);
+      }
+      _count += 1;
+    }.bind(this), 50);
+  }
+
+  function createImageData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createNS('image');
+    if (isSafari) {
+      this.testImageLoaded(img);
+    } else {
+      img.addEventListener('load', this._imageLoaded, false);
+    }
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
+    this._elementHelper.append(img);
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function createImgData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createTag('img');
+    img.crossOrigin = 'anonymous';
+    img.addEventListener('load', this._imageLoaded, false);
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.src = path;
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function loadAssets(assets, cb) {
+    this.imagesLoadedCb = cb;
+    var i;
+    var len = assets.length;
+    for (i = 0; i < len; i += 1) {
+      if (!assets[i].layers) {
+        this.totalImages += 1;
+        this.images.push(this._createImageData(assets[i]));
+      }
+    }
+  }
+
+  function setPath(path) {
+    this.path = path || '';
+  }
+
+  function setAssetsPath(path) {
+    this.assetsPath = path || '';
+  }
+
+  function getImage(assetData) {
+    var i = 0;
+    var len = this.images.length;
+    while (i < len) {
+      if (this.images[i].assetData === assetData) {
+        return this.images[i].img;
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function destroy() {
+    this.imagesLoadedCb = null;
+    this.images.length = 0;
+  }
+
+  function loaded() {
+    return this.totalImages === this.loadedAssets;
+  }
+
+  function setCacheType(type, elementHelper) {
+    if (type === 'svg') {
+      this._elementHelper = elementHelper;
+      this._createImageData = this.createImageData.bind(this);
+    } else {
+      this._createImageData = this.createImgData.bind(this);
+    }
+  }
+
+  function ImagePreloaderFactory() {
+    this._imageLoaded = imageLoaded.bind(this);
+    this.testImageLoaded = testImageLoaded.bind(this);
+    this.assetsPath = '';
+    this.path = '';
+    this.totalImages = 0;
+    this.loadedAssets = 0;
+    this.imagesLoadedCb = null;
+    this.images = [];
+  }
+
+  ImagePreloaderFactory.prototype = {
+    loadAssets: loadAssets,
+    setAssetsPath: setAssetsPath,
+    setPath: setPath,
+    loaded: loaded,
+    destroy: destroy,
+    getImage: getImage,
+    createImgData: createImgData,
+    createImageData: createImageData,
+    imageLoaded: imageLoaded,
+    setCacheType: setCacheType,
+  };
+
+  return ImagePreloaderFactory;
+}());
+
+/* exported featureSupport */
+
+var featureSupport = (function () {
+  var ob = {
+    maskType: true,
+  };
+  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)) {
+    ob.maskType = false;
+  }
+  return ob;
+}());
+
+/* global createNS */
+/* exported filtersFactory */
+
+var filtersFactory = (function () {
+  var ob = {};
+  ob.createFilter = createFilter;
+  ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
+
+  function createFilter(filId) {
+    var fil = createNS('filter');
+    fil.setAttribute('id', filId);
+    fil.setAttribute('filterUnits', 'objectBoundingBox');
+    fil.setAttribute('x', '0%');
+    fil.setAttribute('y', '0%');
+    fil.setAttribute('width', '100%');
+    fil.setAttribute('height', '100%');
+    return fil;
+  }
+
+  function createAlphaToLuminanceFilter() {
+    var feColorMatrix = createNS('feColorMatrix');
+    feColorMatrix.setAttribute('type', 'matrix');
+    feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+    feColorMatrix.setAttribute('values', '0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
+    return feColorMatrix;
+  }
+
+  return ob;
+}());
+
+/* exported assetLoader */
+
+var assetLoader = (function () {
+  function formatResponse(xhr) {
+    if (xhr.response && typeof xhr.response === 'object') {
+      return xhr.response;
+    } if (xhr.response && typeof xhr.response === 'string') {
+      return JSON.parse(xhr.response);
+    } if (xhr.responseText) {
+      return JSON.parse(xhr.responseText);
+    }
+    return null;
+  }
+
+  function loadAsset(path, callback, errorCallback) {
+    var response;
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', path, true);
+    // set responseType after calling open or IE will break.
+    try {
+      // This crashes on Android WebView prior to KitKat
+      xhr.responseType = 'json';
+    } catch (err) {} // eslint-disable-line no-empty
+    xhr.send();
+    xhr.onreadystatechange = function () {
+      if (xhr.readyState === 4) {
+        if (xhr.status === 200) {
+          response = formatResponse(xhr);
+          callback(response);
+        } else {
+          try {
+            response = formatResponse(xhr);
+            callback(response);
+          } catch (err) {
+            if (errorCallback) {
+              errorCallback(err);
+            }
+          }
         }
+      }
+    };
+  }
+  return {
+    load: loadAsset,
+  };
+}());
+
+/* global createSizedArray, PropertyFactory, TextAnimatorDataProperty, bez, addHueToRGB,
+  addSaturationToRGB, addBrightnessToRGB, LetterProps, Matrix, extendPrototype, DynamicPropertyContainer */
+
+function TextAnimatorProperty(textData, renderType, elem) {
+  this._isFirstFrame = true;
+  this._hasMaskedPath = false;
+  this._frameId = -1;
+  this._textData = textData;
+  this._renderType = renderType;
+  this._elem = elem;
+  this._animatorsData = createSizedArray(this._textData.a.length);
+  this._pathData = {};
+  this._moreOptions = {
+    alignment: {},
+  };
+  this.renderedLetters = [];
+  this.lettersChangedFlag = false;
+  this.initDynamicPropertyContainer(elem);
+}
+
+TextAnimatorProperty.prototype.searchProperties = function () {
+  var i;
+  var len = this._textData.a.length;
+  var animatorProps;
+  var getProp = PropertyFactory.getProp;
+  for (i = 0; i < len; i += 1) {
+    animatorProps = this._textData.a[i];
+    this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+  }
+  if (this._textData.p && 'm' in this._textData.p) {
+    this._pathData = {
+      f: getProp(this._elem, this._textData.p.f, 0, 0, this),
+      l: getProp(this._elem, this._textData.p.l, 0, 0, this),
+      r: this._textData.p.r,
+      m: this._elem.maskManager.getMaskProperty(this._textData.p.m),
+    };
+    this._hasMaskedPath = true;
+  } else {
+    this._hasMaskedPath = false;
+  }
+  this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
+};
+
+TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
+  this.lettersChangedFlag = lettersChangedFlag;
+  if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+    return;
+  }
+  this._isFirstFrame = false;
+  var alignment = this._moreOptions.alignment.v;
+  var animators = this._animatorsData;
+  var textData = this._textData;
+  var matrixHelper = this.mHelper;
+  var renderType = this._renderType;
+  var renderedLettersCount = this.renderedLetters.length;
+  var xPos;
+  var yPos;
+  var i;
+  var len;
+  var letters = documentData.l;
+  var pathInfo;
+  var currentLength;
+  var currentPoint;
+  var segmentLength;
+  var flag;
+  var pointInd;
+  var segmentInd;
+  var prevPoint;
+  var points;
+  var segments;
+  var partialLength;
+  var totalLength;
+  var perc;
+  var tanAngle;
+  var mask;
+  if (this._hasMaskedPath) {
+    mask = this._pathData.m;
+    if (!this._pathData.n || this._pathData._mdf) {
+      var paths = mask.v;
+      if (this._pathData.r) {
+        paths = paths.reverse();
+      }
+      // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+      pathInfo = {
+        tLength: 0,
+        segments: [],
+      };
+      len = paths._length - 1;
+      var bezierData;
+      totalLength = 0;
+      for (i = 0; i < len; i += 1) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      i = len;
+      if (mask.v.c) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      this._pathData.pi = pathInfo;
+    }
+    pathInfo = this._pathData.pi;
+
+    currentLength = this._pathData.f.v;
+    segmentInd = 0;
+    pointInd = 1;
+    segmentLength = 0;
+    flag = true;
+    segments = pathInfo.segments;
+    if (currentLength < 0 && mask.v.c) {
+      if (pathInfo.tLength < Math.abs(currentLength)) {
+        currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+      }
+      segmentInd = segments.length - 1;
+      points = segments[segmentInd].points;
+      pointInd = points.length - 1;
+      while (currentLength < 0) {
+        currentLength += points[pointInd].partialLength;
+        pointInd -= 1;
+        if (pointInd < 0) {
+          segmentInd -= 1;
+          points = segments[segmentInd].points;
+          pointInd = points.length - 1;
+        }
+      }
+    }
+    points = segments[segmentInd].points;
+    prevPoint = points[pointInd - 1];
+    currentPoint = points[pointInd];
+    partialLength = currentPoint.partialLength;
+  }
+
+  len = letters.length;
+  xPos = 0;
+  yPos = 0;
+  var yOff = documentData.finalSize * 1.2 * 0.714;
+  var firstLine = true;
+  var animatorProps;
+  var animatorSelector;
+  var j;
+  var jLen;
+  var letterValue;
+
+  jLen = animators.length;
+
+  var mult;
+  var ind = -1;
+  var offf;
+  var xPathPos;
+  var yPathPos;
+  var initPathPos = currentLength;
+  var initSegmentInd = segmentInd;
+  var initPointInd = pointInd;
+  var currentLine = -1;
+  var elemOpacity;
+  var sc;
+  var sw;
+  var fc;
+  var k;
+  var letterSw;
+  var letterSc;
+  var letterFc;
+  var letterM = '';
+  var letterP = this.defaultPropsArray;
+  var letterO;
+
+  //
+  if (documentData.j === 2 || documentData.j === 1) {
+    var animatorJustifyOffset = 0;
+    var animatorFirstCharOffset = 0;
+    var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+    var lastIndex = 0;
+    var isNewLine = true;
+
+    for (i = 0; i < len; i += 1) {
+      if (letters[i].n) {
+        if (animatorJustifyOffset) {
+          animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while (lastIndex < i) {
+          letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+          lastIndex += 1;
+        }
+        animatorJustifyOffset = 0;
+        isNewLine = true;
+      } else {
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.t.propType) {
+            if (isNewLine && documentData.j === 2) {
+              animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+            }
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
+            } else {
+              animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
+            }
+          }
+        }
+        isNewLine = false;
+      }
+    }
+    if (animatorJustifyOffset) {
+      animatorJustifyOffset += animatorFirstCharOffset;
+    }
+    while (lastIndex < i) {
+      letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+      lastIndex += 1;
+    }
+  }
+  //
+
+  for (i = 0; i < len; i += 1) {
+    matrixHelper.reset();
+    elemOpacity = 1;
+    if (letters[i].n) {
+      xPos = 0;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      currentLength = initPathPos;
+      firstLine = false;
+      if (this._hasMaskedPath) {
+        segmentInd = initSegmentInd;
+        pointInd = initPointInd;
         points = segments[segmentInd].points;
         prevPoint = points[pointInd - 1];
         currentPoint = points[pointInd];
         partialLength = currentPoint.partialLength;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.finalSize * 1.2 * 0.714;
-    var firstLine = true;
-    var animatorProps, animatorSelector;
-    var j, jLen;
-    var letterValue;
-
-    jLen = animators.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
-
-    //
-    if(documentData.j === 2 || documentData.j === 1) {
-        var animatorJustifyOffset = 0;
-        var animatorFirstCharOffset = 0;
-        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
-        var lastIndex = 0;
-        var isNewLine = true;
-
-        for (i = 0; i < len; i += 1) {
-            if (letters[i].n) {
-                if(animatorJustifyOffset) {
-                    animatorJustifyOffset += animatorFirstCharOffset;
-                }
-                while (lastIndex < i) {
-                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-                    lastIndex += 1;
-                }
-                animatorJustifyOffset = 0;
-                isNewLine = true;
+        segmentLength = 0;
+      }
+      letterM = '';
+      letterFc = '';
+      letterSw = '';
+      letterO = '';
+      letterP = this.defaultPropsArray;
+    } else {
+      if (this._hasMaskedPath) {
+        if (currentLine !== letters[i].line) {
+          switch (documentData.j) {
+            case 1:
+              currentLength += totalLength - documentData.lineWidths[letters[i].line];
+              break;
+            case 2:
+              currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
+              break;
+            default:
+              break;
+          }
+          currentLine = letters[i].line;
+        }
+        if (ind !== letters[i].ind) {
+          if (letters[ind]) {
+            currentLength += letters[ind].extra;
+          }
+          currentLength += letters[i].an / 2;
+          ind = letters[i].ind;
+        }
+        currentLength += (alignment[0] * letters[i].an) * 0.005;
+        var animatorOffset = 0;
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.p.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.p.v[0] * mult[0];
             } else {
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.t.propType) {
-                        if (isNewLine && documentData.j === 2) {
-                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
-                        }
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
-                        if (mult.length) {
-                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
-                        } else {
-                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
-                        }
-                    }
-                }
-                isNewLine = false;
+              animatorOffset += animatorProps.p.v[0] * mult;
             }
+          }
+          if (animatorProps.a.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.a.v[0] * mult[0];
+            } else {
+              animatorOffset += animatorProps.a.v[0] * mult;
+            }
+          }
         }
-        if(animatorJustifyOffset) {
-            animatorJustifyOffset += animatorFirstCharOffset;
-        }
-        while(lastIndex < i) {
-            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-            lastIndex += 1;
-        }
-    }
-    //
-
-    for( i = 0; i < len; i += 1) {
-
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this._hasMaskedPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
+        flag = true;
+        while (flag) {
+          if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+            matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01);
+            flag = false;
+          } else if (points) {
+            segmentLength += currentPoint.partialLength;
+            pointInd += 1;
+            if (pointInd >= points.length) {
+              pointInd = 0;
+              segmentInd += 1;
+              if (!segments[segmentInd]) {
+                if (mask.v.c) {
+                  pointInd = 0;
+                  segmentInd = 0;
+                  points = segments[segmentInd].points;
+                } else {
+                  segmentLength -= currentPoint.partialLength;
+                  points = null;
+                }
+              } else {
                 points = segments[segmentInd].points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
+              }
             }
-            letterO = letterSw = letterFc = letterM = '';
-            letterP = this.defaultPropsArray;
-        }else{
-            if(this._hasMaskedPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += alignment[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.p.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
+            if (points) {
+              prevPoint = currentPoint;
+              currentPoint = points[pointInd];
+              partialLength = currentPoint.partialLength;
+            }
+          }
+        }
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
+      } else {
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
 
-                    }
-                    if (animatorProps.a.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
+        // Grouping alignment
+        matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0);
+      }
 
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.t.propType) {
+          animatorSelector = animators[j].s;
+          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"
+          if (xPos !== 0 || documentData.j !== 0) {
+            if (this._hasMaskedPath) {
+              if (mult.length) {
+                currentLength += animatorProps.t.v * mult[0];
+              } else {
+                currentLength += animatorProps.t.v * mult;
+              }
+            } else if (mult.length) {
+              xPos += animatorProps.t.v * mult[0];
             } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+              xPos += animatorProps.t.v * mult;
             }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.t.propType) {
-                    animatorSelector = animators[j].s;
-                    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"
-                    if(xPos !== 0 || documentData.j !== 0) {
-                        if(this._hasMaskedPath) {
-                            if(mult.length) {
-                                currentLength += animatorProps.t.v*mult[0];
-                            } else {
-                                currentLength += animatorProps.t.v*mult;
-                            }
-                        }else{
-                            if(mult.length) {
-                                xPos += animatorProps.t.v*mult[0];
-                            } else {
-                                xPos += animatorProps.t.v*mult;
-                            }
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim && documentData.fc) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.a.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.s.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = animators[j].a;
-                animatorSelector = animators[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                if (animatorProps.sk.propType) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if (animatorProps.r.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if (animatorProps.ry.propType) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if (animatorProps.rx.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if (animatorProps.o.propType) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
-                        } else {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim && documentData.fc) {
-                    if(animatorProps.fc.propType){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                            }
-                        }
-                    }
-                    if(animatorProps.fh.propType){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if(animatorProps.fs.propType){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if(animatorProps.fb.propType){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-
-                if (animatorProps.p.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(this._hasMaskedPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim && documentData.fc){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this._hasMaskedPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
-                if (textData.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= alignment[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.finalSize;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                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]];
-            }
-            letterO = elemOpacity;
+          }
         }
-
-        if(renderedLettersCount <= i) {
-            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            this.renderedLetters.push(letterValue);
-            renderedLettersCount += 1;
-            this.lettersChangedFlag = true;
+      }
+      if (documentData.strokeWidthAnim) {
+        sw = documentData.sw || 0;
+      }
+      if (documentData.strokeColorAnim) {
+        if (documentData.sc) {
+          sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
         } else {
-            letterValue = this.renderedLetters[i];
-            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+          sc = [0, 0, 0];
         }
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.a.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+
+          if (mult.length) {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.s.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (mult.length) {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1);
+          } else {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        animatorSelector = animators[j].s;
+        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+        if (animatorProps.sk.propType) {
+          if (mult.length) {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+          } else {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+          }
+        }
+        if (animatorProps.r.propType) {
+          if (mult.length) {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+          } else {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult);
+          }
+        }
+        if (animatorProps.ry.propType) {
+          if (mult.length) {
+            matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
+          } else {
+            matrixHelper.rotateY(animatorProps.ry.v * mult);
+          }
+        }
+        if (animatorProps.rx.propType) {
+          if (mult.length) {
+            matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
+          } else {
+            matrixHelper.rotateX(animatorProps.rx.v * mult);
+          }
+        }
+        if (animatorProps.o.propType) {
+          if (mult.length) {
+            elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0];
+          } else {
+            elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult;
+          }
+        }
+        if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+          if (mult.length) {
+            sw += animatorProps.sw.v * mult[0];
+          } else {
+            sw += animatorProps.sw.v * mult;
+          }
+        }
+        if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+          for (k = 0; k < 3; k += 1) {
+            if (mult.length) {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
+            } else {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
+            }
+          }
+        }
+        if (documentData.fillColorAnim && documentData.fc) {
+          if (animatorProps.fc.propType) {
+            for (k = 0; k < 3; k += 1) {
+              if (mult.length) {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
+              } else {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
+              }
+            }
+          }
+          if (animatorProps.fh.propType) {
+            if (mult.length) {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
+            } else {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult);
+            }
+          }
+          if (animatorProps.fs.propType) {
+            if (mult.length) {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
+            } else {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
+            }
+          }
+          if (animatorProps.fb.propType) {
+            if (mult.length) {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
+            } else {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
+            }
+          }
+        }
+      }
+
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+
+        if (animatorProps.p.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (this._hasMaskedPath) {
+            if (mult.length) {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+            } else {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+            }
+          } else if (mult.length) {
+            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+          }
+        }
+      }
+      if (documentData.strokeWidthAnim) {
+        letterSw = sw < 0 ? 0 : sw;
+      }
+      if (documentData.strokeColorAnim) {
+        letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
+      }
+
+      if (this._hasMaskedPath) {
+        matrixHelper.translate(0, -documentData.ls);
+
+        matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0);
+        if (textData.p.p) {
+          tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+          var rot = (Math.atan(tanAngle) * 180) / Math.PI;
+          if (currentPoint.point[0] < prevPoint.point[0]) {
+            rot += 180;
+          }
+          matrixHelper.rotate((-rot * Math.PI) / 180);
+        }
+        matrixHelper.translate(xPathPos, yPathPos, 0);
+        currentLength -= (alignment[0] * letters[i].an) * 0.005;
+        if (letters[i + 1] && ind !== letters[i + 1].ind) {
+          currentLength += letters[i].an / 2;
+          currentLength += (documentData.tr * 0.001) * documentData.finalSize;
+        }
+      } else {
+        matrixHelper.translate(xPos, yPos, 0);
+
+        if (documentData.ps) {
+          // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+          matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+        }
+        switch (documentData.j) {
+          case 1:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
+            break;
+          case 2:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
+            break;
+          default:
+            break;
+        }
+        matrixHelper.translate(0, -documentData.ls);
+        matrixHelper.translate(offf, 0, 0);
+        matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0);
+        xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize;
+      }
+      if (renderType === 'html') {
+        letterM = matrixHelper.toCSS();
+      } else if (renderType === 'svg') {
+        letterM = matrixHelper.to2dCSS();
+      } else {
+        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]];
+      }
+      letterO = elemOpacity;
     }
+
+    if (renderedLettersCount <= i) {
+      letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
+      this.renderedLetters.push(letterValue);
+      renderedLettersCount += 1;
+      this.lettersChangedFlag = true;
+    } else {
+      letterValue = this.renderedLetters[i];
+      this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+    }
+  }
 };
 
-TextAnimatorProperty.prototype.getValue = function(){
-	if(this._elem.globalData.frameId === this._frameId){
-        return;
-    }
-    this._frameId = this._elem.globalData.frameId;
-    this.iterateDynamicProperties();
+TextAnimatorProperty.prototype.getValue = function () {
+  if (this._elem.globalData.frameId === this._frameId) {
+    return;
+  }
+  this._frameId = this._elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 TextAnimatorProperty.prototype.mHelper = new Matrix();
 TextAnimatorProperty.prototype.defaultPropsArray = [];
 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
+
+/* global PropertyFactory, degToRads, TextSelectorProp */
+/* exported TextAnimatorDataProperty */
+
 function TextAnimatorDataProperty(elem, animatorProps, container) {
-	var defaultData = {propType:false};
-	var getProp = PropertyFactory.getProp;
-	var textAnimator_animatables = animatorProps.a;
-	this.a = {
-		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
-		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
-		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
-		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
-		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
-		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
-		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
-		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
-		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
-		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
-		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
-		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
-		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
-		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
-		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
-		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
-	};
+  var defaultData = { propType: false };
+  var getProp = PropertyFactory.getProp;
+  var textAnimatorAnimatables = animatorProps.a;
+  this.a = {
+    r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
+    rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
+    ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
+    sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
+    sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
+    s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
+    a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
+    o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
+    p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
+    sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
+    sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
+    fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
+    fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
+    fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
+    fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
+    t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData,
+  };
 
-	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
-    this.s.t = animatorProps.s.t;
+  this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
+  this.s.t = animatorProps.s.t;
 }
-function LetterProps(o, sw, sc, fc, m, p){
+
+function LetterProps(o, sw, sc, fc, m, p) {
+  this.o = o;
+  this.sw = sw;
+  this.sc = sc;
+  this.fc = fc;
+  this.m = m;
+  this.p = p;
+  this._mdf = {
+    o: true,
+    sw: !!sw,
+    sc: !!sc,
+    fc: !!fc,
+    m: true,
+    p: true,
+  };
+}
+
+LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
+  this._mdf.o = false;
+  this._mdf.sw = false;
+  this._mdf.sc = false;
+  this._mdf.fc = false;
+  this._mdf.m = false;
+  this._mdf.p = false;
+  var updated = false;
+
+  if (this.o !== o) {
     this.o = o;
+    this._mdf.o = true;
+    updated = true;
+  }
+  if (this.sw !== sw) {
     this.sw = sw;
+    this._mdf.sw = true;
+    updated = true;
+  }
+  if (this.sc !== sc) {
     this.sc = sc;
+    this._mdf.sc = true;
+    updated = true;
+  }
+  if (this.fc !== fc) {
     this.fc = fc;
+    this._mdf.fc = true;
+    updated = true;
+  }
+  if (this.m !== m) {
     this.m = m;
+    this._mdf.m = true;
+    updated = true;
+  }
+  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])) {
     this.p = p;
-    this._mdf = {
-    	o: true,
-    	sw: !!sw,
-    	sc: !!sc,
-    	fc: !!fc,
-    	m: true,
-    	p: true
-    };
-}
-
-LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
-	this._mdf.o = false;
-	this._mdf.sw = false;
-	this._mdf.sc = false;
-	this._mdf.fc = false;
-	this._mdf.m = false;
-	this._mdf.p = false;
-	var updated = false;
-
-	if(this.o !== o) {
-		this.o = o;
-		this._mdf.o = true;
-		updated = true;
-	}
-	if(this.sw !== sw) {
-		this.sw = sw;
-		this._mdf.sw = true;
-		updated = true;
-	}
-	if(this.sc !== sc) {
-		this.sc = sc;
-		this._mdf.sc = true;
-		updated = true;
-	}
-	if(this.fc !== fc) {
-		this.fc = fc;
-		this._mdf.fc = true;
-		updated = true;
-	}
-	if(this.m !== m) {
-		this.m = m;
-		this._mdf.m = true;
-		updated = true;
-	}
-	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])) {
-		this.p = p;
-		this._mdf.p = true;
-		updated = true;
-	}
-	return updated;
-};
-function TextProperty(elem, data){
-	this._frameId = initialDefaultFrame;
-	this.pv = '';
-	this.v = '';
-	this.kf = false;
-	this._isFirstFrame = true;
-	this._mdf = false;
-    this.data = data;
-	this.elem = elem;
-    this.comp = this.elem.comp;
-	this.keysIndex = 0;
-    this.canResize = false;
-    this.minimumFontSize = 1;
-    this.effectsSequence = [];
-	this.currentData = {
-		ascent: 0,
-        boxWidth: this.defaultBoxWidth,
-        f: '',
-        fStyle: '',
-        fWeight: '',
-        fc: '',
-        j: '',
-        justifyOffset: '',
-        l: [],
-        lh: 0,
-        lineWidths: [],
-        ls: '',
-        of: '',
-        s: '',
-        sc: '',
-        sw: 0,
-        t: 0,
-        tr: 0,
-        sz:0,
-        ps:null,
-        fillColorAnim: false,
-        strokeColorAnim: false,
-        strokeWidthAnim: false,
-        yOffset: 0,
-        finalSize:0,
-        finalText:[],
-        finalLineHeight: 0,
-        __complete: false
-
-	};
-    this.copyData(this.currentData, this.data.d.k[0].s);
-
-    if(!this.searchProperty()) {
-        this.completeTextData(this.currentData);
-    }
-}
-
-TextProperty.prototype.defaultBoxWidth = [0,0];
-
-TextProperty.prototype.copyData = function(obj, data) {
-    for(var s in data) {
-        if(data.hasOwnProperty(s)) {
-            obj[s] = data[s];
-        }
-    }
-    return obj;
-}
-
-TextProperty.prototype.setCurrentData = function(data){
-    if(!data.__complete) {
-        this.completeTextData(data);
-    }
-    this.currentData = data;
-    this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
-    this._mdf = true;
+    this._mdf.p = true;
+    updated = true;
+  }
+  return updated;
 };
 
-TextProperty.prototype.searchProperty = function() {
-    return this.searchKeyframes();
-};
+/* global FontManager, initialDefaultFrame, getFontProperties */
+/* exported TextProperty */
 
-TextProperty.prototype.searchKeyframes = function() {
-    this.kf = this.data.d.k.length > 1;
-    if(this.kf) {
-        this.addEffect(this.getKeyframeValue.bind(this));
-    }
-    return this.kf;
+function TextProperty(elem, data) {
+  this._frameId = initialDefaultFrame;
+  this.pv = '';
+  this.v = '';
+  this.kf = false;
+  this._isFirstFrame = true;
+  this._mdf = false;
+  this.data = data;
+  this.elem = elem;
+  this.comp = this.elem.comp;
+  this.keysIndex = 0;
+  this.canResize = false;
+  this.minimumFontSize = 1;
+  this.effectsSequence = [];
+  this.currentData = {
+    ascent: 0,
+    boxWidth: this.defaultBoxWidth,
+    f: '',
+    fStyle: '',
+    fWeight: '',
+    fc: '',
+    j: '',
+    justifyOffset: '',
+    l: [],
+    lh: 0,
+    lineWidths: [],
+    ls: '',
+    of: '',
+    s: '',
+    sc: '',
+    sw: 0,
+    t: 0,
+    tr: 0,
+    sz: 0,
+    ps: null,
+    fillColorAnim: false,
+    strokeColorAnim: false,
+    strokeWidthAnim: false,
+    yOffset: 0,
+    finalSize: 0,
+    finalText: [],
+    finalLineHeight: 0,
+    __complete: false,
+
+  };
+  this.copyData(this.currentData, this.data.d.k[0].s);
+
+  if (!this.searchProperty()) {
+    this.completeTextData(this.currentData);
+  }
 }
 
-TextProperty.prototype.addEffect = function(effectFunction) {
-	this.effectsSequence.push(effectFunction);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.defaultBoxWidth = [0, 0];
+
+TextProperty.prototype.copyData = function (obj, data) {
+  for (var s in data) {
+    if (Object.prototype.hasOwnProperty.call(data, s)) {
+      obj[s] = data[s];
+    }
+  }
+  return obj;
 };
 
-TextProperty.prototype.getValue = function(_finalValue) {
-    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
-        return;
-    }
-    this.currentData.t = this.data.d.k[this.keysIndex].s.t;
-    var currentValue = this.currentData;
-    var currentIndex = this.keysIndex;
-    if(this.lock) {
-        this.setCurrentData(this.currentData);
-        return;
-    }
-    this.lock = true;
-    this._mdf = false;
-    var multipliedValue;
-    var i, len = this.effectsSequence.length;
-    var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
-    for(i = 0; i < len; i += 1) {
-        //Checking if index changed to prevent creating a new object every time the expression updates.
-        if(currentIndex !== this.keysIndex) {
-            finalValue = this.effectsSequence[i](finalValue, finalValue.t);
-        } else {
-            finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
-        }
-    }
-    if(currentValue !== finalValue) {
-        this.setCurrentData(finalValue);
-    }
-    this.pv = this.v = this.currentData;
-    this.lock = false;
-    this.frameId = this.elem.globalData.frameId;
-}
+TextProperty.prototype.setCurrentData = function (data) {
+  if (!data.__complete) {
+    this.completeTextData(data);
+  }
+  this.currentData = data;
+  this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+  this._mdf = true;
+};
 
-TextProperty.prototype.getKeyframeValue = function() {
-    var textKeys = this.data.d.k, textDocumentData;
-    var frameNum = this.elem.comp.renderedFrame;
-    var i = 0, len = textKeys.length;
-    while(i <= len - 1) {
-        textDocumentData = textKeys[i].s;
-        if(i === len - 1 || textKeys[i+1].t > frameNum){
-            break;
-        }
+TextProperty.prototype.searchProperty = function () {
+  return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function () {
+  this.kf = this.data.d.k.length > 1;
+  if (this.kf) {
+    this.addEffect(this.getKeyframeValue.bind(this));
+  }
+  return this.kf;
+};
+
+TextProperty.prototype.addEffect = function (effectFunction) {
+  this.effectsSequence.push(effectFunction);
+  this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function (_finalValue) {
+  if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+    return;
+  }
+  this.currentData.t = this.data.d.k[this.keysIndex].s.t;
+  var currentValue = this.currentData;
+  var currentIndex = this.keysIndex;
+  if (this.lock) {
+    this.setCurrentData(this.currentData);
+    return;
+  }
+  this.lock = true;
+  this._mdf = false;
+  var i; var
+    len = this.effectsSequence.length;
+  var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
+  for (i = 0; i < len; i += 1) {
+    // Checking if index changed to prevent creating a new object every time the expression updates.
+    if (currentIndex !== this.keysIndex) {
+      finalValue = this.effectsSequence[i](finalValue, finalValue.t);
+    } else {
+      finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
+    }
+  }
+  if (currentValue !== finalValue) {
+    this.setCurrentData(finalValue);
+  }
+  this.v = this.currentData;
+  this.pv = this.v;
+  this.lock = false;
+  this.frameId = this.elem.globalData.frameId;
+};
+
+TextProperty.prototype.getKeyframeValue = function () {
+  var textKeys = this.data.d.k;
+  var frameNum = this.elem.comp.renderedFrame;
+  var i = 0; var
+    len = textKeys.length;
+  while (i <= len - 1) {
+    if (i === len - 1 || textKeys[i + 1].t > frameNum) {
+      break;
+    }
+    i += 1;
+  }
+  if (this.keysIndex !== i) {
+    this.keysIndex = i;
+  }
+  return this.data.d.k[this.keysIndex].s;
+};
+
+TextProperty.prototype.buildFinalText = function (text) {
+  var combinedCharacters = FontManager.getCombinedCharacterCodes();
+  var charactersArray = [];
+  var i = 0; var
+    len = text.length;
+  var charCode;
+  while (i < len) {
+    charCode = text.charCodeAt(i);
+    if (combinedCharacters.indexOf(charCode) !== -1) {
+      charactersArray[charactersArray.length - 1] += text.charAt(i);
+    } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      charCode = text.charCodeAt(i + 1);
+      if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
+        charactersArray.push(text.substr(i, 2));
         i += 1;
+      } else {
+        charactersArray.push(text.charAt(i));
+      }
+    } else {
+      charactersArray.push(text.charAt(i));
     }
-    if(this.keysIndex !== i) {
-        this.keysIndex = i;
-    }
-    return this.data.d.k[this.keysIndex].s;
+    i += 1;
+  }
+  return charactersArray;
 };
 
-TextProperty.prototype.buildFinalText = function(text) {
-    var combinedCharacters = FontManager.getCombinedCharacterCodes();
-    var charactersArray = [];
-    var i = 0, len = text.length;
-    var charCode;
-    while (i < len) {
-        charCode = text.charCodeAt(i);
-        if (combinedCharacters.indexOf(charCode) !== -1) {
-            charactersArray[charactersArray.length - 1] += text.charAt(i);
-        } else {
-            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
-                charCode = text.charCodeAt(i + 1);
-                if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
-                    charactersArray.push(text.substr(i, 2));
-                    ++i;
-                } else {
-                    charactersArray.push(text.charAt(i));
-                }
-            } else {
-                charactersArray.push(text.charAt(i));
-            }
-        }
-        i += 1;
-    }
-    return charactersArray;
-}
-
-TextProperty.prototype.completeTextData = function(documentData) {
-    documentData.__complete = true;
-    var fontManager = this.elem.globalData.fontManager;
-    var data = this.data;
-    var letters = [];
-    var i, len;
-    var newLineFlag, index = 0, val;
-    var anchorGrouping = data.m.g;
-    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-    var lineWidth = 0;
-    var maxLineWidth = 0;
-    var j, jLen;
-    var fontData = fontManager.getFontByName(documentData.f);
-    var charData, cLength = 0;
-    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
-
-    var fWeight = 'normal', fStyle = 'normal';
-    len = styles.length;
-    var styleName;
-    for(i=0;i<len;i+=1){
-        styleName = styles[i].toLowerCase();
-        switch(styleName) {
-            case 'italic':
-            fStyle = 'italic';
-            break;
-            case 'bold':
-            fWeight = '700';
-            break;
-            case 'black':
-            fWeight = '900';
-            break;
-            case 'medium':
-            fWeight = '500';
-            break;
-            case 'regular':
-            case 'normal':
-            fWeight = '400';
-            break;
-            case 'light':
-            case 'thin':
-            fWeight = '200';
-            break;
-        }
-    }
-    documentData.fWeight = fontData.fWeight || fWeight;
-    documentData.fStyle = fStyle;
-    documentData.finalSize = documentData.s;
-    documentData.finalText = this.buildFinalText(documentData.t);
-    len = documentData.finalText.length;
-    documentData.finalLineHeight = documentData.lh;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var charCode;
-    if(documentData.sz){
-        var flag = true;
-        var boxWidth = documentData.sz[0];
-        var boxHeight = documentData.sz[1];
-        var currentHeight, finalText;
-        while(flag) {
-            finalText = this.buildFinalText(documentData.t);
-            currentHeight = 0;
-            lineWidth = 0;
-            len = finalText.length;
-            trackingOffset = documentData.tr/1000*documentData.finalSize;
-            var lastSpaceIndex = -1;
-            for(i=0;i<len;i+=1){
-                charCode = finalText[i].charCodeAt(0);
-                newLineFlag = false;
-                if(finalText[i] === ' '){
-                    lastSpaceIndex = i;
-                }else if(charCode === 13 || charCode === 3){
-                    lineWidth = 0;
-                    newLineFlag = true;
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-                }else{
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
-                }
-                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
-                    if(lastSpaceIndex === -1){
-                        len += 1;
-                    } else {
-                        i = lastSpaceIndex;
-                    }
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
-                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
-                    lastSpaceIndex = -1;
-                    lineWidth = 0;
-                }else {
-                    lineWidth += cLength;
-                    lineWidth += trackingOffset;
-                }
-            }
-            currentHeight += fontData.ascent*documentData.finalSize/100;
-            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
-                documentData.finalSize -= 1;
-                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
-            } else {
-                documentData.finalText = finalText;
-                len = documentData.finalText.length;
-                flag = false;
-            }
-        }
-
-    }
-    lineWidth = - trackingOffset;
+TextProperty.prototype.completeTextData = function (documentData) {
+  documentData.__complete = true;
+  var fontManager = this.elem.globalData.fontManager;
+  var data = this.data;
+  var letters = [];
+  var i; var
+    len;
+  var newLineFlag; var index = 0; var
+    val;
+  var anchorGrouping = data.m.g;
+  var currentSize = 0; var currentPos = 0; var currentLine = 0; var
+    lineWidths = [];
+  var lineWidth = 0;
+  var maxLineWidth = 0;
+  var j; var
+    jLen;
+  var fontData = fontManager.getFontByName(documentData.f);
+  var charData; var
     cLength = 0;
-    var uncollapsedSpaces = 0;
-    var currentChar;
-    for (i = 0;i < len ;i += 1) {
+
+  var fontProps = getFontProperties(fontData);
+  documentData.fWeight = fontProps.weight;
+  documentData.fStyle = fontProps.style;
+  documentData.finalSize = documentData.s;
+  documentData.finalText = this.buildFinalText(documentData.t);
+  len = documentData.finalText.length;
+  documentData.finalLineHeight = documentData.lh;
+  var trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+  var charCode;
+  if (documentData.sz) {
+    var flag = true;
+    var boxWidth = documentData.sz[0];
+    var boxHeight = documentData.sz[1];
+    var currentHeight; var
+      finalText;
+    while (flag) {
+      finalText = this.buildFinalText(documentData.t);
+      currentHeight = 0;
+      lineWidth = 0;
+      len = finalText.length;
+      trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+      var lastSpaceIndex = -1;
+      for (i = 0; i < len; i += 1) {
+        charCode = finalText[i].charCodeAt(0);
         newLineFlag = false;
-        currentChar = documentData.finalText[i];
-        charCode = currentChar.charCodeAt(0);
-        if (charCode === 13 || charCode === 3) {
-            uncollapsedSpaces = 0;
-            lineWidths.push(lineWidth);
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidth = - 2 * trackingOffset;
-            val = '';
-            newLineFlag = true;
-            currentLine += 1;
-        }else{
-            val = currentChar;
+        if (finalText[i] === ' ') {
+          lastSpaceIndex = i;
+        } else if (charCode === 13 || charCode === 3) {
+          lineWidth = 0;
+          newLineFlag = true;
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
         }
-        if(fontManager.chars){
-            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-        }else{
-            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
-            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
-        }
-
-        //
-        if(currentChar === ' '){
-            uncollapsedSpaces += cLength + trackingOffset;
+        if (fontManager.chars) {
+          charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+          cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
         } else {
-            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
-            uncollapsedSpaces = 0;
+          // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+          cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
         }
-        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
-        if(anchorGrouping == 2){
-            currentSize += cLength;
-            if(val === '' || val === ' ' || i === len - 1){
-                if(val === '' || val === ' '){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                index += 1;
-                currentSize = 0;
-            }
-        }else if(anchorGrouping == 3){
-            currentSize += cLength;
-            if(val === '' || i === len - 1){
-                if(val === ''){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                currentSize = 0;
-                index += 1;
-            }
-        }else{
-            letters[index].ind = index;
-            letters[index].extra = 0;
-            index += 1;
+        if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
+          if (lastSpaceIndex === -1) {
+            len += 1;
+          } else {
+            i = lastSpaceIndex;
+          }
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
+          finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r');
+          // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+          lastSpaceIndex = -1;
+          lineWidth = 0;
+        } else {
+          lineWidth += cLength;
+          lineWidth += trackingOffset;
         }
+      }
+      currentHeight += (fontData.ascent * documentData.finalSize) / 100;
+      if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+        documentData.finalSize -= 1;
+        documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s;
+      } else {
+        documentData.finalText = finalText;
+        len = documentData.finalText.length;
+        flag = false;
+      }
     }
-    documentData.l = letters;
-    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-    lineWidths.push(lineWidth);
-    if(documentData.sz){
-        documentData.boxWidth = documentData.sz[0];
+  }
+  lineWidth = -trackingOffset;
+  cLength = 0;
+  var uncollapsedSpaces = 0;
+  var currentChar;
+  for (i = 0; i < len; i += 1) {
+    newLineFlag = false;
+    currentChar = documentData.finalText[i];
+    charCode = currentChar.charCodeAt(0);
+    if (charCode === 13 || charCode === 3) {
+      uncollapsedSpaces = 0;
+      lineWidths.push(lineWidth);
+      maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+      lineWidth = -2 * trackingOffset;
+      val = '';
+      newLineFlag = true;
+      currentLine += 1;
+    } else {
+      val = currentChar;
+    }
+    if (fontManager.chars) {
+      charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+      cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
+    } else {
+      // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+      // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+      cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+    }
+
+    //
+    if (currentChar === ' ') {
+      uncollapsedSpaces += cLength + trackingOffset;
+    } else {
+      lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+      uncollapsedSpaces = 0;
+    }
+    letters.push({
+      l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0,
+    });
+    if (anchorGrouping == 2) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || val === ' ' || i === len - 1) {
+        if (val === '' || val === ' ') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        index += 1;
+        currentSize = 0;
+      }
+    } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || i === len - 1) {
+        if (val === '') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        currentSize = 0;
+        index += 1;
+      }
+    } else {
+      letters[index].ind = index;
+      letters[index].extra = 0;
+      index += 1;
+    }
+  }
+  documentData.l = letters;
+  maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+  lineWidths.push(lineWidth);
+  if (documentData.sz) {
+    documentData.boxWidth = documentData.sz[0];
+    documentData.justifyOffset = 0;
+  } else {
+    documentData.boxWidth = maxLineWidth;
+    switch (documentData.j) {
+      case 1:
+        documentData.justifyOffset = -documentData.boxWidth;
+        break;
+      case 2:
+        documentData.justifyOffset = -documentData.boxWidth / 2;
+        break;
+      default:
         documentData.justifyOffset = 0;
-    }else{
-        documentData.boxWidth = maxLineWidth;
-        switch(documentData.j){
-            case 1:
-                documentData.justifyOffset = - documentData.boxWidth;
-                break;
-            case 2:
-                documentData.justifyOffset = - documentData.boxWidth/2;
-                break;
-            default:
-                documentData.justifyOffset = 0;
-        }
     }
-    documentData.lineWidths = lineWidths;
+  }
+  documentData.lineWidths = lineWidths;
 
-    var animators = data.a, animatorData, letterData;
-    jLen = animators.length;
-    var based, ind, indexes = [];
-    for(j=0;j<jLen;j+=1){
-        animatorData = animators[j];
-        if(animatorData.a.sc){
-            documentData.strokeColorAnim = true;
-        }
-        if(animatorData.a.sw){
-            documentData.strokeWidthAnim = true;
-        }
-        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
-            documentData.fillColorAnim = true;
-        }
-        ind = 0;
-        based = animatorData.s.b;
-        for(i=0;i<len;i+=1){
-            letterData = letters[i];
-            letterData.anIndexes[j] = ind;
-            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))){
-                if(animatorData.s.rn === 1){
-                    indexes.push(ind);
-                }
-                ind += 1;
-            }
-        }
-        data.a[j].s.totalChars = ind;
-        var currentInd = -1, newInd;
-        if(animatorData.s.rn === 1){
-            for(i = 0; i < len; i += 1){
-                letterData = letters[i];
-                if(currentInd != letterData.anIndexes[j]){
-                    currentInd = letterData.anIndexes[j];
-                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                }
-                letterData.anIndexes[j] = newInd;
-            }
-        }
+  var animators = data.a; var animatorData; var
+    letterData;
+  jLen = animators.length;
+  var based; var ind; var
+    indexes = [];
+  for (j = 0; j < jLen; j += 1) {
+    animatorData = animators[j];
+    if (animatorData.a.sc) {
+      documentData.strokeColorAnim = true;
     }
-    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
-    documentData.ls = documentData.ls || 0;
-    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+    if (animatorData.a.sw) {
+      documentData.strokeWidthAnim = true;
+    }
+    if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
+      documentData.fillColorAnim = true;
+    }
+    ind = 0;
+    based = animatorData.s.b;
+    for (i = 0; i < len; i += 1) {
+      letterData = letters[i];
+      letterData.anIndexes[j] = ind;
+      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))) { // eslint-disable-line eqeqeq
+        if (animatorData.s.rn === 1) {
+          indexes.push(ind);
+        }
+        ind += 1;
+      }
+    }
+    data.a[j].s.totalChars = ind;
+    var currentInd = -1; var
+      newInd;
+    if (animatorData.s.rn === 1) {
+      for (i = 0; i < len; i += 1) {
+        letterData = letters[i];
+        if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq
+          currentInd = letterData.anIndexes[j];
+          newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
+        }
+        letterData.anIndexes[j] = newInd;
+      }
+    }
+  }
+  documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
+  documentData.ls = documentData.ls || 0;
+  documentData.ascent = (fontData.ascent * documentData.finalSize) / 100;
 };
 
-TextProperty.prototype.updateDocumentData = function(newData, index) {
-	index = index === undefined ? this.keysIndex : index;
-    var dData = this.copyData({}, this.data.d.k[index].s);
-    dData = this.copyData(dData, newData);
-    this.data.d.k[index].s = dData;
-    this.recalculate(index);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.updateDocumentData = function (newData, index) {
+  index = index === undefined ? this.keysIndex : index;
+  var dData = this.copyData({}, this.data.d.k[index].s);
+  dData = this.copyData(dData, newData);
+  this.data.d.k[index].s = dData;
+  this.recalculate(index);
+  this.elem.addDynamicProperty(this);
 };
 
-TextProperty.prototype.recalculate = function(index) {
-    var dData = this.data.d.k[index].s;
-    dData.__complete = false;
-    this.keysIndex = 0;
-    this._isFirstFrame = true;
-    this.getValue(dData);
-}
-
-TextProperty.prototype.canResizeFont = function(_canResize) {
-    this.canResize = _canResize;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.recalculate = function (index) {
+  var dData = this.data.d.k[index].s;
+  dData.__complete = false;
+  this.keysIndex = 0;
+  this._isFirstFrame = true;
+  this.getValue(dData);
 };
 
-TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
-    this.minimumFontSize = Math.floor(_fontValue) || 1;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.canResizeFont = function (_canResize) {
+  this.canResize = _canResize;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
 };
 
-var TextSelectorProp = (function(){
-    var max = Math.max;
-    var min = Math.min;
-    var floor = Math.floor;
+TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
+  this.minimumFontSize = Math.floor(_fontValue) || 1;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
+};
 
-    function TextSelectorProp(elem,data){
-        this._currentTextLength = -1;
-        this.k = false;
-        this.data = data;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.finalS = 0;
-        this.finalE = 0;
-        this.initDynamicPropertyContainer(elem);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
-        if('e' in data){
-            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
-        }else{
-            this.e = {v:100};
+/* global extendPrototype, BezierFactory, PropertyFactory, DynamicPropertyContainer */
+/* exported TextSelectorProp */
+
+var TextSelectorProp = (function () {
+  var max = Math.max;
+  var min = Math.min;
+  var floor = Math.floor;
+
+  function TextSelectorPropFactory(elem, data) {
+    this._currentTextLength = -1;
+    this.k = false;
+    this.data = data;
+    this.elem = elem;
+    this.comp = elem.comp;
+    this.finalS = 0;
+    this.finalE = 0;
+    this.initDynamicPropertyContainer(elem);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this);
+    if ('e' in data) {
+      this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
+    } else {
+      this.e = { v: 100 };
+    }
+    this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this);
+    this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this);
+    this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this);
+    this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
+    if (!this.dynamicProperties.length) {
+      this.getValue();
+    }
+  }
+
+  TextSelectorPropFactory.prototype = {
+    getMult: function (ind) {
+      if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+        this.getValue();
+      }
+      // var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+      var x1 = 0;
+      var y1 = 0;
+      var x2 = 1;
+      var y2 = 1;
+      if (this.ne.v > 0) {
+        x1 = this.ne.v / 100.0;
+      } else {
+        y1 = -this.ne.v / 100.0;
+      }
+      if (this.xe.v > 0) {
+        x2 = 1.0 - this.xe.v / 100.0;
+      } else {
+        y2 = 1.0 + this.xe.v / 100.0;
+      }
+      var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
+
+      var mult = 0;
+      var s = this.finalS;
+      var e = this.finalE;
+      var type = this.data.sh;
+      if (type === 2) {
+        if (e === s) {
+          mult = ind >= e ? 1 : 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
-        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
-        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
-        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
-        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
-        if(!this.dynamicProperties.length){
-            this.getValue();
+        mult = easer(mult);
+      } else if (type === 3) {
+        if (e === s) {
+          mult = ind >= e ? 0 : 1;
+        } else {
+          mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
+
+        mult = easer(mult);
+      } else if (type === 4) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
+          if (mult < 0.5) {
+            mult *= 2;
+          } else {
+            mult = 1 - 2 * (mult - 0.5);
+          }
+        }
+        mult = easer(mult);
+      } else if (type === 5) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          var tot = e - s;
+          /* ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          var x = -tot / 2 + ind;
+          var a = tot / 2;
+          mult = Math.sqrt(1 - (x * x) / (a * a));
+        }
+        mult = easer(mult);
+      } else if (type === 6) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line
+        }
+        mult = easer(mult);
+      } else {
+        if (ind >= floor(s)) {
+          if (ind - s < 0) {
+            mult = max(0, min(min(e, 1) - (s - ind), 1));
+          } else {
+            mult = max(0, min(e - ind, 1));
+          }
+        }
+        mult = easer(mult);
+      }
+      return mult * this.a.v;
+    },
+    getValue: function (newCharsFlag) {
+      this.iterateDynamicProperties();
+      this._mdf = newCharsFlag || this._mdf;
+      this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+      if (newCharsFlag && this.data.r === 2) {
+        this.e.v = this._currentTextLength;
+      }
+      var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
+      var o = this.o.v / divisor;
+      var s = this.s.v / divisor + o;
+      var e = (this.e.v / divisor) + o;
+      if (s > e) {
+        var _s = s;
+        s = e;
+        e = _s;
+      }
+      this.finalS = s;
+      this.finalE = e;
+    },
+  };
+  extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
+
+  function getTextSelectorProp(elem, data, arr) {
+    return new TextSelectorPropFactory(elem, data, arr);
+  }
+
+  return {
+    getTextSelectorProp: getTextSelectorProp,
+  };
+}());
+
+/* global createSizedArray, pooling */
+/* exported poolFactory */
+
+var poolFactory = (function () {
+  return function (initialLength, _create, _release) {
+    var _length = 0;
+    var _maxLength = initialLength;
+    var pool = createSizedArray(_maxLength);
+
+    var ob = {
+      newElement: newElement,
+      release: release,
+    };
+
+    function newElement() {
+      var element;
+      if (_length) {
+        _length -= 1;
+        element = pool[_length];
+      } else {
+        element = _create();
+      }
+      return element;
     }
 
-    TextSelectorProp.prototype = {
-        getMult: function(ind) {
-            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
-                this.getValue();
-            }
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var x1 = 0;
-            var y1 = 0;
-            var x2 = 1;
-            var y2 = 1;
-            if(this.ne.v > 0) {
-                x1 = this.ne.v / 100.0;
-            }
-            else {
-                y1 = -this.ne.v / 100.0;
-            }
-            if(this.xe.v > 0) {
-                x2 = 1.0 - this.xe.v / 100.0;
-            }
-            else {
-                y2 = 1.0 + this.xe.v / 100.0;
-            }
-            var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
-
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if (type === 2){
-                if (e === s) {
-                    mult = ind >= e ? 1 : 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                }
-                mult = easer(mult);
-            } else if(type === 3) {
-                if (e === s) {
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
-                }
-
-                mult = easer(mult);
-            } else if (type === 4) {
-                if (e === s) {
-                    mult = 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                    if (mult < 0.5) {
-                        mult *= 2;
-                    } else {
-                        mult = 1 - 2 * (mult - 0.5);
-                    }
-                }
-                mult = easer(mult);
-            } else if (type === 5) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x * x) / (a * a));
-                }
-                mult = easer(mult);
-            } else if (type === 6) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
-                }
-                mult = easer(mult);
-            } else {
-                if (ind >= floor(s)) {
-                    if (ind - s < 0) {
-                        mult = max(0, min(min(e, 1) - (s - ind), 1));
-                    } else {
-                        mult = max(0, min(e - ind, 1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        },
-        getValue: function(newCharsFlag) {
-            this.iterateDynamicProperties();
-            this._mdf = newCharsFlag || this._mdf;
-            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
-            if(newCharsFlag && this.data.r === 2) {
-                this.e.v = this._currentTextLength;
-            }
-            var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-    }
-    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
+    function release(element) {
+      if (_length === _maxLength) {
+        pool = pooling.double(pool);
+        _maxLength *= 2;
+      }
+      if (_release) {
+        _release(element);
+      }
+      pool[_length] = element;
+      _length += 1;
     }
 
+    return ob;
+  };
+}());
+
+/* global createSizedArray */
+/* exported pooling */
+
+var pooling = (function () {
+  function double(arr) {
+    return arr.concat(createSizedArray(arr.length));
+  }
+
+  return {
+    double: double,
+  };
+}());
+
+/* global createTypedArray, poolFactory */
+/* exported pointPool */
+
+var pointPool = (function () {
+  function create() {
+    return createTypedArray('float32', 2);
+  }
+  return poolFactory(8, create);
+}());
+
+/* global ShapePath, pointPool, poolFactory */
+/* exported shapePool */
+
+var shapePool = (function () {
+  function create() {
+    return new ShapePath();
+  }
+
+  function release(shapePath) {
+    var len = shapePath._length;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      pointPool.release(shapePath.v[i]);
+      pointPool.release(shapePath.i[i]);
+      pointPool.release(shapePath.o[i]);
+      shapePath.v[i] = null;
+      shapePath.i[i] = null;
+      shapePath.o[i] = null;
+    }
+    shapePath._length = 0;
+    shapePath.c = false;
+  }
+
+  function clone(shape) {
+    var cloned = factory.newElement();
+    var i;
+    var len = shape._length === undefined ? shape.v.length : shape._length;
+    cloned.setLength(len);
+    cloned.c = shape.c;
+
+    for (i = 0; i < len; i += 1) {
+      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);
+    }
+    return cloned;
+  }
+
+  var factory = poolFactory(4, create, release);
+  factory.clone = clone;
+
+  return factory;
+}());
+
+/* global createSizedArray, ShapeCollection, shapePool, pooling */
+/* exported shapeCollectionPool */
+
+var shapeCollectionPool = (function () {
+  var ob = {
+    newShapeCollection: newShapeCollection,
+    release: release,
+  };
+
+  var _length = 0;
+  var _maxLength = 4;
+  var pool = createSizedArray(_maxLength);
+
+  function newShapeCollection() {
+    var shapeCollection;
+    if (_length) {
+      _length -= 1;
+      shapeCollection = pool[_length];
+    } else {
+      shapeCollection = new ShapeCollection();
+    }
+    return shapeCollection;
+  }
+
+  function release(shapeCollection) {
+    var i;
+    var len = shapeCollection._length;
+    for (i = 0; i < len; i += 1) {
+      shapePool.release(shapeCollection.shapes[i]);
+    }
+    shapeCollection._length = 0;
+
+    if (_length === _maxLength) {
+      pool = pooling.double(pool);
+      _maxLength *= 2;
+    }
+    pool[_length] = shapeCollection;
+    _length += 1;
+  }
+
+  return ob;
+}());
+
+/* global poolFactory, bezierLengthPool */
+/* exported segmentsLengthPool */
+
+var segmentsLengthPool = (function () {
+  function create() {
     return {
-        getTextSelectorProp: getTextSelectorProp
+      lengths: [],
+      totalLength: 0,
     };
-}());
+  }
 
-    
-var pool_factory = (function() {
-	return function(initialLength, _create, _release, _clone) {
-
-		var _length = 0;
-		var _maxLength = initialLength;
-		var pool = createSizedArray(_maxLength);
-
-		var ob = {
-			newElement: newElement,
-			release: release
-		};
-
-		function newElement(){
-			var element;
-			if(_length){
-				_length -= 1;
-				element = pool[_length];
-			} else {
-				element = _create();
-			}
-			return element;
-		}
-
-		function release(element) {
-			if(_length === _maxLength) {
-				pool = pooling.double(pool);
-				_maxLength = _maxLength*2;
-			}
-			if (_release) {
-				_release(element);
-			}
-			pool[_length] = element;
-			_length += 1;
-		}
-
-		function clone() {
-			var clonedElement = newElement();
-			return _clone(clonedElement);
-		}
-
-		return ob;
-	};
-}());
-
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(createSizedArray(arr.length));
-	}
-
-	return {
-		double: double
-	};
-}());
-var point_pool = (function(){
-
-	function create() {
-		return createTypedArray('float32', 2);
-	}
-	return pool_factory(8, create);
-}());
-var shape_pool = (function(){
-
-	function create() {
-		return new ShapePath();
-	}
-
-	function release(shapePath) {
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-	}
-
-	function clone(shape) {
-		var cloned = factory.newElement();
-		var i, len = shape._length === undefined ? shape.v.length : shape._length;
-		cloned.setLength(len);
-		cloned.c = shape.c;
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			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);
-		}
-		return cloned;
-	}
-
-	var factory = pool_factory(4, create, release);
-	factory.clone = clone;
-
-	return factory;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release
-	};
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = createSizedArray(_maxLength);
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	return ob;
-}());
-var segments_length_pool = (function(){
-
-	function create() {
-		return {
-			lengths: [],
-			totalLength: 0
-		};
-	}
-
-	function release(element) {
-		var i, len = element.lengths.length;
-		for(i=0;i<len;i+=1) {
-			bezier_length_pool.release(element.lengths[i]);
-		}
-		element.lengths.length = 0;
-	}
-
-	return pool_factory(8, create, release);
-}());
-var bezier_length_pool = (function(){
-
-	function create() {
-		return {
-            addedLength: 0,
-            percents: createTypedArray('float32', defaultCurveSegments),
-            lengths: createTypedArray('float32', defaultCurveSegments),
-        };
-	}
-	return pool_factory(8, create);
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
+  function release(element) {
+    var i;
+    var len = element.lengths.length;
+    for (i = 0; i < len; i += 1) {
+      bezierLengthPool.release(element.lengths[i]);
     }
-    this.checkPendingElements();
-};
+    element.lengths.length = 0;
+  }
 
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 3:
-            return this.createNull(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 6:
-            return this.createAudio(layer);
-        case 13:
-            return this.createCamera(layer);
-    }
-    return this.createNull(layer);
-};
+  return poolFactory(8, create, release);
+}());
 
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-};
+/* global createTypedArray, defaultCurveSegments, poolFactory */
+/* exported bezierLengthPool */
 
-BaseRenderer.prototype.createAudio = function(data){
-    return new AudioElement(data, this.globalData, this);
-};
+var bezierLengthPool = (function () {
+  function create() {
+    return {
+      addedLength: 0,
+      percents: createTypedArray('float32', defaultCurveSegments),
+      lengths: createTypedArray('float32', defaultCurveSegments),
+    };
+  }
+  return poolFactory(8, create);
+}());
 
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
+/* global AudioElement, FontManager */
+
+function BaseRenderer() {}
+BaseRenderer.prototype.checkLayers = function (num) {
+  var i;
+  var len = this.layers.length;
+  var data;
+  this.completeLayers = true;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (!this.elements[i]) {
+      data = this.layers[i];
+      if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) {
         this.buildItem(i);
+      }
     }
-    this.checkPendingElements();
+    this.completeLayers = this.elements[i] ? this.completeLayers : false;
+  }
+  this.checkPendingElements();
 };
 
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
+BaseRenderer.prototype.createItem = function (layer) {
+  switch (layer.ty) {
+    case 2:
+      return this.createImage(layer);
+    case 0:
+      return this.createComp(layer);
+    case 1:
+      return this.createSolid(layer);
+    case 3:
+      return this.createNull(layer);
+    case 4:
+      return this.createShape(layer);
+    case 5:
+      return this.createText(layer);
+    case 6:
+      return this.createAudio(layer);
+    case 13:
+      return this.createCamera(layer);
+    default:
+      return this.createNull(layer);
+  }
+};
+
+BaseRenderer.prototype.createCamera = function () {
+  throw new Error('You\'re using a 3d camera. Try the html renderer.');
+};
+
+BaseRenderer.prototype.createAudio = function (data) {
+  return new AudioElement(data, this.globalData, this);
+};
+
+BaseRenderer.prototype.buildAllItems = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    this.buildItem(i);
+  }
+  this.checkPendingElements();
+};
+
+BaseRenderer.prototype.includeLayers = function (newLayers) {
+  this.completeLayers = false;
+  var i;
+  var len = newLayers.length;
+  var j;
+  var jLen = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    j = 0;
+    while (j < jLen) {
+      if (this.layers[j].id === newLayers[i].id) {
+        this.layers[j] = newLayers[i];
+        break;
+      }
+      j += 1;
+    }
+  }
+};
+
+BaseRenderer.prototype.setProjectInterface = function (pInterface) {
+  this.globalData.projectInterface = pInterface;
+};
+
+BaseRenderer.prototype.initItems = function () {
+  if (!this.globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+};
+BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
+  var elements = this.elements;
+  var layers = this.layers;
+  var i = 0;
+  var len = layers.length;
+  while (i < len) {
+    if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq
+      if (!elements[i] || elements[i] === true) {
+        this.buildItem(i);
+        this.addPendingElement(element);
+      } else {
+        hierarchy.push(elements[i]);
+        elements[i].setAsParent();
+        if (layers[i].parent !== undefined) {
+          this.buildElementParenting(element, layers[i].parent, hierarchy);
+        } else {
+          element.setHierarchy(hierarchy);
         }
+      }
     }
+    i += 1;
+  }
 };
 
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
+BaseRenderer.prototype.addPendingElement = function (element) {
+  this.pendingElements.push(element);
 };
 
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
+BaseRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i]);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
     }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while (i < len) {
-        if (layers[i].ind == parentName) {
-            if (!elements[i] || elements[i] === true) {
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i].setAsParent();
-                if(layers[i].parent !== undefined) {
-                    this.buildElementParenting(element, layers[i].parent, hierarchy);
-                } else {
-                    element.setHierarchy(hierarchy);
-                }
-            }
-        }
-        i += 1;
-    }
+  }
 };
 
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
+BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
+  this.globalData.fontManager = new FontManager();
+  this.globalData.fontManager.addChars(animData.chars);
+  this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
+  this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+  this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
+  this.globalData.imageLoader = this.animationItem.imagePreloader;
+  this.globalData.audioController = this.animationItem.audioController;
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
 };
 
-BaseRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i]);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
+/* global createElementID, extendPrototype, BaseRenderer, NullElement, SVGShapeElement, SVGTextLottieElement,
+IImageElement, SVGCompElement, ISolidElement, createNS, locationHref, createSizedArray, expressionsPlugin */
 
-BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.imageLoader = this.animationItem.imagePreloader;
-    this.globalData.audioController = this.animationItem.audioController;
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-}
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.svgElement = createNS('svg');
-    var ariaLabel = '';
-    if (config && config.title) {
-        var titleElement = createNS('title');
-        var titleId = createElementID();
-        titleElement.setAttribute('id', titleId);
-        titleElement.textContent = config.title;
-        this.svgElement.appendChild(titleElement);
-        ariaLabel += titleId;
-    }
-    if (config && config.description) {
-        var descElement = createNS('desc');
-        var descId = createElementID();
-        descElement.setAttribute('id', descId);
-        descElement.textContent = config.description;
-        this.svgElement.appendChild(descElement);
-        ariaLabel += ' ' + descId;
-    }
-    if (ariaLabel) {
-        this.svgElement.setAttribute('aria-labelledby', ariaLabel)
-    }
-    var defs = createNS( 'defs');
-    this.svgElement.appendChild(defs);
-    var maskElement = createNS('g');
-    this.svgElement.appendChild(maskElement);
-    this.layerElement = maskElement;
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        viewBoxOnly: (config && config.viewBoxOnly) || false,
-        viewBoxSize: (config && config.viewBoxSize) || false,
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-        focusable: config && config.focusable,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '100%',
-            height: config && config.filterSize && config.filterSize.height || '100%',
-            x: config && config.filterSize && config.filterSize.x || '0%',
-            y: config && config.filterSize && config.filterSize.y || '0%',
-        }
-    };
+function SVGRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.svgElement = createNS('svg');
+  var ariaLabel = '';
+  if (config && config.title) {
+    var titleElement = createNS('title');
+    var titleId = createElementID();
+    titleElement.setAttribute('id', titleId);
+    titleElement.textContent = config.title;
+    this.svgElement.appendChild(titleElement);
+    ariaLabel += titleId;
+  }
+  if (config && config.description) {
+    var descElement = createNS('desc');
+    var descId = createElementID();
+    descElement.setAttribute('id', descId);
+    descElement.textContent = config.description;
+    this.svgElement.appendChild(descElement);
+    ariaLabel += ' ' + descId;
+  }
+  if (ariaLabel) {
+    this.svgElement.setAttribute('aria-labelledby', ariaLabel);
+  }
+  var defs = createNS('defs');
+  this.svgElement.appendChild(defs);
+  var maskElement = createNS('g');
+  this.svgElement.appendChild(maskElement);
+  this.layerElement = maskElement;
+  this.renderConfig = {
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    hideOnTransparent: !((config && config.hideOnTransparent === false)),
+    viewBoxOnly: (config && config.viewBoxOnly) || false,
+    viewBoxSize: (config && config.viewBoxSize) || false,
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+    focusable: config && config.focusable,
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '100%',
+      height: (config && config.filterSize && config.filterSize.height) || '100%',
+      x: (config && config.filterSize && config.filterSize.x) || '0%',
+      y: (config && config.filterSize && config.filterSize.y) || '0%',
+    },
+  };
 
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        defs: defs,
-        renderConfig: this.renderConfig
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-    this.rendererType = 'svg';
-
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    defs: defs,
+    renderConfig: this.renderConfig,
+  };
+  this.elements = [];
+  this.pendingElements = [];
+  this.destroyed = false;
+  this.rendererType = 'svg';
 }
 
-extendPrototype([BaseRenderer],SVGRenderer);
+extendPrototype([BaseRenderer], SVGRenderer);
 
 SVGRenderer.prototype.createNull = function (data) {
-    return new NullElement(data,this.globalData,this);
+  return new NullElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new SVGShapeElement(data,this.globalData,this);
+  return new SVGShapeElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data,this.globalData,this);
-
+  return new SVGTextLottieElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data,this.globalData,this);
+  return new IImageElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new SVGCompElement(data,this.globalData,this);
-
+  return new SVGCompElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data,this.globalData,this);
+  return new ISolidElement(data, this.globalData, this);
 };
 
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    if(this.renderConfig.viewBoxSize) {
-        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
-    } else {
-        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    }
+SVGRenderer.prototype.configAnimation = function (animData) {
+  this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+  if (this.renderConfig.viewBoxSize) {
+    this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
+  } else {
+    this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
+  }
 
-    if(!this.renderConfig.viewBoxOnly) {
-        this.svgElement.setAttribute('width',animData.w);
-        this.svgElement.setAttribute('height',animData.h);
-        this.svgElement.style.width = '100%';
-        this.svgElement.style.height = '100%';
-        this.svgElement.style.transform = 'translate3d(0,0,0)';
-    }
-    if (this.renderConfig.className) {
-        this.svgElement.setAttribute('class', this.renderConfig.className);
-    }
-    if (this.renderConfig.id) {
-        this.svgElement.setAttribute('id', this.renderConfig.id);
-    }
-    if (this.renderConfig.focusable !== undefined) {
-        this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
-    }
-    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.svgElement);
-    //Mask animation
-    var defs = this.globalData.defs;
+  if (!this.renderConfig.viewBoxOnly) {
+    this.svgElement.setAttribute('width', animData.w);
+    this.svgElement.setAttribute('height', animData.h);
+    this.svgElement.style.width = '100%';
+    this.svgElement.style.height = '100%';
+    this.svgElement.style.transform = 'translate3d(0,0,0)';
+  }
+  if (this.renderConfig.className) {
+    this.svgElement.setAttribute('class', this.renderConfig.className);
+  }
+  if (this.renderConfig.id) {
+    this.svgElement.setAttribute('id', this.renderConfig.id);
+  }
+  if (this.renderConfig.focusable !== undefined) {
+    this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
+  }
+  this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio);
+  // this.layerElement.style.transform = 'translate3d(0,0,0)';
+  // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
+  this.animationItem.wrapper.appendChild(this.svgElement);
+  // Mask animation
+  var defs = this.globalData.defs;
 
-    this.setupGlobalData(animData, defs);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.data = animData;
+  this.setupGlobalData(animData, defs);
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.data = animData;
 
-    var maskElement = createNS( 'clipPath');
-    var rect = createNS('rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = createElementID();
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+  var maskElement = createNS('clipPath');
+  var rect = createNS('rect');
+  rect.setAttribute('width', animData.w);
+  rect.setAttribute('height', animData.h);
+  rect.setAttribute('x', 0);
+  rect.setAttribute('y', 0);
+  var maskId = createElementID();
+  maskElement.setAttribute('id', maskId);
+  maskElement.appendChild(rect);
+  this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + maskId + ')');
 
-    defs.appendChild(maskElement);
-    this.layers = animData.layers;
-    this.elements = createSizedArray(animData.layers.length);
+  defs.appendChild(maskElement);
+  this.layers = animData.layers;
+  this.elements = createSizedArray(animData.layers.length);
 };
 
-
 SVGRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.layerElement = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 SVGRenderer.prototype.updateContainerSize = function () {
 };
 
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
+SVGRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  elements[pos] = true;
+  var element = this.createItem(this.layers[pos]);
 
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
+  elements[pos] = element;
+  if (expressionsPlugin) {
+    if (this.layers[pos].ty === 0) {
+      this.globalData.projectInterface.registerComposition(element);
     }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
+    element.initExpressions();
+  }
+  this.appendElementInPos(element, pos);
+  if (this.layers[pos].tt) {
+    if (!this.elements[pos - 1] || this.elements[pos - 1] === true) {
+      this.buildItem(pos - 1);
+      this.addPendingElement(element);
+    } else {
+      element.setMatte(elements[pos - 1].layerId);
     }
+  }
 };
 
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame === num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    // console.log('-------');
-    // console.log('FRAME ',num);
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    this.globalData._mdf = false;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    if(this.globalData._mdf) {
-        for (i = 0; i < len; i += 1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
+SVGRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+    if (element.data.tt) {
+      var i = 0;
+      var len = this.elements.length;
+      while (i < len) {
+        if (this.elements[i] === element) {
+          element.setMatte(this.elements[i - 1].layerId);
+          break;
         }
         i += 1;
+      }
     }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
-    } else {
-        this.layerElement.appendChild(newElement);
-    }
+  }
 };
 
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
-};
-
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
-};
-
-function CanvasRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.renderConfig = {
-        clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
-        context: (config && config.context) || null,
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-    };
-    this.renderConfig.dpr = (config && config.dpr) || 1;
-    if (this.animationItem.wrapper) {
-        this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
+SVGRenderer.prototype.renderFrame = function (num) {
+  if (this.renderedFrame === num || this.destroyed) {
+    return;
+  }
+  if (num === null) {
+    num = this.renderedFrame;
+  } else {
+    this.renderedFrame = num;
+  }
+  // console.log('-------');
+  // console.log('FRAME ',num);
+  this.globalData.frameNum = num;
+  this.globalData.frameId += 1;
+  this.globalData.projectInterface.currentFrame = num;
+  this.globalData._mdf = false;
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
-    this.renderedFrame = -1;
-    this.globalData = {
-        frameNum: -1,
-        _mdf: false,
-        renderConfig: this.renderConfig,
-        currentGlobalAlpha: -1
-    };
-    this.contextData = new CVContextData();
-    this.elements = [];
-    this.pendingElements = [];
-    this.transformMat = new Matrix();
-    this.completeLayers = false;
-    this.rendererType = 'canvas';
+  }
+  if (this.globalData._mdf) {
+    for (i = 0; i < len; i += 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+  }
+};
+
+SVGRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newElement = element.getBaseElement();
+  if (!newElement) {
+    return;
+  }
+  var i = 0;
+  var nextElement;
+  while (i < pos) {
+    if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
+      nextElement = this.elements[i].getBaseElement();
+    }
+    i += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(newElement, nextElement);
+  } else {
+    this.layerElement.appendChild(newElement);
+  }
+};
+
+SVGRenderer.prototype.hide = function () {
+  this.layerElement.style.display = 'none';
+};
+
+SVGRenderer.prototype.show = function () {
+  this.layerElement.style.display = 'block';
+};
+
+/* global CVContextData, Matrix, extendPrototype, BaseRenderer, CVShapeElement, CVTextElement,
+CVImageElement, CVCompElement, CVSolidElement, SVGRenderer, createTag, createSizedArray */
+
+function CanvasRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.renderConfig = {
+    clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
+    context: (config && config.context) || null,
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+  };
+  this.renderConfig.dpr = (config && config.dpr) || 1;
+  if (this.animationItem.wrapper) {
+    this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
+  }
+  this.renderedFrame = -1;
+  this.globalData = {
+    frameNum: -1,
+    _mdf: false,
+    renderConfig: this.renderConfig,
+    currentGlobalAlpha: -1,
+  };
+  this.contextData = new CVContextData();
+  this.elements = [];
+  this.pendingElements = [];
+  this.transformMat = new Matrix();
+  this.completeLayers = false;
+  this.rendererType = 'canvas';
 }
-extendPrototype([BaseRenderer],CanvasRenderer);
+extendPrototype([BaseRenderer], CanvasRenderer);
 
 CanvasRenderer.prototype.createShape = function (data) {
-    return new CVShapeElement(data, this.globalData, this);
+  return new CVShapeElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createText = function (data) {
-    return new CVTextElement(data, this.globalData, this);
+  return new CVTextElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createImage = function (data) {
-    return new CVImageElement(data, this.globalData, this);
+  return new CVImageElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createComp = function (data) {
-    return new CVCompElement(data, this.globalData, this);
+  return new CVCompElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createSolid = function (data) {
-    return new CVSolidElement(data, this.globalData, this);
+  return new CVSolidElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
 
-CanvasRenderer.prototype.ctxTransform = function(props){
-    if(props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0){
-        return;
-    }
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.transform(props[0],props[1],props[4],props[5],props[12],props[13]);
-        return;
-    }
-    this.transformMat.cloneFromProps(props);
-    var cProps = this.contextData.cTr.props;
-    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]);
-    //this.contextData.cTr.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]);
-    this.contextData.cTr.cloneFromProps(this.transformMat.props);
-    var trProps = this.contextData.cTr.props;
-    this.canvasContext.setTransform(trProps[0],trProps[1],trProps[4],trProps[5],trProps[12],trProps[13]);
+CanvasRenderer.prototype.ctxTransform = function (props) {
+  if (props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0) {
+    return;
+  }
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.transform(props[0], props[1], props[4], props[5], props[12], props[13]);
+    return;
+  }
+  this.transformMat.cloneFromProps(props);
+  var cProps = this.contextData.cTr.props;
+  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]);
+  // this.contextData.cTr.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]);
+  this.contextData.cTr.cloneFromProps(this.transformMat.props);
+  var trProps = this.contextData.cTr.props;
+  this.canvasContext.setTransform(trProps[0], trProps[1], trProps[4], trProps[5], trProps[12], trProps[13]);
 };
 
-CanvasRenderer.prototype.ctxOpacity = function(op){
-    /*if(op === 1){
+CanvasRenderer.prototype.ctxOpacity = function (op) {
+  /* if(op === 1){
         return;
-    }*/
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
-        this.globalData.currentGlobalAlpha = this.contextData.cO;
-        return;
-    }
-    this.contextData.cO *= op < 0 ? 0 : op;
-    if(this.globalData.currentGlobalAlpha !== this.contextData.cO) {
-        this.canvasContext.globalAlpha = this.contextData.cO;
-        this.globalData.currentGlobalAlpha = this.contextData.cO;
-    }
+    } */
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
+    this.globalData.currentGlobalAlpha = this.contextData.cO;
+    return;
+  }
+  this.contextData.cO *= op < 0 ? 0 : op;
+  if (this.globalData.currentGlobalAlpha !== this.contextData.cO) {
+    this.canvasContext.globalAlpha = this.contextData.cO;
+    this.globalData.currentGlobalAlpha = this.contextData.cO;
+  }
 };
 
-CanvasRenderer.prototype.reset = function(){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.restore();
-        return;
-    }
-    this.contextData.reset();
+CanvasRenderer.prototype.reset = function () {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.restore();
+    return;
+  }
+  this.contextData.reset();
 };
 
-CanvasRenderer.prototype.save = function(actionFlag){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.save();
-        return;
-    }
-    if(actionFlag){
-        this.canvasContext.save();
-    }
-    var props = this.contextData.cTr.props;
-    if(this.contextData._length <= this.contextData.cArrPos) {
-        this.contextData.duplicate();
-    }
-    var i, arr = this.contextData.saved[this.contextData.cArrPos];
-    for (i = 0; i < 16; i += 1) {
-        arr[i] = props[i];
-    }
-    this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
-    this.contextData.cArrPos += 1;
+CanvasRenderer.prototype.save = function (actionFlag) {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.save();
+    return;
+  }
+  if (actionFlag) {
+    this.canvasContext.save();
+  }
+  var props = this.contextData.cTr.props;
+  if (this.contextData._length <= this.contextData.cArrPos) {
+    this.contextData.duplicate();
+  }
+  var i;
+  var arr = this.contextData.saved[this.contextData.cArrPos];
+  for (i = 0; i < 16; i += 1) {
+    arr[i] = props[i];
+  }
+  this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
+  this.contextData.cArrPos += 1;
 };
 
-CanvasRenderer.prototype.restore = function(actionFlag){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.restore();
-        return;
-    }
-    if(actionFlag){
-        this.canvasContext.restore();
-        this.globalData.blendMode = 'source-over';
-    }
-    this.contextData.cArrPos -= 1;
-    var popped = this.contextData.saved[this.contextData.cArrPos];
-    var i,arr = this.contextData.cTr.props;
-    for(i=0;i<16;i+=1){
-        arr[i] = popped[i];
-    }
-    this.canvasContext.setTransform(popped[0],popped[1],popped[4],popped[5],popped[12],popped[13]);
-    popped = this.contextData.savedOp[this.contextData.cArrPos];
-    this.contextData.cO = popped;
-    if(this.globalData.currentGlobalAlpha !== popped) {
-        this.canvasContext.globalAlpha = popped;
-        this.globalData.currentGlobalAlpha = popped;
-    }
+CanvasRenderer.prototype.restore = function (actionFlag) {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.restore();
+    return;
+  }
+  if (actionFlag) {
+    this.canvasContext.restore();
+    this.globalData.blendMode = 'source-over';
+  }
+  this.contextData.cArrPos -= 1;
+  var popped = this.contextData.saved[this.contextData.cArrPos];
+  var i;
+  var arr = this.contextData.cTr.props;
+  for (i = 0; i < 16; i += 1) {
+    arr[i] = popped[i];
+  }
+  this.canvasContext.setTransform(popped[0], popped[1], popped[4], popped[5], popped[12], popped[13]);
+  popped = this.contextData.savedOp[this.contextData.cArrPos];
+  this.contextData.cO = popped;
+  if (this.globalData.currentGlobalAlpha !== popped) {
+    this.canvasContext.globalAlpha = popped;
+    this.globalData.currentGlobalAlpha = popped;
+  }
 };
 
-CanvasRenderer.prototype.configAnimation = function(animData){
-    if(this.animationItem.wrapper){
-        this.animationItem.container = createTag('canvas');
-        this.animationItem.container.style.width = '100%';
-        this.animationItem.container.style.height = '100%';
-        //this.animationItem.container.style.transform = 'translate3d(0,0,0)';
-        //this.animationItem.container.style.webkitTransform = 'translate3d(0,0,0)';
-        this.animationItem.container.style.transformOrigin = this.animationItem.container.style.mozTransformOrigin = this.animationItem.container.style.webkitTransformOrigin = this.animationItem.container.style['-webkit-transform'] = "0px 0px 0px";
-        this.animationItem.wrapper.appendChild(this.animationItem.container);
-        this.canvasContext = this.animationItem.container.getContext('2d');
-        if(this.renderConfig.className) {
-            this.animationItem.container.setAttribute('class', this.renderConfig.className);
-        }
-        if(this.renderConfig.id) {
-            this.animationItem.container.setAttribute('id', this.renderConfig.id);
-        }
-    }else{
-        this.canvasContext = this.renderConfig.context;
+CanvasRenderer.prototype.configAnimation = function (animData) {
+  if (this.animationItem.wrapper) {
+    this.animationItem.container = createTag('canvas');
+    var containerStyle = this.animationItem.container.style;
+    containerStyle.width = '100%';
+    containerStyle.height = '100%';
+    var origin = '0px 0px 0px';
+    containerStyle.transformOrigin = origin;
+    containerStyle.mozTransformOrigin = origin;
+    containerStyle.webkitTransformOrigin = origin;
+    containerStyle['-webkit-transform'] = origin;
+    this.animationItem.wrapper.appendChild(this.animationItem.container);
+    this.canvasContext = this.animationItem.container.getContext('2d');
+    if (this.renderConfig.className) {
+      this.animationItem.container.setAttribute('class', this.renderConfig.className);
     }
-    this.data = animData;
-    this.layers = animData.layers;
-    this.transformCanvas = {
-        w: animData.w,
-        h:animData.h,
-        sx:0,
-        sy:0,
-        tx:0,
-        ty:0
-    };
-    this.setupGlobalData(animData, document.body);
-    this.globalData.canvasContext = this.canvasContext;
-    this.globalData.renderer = this;
-    this.globalData.isDashed = false;
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.globalData.transformCanvas = this.transformCanvas;
-    this.elements = createSizedArray(animData.layers.length);
+    if (this.renderConfig.id) {
+      this.animationItem.container.setAttribute('id', this.renderConfig.id);
+    }
+  } else {
+    this.canvasContext = this.renderConfig.context;
+  }
+  this.data = animData;
+  this.layers = animData.layers;
+  this.transformCanvas = {
+    w: animData.w,
+    h: animData.h,
+    sx: 0,
+    sy: 0,
+    tx: 0,
+    ty: 0,
+  };
+  this.setupGlobalData(animData, document.body);
+  this.globalData.canvasContext = this.canvasContext;
+  this.globalData.renderer = this;
+  this.globalData.isDashed = false;
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.globalData.transformCanvas = this.transformCanvas;
+  this.elements = createSizedArray(animData.layers.length);
 
-    this.updateContainerSize();
+  this.updateContainerSize();
 };
 
 CanvasRenderer.prototype.updateContainerSize = function () {
-    this.reset();
-    var elementWidth,elementHeight;
-    if(this.animationItem.wrapper && this.animationItem.container){
-        elementWidth = this.animationItem.wrapper.offsetWidth;
-        elementHeight = this.animationItem.wrapper.offsetHeight;
-        this.animationItem.container.setAttribute('width',elementWidth * this.renderConfig.dpr );
-        this.animationItem.container.setAttribute('height',elementHeight * this.renderConfig.dpr);
-    }else{
-        elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
-        elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
+  this.reset();
+  var elementWidth;
+  var elementHeight;
+  if (this.animationItem.wrapper && this.animationItem.container) {
+    elementWidth = this.animationItem.wrapper.offsetWidth;
+    elementHeight = this.animationItem.wrapper.offsetHeight;
+    this.animationItem.container.setAttribute('width', elementWidth * this.renderConfig.dpr);
+    this.animationItem.container.setAttribute('height', elementHeight * this.renderConfig.dpr);
+  } else {
+    elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
+    elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
+  }
+  var elementRel;
+  var animationRel;
+  if (this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1) {
+    var par = this.renderConfig.preserveAspectRatio.split(' ');
+    var fillType = par[1] || 'meet';
+    var pos = par[0] || 'xMidYMid';
+    var xPos = pos.substr(0, 4);
+    var yPos = pos.substr(4);
+    elementRel = elementWidth / elementHeight;
+    animationRel = this.transformCanvas.w / this.transformCanvas.h;
+    if ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice')) {
+      this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+      this.transformCanvas.sy = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+    } else {
+      this.transformCanvas.sx = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
+      this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
     }
-    var elementRel,animationRel;
-    if(this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1){
-        var par = this.renderConfig.preserveAspectRatio.split(' ');
-        var fillType = par[1] || 'meet';
-        var pos = par[0] || 'xMidYMid';
-        var xPos = pos.substr(0,4);
-        var yPos = pos.substr(4);
-        elementRel = elementWidth/elementHeight;
-        animationRel = this.transformCanvas.w/this.transformCanvas.h;
-        if(animationRel>elementRel && fillType === 'meet' || animationRel<elementRel && fillType === 'slice'){
-            this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-            this.transformCanvas.sy = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-        }else{
-            this.transformCanvas.sx = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
-            this.transformCanvas.sy = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
-        }
 
-        if(xPos === 'xMid' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
-            this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))/2*this.renderConfig.dpr;
-        } else if(xPos === 'xMax' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
-            this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))*this.renderConfig.dpr;
-        } else {
-            this.transformCanvas.tx = 0;
-        }
-        if(yPos === 'YMid' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
-            this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w))/2)*this.renderConfig.dpr;
-        } else if(yPos === 'YMax' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
-            this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w)))*this.renderConfig.dpr;
-        } else {
-            this.transformCanvas.ty = 0;
-        }
-
-    }else if(this.renderConfig.preserveAspectRatio == 'none'){
-        this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-        this.transformCanvas.sy = elementHeight/(this.transformCanvas.h/this.renderConfig.dpr);
-        this.transformCanvas.tx = 0;
-        this.transformCanvas.ty = 0;
-    }else{
-        this.transformCanvas.sx = this.renderConfig.dpr;
-        this.transformCanvas.sy = this.renderConfig.dpr;
-        this.transformCanvas.tx = 0;
-        this.transformCanvas.ty = 0;
+    if (xPos === 'xMid' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) {
+      this.transformCanvas.tx = ((elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) / 2) * this.renderConfig.dpr;
+    } else if (xPos === 'xMax' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) {
+      this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) * this.renderConfig.dpr;
+    } else {
+      this.transformCanvas.tx = 0;
     }
-    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];
-    /*var i, len = this.elements.length;
+    if (yPos === 'YMid' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) {
+      this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) / 2) * this.renderConfig.dpr;
+    } else if (yPos === 'YMax' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) {
+      this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w))) * this.renderConfig.dpr;
+    } else {
+      this.transformCanvas.ty = 0;
+    }
+  } else if (this.renderConfig.preserveAspectRatio === 'none') {
+    this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+    this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
+    this.transformCanvas.tx = 0;
+    this.transformCanvas.ty = 0;
+  } else {
+    this.transformCanvas.sx = this.renderConfig.dpr;
+    this.transformCanvas.sy = this.renderConfig.dpr;
+    this.transformCanvas.tx = 0;
+    this.transformCanvas.ty = 0;
+  }
+  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];
+  /* var i, len = this.elements.length;
     for(i=0;i<len;i+=1){
         if(this.elements[i] && this.elements[i].data.ty === 0){
             this.elements[i].resize(this.globalData.transformCanvas);
         }
-    }*/
-    this.ctxTransform(this.transformCanvas.props);
-    this.canvasContext.beginPath();
-    this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
-    this.canvasContext.closePath();
-    this.canvasContext.clip();
+    } */
+  this.ctxTransform(this.transformCanvas.props);
+  this.canvasContext.beginPath();
+  this.canvasContext.rect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+  this.canvasContext.closePath();
+  this.canvasContext.clip();
 
-    this.renderFrame(this.renderedFrame, true);
+  this.renderFrame(this.renderedFrame, true);
 };
 
 CanvasRenderer.prototype.destroy = function () {
-    if(this.renderConfig.clearCanvas && this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.renderConfig.clearCanvas && this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = len - 1; i >= 0; i-=1) {
-        if(this.elements[i]) {
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.globalData.canvasContext = null;
-    this.animationItem.container = null;
-    this.destroyed = true;
+  }
+  this.elements.length = 0;
+  this.globalData.canvasContext = null;
+  this.animationItem.container = null;
+  this.destroyed = true;
 };
 
-CanvasRenderer.prototype.renderFrame = function(num, forceRender){
-    if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){
-        return;
-    }
-    this.renderedFrame = num;
-    this.globalData.frameNum = num - this.animationItem._isFirstFrame;
-    this.globalData.frameId += 1;
-    this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
-    this.globalData.projectInterface.currentFrame = num;
+CanvasRenderer.prototype.renderFrame = function (num, forceRender) {
+  if ((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1) {
+    return;
+  }
+  this.renderedFrame = num;
+  this.globalData.frameNum = num - this.animationItem._isFirstFrame;
+  this.globalData.frameId += 1;
+  this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
+  this.globalData.projectInterface.currentFrame = num;
 
-     // console.log('--------');
-     // console.log('NEW: ',num);
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
+  // console.log('--------');
+  // console.log('NEW: ',num);
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
 
-    for (i = 0; i < len; i++) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
-    if(this.globalData._mdf) {
-        if(this.renderConfig.clearCanvas === true){
-            this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
-        }else{
-            this.save();
-        }
-        for (i = len - 1; i >= 0; i-=1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-        if(this.renderConfig.clearCanvas !== true){
-            this.restore();
-        }
+  }
+  if (this.globalData._mdf) {
+    if (this.renderConfig.clearCanvas === true) {
+      this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+    } else {
+      this.save();
     }
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+    if (this.renderConfig.clearCanvas !== true) {
+      this.restore();
+    }
+  }
 };
 
-CanvasRenderer.prototype.buildItem = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    var element = this.createItem(this.layers[pos], this,this.globalData);
-    elements[pos] = element;
-    element.initExpressions();
-    /*if(this.layers[pos].ty === 0){
+CanvasRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  var element = this.createItem(this.layers[pos], this, this.globalData);
+  elements[pos] = element;
+  element.initExpressions();
+  /* if(this.layers[pos].ty === 0){
         element.resize(this.globalData.transformCanvas);
-    }*/
+    } */
 };
 
-CanvasRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-    }
+CanvasRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+  }
 };
 
-CanvasRenderer.prototype.hide = function(){
-    this.animationItem.container.style.display = 'none';
+CanvasRenderer.prototype.hide = function () {
+  this.animationItem.container.style.display = 'none';
 };
 
-CanvasRenderer.prototype.show = function(){
-    this.animationItem.container.style.display = 'block';
+CanvasRenderer.prototype.show = function () {
+  this.animationItem.container.style.display = 'block';
 };
 
-function HybridRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.renderConfig = {
-        className: (config && config.className) || '',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '400%',
-            height: config && config.filterSize && config.filterSize.height || '400%',
-            x: config && config.filterSize && config.filterSize.x || '-100%',
-            y: config && config.filterSize && config.filterSize.y || '-100%',
-        }
-    };
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        renderConfig: this.renderConfig
-    };
-    this.pendingElements = [];
-    this.elements = [];
-    this.threeDElements = [];
-    this.destroyed = false;
-    this.camera = null;
-    this.supports3d = true;
-    this.rendererType = 'html';
+/* global extendPrototype, BaseRenderer, SVGRenderer, SVGShapeElement, HShapeElement, SVGTextLottieElement,
+HTextElement, HCameraElement, IImageElement, HImageElement, SVGCompElement, HCompElement, ISolidElement,
+HSolidElement, styleDiv, createTag, createNS */
 
+function HybridRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.renderConfig = {
+    className: (config && config.className) || '',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    hideOnTransparent: !(config && config.hideOnTransparent === false),
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '400%',
+      height: (config && config.filterSize && config.filterSize.height) || '400%',
+      x: (config && config.filterSize && config.filterSize.x) || '-100%',
+      y: (config && config.filterSize && config.filterSize.y) || '-100%',
+    },
+  };
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    renderConfig: this.renderConfig,
+  };
+  this.pendingElements = [];
+  this.elements = [];
+  this.threeDElements = [];
+  this.destroyed = false;
+  this.camera = null;
+  this.supports3d = true;
+  this.rendererType = 'html';
 }
 
-extendPrototype([BaseRenderer],HybridRenderer);
+extendPrototype([BaseRenderer], HybridRenderer);
 
 HybridRenderer.prototype.buildItem = SVGRenderer.prototype.buildItem;
 
-HybridRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-    }
+HybridRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+  }
 };
 
-HybridRenderer.prototype.appendElementInPos = function(element, pos){
-    var newDOMElement = element.getBaseElement();
-    if(!newDOMElement){
-        return;
-    }
-    var layer = this.layers[pos];
-    if(!layer.ddd || !this.supports3d){
-        if(this.threeDElements) {
-            this.addTo3dContainer(newDOMElement,pos);
-        } else {
-            var i = 0;
-            var nextDOMElement, nextLayer, tmpDOMElement;
-            while(i<pos){
-                if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement){
-                    nextLayer = this.elements[i];
-                    tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
-                    nextDOMElement = tmpDOMElement || nextDOMElement;
-                }
-                i += 1;
-            }
-            if(nextDOMElement){
-                if(!layer.ddd || !this.supports3d){
-                    this.layerElement.insertBefore(newDOMElement, nextDOMElement);
-                }
-            } else {
-                if(!layer.ddd || !this.supports3d){
-                    this.layerElement.appendChild(newDOMElement);
-                }
-            }
-        }
-        
+HybridRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newDOMElement = element.getBaseElement();
+  if (!newDOMElement) {
+    return;
+  }
+  var layer = this.layers[pos];
+  if (!layer.ddd || !this.supports3d) {
+    if (this.threeDElements) {
+      this.addTo3dContainer(newDOMElement, pos);
     } else {
-        this.addTo3dContainer(newDOMElement,pos);
+      var i = 0;
+      var nextDOMElement;
+      var nextLayer;
+      var tmpDOMElement;
+      while (i < pos) {
+        if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement) {
+          nextLayer = this.elements[i];
+          tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
+          nextDOMElement = tmpDOMElement || nextDOMElement;
+        }
+        i += 1;
+      }
+      if (nextDOMElement) {
+        if (!layer.ddd || !this.supports3d) {
+          this.layerElement.insertBefore(newDOMElement, nextDOMElement);
+        }
+      } else if (!layer.ddd || !this.supports3d) {
+        this.layerElement.appendChild(newDOMElement);
+      }
     }
+  } else {
+    this.addTo3dContainer(newDOMElement, pos);
+  }
 };
 
 HybridRenderer.prototype.createShape = function (data) {
-    if(!this.supports3d){
-        return new SVGShapeElement(data, this.globalData, this);
-    }
-    return new HShapeElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new SVGShapeElement(data, this.globalData, this);
+  }
+  return new HShapeElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createText = function (data) {
-    if(!this.supports3d){
-        return new SVGTextElement(data, this.globalData, this);
-    }
-    return new HTextElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new SVGTextLottieElement(data, this.globalData, this);
+  }
+  return new HTextElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createCamera = function (data) {
-    this.camera = new HCameraElement(data, this.globalData, this);
-    return this.camera;
+  this.camera = new HCameraElement(data, this.globalData, this);
+  return this.camera;
 };
 
 HybridRenderer.prototype.createImage = function (data) {
-    if(!this.supports3d){
-        return new IImageElement(data, this.globalData, this);
-    }
-    return new HImageElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new IImageElement(data, this.globalData, this);
+  }
+  return new HImageElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createComp = function (data) {
-    if(!this.supports3d){
-        return new SVGCompElement(data, this.globalData, this);
-    }
-    return new HCompElement(data, this.globalData, this);
-
+  if (!this.supports3d) {
+    return new SVGCompElement(data, this.globalData, this);
+  }
+  return new HCompElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createSolid = function (data) {
-    if(!this.supports3d){
-        return new ISolidElement(data, this.globalData, this);
-    }
-    return new HSolidElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new ISolidElement(data, this.globalData, this);
+  }
+  return new HSolidElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
 
-HybridRenderer.prototype.getThreeDContainerByPos = function(pos){
-    var i = 0, len = this.threeDElements.length;
-    while(i<len) {
-        if(this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
-            return this.threeDElements[i].perspectiveElem;
+HybridRenderer.prototype.getThreeDContainerByPos = function (pos) {
+  var i = 0;
+  var len = this.threeDElements.length;
+  while (i < len) {
+    if (this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
+      return this.threeDElements[i].perspectiveElem;
+    }
+    i += 1;
+  }
+  return null;
+};
+
+HybridRenderer.prototype.createThreeDContainer = function (pos, type) {
+  var perspectiveElem = createTag('div');
+  var style;
+  var containerStyle;
+  styleDiv(perspectiveElem);
+  var container = createTag('div');
+  styleDiv(container);
+  if (type === '3d') {
+    style = perspectiveElem.style;
+    style.width = this.globalData.compSize.w + 'px';
+    style.height = this.globalData.compSize.h + 'px';
+    var center = '50% 50%';
+    style.webkitTransformOrigin = center;
+    style.mozTransformOrigin = center;
+    style.transformOrigin = center;
+    containerStyle = container.style;
+    var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+    containerStyle.transform = matrix;
+    containerStyle.webkitTransform = matrix;
+  }
+
+  perspectiveElem.appendChild(container);
+  // this.resizerElem.appendChild(perspectiveElem);
+  var threeDContainerData = {
+    container: container,
+    perspectiveElem: perspectiveElem,
+    startPos: pos,
+    endPos: pos,
+    type: type,
+  };
+  this.threeDElements.push(threeDContainerData);
+  return threeDContainerData;
+};
+
+HybridRenderer.prototype.build3dContainers = function () {
+  var i;
+  var len = this.layers.length;
+  var lastThreeDContainerData;
+  var currentContainer = '';
+  for (i = 0; i < len; i += 1) {
+    if (this.layers[i].ddd && this.layers[i].ty !== 3) {
+      if (currentContainer !== '3d') {
+        currentContainer = '3d';
+        lastThreeDContainerData = this.createThreeDContainer(i, '3d');
+      }
+      lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
+    } else {
+      if (currentContainer !== '2d') {
+        currentContainer = '2d';
+        lastThreeDContainerData = this.createThreeDContainer(i, '2d');
+      }
+      lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
+    }
+  }
+  len = this.threeDElements.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
+  }
+};
+
+HybridRenderer.prototype.addTo3dContainer = function (elem, pos) {
+  var i = 0;
+  var len = this.threeDElements.length;
+  while (i < len) {
+    if (pos <= this.threeDElements[i].endPos) {
+      var j = this.threeDElements[i].startPos;
+      var nextElement;
+      while (j < pos) {
+        if (this.elements[j] && this.elements[j].getBaseElement) {
+          nextElement = this.elements[j].getBaseElement();
         }
-        i += 1;
+        j += 1;
+      }
+      if (nextElement) {
+        this.threeDElements[i].container.insertBefore(elem, nextElement);
+      } else {
+        this.threeDElements[i].container.appendChild(elem);
+      }
+      break;
     }
+    i += 1;
+  }
 };
 
-HybridRenderer.prototype.createThreeDContainer = function(pos, type){
-    var perspectiveElem = createTag('div');
-    styleDiv(perspectiveElem);
-    var container = createTag('div');
-    styleDiv(container);
-    if(type === '3d') {
-        perspectiveElem.style.width = this.globalData.compSize.w+'px';
-        perspectiveElem.style.height = this.globalData.compSize.h+'px';
-        perspectiveElem.style.transformOrigin = perspectiveElem.style.mozTransformOrigin = perspectiveElem.style.webkitTransformOrigin = "50% 50%";
-        container.style.transform = container.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
-    }
-    
-    perspectiveElem.appendChild(container);
-    //this.resizerElem.appendChild(perspectiveElem);
-    var threeDContainerData = {
-        container:container,
-        perspectiveElem:perspectiveElem,
-        startPos: pos,
-        endPos: pos,
-        type: type
-    };
-    this.threeDElements.push(threeDContainerData);
-    return threeDContainerData;
-};
+HybridRenderer.prototype.configAnimation = function (animData) {
+  var resizerElem = createTag('div');
+  var wrapper = this.animationItem.wrapper;
+  var style = resizerElem.style;
+  style.width = animData.w + 'px';
+  style.height = animData.h + 'px';
+  this.resizerElem = resizerElem;
+  styleDiv(resizerElem);
+  style.transformStyle = 'flat';
+  style.mozTransformStyle = 'flat';
+  style.webkitTransformStyle = 'flat';
+  if (this.renderConfig.className) {
+    resizerElem.setAttribute('class', this.renderConfig.className);
+  }
+  wrapper.appendChild(resizerElem);
 
-HybridRenderer.prototype.build3dContainers = function(){
-    var i, len = this.layers.length;
-    var lastThreeDContainerData;
-    var currentContainer = '';
-    for(i=0;i<len;i+=1){
-        if(this.layers[i].ddd && this.layers[i].ty !== 3){
-            if(currentContainer !== '3d'){
-                currentContainer = '3d';
-                lastThreeDContainerData = this.createThreeDContainer(i,'3d');
-            }
-            lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
-        } else {
-            if(currentContainer !== '2d'){
-                currentContainer = '2d';
-                lastThreeDContainerData = this.createThreeDContainer(i,'2d');
-            }
-            lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
-        }
-    }
-    len = this.threeDElements.length;
-    for(i = len - 1; i >= 0; i --) {
-        this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
-    }
-};
-
-HybridRenderer.prototype.addTo3dContainer = function(elem,pos){
-    var i = 0, len = this.threeDElements.length;
-    while(i<len){
-        if(pos <= this.threeDElements[i].endPos){
-            var j = this.threeDElements[i].startPos;
-            var nextElement;
-            while(j<pos){
-                if(this.elements[j] && this.elements[j].getBaseElement){
-                    nextElement = this.elements[j].getBaseElement();
-                }
-                j += 1;
-            }
-            if(nextElement){
-                this.threeDElements[i].container.insertBefore(elem, nextElement);
-            } else {
-                this.threeDElements[i].container.appendChild(elem);
-            }
-            break;
-        }
-        i += 1;
-    }
-};
-
-HybridRenderer.prototype.configAnimation = function(animData){
-    var resizerElem = createTag('div');
-    var wrapper = this.animationItem.wrapper;
-    resizerElem.style.width = animData.w+'px';
-    resizerElem.style.height = animData.h+'px';
-    this.resizerElem = resizerElem;
-    styleDiv(resizerElem);
-    resizerElem.style.transformStyle = resizerElem.style.webkitTransformStyle = resizerElem.style.mozTransformStyle = "flat";
-    if(this.renderConfig.className) {
-      resizerElem.setAttribute('class', this.renderConfig.className);
-    }
-    wrapper.appendChild(resizerElem);
-
-    resizerElem.style.overflow = 'hidden';
-    var svg = createNS('svg');
-    svg.setAttribute('width','1');
-    svg.setAttribute('height','1');
-    styleDiv(svg);
-    this.resizerElem.appendChild(svg);
-    var defs = createNS('defs');
-    svg.appendChild(defs);
-    this.data = animData;
-    //Mask animation
-    this.setupGlobalData(animData, svg);
-    this.globalData.defs = defs;
-    this.layers = animData.layers;
-    this.layerElement = this.resizerElem;
-    this.build3dContainers();
-    this.updateContainerSize();
+  style.overflow = 'hidden';
+  var svg = createNS('svg');
+  svg.setAttribute('width', '1');
+  svg.setAttribute('height', '1');
+  styleDiv(svg);
+  this.resizerElem.appendChild(svg);
+  var defs = createNS('defs');
+  svg.appendChild(defs);
+  this.data = animData;
+  // Mask animation
+  this.setupGlobalData(animData, svg);
+  this.globalData.defs = defs;
+  this.layers = animData.layers;
+  this.layerElement = this.resizerElem;
+  this.build3dContainers();
+  this.updateContainerSize();
 };
 
 HybridRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
-    }
-    this.animationItem.container = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        this.elements[i].destroy();
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.animationItem.container = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    this.elements[i].destroy();
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 HybridRenderer.prototype.updateContainerSize = function () {
-    var elementWidth = this.animationItem.wrapper.offsetWidth;
-    var elementHeight = this.animationItem.wrapper.offsetHeight;
-    var elementRel = elementWidth/elementHeight;
-    var animationRel = this.globalData.compSize.w/this.globalData.compSize.h;
-    var sx,sy,tx,ty;
-    if(animationRel>elementRel){
-        sx = elementWidth/(this.globalData.compSize.w);
-        sy = elementWidth/(this.globalData.compSize.w);
-        tx = 0;
-        ty = ((elementHeight-this.globalData.compSize.h*(elementWidth/this.globalData.compSize.w))/2);
-    }else{
-        sx = elementHeight/(this.globalData.compSize.h);
-        sy = elementHeight/(this.globalData.compSize.h);
-        tx = (elementWidth-this.globalData.compSize.w*(elementHeight/this.globalData.compSize.h))/2;
-        ty = 0;
-    }
-    this.resizerElem.style.transform = this.resizerElem.style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,'+sy+',0,0,0,0,1,0,'+tx+','+ty+',0,1)';
+  var elementWidth = this.animationItem.wrapper.offsetWidth;
+  var elementHeight = this.animationItem.wrapper.offsetHeight;
+  var elementRel = elementWidth / elementHeight;
+  var animationRel = this.globalData.compSize.w / this.globalData.compSize.h;
+  var sx;
+  var sy;
+  var tx;
+  var ty;
+  if (animationRel > elementRel) {
+    sx = elementWidth / (this.globalData.compSize.w);
+    sy = elementWidth / (this.globalData.compSize.w);
+    tx = 0;
+    ty = ((elementHeight - this.globalData.compSize.h * (elementWidth / this.globalData.compSize.w)) / 2);
+  } else {
+    sx = elementHeight / (this.globalData.compSize.h);
+    sy = elementHeight / (this.globalData.compSize.h);
+    tx = (elementWidth - this.globalData.compSize.w * (elementHeight / this.globalData.compSize.h)) / 2;
+    ty = 0;
+  }
+  var style = this.resizerElem.style;
+  style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,' + sy + ',0,0,0,0,1,0,' + tx + ',' + ty + ',0,1)';
+  style.transform = style.webkitTransform;
 };
 
 HybridRenderer.prototype.renderFrame = SVGRenderer.prototype.renderFrame;
 
-HybridRenderer.prototype.hide = function(){
-    this.resizerElem.style.display = 'none';
+HybridRenderer.prototype.hide = function () {
+  this.resizerElem.style.display = 'none';
 };
 
-HybridRenderer.prototype.show = function(){
-    this.resizerElem.style.display = 'block';
+HybridRenderer.prototype.show = function () {
+  this.resizerElem.style.display = 'block';
 };
 
-HybridRenderer.prototype.initItems = function(){
-    this.buildAllItems();
-    if(this.camera){
-        this.camera.setup();
+HybridRenderer.prototype.initItems = function () {
+  this.buildAllItems();
+  if (this.camera) {
+    this.camera.setup();
+  } else {
+    var cWidth = this.globalData.compSize.w;
+    var cHeight = this.globalData.compSize.h;
+    var i;
+    var len = this.threeDElements.length;
+    for (i = 0; i < len; i += 1) {
+      var style = this.threeDElements[i].perspectiveElem.style;
+      style.webkitPerspective = Math.sqrt(Math.pow(cWidth, 2) + Math.pow(cHeight, 2)) + 'px';
+      style.perspective = style.webkitPerspective;
+    }
+  }
+};
+
+HybridRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  var floatingContainer = createTag('div');
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i], floatingContainer, this.globalData.comp, null);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
+    }
+  }
+};
+
+/* global createSizedArray, createElementID, PropertyFactory, ShapePropertyFactory, createNS, locationHref */
+
+function MaskElement(data, element, globalData) {
+  this.data = data;
+  this.element = element;
+  this.globalData = globalData;
+  this.storedData = [];
+  this.masksProperties = this.data.masksProperties || [];
+  this.maskElement = null;
+  var defs = this.globalData.defs;
+  var i;
+  var len = this.masksProperties ? this.masksProperties.length : 0;
+  this.viewData = createSizedArray(len);
+  this.solidPath = '';
+
+  var path;
+  var properties = this.masksProperties;
+  var count = 0;
+  var currentMasks = [];
+  var j;
+  var jLen;
+  var layerId = createElementID();
+  var rect;
+  var expansor;
+  var feMorph;
+  var x;
+  var maskType = 'clipPath';
+  var maskRef = 'clip-path';
+  for (i = 0; i < len; i += 1) {
+    if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
+      maskType = 'mask';
+      maskRef = 'mask';
+    }
+
+    if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
+      rect = createNS('rect');
+      rect.setAttribute('fill', '#ffffff');
+      rect.setAttribute('width', this.element.comp.data.w || 0);
+      rect.setAttribute('height', this.element.comp.data.h || 0);
+      currentMasks.push(rect);
     } else {
-        var cWidth = this.globalData.compSize.w;
-        var cHeight = this.globalData.compSize.h;
-        var i, len = this.threeDElements.length;
-        for(i=0;i<len;i+=1){
-            this.threeDElements[i].perspectiveElem.style.perspective = this.threeDElements[i].perspectiveElem.style.webkitPerspective = Math.sqrt(Math.pow(cWidth,2) + Math.pow(cHeight,2)) + 'px';
-        }
-    }
-};
-
-HybridRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    var floatingContainer = createTag('div');
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i],floatingContainer,this.globalData.comp,null);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
-
-function MaskElement(data,element,globalData) {
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties || [];
-    this.maskElement = null;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties ? this.masksProperties.length : 0;
-    this.viewData = createSizedArray(len);
-    this.solidPath = '';
-
-
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = createElementID();
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
-            rect = createNS( 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w || 0);
-            rect.setAttribute('height', this.element.comp.data.h || 0);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = createNS( 'path');
-        if(properties[i].mode == 'n') {
-            // TODO move this to a factory or to a constructor
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-                elem: path,
-                lastPath: ''
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
-        path.setAttribute('clip-rule','nonzero');
-        var filterID;
-
-        if (properties[i].x.k !== 0) {
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
-            filterID = createElementID();
-            expansor = createNS('filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = createNS('feMorphology');
-            feMorph.setAttribute('operator','erode');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
-        } else {
-            feMorph = null;
-            x = null;
-        }
-
-        // TODO move this to a factory or to a constructor
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = createNS('g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = createNS('mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        // TODO move this to a factory or to a constructor
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-            invRect: rect
-        };
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
+      rect = null;
     }
 
-    this.maskElement = createNS( maskType);
+    path = createNS('path');
+    if (properties[i].mode === 'n') {
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        elem: path,
+        lastPath: '',
+      };
+      defs.appendChild(path);
+    } else {
+      count += 1;
 
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
-    }
+      path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      path.setAttribute('clip-rule', 'nonzero');
+      var filterID;
 
-    if(count > 0){
-        this.maskElement.setAttribute('id', layerId);
-        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
-        defs.appendChild(this.maskElement);
-    }
-    if (this.viewData.length) {
-        this.element.addRenderableComponent(this);
-    }
+      if (properties[i].x.k !== 0) {
+        maskType = 'mask';
+        maskRef = 'mask';
+        x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
+        filterID = createElementID();
+        expansor = createNS('filter');
+        expansor.setAttribute('id', filterID);
+        feMorph = createNS('feMorphology');
+        feMorph.setAttribute('operator', 'erode');
+        feMorph.setAttribute('in', 'SourceGraphic');
+        feMorph.setAttribute('radius', '0');
+        expansor.appendChild(feMorph);
+        defs.appendChild(expansor);
+        path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      } else {
+        feMorph = null;
+        x = null;
+      }
 
+      // TODO move this to a factory or to a constructor
+      this.storedData[i] = {
+        elem: path,
+        x: x,
+        expan: feMorph,
+        lastPath: '',
+        lastOperator: '',
+        filterId: filterID,
+        lastRadius: 0,
+      };
+      if (properties[i].mode === 'i') {
+        jLen = currentMasks.length;
+        var g = createNS('g');
+        for (j = 0; j < jLen; j += 1) {
+          g.appendChild(currentMasks[j]);
+        }
+        var mask = createNS('mask');
+        mask.setAttribute('mask-type', 'alpha');
+        mask.setAttribute('id', layerId + '_' + count);
+        mask.appendChild(path);
+        defs.appendChild(mask);
+        g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
+
+        currentMasks.length = 0;
+        currentMasks.push(g);
+      } else {
+        currentMasks.push(path);
+      }
+      if (properties[i].inv && !this.solidPath) {
+        this.solidPath = this.createLayerSolidPath();
+      }
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        elem: path,
+        lastPath: '',
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        invRect: rect,
+      };
+      if (!this.viewData[i].prop.k) {
+        this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
+      }
+    }
+  }
+
+  this.maskElement = createNS(maskType);
+
+  len = currentMasks.length;
+  for (i = 0; i < len; i += 1) {
+    this.maskElement.appendChild(currentMasks[i]);
+  }
+
+  if (count > 0) {
+    this.maskElement.setAttribute('id', layerId);
+    this.element.maskedElement.setAttribute(maskRef, 'url(' + locationHref + '#' + layerId + ')');
+    defs.appendChild(this.maskElement);
+  }
+  if (this.viewData.length) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
+MaskElement.prototype.getMaskProperty = function (pos) {
+  return this.viewData[pos].prop;
 };
 
 MaskElement.prototype.renderFrame = function (isFirstFrame) {
-    var finalMat = this.element.finalTransform.mat;
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop._mdf || isFirstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op._mdf || isFirstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
-                this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
-            }
-            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
+  var finalMat = this.element.finalTransform.mat;
+  var i;
+  var len = this.masksProperties.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.viewData[i].prop._mdf || isFirstFrame) {
+      this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
     }
+    if (this.viewData[i].op._mdf || isFirstFrame) {
+      this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
+    }
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
+        this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
+      }
+      if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
+        var feMorph = this.storedData[i].expan;
+        if (this.storedData[i].x.v < 0) {
+          if (this.storedData[i].lastOperator !== 'erode') {
+            this.storedData[i].lastOperator = 'erode';
+            this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
+          }
+          feMorph.setAttribute('radius', -this.storedData[i].x.v);
+        } else {
+          if (this.storedData[i].lastOperator !== 'dilate') {
+            this.storedData[i].lastOperator = 'dilate';
+            this.storedData[i].elem.setAttribute('filter', null);
+          }
+          this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
+        }
+      }
+    }
+  }
 };
 
 MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
+  return this.maskElement;
 };
 
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
+MaskElement.prototype.createLayerSolidPath = function () {
+  var path = 'M0,0 ';
+  path += ' h' + this.globalData.compSize.w;
+  path += ' v' + this.globalData.compSize.h;
+  path += ' h-' + this.globalData.compSize.w;
+  path += ' v-' + this.globalData.compSize.h + ' ';
+  return path;
 };
 
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //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];
-        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];
-    }
-        //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];
-    if(pathNodes.c && len > 1){
-        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];
-    }
-    //pathNodes.__renderedString = pathString;
+MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
+  var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
+  var i;
+  var len;
+  len = pathNodes._length;
+  for (i = 1; i < len; i += 1) {
+    // 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];
+    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];
+  }
+  // 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];
+  if (pathNodes.c && len > 1) {
+    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];
+  }
+  // pathNodes.__renderedString = pathString;
 
-    if(viewData.lastPath !== pathString){
-        var pathShapeValue = '';
-        if(viewData.elem){
-            if(pathNodes.c){
-                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
-            }
-            viewData.elem.setAttribute('d',pathShapeValue);
-        }
-        viewData.lastPath = pathString;
+  if (viewData.lastPath !== pathString) {
+    var pathShapeValue = '';
+    if (viewData.elem) {
+      if (pathNodes.c) {
+        pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
+      }
+      viewData.elem.setAttribute('d', pathShapeValue);
     }
+    viewData.lastPath = pathString;
+  }
 };
 
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.masksProperties = null;
+MaskElement.prototype.destroy = function () {
+  this.element = null;
+  this.globalData = null;
+  this.maskElement = null;
+  this.data = null;
+  this.masksProperties = null;
 };
 
 /**
- * @file 
+ * @file
  * Handles AE's layer parenting property.
  *
  */
 
-function HierarchyElement(){}
+function HierarchyElement() {}
 
 HierarchyElement.prototype = {
-	/**
-     * @function 
+  /**
+     * @function
      * Initializes hierarchy properties
      *
      */
-	initHierarchy: function() {
-		//element's parent list
-	    this.hierarchy = [];
-	    //if element is parent of another layer _isParent will be true
-	    this._isParent = false;
-	    this.checkParenting();
-	},
-	/**
-     * @function 
+  initHierarchy: function () {
+    // element's parent list
+    this.hierarchy = [];
+    // if element is parent of another layer _isParent will be true
+    this._isParent = false;
+    this.checkParenting();
+  },
+  /**
+     * @function
      * Sets layer's hierarchy.
      * @param {array} hierarch
      * layer's parent list
      *
-     */ 
-	setHierarchy: function(hierarchy){
-	    this.hierarchy = hierarchy;
-	},
-	/**
-     * @function 
+     */
+  setHierarchy: function (hierarchy) {
+    this.hierarchy = hierarchy;
+  },
+  /**
+     * @function
      * Sets layer as parent.
      *
-     */ 
-	setAsParent: function() {
-	    this._isParent = true;
-	},
-	/**
-     * @function 
+     */
+  setAsParent: function () {
+    this._isParent = true;
+  },
+  /**
+     * @function
      * Searches layer's parenting chain
      *
-     */ 
-	checkParenting: function(){
-	    if (this.data.parent !== undefined){
-	        this.comp.buildElementParenting(this, this.data.parent, []);
-	    }
-	}
+     */
+  checkParenting: function () {
+    if (this.data.parent !== undefined) {
+      this.comp.buildElementParenting(this, this.data.parent, []);
+    }
+  },
 };
+
 /**
- * @file 
+ * @file
  * Handles element's layer frame update.
  * Checks layer in point and out point
  *
  */
 
-function FrameElement(){}
+function FrameElement() {}
 
 FrameElement.prototype = {
-    /**
-     * @function 
+  /**
+     * @function
      * Initializes frame related properties.
      *
      */
-    initFrame: function(){
-        //set to true when inpoint is rendered
-        this._isFirstFrame = false;
-        //list of animated properties
-        this.dynamicProperties = [];
-        // If layer has been modified in current tick this will be true
-        this._mdf = false;
-    },
-    /**
-     * @function 
+  initFrame: function () {
+    // set to true when inpoint is rendered
+    this._isFirstFrame = false;
+    // list of animated properties
+    this.dynamicProperties = [];
+    // If layer has been modified in current tick this will be true
+    this._mdf = false;
+  },
+  /**
+     * @function
      * Calculates all dynamic values
      *
      * @param {number} num
      * current frame number in Layer's time
      * @param {boolean} isVisible
      * if layers is currently in range
-     * 
+     *
      */
-    prepareProperties: function(num, isVisible) {
-        var i, len = this.dynamicProperties.length;
-        for (i = 0;i < len; i += 1) {
-            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i]._mdf) {
-                    this.globalData._mdf = true;
-                    this._mdf = true;
-                }
-            }
+  prepareProperties: function (num, isVisible) {
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+        this.dynamicProperties[i].getValue();
+        if (this.dynamicProperties[i]._mdf) {
+          this.globalData._mdf = true;
+          this._mdf = true;
         }
-    },
-    addDynamicProperty: function(prop) {
-        if(this.dynamicProperties.indexOf(prop) === -1) {
-            this.dynamicProperties.push(prop);
-        }
+      }
     }
+  },
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+    }
+  },
 };
-function TransformElement(){}
+
+/* global TransformPropertyFactory, Matrix */
+
+function TransformElement() {}
 
 TransformElement.prototype = {
-    initTransform: function() {
-        this.finalTransform = {
-            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
-            _matMdf: false,
-            _opMdf: false,
-            mat: new Matrix()
-        };
-        if (this.data.ao) {
-            this.finalTransform.mProp.autoOriented = true;
-        }
+  initTransform: function () {
+    this.finalTransform = {
+      mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 },
+      _matMdf: false,
+      _opMdf: false,
+      mat: new Matrix(),
+    };
+    if (this.data.ao) {
+      this.finalTransform.mProp.autoOriented = true;
+    }
 
-        //TODO: check TYPE 11: Guided elements
-        if (this.data.ty !== 11) {
-            //this.createElements();
-        }
-    },
-    renderTransform: function() {
+    // TODO: check TYPE 11: Guided elements
+    if (this.data.ty !== 11) {
+      // this.createElements();
+    }
+  },
+  renderTransform: function () {
+    this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+    this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
 
-        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
-        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+    if (this.hierarchy) {
+      var mat;
+      var finalMat = this.finalTransform.mat;
+      var i = 0;
+      var len = this.hierarchy.length;
+      // Checking if any of the transformation matrices in the hierarchy chain has changed.
+      if (!this.finalTransform._matMdf) {
+        while (i < len) {
+          if (this.hierarchy[i].finalTransform.mProp._mdf) {
+            this.finalTransform._matMdf = true;
+            break;
+          }
+          i += 1;
+        }
+      }
 
-        if (this.hierarchy) {
-            var mat;
-            var finalMat = this.finalTransform.mat;
-            var i = 0, len = this.hierarchy.length;
-            //Checking if any of the transformation matrices in the hierarchy chain has changed.
-            if (!this.finalTransform._matMdf) {
-                while (i < len) {
-                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
-                        this.finalTransform._matMdf = true;
-                        break;
-                    }
-                    i += 1;
-                }
-            }
-            
-            if (this.finalTransform._matMdf) {
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-                for (i = 0; i < len; i += 1) {
-                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                    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]);
-                }
-            }
-        }
-    },
-    globalToLocal: function(pt) {
-        var transforms = [];
-        transforms.push(this.finalTransform);
-        var flag = true;
-        var comp = this.comp;
-        while (flag) {
-            if (comp.finalTransform) {
-                if (comp.data.hasMask) {
-                    transforms.splice(0, 0, comp.finalTransform);
-                }
-                comp = comp.comp;
-            } else {
-                flag = false;
-            }
-        }
-        var i, len = transforms.length,ptNew;
+      if (this.finalTransform._matMdf) {
+        mat = this.finalTransform.mProp.v.props;
+        finalMat.cloneFromProps(mat);
         for (i = 0; i < len; i += 1) {
-            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
-            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+          mat = this.hierarchy[i].finalTransform.mProp.v.props;
+          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]);
         }
-        return pt;
-    },
-    mHelper: new Matrix()
+      }
+    }
+  },
+  globalToLocal: function (pt) {
+    var transforms = [];
+    transforms.push(this.finalTransform);
+    var flag = true;
+    var comp = this.comp;
+    while (flag) {
+      if (comp.finalTransform) {
+        if (comp.data.hasMask) {
+          transforms.splice(0, 0, comp.finalTransform);
+        }
+        comp = comp.comp;
+      } else {
+        flag = false;
+      }
+    }
+    var i;
+    var len = transforms.length;
+    var ptNew;
+    for (i = 0; i < len; i += 1) {
+      ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+      // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+      pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+    }
+    return pt;
+  },
+  mHelper: new Matrix(),
 };
-function RenderableElement(){
+
+function RenderableElement() {
 
 }
 
 RenderableElement.prototype = {
-    initRenderable: function() {
-        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
-        this.isInRange = false;
-        //layer's display state
-        this.hidden = false;
-        // If layer's transparency equals 0, it can be hidden
-        this.isTransparent = false;
-        //list of animated components
-        this.renderableComponents = [];
-    },
-    addRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) === -1) {
-            this.renderableComponents.push(component);
-        }
-    },
-    removeRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) !== -1) {
-            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
-        }
-    },
-    prepareRenderableFrame: function(num) {
-        this.checkLayerLimits(num);
-    },
-    checkTransparency: function(){
-        if(this.finalTransform.mProp.o.v <= 0) {
-            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
-                this.isTransparent = true;
-                this.hide();
-            }
-        } else if(this.isTransparent) {
-            this.isTransparent = false;
-            this.show();
-        }
-    },
-    /**
-     * @function 
+  initRenderable: function () {
+    // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+    this.isInRange = false;
+    // layer's display state
+    this.hidden = false;
+    // If layer's transparency equals 0, it can be hidden
+    this.isTransparent = false;
+    // list of animated components
+    this.renderableComponents = [];
+  },
+  addRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) === -1) {
+      this.renderableComponents.push(component);
+    }
+  },
+  removeRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) !== -1) {
+      this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+    }
+  },
+  prepareRenderableFrame: function (num) {
+    this.checkLayerLimits(num);
+  },
+  checkTransparency: function () {
+    if (this.finalTransform.mProp.o.v <= 0) {
+      if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
+        this.isTransparent = true;
+        this.hide();
+      }
+    } else if (this.isTransparent) {
+      this.isTransparent = false;
+      this.show();
+    }
+  },
+  /**
+     * @function
      * Initializes frame related properties.
      *
      * @param {number} num
      * current frame number in Layer's time
-     * 
+     *
      */
-    checkLayerLimits: function(num) {
-        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-        {
-            if(this.isInRange !== true){
-                this.globalData._mdf = true;
-                this._mdf = true;
-                this.isInRange = true;
-                this.show();
-            }
-        } else {
-            if(this.isInRange !== false){
-                this.globalData._mdf = true;
-                this.isInRange = false;
-                this.hide();
-            }
-        }
-    },
-    renderRenderable: function() {
-        var i, len = this.renderableComponents.length;
-        for(i = 0; i < len; i += 1) {
-            this.renderableComponents[i].renderFrame(this._isFirstFrame);
-        }
-        /*this.maskManager.renderFrame(this.finalTransform.mat);
-        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
-    },
-    sourceRectAtTime: function(){
-        return {
-            top:0,
-            left:0,
-            width:100,
-            height:100
-        };
-    },
-    getLayerSize: function(){
-        if(this.data.ty === 5){
-            return {w:this.data.textData.width,h:this.data.textData.height};
-        }else{
-            return {w:this.data.width,h:this.data.height};
-        }
+  checkLayerLimits: function (num) {
+    if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
+      if (this.isInRange !== true) {
+        this.globalData._mdf = true;
+        this._mdf = true;
+        this.isInRange = true;
+        this.show();
+      }
+    } else if (this.isInRange !== false) {
+      this.globalData._mdf = true;
+      this.isInRange = false;
+      this.hide();
     }
+  },
+  renderRenderable: function () {
+    var i;
+    var len = this.renderableComponents.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderableComponents[i].renderFrame(this._isFirstFrame);
+    }
+    /* this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
+  },
+  sourceRectAtTime: function () {
+    return {
+      top: 0,
+      left: 0,
+      width: 100,
+      height: 100,
+    };
+  },
+  getLayerSize: function () {
+    if (this.data.ty === 5) {
+      return { w: this.data.textData.width, h: this.data.textData.height };
+    }
+    return { w: this.data.width, h: this.data.height };
+  },
 };
+
+/* global extendPrototype, RenderableElement, createProxyFunction */
+
 function RenderableDOMElement() {}
 
-(function(){
-    var _prototype = {
-        initElement: function(data,globalData,comp) {
-            this.initFrame();
-            this.initBaseData(data, globalData, comp);
-            this.initTransform(data, globalData, comp);
-            this.initHierarchy();
-            this.initRenderable();
-            this.initRendererElement();
-            this.createContainerElements();
-            this.createRenderableComponents();
-            this.createContent();
-            this.hide();
-        },
-        hide: function(){
-            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-                var elem = this.baseElement || this.layerElement;
-                elem.style.display = 'none';
-                this.hidden = true;
-            }
-        },
-        show: function(){
-            if (this.isInRange && !this.isTransparent){
-                if (!this.data.hd) {
-                    var elem = this.baseElement || this.layerElement;
-                    elem.style.display = 'block';
-                }
-                this.hidden = false;
-                this._isFirstFrame = true;
-            }
-        },
-        renderFrame: function() {
-            //If it is exported as hidden (data.hd === true) no need to render
-            //If it is not visible no need to render
-            if (this.data.hd || this.hidden) {
-                return;
-            }
-            this.renderTransform();
-            this.renderRenderable();
-            this.renderElement();
-            this.renderInnerContent();
-            if (this._isFirstFrame) {
-                this._isFirstFrame = false;
-            }
-        },
-        renderInnerContent: function() {},
-        prepareFrame: function(num) {
-            this._mdf = false;
-            this.prepareRenderableFrame(num);
-            this.prepareProperties(num, this.isInRange);
-            this.checkTransparency();
-        },
-        destroy: function(){
-            this.innerElem =  null;
-            this.destroyBaseElement();
+(function () {
+  var _prototype = {
+    initElement: function (data, globalData, comp) {
+      this.initFrame();
+      this.initBaseData(data, globalData, comp);
+      this.initTransform(data, globalData, comp);
+      this.initHierarchy();
+      this.initRenderable();
+      this.initRendererElement();
+      this.createContainerElements();
+      this.createRenderableComponents();
+      this.createContent();
+      this.hide();
+    },
+    hide: function () {
+      if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+        var elem = this.baseElement || this.layerElement;
+        elem.style.display = 'none';
+        this.hidden = true;
+      }
+    },
+    show: function () {
+      if (this.isInRange && !this.isTransparent) {
+        if (!this.data.hd) {
+          var elem = this.baseElement || this.layerElement;
+          elem.style.display = 'block';
         }
-    };
-    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+        this.hidden = false;
+        this._isFirstFrame = true;
+      }
+    },
+    renderFrame: function () {
+      // If it is exported as hidden (data.hd === true) no need to render
+      // If it is not visible no need to render
+      if (this.data.hd || this.hidden) {
+        return;
+      }
+      this.renderTransform();
+      this.renderRenderable();
+      this.renderElement();
+      this.renderInnerContent();
+      if (this._isFirstFrame) {
+        this._isFirstFrame = false;
+      }
+    },
+    renderInnerContent: function () {},
+    prepareFrame: function (num) {
+      this._mdf = false;
+      this.prepareRenderableFrame(num);
+      this.prepareProperties(num, this.isInRange);
+      this.checkTransparency();
+    },
+    destroy: function () {
+      this.innerElem = null;
+      this.destroyBaseElement();
+    },
+  };
+  extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
 }());
+
+/* exported ProcessedElement */
+
 function ProcessedElement(element, position) {
-	this.elem = element;
-	this.pos = position;
+  this.elem = element;
+  this.pos = position;
 }
+
+/* global createNS */
+
 function SVGStyleData(data, level) {
-	this.data = data;
-	this.type = data.ty;
-	this.d = '';
-	this.lvl = level;
-	this._mdf = false;
-	this.closed = data.hd === true;
-	this.pElem = createNS('path');
-	this.msElem = null;
+  this.data = data;
+  this.type = data.ty;
+  this.d = '';
+  this.lvl = level;
+  this._mdf = false;
+  this.closed = data.hd === true;
+  this.pElem = createNS('path');
+  this.msElem = null;
 }
 
-SVGStyleData.prototype.reset = function() {
-	this.d = '';
-	this._mdf = false;
+SVGStyleData.prototype.reset = function () {
+  this.d = '';
+  this._mdf = false;
 };
+
 function SVGShapeData(transformers, level, shape) {
-    this.caches = [];
-    this.styles = [];
-    this.transformers = transformers;
-    this.lStr = '';
-    this.sh = shape;
-    this.lvl = level;
-    //TODO find if there are some cases where _isAnimated can be false. 
-    // For now, since shapes add up with other shapes. They have to be calculated every time.
-    // One way of finding out is checking if all styles associated to this shape depend only of this shape
-    this._isAnimated = !!shape.k;
-    // TODO: commenting this for now since all shapes are animated
-    var i = 0, len = transformers.length;
-    while(i < len) {
-    	if(transformers[i].mProps.dynamicProperties.length) {
-    		this._isAnimated = true;
-    		break;
-    	}
-    	i += 1;
+  this.caches = [];
+  this.styles = [];
+  this.transformers = transformers;
+  this.lStr = '';
+  this.sh = shape;
+  this.lvl = level;
+  // TODO find if there are some cases where _isAnimated can be false.
+  // For now, since shapes add up with other shapes. They have to be calculated every time.
+  // One way of finding out is checking if all styles associated to this shape depend only of this shape
+  this._isAnimated = !!shape.k;
+  // TODO: commenting this for now since all shapes are animated
+  var i = 0;
+  var len = transformers.length;
+  while (i < len) {
+    if (transformers[i].mProps.dynamicProperties.length) {
+      this._isAnimated = true;
+      break;
     }
+    i += 1;
+  }
 }
 
-SVGShapeData.prototype.setAsAnimated = function() {
-    this._isAnimated = true;
-}
+SVGShapeData.prototype.setAsAnimated = function () {
+  this._isAnimated = true;
+};
+
+/* exported SVGTransformData */
+
 function SVGTransformData(mProps, op, container) {
-	this.transform = {
-		mProps: mProps,
-		op: op,
-		container: container
-	};
-	this.elements = [];
-    this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
+  this.transform = {
+    mProps: mProps,
+    op: op,
+    container: container,
+  };
+  this.elements = [];
+  this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
 }
-function SVGStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
-    this._isAnimated = !!this._isAnimated;
+
+/* global DashProperty, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
-function SVGFillStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
+
+/* global PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
-function SVGGradientFillStyleData(elem, data, styleOb){
-    this.initDynamicPropertyContainer(elem);
-    this.getValue = this.iterateDynamicProperties;
-    this.initGradientData(elem, data, styleOb);
+
+/* global PropertyFactory, degToRads, GradientProperty, createElementID, createNS, locationHref,
+extendPrototype, DynamicPropertyContainer */
+
+function SVGGradientFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.initGradientData(elem, data, styleOb);
 }
 
-SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){
-    this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-    this.s = PropertyFactory.getProp(elem,data.s,1,null,this);
-    this.e = PropertyFactory.getProp(elem,data.e,1,null,this);
-    this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this);
-    this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this);
-    this.g = new GradientProperty(elem,data.g,this);
-    this.style = styleOb;
-    this.stops = [];
-    this.setGradientData(styleOb.pElem, data);
-    this.setGradientOpacity(data, styleOb);
-    this._isAnimated = !!this._isAnimated;
-
+SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) {
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.s = PropertyFactory.getProp(elem, data.s, 1, null, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 1, null, this);
+  this.h = PropertyFactory.getProp(elem, data.h || { k: 0 }, 0, 0.01, this);
+  this.a = PropertyFactory.getProp(elem, data.a || { k: 0 }, 0, degToRads, this);
+  this.g = new GradientProperty(elem, data.g, this);
+  this.style = styleOb;
+  this.stops = [];
+  this.setGradientData(styleOb.pElem, data);
+  this.setGradientOpacity(data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 };
 
-SVGGradientFillStyleData.prototype.setGradientData = function(pathElement,data){
+SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) {
+  var gradientId = createElementID();
+  var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+  gfill.setAttribute('id', gradientId);
+  gfill.setAttribute('spreadMethod', 'pad');
+  gfill.setAttribute('gradientUnits', 'userSpaceOnUse');
+  var stops = [];
+  var stop;
+  var j;
+  var jLen;
+  jLen = data.g.p * 4;
+  for (j = 0; j < jLen; j += 4) {
+    stop = createNS('stop');
+    gfill.appendChild(stop);
+    stops.push(stop);
+  }
+  pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + gradientId + ')');
 
-    var gradientId = createElementID();
-    var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-    gfill.setAttribute('id',gradientId);
-    gfill.setAttribute('spreadMethod','pad');
-    gfill.setAttribute('gradientUnits','userSpaceOnUse');
-    var stops = [];
-    var stop, j, jLen;
-    jLen = data.g.p*4;
-    for(j=0;j<jLen;j+=4){
-        stop = createNS('stop');
-        gfill.appendChild(stop);
-        stops.push(stop);
-    }
-    pathElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+gradientId+')');
-    
-    this.gf = gfill;
-    this.cst = stops;
+  this.gf = gfill;
+  this.cst = stops;
 };
 
-SVGGradientFillStyleData.prototype.setGradientOpacity = function(data, styleOb){
-    if(this.g._hasOpacity && !this.g._collapsable){
-        var stop, j, jLen;
-        var mask = createNS("mask");
-        var maskElement = createNS( 'path');
-        mask.appendChild(maskElement);
-        var opacityId = createElementID();
-        var maskId = createElementID();
-        mask.setAttribute('id',maskId);
-        var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-        opFill.setAttribute('id',opacityId);
-        opFill.setAttribute('spreadMethod','pad');
-        opFill.setAttribute('gradientUnits','userSpaceOnUse');
-        jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
-        var stops = this.stops;
-        for(j=data.g.p*4;j<jLen;j+=2){
-            stop = createNS('stop');
-            stop.setAttribute('stop-color','rgb(255,255,255)');
-            opFill.appendChild(stop);
-            stops.push(stop);
-        }
-        maskElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+opacityId+')');
-        this.of = opFill;
-        this.ms = mask;
-        this.ost = stops;
-        this.maskId = maskId;
-        styleOb.msElem = maskElement;
+SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) {
+  if (this.g._hasOpacity && !this.g._collapsable) {
+    var stop;
+    var j;
+    var jLen;
+    var mask = createNS('mask');
+    var maskElement = createNS('path');
+    mask.appendChild(maskElement);
+    var opacityId = createElementID();
+    var maskId = createElementID();
+    mask.setAttribute('id', maskId);
+    var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+    opFill.setAttribute('id', opacityId);
+    opFill.setAttribute('spreadMethod', 'pad');
+    opFill.setAttribute('gradientUnits', 'userSpaceOnUse');
+    jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
+    var stops = this.stops;
+    for (j = data.g.p * 4; j < jLen; j += 2) {
+      stop = createNS('stop');
+      stop.setAttribute('stop-color', 'rgb(255,255,255)');
+      opFill.appendChild(stop);
+      stops.push(stop);
     }
+    maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + opacityId + ')');
+    this.of = opFill;
+    this.ms = mask;
+    this.ost = stops;
+    this.maskId = maskId;
+    styleOb.msElem = maskElement;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
-function SVGGradientStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-    this.initGradientData(elem, data, styleOb);
-    this._isAnimated = !!this._isAnimated;
+
+/* global PropertyFactory, DashProperty, extendPrototype, SVGGradientFillStyleData, DynamicPropertyContainer */
+
+function SVGGradientStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.initGradientData(elem, data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
+
+/* global createNS */
+/* exported ShapeGroupData */
+
 function ShapeGroupData() {
-	this.it = [];
-    this.prevViewData = [];
-    this.gr = createNS('g');
+  this.it = [];
+  this.prevViewData = [];
+  this.gr = createNS('g');
 }
-var SVGElementsRenderer = (function() {
-	var _identityMatrix = new Matrix();
-	var _matrixHelper = new Matrix();
 
-	var ob = {
-		createRenderFunction: createRenderFunction
-	}
+/* global Matrix, buildShapeString, bmFloor */
+/* exported SVGElementsRenderer */
 
-	function createRenderFunction(data) {
-	    var ty = data.ty;
-	    switch(data.ty) {
-	        case 'fl':
-	        return renderFill;
-	        case 'gf':
-	        return renderGradient;
-	        case 'gs':
-	        return renderGradientStroke;
-	        case 'st':
-	        return renderStroke;
-	        case 'sh':
-	        case 'el':
-	        case 'rc':
-	        case 'sr':
-	        return renderPath;
-	        case 'tr':
-	        return renderContentTransform;
-	    }
-	}
+var SVGElementsRenderer = (function () {
+  var _identityMatrix = new Matrix();
+  var _matrixHelper = new Matrix();
 
-	function renderContentTransform(styleData, itemData, isFirstFrame) {
-	    if(isFirstFrame || itemData.transform.op._mdf){
-	        itemData.transform.container.setAttribute('opacity',itemData.transform.op.v);
-	    }
-	    if(isFirstFrame || itemData.transform.mProps._mdf){
-	        itemData.transform.container.setAttribute('transform',itemData.transform.mProps.v.to2dCSS());
-	    }
-	}
+  var ob = {
+    createRenderFunction: createRenderFunction,
+  };
 
-	function renderPath(styleData, itemData, isFirstFrame) {
-	    var j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = itemData.styles.length;
-	    var lvl = itemData.lvl;
-	    var paths, mat, props, iterations, k;
-	    for(l=0;l<lLen;l+=1){
-	        redraw = itemData.sh._mdf || isFirstFrame;
-	        if(itemData.styles[l].lvl < lvl){
-	            mat = _matrixHelper.reset();
-	            iterations = lvl - itemData.styles[l].lvl;
-	            k = itemData.transformers.length-1;
-	            while(!redraw && iterations > 0) {
-	                redraw = itemData.transformers[k].mProps._mdf || redraw;
-	                iterations --;
-	                k --;
-	            }
-	            if(redraw) {
-	                iterations = lvl - itemData.styles[l].lvl;
-	                k = itemData.transformers.length-1;
-	                while(iterations > 0) {
-	                    props = itemData.transformers[k].mProps.v.props;
-	                    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]);
-	                    iterations --;
-	                    k --;
-	                }
-	            }
-	        } else {
-	            mat = _identityMatrix;
-	        }
-	        paths = itemData.sh.paths;
-	        jLen = paths._length;
-	        if(redraw){
-	            pathStringTransformed = '';
-	            for(j=0;j<jLen;j+=1){
-	                pathNodes = paths.shapes[j];
-	                if(pathNodes && pathNodes._length){
-	                    pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
-	                }
-	            }
-	            itemData.caches[l] = pathStringTransformed;
-	        } else {
-	            pathStringTransformed = itemData.caches[l];
-	        }
-	        itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
-	        itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
-	    }
-	}
+  function createRenderFunction(data) {
+    switch (data.ty) {
+      case 'fl':
+        return renderFill;
+      case 'gf':
+        return renderGradient;
+      case 'gs':
+        return renderGradientStroke;
+      case 'st':
+        return renderStroke;
+      case 'sh':
+      case 'el':
+      case 'rc':
+      case 'sr':
+        return renderPath;
+      case 'tr':
+        return renderContentTransform;
+      default:
+        return null;
+    }
+  }
 
-	function renderFill (styleData,itemData, isFirstFrame){
-	    var styleElem = itemData.style;
+  function renderContentTransform(styleData, itemData, isFirstFrame) {
+    if (isFirstFrame || itemData.transform.op._mdf) {
+      itemData.transform.container.setAttribute('opacity', itemData.transform.op.v);
+    }
+    if (isFirstFrame || itemData.transform.mProps._mdf) {
+      itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS());
+    }
+  }
 
-	    if(itemData.c._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill','rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill-opacity',itemData.o.v);
-	    }
-	};
+  function renderPath(styleData, itemData, isFirstFrame) {
+    var j;
+    var jLen;
+    var pathStringTransformed;
+    var redraw;
+    var pathNodes;
+    var l;
+    var lLen = itemData.styles.length;
+    var lvl = itemData.lvl;
+    var paths;
+    var mat;
+    var props;
+    var iterations;
+    var k;
+    for (l = 0; l < lLen; l += 1) {
+      redraw = itemData.sh._mdf || isFirstFrame;
+      if (itemData.styles[l].lvl < lvl) {
+        mat = _matrixHelper.reset();
+        iterations = lvl - itemData.styles[l].lvl;
+        k = itemData.transformers.length - 1;
+        while (!redraw && iterations > 0) {
+          redraw = itemData.transformers[k].mProps._mdf || redraw;
+          iterations -= 1;
+          k -= 1;
+        }
+        if (redraw) {
+          iterations = lvl - itemData.styles[l].lvl;
+          k = itemData.transformers.length - 1;
+          while (iterations > 0) {
+            props = itemData.transformers[k].mProps.v.props;
+            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]);
+            iterations -= 1;
+            k -= 1;
+          }
+        }
+      } else {
+        mat = _identityMatrix;
+      }
+      paths = itemData.sh.paths;
+      jLen = paths._length;
+      if (redraw) {
+        pathStringTransformed = '';
+        for (j = 0; j < jLen; j += 1) {
+          pathNodes = paths.shapes[j];
+          if (pathNodes && pathNodes._length) {
+            pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
+          }
+        }
+        itemData.caches[l] = pathStringTransformed;
+      } else {
+        pathStringTransformed = itemData.caches[l];
+      }
+      itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
+      itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
+    }
+  }
 
-	function renderGradientStroke (styleData, itemData, isFirstFrame) {
-	    renderGradient(styleData, itemData, isFirstFrame);
-	    renderStroke(styleData, itemData, isFirstFrame);
-	}
+  function renderFill(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
 
-	function renderGradient(styleData, itemData, isFirstFrame) {
-	    var gfill = itemData.gf;
-	    var hasOpacity = itemData.g._hasOpacity;
-	    var pt1 = itemData.s.v, pt2 = itemData.e.v;
+    if (itemData.c._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill-opacity', itemData.o.v);
+    }
+  }
 
-	    if (itemData.o._mdf || isFirstFrame) {
-	        var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
-	        itemData.style.pElem.setAttribute(attr, itemData.o.v);
-	    }
-	    if (itemData.s._mdf || isFirstFrame) {
-	        var attr1 = styleData.t === 1 ? 'x1' : 'cx';
-	        var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
-	        gfill.setAttribute(attr1, pt1[0]);
-	        gfill.setAttribute(attr2, pt1[1]);
-	        if (hasOpacity && !itemData.g._collapsable) {
-	            itemData.of.setAttribute(attr1, pt1[0]);
-	            itemData.of.setAttribute(attr2, pt1[1]);
-	        }
-	    }
-	    var stops, i, len, stop;
-	    if (itemData.g._cmdf || isFirstFrame) {
-	        stops = itemData.cst;
-	        var cValues = itemData.g.c;
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1){
-	            stop = stops[i];
-	            stop.setAttribute('offset', cValues[i * 4] + '%');
-	            stop.setAttribute('stop-color','rgb('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ')');
-	        }
-	    }
-	    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
-	        var oValues = itemData.g.o;
-	        if(itemData.g._collapsable) {
-	            stops = itemData.cst;
-	        } else {
-	            stops = itemData.ost;
-	        }
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1) {
-	            stop = stops[i];
-	            if(!itemData.g._collapsable) {
-	                stop.setAttribute('offset', oValues[i * 2] + '%');
-	            }
-	            stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
-	        }
-	    }
-	    if (styleData.t === 1) {
-	        if (itemData.e._mdf  || isFirstFrame) {
-	            gfill.setAttribute('x2', pt2[0]);
-	            gfill.setAttribute('y2', pt2[1]);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('x2', pt2[0]);
-	                itemData.of.setAttribute('y2', pt2[1]);
-	            }
-	        }
-	    } else {
-	        var rad;
-	        if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
-	            rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            gfill.setAttribute('r', rad);
-	            if(hasOpacity && !itemData.g._collapsable){
-	                itemData.of.setAttribute('r', rad);
-	            }
-	        }
-	        if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
-	            if (!rad) {
-	                rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            }
-	            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+  function renderGradientStroke(styleData, itemData, isFirstFrame) {
+    renderGradient(styleData, itemData, isFirstFrame);
+    renderStroke(styleData, itemData, isFirstFrame);
+  }
 
-	            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-	            var dist = rad * percent;
-	            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-	            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-	            gfill.setAttribute('fx', x);
-	            gfill.setAttribute('fy', y);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('fx', x);
-	                itemData.of.setAttribute('fy', y);
-	            }
-	        }
-	        //gfill.setAttribute('fy','200');
-	    }
-	};
+  function renderGradient(styleData, itemData, isFirstFrame) {
+    var gfill = itemData.gf;
+    var hasOpacity = itemData.g._hasOpacity;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
 
-	function renderStroke(styleData, itemData, isFirstFrame) {
-	    var styleElem = itemData.style;
-	    var d = itemData.d;
-	    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
-	        styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
-	        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
-	    }
-	    if(itemData.c && (itemData.c._mdf || isFirstFrame)){
-	        styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
-	    }
-	    if(itemData.w._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
-	        if(styleElem.msElem){
-	            styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
-	        }
-	    }
-	};
+    if (itemData.o._mdf || isFirstFrame) {
+      var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
+      itemData.style.pElem.setAttribute(attr, itemData.o.v);
+    }
+    if (itemData.s._mdf || isFirstFrame) {
+      var attr1 = styleData.t === 1 ? 'x1' : 'cx';
+      var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
+      gfill.setAttribute(attr1, pt1[0]);
+      gfill.setAttribute(attr2, pt1[1]);
+      if (hasOpacity && !itemData.g._collapsable) {
+        itemData.of.setAttribute(attr1, pt1[0]);
+        itemData.of.setAttribute(attr2, pt1[1]);
+      }
+    }
+    var stops;
+    var i;
+    var len;
+    var stop;
+    if (itemData.g._cmdf || isFirstFrame) {
+      stops = itemData.cst;
+      var cValues = itemData.g.c;
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        stop.setAttribute('offset', cValues[i * 4] + '%');
+        stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')');
+      }
+    }
+    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
+      var oValues = itemData.g.o;
+      if (itemData.g._collapsable) {
+        stops = itemData.cst;
+      } else {
+        stops = itemData.ost;
+      }
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        if (!itemData.g._collapsable) {
+          stop.setAttribute('offset', oValues[i * 2] + '%');
+        }
+        stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
+      }
+    }
+    if (styleData.t === 1) {
+      if (itemData.e._mdf || isFirstFrame) {
+        gfill.setAttribute('x2', pt2[0]);
+        gfill.setAttribute('y2', pt2[1]);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('x2', pt2[0]);
+          itemData.of.setAttribute('y2', pt2[1]);
+        }
+      }
+    } else {
+      var rad;
+      if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
+        rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        gfill.setAttribute('r', rad);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('r', rad);
+        }
+      }
+      if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
+        if (!rad) {
+          rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        }
+        var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
 
-	return ob;
-}())
+        var percent = itemData.h.v;
+        if (percent >= 1) {
+          percent = 0.99;
+        } else if (percent <= -1) {
+          percent = -0.99;
+        }
+        var dist = rad * percent;
+        var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+        var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+        gfill.setAttribute('fx', x);
+        gfill.setAttribute('fy', y);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('fx', x);
+          itemData.of.setAttribute('fy', y);
+        }
+      }
+      // gfill.setAttribute('fy','200');
+    }
+  }
+
+  function renderStroke(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
+    var d = itemData.d;
+    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
+      styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
+      styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
+    }
+    if (itemData.c && (itemData.c._mdf || isFirstFrame)) {
+      styleElem.pElem.setAttribute('stroke', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
+    }
+    if (itemData.w._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
+      if (styleElem.msElem) {
+        styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
+      }
+    }
+  }
+
+  return ob;
+}());
+
+/* global Matrix */
+
 function ShapeTransformManager() {
-	this.sequences = {};
-	this.sequenceList = [];
-    this.transform_key_count = 0;
+  this.sequences = {};
+  this.sequenceList = [];
+  this.transform_key_count = 0;
 }
 
 ShapeTransformManager.prototype = {
-	addTransformSequence: function(transforms) {
-		var i, len = transforms.length;
-		var key = '_';
-		for(i = 0; i < len; i += 1) {
-			key += transforms[i].transform.key + '_';
-		}
-		var sequence = this.sequences[key];
-		if(!sequence) {
-			sequence = {
-				transforms: [].concat(transforms),
-				finalTransform: new Matrix(),
-				_mdf: false
-			};
-			this.sequences[key] = sequence;
-			this.sequenceList.push(sequence);
-		}
-		return sequence;
-	},
-	processSequence: function(sequence, isFirstFrame) {
-		var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
-		while (i < len && !isFirstFrame) {
-			if (sequence.transforms[i].transform.mProps._mdf) {
-				_mdf = true;
-				break;
-			}
-			i += 1
-		}
-		if (_mdf) {
-			var props;
-			sequence.finalTransform.reset();
-			for (i = len - 1; i >= 0; i -= 1) {
-		        props = sequence.transforms[i].transform.mProps.v.props;
-		        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]);
-			}
-		}
-		sequence._mdf = _mdf;
-		
-	},
-	processSequences: function(isFirstFrame) {
-		var i, len = this.sequenceList.length;
-		for (i = 0; i < len; i += 1) {
-			this.processSequence(this.sequenceList[i], isFirstFrame);
-		}
-
-	},
-	getNewKey: function() {
-		return '_' + this.transform_key_count++;
-	}
-}
-function CVShapeData(element, data, styles, transformsManager) {
-    this.styledShapes = [];
-    this.tr = [0,0,0,0,0,0];
-    var ty = 4;
-    if(data.ty == 'rc'){
-        ty = 5;
-    }else if(data.ty == 'el'){
-        ty = 6;
-    }else if(data.ty == 'sr'){
-        ty = 7;
-    }
-    this.sh = ShapePropertyFactory.getShapeProp(element,data,ty,element);
-    var i , len = styles.length,styledShape;
+  addTransformSequence: function (transforms) {
+    var i;
+    var len = transforms.length;
+    var key = '_';
     for (i = 0; i < len; i += 1) {
-        if (!styles[i].closed) {
-            styledShape = {
-                transforms: transformsManager.addTransformSequence(styles[i].transforms),
-                trNodes: []
-            }
-            this.styledShapes.push(styledShape);
-            styles[i].elements.push(styledShape);
-        }
+      key += transforms[i].transform.key + '_';
     }
+    var sequence = this.sequences[key];
+    if (!sequence) {
+      sequence = {
+        transforms: [].concat(transforms),
+        finalTransform: new Matrix(),
+        _mdf: false,
+      };
+      this.sequences[key] = sequence;
+      this.sequenceList.push(sequence);
+    }
+    return sequence;
+  },
+  processSequence: function (sequence, isFirstFrame) {
+    var i = 0;
+    var len = sequence.transforms.length;
+    var _mdf = isFirstFrame;
+    while (i < len && !isFirstFrame) {
+      if (sequence.transforms[i].transform.mProps._mdf) {
+        _mdf = true;
+        break;
+      }
+      i += 1;
+    }
+    if (_mdf) {
+      var props;
+      sequence.finalTransform.reset();
+      for (i = len - 1; i >= 0; i -= 1) {
+        props = sequence.transforms[i].transform.mProps.v.props;
+        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]);
+      }
+    }
+    sequence._mdf = _mdf;
+  },
+  processSequences: function (isFirstFrame) {
+    var i;
+    var len = this.sequenceList.length;
+    for (i = 0; i < len; i += 1) {
+      this.processSequence(this.sequenceList[i], isFirstFrame);
+    }
+  },
+  getNewKey: function () {
+    this.transform_key_count += 1;
+    return '_' + this.transform_key_count;
+  },
+};
+
+/* global ShapePropertyFactory, SVGShapeData */
+
+function CVShapeData(element, data, styles, transformsManager) {
+  this.styledShapes = [];
+  this.tr = [0, 0, 0, 0, 0, 0];
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  this.sh = ShapePropertyFactory.getShapeProp(element, data, ty, element);
+  var i;
+  var len = styles.length;
+  var styledShape;
+  for (i = 0; i < len; i += 1) {
+    if (!styles[i].closed) {
+      styledShape = {
+        transforms: transformsManager.addTransformSequence(styles[i].transforms),
+        trNodes: [],
+      };
+      this.styledShapes.push(styledShape);
+      styles[i].elements.push(styledShape);
+    }
+  }
 }
 
 CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;
-function BaseElement(){
+
+/* global LayerExpressionInterface, EffectsExpressionInterface, CompExpressionInterface, ShapeExpressionInterface,
+TextExpressionInterface, getBlendMode,createElementID, EffectsManager */
+
+function BaseElement() {
 }
 
 BaseElement.prototype = {
-    checkMasks: function(){
-        if(!this.data.hasMask){
-            return false;
-        }
-        var i = 0, len = this.data.masksProperties.length;
-        while(i<len) {
-            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-                return true;
-            }
-            i += 1;
-        }
-        return false;
-    },
-    initExpressions: function(){
-        this.layerInterface = LayerExpressionInterface(this);
-        if(this.data.hasMask && this.maskManager) {
-            this.layerInterface.registerMaskInterface(this.maskManager);
-        }
-        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-        this.layerInterface.registerEffectsInterface(effectsInterface);
-
-        if(this.data.ty === 0 || this.data.xt){
-            this.compInterface = CompExpressionInterface(this);
-        } else if(this.data.ty === 4){
-            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
-            this.layerInterface.content = this.layerInterface.shapeInterface;
-        } else if(this.data.ty === 5){
-            this.layerInterface.textInterface = TextExpressionInterface(this);
-            this.layerInterface.text = this.layerInterface.textInterface;
-        }
-    },
-    setBlendMode: function(){
-        var blendModeValue = getBlendMode(this.data.bm);
-        var elem = this.baseElement || this.layerElement;
-
-        elem.style['mix-blend-mode'] = blendModeValue;
-    },
-    initBaseData: function(data, globalData, comp){
-        this.globalData = globalData;
-        this.comp = comp;
-        this.data = data;
-        this.layerId = createElementID();
-        
-        //Stretch factor for old animations missing this property.
-        if(!this.data.sr){
-            this.data.sr = 1;
-        }
-        // effects manager
-        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-        
-    },
-    getType: function(){
-        return this.type;
+  checkMasks: function () {
+    if (!this.data.hasMask) {
+      return false;
     }
-    ,sourceRectAtTime: function(){}
-}
-function NullElement(data,globalData,comp){
-    this.initFrame();
-	this.initBaseData(data, globalData, comp);
-    this.initFrame();
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
+    var i = 0;
+    var len = this.data.masksProperties.length;
+    while (i < len) {
+      if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+        return true;
+      }
+      i += 1;
+    }
+    return false;
+  },
+  initExpressions: function () {
+    this.layerInterface = LayerExpressionInterface(this);
+    if (this.data.hasMask && this.maskManager) {
+      this.layerInterface.registerMaskInterface(this.maskManager);
+    }
+    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
+    this.layerInterface.registerEffectsInterface(effectsInterface);
+
+    if (this.data.ty === 0 || this.data.xt) {
+      this.compInterface = CompExpressionInterface(this);
+    } else if (this.data.ty === 4) {
+      this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
+      this.layerInterface.content = this.layerInterface.shapeInterface;
+    } else if (this.data.ty === 5) {
+      this.layerInterface.textInterface = TextExpressionInterface(this);
+      this.layerInterface.text = this.layerInterface.textInterface;
+    }
+  },
+  setBlendMode: function () {
+    var blendModeValue = getBlendMode(this.data.bm);
+    var elem = this.baseElement || this.layerElement;
+
+    elem.style['mix-blend-mode'] = blendModeValue;
+  },
+  initBaseData: function (data, globalData, comp) {
+    this.globalData = globalData;
+    this.comp = comp;
+    this.data = data;
+    this.layerId = createElementID();
+
+    // Stretch factor for old animations missing this property.
+    if (!this.data.sr) {
+      this.data.sr = 1;
+    }
+    // effects manager
+    this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
+  },
+  getType: function () {
+    return this.type;
+  },
+  sourceRectAtTime: function () {},
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement */
+
+function NullElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initFrame();
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
 }
 
-NullElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
+NullElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-NullElement.prototype.renderFrame = function() {
+NullElement.prototype.renderFrame = function () {
 };
 
-NullElement.prototype.getBaseElement = function() {
-	return null;
+NullElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-NullElement.prototype.destroy = function() {
+NullElement.prototype.destroy = function () {
 };
 
-NullElement.prototype.sourceRectAtTime = function() {
+NullElement.prototype.sourceRectAtTime = function () {
 };
 
-NullElement.prototype.hide = function() {
+NullElement.prototype.hide = function () {
 };
 
-extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
 
-function SVGBaseElement(){
+/* global filtersFactory, featureSupport, filtersFactory, createElementID, createNS, MaskElement, SVGEffects, locationHref */
+
+function SVGBaseElement() {
 }
 
 SVGBaseElement.prototype = {
-    initRendererElement: function() {
-        this.layerElement = createNS('g');
-    },
-    createContainerElements: function(){
-        this.matteElement = createNS('g');
-        this.transformedElement = this.layerElement;
-        this.maskedElement = this.layerElement;
-        this._sizeChanged = false;
-        var layerElementParent = null;
-        //If this layer acts as a mask for the following layer
-        var filId, fil, gg;
-        if (this.data.td) {
-            if (this.data.td == 3 || this.data.td == 1) {
-                var masker = createNS('mask');
-                masker.setAttribute('id', this.layerId);
-                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
-                masker.appendChild(this.layerElement);
-                layerElementParent = masker;
-                this.globalData.defs.appendChild(masker);
-                // This is only for IE and Edge when mask if of type alpha
-                if (!featureSupport.maskType && this.data.td == 1) {
-                    masker.setAttribute('mask-type', 'luminance');
-                    filId = createElementID();
-                    fil = filtersFactory.createFilter(filId);
-                    this.globalData.defs.appendChild(fil);
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    masker.appendChild(gg);
-                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
-                }
-            } else if(this.data.td == 2) {
-                var maskGroup = createNS('mask');
-                maskGroup.setAttribute('id', this.layerId);
-                maskGroup.setAttribute('mask-type','alpha');
-                var maskGrouper = createNS('g');
-                maskGroup.appendChild(maskGrouper);
-                filId = createElementID();
-                fil = filtersFactory.createFilter(filId);
-                ////
+  initRendererElement: function () {
+    this.layerElement = createNS('g');
+  },
+  createContainerElements: function () {
+    this.matteElement = createNS('g');
+    this.transformedElement = this.layerElement;
+    this.maskedElement = this.layerElement;
+    this._sizeChanged = false;
+    var layerElementParent = null;
+    // If this layer acts as a mask for the following layer
+    var filId;
+    var fil;
+    var gg;
+    if (this.data.td) {
+      if (this.data.td == 3 || this.data.td == 1) { // eslint-disable-line eqeqeq
+        var masker = createNS('mask');
+        masker.setAttribute('id', this.layerId);
+        masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha'); // eslint-disable-line eqeqeq
+        masker.appendChild(this.layerElement);
+        layerElementParent = masker;
+        this.globalData.defs.appendChild(masker);
+        // This is only for IE and Edge when mask if of type alpha
+        if (!featureSupport.maskType && this.data.td == 1) { // eslint-disable-line eqeqeq
+          masker.setAttribute('mask-type', 'luminance');
+          filId = createElementID();
+          fil = filtersFactory.createFilter(filId);
+          this.globalData.defs.appendChild(fil);
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          masker.appendChild(gg);
+          gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        }
+      } else if (this.data.td == 2) { // eslint-disable-line eqeqeq
+        var maskGroup = createNS('mask');
+        maskGroup.setAttribute('id', this.layerId);
+        maskGroup.setAttribute('mask-type', 'alpha');
+        var maskGrouper = createNS('g');
+        maskGroup.appendChild(maskGrouper);
+        filId = createElementID();
+        fil = filtersFactory.createFilter(filId);
+        /// /
 
-                // This solution doesn't work on Android when meta tag with viewport attribute is set
-                /*var feColorMatrix = createNS('feColorMatrix');
+        // This solution doesn't work on Android when meta tag with viewport attribute is set
+        /* var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type', 'matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
                 feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-                fil.appendChild(feColorMatrix);*/
-                ////
-                var feCTr = createNS('feComponentTransfer');
-                feCTr.setAttribute('in','SourceGraphic');
-                fil.appendChild(feCTr);
-                var feFunc = createNS('feFuncA');
-                feFunc.setAttribute('type','table');
-                feFunc.setAttribute('tableValues','1.0 0.0');
-                feCTr.appendChild(feFunc);
-                ////
-                this.globalData.defs.appendChild(fil);
-                var alphaRect = createNS('rect');
-                alphaRect.setAttribute('width',  this.comp.data.w);
-                alphaRect.setAttribute('height', this.comp.data.h);
-                alphaRect.setAttribute('x','0');
-                alphaRect.setAttribute('y','0');
-                alphaRect.setAttribute('fill','#ffffff');
-                alphaRect.setAttribute('opacity','0');
-                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
-                maskGrouper.appendChild(alphaRect);
-                maskGrouper.appendChild(this.layerElement);
-                layerElementParent = maskGrouper;
-                if (!featureSupport.maskType) {
-                    maskGroup.setAttribute('mask-type', 'luminance');
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    maskGrouper.appendChild(alphaRect);
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    maskGrouper.appendChild(gg);
-                }
-                this.globalData.defs.appendChild(maskGroup);
-            }
-        } else if (this.data.tt) {
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        } else {
-            this.baseElement = this.layerElement;
+                fil.appendChild(feColorMatrix); */
+        /// /
+        var feCTr = createNS('feComponentTransfer');
+        feCTr.setAttribute('in', 'SourceGraphic');
+        fil.appendChild(feCTr);
+        var feFunc = createNS('feFuncA');
+        feFunc.setAttribute('type', 'table');
+        feFunc.setAttribute('tableValues', '1.0 0.0');
+        feCTr.appendChild(feFunc);
+        /// /
+        this.globalData.defs.appendChild(fil);
+        var alphaRect = createNS('rect');
+        alphaRect.setAttribute('width', this.comp.data.w);
+        alphaRect.setAttribute('height', this.comp.data.h);
+        alphaRect.setAttribute('x', '0');
+        alphaRect.setAttribute('y', '0');
+        alphaRect.setAttribute('fill', '#ffffff');
+        alphaRect.setAttribute('opacity', '0');
+        maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        maskGrouper.appendChild(alphaRect);
+        maskGrouper.appendChild(this.layerElement);
+        layerElementParent = maskGrouper;
+        if (!featureSupport.maskType) {
+          maskGroup.setAttribute('mask-type', 'luminance');
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          maskGrouper.appendChild(alphaRect);
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          maskGrouper.appendChild(gg);
         }
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id', this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
-        if (this.data.ty === 0 && !this.data.hd) {
-            var cp = createNS( 'clipPath');
-            var pt = createNS('path');
-            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
-            var clipId = createElementID();
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-
-            if (this.checkMasks()) {
-                var cpGroup = createNS('g');
-                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
-                cpGroup.appendChild(this.layerElement);
-                this.transformedElement = cpGroup;
-                if (layerElementParent) {
-                    layerElementParent.appendChild(this.transformedElement);
-                } else {
-                    this.baseElement = this.transformedElement;
-                }
-            } else {
-                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
-            }
-            
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-
-    },
-    renderElement: function() {
-        if (this.finalTransform._matMdf) {
-            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
-        }
-        if (this.finalTransform._opMdf) {
-            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
-        }
-    },
-    destroyBaseElement: function() {
-        this.layerElement = null;
-        this.matteElement = null;
-        this.maskManager.destroy();
-    },
-    getBaseElement: function() {
-        if (this.data.hd) {
-            return null;
-        }
-        return this.baseElement;
-    },
-    createRenderableComponents: function() {
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-        this.renderableEffectsManager = new SVGEffects(this);
-    },
-    setMatte: function(id) {
-        if (!this.matteElement) {
-            return;
-        }
-        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
+        this.globalData.defs.appendChild(maskGroup);
+      }
+    } else if (this.data.tt) {
+      this.matteElement.appendChild(this.layerElement);
+      layerElementParent = this.matteElement;
+      this.baseElement = this.matteElement;
+    } else {
+      this.baseElement = this.layerElement;
     }
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+    if (this.data.ty === 0 && !this.data.hd) {
+      var cp = createNS('clipPath');
+      var pt = createNS('path');
+      pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+      var clipId = createElementID();
+      cp.setAttribute('id', clipId);
+      cp.appendChild(pt);
+      this.globalData.defs.appendChild(cp);
+
+      if (this.checkMasks()) {
+        var cpGroup = createNS('g');
+        cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+        cpGroup.appendChild(this.layerElement);
+        this.transformedElement = cpGroup;
+        if (layerElementParent) {
+          layerElementParent.appendChild(this.transformedElement);
+        } else {
+          this.baseElement = this.transformedElement;
+        }
+      } else {
+        this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+      }
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    if (this.finalTransform._matMdf) {
+      this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+    }
+    if (this.finalTransform._opMdf) {
+      this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+    }
+  },
+  destroyBaseElement: function () {
+    this.layerElement = null;
+    this.matteElement = null;
+    this.maskManager.destroy();
+  },
+  getBaseElement: function () {
+    if (this.data.hd) {
+      return null;
+    }
+    return this.baseElement;
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+    this.renderableEffectsManager = new SVGEffects(this);
+  },
+  setMatte: function (id) {
+    if (!this.matteElement) {
+      return;
+    }
+    this.matteElement.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+  },
 };
-function IShapeElement(){
+
+/* global ProcessedElement */
+
+function IShapeElement() {
 }
 
 IShapeElement.prototype = {
-    addShapeToModifiers: function(data) {
-        var i, len = this.shapeModifiers.length;
-        for(i=0;i<len;i+=1){
-            this.shapeModifiers[i].addShape(data);
-        }
-    },
-    isShapeInAnimatedModifiers: function(data) {
-        var i = 0, len = this.shapeModifiers.length;
-        while(i < len) {
-            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
-                return true;
-            }
-        }
-        return false;
-    },
-    renderModifiers: function() {
-        if(!this.shapeModifiers.length){
-            return;
-        }
-        var i, len = this.shapes.length;
-        for(i=0;i<len;i+=1){
-            this.shapes[i].sh.reset();
-        }
-
-        len = this.shapeModifiers.length;
-        for(i=len-1;i>=0;i-=1){
-            this.shapeModifiers[i].processShapes(this._isFirstFrame);
-        }
-    },
-    lcEnum: {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'square'
-    },
-    ljEnum: {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    },
-    searchProcessedElement: function(elem){
-        var elements = this.processedElements;
-        var i = 0, len = elements.length;
-        while (i < len) {
-            if (elements[i].elem === elem) {
-                return elements[i].pos;
-            }
-            i += 1;
-        }
-        return 0;
-    },
-    addProcessedElement: function(elem, pos){
-        var elements = this.processedElements;
-        var i = elements.length;
-        while(i) {
-            i -= 1;
-            if (elements[i].elem === elem) {
-                elements[i].pos = pos;
-                return;
-            }
-        }
-        elements.push(new ProcessedElement(elem, pos));
-    },
-    prepareFrame: function(num) {
-        this.prepareRenderableFrame(num);
-        this.prepareProperties(num, this.isInRange);
+  addShapeToModifiers: function (data) {
+    var i;
+    var len = this.shapeModifiers.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapeModifiers[i].addShape(data);
     }
-};
-function ITextElement(){
-}
+  },
+  isShapeInAnimatedModifiers: function (data) {
+    var i = 0;
+    var len = this.shapeModifiers.length;
+    while (i < len) {
+      if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  renderModifiers: function () {
+    if (!this.shapeModifiers.length) {
+      return;
+    }
+    var i;
+    var len = this.shapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].sh.reset();
+    }
 
-ITextElement.prototype.initElement = function(data,globalData,comp){
-    this.lettersChangedFlag = true;
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
-    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
-    this.initRenderable();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    this.createContent();
-    this.hide();
-    this.textAnimator.searchProperties(this.dynamicProperties);
-};
-
-ITextElement.prototype.prepareFrame = function(num) {
-    this._mdf = false;
+    len = this.shapeModifiers.length;
+    for (i = len - 1; i >= 0; i -= 1) {
+      this.shapeModifiers[i].processShapes(this._isFirstFrame);
+    }
+  },
+  lcEnum: {
+    1: 'butt',
+    2: 'round',
+    3: 'square',
+  },
+  ljEnum: {
+    1: 'miter',
+    2: 'round',
+    3: 'bevel',
+  },
+  searchProcessedElement: function (elem) {
+    var elements = this.processedElements;
+    var i = 0;
+    var len = elements.length;
+    while (i < len) {
+      if (elements[i].elem === elem) {
+        return elements[i].pos;
+      }
+      i += 1;
+    }
+    return 0;
+  },
+  addProcessedElement: function (elem, pos) {
+    var elements = this.processedElements;
+    var i = elements.length;
+    while (i) {
+      i -= 1;
+      if (elements[i].elem === elem) {
+        elements[i].pos = pos;
+        return;
+      }
+    }
+    elements.push(new ProcessedElement(elem, pos));
+  },
+  prepareFrame: function (num) {
     this.prepareRenderableFrame(num);
     this.prepareProperties(num, this.isInRange);
-    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
-        this.buildNewText();
-        this.textProperty._isFirstFrame = false;
-        this.textProperty._mdf = false;
-    }
+  },
 };
 
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        pathNodes = shapes[j].ks.k;
-        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
-    }
-    return shapeStr;
+/* global TextProperty, TextAnimatorProperty, buildShapeString, LetterProps */
+
+function ITextElement() {
+}
+
+ITextElement.prototype.initElement = function (data, globalData, comp) {
+  this.lettersChangedFlag = true;
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+  this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
+  this.initRenderable();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  this.createContent();
+  this.hide();
+  this.textAnimator.searchProperties(this.dynamicProperties);
 };
 
-ITextElement.prototype.updateDocumentData = function(newData, index) {
-    this.textProperty.updateDocumentData(newData, index);
+ITextElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
+    this.buildNewText();
+    this.textProperty._isFirstFrame = false;
+    this.textProperty._mdf = false;
+  }
 };
 
-ITextElement.prototype.canResizeFont = function(_canResize) {
-    this.textProperty.canResizeFont(_canResize);
+ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
+  var j;
+  var jLen = shapes.length;
+  var pathNodes;
+  var shapeStr = '';
+  for (j = 0; j < jLen; j += 1) {
+    pathNodes = shapes[j].ks.k;
+    shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
+  }
+  return shapeStr;
 };
 
-ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
-    this.textProperty.setMinimumFontSize(_fontSize);
+ITextElement.prototype.updateDocumentData = function (newData, index) {
+  this.textProperty.updateDocumentData(newData, index);
 };
 
-ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
-    if(documentData.ps){
-        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-    }
-    matrixHelper.translate(0,-documentData.ls,0);
-    switch(documentData.j){
-        case 1:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
-            break;
-        case 2:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
-            break;
-    }
-    matrixHelper.translate(xPos, yPos, 0);
+ITextElement.prototype.canResizeFont = function (_canResize) {
+  this.textProperty.canResizeFont(_canResize);
 };
 
+ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
+  this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-ITextElement.prototype.buildColor = function(colorData) {
-    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
+ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
+  if (documentData.ps) {
+    matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+  }
+  matrixHelper.translate(0, -documentData.ls, 0);
+  switch (documentData.j) {
+    case 1:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
+      break;
+    case 2:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
+      break;
+    default:
+      break;
+  }
+  matrixHelper.translate(xPos, yPos, 0);
+};
+
+ITextElement.prototype.buildColor = function (colorData) {
+  return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
 
-ITextElement.prototype.destroy = function(){
-    
+ITextElement.prototype.destroy = function () {
+
 };
-function ICompElement(){}
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement */
+
+function ICompElement() {}
 
 extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
 
-ICompElement.prototype.initElement = function(data,globalData,comp) {
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.initTransform(data, globalData, comp);
-    this.initRenderable();
-    this.initHierarchy();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-    this.hide();
+ICompElement.prototype.initElement = function (data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initTransform(data, globalData, comp);
+  this.initRenderable();
+  this.initHierarchy();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  if (this.data.xt || !globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+  this.hide();
 };
 
-/*ICompElement.prototype.hide = function(){
+/* ICompElement.prototype.hide = function(){
     if(!this.hidden){
         this.hideElement();
         var i,len = this.elements.length;
@@ -8478,1141 +8978,1206 @@
             }
         }
     }
-};*/
+}; */
 
-ICompElement.prototype.prepareFrame = function(num){
-    this._mdf = false;
-    this.prepareRenderableFrame(num);
-    this.prepareProperties(num, this.isInRange);
-    if(!this.isInRange && !this.data.xt){
-        return;
-    }
+ICompElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (!this.isInRange && !this.data.xt) {
+    return;
+  }
 
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    if (timeRemapped === this.data.op) {
+      timeRemapped = this.data.op - 1;
     }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
+    this.renderedFrame = timeRemapped;
+  } else {
+    this.renderedFrame = num / this.data.sr;
+  }
+  var i;
+  var len = this.elements.length;
+  if (!this.completeLayers) {
+    this.checkLayers(this.renderedFrame);
+  }
+  // This iteration needs to be backwards because of how expressions connect between each other
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+      if (this.elements[i]._mdf) {
+        this._mdf = true;
+      }
     }
-    //This iteration needs to be backwards because of how expressions connect between each other
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-            if(this.elements[i]._mdf) {
-                this._mdf = true;
-            }
-        }
-    }
+  }
 };
 
-ICompElement.prototype.renderInnerContent = function() {
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i += 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+ICompElement.prototype.renderInnerContent = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
+ICompElement.prototype.setElements = function (elems) {
+  this.elements = elems;
 };
 
-ICompElement.prototype.getElements = function(){
-    return this.elements;
+ICompElement.prototype.getElements = function () {
+  return this.elements;
 };
 
-ICompElement.prototype.destroyElements = function(){
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
+ICompElement.prototype.destroyElements = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
+  }
 };
 
-ICompElement.prototype.destroy = function(){
-    this.destroyElements();
-    this.destroyBaseElement();
+ICompElement.prototype.destroy = function () {
+  this.destroyElements();
+  this.destroyBaseElement();
 };
 
-function IImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
-    this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, createNS */
+
+function IImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
+  this.sourceRect = {
+    top: 0, left: 0, width: this.assetData.w, height: this.assetData.h,
+  };
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
 
-IImageElement.prototype.createContent = function(){
+IImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.innerElem = createNS('image');
+  this.innerElem.setAttribute('width', this.assetData.w + 'px');
+  this.innerElem.setAttribute('height', this.assetData.h + 'px');
+  this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
+  this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
 
-    this.innerElem = createNS('image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    
-    this.layerElement.appendChild(this.innerElem);
+  this.layerElement.appendChild(this.innerElem);
 };
 
-IImageElement.prototype.sourceRectAtTime = function() {
-	return this.sourceRect;
-}
-function ISolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
+IImageElement.prototype.sourceRectAtTime = function () {
+  return this.sourceRect;
+};
+
+/* global extendPrototype, IImageElement, createNS */
+
+function ISolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createContent = function(){
-
-    var rect = createNS('rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
+ISolidElement.prototype.createContent = function () {
+  var rect = createNS('rect');
+  /// /rect.style.width = this.data.sw;
+  /// /rect.style.height = this.data.sh;
+  /// /rect.style.fill = this.data.sc;
+  rect.setAttribute('width', this.data.sw);
+  rect.setAttribute('height', this.data.sh);
+  rect.setAttribute('fill', this.data.sc);
+  this.layerElement.appendChild(rect);
 };
-function AudioElement(data,globalData,comp){
-    this.initFrame();
-    this.initRenderable();
-    this.assetData = globalData.getAssetData(data.refId);
-	this.initBaseData(data, globalData, comp);
-	this._isPlaying = false;
-	this._canPlay = false;
-	var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.audio = this.globalData.audioController.createAudio(assetPath);
-    this._currentTime = 0;
-    this.globalData.audioController.addAudio(this);
-    this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate,this) : {_placeholder:true};
+
+/* global PropertyFactory, extendPrototype, RenderableElement, BaseElement, FrameElement */
+
+function AudioElement(data, globalData, comp) {
+  this.initFrame();
+  this.initRenderable();
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initBaseData(data, globalData, comp);
+  this._isPlaying = false;
+  this._canPlay = false;
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.audio = this.globalData.audioController.createAudio(assetPath);
+  this._currentTime = 0;
+  this.globalData.audioController.addAudio(this);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
-AudioElement.prototype.prepareFrame = function(num) {
-    this.prepareRenderableFrame(num, true);
-    this.prepareProperties(num, true);
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        this._currentTime = timeRemapped;
-    } else {
-        this._currentTime = num / this.data.sr;
+AudioElement.prototype.prepareFrame = function (num) {
+  this.prepareRenderableFrame(num, true);
+  this.prepareProperties(num, true);
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    this._currentTime = timeRemapped;
+  } else {
+    this._currentTime = num / this.data.sr;
+  }
+};
+
+extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
+
+AudioElement.prototype.renderFrame = function () {
+  if (this.isInRange && this._canPlay) {
+    if (!this._isPlaying) {
+      this.audio.play();
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
+      this._isPlaying = true;
+    } else if (!this.audio.playing()
+      || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
+    ) {
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
     }
+  }
 };
 
-extendPrototype([RenderableElement,BaseElement,FrameElement], AudioElement);
-
-AudioElement.prototype.renderFrame = function() {
-	if (this.isInRange && this._canPlay) {
-		if (!this._isPlaying) {
-			this.audio.play();
-			this.audio.seek(this._currentTime / this.globalData.frameRate);
-			this._isPlaying = true;
-		} else if (!this.audio.playing()
-			|| Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
-		) {
-			this.audio.seek(this._currentTime / this.globalData.frameRate)
-		}
-	}
+AudioElement.prototype.show = function () {
+  // this.audio.play()
 };
 
-AudioElement.prototype.show = function() {
-	// this.audio.play()
+AudioElement.prototype.hide = function () {
+  this.audio.pause();
+  this._isPlaying = false;
 };
 
-AudioElement.prototype.hide = function() {
-	this.audio.pause();
-	this._isPlaying = false;
+AudioElement.prototype.pause = function () {
+  this.audio.pause();
+  this._isPlaying = false;
+  this._canPlay = false;
 };
 
-AudioElement.prototype.pause = function() {
-	this.audio.pause();
-	this._isPlaying = false;
-	this._canPlay = false;
+AudioElement.prototype.resume = function () {
+  this._canPlay = true;
 };
 
-AudioElement.prototype.resume = function() {
-	this._canPlay = true;
+AudioElement.prototype.setRate = function (rateValue) {
+  this.audio.rate(rateValue);
 };
 
-AudioElement.prototype.setRate = function(rateValue) {
-	this.audio.rate(rateValue);
+AudioElement.prototype.volume = function (volumeValue) {
+  this.audio.volume(volumeValue);
 };
 
-AudioElement.prototype.volume = function(volumeValue) {
-	this.audio.volume(volumeValue);
+AudioElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-AudioElement.prototype.getBaseElement = function() {
-	return null;
+AudioElement.prototype.destroy = function () {
 };
 
-AudioElement.prototype.destroy = function() {
+AudioElement.prototype.sourceRectAtTime = function () {
 };
 
-AudioElement.prototype.sourceRectAtTime = function() {
+AudioElement.prototype.initExpressions = function () {
 };
 
-AudioElement.prototype.initExpressions = function() {
-};
+/* global createSizedArray, PropertyFactory, extendPrototype, SVGRenderer, ICompElement, SVGBaseElement */
 
-
-function SVGCompElement(data,globalData,comp){
-    this.layers = data.layers;
-    this.supports3d = true;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
-    //this.layerElement = createNS('g');
-    this.initElement(data,globalData,comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+function SVGCompElement(data, globalData, comp) {
+  this.layers = data.layers;
+  this.supports3d = true;
+  this.completeLayers = false;
+  this.pendingElements = [];
+  this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+  // this.layerElement = createNS('g');
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement);
-function SVGTextElement(data,globalData,comp){
-    this.textSpans = [];
-    this.renderType = 'svg';
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, ITextElement, createSizedArray, createNS */
+
+function SVGTextLottieElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.renderType = 'svg';
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], SVGTextElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement);
 
-SVGTextElement.prototype.createContent = function(){
-
-    if (this.data.singleShape && !this.globalData.fontManager.chars) {
-        this.textContainer = createNS('text');
-    }
+SVGTextLottieElement.prototype.createContent = function () {
+  if (this.data.singleShape && !this.globalData.fontManager.chars) {
+    this.textContainer = createNS('text');
+  }
 };
 
-SVGTextElement.prototype.buildTextContents = function(textArray) {
-    var i = 0, len = textArray.length;
-    var textContents = [], currentTextContent = '';
-    while (i < len) {
-        if(textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
-            textContents.push(currentTextContent);
-            currentTextContent = '';
+SVGTextLottieElement.prototype.buildTextContents = function (textArray) {
+  var i = 0;
+  var len = textArray.length;
+  var textContents = [];
+  var currentTextContent = '';
+  while (i < len) {
+    if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
+      textContents.push(currentTextContent);
+      currentTextContent = '';
+    } else {
+      currentTextContent += textArray[i];
+    }
+    i += 1;
+  }
+  textContents.push(currentTextContent);
+  return textContents;
+};
+
+SVGTextLottieElement.prototype.buildNewText = function () {
+  var i;
+  var len;
+
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
+  if (documentData.fc) {
+    this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
+  } else {
+    this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
+  }
+  if (documentData.sc) {
+    this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
+    this.layerElement.setAttribute('stroke-width', documentData.sw);
+  }
+  this.layerElement.setAttribute('font-size', documentData.finalSize);
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  if (fontData.fClass) {
+    this.layerElement.setAttribute('class', fontData.fClass);
+  } else {
+    this.layerElement.setAttribute('font-family', fontData.fFamily);
+    var fWeight = documentData.fWeight;
+    var fStyle = documentData.fStyle;
+    this.layerElement.setAttribute('font-style', fStyle);
+    this.layerElement.setAttribute('font-weight', fWeight);
+  }
+  this.layerElement.setAttribute('aria-label', documentData.t);
+
+  var letters = documentData.l || [];
+  var usesGlyphs = !!this.globalData.fontManager.chars;
+  len = letters.length;
+
+  var tSpan;
+  var matrixHelper = this.mHelper;
+  var shapes;
+  var shapeStr = '';
+  var singleShape = this.data.singleShape;
+  var xPos = 0;
+  var yPos = 0;
+  var firstLine = true;
+  var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
+  if (singleShape && !usesGlyphs && !documentData.sz) {
+    var tElement = this.textContainer;
+    var justify = 'start';
+    switch (documentData.j) {
+      case 1:
+        justify = 'end';
+        break;
+      case 2:
+        justify = 'middle';
+        break;
+      default:
+        justify = 'start';
+        break;
+    }
+    tElement.setAttribute('text-anchor', justify);
+    tElement.setAttribute('letter-spacing', trackingOffset);
+    var textContent = this.buildTextContents(documentData.finalText);
+    len = textContent.length;
+    yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
+    for (i = 0; i < len; i += 1) {
+      tSpan = this.textSpans[i] || createNS('tspan');
+      tSpan.textContent = textContent[i];
+      tSpan.setAttribute('x', 0);
+      tSpan.setAttribute('y', yPos);
+      tSpan.style.display = 'inherit';
+      tElement.appendChild(tSpan);
+      this.textSpans[i] = tSpan;
+      yPos += documentData.finalLineHeight;
+    }
+
+    this.layerElement.appendChild(tElement);
+  } else {
+    var cachedSpansLength = this.textSpans.length;
+    var shapeData;
+    var charData;
+    for (i = 0; i < len; i += 1) {
+      if (!usesGlyphs || !singleShape || i === 0) {
+        tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs ? 'path' : 'text');
+        if (cachedSpansLength <= i) {
+          tSpan.setAttribute('stroke-linecap', 'butt');
+          tSpan.setAttribute('stroke-linejoin', 'round');
+          tSpan.setAttribute('stroke-miterlimit', '4');
+          this.textSpans[i] = tSpan;
+          this.layerElement.appendChild(tSpan);
+        }
+        tSpan.style.display = 'inherit';
+      }
+
+      matrixHelper.reset();
+      matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+      if (singleShape) {
+        if (letters[i].n) {
+          xPos = -trackingOffset;
+          yPos += documentData.yOffset;
+          yPos += firstLine ? 1 : 0;
+          firstLine = false;
+        }
+        this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
+        xPos += letters[i].l || 0;
+        // xPos += letters[i].val === ' ' ? 0 : trackingOffset;
+        xPos += trackingOffset;
+      }
+      if (usesGlyphs) {
+        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+        shapeData = (charData && charData.data) || {};
+        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+        if (!singleShape) {
+          tSpan.setAttribute('d', this.createPathShape(matrixHelper, shapes));
         } else {
-            currentTextContent += textArray[i];
+          shapeStr += this.createPathShape(matrixHelper, shapes);
         }
-        i += 1;
+      } else {
+        if (singleShape) {
+          tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')');
+        }
+        tSpan.textContent = letters[i].val;
+        tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
+      }
+      //
     }
-    textContents.push(currentTextContent);
-    return textContents;
+    if (singleShape && tSpan) {
+      tSpan.setAttribute('d', shapeStr);
+    }
+  }
+  while (i < this.textSpans.length) {
+    this.textSpans[i].style.display = 'none';
+    i += 1;
+  }
+
+  this._sizeChanged = true;
+};
+
+SVGTextLottieElement.prototype.sourceRectAtTime = function () {
+  this.prepareFrame(this.comp.renderedFrame - this.data.st);
+  this.renderInnerContent();
+  if (this._sizeChanged) {
+    this._sizeChanged = false;
+    var textBox = this.layerElement.getBBox();
+    this.bbox = {
+      top: textBox.y,
+      left: textBox.x,
+      width: textBox.width,
+      height: textBox.height,
+    };
+  }
+  return this.bbox;
+};
+
+SVGTextLottieElement.prototype.renderInnerContent = function () {
+  if (!this.data.singleShape) {
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+    if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
+      this._sizeChanged = true;
+      var i;
+      var len;
+      var renderedLetters = this.textAnimator.renderedLetters;
+
+      var letters = this.textProperty.currentData.l;
+
+      len = letters.length;
+      var renderedLetter;
+      var textSpan;
+      for (i = 0; i < len; i += 1) {
+        if (!letters[i].n) {
+          renderedLetter = renderedLetters[i];
+          textSpan = this.textSpans[i];
+          if (renderedLetter._mdf.m) {
+            textSpan.setAttribute('transform', renderedLetter.m);
+          }
+          if (renderedLetter._mdf.o) {
+            textSpan.setAttribute('opacity', renderedLetter.o);
+          }
+          if (renderedLetter._mdf.sw) {
+            textSpan.setAttribute('stroke-width', renderedLetter.sw);
+          }
+          if (renderedLetter._mdf.sc) {
+            textSpan.setAttribute('stroke', renderedLetter.sc);
+          }
+          if (renderedLetter._mdf.fc) {
+            textSpan.setAttribute('fill', renderedLetter.fc);
+          }
+        }
+      }
+    }
+  }
+};
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement,
+FrameElement, RenderableDOMElement, Matrix, SVGStyleData, SVGStrokeStyleData, SVGFillStyleData,
+SVGGradientFillStyleData, SVGGradientStrokeStyleData, locationHref, getBlendMode, ShapeGroupData,
+TransformPropertyFactory, SVGTransformData, ShapePropertyFactory, SVGShapeData, SVGElementsRenderer, ShapeModifiers */
+
+function SVGShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
 }
 
-SVGTextElement.prototype.buildNewText = function(){
-    var i, len;
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
 
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
-    if(documentData.fc) {
-        this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
-    }else{
-        this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
-    }
-    if(documentData.sc){
-        this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
-        this.layerElement.setAttribute('stroke-width', documentData.sw);
-    }
-    this.layerElement.setAttribute('font-size', documentData.finalSize);
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(fontData.fClass){
-        this.layerElement.setAttribute('class',fontData.fClass);
-    } else {
-        this.layerElement.setAttribute('font-family', fontData.fFamily);
-        var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-        this.layerElement.setAttribute('font-style', fStyle);
-        this.layerElement.setAttribute('font-weight', fWeight);
-    }
-    this.layerElement.setAttribute('aria-label', documentData.t);
-
-    var letters = documentData.l || [];
-    var usesGlyphs = !!this.globalData.fontManager.chars;
-    len = letters.length;
-
-    var tSpan;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '', singleShape = this.data.singleShape;
-    var xPos = 0, yPos = 0, firstLine = true;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    if(singleShape && !usesGlyphs && !documentData.sz) {
-        var tElement = this.textContainer;
-        var justify = 'start';
-        switch(documentData.j) {
-            case 1:
-                justify = 'end';
-                break;
-            case 2:
-                justify = 'middle';
-                break;
-        }
-        tElement.setAttribute('text-anchor',justify);
-        tElement.setAttribute('letter-spacing',trackingOffset);
-        var textContent = this.buildTextContents(documentData.finalText);
-        len = textContent.length;
-        yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
-        for ( i = 0; i < len; i += 1) {
-            tSpan = this.textSpans[i] || createNS('tspan');
-            tSpan.textContent = textContent[i];
-            tSpan.setAttribute('x', 0);
-            tSpan.setAttribute('y', yPos);
-            tSpan.style.display = 'inherit';
-            tElement.appendChild(tSpan);
-            this.textSpans[i] = tSpan;
-            yPos += documentData.finalLineHeight;
-        }
-        
-        this.layerElement.appendChild(tElement);
-    } else {
-        var cachedSpansLength = this.textSpans.length;
-        var shapeData, charData;
-        for (i = 0; i < len; i += 1) {
-            if(!usesGlyphs || !singleShape || i === 0){
-                tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs?'path':'text');
-                if (cachedSpansLength <= i) {
-                    tSpan.setAttribute('stroke-linecap', 'butt');
-                    tSpan.setAttribute('stroke-linejoin','round');
-                    tSpan.setAttribute('stroke-miterlimit','4');
-                    this.textSpans[i] = tSpan;
-                    this.layerElement.appendChild(tSpan);
-                }
-                tSpan.style.display = 'inherit';
-            }
-            
-            matrixHelper.reset();
-            matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
-            if (singleShape) {
-                if(letters[i].n) {
-                    xPos = -trackingOffset;
-                    yPos += documentData.yOffset;
-                    yPos += firstLine ? 1 : 0;
-                    firstLine = false;
-                }
-                this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
-                xPos += letters[i].l || 0;
-                //xPos += letters[i].val === ' ' ? 0 : trackingOffset;
-                xPos += trackingOffset;
-            }
-            if(usesGlyphs) {
-                charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-                shapeData = charData && charData.data || {};
-                shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
-                if(!singleShape){
-                    tSpan.setAttribute('d',this.createPathShape(matrixHelper,shapes));
-                } else {
-                    shapeStr += this.createPathShape(matrixHelper,shapes);
-                }
-            } else {
-                if(singleShape) {
-                    tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")");
-                }
-                tSpan.textContent = letters[i].val;
-                tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            }
-            //
-        }
-        if (singleShape && tSpan) {
-            tSpan.setAttribute('d',shapeStr);
-        }
-    }
-    while (i < this.textSpans.length){
-        this.textSpans[i].style.display = 'none';
-        i += 1;
-    }
-    
-    this._sizeChanged = true;
-};
-
-SVGTextElement.prototype.sourceRectAtTime = function(time){
-    this.prepareFrame(this.comp.renderedFrame - this.data.st);
-    this.renderInnerContent();
-    if(this._sizeChanged){
-        this._sizeChanged = false;
-        var textBox = this.layerElement.getBBox();
-        this.bbox = {
-            top: textBox.y,
-            left: textBox.x,
-            width: textBox.width,
-            height: textBox.height
-        };
-    }
-    return this.bbox;
-};
-
-SVGTextElement.prototype.renderInnerContent = function(){
-
-    if(!this.data.singleShape){
-        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
-        if(this.lettersChangedFlag || this.textAnimator.lettersChangedFlag){
-            this._sizeChanged = true;
-            var  i,len;
-            var renderedLetters = this.textAnimator.renderedLetters;
-
-            var letters = this.textProperty.currentData.l;
-
-            len = letters.length;
-            var renderedLetter, textSpan;
-            for(i=0;i<len;i+=1){
-                if(letters[i].n){
-                    continue;
-                }
-                renderedLetter = renderedLetters[i];
-                textSpan = this.textSpans[i];
-                if(renderedLetter._mdf.m) {
-                    textSpan.setAttribute('transform',renderedLetter.m);
-                }
-                if(renderedLetter._mdf.o) {
-                    textSpan.setAttribute('opacity',renderedLetter.o);
-                }
-                if(renderedLetter._mdf.sw){
-                    textSpan.setAttribute('stroke-width',renderedLetter.sw);
-                }
-                if(renderedLetter._mdf.sc){
-                    textSpan.setAttribute('stroke',renderedLetter.sc);
-                }
-                if(renderedLetter._mdf.fc){
-                    textSpan.setAttribute('fill',renderedLetter.fc);
-                }
-            }
-        }
-    }
-};
-
-function SVGShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
-}
-
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
-
-SVGShapeElement.prototype.initSecondaryElement = function() {
+SVGShapeElement.prototype.initSecondaryElement = function () {
 };
 
 SVGShapeElement.prototype.identityMatrix = new Matrix();
 
-SVGShapeElement.prototype.buildExpressionInterface = function(){};
+SVGShapeElement.prototype.buildExpressionInterface = function () {};
 
-SVGShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
+SVGShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
 };
 
 /*
 This method searches for multiple shapes that affect a single element and one of them is animated
 */
-SVGShapeElement.prototype.filterUniqueShapes = function(){
-    var i, len = this.shapes.length, shape;
-    var j, jLen = this.stylesList.length;
-    var style, count = 0;
-    var tempShapes = [];
-    var areAnimated = false;
-    for(j = 0; j < jLen; j += 1) {
-        style = this.stylesList[j];
-        areAnimated = false;
-        tempShapes.length = 0;
-        for(i = 0; i < len; i += 1) {
-            shape = this.shapes[i];
-            if(shape.styles.indexOf(style) !== -1) {
-                tempShapes.push(shape);
-                areAnimated = shape._isAnimated || areAnimated;
-            }
-        }
-        if(tempShapes.length > 1 && areAnimated) {
-            this.setShapesAsAnimated(tempShapes);
-        }
-    }
-}
-
-SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
-    var i, len = shapes.length;
-    for(i = 0; i < len; i += 1) {
-        shapes[i].setAsAnimated();
-    }
-}
-
-SVGShapeElement.prototype.createStyleElement = function(data, level){
-    //TODO: prevent drawing of hidden styles
-    var elementData;
-    var styleOb = new SVGStyleData(data, level);
-
-    var pathElement = styleOb.pElem;
-    if(data.ty === 'st') {
-        elementData = new SVGStrokeStyleData(this, data, styleOb);
-    } else if(data.ty === 'fl') {
-        elementData = new SVGFillStyleData(this, data, styleOb);
-    } else if(data.ty === 'gf' || data.ty === 'gs') {
-        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
-        elementData = new gradientConstructor(this, data, styleOb);
-        this.globalData.defs.appendChild(elementData.gf);
-        if (elementData.maskId) {
-            this.globalData.defs.appendChild(elementData.ms);
-            this.globalData.defs.appendChild(elementData.of);
-            pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
-        }
-    }
-    
-    if(data.ty === 'st' || data.ty === 'gs') {
-        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
-        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
-        pathElement.setAttribute('fill-opacity','0');
-        if(data.lj === 1) {
-            pathElement.setAttribute('stroke-miterlimit',data.ml);
-        }
-    }
-
-    if(data.r === 2) {
-        pathElement.setAttribute('fill-rule', 'evenodd');
-    }
-
-    if(data.ln){
-        pathElement.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        pathElement.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    this.stylesList.push(styleOb);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = new ShapeGroupData();
-    if(data.ln){
-        elementData.gr.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        elementData.gr.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    return elementData;
-};
-
-SVGShapeElement.prototype.createTransformElement = function(data, container) {
-    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
-    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
-    var ty = 4;
-    if(data.ty === 'rc'){
-        ty = 5;
-    }else if(data.ty === 'el'){
-        ty = 6;
-    }else if(data.ty === 'sr'){
-        ty = 7;
-    }
-    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
-    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
-    var i = 0, len = this.animatedContents.length;
-    while(i < len) {
-        if(this.animatedContents[i].element === element) {
-            return;
-        }
-        i += 1;
-    }
-    this.animatedContents.push({
-        fn: SVGElementsRenderer.createRenderFunction(data),
-        element: element,
-        data: data
-    });
-};
-
-SVGShapeElement.prototype.setElementStyles = function(elementData){
-    var arr = elementData.styles;
-    var j, jLen = this.stylesList.length;
-    for (j = 0; j < jLen; j += 1) {
-        if (!this.stylesList[j].closed) {
-            arr.push(this.stylesList[j]);
-        }
-    }
-};
-
-SVGShapeElement.prototype.reloadShapes = function(){
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for( i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
-    len = this.dynamicProperties.length;
-    for(i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-};
-
-SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._render = render;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], level);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].style.pElem);
-            }
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].gr);
-            }
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                itemsData[i] = this.createTransformElement(arr[i], container);
-            }
-            currentTransform = itemsData[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
-            }
-            this.setElementStyles(itemsData[i]);
-
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        }else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                render = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    len = ownStyles.length;
-    for(i=0;i<len;i+=1){
-        ownStyles[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-SVGShapeElement.prototype.renderInnerContent = function() {
-    this.renderModifiers();
-    var i, len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        this.stylesList[i].reset();
-    }
-    this.renderShape();
-
+SVGShapeElement.prototype.filterUniqueShapes = function () {
+  var i;
+  var len = this.shapes.length;
+  var shape;
+  var j;
+  var jLen = this.stylesList.length;
+  var style;
+  var tempShapes = [];
+  var areAnimated = false;
+  for (j = 0; j < jLen; j += 1) {
+    style = this.stylesList[j];
+    areAnimated = false;
+    tempShapes.length = 0;
     for (i = 0; i < len; i += 1) {
-        if (this.stylesList[i]._mdf || this._isFirstFrame) {
-            if(this.stylesList[i].msElem){
-                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                //Adding M0 0 fixes same mask bug on all browsers
-                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
-            }
-            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
-        }
+      shape = this.shapes[i];
+      if (shape.styles.indexOf(style) !== -1) {
+        tempShapes.push(shape);
+        areAnimated = shape._isAnimated || areAnimated;
+      }
     }
+    if (tempShapes.length > 1 && areAnimated) {
+      this.setShapesAsAnimated(tempShapes);
+    }
+  }
 };
 
-SVGShapeElement.prototype.renderShape = function() {
-    var i, len = this.animatedContents.length;
-    var animatedContent;
-    for(i = 0; i < len; i += 1) {
-        animatedContent = this.animatedContents[i];
-        if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
-            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
-        }
-    }
-}
-
-SVGShapeElement.prototype.destroy = function(){
-    this.destroyBaseElement();
-    this.shapesData = null;
-    this.itemsData = null;
+SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
+  var i;
+  var len = shapes.length;
+  for (i = 0; i < len; i += 1) {
+    shapes[i].setAsAnimated();
+  }
 };
 
-function SVGTintFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    feColorMatrix.setAttribute('result','f2');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-    if(filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k){
-        var feMerge = createNS('feMerge');
-        filter.appendChild(feMerge);
-        var feMergeNode;
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','SourceGraphic');
-        feMerge.appendChild(feMergeNode);
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','f2');
-        feMerge.appendChild(feMergeNode);
-    }
-}
+SVGShapeElement.prototype.createStyleElement = function (data, level) {
+  // TODO: prevent drawing of hidden styles
+  var elementData;
+  var styleOb = new SVGStyleData(data, level);
 
-SVGTintFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var colorBlack = this.filterManager.effectElements[0].p.v;
-        var colorWhite = this.filterManager.effectElements[1].p.v;
-        var opacity = this.filterManager.effectElements[2].p.v/100;
-        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 ' + opacity + ' 0');
+  var pathElement = styleOb.pElem;
+  if (data.ty === 'st') {
+    elementData = new SVGStrokeStyleData(this, data, styleOb);
+  } else if (data.ty === 'fl') {
+    elementData = new SVGFillStyleData(this, data, styleOb);
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+    elementData = new GradientConstructor(this, data, styleOb);
+    this.globalData.defs.appendChild(elementData.gf);
+    if (elementData.maskId) {
+      this.globalData.defs.appendChild(elementData.ms);
+      this.globalData.defs.appendChild(elementData.of);
+      pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
     }
+  }
+
+  if (data.ty === 'st' || data.ty === 'gs') {
+    pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+    pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
+    pathElement.setAttribute('fill-opacity', '0');
+    if (data.lj === 1) {
+      pathElement.setAttribute('stroke-miterlimit', data.ml);
+    }
+  }
+
+  if (data.r === 2) {
+    pathElement.setAttribute('fill-rule', 'evenodd');
+  }
+
+  if (data.ln) {
+    pathElement.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    pathElement.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  this.stylesList.push(styleOb);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
 };
-function SVGFillFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-}
-SVGFillFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color = this.filterManager.effectElements[2].p.v;
-        var opacity = this.filterManager.effectElements[6].p.v;
-        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');
-    }
+
+SVGShapeElement.prototype.createGroupElement = function (data) {
+  var elementData = new ShapeGroupData();
+  if (data.ln) {
+    elementData.gr.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    elementData.gr.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  return elementData;
 };
-function SVGGaussianBlurEffect(filter, filterManager){
-    // Outset the filter region by 100% on all sides to accommodate blur expansion.
-    filter.setAttribute('x','-100%');
-    filter.setAttribute('y','-100%');
-    filter.setAttribute('width','300%');
-    filter.setAttribute('height','300%');
 
-    this.filterManager = filterManager;
-    var feGaussianBlur = createNS('feGaussianBlur');
-    filter.appendChild(feGaussianBlur);
-    this.feGaussianBlur = feGaussianBlur;
-}
+SVGShapeElement.prototype.createTransformElement = function (data, container) {
+  var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
+  var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-SVGGaussianBlurEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        // Empirical value, matching AE's blur appearance.
-        var kBlurrinessToSigma = 0.3;
-        var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
+  var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-        // Dimensions mapping:
-        //
-        //   1 -> horizontal & vertical
-        //   2 -> horizontal only
-        //   3 -> vertical only
-        //
-        var dimensions = this.filterManager.effectElements[1].p.v;
-        var sigmaX = (dimensions == 3) ? 0 : sigma;
-        var sigmaY = (dimensions == 2) ? 0 : sigma;
-
-        this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + " " + sigmaY);
-
-        // Repeat edges mapping:
-        //
-        //   0 -> off -> duplicate
-        //   1 -> on  -> wrap
-        var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate';
-        this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
+  var i = 0;
+  var len = this.animatedContents.length;
+  while (i < len) {
+    if (this.animatedContents[i].element === element) {
+      return;
     }
-}
-function SVGStrokeEffect(elem, filterManager){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.elem = elem;
-    this.paths = [];
-}
+    i += 1;
+  }
+  this.animatedContents.push({
+    fn: SVGElementsRenderer.createRenderFunction(data),
+    element: element,
+    data: data,
+  });
+};
 
-SVGStrokeEffect.prototype.initialize = function(){
+SVGShapeElement.prototype.setElementStyles = function (elementData) {
+  var arr = elementData.styles;
+  var j;
+  var jLen = this.stylesList.length;
+  for (j = 0; j < jLen; j += 1) {
+    if (!this.stylesList[j].closed) {
+      arr.push(this.stylesList[j]);
+    }
+  }
+};
 
-    var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-    var path,groupPath, i, len;
-    if(this.filterManager.effectElements[1].p.v === 1){
-        len = this.elem.maskManager.masksProperties.length;
-        i = 0;
+SVGShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
+  var ownTransformers = [].concat(transformers);
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var currentTransform;
+  var modifier;
+  var processedPos;
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._render = render;
     } else {
-        i = this.filterManager.effectElements[0].p.v - 1;
-        len = i + 1;
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    groupPath = createNS('g'); 
-    groupPath.setAttribute('fill','none');
-    groupPath.setAttribute('stroke-linecap','round');
-    groupPath.setAttribute('stroke-dashoffset',1);
-    for(i;i<len;i+=1){
-        path = createNS('path');
-        groupPath.appendChild(path);
-        this.paths.push({p:path,m:i});
-    }
-    if(this.filterManager.effectElements[10].p.v === 3){
-        var mask = createNS('mask');
-        var id = createElementID();
-        mask.setAttribute('id',id);
-        mask.setAttribute('mask-type','alpha');
-        mask.appendChild(groupPath);
-        this.elem.globalData.defs.appendChild(mask);
-        var g = createNS('g');
-        g.setAttribute('mask','url(' + locationHref + '#'+id+')');
-        while (elemChildren[0]) {
-            g.appendChild(elemChildren[0]);
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], level);
+      } else {
+        itemsData[i].style.closed = false;
+      }
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].style.pElem);
+      }
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
+        for (j = 0; j < jLen; j += 1) {
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        this.elem.layerElement.appendChild(g);
-        this.masker = mask;
-        groupPath.setAttribute('stroke','#fff');
-    } else if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(this.filterManager.effectElements[10].p.v === 2){
-            elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-            while(elemChildren.length){
-                this.elem.layerElement.removeChild(elemChildren[0]);
-            }
-        }
-        this.elem.layerElement.appendChild(groupPath);
-        this.elem.layerElement.removeAttribute('mask');
-        groupPath.setAttribute('stroke','#fff');
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].gr);
+      }
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        itemsData[i] = this.createTransformElement(arr[i], container);
+      }
+      currentTransform = itemsData[i].transform;
+      ownTransformers.push(currentTransform);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+      }
+      this.setElementStyles(itemsData[i]);
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        render = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-    this.initialized = true;
-    this.pathMasker = groupPath;
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  len = ownStyles.length;
+  for (i = 0; i < len; i += 1) {
+    ownStyles[i].closed = true;
+  }
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
 };
 
-SVGStrokeEffect.prototype.renderFrame = function(forceRender){
-    if(!this.initialized){
-        this.initialize();
-    }
-    var i, len = this.paths.length;
-    var mask, path;
-    for(i=0;i<len;i+=1){
-        if(this.paths[i].m === -1) {
-            continue;
-        }
-        mask = this.elem.maskManager.viewData[this.paths[i].m];
-        path = this.paths[i].p;
-        if(forceRender || this.filterManager._mdf || mask.prop._mdf){
-            path.setAttribute('d',mask.lastPath);
-        }
-        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){
-            var dasharrayValue;
-            if(this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100){
-                var s = Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var e = Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var l = path.getTotalLength();
-                dasharrayValue = '0 0 0 ' + l*s + ' ';
-                var lineLength = l*(e-s);
-                var segment = 1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-                var units = Math.floor(lineLength/segment);
-                var j;
-                for(j=0;j<units;j+=1){
-                    dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100 + ' ';
-                }
-                dasharrayValue += '0 ' + l*10 + ' 0 0';
-            } else {
-                dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-            }
-            path.setAttribute('stroke-dasharray',dasharrayValue);
-        }
-    }
-    if(forceRender || this.filterManager.effectElements[4].p._mdf){
-        this.pathMasker.setAttribute('stroke-width',this.filterManager.effectElements[4].p.v*2);
-    }
-    
-    if(forceRender || this.filterManager.effectElements[6].p._mdf){
-        this.pathMasker.setAttribute('opacity',this.filterManager.effectElements[6].p.v);
-    }
-    if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(forceRender || this.filterManager.effectElements[3].p._mdf){
-            var color = this.filterManager.effectElements[3].p.v;
-            this.pathMasker.setAttribute('stroke','rgb('+bm_floor(color[0]*255)+','+bm_floor(color[1]*255)+','+bm_floor(color[2]*255)+')');
-        }
-    }
-};
-function SVGTritoneFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    var feComponentTransfer = createNS('feComponentTransfer');
-    feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-    filter.appendChild(feComponentTransfer);
-    this.matrixFilter = feComponentTransfer;
-    var feFuncR = createNS('feFuncR');
-    feFuncR.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncR);
-    this.feFuncR = feFuncR;
-    var feFuncG = createNS('feFuncG');
-    feFuncG.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncG);
-    this.feFuncG = feFuncG;
-    var feFuncB = createNS('feFuncB');
-    feFuncB.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncB);
-    this.feFuncB = feFuncB;
-}
+SVGShapeElement.prototype.renderInnerContent = function () {
+  this.renderModifiers();
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    this.stylesList[i].reset();
+  }
+  this.renderShape();
 
-SVGTritoneFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color1 = this.filterManager.effectElements[0].p.v;
-        var color2 = this.filterManager.effectElements[1].p.v;
-        var color3 = this.filterManager.effectElements[2].p.v;
-        var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
-        var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
-        var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
-        this.feFuncR.setAttribute('tableValues', tableR);
-        this.feFuncG.setAttribute('tableValues', tableG);
-        this.feFuncB.setAttribute('tableValues', tableB);
-        //var opacity = this.filterManager.effectElements[2].p.v/100;
-        //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 ' + opacity + ' 0');
+  for (i = 0; i < len; i += 1) {
+    if (this.stylesList[i]._mdf || this._isFirstFrame) {
+      if (this.stylesList[i].msElem) {
+        this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+        // Adding M0 0 fixes same mask bug on all browsers
+        this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+      }
+      this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
     }
-};
-function SVGProLevelsFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var effectElements = this.filterManager.effectElements;
-    var feComponentTransfer = createNS('feComponentTransfer');
-    var feFuncR, feFuncG, feFuncB;
-    
-    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){
-        this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
-    }
-    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){
-        this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
-    }
-    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){
-        this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-    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){
-        this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
-    }
-    
-    if(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA){
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        feComponentTransfer = createNS('feComponentTransfer');
-    }
-
-    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){
-
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
-        this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
-        this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-}
-
-SVGProLevelsFilter.prototype.createFeFunc = function(type, feComponentTransfer) {
-    var feFunc = createNS(type);
-    feFunc.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFunc);
-    return feFunc;
+  }
 };
 
-SVGProLevelsFilter.prototype.getTableValue = function(inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
-    var cnt = 0;
-    var segments = 256;
-    var perc;
-    var min = Math.min(inputBlack, inputWhite);
-    var max = Math.max(inputBlack, inputWhite);
-    var table = Array.call(null,{length:segments});
-    var colorValue;
-    var pos = 0;
-    var outputDelta = outputWhite - outputBlack; 
-    var inputDelta = inputWhite - inputBlack; 
-    while(cnt <= 256) {
-        perc = cnt/256;
-        if(perc <= min){
-            colorValue = inputDelta < 0 ? outputWhite : outputBlack;
-        } else if(perc >= max){
-            colorValue = inputDelta < 0 ? outputBlack : outputWhite;
-        } else {
-            colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
-        }
-        table[pos++] = colorValue;
-        cnt += 256/(segments-1);
+SVGShapeElement.prototype.renderShape = function () {
+  var i;
+  var len = this.animatedContents.length;
+  var animatedContent;
+  for (i = 0; i < len; i += 1) {
+    animatedContent = this.animatedContents[i];
+    if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
+      animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
     }
-    return table.join(' ');
+  }
 };
 
-SVGProLevelsFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var val, cnt, perc, bezier;
-        var effectElements = this.filterManager.effectElements;
-        if(this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)){
-            val = this.getTableValue(effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v,effectElements[7].p.v);
-            this.feFuncRComposed.setAttribute('tableValues',val);
-            this.feFuncGComposed.setAttribute('tableValues',val);
-            this.feFuncBComposed.setAttribute('tableValues',val);
-        }
-
-
-        if(this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)){
-            val = this.getTableValue(effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v,effectElements[14].p.v);
-            this.feFuncR.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)){
-            val = this.getTableValue(effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v,effectElements[21].p.v);
-            this.feFuncG.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)){
-            val = this.getTableValue(effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v,effectElements[28].p.v);
-            this.feFuncB.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)){
-            val = this.getTableValue(effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v,effectElements[35].p.v);
-            this.feFuncA.setAttribute('tableValues',val);
-        }
-        
-    }
+SVGShapeElement.prototype.destroy = function () {
+  this.destroyBaseElement();
+  this.shapesData = null;
+  this.itemsData = null;
 };
-function SVGDropShadowEffect(filter, filterManager) {
-    var filterSize = filterManager.container.globalData.renderConfig.filterSize
-    filter.setAttribute('x', filterSize.x);
-    filter.setAttribute('y', filterSize.y);
-    filter.setAttribute('width', filterSize.width);
-    filter.setAttribute('height', filterSize.height);
-    this.filterManager = filterManager;
 
-    var feGaussianBlur = createNS('feGaussianBlur');
-    feGaussianBlur.setAttribute('in','SourceAlpha');
-    feGaussianBlur.setAttribute('result','drop_shadow_1');
-    feGaussianBlur.setAttribute('stdDeviation','0');
-    this.feGaussianBlur = feGaussianBlur;
-    filter.appendChild(feGaussianBlur);
+/* global createNS */
 
-    var feOffset = createNS('feOffset');
-    feOffset.setAttribute('dx','25');
-    feOffset.setAttribute('dy','0');
-    feOffset.setAttribute('in','drop_shadow_1');
-    feOffset.setAttribute('result','drop_shadow_2');
-    this.feOffset = feOffset;
-    filter.appendChild(feOffset);
-    var feFlood = createNS('feFlood');
-    feFlood.setAttribute('flood-color','#00ff00');
-    feFlood.setAttribute('flood-opacity','1');
-    feFlood.setAttribute('result','drop_shadow_3');
-    this.feFlood = feFlood;
-    filter.appendChild(feFlood);
-
-    var feComposite = createNS('feComposite');
-    feComposite.setAttribute('in','drop_shadow_3');
-    feComposite.setAttribute('in2','drop_shadow_2');
-    feComposite.setAttribute('operator','in');
-    feComposite.setAttribute('result','drop_shadow_4');
-    filter.appendChild(feComposite);
-
-
+function SVGTintFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  feColorMatrix.setAttribute('result', 'f2');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+  if (filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k) {
     var feMerge = createNS('feMerge');
     filter.appendChild(feMerge);
     var feMergeNode;
     feMergeNode = createNS('feMergeNode');
+    feMergeNode.setAttribute('in', 'SourceGraphic');
     feMerge.appendChild(feMergeNode);
     feMergeNode = createNS('feMergeNode');
-    feMergeNode.setAttribute('in','SourceGraphic');
-    this.feMergeNode = feMergeNode;
-    this.feMerge = feMerge;
-    this.originalNodeAdded = false;
+    feMergeNode.setAttribute('in', 'f2');
     feMerge.appendChild(feMergeNode);
+  }
 }
 
-SVGDropShadowEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        if(forceRender || this.filterManager.effectElements[4].p._mdf){
-            this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+SVGTintFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var colorBlack = this.filterManager.effectElements[0].p.v;
+    var colorWhite = this.filterManager.effectElements[1].p.v;
+    var opacity = this.filterManager.effectElements[2].p.v / 100;
+    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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGFillFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+}
+SVGFillFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color = this.filterManager.effectElements[2].p.v;
+    var opacity = this.filterManager.effectElements[6].p.v;
+    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');
+  }
+};
+
+/* global createNS */
+
+function SVGGaussianBlurEffect(filter, filterManager) {
+  // Outset the filter region by 100% on all sides to accommodate blur expansion.
+  filter.setAttribute('x', '-100%');
+  filter.setAttribute('y', '-100%');
+  filter.setAttribute('width', '300%');
+  filter.setAttribute('height', '300%');
+
+  this.filterManager = filterManager;
+  var feGaussianBlur = createNS('feGaussianBlur');
+  filter.appendChild(feGaussianBlur);
+  this.feGaussianBlur = feGaussianBlur;
+}
+
+SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    // Empirical value, matching AE's blur appearance.
+    var kBlurrinessToSigma = 0.3;
+    var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+
+    // Dimensions mapping:
+    //
+    //   1 -> horizontal & vertical
+    //   2 -> horizontal only
+    //   3 -> vertical only
+    //
+    var dimensions = this.filterManager.effectElements[1].p.v;
+    var sigmaX = (dimensions == 3) ? 0 : sigma; // eslint-disable-line eqeqeq
+    var sigmaY = (dimensions == 2) ? 0 : sigma; // eslint-disable-line eqeqeq
+
+    this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + ' ' + sigmaY);
+
+    // Repeat edges mapping:
+    //
+    //   0 -> off -> duplicate
+    //   1 -> on  -> wrap
+    var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate'; // eslint-disable-line eqeqeq
+    this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+  }
+};
+
+/* global createNS, createElementID, locationHref, bmFloor */
+
+function SVGStrokeEffect(elem, filterManager) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.elem = elem;
+  this.paths = [];
+}
+
+SVGStrokeEffect.prototype.initialize = function () {
+  var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+  var path;
+  var groupPath;
+  var i;
+  var len;
+  if (this.filterManager.effectElements[1].p.v === 1) {
+    len = this.elem.maskManager.masksProperties.length;
+    i = 0;
+  } else {
+    i = this.filterManager.effectElements[0].p.v - 1;
+    len = i + 1;
+  }
+  groupPath = createNS('g');
+  groupPath.setAttribute('fill', 'none');
+  groupPath.setAttribute('stroke-linecap', 'round');
+  groupPath.setAttribute('stroke-dashoffset', 1);
+  for (i; i < len; i += 1) {
+    path = createNS('path');
+    groupPath.appendChild(path);
+    this.paths.push({ p: path, m: i });
+  }
+  if (this.filterManager.effectElements[10].p.v === 3) {
+    var mask = createNS('mask');
+    var id = createElementID();
+    mask.setAttribute('id', id);
+    mask.setAttribute('mask-type', 'alpha');
+    mask.appendChild(groupPath);
+    this.elem.globalData.defs.appendChild(mask);
+    var g = createNS('g');
+    g.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+    while (elemChildren[0]) {
+      g.appendChild(elemChildren[0]);
+    }
+    this.elem.layerElement.appendChild(g);
+    this.masker = mask;
+    groupPath.setAttribute('stroke', '#fff');
+  } else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (this.filterManager.effectElements[10].p.v === 2) {
+      elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+      while (elemChildren.length) {
+        this.elem.layerElement.removeChild(elemChildren[0]);
+      }
+    }
+    this.elem.layerElement.appendChild(groupPath);
+    this.elem.layerElement.removeAttribute('mask');
+    groupPath.setAttribute('stroke', '#fff');
+  }
+  this.initialized = true;
+  this.pathMasker = groupPath;
+};
+
+SVGStrokeEffect.prototype.renderFrame = function (forceRender) {
+  if (!this.initialized) {
+    this.initialize();
+  }
+  var i;
+  var len = this.paths.length;
+  var mask;
+  var path;
+  for (i = 0; i < len; i += 1) {
+    if (this.paths[i].m !== -1) {
+      mask = this.elem.maskManager.viewData[this.paths[i].m];
+      path = this.paths[i].p;
+      if (forceRender || this.filterManager._mdf || mask.prop._mdf) {
+        path.setAttribute('d', mask.lastPath);
+      }
+      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) {
+        var dasharrayValue;
+        if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) {
+          var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var l = path.getTotalLength();
+          dasharrayValue = '0 0 0 ' + l * s + ' ';
+          var lineLength = l * (e - s);
+          var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
+          var units = Math.floor(lineLength / segment);
+          var j;
+          for (j = 0; j < units; j += 1) {
+            dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' ';
+          }
+          dasharrayValue += '0 ' + l * 10 + ' 0 0';
+        } else {
+          dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
         }
-        if(forceRender || this.filterManager.effectElements[0].p._mdf){
-            var col = this.filterManager.effectElements[0].p.v;
-            this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255)));
-        }
-        if(forceRender || this.filterManager.effectElements[1].p._mdf){
-            this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255);
-        }
-        if(forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf){
-            var distance = this.filterManager.effectElements[3].p.v;
-            var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
-            var x = distance * Math.cos(angle);
-            var y = distance * Math.sin(angle);
-            this.feOffset.setAttribute('dx', x);
-            this.feOffset.setAttribute('dy', y);
-        }
-        /*if(forceRender || this.filterManager.effectElements[5].p._mdf){
+        path.setAttribute('stroke-dasharray', dasharrayValue);
+      }
+    }
+  }
+  if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+    this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2);
+  }
+
+  if (forceRender || this.filterManager.effectElements[6].p._mdf) {
+    this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v);
+  }
+  if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (forceRender || this.filterManager.effectElements[3].p._mdf) {
+      var color = this.filterManager.effectElements[3].p.v;
+      this.pathMasker.setAttribute('stroke', 'rgb(' + bmFloor(color[0] * 255) + ',' + bmFloor(color[1] * 255) + ',' + bmFloor(color[2] * 255) + ')');
+    }
+  }
+};
+
+/* global createNS */
+
+function SVGTritoneFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  var feComponentTransfer = createNS('feComponentTransfer');
+  feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+  filter.appendChild(feComponentTransfer);
+  this.matrixFilter = feComponentTransfer;
+  var feFuncR = createNS('feFuncR');
+  feFuncR.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncR);
+  this.feFuncR = feFuncR;
+  var feFuncG = createNS('feFuncG');
+  feFuncG.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncG);
+  this.feFuncG = feFuncG;
+  var feFuncB = createNS('feFuncB');
+  feFuncB.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncB);
+  this.feFuncB = feFuncB;
+}
+
+SVGTritoneFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color1 = this.filterManager.effectElements[0].p.v;
+    var color2 = this.filterManager.effectElements[1].p.v;
+    var color3 = this.filterManager.effectElements[2].p.v;
+    var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
+    var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
+    var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
+    this.feFuncR.setAttribute('tableValues', tableR);
+    this.feFuncG.setAttribute('tableValues', tableG);
+    this.feFuncB.setAttribute('tableValues', tableB);
+    // var opacity = this.filterManager.effectElements[2].p.v/100;
+    // 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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGProLevelsFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var effectElements = this.filterManager.effectElements;
+  var feComponentTransfer = createNS('feComponentTransfer');
+
+  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) {
+    this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
+  }
+  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) {
+    this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
+  }
+  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) {
+    this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+  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) {
+    this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
+  }
+
+  if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    feComponentTransfer = createNS('feComponentTransfer');
+  }
+
+  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) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
+    this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
+    this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+}
+
+SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) {
+  var feFunc = createNS(type);
+  feFunc.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFunc);
+  return feFunc;
+};
+
+SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
+  var cnt = 0;
+  var segments = 256;
+  var perc;
+  var min = Math.min(inputBlack, inputWhite);
+  var max = Math.max(inputBlack, inputWhite);
+  var table = Array.call(null, { length: segments });
+  var colorValue;
+  var pos = 0;
+  var outputDelta = outputWhite - outputBlack;
+  var inputDelta = inputWhite - inputBlack;
+  while (cnt <= 256) {
+    perc = cnt / 256;
+    if (perc <= min) {
+      colorValue = inputDelta < 0 ? outputWhite : outputBlack;
+    } else if (perc >= max) {
+      colorValue = inputDelta < 0 ? outputBlack : outputWhite;
+    } else {
+      colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
+    }
+    table[pos] = colorValue;
+    pos += 1;
+    cnt += 256 / (segments - 1);
+  }
+  return table.join(' ');
+};
+
+SVGProLevelsFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var val;
+    var effectElements = this.filterManager.effectElements;
+    if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) {
+      val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v);
+      this.feFuncRComposed.setAttribute('tableValues', val);
+      this.feFuncGComposed.setAttribute('tableValues', val);
+      this.feFuncBComposed.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) {
+      val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v);
+      this.feFuncR.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) {
+      val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v);
+      this.feFuncG.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) {
+      val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v);
+      this.feFuncB.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) {
+      val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v);
+      this.feFuncA.setAttribute('tableValues', val);
+    }
+  }
+};
+
+/* global createNS, rgbToHex, degToRads */
+
+function SVGDropShadowEffect(filter, filterManager) {
+  var filterSize = filterManager.container.globalData.renderConfig.filterSize;
+  filter.setAttribute('x', filterSize.x);
+  filter.setAttribute('y', filterSize.y);
+  filter.setAttribute('width', filterSize.width);
+  filter.setAttribute('height', filterSize.height);
+  this.filterManager = filterManager;
+
+  var feGaussianBlur = createNS('feGaussianBlur');
+  feGaussianBlur.setAttribute('in', 'SourceAlpha');
+  feGaussianBlur.setAttribute('result', 'drop_shadow_1');
+  feGaussianBlur.setAttribute('stdDeviation', '0');
+  this.feGaussianBlur = feGaussianBlur;
+  filter.appendChild(feGaussianBlur);
+
+  var feOffset = createNS('feOffset');
+  feOffset.setAttribute('dx', '25');
+  feOffset.setAttribute('dy', '0');
+  feOffset.setAttribute('in', 'drop_shadow_1');
+  feOffset.setAttribute('result', 'drop_shadow_2');
+  this.feOffset = feOffset;
+  filter.appendChild(feOffset);
+  var feFlood = createNS('feFlood');
+  feFlood.setAttribute('flood-color', '#00ff00');
+  feFlood.setAttribute('flood-opacity', '1');
+  feFlood.setAttribute('result', 'drop_shadow_3');
+  this.feFlood = feFlood;
+  filter.appendChild(feFlood);
+
+  var feComposite = createNS('feComposite');
+  feComposite.setAttribute('in', 'drop_shadow_3');
+  feComposite.setAttribute('in2', 'drop_shadow_2');
+  feComposite.setAttribute('operator', 'in');
+  feComposite.setAttribute('result', 'drop_shadow_4');
+  filter.appendChild(feComposite);
+
+  var feMerge = createNS('feMerge');
+  filter.appendChild(feMerge);
+  var feMergeNode;
+  feMergeNode = createNS('feMergeNode');
+  feMerge.appendChild(feMergeNode);
+  feMergeNode = createNS('feMergeNode');
+  feMergeNode.setAttribute('in', 'SourceGraphic');
+  this.feMergeNode = feMergeNode;
+  this.feMerge = feMerge;
+  this.originalNodeAdded = false;
+  feMerge.appendChild(feMergeNode);
+}
+
+SVGDropShadowEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+      this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+    }
+    if (forceRender || this.filterManager.effectElements[0].p._mdf) {
+      var col = this.filterManager.effectElements[0].p.v;
+      this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255)));
+    }
+    if (forceRender || this.filterManager.effectElements[1].p._mdf) {
+      this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255);
+    }
+    if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {
+      var distance = this.filterManager.effectElements[3].p.v;
+      var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
+      var x = distance * Math.cos(angle);
+      var y = distance * Math.sin(angle);
+      this.feOffset.setAttribute('dx', x);
+      this.feOffset.setAttribute('dy', y);
+    }
+    /* if(forceRender || this.filterManager.effectElements[5].p._mdf){
             if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
                 this.feMerge.removeChild(this.feMergeNode);
                 this.originalNodeAdded = false;
@@ -9620,5351 +10185,5697 @@
                 this.feMerge.appendChild(this.feMergeNode);
                 this.originalNodeAdded = true;
             }
-        }*/
-    }
+        } */
+  }
 };
+
+/* global createElementID, createNS */
+
 var _svgMatteSymbols = [];
 
-function SVGMatte3Effect(filterElem, filterManager, elem){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.filterElem = filterElem;
-    this.elem = elem;
-    elem.matteElement = createNS('g');
-    elem.matteElement.appendChild(elem.layerElement);
-    elem.matteElement.appendChild(elem.transformedElement);
-    elem.baseElement = elem.matteElement;
+function SVGMatte3Effect(filterElem, filterManager, elem) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.filterElem = filterElem;
+  this.elem = elem;
+  elem.matteElement = createNS('g');
+  elem.matteElement.appendChild(elem.layerElement);
+  elem.matteElement.appendChild(elem.transformedElement);
+  elem.baseElement = elem.matteElement;
 }
 
-SVGMatte3Effect.prototype.findSymbol = function(mask) {
-    var i = 0, len = _svgMatteSymbols.length;
-    while(i < len) {
-        if(_svgMatteSymbols[i] === mask) {
-            return _svgMatteSymbols[i];
-        }
-        i += 1;
+SVGMatte3Effect.prototype.findSymbol = function (mask) {
+  var i = 0;
+  var len = _svgMatteSymbols.length;
+  while (i < len) {
+    if (_svgMatteSymbols[i] === mask) {
+      return _svgMatteSymbols[i];
     }
-    return null;
+    i += 1;
+  }
+  return null;
 };
 
-SVGMatte3Effect.prototype.replaceInParent = function(mask, symbolId) {
-    var parentNode = mask.layerElement.parentNode;
-    if(!parentNode) {
-        return;
+SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) {
+  var parentNode = mask.layerElement.parentNode;
+  if (!parentNode) {
+    return;
+  }
+  var children = parentNode.children;
+  var i = 0;
+  var len = children.length;
+  while (i < len) {
+    if (children[i] === mask.layerElement) {
+      break;
     }
-    var children = parentNode.children;
-    var i = 0, len = children.length;
-    while (i < len) {
-        if (children[i] === mask.layerElement) {
-            break;
-        }
-        i += 1;
-    }
-    var nextChild;
-    if (i <= len - 2) {
-        nextChild = children[i + 1];
-    }
+    i += 1;
+  }
+  var nextChild;
+  if (i <= len - 2) {
+    nextChild = children[i + 1];
+  }
+  var useElem = createNS('use');
+  useElem.setAttribute('href', '#' + symbolId);
+  if (nextChild) {
+    parentNode.insertBefore(useElem, nextChild);
+  } else {
+    parentNode.appendChild(useElem);
+  }
+};
+
+SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) {
+  if (!this.findSymbol(mask)) {
+    var symbolId = createElementID();
+    var masker = createNS('mask');
+    masker.setAttribute('id', mask.layerId);
+    masker.setAttribute('mask-type', 'alpha');
+    _svgMatteSymbols.push(mask);
+    var defs = elem.globalData.defs;
+    defs.appendChild(masker);
+    var symbol = createNS('symbol');
+    symbol.setAttribute('id', symbolId);
+    this.replaceInParent(mask, symbolId);
+    symbol.appendChild(mask.layerElement);
+    defs.appendChild(symbol);
     var useElem = createNS('use');
     useElem.setAttribute('href', '#' + symbolId);
-    if(nextChild) {
-        parentNode.insertBefore(useElem, nextChild);
-    } else {
-        parentNode.appendChild(useElem);
-    }
+    masker.appendChild(useElem);
+    mask.data.hd = false;
+    mask.show();
+  }
+  elem.setMatte(mask.layerId);
 };
 
-SVGMatte3Effect.prototype.setElementAsMask = function(elem, mask) {
-    if(!this.findSymbol(mask)) {
-        var symbolId = createElementID();
-        var masker = createNS('mask');
-        masker.setAttribute('id', mask.layerId);
-        masker.setAttribute('mask-type', 'alpha');
-        _svgMatteSymbols.push(mask);
-        var defs = elem.globalData.defs;
-        defs.appendChild(masker);
-        var symbol = createNS('symbol');
-        symbol.setAttribute('id', symbolId);
-        this.replaceInParent(mask, symbolId);
-        symbol.appendChild(mask.layerElement);
-        defs.appendChild(symbol);
-        var useElem = createNS('use');
-        useElem.setAttribute('href', '#' + symbolId);
-        masker.appendChild(useElem);
-        mask.data.hd = false;
-        mask.show();
+SVGMatte3Effect.prototype.initialize = function () {
+  var ind = this.filterManager.effectElements[0].p.v;
+  var elements = this.elem.comp.elements;
+  var i = 0;
+  var len = elements.length;
+  while (i < len) {
+    if (elements[i] && elements[i].data.ind === ind) {
+      this.setElementAsMask(this.elem, elements[i]);
     }
-    elem.setMatte(mask.layerId);
+    i += 1;
+  }
+  this.initialized = true;
 };
 
-SVGMatte3Effect.prototype.initialize = function() {
-    var ind = this.filterManager.effectElements[0].p.v;
-    var elements = this.elem.comp.elements;
-    var i = 0, len = elements.length;
-    while (i < len) {
-    	if (elements[i] && elements[i].data.ind === ind) {
-    		this.setElementAsMask(this.elem, elements[i]);
-    	}
-    	i += 1;
-    }
-    this.initialized = true;
+SVGMatte3Effect.prototype.renderFrame = function () {
+  if (!this.initialized) {
+    this.initialize();
+  }
 };
 
-SVGMatte3Effect.prototype.renderFrame = function() {
-	if(!this.initialized) {
-		this.initialize();
-	}
-};
-function SVGEffects(elem){
-    var i, len = elem.data.ef ? elem.data.ef.length : 0;
-    var filId = createElementID();
-    var fil = filtersFactory.createFilter(filId);
-    var count = 0;
-    this.filters = [];
-    var filterManager;
-    for(i=0;i<len;i+=1){
-        filterManager = null;
-        if(elem.data.ef[i].ty === 20){
-            count += 1;
-            filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 21){
-            count += 1;
-            filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 22){
-            filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 23){
-            count += 1;
-            filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 24){
-            count += 1;
-            filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 25){
-            count += 1;
-            filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 28){
-            //count += 1;
-            filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
-        }else if(elem.data.ef[i].ty === 29){
-            count += 1;
-            filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
-        }
-        if(filterManager) {
-            this.filters.push(filterManager);
-        }
+/* global createElementID, filtersFactory, SVGTintFilter, SVGFillFilter, SVGStrokeEffect, SVGTritoneFilter,
+SVGProLevelsFilter, SVGDropShadowEffect, SVGMatte3Effect, SVGGaussianBlurEffect, locationHref */
+
+function SVGEffects(elem) {
+  var i;
+  var len = elem.data.ef ? elem.data.ef.length : 0;
+  var filId = createElementID();
+  var fil = filtersFactory.createFilter(filId);
+  var count = 0;
+  this.filters = [];
+  var filterManager;
+  for (i = 0; i < len; i += 1) {
+    filterManager = null;
+    if (elem.data.ef[i].ty === 20) {
+      count += 1;
+      filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 21) {
+      count += 1;
+      filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 22) {
+      filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 23) {
+      count += 1;
+      filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 24) {
+      count += 1;
+      filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 25) {
+      count += 1;
+      filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 28) {
+      // count += 1;
+      filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
+    } else if (elem.data.ef[i].ty === 29) {
+      count += 1;
+      filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
     }
-    if(count){
-        elem.globalData.defs.appendChild(fil);
-        elem.layerElement.setAttribute('filter','url(' + locationHref + '#'+filId+')');
+    if (filterManager) {
+      this.filters.push(filterManager);
     }
-    if (this.filters.length) {
-        elem.addRenderableComponent(this);
-    }
+  }
+  if (count) {
+    elem.globalData.defs.appendChild(fil);
+    elem.layerElement.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+  }
+  if (this.filters.length) {
+    elem.addRenderableComponent(this);
+  }
 }
 
-SVGEffects.prototype.renderFrame = function(_isFirstFrame){
-    var i, len = this.filters.length;
-    for(i=0;i<len;i+=1){
-        this.filters[i].renderFrame(_isFirstFrame);
-    }
+SVGEffects.prototype.renderFrame = function (_isFirstFrame) {
+  var i;
+  var len = this.filters.length;
+  for (i = 0; i < len; i += 1) {
+    this.filters[i].renderFrame(_isFirstFrame);
+  }
 };
+
+/* global Matrix, createTypedArray */
+
 function CVContextData() {
-	this.saved = [];
-    this.cArrPos = 0;
-    this.cTr = new Matrix();
-    this.cO = 1;
-    var i, len = 15;
-    this.savedOp = createTypedArray('float32', len);
-    for(i=0;i<len;i+=1){
-        this.saved[i] = createTypedArray('float32', 16);
-    }
-    this._length = len;
+  this.saved = [];
+  this.cArrPos = 0;
+  this.cTr = new Matrix();
+  this.cO = 1;
+  var i;
+  var len = 15;
+  this.savedOp = createTypedArray('float32', len);
+  for (i = 0; i < len; i += 1) {
+    this.saved[i] = createTypedArray('float32', 16);
+  }
+  this._length = len;
 }
 
-CVContextData.prototype.duplicate = function() {
-	var newLength = this._length * 2;
-	var currentSavedOp = this.savedOp;
-    this.savedOp = createTypedArray('float32', newLength);
-    this.savedOp.set(currentSavedOp);
-    var i = 0;
-    for(i = this._length; i < newLength; i += 1) {
-        this.saved[i] = createTypedArray('float32', 16);
-    }
-    this._length = newLength;
+CVContextData.prototype.duplicate = function () {
+  var newLength = this._length * 2;
+  var currentSavedOp = this.savedOp;
+  this.savedOp = createTypedArray('float32', newLength);
+  this.savedOp.set(currentSavedOp);
+  var i = 0;
+  for (i = this._length; i < newLength; i += 1) {
+    this.saved[i] = createTypedArray('float32', 16);
+  }
+  this._length = newLength;
 };
 
-CVContextData.prototype.reset = function() {
-	this.cArrPos = 0;
-	this.cTr.reset();
-    this.cO = 1;
+CVContextData.prototype.reset = function () {
+  this.cArrPos = 0;
+  this.cTr.reset();
+  this.cO = 1;
 };
-function CVBaseElement(){
+
+/* global CVEffects, getBlendMode, CVMaskElement, Matrix */
+
+function CVBaseElement() {
 }
 
 CVBaseElement.prototype = {
-    createElements: function(){},
-    initRendererElement: function(){},
-    createContainerElements: function(){
-        this.canvasContext = this.globalData.canvasContext;
-        this.renderableEffectsManager = new CVEffects(this);
-    },
-    createContent: function(){},
-    setBlendMode: function(){
-        var globalData = this.globalData;
-        if(globalData.blendMode !== this.data.bm) {
-            globalData.blendMode = this.data.bm;
-            var blendModeValue = getBlendMode(this.data.bm);
-            globalData.canvasContext.globalCompositeOperation = blendModeValue;
-        }
-    },
-    createRenderableComponents: function(){
-        this.maskManager = new CVMaskElement(this.data, this);
-    },
-    hideElement: function(){
-        if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-            this.hidden = true;
-        }
-    },
-    showElement: function(){
-        if (this.isInRange && !this.isTransparent){
-            this.hidden = false;
-            this._isFirstFrame = true;
-            this.maskManager._isFirstFrame = true;
-        }
-    },
-    renderFrame: function() {
-        if (this.hidden || this.data.hd) {
-            return;
-        }
-        this.renderTransform();
-        this.renderRenderable();
-        this.setBlendMode();
-        var forceRealStack = this.data.ty === 0;
-        this.globalData.renderer.save(forceRealStack);
-        this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
-        this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
-        this.renderInnerContent();
-        this.globalData.renderer.restore(forceRealStack);
-        if(this.maskManager.hasMasks) {
-            this.globalData.renderer.restore(true);
-        }
-        if (this._isFirstFrame) {
-            this._isFirstFrame = false;
-        }
-    },
-    destroy: function(){
-        this.canvasContext = null;
-        this.data = null;
-        this.globalData = null;
-        this.maskManager.destroy();
-    },
-    mHelper: new Matrix()
+  createElements: function () {},
+  initRendererElement: function () {},
+  createContainerElements: function () {
+    this.canvasContext = this.globalData.canvasContext;
+    this.renderableEffectsManager = new CVEffects(this);
+  },
+  createContent: function () {},
+  setBlendMode: function () {
+    var globalData = this.globalData;
+    if (globalData.blendMode !== this.data.bm) {
+      globalData.blendMode = this.data.bm;
+      var blendModeValue = getBlendMode(this.data.bm);
+      globalData.canvasContext.globalCompositeOperation = blendModeValue;
+    }
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new CVMaskElement(this.data, this);
+  },
+  hideElement: function () {
+    if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+      this.hidden = true;
+    }
+  },
+  showElement: function () {
+    if (this.isInRange && !this.isTransparent) {
+      this.hidden = false;
+      this._isFirstFrame = true;
+      this.maskManager._isFirstFrame = true;
+    }
+  },
+  renderFrame: function () {
+    if (this.hidden || this.data.hd) {
+      return;
+    }
+    this.renderTransform();
+    this.renderRenderable();
+    this.setBlendMode();
+    var forceRealStack = this.data.ty === 0;
+    this.globalData.renderer.save(forceRealStack);
+    this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
+    this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
+    this.renderInnerContent();
+    this.globalData.renderer.restore(forceRealStack);
+    if (this.maskManager.hasMasks) {
+      this.globalData.renderer.restore(true);
+    }
+    if (this._isFirstFrame) {
+      this._isFirstFrame = false;
+    }
+  },
+  destroy: function () {
+    this.canvasContext = null;
+    this.data = null;
+    this.globalData = null;
+    this.maskManager.destroy();
+  },
+  mHelper: new Matrix(),
 };
 CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;
 CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;
 
-function CVImageElement(data, globalData, comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.img = globalData.imageLoader.getImage(this.assetData);
-    this.initElement(data,globalData,comp);
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement,HierarchyElement, FrameElement,
+RenderableElement, SVGShapeElement, IImageElement, createTag */
+
+function CVImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.img = globalData.imageLoader.getImage(this.assetData);
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement);
 
 CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement;
 CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
 
-CVImageElement.prototype.createContent = function(){
+CVImageElement.prototype.createContent = function () {
+  if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
+    var canvas = createTag('canvas');
+    canvas.width = this.assetData.w;
+    canvas.height = this.assetData.h;
+    var ctx = canvas.getContext('2d');
 
-    if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
-        var canvas = createTag('canvas');
-        canvas.width = this.assetData.w;
-        canvas.height = this.assetData.h;
-        var ctx = canvas.getContext('2d');
-
-        var imgW = this.img.width;
-        var imgH = this.img.height;
-        var imgRel = imgW / imgH;
-        var canvasRel = this.assetData.w/this.assetData.h;
-        var widthCrop, heightCrop;
-        var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
-        if((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) {
-            heightCrop = imgH;
-            widthCrop = heightCrop*canvasRel;
-        } else {
-            widthCrop = imgW;
-            heightCrop = widthCrop/canvasRel;
-        }
-        ctx.drawImage(this.img,(imgW-widthCrop)/2,(imgH-heightCrop)/2,widthCrop,heightCrop,0,0,this.assetData.w,this.assetData.h);
-        this.img = canvas;
+    var imgW = this.img.width;
+    var imgH = this.img.height;
+    var imgRel = imgW / imgH;
+    var canvasRel = this.assetData.w / this.assetData.h;
+    var widthCrop;
+    var heightCrop;
+    var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
+    if ((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) {
+      heightCrop = imgH;
+      widthCrop = heightCrop * canvasRel;
+    } else {
+      widthCrop = imgW;
+      heightCrop = widthCrop / canvasRel;
     }
-
+    ctx.drawImage(this.img, (imgW - widthCrop) / 2, (imgH - heightCrop) / 2, widthCrop, heightCrop, 0, 0, this.assetData.w, this.assetData.h);
+    this.img = canvas;
+  }
 };
 
-CVImageElement.prototype.renderInnerContent = function(parentMatrix){
-    this.canvasContext.drawImage(this.img, 0, 0);
+CVImageElement.prototype.renderInnerContent = function () {
+  this.canvasContext.drawImage(this.img, 0, 0);
 };
 
-CVImageElement.prototype.destroy = function(){
-    this.img = null;
+CVImageElement.prototype.destroy = function () {
+  this.img = null;
 };
+
+/* global createSizedArray, PropertyFactory, extendPrototype, CanvasRenderer, ICompElement, CVBaseElement */
+
 function CVCompElement(data, globalData, comp) {
-    this.completeLayers = false;
-    this.layers = data.layers;
-    this.pendingElements = [];
-    this.elements = createSizedArray(this.layers.length);
-    this.initElement(data, globalData, comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate, this) : {_placeholder:true};
+  this.completeLayers = false;
+  this.layers = data.layers;
+  this.pendingElements = [];
+  this.elements = createSizedArray(this.layers.length);
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([CanvasRenderer, ICompElement, CVBaseElement], CVCompElement);
 
-CVCompElement.prototype.renderInnerContent = function() {
-    var ctx = this.canvasContext;
-    ctx.beginPath();
-    ctx.moveTo(0, 0);
-    ctx.lineTo(this.data.w, 0);
-    ctx.lineTo(this.data.w, this.data.h);
-    ctx.lineTo(0, this.data.h);
-    ctx.lineTo(0, 0);
-    ctx.clip();
-    var i,len = this.layers.length;
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+CVCompElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.beginPath();
+  ctx.moveTo(0, 0);
+  ctx.lineTo(this.data.w, 0);
+  ctx.lineTo(this.data.w, this.data.h);
+  ctx.lineTo(0, this.data.h);
+  ctx.lineTo(0, 0);
+  ctx.clip();
+  var i;
+  var len = this.layers.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-CVCompElement.prototype.destroy = function(){
-    var i,len = this.layers.length;
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.elements[i]) {
-            this.elements[i].destroy();
-        }
+CVCompElement.prototype.destroy = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layers = null;
-    this.elements = null;
+  }
+  this.layers = null;
+  this.elements = null;
 };
 
-function CVMaskElement(data,element){
-    this.data = data;
-    this.element = element;
-    this.masksProperties = this.data.masksProperties || [];
-    this.viewData = createSizedArray(this.masksProperties.length);
-    var i, len = this.masksProperties.length, hasMasks = false;
-    for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode !== 'n'){
-            hasMasks = true;
-        }
-        this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);
+/* global createSizedArray, ShapePropertyFactory, MaskElement */
+
+function CVMaskElement(data, element) {
+  this.data = data;
+  this.element = element;
+  this.masksProperties = this.data.masksProperties || [];
+  this.viewData = createSizedArray(this.masksProperties.length);
+  var i;
+  var len = this.masksProperties.length;
+  var hasMasks = false;
+  for (i = 0; i < len; i += 1) {
+    if (this.masksProperties[i].mode !== 'n') {
+      hasMasks = true;
     }
-    this.hasMasks = hasMasks;
-    if(hasMasks) {
-        this.element.addRenderableComponent(this);
-    }
+    this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[i], 3);
+  }
+  this.hasMasks = hasMasks;
+  if (hasMasks) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
 CVMaskElement.prototype.renderFrame = function () {
-    if(!this.hasMasks){
-        return;
+  if (!this.hasMasks) {
+    return;
+  }
+  var transform = this.element.finalTransform.mat;
+  var ctx = this.element.canvasContext;
+  var i;
+  var len = this.masksProperties.length;
+  var pt;
+  var pts;
+  var data;
+  ctx.beginPath();
+  for (i = 0; i < len; i += 1) {
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.masksProperties[i].inv) {
+        ctx.moveTo(0, 0);
+        ctx.lineTo(this.element.globalData.compSize.w, 0);
+        ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
+        ctx.lineTo(0, this.element.globalData.compSize.h);
+        ctx.lineTo(0, 0);
+      }
+      data = this.viewData[i].v;
+      pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0);
+      ctx.moveTo(pt[0], pt[1]);
+      var j;
+      var jLen = data._length;
+      for (j = 1; j < jLen; j += 1) {
+        pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
+        ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
+      }
+      pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
+      ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
     }
-    var transform = this.element.finalTransform.mat;
-    var ctx = this.element.canvasContext;
-    var i, len = this.masksProperties.length;
-    var pt,pts,data;
-    ctx.beginPath();
-    for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode !== 'n'){
-            if (this.masksProperties[i].inv) {
-                ctx.moveTo(0, 0);
-                ctx.lineTo(this.element.globalData.compSize.w, 0);
-                ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
-                ctx.lineTo(0, this.element.globalData.compSize.h);
-                ctx.lineTo(0, 0);
-            }
-            data = this.viewData[i].v;
-            pt = transform.applyToPointArray(data.v[0][0],data.v[0][1],0);
-            ctx.moveTo(pt[0], pt[1]);
-            var j, jLen = data._length;
-            for (j = 1; j < jLen; j++) {
-                pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
-                ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
-            }
-            pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
-            ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
-        }
-    }
-    this.element.globalData.renderer.save(true);
-    ctx.clip();
+  }
+  this.element.globalData.renderer.save(true);
+  ctx.clip();
 };
 
 CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;
 
-CVMaskElement.prototype.destroy = function(){
-    this.element = null;
+CVMaskElement.prototype.destroy = function () {
+  this.element = null;
 };
+
+/* global ShapeTransformManager, extendPrototype, BaseElement, TransformElement, CVBaseElement, IShapeElement,
+HierarchyElement, FrameElement, RenderableElement, RenderableDOMElement, PropertyFactory, degToRads, GradientProperty,
+DashProperty, TransformPropertyFactory, CVShapeData, ShapeModifiers, bmFloor */
+
 function CVShapeElement(data, globalData, comp) {
-    this.shapes = [];
-    this.shapesData = data.shapes;
-    this.stylesList = [];
-    this.itemsData = [];
-    this.prevViewData = [];
-    this.shapeModifiers = [];
-    this.processedElements = [];
-    this.transformsManager = new ShapeTransformManager();
-    this.initElement(data, globalData, comp);
+  this.shapes = [];
+  this.shapesData = data.shapes;
+  this.stylesList = [];
+  this.itemsData = [];
+  this.prevViewData = [];
+  this.shapeModifiers = [];
+  this.processedElements = [];
+  this.transformsManager = new ShapeTransformManager();
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement], CVShapeElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement);
 
 CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;
 
-CVShapeElement.prototype.transformHelper = {opacity:1,_opMdf:false};
+CVShapeElement.prototype.transformHelper = { opacity: 1, _opMdf: false };
 
 CVShapeElement.prototype.dashResetter = [];
 
-CVShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
+CVShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
 };
 
-CVShapeElement.prototype.createStyleElement = function(data, transforms) {
-    var styleElem = {
-        data: data,
-        type: data.ty,
-        preTransforms: this.transformsManager.addTransformSequence(transforms),
-        transforms: [],
-        elements: [],
-        closed: data.hd === true
-    };
-    var elementData = {};
-    if(data.ty == 'fl' || data.ty == 'st'){
-        elementData.c = PropertyFactory.getProp(this,data.c,1,255,this);
-        if(!elementData.c.k){
-            styleElem.co = 'rgb('+bm_floor(elementData.c.v[0])+','+bm_floor(elementData.c.v[1])+','+bm_floor(elementData.c.v[2])+')';
-        }
-    } else if (data.ty === 'gf' || data.ty === 'gs') {
-        elementData.s = PropertyFactory.getProp(this,data.s,1,null,this);
-        elementData.e = PropertyFactory.getProp(this,data.e,1,null,this);
-        elementData.h = PropertyFactory.getProp(this,data.h||{k:0},0,0.01,this);
-        elementData.a = PropertyFactory.getProp(this,data.a||{k:0},0,degToRads,this);
-        elementData.g = new GradientProperty(this,data.g,this);
+CVShapeElement.prototype.createStyleElement = function (data, transforms) {
+  var styleElem = {
+    data: data,
+    type: data.ty,
+    preTransforms: this.transformsManager.addTransformSequence(transforms),
+    transforms: [],
+    elements: [],
+    closed: data.hd === true,
+  };
+  var elementData = {};
+  if (data.ty === 'fl' || data.ty === 'st') {
+    elementData.c = PropertyFactory.getProp(this, data.c, 1, 255, this);
+    if (!elementData.c.k) {
+      styleElem.co = 'rgb(' + bmFloor(elementData.c.v[0]) + ',' + bmFloor(elementData.c.v[1]) + ',' + bmFloor(elementData.c.v[2]) + ')';
     }
-    elementData.o = PropertyFactory.getProp(this,data.o,0,0.01,this);
-    if(data.ty == 'st' || data.ty == 'gs') {
-        styleElem.lc = this.lcEnum[data.lc] || 'round';
-        styleElem.lj = this.ljEnum[data.lj] || 'round';
-        if(data.lj == 1) {
-            styleElem.ml = data.ml;
-        }
-        elementData.w = PropertyFactory.getProp(this,data.w,0,null,this);
-        if(!elementData.w.k){
-            styleElem.wi = elementData.w.v;
-        }
-        if(data.d){
-            var d = new DashProperty(this,data.d,'canvas', this);
-            elementData.d = d;
-            if(!elementData.d.k){
-                styleElem.da = elementData.d.dashArray;
-                styleElem.do = elementData.d.dashoffset[0];
-            }
-        }
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    elementData.s = PropertyFactory.getProp(this, data.s, 1, null, this);
+    elementData.e = PropertyFactory.getProp(this, data.e, 1, null, this);
+    elementData.h = PropertyFactory.getProp(this, data.h || { k: 0 }, 0, 0.01, this);
+    elementData.a = PropertyFactory.getProp(this, data.a || { k: 0 }, 0, degToRads, this);
+    elementData.g = new GradientProperty(this, data.g, this);
+  }
+  elementData.o = PropertyFactory.getProp(this, data.o, 0, 0.01, this);
+  if (data.ty === 'st' || data.ty === 'gs') {
+    styleElem.lc = this.lcEnum[data.lc] || 'round';
+    styleElem.lj = this.ljEnum[data.lj] || 'round';
+    if (data.lj == 1) { // eslint-disable-line eqeqeq
+      styleElem.ml = data.ml;
+    }
+    elementData.w = PropertyFactory.getProp(this, data.w, 0, null, this);
+    if (!elementData.w.k) {
+      styleElem.wi = elementData.w.v;
+    }
+    if (data.d) {
+      var d = new DashProperty(this, data.d, 'canvas', this);
+      elementData.d = d;
+      if (!elementData.d.k) {
+        styleElem.da = elementData.d.dashArray;
+        styleElem.do = elementData.d.dashoffset[0];
+      }
+    }
+  } else {
+    styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+  }
+  this.stylesList.push(styleElem);
+  elementData.style = styleElem;
+  return elementData;
+};
+
+CVShapeElement.prototype.createGroupElement = function () {
+  var elementData = {
+    it: [],
+    prevViewData: [],
+  };
+  return elementData;
+};
+
+CVShapeElement.prototype.createTransformElement = function (data) {
+  var elementData = {
+    transform: {
+      opacity: 1,
+      _opMdf: false,
+      key: this.transformsManager.getNewKey(),
+      op: PropertyFactory.getProp(this, data.o, 0, 0.01, this),
+      mProps: TransformPropertyFactory.getTransformProperty(this, data, this),
+    },
+  };
+  return elementData;
+};
+
+CVShapeElement.prototype.createShapeElement = function (data) {
+  var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
+
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  return elementData;
+};
+
+CVShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+  this.transformsManager.processSequences(this._isFirstFrame);
+};
+
+CVShapeElement.prototype.addTransformToStyleList = function (transform) {
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    if (!this.stylesList[i].closed) {
+      this.stylesList[i].transforms.push(transform);
+    }
+  }
+};
+
+CVShapeElement.prototype.removeTransformFromStyleList = function () {
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    if (!this.stylesList[i].closed) {
+      this.stylesList[i].transforms.pop();
+    }
+  }
+};
+
+CVShapeElement.prototype.closeStyles = function (styles) {
+  var i;
+  var len = styles.length;
+  for (i = 0; i < len; i += 1) {
+    styles[i].closed = true;
+  }
+};
+
+CVShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, shouldRender, transforms) {
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var processedPos;
+  var modifier;
+  var currentTransform;
+  var ownTransforms = [].concat(transforms);
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._shouldRender = shouldRender;
     } else {
-        styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    this.stylesList.push(styleElem);
-    elementData.style = styleElem;
-    return elementData;
-};
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
+      } else {
+        itemsData[i].style.closed = false;
+      }
 
-CVShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = {
-        it: [],
-        prevViewData: []
-    };
-    return elementData;
-};
-
-CVShapeElement.prototype.createTransformElement = function(data) {
-    var elementData = {
-        transform : {
-            opacity: 1,
-            _opMdf:false,
-            key: this.transformsManager.getNewKey(),
-            op: PropertyFactory.getProp(this,data.o,0,0.01,this),
-            mProps: TransformPropertyFactory.getTransformProperty(this,data,this)
-        }
-    };
-    return elementData;
-};
-
-CVShapeElement.prototype.createShapeElement = function(data) {
-    var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
-    
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    return elementData;
-};
-
-CVShapeElement.prototype.reloadShapes = function() {
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for (i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
-    len = this.dynamicProperties.length;
-    for (i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-    this.transformsManager.processSequences(this._isFirstFrame);
-};
-
-CVShapeElement.prototype.addTransformToStyleList = function(transform) {
-    var i, len = this.stylesList.length;
-    for (i = 0; i < len; i += 1) {
-        if(!this.stylesList[i].closed) {
-            this.stylesList[i].transforms.push(transform);
-        }
-    }
-}
-
-CVShapeElement.prototype.removeTransformFromStyleList = function() {
-    var i, len = this.stylesList.length;
-    for (i = 0; i < len; i += 1) {
-        if(!this.stylesList[i].closed) {
-            this.stylesList[i].transforms.pop();
-        }
-    }
-}
-
-CVShapeElement.prototype.closeStyles = function(styles) {
-    var i, len = styles.length, j, jLen;
-    for (i = 0; i < len; i += 1) {
-        styles[i].closed = true;
-    }
-}
-
-CVShapeElement.prototype.searchShapes = function(arr,itemsData, prevViewData, shouldRender, transforms){
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], processedPos, modifier, currentTransform;
-    var ownTransforms = [].concat(transforms);
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._shouldRender = shouldRender;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st'|| arr[i].ty == 'gf'|| arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData, shouldRender, ownTransforms);
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                currentTransform = this.createTransformElement(arr[i]);
-                itemsData[i] = currentTransform;
-            }
-            ownTransforms.push(itemsData[i]);
-            this.addTransformToStyleList(itemsData[i]);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i]);
-            }
-            
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        } else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                shouldRender = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    this.removeTransformFromStyleList();
-    this.closeStyles(ownStyles);
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-CVShapeElement.prototype.renderInnerContent = function() {
-    this.transformHelper.opacity = 1;
-    this.transformHelper._opMdf = false;
-    this.renderModifiers();
-    this.transformsManager.processSequences(this._isFirstFrame);
-    this.renderShape(this.transformHelper,this.shapesData,this.itemsData,true);
-};
-
-CVShapeElement.prototype.renderShapeTransform = function(parentTransform, groupTransform) {
-    var props, groupMatrix;
-    if(parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
-        groupTransform.opacity = parentTransform.opacity;
-        groupTransform.opacity *= groupTransform.op.v;
-        groupTransform._opMdf = true;
-    }
-};
-
-CVShapeElement.prototype.drawLayer = function() {
-    var i, len = this.stylesList.length;
-    var j, jLen, k, kLen,elems,nodes, renderer = this.globalData.renderer, ctx = this.globalData.canvasContext, type, currentStyle;
-    for(i=0;i<len;i+=1){
-        currentStyle = this.stylesList[i];
-        type = currentStyle.type;
-
-        //Skipping style when
-        //Stroke width equals 0
-        //style should not be rendered (extra unused repeaters)
-        //current opacity equals 0
-        //global opacity equals 0
-        if(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0){
-            continue;
-        }
-        renderer.save();
-        elems = currentStyle.elements;
-        if(type === 'st' || type === 'gs'){
-            ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
-            ctx.lineWidth = currentStyle.wi;
-            ctx.lineCap = currentStyle.lc;
-            ctx.lineJoin = currentStyle.lj;
-            ctx.miterLimit = currentStyle.ml || 0;
-        } else {
-            ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
-        }
-        renderer.ctxOpacity(currentStyle.coOp);
-        if(type !== 'st' && type !== 'gs'){
-            ctx.beginPath();
-        }
-        renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
-        jLen = elems.length;
-        for(j=0;j<jLen;j+=1){
-            if(type === 'st' || type === 'gs'){
-                ctx.beginPath();
-                if(currentStyle.da){
-                    ctx.setLineDash(currentStyle.da);
-                    ctx.lineDashOffset = currentStyle.do;
-                }
-            }
-            nodes = elems[j].trNodes;
-            kLen = nodes.length;
-
-            for(k=0;k<kLen;k+=1){
-                if(nodes[k].t == 'm'){
-                    ctx.moveTo(nodes[k].p[0],nodes[k].p[1]);
-                }else if(nodes[k].t == 'c'){
-                    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]);
-                }else{
-                    ctx.closePath();
-                }
-            }
-            if(type === 'st' || type === 'gs'){
-                ctx.stroke();
-                if(currentStyle.da){
-                    ctx.setLineDash(this.dashResetter);
-                }
-            }
-        }
-        if(type !== 'st' && type !== 'gs'){
-            ctx.fill(currentStyle.r);
-        }
-        renderer.restore();
-    }
-};
-
-CVShapeElement.prototype.renderShape = function(parentTransform,items,data,isMain){
-    var i, len = items.length - 1;
-    var groupTransform;
-    groupTransform = parentTransform;
-    for(i=len;i>=0;i-=1){
-        if(items[i].ty == 'tr'){
-            groupTransform = data[i].transform;
-            this.renderShapeTransform(parentTransform, groupTransform);
-        }else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc' || items[i].ty == 'sr'){
-            this.renderPath(items[i],data[i]);
-        }else if(items[i].ty == 'fl'){
-            this.renderFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'st'){
-            this.renderStroke(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gf' || items[i].ty == 'gs'){
-            this.renderGradientFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gr'){
-            this.renderShape(groupTransform,items[i].it,data[i].it);
-        }else if(items[i].ty == 'tm'){
-            //
-        }
-    }
-    if(isMain){
-        this.drawLayer();
-    }
-    
-};
-
-CVShapeElement.prototype.renderStyledShape = function(styledShape, shape){
-    if(this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
-        var shapeNodes = styledShape.trNodes;
-        var paths = shape.paths;
-        var i, len, j, jLen = paths._length;
-        shapeNodes.length = 0;
-        var groupTransformMat = styledShape.transforms.finalTransform;
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
         for (j = 0; j < jLen; j += 1) {
-            var pathNodes = paths.shapes[j];
-            if(pathNodes && pathNodes.v){
-                len = pathNodes._length;
-                for (i = 1; i < len; i += 1) {
-                    if (i === 1) {
-                        shapeNodes.push({
-                            t: 'm',
-                            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
-                        });
-                    }
-                    shapeNodes.push({
-                        t: 'c',
-                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])
-                    });
-                }
-                if (len === 1) {
-                    shapeNodes.push({
-                        t: 'm',
-                        p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
-                    });
-                }
-                if (pathNodes.c && len) {
-                    shapeNodes.push({
-                        t: 'c',
-                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])
-                    });
-                    shapeNodes.push({
-                        t: 'z'
-                    });
-                }
-            }
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        styledShape.trNodes = shapeNodes;
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, shouldRender, ownTransforms);
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        currentTransform = this.createTransformElement(arr[i]);
+        itemsData[i] = currentTransform;
+      }
+      ownTransforms.push(itemsData[i]);
+      this.addTransformToStyleList(itemsData[i]);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i]);
+      }
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        shouldRender = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-}
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  this.removeTransformFromStyleList();
+  this.closeStyles(ownStyles);
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
+};
 
-CVShapeElement.prototype.renderPath = function(pathData,itemData){
-    if(pathData.hd !== true && pathData._shouldRender) {
-        var i, len = itemData.styledShapes.length;
-        for (i = 0; i < len; i += 1) {
-            this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
+CVShapeElement.prototype.renderInnerContent = function () {
+  this.transformHelper.opacity = 1;
+  this.transformHelper._opMdf = false;
+  this.renderModifiers();
+  this.transformsManager.processSequences(this._isFirstFrame);
+  this.renderShape(this.transformHelper, this.shapesData, this.itemsData, true);
+};
+
+CVShapeElement.prototype.renderShapeTransform = function (parentTransform, groupTransform) {
+  if (parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
+    groupTransform.opacity = parentTransform.opacity;
+    groupTransform.opacity *= groupTransform.op.v;
+    groupTransform._opMdf = true;
+  }
+};
+
+CVShapeElement.prototype.drawLayer = function () {
+  var i;
+  var len = this.stylesList.length;
+  var j;
+  var jLen;
+  var k;
+  var kLen;
+  var elems;
+  var nodes;
+  var renderer = this.globalData.renderer;
+  var ctx = this.globalData.canvasContext;
+  var type;
+  var currentStyle;
+  for (i = 0; i < len; i += 1) {
+    currentStyle = this.stylesList[i];
+    type = currentStyle.type;
+
+    // Skipping style when
+    // Stroke width equals 0
+    // style should not be rendered (extra unused repeaters)
+    // current opacity equals 0
+    // global opacity equals 0
+    if (!(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0)) {
+      renderer.save();
+      elems = currentStyle.elements;
+      if (type === 'st' || type === 'gs') {
+        ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
+        ctx.lineWidth = currentStyle.wi;
+        ctx.lineCap = currentStyle.lc;
+        ctx.lineJoin = currentStyle.lj;
+        ctx.miterLimit = currentStyle.ml || 0;
+      } else {
+        ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
+      }
+      renderer.ctxOpacity(currentStyle.coOp);
+      if (type !== 'st' && type !== 'gs') {
+        ctx.beginPath();
+      }
+      renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
+      jLen = elems.length;
+      for (j = 0; j < jLen; j += 1) {
+        if (type === 'st' || type === 'gs') {
+          ctx.beginPath();
+          if (currentStyle.da) {
+            ctx.setLineDash(currentStyle.da);
+            ctx.lineDashOffset = currentStyle.do;
+          }
         }
-    }
-};
+        nodes = elems[j].trNodes;
+        kLen = nodes.length;
 
-CVShapeElement.prototype.renderFill = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-
-    if (itemData.c._mdf || this._isFirstFrame) {
-        styleElem.co = 'rgb(' 
-        + bm_floor(itemData.c.v[0]) + ',' 
-        + bm_floor(itemData.c.v[1]) + ',' 
-        + bm_floor(itemData.c.v[2]) + ')';
-    }
-    if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
-        styleElem.coOp = itemData.o.v * groupTransform.opacity;
-    }
-};
-
-CVShapeElement.prototype.renderGradientFill = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-    if(!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
-        var ctx = this.globalData.canvasContext;
-        var grd;
-        var pt1 = itemData.s.v, pt2 = itemData.e.v;
-        if (styleData.t === 1) {
-            grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
-        } else {
-            var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
-
-            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-            var dist = rad * percent;
-            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-            var grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
+        for (k = 0; k < kLen; k += 1) {
+          if (nodes[k].t === 'm') {
+            ctx.moveTo(nodes[k].p[0], nodes[k].p[1]);
+          } else if (nodes[k].t === 'c') {
+            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]);
+          } else {
+            ctx.closePath();
+          }
         }
-
-        var i, len = styleData.g.p;
-        var cValues = itemData.g.c;
-        var opacity = 1;
-
-        for (i = 0; i < len; i += 1){
-            if(itemData.g._hasOpacity && itemData.g._collapsable) {
-                opacity = itemData.g.o[i*2 + 1];
-            }
-            grd.addColorStop(cValues[i * 4] / 100,'rgba('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ',' + opacity + ')');
+        if (type === 'st' || type === 'gs') {
+          ctx.stroke();
+          if (currentStyle.da) {
+            ctx.setLineDash(this.dashResetter);
+          }
         }
-        styleElem.grd = grd;
+      }
+      if (type !== 'st' && type !== 'gs') {
+        ctx.fill(currentStyle.r);
+      }
+      renderer.restore();
     }
-    styleElem.coOp = itemData.o.v*groupTransform.opacity;
-    
+  }
 };
 
-CVShapeElement.prototype.renderStroke = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-    var d = itemData.d;
-    if(d && (d._mdf  || this._isFirstFrame)){
-        styleElem.da = d.dashArray;
-        styleElem.do = d.dashoffset[0];
+CVShapeElement.prototype.renderShape = function (parentTransform, items, data, isMain) {
+  var i;
+  var len = items.length - 1;
+  var groupTransform;
+  groupTransform = parentTransform;
+  for (i = len; i >= 0; i -= 1) {
+    if (items[i].ty === 'tr') {
+      groupTransform = data[i].transform;
+      this.renderShapeTransform(parentTransform, groupTransform);
+    } else if (items[i].ty === 'sh' || items[i].ty === 'el' || items[i].ty === 'rc' || items[i].ty === 'sr') {
+      this.renderPath(items[i], data[i]);
+    } else if (items[i].ty === 'fl') {
+      this.renderFill(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'st') {
+      this.renderStroke(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'gf' || items[i].ty === 'gs') {
+      this.renderGradientFill(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'gr') {
+      this.renderShape(groupTransform, items[i].it, data[i].it);
+    } else if (items[i].ty === 'tm') {
+      //
     }
-    if(itemData.c._mdf || this._isFirstFrame){
-        styleElem.co = 'rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')';
-    }
-    if(itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame){
-        styleElem.coOp = itemData.o.v*groupTransform.opacity;
-    }
-    if(itemData.w._mdf || this._isFirstFrame){
-        styleElem.wi = itemData.w.v;
-    }
+  }
+  if (isMain) {
+    this.drawLayer();
+  }
 };
 
-
-CVShapeElement.prototype.destroy = function(){
-    this.shapesData = null;
-    this.globalData = null;
-    this.canvasContext = null;
-    this.stylesList.length = 0;
-    this.itemsData.length = 0;
+CVShapeElement.prototype.renderStyledShape = function (styledShape, shape) {
+  if (this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
+    var shapeNodes = styledShape.trNodes;
+    var paths = shape.paths;
+    var i;
+    var len;
+    var j;
+    var jLen = paths._length;
+    shapeNodes.length = 0;
+    var groupTransformMat = styledShape.transforms.finalTransform;
+    for (j = 0; j < jLen; j += 1) {
+      var pathNodes = paths.shapes[j];
+      if (pathNodes && pathNodes.v) {
+        len = pathNodes._length;
+        for (i = 1; i < len; i += 1) {
+          if (i === 1) {
+            shapeNodes.push({
+              t: 'm',
+              p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0),
+            });
+          }
+          shapeNodes.push({
+            t: 'c',
+            pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i]),
+          });
+        }
+        if (len === 1) {
+          shapeNodes.push({
+            t: 'm',
+            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0),
+          });
+        }
+        if (pathNodes.c && len) {
+          shapeNodes.push({
+            t: 'c',
+            pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0]),
+          });
+          shapeNodes.push({
+            t: 'z',
+          });
+        }
+      }
+    }
+    styledShape.trNodes = shapeNodes;
+  }
 };
 
+CVShapeElement.prototype.renderPath = function (pathData, itemData) {
+  if (pathData.hd !== true && pathData._shouldRender) {
+    var i;
+    var len = itemData.styledShapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
+    }
+  }
+};
+
+CVShapeElement.prototype.renderFill = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+
+  if (itemData.c._mdf || this._isFirstFrame) {
+    styleElem.co = 'rgb('
+        + bmFloor(itemData.c.v[0]) + ','
+        + bmFloor(itemData.c.v[1]) + ','
+        + bmFloor(itemData.c.v[2]) + ')';
+  }
+  if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
+    styleElem.coOp = itemData.o.v * groupTransform.opacity;
+  }
+};
+
+CVShapeElement.prototype.renderGradientFill = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+  var grd;
+  if (!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
+    var ctx = this.globalData.canvasContext;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
+    if (styleData.t === 1) {
+      grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
+    } else {
+      var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+      var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+
+      var percent = itemData.h.v;
+      if (percent >= 1) {
+        percent = 0.99;
+      } else if (percent <= -1) {
+        percent = -0.99;
+      }
+      var dist = rad * percent;
+      var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+      var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+      grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
+    }
+
+    var i;
+    var len = styleData.g.p;
+    var cValues = itemData.g.c;
+    var opacity = 1;
+
+    for (i = 0; i < len; i += 1) {
+      if (itemData.g._hasOpacity && itemData.g._collapsable) {
+        opacity = itemData.g.o[i * 2 + 1];
+      }
+      grd.addColorStop(cValues[i * 4] / 100, 'rgba(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ',' + opacity + ')');
+    }
+    styleElem.grd = grd;
+  }
+  styleElem.coOp = itemData.o.v * groupTransform.opacity;
+};
+
+CVShapeElement.prototype.renderStroke = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+  var d = itemData.d;
+  if (d && (d._mdf || this._isFirstFrame)) {
+    styleElem.da = d.dashArray;
+    styleElem.do = d.dashoffset[0];
+  }
+  if (itemData.c._mdf || this._isFirstFrame) {
+    styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')';
+  }
+  if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
+    styleElem.coOp = itemData.o.v * groupTransform.opacity;
+  }
+  if (itemData.w._mdf || this._isFirstFrame) {
+    styleElem.wi = itemData.w.v;
+  }
+};
+
+CVShapeElement.prototype.destroy = function () {
+  this.shapesData = null;
+  this.globalData = null;
+  this.canvasContext = null;
+  this.stylesList.length = 0;
+  this.itemsData.length = 0;
+};
+
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement,
+SVGShapeElement, IImageElement */
 
 function CVSolidElement(data, globalData, comp) {
-    this.initElement(data,globalData,comp);
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);
 
 CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;
 CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
 
-CVSolidElement.prototype.renderInnerContent = function() {
-    var ctx = this.canvasContext;
-    ctx.fillStyle = this.data.sc;
-    ctx.fillRect(0, 0, this.data.sw, this.data.sh);
-    //
+CVSolidElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.fillStyle = this.data.sc;
+  ctx.fillRect(0, 0, this.data.sw, this.data.sh);
+  //
 };
-function CVTextElement(data, globalData, comp){
-    this.textSpans = [];
-    this.yOffset = 0;
-    this.fillColorAnim = false;
-    this.strokeColorAnim = false;
-    this.strokeWidthAnim = false;
-    this.stroke = false;
-    this.fill = false;
-    this.justifyOffset = 0;
-    this.currentRender = null;
-    this.renderType = 'canvas';
-    this.values = {
-        fill: 'rgba(0,0,0,0)',
-        stroke: 'rgba(0,0,0,0)',
-        sWidth: 0,
-        fValue: ''
-    };
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement,
+RenderableElement, ITextElement, createTag, createSizedArray */
+
+function CVTextElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.yOffset = 0;
+  this.fillColorAnim = false;
+  this.strokeColorAnim = false;
+  this.strokeWidthAnim = false;
+  this.stroke = false;
+  this.fill = false;
+  this.justifyOffset = 0;
+  this.currentRender = null;
+  this.renderType = 'canvas';
+  this.values = {
+    fill: 'rgba(0,0,0,0)',
+    stroke: 'rgba(0,0,0,0)',
+    sWidth: 0,
+    fValue: '',
+  };
+  this.initElement(data, globalData, comp);
 }
-extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement], CVTextElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement);
 
 CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d');
 
-CVTextElement.prototype.buildNewText = function(){
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
+CVTextElement.prototype.buildNewText = function () {
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
 
-    var hasFill = false;
-    if(documentData.fc) {
-        hasFill = true;
-        this.values.fill = this.buildColor(documentData.fc);
-    }else{
-        this.values.fill = 'rgba(0,0,0,0)';
+  var hasFill = false;
+  if (documentData.fc) {
+    hasFill = true;
+    this.values.fill = this.buildColor(documentData.fc);
+  } else {
+    this.values.fill = 'rgba(0,0,0,0)';
+  }
+  this.fill = hasFill;
+  var hasStroke = false;
+  if (documentData.sc) {
+    hasStroke = true;
+    this.values.stroke = this.buildColor(documentData.sc);
+    this.values.sWidth = documentData.sw;
+  }
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  var i;
+  var len;
+  var letters = documentData.l;
+  var matrixHelper = this.mHelper;
+  this.stroke = hasStroke;
+  this.values.fValue = documentData.finalSize + 'px ' + this.globalData.fontManager.getFontByName(documentData.f).fFamily;
+  len = documentData.finalText.length;
+  // this.tHelper.font = this.values.fValue;
+  var charData;
+  var shapeData;
+  var k;
+  var kLen;
+  var shapes;
+  var j;
+  var jLen;
+  var pathNodes;
+  var commands;
+  var pathArr;
+  var singleShape = this.data.singleShape;
+  var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
+  var xPos = 0;
+  var yPos = 0;
+  var firstLine = true;
+  var cnt = 0;
+  for (i = 0; i < len; i += 1) {
+    charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+    shapeData = (charData && charData.data) || {};
+    matrixHelper.reset();
+    if (singleShape && letters[i].n) {
+      xPos = -trackingOffset;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      firstLine = false;
     }
-    this.fill = hasFill;
-    var hasStroke = false;
-    if(documentData.sc){
-        hasStroke = true;
-        this.values.stroke = this.buildColor(documentData.sc);
-        this.values.sWidth = documentData.sw;
-    }
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    var i, len;
-    var letters = documentData.l;
-    var matrixHelper = this.mHelper;
-    this.stroke = hasStroke;
-    this.values.fValue = documentData.finalSize + 'px '+ this.globalData.fontManager.getFontByName(documentData.f).fFamily;
-    len = documentData.finalText.length;
-    //this.tHelper.font = this.values.fValue;
-    var charData, shapeData, k, kLen, shapes, j, jLen, pathNodes, commands, pathArr, singleShape = this.data.singleShape;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var xPos = 0, yPos = 0, firstLine = true;
-    var cnt = 0;
-    for (i = 0; i < len; i += 1) {
-        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-        shapeData = charData && charData.data || {};
-        matrixHelper.reset();
-        if(singleShape && letters[i].n) {
-            xPos = -trackingOffset;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            firstLine = false;
-        }
 
-        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
-        jLen = shapes.length;
-        matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
-        if(singleShape){
-            this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
-        }
-        commands = createSizedArray(jLen);
-        for(j=0;j<jLen;j+=1){
-            kLen = shapes[j].ks.k.i.length;
-            pathNodes = shapes[j].ks.k;
-            pathArr = [];
-            for(k=1;k<kLen;k+=1){
-                if(k==1){
-                    pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0],pathNodes.v[0][1],0),matrixHelper.applyToY(pathNodes.v[0][0],pathNodes.v[0][1],0));
-                }
-                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));
-            }
-            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));
-            commands[j] = pathArr;
-        }
-        if(singleShape){
-            xPos += letters[i].l;
-            xPos += trackingOffset;
-        }
-        if(this.textSpans[cnt]){
-            this.textSpans[cnt].elem = commands;
-        } else {
-            this.textSpans[cnt] = {elem: commands};
-        }
-        cnt +=1;
+    shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+    jLen = shapes.length;
+    matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+    if (singleShape) {
+      this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
     }
+    commands = createSizedArray(jLen);
+    for (j = 0; j < jLen; j += 1) {
+      kLen = shapes[j].ks.k.i.length;
+      pathNodes = shapes[j].ks.k;
+      pathArr = [];
+      for (k = 1; k < kLen; k += 1) {
+        if (k === 1) {
+          pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));
+        }
+        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));
+      }
+      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));
+      commands[j] = pathArr;
+    }
+    if (singleShape) {
+      xPos += letters[i].l;
+      xPos += trackingOffset;
+    }
+    if (this.textSpans[cnt]) {
+      this.textSpans[cnt].elem = commands;
+    } else {
+      this.textSpans[cnt] = { elem: commands };
+    }
+    cnt += 1;
+  }
 };
 
-CVTextElement.prototype.renderInnerContent = function(){
-    var ctx = this.canvasContext;
-    var finalMat = this.finalTransform.mat.props;
-    ctx.font = this.values.fValue;
-    ctx.lineCap = 'butt';
-    ctx.lineJoin = 'miter';
-    ctx.miterLimit = 4;
+CVTextElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.font = this.values.fValue;
+  ctx.lineCap = 'butt';
+  ctx.lineJoin = 'miter';
+  ctx.miterLimit = 4;
 
-    if(!this.data.singleShape){
-        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  if (!this.data.singleShape) {
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  }
+
+  var i;
+  var len;
+  var j;
+  var jLen;
+  var k;
+  var kLen;
+  var renderedLetters = this.textAnimator.renderedLetters;
+
+  var letters = this.textProperty.currentData.l;
+
+  len = letters.length;
+  var renderedLetter;
+  var lastFill = null;
+  var lastStroke = null;
+  var lastStrokeW = null;
+  var commands;
+  var pathArr;
+  for (i = 0; i < len; i += 1) {
+    if (!letters[i].n) {
+      renderedLetter = renderedLetters[i];
+      if (renderedLetter) {
+        this.globalData.renderer.save();
+        this.globalData.renderer.ctxTransform(renderedLetter.p);
+        this.globalData.renderer.ctxOpacity(renderedLetter.o);
+      }
+      if (this.fill) {
+        if (renderedLetter && renderedLetter.fc) {
+          if (lastFill !== renderedLetter.fc) {
+            lastFill = renderedLetter.fc;
+            ctx.fillStyle = renderedLetter.fc;
+          }
+        } else if (lastFill !== this.values.fill) {
+          lastFill = this.values.fill;
+          ctx.fillStyle = this.values.fill;
+        }
+        commands = this.textSpans[i].elem;
+        jLen = commands.length;
+        this.globalData.canvasContext.beginPath();
+        for (j = 0; j < jLen; j += 1) {
+          pathArr = commands[j];
+          kLen = pathArr.length;
+          this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
+          for (k = 2; k < kLen; k += 6) {
+            this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
+          }
+        }
+        this.globalData.canvasContext.closePath();
+        this.globalData.canvasContext.fill();
+        /// ctx.fillText(this.textSpans[i].val,0,0);
+      }
+      if (this.stroke) {
+        if (renderedLetter && renderedLetter.sw) {
+          if (lastStrokeW !== renderedLetter.sw) {
+            lastStrokeW = renderedLetter.sw;
+            ctx.lineWidth = renderedLetter.sw;
+          }
+        } else if (lastStrokeW !== this.values.sWidth) {
+          lastStrokeW = this.values.sWidth;
+          ctx.lineWidth = this.values.sWidth;
+        }
+        if (renderedLetter && renderedLetter.sc) {
+          if (lastStroke !== renderedLetter.sc) {
+            lastStroke = renderedLetter.sc;
+            ctx.strokeStyle = renderedLetter.sc;
+          }
+        } else if (lastStroke !== this.values.stroke) {
+          lastStroke = this.values.stroke;
+          ctx.strokeStyle = this.values.stroke;
+        }
+        commands = this.textSpans[i].elem;
+        jLen = commands.length;
+        this.globalData.canvasContext.beginPath();
+        for (j = 0; j < jLen; j += 1) {
+          pathArr = commands[j];
+          kLen = pathArr.length;
+          this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
+          for (k = 2; k < kLen; k += 6) {
+            this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
+          }
+        }
+        this.globalData.canvasContext.closePath();
+        this.globalData.canvasContext.stroke();
+        /// ctx.strokeText(letters[i].val,0,0);
+      }
+      if (renderedLetter) {
+        this.globalData.renderer.restore();
+      }
     }
-
-    var  i,len, j, jLen, k, kLen;
-    var renderedLetters = this.textAnimator.renderedLetters;
-
-    var letters = this.textProperty.currentData.l;
-
-    len = letters.length;
-    var renderedLetter;
-    var lastFill = null, lastStroke = null, lastStrokeW = null, commands, pathArr;
-    for(i=0;i<len;i+=1){
-        if(letters[i].n){
-            continue;
-        }
-        renderedLetter = renderedLetters[i];
-        if(renderedLetter){
-            this.globalData.renderer.save();
-            this.globalData.renderer.ctxTransform(renderedLetter.p);
-            this.globalData.renderer.ctxOpacity(renderedLetter.o);
-        }
-        if(this.fill){
-            if(renderedLetter && renderedLetter.fc){
-                if(lastFill !== renderedLetter.fc){
-                    lastFill = renderedLetter.fc;
-                    ctx.fillStyle = renderedLetter.fc;
-                }
-            }else if(lastFill !== this.values.fill){
-                lastFill = this.values.fill;
-                ctx.fillStyle = this.values.fill;
-            }
-            commands = this.textSpans[i].elem;
-            jLen = commands.length;
-            this.globalData.canvasContext.beginPath();
-            for(j=0;j<jLen;j+=1) {
-                pathArr = commands[j];
-                kLen = pathArr.length;
-                this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
-                for (k = 2; k < kLen; k += 6) {
-                    this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
-                }
-            }
-            this.globalData.canvasContext.closePath();
-            this.globalData.canvasContext.fill();
-            ///ctx.fillText(this.textSpans[i].val,0,0);
-        }
-        if(this.stroke){
-            if(renderedLetter && renderedLetter.sw){
-                if(lastStrokeW !== renderedLetter.sw){
-                    lastStrokeW = renderedLetter.sw;
-                    ctx.lineWidth = renderedLetter.sw;
-                }
-            }else if(lastStrokeW !== this.values.sWidth){
-                lastStrokeW = this.values.sWidth;
-                ctx.lineWidth = this.values.sWidth;
-            }
-            if(renderedLetter && renderedLetter.sc){
-                if(lastStroke !== renderedLetter.sc){
-                    lastStroke = renderedLetter.sc;
-                    ctx.strokeStyle = renderedLetter.sc;
-                }
-            }else if(lastStroke !== this.values.stroke){
-                lastStroke = this.values.stroke;
-                ctx.strokeStyle = this.values.stroke;
-            }
-            commands = this.textSpans[i].elem;
-            jLen = commands.length;
-            this.globalData.canvasContext.beginPath();
-            for(j=0;j<jLen;j+=1) {
-                pathArr = commands[j];
-                kLen = pathArr.length;
-                this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
-                for (k = 2; k < kLen; k += 6) {
-                    this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
-                }
-            }
-            this.globalData.canvasContext.closePath();
-            this.globalData.canvasContext.stroke();
-            ///ctx.strokeText(letters[i].val,0,0);
-        }
-        if(renderedLetter) {
-            this.globalData.renderer.restore();
-        }
-    }
+  }
 };
+
 function CVEffects() {
 
 }
-CVEffects.prototype.renderFrame = function(){};
-function HBaseElement(data,globalData,comp){}
+CVEffects.prototype.renderFrame = function () {};
+
+/* global createTag, createNS, styleDiv, CVEffects, MaskElement, SVGBaseElement, HybridRenderer */
+
+function HBaseElement() {}
 HBaseElement.prototype = {
-    checkBlendMode: function(){},
-    initRendererElement: function(){
-        this.baseElement = createTag(this.data.tg || 'div');
-        if(this.data.hasMask) {
-            this.svgElement = createNS('svg');
-            this.layerElement = createNS('g');
-            this.maskedElement = this.layerElement;
-            this.svgElement.appendChild(this.layerElement);
-            this.baseElement.appendChild(this.svgElement);
-        } else {
-            this.layerElement = this.baseElement;
-        }
-        styleDiv(this.baseElement);
-    },
-    createContainerElements: function(){
-        this.renderableEffectsManager = new CVEffects(this);
-        this.transformedElement = this.baseElement;
-        this.maskedElement = this.layerElement;
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id',this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-    },
-    renderElement: function() {
-        if(this.finalTransform._matMdf){
-            this.transformedElement.style.transform = this.transformedElement.style.webkitTransform = this.finalTransform.mat.toCSS();
-        }
-        if(this.finalTransform._opMdf){
-            this.transformedElement.style.opacity = this.finalTransform.mProp.o.v;
-        }
-    },
-    renderFrame: function() {
-        //If it is exported as hidden (data.hd === true) no need to render
-        //If it is not visible no need to render
-        if (this.data.hd || this.hidden) {
-            return;
-        }
-        this.renderTransform();
-        this.renderRenderable();
-        this.renderElement();
-        this.renderInnerContent();
-        if (this._isFirstFrame) {
-            this._isFirstFrame = false;
-        }
-    },
-    destroy: function(){
-        this.layerElement = null;
-        this.transformedElement = null;
-        if(this.matteElement) {
-            this.matteElement = null;
-        }
-        if(this.maskManager) {
-            this.maskManager.destroy();
-            this.maskManager = null;
-        }
-    },
-    createRenderableComponents: function(){
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-    },
-    addEffects: function(){
-    },
-    setMatte: function(){}
+  checkBlendMode: function () {},
+  initRendererElement: function () {
+    this.baseElement = createTag(this.data.tg || 'div');
+    if (this.data.hasMask) {
+      this.svgElement = createNS('svg');
+      this.layerElement = createNS('g');
+      this.maskedElement = this.layerElement;
+      this.svgElement.appendChild(this.layerElement);
+      this.baseElement.appendChild(this.svgElement);
+    } else {
+      this.layerElement = this.baseElement;
+    }
+    styleDiv(this.baseElement);
+  },
+  createContainerElements: function () {
+    this.renderableEffectsManager = new CVEffects(this);
+    this.transformedElement = this.baseElement;
+    this.maskedElement = this.layerElement;
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    var transformedElementStyle = this.transformedElement ? this.transformedElement.style : {};
+    if (this.finalTransform._matMdf) {
+      var matrixValue = this.finalTransform.mat.toCSS();
+      transformedElementStyle.transform = matrixValue;
+      transformedElementStyle.webkitTransform = matrixValue;
+    }
+    if (this.finalTransform._opMdf) {
+      transformedElementStyle.opacity = this.finalTransform.mProp.o.v;
+    }
+  },
+  renderFrame: function () {
+    // If it is exported as hidden (data.hd === true) no need to render
+    // If it is not visible no need to render
+    if (this.data.hd || this.hidden) {
+      return;
+    }
+    this.renderTransform();
+    this.renderRenderable();
+    this.renderElement();
+    this.renderInnerContent();
+    if (this._isFirstFrame) {
+      this._isFirstFrame = false;
+    }
+  },
+  destroy: function () {
+    this.layerElement = null;
+    this.transformedElement = null;
+    if (this.matteElement) {
+      this.matteElement = null;
+    }
+    if (this.maskManager) {
+      this.maskManager.destroy();
+      this.maskManager = null;
+    }
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+  },
+  addEffects: function () {
+  },
+  setMatte: function () {},
 };
 HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;
 HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;
 HBaseElement.prototype.buildElementParenting = HybridRenderer.prototype.buildElementParenting;
-function HSolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
-}
-extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], HSolidElement);
 
-HSolidElement.prototype.createContent = function(){
-    var rect;
-    if(this.data.hasMask){
-        rect = createNS('rect');
-        rect.setAttribute('width',this.data.sw);
-        rect.setAttribute('height',this.data.sh);
-        rect.setAttribute('fill',this.data.sc);
-        this.svgElement.setAttribute('width',this.data.sw);
-        this.svgElement.setAttribute('height',this.data.sh);
-    } else {
-        rect = createTag('div');
-        rect.style.width = this.data.sw + 'px';
-        rect.style.height = this.data.sh + 'px';
-        rect.style.backgroundColor = this.data.sc;
-    }
-    this.layerElement.appendChild(rect);
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, createNS, createTag */
+
+function HSolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
+}
+extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement);
+
+HSolidElement.prototype.createContent = function () {
+  var rect;
+  if (this.data.hasMask) {
+    rect = createNS('rect');
+    rect.setAttribute('width', this.data.sw);
+    rect.setAttribute('height', this.data.sh);
+    rect.setAttribute('fill', this.data.sc);
+    this.svgElement.setAttribute('width', this.data.sw);
+    this.svgElement.setAttribute('height', this.data.sh);
+  } else {
+    rect = createTag('div');
+    rect.style.width = this.data.sw + 'px';
+    rect.style.height = this.data.sh + 'px';
+    rect.style.backgroundColor = this.data.sc;
+  }
+  this.layerElement.appendChild(rect);
 };
 
-function HCompElement(data,globalData,comp){
-    this.layers = data.layers;
-    this.supports3d = !data.hasMask;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
-    this.initElement(data,globalData,comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+/* global createSizedArray, PropertyFactory, extendPrototype, HybridRenderer, ICompElement, HBaseElement */
+
+function HCompElement(data, globalData, comp) {
+  this.layers = data.layers;
+  this.supports3d = !data.hasMask;
+  this.completeLayers = false;
+  this.pendingElements = [];
+  this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([HybridRenderer, ICompElement, HBaseElement], HCompElement);
 HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements;
 
-HCompElement.prototype.createContainerElements = function(){
-    this._createBaseContainerElements();
-    //divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
-    if(this.data.hasMask){
-        this.svgElement.setAttribute('width',this.data.w);
-        this.svgElement.setAttribute('height',this.data.h);
-        this.transformedElement = this.baseElement;
-    } else {
-        this.transformedElement = this.layerElement;
-    }
+HCompElement.prototype.createContainerElements = function () {
+  this._createBaseContainerElements();
+  // divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
+  if (this.data.hasMask) {
+    this.svgElement.setAttribute('width', this.data.w);
+    this.svgElement.setAttribute('height', this.data.h);
+    this.transformedElement = this.baseElement;
+  } else {
+    this.transformedElement = this.layerElement;
+  }
 };
 
-HCompElement.prototype.addTo3dContainer = function(elem,pos) {
-    var j = 0;
-    var nextElement;
-    while(j<pos){
-        if(this.elements[j] && this.elements[j].getBaseElement){
-            nextElement = this.elements[j].getBaseElement();
-        }
-        j += 1;
+HCompElement.prototype.addTo3dContainer = function (elem, pos) {
+  var j = 0;
+  var nextElement;
+  while (j < pos) {
+    if (this.elements[j] && this.elements[j].getBaseElement) {
+      nextElement = this.elements[j].getBaseElement();
     }
-    if(nextElement){
-        this.layerElement.insertBefore(elem, nextElement);
-    } else {
-        this.layerElement.appendChild(elem);
-    }
-}
+    j += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(elem, nextElement);
+  } else {
+    this.layerElement.appendChild(elem);
+  }
+};
 
-function HShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    this.shapesContainer = createNS('g');
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    this.currentBBox = {
-        x:999999,
-        y: -999999,
-        h: 0,
-        w: 0
-    };
+/* global createNS, extendPrototype, BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement,
+HierarchyElement, FrameElement, RenderableElement, createNS, bmMin, bmSqrt, bmMin, bmMax, bmPow */
+
+function HShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  this.shapesContainer = createNS('g');
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  this.currentBBox = {
+    x: 999999,
+    y: -999999,
+    h: 0,
+    w: 0,
+  };
 }
-extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement], HShapeElement);
+extendPrototype([BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement], HShapeElement);
 HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent;
 
-HShapeElement.prototype.createContent = function(){
-    var cont;
-    this.baseElement.style.fontSize = 0;
-    if (this.data.hasMask) {
-        this.layerElement.appendChild(this.shapesContainer);
-        cont = this.svgElement;
-    } else {
-        cont = createNS('svg');
-        var size = this.comp.data ? this.comp.data : this.globalData.compSize;
-        cont.setAttribute('width',size.w);
-        cont.setAttribute('height',size.h);
-        cont.appendChild(this.shapesContainer);
-        this.layerElement.appendChild(cont);
-    }
-
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0, [], true);
-    this.filterUniqueShapes();
-    this.shapeCont = cont;
-};
-
-HShapeElement.prototype.getTransformedPoint = function(transformers, point) {
-    var i, len = transformers.length;
-    for(i = 0; i < len; i += 1) {
-        point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
-    }
-    return point;
-}
-
-HShapeElement.prototype.calculateShapeBoundingBox = function(item, boundingBox) {
-    var shape = item.sh.v;
-    var transformers = item.transformers;
-    var i, len = shape._length, vPoint, oPoint, nextIPoint, nextVPoint, bounds;
-    if (len <= 1) {
-        return;
-    }
-    for (i = 0; i < len - 1; i += 1) {
-        vPoint = this.getTransformedPoint(transformers, shape.v[i]);
-        oPoint = this.getTransformedPoint(transformers, shape.o[i]);
-        nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
-        nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
-        this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
-    }
-    if(shape.c) {
-        vPoint = this.getTransformedPoint(transformers, shape.v[i]);
-        oPoint = this.getTransformedPoint(transformers, shape.o[i]);
-        nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
-        nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
-        this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
-    }
-}
-
-HShapeElement.prototype.checkBounds = function(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
-    this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
-    var bounds = this.shapeBoundingBox;
-    boundingBox.x = bm_min(bounds.left, boundingBox.x);
-    boundingBox.xMax = bm_max(bounds.right, boundingBox.xMax);
-    boundingBox.y = bm_min(bounds.top, boundingBox.y);
-    boundingBox.yMax = bm_max(bounds.bottom, boundingBox.yMax);
-}
-
-HShapeElement.prototype.shapeBoundingBox = {
-    left:0,
-    right:0,
-    top:0,
-    bottom:0,
-}
-
-HShapeElement.prototype.tempBoundingBox = {
-    x:0,
-    xMax:0,
-    y:0,
-    yMax:0,
-    width:0,
-    height:0
-}
-
-HShapeElement.prototype.getBoundsOfCurve = function(p0, p1, p2, p3) {
-
-    var bounds = [[p0[0],p3[0]], [p0[1],p3[1]]];
-
-    for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) {
-
-      b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
-      a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
-      c = 3 * p1[i] - 3 * p0[i];
-
-      b = b | 0;
-      a = a | 0;
-      c = c | 0;
-
-      if (a === 0) {
-
-        if (b === 0) {
-          continue;
-        }
-
-        t = -c / b;
-
-        if (0 < t && t < 1) {
-          bounds[i].push(this.calculateF(t,p0,p1,p2,p3,i));
-        }
-        continue;
-      }
-
-      b2ac = b * b - 4 * c * a;
-
-      if (b2ac < 0) {
-        continue;
-      }
-
-      t1 = (-b + bm_sqrt(b2ac))/(2 * a);
-      if (0 < t1 && t1 < 1) bounds[i].push(this.calculateF(t1,p0,p1,p2,p3,i));
-
-      t2 = (-b - bm_sqrt(b2ac))/(2 * a);
-      if (0 < t2 && t2 < 1) bounds[i].push(this.calculateF(t2,p0,p1,p2,p3,i));
-
-    }
-
-    this.shapeBoundingBox.left = bm_min.apply(null, bounds[0]);
-    this.shapeBoundingBox.top = bm_min.apply(null, bounds[1]);
-    this.shapeBoundingBox.right = bm_max.apply(null, bounds[0]);
-    this.shapeBoundingBox.bottom = bm_max.apply(null, bounds[1]);
-  };
-
-  HShapeElement.prototype.calculateF = function(t, p0, p1, p2, p3, i) {
-    return bm_pow(1-t, 3) * p0[i]
-        + 3 * bm_pow(1-t, 2) * t * p1[i]
-        + 3 * (1-t) * bm_pow(t, 2) * p2[i]
-        + bm_pow(t, 3) * p3[i];
+HShapeElement.prototype.createContent = function () {
+  var cont;
+  this.baseElement.style.fontSize = 0;
+  if (this.data.hasMask) {
+    this.layerElement.appendChild(this.shapesContainer);
+    cont = this.svgElement;
+  } else {
+    cont = createNS('svg');
+    var size = this.comp.data ? this.comp.data : this.globalData.compSize;
+    cont.setAttribute('width', size.w);
+    cont.setAttribute('height', size.h);
+    cont.appendChild(this.shapesContainer);
+    this.layerElement.appendChild(cont);
   }
 
-HShapeElement.prototype.calculateBoundingBox = function(itemsData, boundingBox) {
-    var i, len = itemsData.length, path;
-    for(i = 0; i < len; i += 1) {
-        if(itemsData[i] && itemsData[i].sh) {
-            this.calculateShapeBoundingBox(itemsData[i], boundingBox)
-        } else if(itemsData[i] && itemsData[i].it) {
-            this.calculateBoundingBox(itemsData[i].it, boundingBox)
-        }
-    }
-}
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], true);
+  this.filterUniqueShapes();
+  this.shapeCont = cont;
+};
 
-HShapeElement.prototype.currentBoxContains = function(box) {
-    return this.currentBBox.x <= box.x 
-    && this.currentBBox.y <= box.y 
+HShapeElement.prototype.getTransformedPoint = function (transformers, point) {
+  var i;
+  var len = transformers.length;
+  for (i = 0; i < len; i += 1) {
+    point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
+  }
+  return point;
+};
+
+HShapeElement.prototype.calculateShapeBoundingBox = function (item, boundingBox) {
+  var shape = item.sh.v;
+  var transformers = item.transformers;
+  var i;
+  var len = shape._length;
+  var vPoint;
+  var oPoint;
+  var nextIPoint;
+  var nextVPoint;
+  if (len <= 1) {
+    return;
+  }
+  for (i = 0; i < len - 1; i += 1) {
+    vPoint = this.getTransformedPoint(transformers, shape.v[i]);
+    oPoint = this.getTransformedPoint(transformers, shape.o[i]);
+    nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
+    nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
+    this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
+  }
+  if (shape.c) {
+    vPoint = this.getTransformedPoint(transformers, shape.v[i]);
+    oPoint = this.getTransformedPoint(transformers, shape.o[i]);
+    nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
+    nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
+    this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
+  }
+};
+
+HShapeElement.prototype.checkBounds = function (vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
+  this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
+  var bounds = this.shapeBoundingBox;
+  boundingBox.x = bmMin(bounds.left, boundingBox.x);
+  boundingBox.xMax = bmMax(bounds.right, boundingBox.xMax);
+  boundingBox.y = bmMin(bounds.top, boundingBox.y);
+  boundingBox.yMax = bmMax(bounds.bottom, boundingBox.yMax);
+};
+
+HShapeElement.prototype.shapeBoundingBox = {
+  left: 0,
+  right: 0,
+  top: 0,
+  bottom: 0,
+};
+
+HShapeElement.prototype.tempBoundingBox = {
+  x: 0,
+  xMax: 0,
+  y: 0,
+  yMax: 0,
+  width: 0,
+  height: 0,
+};
+
+HShapeElement.prototype.getBoundsOfCurve = function (p0, p1, p2, p3) {
+  var bounds = [[p0[0], p3[0]], [p0[1], p3[1]]];
+
+  for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) { // eslint-disable-line no-plusplus
+    b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
+    a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
+    c = 3 * p1[i] - 3 * p0[i];
+
+    b |= 0; // eslint-disable-line no-bitwise
+    a |= 0; // eslint-disable-line no-bitwise
+    c |= 0; // eslint-disable-line no-bitwise
+
+    if (a === 0 && b === 0) {
+      //
+    } else if (a === 0) {
+      t = -c / b;
+
+      if (t > 0 && t < 1) {
+        bounds[i].push(this.calculateF(t, p0, p1, p2, p3, i));
+      }
+    } else {
+      b2ac = b * b - 4 * c * a;
+
+      if (b2ac >= 0) {
+        t1 = (-b + bmSqrt(b2ac)) / (2 * a);
+        if (t1 > 0 && t1 < 1) bounds[i].push(this.calculateF(t1, p0, p1, p2, p3, i));
+        t2 = (-b - bmSqrt(b2ac)) / (2 * a);
+        if (t2 > 0 && t2 < 1) bounds[i].push(this.calculateF(t2, p0, p1, p2, p3, i));
+      }
+    }
+  }
+
+  this.shapeBoundingBox.left = bmMin.apply(null, bounds[0]);
+  this.shapeBoundingBox.top = bmMin.apply(null, bounds[1]);
+  this.shapeBoundingBox.right = bmMax.apply(null, bounds[0]);
+  this.shapeBoundingBox.bottom = bmMax.apply(null, bounds[1]);
+};
+
+HShapeElement.prototype.calculateF = function (t, p0, p1, p2, p3, i) {
+  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];
+};
+
+HShapeElement.prototype.calculateBoundingBox = function (itemsData, boundingBox) {
+  var i;
+  var len = itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    if (itemsData[i] && itemsData[i].sh) {
+      this.calculateShapeBoundingBox(itemsData[i], boundingBox);
+    } else if (itemsData[i] && itemsData[i].it) {
+      this.calculateBoundingBox(itemsData[i].it, boundingBox);
+    }
+  }
+};
+
+HShapeElement.prototype.currentBoxContains = function (box) {
+  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
-}
-
-HShapeElement.prototype.renderInnerContent = function() {
-    this._renderShapeFrame();
-
-    if(!this.hidden && (this._isFirstFrame || this._mdf)) {
-        var tempBoundingBox = this.tempBoundingBox;
-        var max = 999999;
-        tempBoundingBox.x = max;
-        tempBoundingBox.xMax = -max;
-        tempBoundingBox.y = max;
-        tempBoundingBox.yMax = -max;
-        this.calculateBoundingBox(this.itemsData, tempBoundingBox);
-        tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
-        tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
-        //var tempBoundingBox = this.shapeCont.getBBox();
-        if(this.currentBoxContains(tempBoundingBox)) {
-            return;
-        }
-        var changed = false;
-        if(this.currentBBox.w !== tempBoundingBox.width){
-            this.currentBBox.w = tempBoundingBox.width;
-            this.shapeCont.setAttribute('width',tempBoundingBox.width);
-            changed = true;
-        }
-        if(this.currentBBox.h !== tempBoundingBox.height){
-            this.currentBBox.h = tempBoundingBox.height;
-            this.shapeCont.setAttribute('height',tempBoundingBox.height);
-            changed = true;
-        }
-        if(changed  || this.currentBBox.x !== tempBoundingBox.x  || this.currentBBox.y !== tempBoundingBox.y){
-            this.currentBBox.w = tempBoundingBox.width;
-            this.currentBBox.h = tempBoundingBox.height;
-            this.currentBBox.x = tempBoundingBox.x;
-            this.currentBBox.y = tempBoundingBox.y;
-
-            this.shapeCont.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
-            this.shapeCont.style.transform = this.shapeCont.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
-        }
-    }
-
+    && this.currentBBox.height + this.currentBBox.y >= box.y + box.height;
 };
-function HTextElement(data,globalData,comp){
-    this.textSpans = [];
-    this.textPaths = [];
-    this.currentBBox = {
-        x:999999,
-        y: -999999,
-        h: 0,
-        w: 0
-    };
+
+HShapeElement.prototype.renderInnerContent = function () {
+  this._renderShapeFrame();
+
+  if (!this.hidden && (this._isFirstFrame || this._mdf)) {
+    var tempBoundingBox = this.tempBoundingBox;
+    var max = 999999;
+    tempBoundingBox.x = max;
+    tempBoundingBox.xMax = -max;
+    tempBoundingBox.y = max;
+    tempBoundingBox.yMax = -max;
+    this.calculateBoundingBox(this.itemsData, tempBoundingBox);
+    tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
+    tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
+    // var tempBoundingBox = this.shapeCont.getBBox();
+    if (this.currentBoxContains(tempBoundingBox)) {
+      return;
+    }
+    var changed = false;
+    if (this.currentBBox.w !== tempBoundingBox.width) {
+      this.currentBBox.w = tempBoundingBox.width;
+      this.shapeCont.setAttribute('width', tempBoundingBox.width);
+      changed = true;
+    }
+    if (this.currentBBox.h !== tempBoundingBox.height) {
+      this.currentBBox.h = tempBoundingBox.height;
+      this.shapeCont.setAttribute('height', tempBoundingBox.height);
+      changed = true;
+    }
+    if (changed || this.currentBBox.x !== tempBoundingBox.x || this.currentBBox.y !== tempBoundingBox.y) {
+      this.currentBBox.w = tempBoundingBox.width;
+      this.currentBBox.h = tempBoundingBox.height;
+      this.currentBBox.x = tempBoundingBox.x;
+      this.currentBBox.y = tempBoundingBox.y;
+
+      this.shapeCont.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
+      var shapeStyle = this.shapeCont.style;
+      var shapeTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
+      shapeStyle.transform = shapeTransform;
+      shapeStyle.webkitTransform = shapeTransform;
+    }
+  }
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, ITextElement, createSizedArray, createTag, styleDiv, createNS */
+
+function HTextElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.textPaths = [];
+  this.currentBBox = {
+    x: 999999,
+    y: -999999,
+    h: 0,
+    w: 0,
+  };
+  this.renderType = 'svg';
+  this.isMasked = false;
+  this.initElement(data, globalData, comp);
+}
+extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement);
+
+HTextElement.prototype.createContent = function () {
+  this.isMasked = this.checkMasks();
+  if (this.isMasked) {
     this.renderType = 'svg';
-    this.isMasked = false;
-    this.initElement(data,globalData,comp);
+    this.compW = this.comp.data.w;
+    this.compH = this.comp.data.h;
+    this.svgElement.setAttribute('width', this.compW);
+    this.svgElement.setAttribute('height', this.compH);
+    var g = createNS('g');
+    this.maskedElement.appendChild(g);
+    this.innerElem = g;
+  } else {
+    this.renderType = 'html';
+    this.innerElem = this.layerElement;
+  }
 
-}
-extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], HTextElement);
-
-HTextElement.prototype.createContent = function(){
-    this.isMasked = this.checkMasks();
-    if(this.isMasked){
-        this.renderType = 'svg';
-        this.compW = this.comp.data.w;
-        this.compH = this.comp.data.h;
-        this.svgElement.setAttribute('width',this.compW);
-        this.svgElement.setAttribute('height',this.compH);
-        var g = createNS('g');
-        this.maskedElement.appendChild(g);
-        this.innerElem = g;
-    } else {
-        this.renderType = 'html';
-        this.innerElem = this.layerElement;
-    }
-
-    this.checkParenting();
-
+  this.checkParenting();
 };
 
-HTextElement.prototype.buildNewText = function(){
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
-    var innerElemStyle = this.innerElem.style;
-    innerElemStyle.color = innerElemStyle.fill = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
-    if(documentData.sc){
-        innerElemStyle.stroke = this.buildColor(documentData.sc);
-        innerElemStyle.strokeWidth = documentData.sw+'px';
+HTextElement.prototype.buildNewText = function () {
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
+  var innerElemStyle = this.innerElem.style;
+  var textColor = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
+  innerElemStyle.fill = textColor;
+  innerElemStyle.color = textColor;
+  if (documentData.sc) {
+    innerElemStyle.stroke = this.buildColor(documentData.sc);
+    innerElemStyle.strokeWidth = documentData.sw + 'px';
+  }
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  if (!this.globalData.fontManager.chars) {
+    innerElemStyle.fontSize = documentData.finalSize + 'px';
+    innerElemStyle.lineHeight = documentData.finalSize + 'px';
+    if (fontData.fClass) {
+      this.innerElem.className = fontData.fClass;
+    } else {
+      innerElemStyle.fontFamily = fontData.fFamily;
+      var fWeight = documentData.fWeight;
+      var fStyle = documentData.fStyle;
+      innerElemStyle.fontStyle = fStyle;
+      innerElemStyle.fontWeight = fWeight;
     }
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(!this.globalData.fontManager.chars){
-        innerElemStyle.fontSize = documentData.finalSize+'px';
-        innerElemStyle.lineHeight = documentData.finalSize+'px';
-        if(fontData.fClass){
-            this.innerElem.className = fontData.fClass;
+  }
+  var i;
+  var len;
+
+  var letters = documentData.l;
+  len = letters.length;
+  var tSpan;
+  var tParent;
+  var tCont;
+  var matrixHelper = this.mHelper;
+  var shapes;
+  var shapeStr = '';
+  var cnt = 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.globalData.fontManager.chars) {
+      if (!this.textPaths[cnt]) {
+        tSpan = createNS('path');
+        tSpan.setAttribute('stroke-linecap', 'butt');
+        tSpan.setAttribute('stroke-linejoin', 'round');
+        tSpan.setAttribute('stroke-miterlimit', '4');
+      } else {
+        tSpan = this.textPaths[cnt];
+      }
+      if (!this.isMasked) {
+        if (this.textSpans[cnt]) {
+          tParent = this.textSpans[cnt];
+          tCont = tParent.children[0];
         } else {
-            innerElemStyle.fontFamily = fontData.fFamily;
-            var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-            innerElemStyle.fontStyle = fStyle;
-            innerElemStyle.fontWeight = fWeight;
+          tParent = createTag('div');
+          tParent.style.lineHeight = 0;
+          tCont = createNS('svg');
+          tCont.appendChild(tSpan);
+          styleDiv(tParent);
         }
+      }
+    } else if (!this.isMasked) {
+      if (this.textSpans[cnt]) {
+        tParent = this.textSpans[cnt];
+        tSpan = this.textPaths[cnt];
+      } else {
+        tParent = createTag('span');
+        styleDiv(tParent);
+        tSpan = createTag('span');
+        styleDiv(tSpan);
+        tParent.appendChild(tSpan);
+      }
+    } else {
+      tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
     }
-    var i, len;
+    // tSpan.setAttribute('visibility', 'hidden');
+    if (this.globalData.fontManager.chars) {
+      var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+      var shapeData;
+      if (charData) {
+        shapeData = charData.data;
+      } else {
+        shapeData = null;
+      }
+      matrixHelper.reset();
+      if (shapeData && shapeData.shapes) {
+        shapes = shapeData.shapes[0].it;
+        matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+        shapeStr = this.createPathShape(matrixHelper, shapes);
+        tSpan.setAttribute('d', shapeStr);
+      }
+      if (!this.isMasked) {
+        this.innerElem.appendChild(tParent);
+        if (shapeData && shapeData.shapes) {
+          // document.body.appendChild is needed to get exact measure of shape
+          document.body.appendChild(tCont);
+          var boundingBox = tCont.getBBox();
+          tCont.setAttribute('width', boundingBox.width + 2);
+          tCont.setAttribute('height', boundingBox.height + 2);
+          tCont.setAttribute('viewBox', (boundingBox.x - 1) + ' ' + (boundingBox.y - 1) + ' ' + (boundingBox.width + 2) + ' ' + (boundingBox.height + 2));
+          var tContStyle = tCont.style;
+          var tContTranslation = 'translate(' + (boundingBox.x - 1) + 'px,' + (boundingBox.y - 1) + 'px)';
+          tContStyle.transform = tContTranslation;
+          tContStyle.webkitTransform = tContTranslation;
 
-    var letters = documentData.l;
-    len = letters.length;
-    var tSpan,tParent,tCont;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '';
-    var cnt = 0;
-    for (i = 0;i < len ;i += 1) {
-        if(this.globalData.fontManager.chars){
-            if(!this.textPaths[cnt]){
-                tSpan = createNS('path');
-                tSpan.setAttribute('stroke-linecap', 'butt');
-                tSpan.setAttribute('stroke-linejoin','round');
-                tSpan.setAttribute('stroke-miterlimit','4');
-            } else {
-                tSpan = this.textPaths[cnt];
-            }
-            if(!this.isMasked){
-                if(this.textSpans[cnt]){
-                    tParent = this.textSpans[cnt];
-                    tCont = tParent.children[0];
-                } else {
-
-                    tParent = createTag('div');
-                    tParent.style.lineHeight = 0;
-                    tCont = createNS('svg');
-                    tCont.appendChild(tSpan);
-                    styleDiv(tParent);
-                }
-            }
-        }else{
-            if(!this.isMasked){
-                if(this.textSpans[cnt]){
-                    tParent = this.textSpans[cnt];
-                    tSpan = this.textPaths[cnt];
-                } else {
-                    tParent = createTag('span');
-                    styleDiv(tParent);
-                    tSpan = createTag('span');
-                    styleDiv(tSpan);
-                    tParent.appendChild(tSpan);
-                }
-            } else {
-                tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
-            }
+          letters[i].yOffset = boundingBox.y - 1;
+        } else {
+          tCont.setAttribute('width', 1);
+          tCont.setAttribute('height', 1);
         }
-        //tSpan.setAttribute('visibility', 'hidden');
-        if(this.globalData.fontManager.chars){
-            var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-            var shapeData;
-            if(charData){
-                shapeData = charData.data;
-            } else {
-                shapeData = null;
-            }
-            matrixHelper.reset();
-            if(shapeData && shapeData.shapes){
-                shapes = shapeData.shapes[0].it;
-                matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
-                shapeStr = this.createPathShape(matrixHelper,shapes);
-                tSpan.setAttribute('d',shapeStr);
-            }
-            if(!this.isMasked){
-                this.innerElem.appendChild(tParent);
-                if(shapeData && shapeData.shapes){
-
-                    //document.body.appendChild is needed to get exact measure of shape
-                    document.body.appendChild(tCont);
-                    var boundingBox = tCont.getBBox();
-                    tCont.setAttribute('width',boundingBox.width + 2);
-                    tCont.setAttribute('height',boundingBox.height + 2);
-                    tCont.setAttribute('viewBox',(boundingBox.x-1)+' '+ (boundingBox.y-1)+' '+ (boundingBox.width+2)+' '+ (boundingBox.height+2));
-                    tCont.style.transform = tCont.style.webkitTransform = 'translate(' + (boundingBox.x-1) + 'px,' + (boundingBox.y-1) + 'px)';
-
-                    letters[i].yOffset = boundingBox.y-1;
-
-                } else{
-                    tCont.setAttribute('width',1);
-                    tCont.setAttribute('height',1);
-                }
-                    tParent.appendChild(tCont);
-            }else{
-                this.innerElem.appendChild(tSpan);
-            }
-        }else{
-            tSpan.textContent = letters[i].val;
-            tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            if(!this.isMasked){
-                this.innerElem.appendChild(tParent);
-                //
-                tSpan.style.transform = tSpan.style.webkitTransform = 'translate3d(0,'+ -documentData.finalSize/1.2+'px,0)';
-            } else {
-                this.innerElem.appendChild(tSpan);
-            }
-        }
+        tParent.appendChild(tCont);
+      } else {
+        this.innerElem.appendChild(tSpan);
+      }
+    } else {
+      tSpan.textContent = letters[i].val;
+      tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
+      if (!this.isMasked) {
+        this.innerElem.appendChild(tParent);
         //
-        if(!this.isMasked){
-            this.textSpans[cnt] = tParent;
-        }else{
-            this.textSpans[cnt] = tSpan;
-        }
-        this.textSpans[cnt].style.display = 'block';
-        this.textPaths[cnt] = tSpan;
-        cnt += 1;
+        var tStyle = tSpan.style;
+        var tSpanTranslation = 'translate3d(0,' + -documentData.finalSize / 1.2 + 'px,0)';
+        tStyle.transform = tSpanTranslation;
+        tStyle.webkitTransform = tSpanTranslation;
+      } else {
+        this.innerElem.appendChild(tSpan);
+      }
     }
-    while(cnt < this.textSpans.length){
-        this.textSpans[cnt].style.display = 'none';
-        cnt += 1;
+    //
+    if (!this.isMasked) {
+      this.textSpans[cnt] = tParent;
+    } else {
+      this.textSpans[cnt] = tSpan;
     }
+    this.textSpans[cnt].style.display = 'block';
+    this.textPaths[cnt] = tSpan;
+    cnt += 1;
+  }
+  while (cnt < this.textSpans.length) {
+    this.textSpans[cnt].style.display = 'none';
+    cnt += 1;
+  }
 };
 
-HTextElement.prototype.renderInnerContent = function() {
+HTextElement.prototype.renderInnerContent = function () {
+  var svgStyle;
+  if (this.data.singleShape) {
+    if (!this._isFirstFrame && !this.lettersChangedFlag) {
+      return;
+    } if (this.isMasked && this.finalTransform._matMdf) {
+      // Todo Benchmark if using this is better than getBBox
+      this.svgElement.setAttribute('viewBox', -this.finalTransform.mProp.p.v[0] + ' ' + -this.finalTransform.mProp.p.v[1] + ' ' + this.compW + ' ' + this.compH);
+      svgStyle = this.svgElement.style;
+      var translation = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
+      svgStyle.transform = translation;
+      svgStyle.webkitTransform = translation;
+    }
+  }
 
-    if(this.data.singleShape){
-        if(!this._isFirstFrame && !this.lettersChangedFlag){
-            return;
+  this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  if (!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag) {
+    return;
+  }
+  var i;
+  var len;
+  var count = 0;
+  var renderedLetters = this.textAnimator.renderedLetters;
+
+  var letters = this.textProperty.currentData.l;
+
+  len = letters.length;
+  var renderedLetter;
+  var textSpan;
+  var textPath;
+  for (i = 0; i < len; i += 1) {
+    if (letters[i].n) {
+      count += 1;
+    } else {
+      textSpan = this.textSpans[i];
+      textPath = this.textPaths[i];
+      renderedLetter = renderedLetters[count];
+      count += 1;
+      if (renderedLetter._mdf.m) {
+        if (!this.isMasked) {
+          textSpan.style.webkitTransform = renderedLetter.m;
+          textSpan.style.transform = renderedLetter.m;
         } else {
-            // Todo Benchmark if using this is better than getBBox
-             if(this.isMasked && this.finalTransform._matMdf){
-                 this.svgElement.setAttribute('viewBox',-this.finalTransform.mProp.p.v[0]+' '+ -this.finalTransform.mProp.p.v[1]+' '+this.compW+' '+this.compH);
-                this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
-             }
+          textSpan.setAttribute('transform', renderedLetter.m);
         }
+      }
+      /// /textSpan.setAttribute('opacity',renderedLetter.o);
+      textSpan.style.opacity = renderedLetter.o;
+      if (renderedLetter.sw && renderedLetter._mdf.sw) {
+        textPath.setAttribute('stroke-width', renderedLetter.sw);
+      }
+      if (renderedLetter.sc && renderedLetter._mdf.sc) {
+        textPath.setAttribute('stroke', renderedLetter.sc);
+      }
+      if (renderedLetter.fc && renderedLetter._mdf.fc) {
+        textPath.setAttribute('fill', renderedLetter.fc);
+        textPath.style.color = renderedLetter.fc;
+      }
+    }
+  }
+
+  if (this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)) {
+    var boundingBox = this.innerElem.getBBox();
+
+    if (this.currentBBox.w !== boundingBox.width) {
+      this.currentBBox.w = boundingBox.width;
+      this.svgElement.setAttribute('width', boundingBox.width);
+    }
+    if (this.currentBBox.h !== boundingBox.height) {
+      this.currentBBox.h = boundingBox.height;
+      this.svgElement.setAttribute('height', boundingBox.height);
     }
 
-    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
-    if(!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag){
-        return;
+    var margin = 1;
+    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)) {
+      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;
+
+      this.svgElement.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
+      svgStyle = this.svgElement.style;
+      var svgTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
+      svgStyle.transform = svgTransform;
+      svgStyle.webkitTransform = svgTransform;
     }
-    var  i,len, count = 0;
-    var renderedLetters = this.textAnimator.renderedLetters;
-
-    var letters = this.textProperty.currentData.l;
-
-    len = letters.length;
-    var renderedLetter, textSpan, textPath;
-    for(i=0;i<len;i+=1){
-        if(letters[i].n){
-            count += 1;
-            continue;
-        }
-        textSpan = this.textSpans[i];
-        textPath = this.textPaths[i];
-        renderedLetter = renderedLetters[count];
-        count += 1;
-        if(renderedLetter._mdf.m) {
-            if(!this.isMasked){
-                textSpan.style.transform = textSpan.style.webkitTransform = renderedLetter.m;
-            }else{
-                textSpan.setAttribute('transform',renderedLetter.m);
-            }
-        }
-        ////textSpan.setAttribute('opacity',renderedLetter.o);
-        textSpan.style.opacity = renderedLetter.o;
-        if(renderedLetter.sw && renderedLetter._mdf.sw){
-            textPath.setAttribute('stroke-width',renderedLetter.sw);
-        }
-        if(renderedLetter.sc && renderedLetter._mdf.sc){
-            textPath.setAttribute('stroke',renderedLetter.sc);
-        }
-        if(renderedLetter.fc && renderedLetter._mdf.fc){
-            textPath.setAttribute('fill',renderedLetter.fc);
-            textPath.style.color = renderedLetter.fc;
-        }
-    }
-
-    if(this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)){
-        var boundingBox = this.innerElem.getBBox();
-
-        if(this.currentBBox.w !== boundingBox.width){
-            this.currentBBox.w = boundingBox.width;
-            this.svgElement.setAttribute('width',boundingBox.width);
-        }
-        if(this.currentBBox.h !== boundingBox.height){
-            this.currentBBox.h = boundingBox.height;
-            this.svgElement.setAttribute('height',boundingBox.height);
-        }
-
-        var margin = 1;
-        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)){
-            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;
-
-            this.svgElement.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
-            this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
-        }
-    }
+  }
 };
-function HImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement,
+FrameElement, RenderableElement, createNS */
+
+function HImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement], HImageElement);
+extendPrototype([BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement);
 
+HImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  var img = new Image();
 
-HImageElement.prototype.createContent = function(){
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
-    var img = new Image();
-
-    if(this.data.hasMask){
-        this.imageElem = createNS('image');
-        this.imageElem.setAttribute('width',this.assetData.w+"px");
-        this.imageElem.setAttribute('height',this.assetData.h+"px");
-        this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-        this.layerElement.appendChild(this.imageElem);
-        this.baseElement.setAttribute('width',this.assetData.w);
-        this.baseElement.setAttribute('height',this.assetData.h);
-    } else {
-        this.layerElement.appendChild(img);
-    }
-    img.crossOrigin = 'anonymous';
-    img.src = assetPath;
-    if(this.data.ln){
-        this.baseElement.setAttribute('id',this.data.ln);
-    }
+  if (this.data.hasMask) {
+    this.imageElem = createNS('image');
+    this.imageElem.setAttribute('width', this.assetData.w + 'px');
+    this.imageElem.setAttribute('height', this.assetData.h + 'px');
+    this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
+    this.layerElement.appendChild(this.imageElem);
+    this.baseElement.setAttribute('width', this.assetData.w);
+    this.baseElement.setAttribute('height', this.assetData.h);
+  } else {
+    this.layerElement.appendChild(img);
+  }
+  img.crossOrigin = 'anonymous';
+  img.src = assetPath;
+  if (this.data.ln) {
+    this.baseElement.setAttribute('id', this.data.ln);
+  }
 };
-function HCameraElement(data,globalData,comp){
-    this.initFrame();
-    this.initBaseData(data,globalData,comp);
-    this.initHierarchy();
-    var getProp = PropertyFactory.getProp;
-    this.pe = getProp(this,data.pe,0,0,this);
-    if(data.ks.p.s){
-        this.px = getProp(this,data.ks.p.x,1,0,this);
-        this.py = getProp(this,data.ks.p.y,1,0,this);
-        this.pz = getProp(this,data.ks.p.z,1,0,this);
-    }else{
-        this.p = getProp(this,data.ks.p,1,0,this);
+
+/* global PropertyFactory, degToRads, Matrix, extendPrototype, BaseElement, FrameElement, HierarchyElement */
+
+function HCameraElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initHierarchy();
+  var getProp = PropertyFactory.getProp;
+  this.pe = getProp(this, data.pe, 0, 0, this);
+  if (data.ks.p.s) {
+    this.px = getProp(this, data.ks.p.x, 1, 0, this);
+    this.py = getProp(this, data.ks.p.y, 1, 0, this);
+    this.pz = getProp(this, data.ks.p.z, 1, 0, this);
+  } else {
+    this.p = getProp(this, data.ks.p, 1, 0, this);
+  }
+  if (data.ks.a) {
+    this.a = getProp(this, data.ks.a, 1, 0, this);
+  }
+  if (data.ks.or.k.length && data.ks.or.k[0].to) {
+    var i;
+    var len = data.ks.or.k.length;
+    for (i = 0; i < len; i += 1) {
+      data.ks.or.k[i].to = null;
+      data.ks.or.k[i].ti = null;
     }
-    if(data.ks.a){
-        this.a = getProp(this,data.ks.a,1,0,this);
-    }
-    if(data.ks.or.k.length && data.ks.or.k[0].to){
-        var i,len = data.ks.or.k.length;
-        for(i=0;i<len;i+=1){
-            data.ks.or.k[i].to = null;
-            data.ks.or.k[i].ti = null;
-        }
-    }
-    this.or = getProp(this,data.ks.or,1,degToRads,this);
-    this.or.sh = true;
-    this.rx = getProp(this,data.ks.rx,0,degToRads,this);
-    this.ry = getProp(this,data.ks.ry,0,degToRads,this);
-    this.rz = getProp(this,data.ks.rz,0,degToRads,this);
-    this.mat = new Matrix();
-    this._prevMat = new Matrix();
-    this._isFirstFrame = true;
-    
-    // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
-    this.finalTransform = {
-        mProp: this
-    };
+  }
+  this.or = getProp(this, data.ks.or, 1, degToRads, this);
+  this.or.sh = true;
+  this.rx = getProp(this, data.ks.rx, 0, degToRads, this);
+  this.ry = getProp(this, data.ks.ry, 0, degToRads, this);
+  this.rz = getProp(this, data.ks.rz, 0, degToRads, this);
+  this.mat = new Matrix();
+  this._prevMat = new Matrix();
+  this._isFirstFrame = true;
+
+  // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
+  this.finalTransform = {
+    mProp: this,
+  };
 }
 extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement);
 
-HCameraElement.prototype.setup = function() {
-    var i, len = this.comp.threeDElements.length, comp;
-    for(i=0;i<len;i+=1){
-        //[perspectiveElem,container]
+HCameraElement.prototype.setup = function () {
+  var i;
+  var len = this.comp.threeDElements.length;
+  var comp;
+  var perspectiveStyle;
+  var containerStyle;
+  for (i = 0; i < len; i += 1) {
+    // [perspectiveElem,container]
+    comp = this.comp.threeDElements[i];
+    if (comp.type === '3d') {
+      perspectiveStyle = comp.perspectiveElem.style;
+      containerStyle = comp.container.style;
+      var perspective = this.pe.v + 'px';
+      var origin = '0px 0px 0px';
+      var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+      perspectiveStyle.perspective = perspective;
+      perspectiveStyle.webkitPerspective = perspective;
+      containerStyle.transformOrigin = origin;
+      containerStyle.mozTransformOrigin = origin;
+      containerStyle.webkitTransformOrigin = origin;
+      perspectiveStyle.transform = matrix;
+      perspectiveStyle.webkitTransform = matrix;
+    }
+  }
+};
+
+HCameraElement.prototype.createElements = function () {
+};
+
+HCameraElement.prototype.hide = function () {
+};
+
+HCameraElement.prototype.renderFrame = function () {
+  var _mdf = this._isFirstFrame;
+  var i;
+  var len;
+  if (this.hierarchy) {
+    len = this.hierarchy.length;
+    for (i = 0; i < len; i += 1) {
+      _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
+    }
+  }
+  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)) {
+    this.mat.reset();
+
+    if (this.hierarchy) {
+      len = this.hierarchy.length - 1;
+      for (i = len; i >= 0; i -= 1) {
+        var mTransf = this.hierarchy[i].finalTransform.mProp;
+        this.mat.translate(-mTransf.p.v[0], -mTransf.p.v[1], mTransf.p.v[2]);
+        this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
+        this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
+        this.mat.scale(1 / mTransf.s.v[0], 1 / mTransf.s.v[1], 1 / mTransf.s.v[2]);
+        this.mat.translate(mTransf.a.v[0], mTransf.a.v[1], mTransf.a.v[2]);
+      }
+    }
+    if (this.p) {
+      this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]);
+    } else {
+      this.mat.translate(-this.px.v, -this.py.v, this.pz.v);
+    }
+    if (this.a) {
+      var diffVector;
+      if (this.p) {
+        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]];
+      } else {
+        diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
+      }
+      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));
+      var lookDir = [diffVector[0] / mag, diffVector[1] / mag, diffVector[2] / mag];
+      var lookLengthOnXZ = Math.sqrt(lookDir[2] * lookDir[2] + lookDir[0] * lookDir[0]);
+      var mRotationX = (Math.atan2(lookDir[1], lookLengthOnXZ));
+      var mRotationY = (Math.atan2(lookDir[0], -lookDir[2]));
+      this.mat.rotateY(mRotationY).rotateX(-mRotationX);
+    }
+    this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
+    this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
+    this.mat.translate(this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0);
+    this.mat.translate(0, 0, this.pe.v);
+
+    var hasMatrixChanged = !this._prevMat.equals(this.mat);
+    if ((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
+      len = this.comp.threeDElements.length;
+      var comp;
+      var perspectiveStyle;
+      var containerStyle;
+      for (i = 0; i < len; i += 1) {
         comp = this.comp.threeDElements[i];
-        if(comp.type === '3d') {
-            comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
-            comp.container.style.transformOrigin = comp.container.style.mozTransformOrigin = comp.container.style.webkitTransformOrigin = "0px 0px 0px";
-            comp.perspectiveElem.style.transform = comp.perspectiveElem.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+        if (comp.type === '3d') {
+          if (hasMatrixChanged) {
+            var matValue = this.mat.toCSS();
+            containerStyle = comp.container.style;
+            containerStyle.transform = matValue;
+            containerStyle.webkitTransform = matValue;
+          }
+          if (this.pe._mdf) {
+            perspectiveStyle = comp.perspectiveElem.style;
+            perspectiveStyle.perspective = this.pe.v + 'px';
+            perspectiveStyle.webkitPerspective = this.pe.v + 'px';
+          }
         }
+      }
+      this.mat.clone(this._prevMat);
     }
+  }
+  this._isFirstFrame = false;
 };
 
-HCameraElement.prototype.createElements = function(){
+HCameraElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-HCameraElement.prototype.hide = function(){
+HCameraElement.prototype.destroy = function () {
 };
+HCameraElement.prototype.getBaseElement = function () { return null; };
 
-HCameraElement.prototype.renderFrame = function(){
-    var _mdf = this._isFirstFrame;
-    var i, len;
-    if(this.hierarchy){
-        len = this.hierarchy.length;
-        for(i=0;i<len;i+=1){
-            _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
-        }
-    }
-    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)) {
-        this.mat.reset();
-
-        if(this.hierarchy){
-            var mat;
-            len = this.hierarchy.length - 1;
-            for (i = len; i >= 0; i -= 1) {
-                var mTransf = this.hierarchy[i].finalTransform.mProp;
-                this.mat.translate(-mTransf.p.v[0],-mTransf.p.v[1],mTransf.p.v[2]);
-                this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
-                this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
-                this.mat.scale(1/mTransf.s.v[0],1/mTransf.s.v[1],1/mTransf.s.v[2]);
-                this.mat.translate(mTransf.a.v[0],mTransf.a.v[1],mTransf.a.v[2]);
-            }
-        }
-        if (this.p) {
-            this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]);
-        } else {
-            this.mat.translate(-this.px.v,-this.py.v,this.pz.v);
-        }
-        if (this.a) {
-            var diffVector
-            if (this.p) {
-                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]];
-            } else {
-                diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
-            }
-            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));
-            var lookDir = [diffVector[0]/mag,diffVector[1]/mag,diffVector[2]/mag];
-            var lookLengthOnXZ = Math.sqrt( lookDir[2]*lookDir[2] + lookDir[0]*lookDir[0] );
-            var m_rotationX = (Math.atan2( lookDir[1], lookLengthOnXZ ));
-            var m_rotationY = (Math.atan2( lookDir[0], -lookDir[2]));
-            this.mat.rotateY(m_rotationY).rotateX(-m_rotationX);
-
-        }
-        this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
-        this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
-        this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0);
-        this.mat.translate(0,0,this.pe.v);
-
-
-        
-
-        var hasMatrixChanged = !this._prevMat.equals(this.mat);
-        if((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
-            len = this.comp.threeDElements.length;
-            var comp;
-            for(i=0;i<len;i+=1){
-                comp = this.comp.threeDElements[i];
-                if(comp.type === '3d') {
-                    if(hasMatrixChanged) {
-                        comp.container.style.transform = comp.container.style.webkitTransform = this.mat.toCSS();
-                    }
-                    if(this.pe._mdf) {
-                        comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
-                    }
-                }
-            }
-            this.mat.clone(this._prevMat);
-        }
-    }
-    this._isFirstFrame = false;
-};
-
-HCameraElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
-};
-
-HCameraElement.prototype.destroy = function(){
-};
-HCameraElement.prototype.getBaseElement = function(){return null;};
 function HEffects() {
 }
-HEffects.prototype.renderFrame = function(){};
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
+HEffects.prototype.renderFrame = function () {};
 
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+/* global createTag, AnimationItem */
+/* exported animationManager */
+
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
+    while (i < len) {
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      window.requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            window.requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    window.requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        window.requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations(animationData, standalone, renderer) {
+    var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+      [].slice.call(document.getElementsByClassName('bodymovin')));
+    var i;
+    var lenAnims = animElements.length;
+    for (i = 0; i < lenAnims; i += 1) {
+      if (renderer) {
+        animElements[i].setAttribute('data-bm-type', renderer);
+      }
+      registerAnimation(animElements[i], animationData);
     }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
-                  [].slice.call(document.getElementsByClassName('bodymovin')));
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerText = '';
-            var div = createTag('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
+    if (standalone && lenAnims === 0) {
+      if (!renderer) {
+        renderer = 'svg';
+      }
+      var body = document.getElementsByTagName('body')[0];
+      body.innerText = '';
+      var div = createTag('div');
+      div.style.width = '100%';
+      div.style.height = '100%';
+      div.setAttribute('data-bm-type', renderer);
+      body.appendChild(div);
+      registerAnimation(div, animationData);
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                window.requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        window.requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function freeze() {
-        _isFrozen = true;
+  function freeze() {
+    _isFrozen = true;
+  }
+
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
+
+  function setVolume(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setVolume(val, animation);
     }
+  }
 
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
+  function mute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.mute(animation);
     }
+  }
 
-    function setVolume(val,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setVolume(val, animation);
-        }
+  function unmute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.unmute(animation);
     }
+  }
 
-    function mute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.mute(animation);
-        }
-    }
-
-    function unmute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.unmute(animation);
-        }
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.setVolume = setVolume;
-    moduleOb.mute = mute;
-    moduleOb.unmute = unmute;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.setVolume = setVolume;
+  moduleOb.mute = mute;
+  moduleOb.unmute = unmute;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
+/* global createElementID, subframeEnabled, ProjectInterface, ImagePreloader, audioControllerFactory, extendPrototype, BaseEvent,
+CanvasRenderer, SVGRenderer, HybridRenderer, assetLoader, dataManager, expressionsPlugin, BMEnterFrameEvent, BMCompleteLoopEvent,
+BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent,
+BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent */
+
 var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.firstFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.playCount = 0;
-    this.animationData = {};
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = createElementID();
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.isSubframeEnabled = subframeEnabled;
-    this.segments = [];
-    this._idle = true;
-    this._completedLoop = false;
-    this.projectInterface = ProjectInterface();
-    this.imagePreloader = new ImagePreloader();
-    this.audioController = audioControllerFactory();
+  this._cbs = [];
+  this.name = '';
+  this.path = '';
+  this.isLoaded = false;
+  this.currentFrame = 0;
+  this.currentRawFrame = 0;
+  this.firstFrame = 0;
+  this.totalFrames = 0;
+  this.frameRate = 0;
+  this.frameMult = 0;
+  this.playSpeed = 1;
+  this.playDirection = 1;
+  this.playCount = 0;
+  this.animationData = {};
+  this.assets = [];
+  this.isPaused = true;
+  this.autoplay = false;
+  this.loop = true;
+  this.renderer = null;
+  this.animationID = createElementID();
+  this.assetsPath = '';
+  this.timeCompleted = 0;
+  this.segmentPos = 0;
+  this.isSubframeEnabled = subframeEnabled;
+  this.segments = [];
+  this._idle = true;
+  this._completedLoop = false;
+  this.projectInterface = ProjectInterface();
+  this.imagePreloader = new ImagePreloader();
+  this.audioController = audioControllerFactory();
 };
 
 extendPrototype([BaseEvent], AnimationItem);
 
-AnimationItem.prototype.setParams = function(params) {
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-    if (params.loop === ''
+AnimationItem.prototype.setParams = function (params) {
+  if (params.wrapper || params.container) {
+    this.wrapper = params.wrapper || params.container;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    case 'svg':
+      this.renderer = new SVGRenderer(this, params.rendererSettings);
+      break;
+    default:
+      this.renderer = new HybridRenderer(this, params.rendererSettings);
+      break;
+  }
+  this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+  if (params.loop === ''
         || params.loop === null
         || params.loop === undefined
-        || params.loop === true)
-    {
-        this.loop = true;
-    } else if (params.loop === false) {
-        this.loop = false;
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = params.assetsPath;
+  this.initialSegment = params.initialSegment;
+  if (params.audioFactory) {
+    this.audioController.setAudioFactory(params.audioFactory);
+  }
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    if (params.path.lastIndexOf('\\') !== -1) {
+      this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
     } else {
-        this.loop = parseInt(params.loop);
+      this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
     }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = params.assetsPath;
-    this.initialSegment = params.initialSegment;
-    if (params.audioFactory) {
-        this.audioController.setAudioFactory(params.audioFactory);
-    }
-    if (params.animationData) {
-        this.configAnimation(params.animationData);
-    } else if(params.path){
+    this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
+    this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
 
-        if( params.path.lastIndexOf('\\') !== -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        } else {
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-
-        assetLoader.load(params.path, this.configAnimation.bind(this), function() {
-            this.trigger('data_failed');
-        }.bind(this));
-    }
-
+    assetLoader.load(params.path, this.configAnimation.bind(this), function () {
+      this.trigger('data_failed');
+    }.bind(this));
+  }
 };
 
 AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
+  if (animationData) {
+    if (typeof animationData !== 'object') {
+      animationData = JSON.parse(animationData);
     }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
+  }
+  var params = {
+    wrapper: wrapper,
+    animationData: animationData,
+  };
+  var wrapperAttributes = wrapper.attributes;
 
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
+  params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-animation-path').value
+    : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-path').value
+      : wrapperAttributes.getNamedItem('bm-path')
+        ? wrapperAttributes.getNamedItem('bm-path').value
+        : '';
+  params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-type').value
+    : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-type').value
+      : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
+        ? wrapperAttributes.getNamedItem('bm-type').value
+        : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
+          ? wrapperAttributes.getNamedItem('data-bm-renderer').value
+          : wrapperAttributes.getNamedItem('bm-renderer')
+            ? wrapperAttributes.getNamedItem('bm-renderer').value
+            : 'canvas';
 
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
+  var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-loop').value
+    : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-loop').value
+      : wrapperAttributes.getNamedItem('bm-loop')
+        ? wrapperAttributes.getNamedItem('bm-loop').value
+        : '';
+  if (loop === 'false') {
+    params.loop = false;
+  } else if (loop === 'true') {
+    params.loop = true;
+  } else if (loop !== '') {
+    params.loop = parseInt(loop, 10);
+  }
+  var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-autoplay').value
+    : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-autoplay').value
+      : wrapperAttributes.getNamedItem('bm-autoplay')
+        ? wrapperAttributes.getNamedItem('bm-autoplay').value
+        : true;
+  params.autoplay = autoplay !== 'false';
+
+  params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-name').value
+    : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-name').value
+      : wrapperAttributes.getNamedItem('bm-name')
+        ? wrapperAttributes.getNamedItem('bm-name').value
+        : '';
+  var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-prerender').value
+    : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-prerender').value
+      : wrapperAttributes.getNamedItem('bm-prerender')
+        ? wrapperAttributes.getNamedItem('bm-prerender').value
+        : '';
+
+  if (prerender === 'false') {
+    params.prerender = false;
+  }
+  this.setParams(params);
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
+  }
+  if (data.chars || data.fonts) {
+    this.renderer.globalData.fontManager.addChars(data.chars);
+    this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
+  }
+  if (data.assets) {
+    len = data.assets.length;
+    for (i = 0; i < len; i += 1) {
+      this.animationData.assets.push(data.assets[i]);
     }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
-        this.trigger('data_failed');
-    }.bind(this));
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.trigger('data_ready');
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  var segment = segments.shift();
+  this.timeCompleted = segment.time * this.frameRate;
+  var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
+  this.segmentPos += 1;
+  assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
+    this.trigger('data_failed');
+  }.bind(this));
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
-    }
-    this.loadNextSegment();
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.imagesLoaded = function() {
-    this.trigger('loaded_images');
-    this.checkLoaded()
-}
+AnimationItem.prototype.imagesLoaded = function () {
+  this.trigger('loaded_images');
+  this.checkLoaded();
+};
 
-AnimationItem.prototype.preloadImages = function() {
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
-}
+AnimationItem.prototype.preloadImages = function () {
+  this.imagePreloader.setAssetsPath(this.assetsPath);
+  this.imagePreloader.setPath(this.path);
+  this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
+};
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    try {
-        this.animationData = animData;
+  if (!this.renderer) {
+    return;
+  }
+  try {
+    this.animationData = animData;
 
-        if (this.initialSegment) {
-            this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
-            this.firstFrame = Math.round(this.initialSegment[0]);
-        } else {
-            this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-            this.firstFrame = Math.round(this.animationData.ip);
-        }
-        this.renderer.configAnimation(animData);
-        if(!animData.assets){
-            animData.assets = [];
-        }
-
-        this.assets = this.animationData.assets;
-        this.frameRate = this.animationData.fr;
-        this.frameMult = this.animationData.fr / 1000;
-        this.renderer.searchExtraCompositions(animData.assets);
-        this.trigger('config_ready');
-        this.preloadImages();
-        this.loadSegments();
-        this.updaFrameModifier();
-        this.waitForFontsLoaded();
-        if (this.isPaused) {
-            this.audioController.pause();
-        }
-    } catch(error) {
-        this.triggerConfigError(error);
+    if (this.initialSegment) {
+      this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+      this.firstFrame = Math.round(this.initialSegment[0]);
+    } else {
+      this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+      this.firstFrame = Math.round(this.animationData.ip);
     }
+    this.renderer.configAnimation(animData);
+    if (!animData.assets) {
+      animData.assets = [];
+    }
+
+    this.assets = this.animationData.assets;
+    this.frameRate = this.animationData.fr;
+    this.frameMult = this.animationData.fr / 1000;
+    this.renderer.searchExtraCompositions(animData.assets);
+    this.trigger('config_ready');
+    this.preloadImages();
+    this.loadSegments();
+    this.updaFrameModifier();
+    this.waitForFontsLoaded();
+    if (this.isPaused) {
+      this.audioController.pause();
+    }
+  } catch (error) {
+    this.triggerConfigError(error);
+  }
 };
 
-AnimationItem.prototype.waitForFontsLoaded = function(){
-    if(!this.renderer) {
-        return;
-    }
-    if(this.renderer.globalData.fontManager.isLoaded){
-        this.checkLoaded();
-    }else{
-        setTimeout(this.waitForFontsLoaded.bind(this),20);
-    }
-}
+AnimationItem.prototype.waitForFontsLoaded = function () {
+  if (!this.renderer) {
+    return;
+  }
+  if (this.renderer.globalData.fontManager.isLoaded) {
+    this.checkLoaded();
+  } else {
+    setTimeout(this.waitForFontsLoaded.bind(this), 20);
+  }
+};
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded 
+  if (!this.isLoaded
         && this.renderer.globalData.fontManager.isLoaded
         && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')
-    ) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function() {
-            this.trigger('DOMLoaded');
-        }.bind(this), 0);
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
+  ) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    setTimeout(function () {
+      this.trigger('DOMLoaded');
+    }.bind(this), 0);
+    this.gotoFrame();
+    if (this.autoplay) {
+      this.play();
+    }
+  }
 };
 
 AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
+  this.renderer.updateContainerSize();
 };
 
-AnimationItem.prototype.setSubframe = function(flag){
-    this.isSubframeEnabled = !!flag;
+AnimationItem.prototype.setSubframe = function (flag) {
+  this.isSubframeEnabled = !!flag;
 };
 
 AnimationItem.prototype.gotoFrame = function () {
-    this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
+  this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
 
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
+  if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
+    this.currentFrame = this.timeCompleted;
+  }
+  this.trigger('enterFrame');
+  this.renderFrame();
 };
 
 AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    try {
-        this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-    } catch(error) {
-        this.triggerRenderFrameError(error);
-    }
+  if (this.isLoaded === false) {
+    return;
+  }
+  try {
+    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
+  } catch (error) {
+    this.triggerRenderFrameError(error);
+  }
 };
 
 AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.isPaused = false;
+    this.audioController.resume();
+    if (this._idle) {
+      this._idle = false;
+      this.trigger('_active');
     }
-    if (this.isPaused === true) {
-        this.isPaused = false;
-        this.audioController.resume();
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
+  }
 };
 
 AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        this._idle = true;
-        this.trigger('_idle');
-        this.audioController.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === false) {
+    this.isPaused = true;
+    this._idle = true;
+    this.trigger('_idle');
+    this.audioController.pause();
+  }
 };
 
 AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.play();
+  } else {
+    this.pause();
+  }
 };
 
 AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.playCount = 0;
-    this._completedLoop = false;
-    this.setCurrentRawFrameValue(0);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.pause();
+  this.playCount = 0;
+  this._completedLoop = false;
+  this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
+  if (name && this.name !== name) {
+    return;
+  }
+  if (isFrame) {
+    this.setCurrentRawFrameValue(value);
+  } else {
+    this.setCurrentRawFrameValue(value * this.frameModifier);
+  }
+  this.pause();
 };
 
 AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
+  this.goToAndStop(value, isFrame, name);
+  this.play();
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    var nextValue = this.currentRawFrame + value * this.frameModifier;
-    var _isComplete = false;
-    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
-    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
-    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
-        if (!this.loop || this.playCount === this.loop) {
-            if (!this.checkSegments(nextValue >  this.totalFrames ? nextValue % this.totalFrames : 0)) {
-                _isComplete = true;
-                nextValue = this.totalFrames - 1;
-            }
-        } else if (nextValue >= this.totalFrames) {
-            this.playCount += 1;
-            if (!this.checkSegments(nextValue % this.totalFrames)) {
-                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
-                this._completedLoop = true;
-                this.trigger('loopComplete');
-            }
-        } else {
-            this.setCurrentRawFrameValue(nextValue);
-        }
-    } else if(nextValue < 0) {
-        if (!this.checkSegments(nextValue % this.totalFrames)) {
-            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
-                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
-                if(!this._completedLoop) {
-                    this._completedLoop = true;
-                } else {
-                    this.trigger('loopComplete');
-                }
-            } else {
-                _isComplete = true;
-                nextValue = 0;
-            }
-        }
+  if (this.isPaused === true || this.isLoaded === false) {
+    return;
+  }
+  var nextValue = this.currentRawFrame + value * this.frameModifier;
+  var _isComplete = false;
+  // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+  // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+  if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+    if (!this.loop || this.playCount === this.loop) {
+      if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
+        _isComplete = true;
+        nextValue = this.totalFrames - 1;
+      }
+    } else if (nextValue >= this.totalFrames) {
+      this.playCount += 1;
+      if (!this.checkSegments(nextValue % this.totalFrames)) {
+        this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+        this._completedLoop = true;
+        this.trigger('loopComplete');
+      }
     } else {
-        this.setCurrentRawFrameValue(nextValue);
+      this.setCurrentRawFrameValue(nextValue);
     }
-    if (_isComplete) {
-        this.setCurrentRawFrameValue(nextValue);
-        this.pause();
-        this.trigger('complete');
+  } else if (nextValue < 0) {
+    if (!this.checkSegments(nextValue % this.totalFrames)) {
+      if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) { // eslint-disable-line no-plusplus
+        this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+        if (!this._completedLoop) {
+          this._completedLoop = true;
+        } else {
+          this.trigger('loopComplete');
+        }
+      } else {
+        _isComplete = true;
+        nextValue = 0;
+      }
     }
+  } else {
+    this.setCurrentRawFrameValue(nextValue);
+  }
+  if (_isComplete) {
+    this.setCurrentRawFrameValue(nextValue);
+    this.pause();
+    this.trigger('complete');
+  }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr, offset){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0.001 + offset);
+AnimationItem.prototype.adjustSegment = function (arr, offset) {
+  this.playCount = 0;
+  if (arr[1] < arr[0]) {
+    if (this.frameModifier > 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(-1);
+      }
     }
-    this.trigger('segmentStart');
+    this.totalFrames = arr[0] - arr[1];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[1];
+    this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
+  } else if (arr[1] > arr[0]) {
+    if (this.frameModifier < 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(1);
+      }
+    }
+    this.totalFrames = arr[1] - arr[0];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[0];
+    this.setCurrentRawFrameValue(0.001 + offset);
+  }
+  this.trigger('segmentStart');
 };
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init;
-        }
+AnimationItem.prototype.setSegment = function (init, end) {
+  var pendingFrame = -1;
+  if (this.isPaused) {
+    if (this.currentRawFrame + this.firstFrame < init) {
+      pendingFrame = init;
+    } else if (this.currentRawFrame + this.firstFrame > end) {
+      pendingFrame = end - init;
     }
+  }
 
-    this.firstFrame = init;
-    this.timeCompleted = this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
+  this.firstFrame = init;
+  this.totalFrames = end - init;
+  this.timeCompleted = this.totalFrames;
+  if (pendingFrame !== -1) {
+    this.goToAndStop(pendingFrame, true);
+  }
 };
 
 AnimationItem.prototype.playSegments = function (arr, forceFlag) {
-    if (forceFlag) {
-        this.segments.length = 0;
+  if (forceFlag) {
+    this.segments.length = 0;
+  }
+  if (typeof arr[0] === 'object') {
+    var i;
+    var len = arr.length;
+    for (i = 0; i < len; i += 1) {
+      this.segments.push(arr[i]);
     }
-    if (typeof arr[0] === 'object') {
-        var i, len = arr.length;
-        for (i = 0; i < len; i += 1) {
-            this.segments.push(arr[i]);
-        }
-    } else {
-        this.segments.push(arr);
-    }
-    if (this.segments.length && forceFlag) {
-        this.adjustSegment(this.segments.shift(), 0);
-    }
-    if (this.isPaused) {
-        this.play();
-    }
+  } else {
+    this.segments.push(arr);
+  }
+  if (this.segments.length && forceFlag) {
+    this.adjustSegment(this.segments.shift(), 0);
+  }
+  if (this.isPaused) {
+    this.play();
+  }
 };
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip,this.animationData.op]);
-    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if (forceFlag) {
-        this.checkSegments(0);
-    }
+  this.segments.length = 0;
+  this.segments.push([this.animationData.ip, this.animationData.op]);
+  // this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+  if (forceFlag) {
+    this.checkSegments(0);
+  }
 };
-AnimationItem.prototype.checkSegments = function(offset) {
-    if (this.segments.length) {
-        this.adjustSegment(this.segments.shift(), offset);
-        return true;
-    }
-    return false;
+AnimationItem.prototype.checkSegments = function (offset) {
+  if (this.segments.length) {
+    this.adjustSegment(this.segments.shift(), offset);
+    return true;
+  }
+  return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this.imagePreloader.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this.imagePreloader.destroy();
+  this.trigger('destroy');
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
+  this.renderer = null;
+  this.imagePreloader = null;
+  this.projectInterface = null;
 };
 
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    this.gotoFrame();
+AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
+  this.currentRawFrame = value;
+  this.gotoFrame();
 };
 
 AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
+  this.playSpeed = val;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
+  this.playDirection = val < 0 ? -1 : 1;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setVolume = function (val, name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.setVolume(val);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.setVolume(val);
 };
 
 AnimationItem.prototype.getVolume = function () {
-    return this.audioController.getVolume();
+  return this.audioController.getVolume();
 };
 
 AnimationItem.prototype.mute = function (name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.mute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.mute();
 };
 
 AnimationItem.prototype.unmute = function (name) {
-    if(name && this.name !== name){
-        return;
-    }
-    this.audioController.unmute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.unmute();
 };
 
 AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-    this.audioController.setRate(this.playSpeed * this.playDirection)
+  this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
+  this.audioController.setRate(this.playSpeed * this.playDirection);
 };
 
 AnimationItem.prototype.getPath = function () {
-    return this.path;
+  return this.path;
 };
 
 AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(assetData.e) {
-        path = assetData.p;
-    } else if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
+  var path = '';
+  if (assetData.e) {
+    path = assetData.p;
+  } else if (this.assetsPath) {
+    var imagePath = assetData.p;
+    if (imagePath.indexOf('images/') !== -1) {
+      imagePath = imagePath.split('/')[1];
     }
-    return path;
+    path = this.assetsPath + imagePath;
+  } else {
+    path = this.path;
+    path += assetData.u ? assetData.u : '';
+    path += assetData.p;
+  }
+  return path;
 };
 
 AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
+  var i = 0;
+  var len = this.assets.length;
+  while (i < len) {
+    if (id === this.assets[i].id) {
+      return this.assets[i];
     }
+    i += 1;
+  }
+  return null;
 };
 
 AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
+  this.renderer.hide();
 };
 
 AnimationItem.prototype.show = function () {
-    this.renderer.show();
+  this.renderer.show();
 };
 
 AnimationItem.prototype.getDuration = function (isFrame) {
-    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+  return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
 };
 
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
+AnimationItem.prototype.trigger = function (name) {
+  if (this._cbs && this._cbs[name]) {
+    switch (name) {
+      case 'enterFrame':
+        this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
+        break;
+      case 'loopComplete':
+        this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+        break;
+      case 'complete':
+        this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
+        break;
+      case 'segmentStart':
+        this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+        break;
+      case 'destroy':
+        this.triggerEvent(name, new BMDestroyEvent(name, this));
+        break;
+      default:
+        this.triggerEvent(name);
     }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
+  }
+  if (name === 'enterFrame' && this.onEnterFrame) {
+    this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
+  }
+  if (name === 'loopComplete' && this.onLoopComplete) {
+    this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+  }
+  if (name === 'complete' && this.onComplete) {
+    this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
+  }
+  if (name === 'segmentStart' && this.onSegmentStart) {
+    this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+  }
+  if (name === 'destroy' && this.onDestroy) {
+    this.onDestroy.call(this, new BMDestroyEvent(name, this));
+  }
 };
 
-AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
+AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
+  var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-    var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
 
-    if (this.onError) {
-        this.onError.call(this, error);
+AnimationItem.prototype.triggerConfigError = function (nativeError) {
+  var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
+
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
+
+/* global CompExpressionInterface, expressionsPlugin: writable */
+/* exported expressionsPlugin */
+
+var Expressions = (function () {
+  var ob = {};
+  ob.initExpressions = initExpressions;
+
+  function initExpressions(animation) {
+    var stackCount = 0;
+    var registers = [];
+
+    function pushExpression() {
+      stackCount += 1;
     }
-}
 
-AnimationItem.prototype.triggerConfigError = function(nativeError) {
-
-    var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
+    function popExpression() {
+      stackCount -= 1;
+      if (stackCount === 0) {
+        releaseInstances();
+      }
     }
-}
-var Expressions = (function(){
-    var ob = {};
-    ob.initExpressions = initExpressions;
 
-
-    function initExpressions(animation){
-
-    	var stackCount = 0;
-    	var registers = [];
-
-    	function pushExpression() {
-			stackCount += 1;
-    	}
-
-    	function popExpression() {
-			stackCount -= 1;
-			if (stackCount === 0) {
-				releaseInstances();
-			}
-    	}
-
-    	function registerExpressionProperty(expression) {
-    		if (registers.indexOf(expression) === -1) {
-				registers.push(expression)
-    		}
-    	}
-
-    	function releaseInstances() {
-    		var i, len = registers.length;
-    		for (i = 0; i < len; i += 1) {
-				registers[i].release();
-    		}
-    		registers.length = 0;
-    	}
-
-        animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
-        animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
-        animation.renderer.globalData.pushExpression = pushExpression;
-        animation.renderer.globalData.popExpression = popExpression;
-        animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+    function registerExpressionProperty(expression) {
+      if (registers.indexOf(expression) === -1) {
+        registers.push(expression);
+      }
     }
-   return ob;
+
+    function releaseInstances() {
+      var i;
+      var len = registers.length;
+      for (i = 0; i < len; i += 1) {
+        registers[i].release();
+      }
+      registers.length = 0;
+    }
+
+    animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
+    animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
+    animation.renderer.globalData.pushExpression = pushExpression;
+    animation.renderer.globalData.popExpression = popExpression;
+    animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+  }
+  return ob;
 }());
 
 expressionsPlugin = Expressions;
 
-var ExpressionManager = (function(){
-    'use strict';
-    var ob = {};
-    var Math = BMMath;
-    var window = null;
-    var document = null;
+/* eslint-disable camelcase, no-unused-vars */
+/* global BMMath, BezierFactory, createTypedArray, degToRads, shapePool */
 
-    function $bm_isInstanceOfArray(arr) {
-        return arr.constructor === Array || arr.constructor === Float32Array;
+var ExpressionManager = (function () {
+  'use strict';
+
+  var ob = {};
+  var Math = BMMath;
+  var window = null;
+  var document = null;
+
+  function $bm_isInstanceOfArray(arr) {
+    return arr.constructor === Array || arr.constructor === Float32Array;
+  }
+
+  function isNumerable(tOfV, v) {
+    return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+  }
+
+  function $bm_neg(a) {
+    var tOfA = typeof a;
+    if (tOfA === 'number' || tOfA === 'boolean' || a instanceof Number) {
+      return -a;
+    }
+    if ($bm_isInstanceOfArray(a)) {
+      var i;
+      var lenA = a.length;
+      var retArr = [];
+      for (i = 0; i < lenA; i += 1) {
+        retArr[i] = -a[i];
+      }
+      return retArr;
+    }
+    if (a.propType) {
+      return a.v;
+    }
+    return -a;
+  }
+
+  var easeInBez = BezierFactory.getBezierEasing(0.333, 0, 0.833, 0.833, 'easeIn').get;
+  var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, 0.667, 1, 'easeOut').get;
+  var easeInOutBez = BezierFactory.getBezierEasing(0.33, 0, 0.667, 1, 'easeInOut').get;
+
+  function sum(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (tOfA === 'string' || tOfB === 'string') {
+      return a + b;
+    }
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a + b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] += b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a + b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] + b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+  var add = sum;
+
+  function sub(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      if (tOfA === 'string') {
+        a = parseInt(a, 10);
+      }
+      if (tOfB === 'string') {
+        b = parseInt(b, 10);
+      }
+      return a - b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] -= b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a - b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] - b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+
+  function mul(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a * b;
     }
 
-    function isNumerable(tOfV, v) {
-        return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] * b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a * b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+
+  function div(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a / b;
+    }
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] / b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a / b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+  function mod(a, b) {
+    if (typeof a === 'string') {
+      a = parseInt(a, 10);
+    }
+    if (typeof b === 'string') {
+      b = parseInt(b, 10);
+    }
+    return a % b;
+  }
+  var $bm_sum = sum;
+  var $bm_sub = sub;
+  var $bm_mul = mul;
+  var $bm_div = div;
+  var $bm_mod = mod;
+
+  function clamp(num, min, max) {
+    if (min > max) {
+      var mm = max;
+      max = min;
+      min = mm;
+    }
+    return Math.min(Math.max(num, min), max);
+  }
+
+  function radiansToDegrees(val) {
+    return val / degToRads;
+  }
+  var radians_to_degrees = radiansToDegrees;
+
+  function degreesToRadians(val) {
+    return val * degToRads;
+  }
+  var degrees_to_radians = radiansToDegrees;
+
+  var helperLengthArray = [0, 0, 0, 0, 0, 0];
+
+  function length(arr1, arr2) {
+    if (typeof arr1 === 'number' || arr1 instanceof Number) {
+      arr2 = arr2 || 0;
+      return Math.abs(arr1 - arr2);
+    }
+    if (!arr2) {
+      arr2 = helperLengthArray;
+    }
+    var i;
+    var len = Math.min(arr1.length, arr2.length);
+    var addedLength = 0;
+    for (i = 0; i < len; i += 1) {
+      addedLength += Math.pow(arr2[i] - arr1[i], 2);
+    }
+    return Math.sqrt(addedLength);
+  }
+
+  function normalize(vec) {
+    return div(vec, length(vec));
+  }
+
+  function rgbToHsl(val) {
+    var r = val[0]; var g = val[1]; var b = val[2];
+    var max = Math.max(r, g, b);
+    var min = Math.min(r, g, b);
+    var h;
+    var s;
+    var l = (max + min) / 2;
+
+    if (max === min) {
+      h = 0; // achromatic
+      s = 0; // achromatic
+    } else {
+      var d = max - min;
+      s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+      switch (max) {
+        case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+        case g: h = (b - r) / d + 2; break;
+        case b: h = (r - g) / d + 4; break;
+        default: break;
+      }
+      h /= 6;
     }
 
-    function $bm_neg(a){
-        var tOfA = typeof a;
-        if(tOfA === 'number' || tOfA === 'boolean'  || a instanceof Number ){
-            return -a;
-        }
-        if($bm_isInstanceOfArray(a)){
-            var i, lenA = a.length;
-            var retArr = [];
-            for(i=0;i<lenA;i+=1){
-                retArr[i] = -a[i];
-            }
-            return retArr;
-        }
-        if (a.propType) {
-            return a.v;
-        }
+    return [h, s, l, val[3]];
+  }
+
+  function hue2rgb(p, q, t) {
+    if (t < 0) t += 1;
+    if (t > 1) t -= 1;
+    if (t < 1 / 6) return p + (q - p) * 6 * t;
+    if (t < 1 / 2) return q;
+    if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
+    return p;
+  }
+
+  function hslToRgb(val) {
+    var h = val[0];
+    var s = val[1];
+    var l = val[2];
+
+    var r;
+    var g;
+    var b;
+
+    if (s === 0) {
+      r = l; // achromatic
+      b = l; // achromatic
+      g = l; // achromatic
+    } else {
+      var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+      var p = 2 * l - q;
+      r = hue2rgb(p, q, h + 1 / 3);
+      g = hue2rgb(p, q, h);
+      b = hue2rgb(p, q, h - 1 / 3);
     }
 
-    var easeInBez = BezierFactory.getBezierEasing(0.333,0,.833,.833, 'easeIn').get;
-    var easeOutBez = BezierFactory.getBezierEasing(0.167,0.167,.667,1, 'easeOut').get;
-    var easeInOutBez = BezierFactory.getBezierEasing(.33,0,.667,1, 'easeInOut').get;
+    return [r, g, b, val[3]];
+  }
 
-    function sum(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(tOfA === 'string' || tOfB === 'string'){
-            return a + b;
-        }
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a + b;
-        }
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] + b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a + b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] + b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+  function linear(t, tMin, tMax, value1, value2) {
+    if (value1 === undefined || value2 === undefined) {
+      value1 = tMin;
+      value2 = tMax;
+      tMin = 0;
+      tMax = 1;
     }
-    var add = sum;
-
-    function sub(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            if(tOfA === 'string') {
-                a = parseInt(a);
-            }
-            if(tOfB === 'string') {
-                b = parseInt(b);
-            }
-            return a - b;
-        }
-        if( $bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] - b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) &&  $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a - b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] - b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+    if (tMax < tMin) {
+      var _tMin = tMax;
+      tMax = tMin;
+      tMin = _tMin;
     }
-
-    function mul(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a * b;
-        }
-
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] * b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a * b[i];
-            }
-            return arr;
-        }
-        return 0;
+    if (t <= tMin) {
+      return value1;
+    } if (t >= tMax) {
+      return value2;
     }
-
-    function div(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a / b;
-        }
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] / b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a / b[i];
-            }
-            return arr;
-        }
-        return 0;
+    var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin);
+    if (!value1.length) {
+      return value1 + (value2 - value1) * perc;
     }
-    function mod(a,b) {
-        if(typeof a === 'string') {
-            a = parseInt(a);
-        }
-        if(typeof b === 'string') {
-            b = parseInt(b);
-        }
-        return a % b;
+    var i;
+    var len = value1.length;
+    var arr = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      arr[i] = value1[i] + (value2[i] - value1[i]) * perc;
     }
-    var $bm_sum = sum;
-    var $bm_sub = sub;
-    var $bm_mul = mul;
-    var $bm_div = div;
-    var $bm_mod = mod;
-
-    function clamp(num, min, max) {
-        if(min > max){
-            var mm = max;
-            max = min;
-            min = mm;
-        }
-        return Math.min(Math.max(num, min), max);
+    return arr;
+  }
+  function random(min, max) {
+    if (max === undefined) {
+      if (min === undefined) {
+        min = 0;
+        max = 1;
+      } else {
+        max = min;
+        min = undefined;
+      }
     }
-
-    function radiansToDegrees(val) {
-        return val/degToRads;
+    if (max.length) {
+      var i;
+      var len = max.length;
+      if (!min) {
+        min = createTypedArray('float32', len);
+      }
+      var arr = createTypedArray('float32', len);
+      var rnd = BMMath.random();
+      for (i = 0; i < len; i += 1) {
+        arr[i] = min[i] + rnd * (max[i] - min[i]);
+      }
+      return arr;
     }
-    var radians_to_degrees = radiansToDegrees;
-
-    function degreesToRadians(val) {
-        return val*degToRads;
+    if (min === undefined) {
+      min = 0;
     }
-    var degrees_to_radians = radiansToDegrees;
+    var rndm = BMMath.random();
+    return min + rndm * (max - min);
+  }
 
-    var helperLengthArray = [0,0,0,0,0,0];
-
-    function length(arr1, arr2) {
-        if (typeof arr1 === 'number' || arr1 instanceof Number) {
-            arr2 = arr2 || 0;
-            return Math.abs(arr1 - arr2);
-        }
-        if(!arr2) {
-            arr2 = helperLengthArray;
-        }
-        var i, len = Math.min(arr1.length, arr2.length);
-        var addedLength = 0;
-        for (i = 0; i < len; i += 1) {
-            addedLength += Math.pow(arr2[i] - arr1[i], 2);
-        }
-        return Math.sqrt(addedLength);
+  function createPath(points, inTangents, outTangents, closed) {
+    var i;
+    var len = points.length;
+    var path = shapePool.newElement();
+    path.setPathData(!!closed, len);
+    var arrPlaceholder = [0, 0];
+    var inVertexPoint;
+    var outVertexPoint;
+    for (i = 0; i < len; i += 1) {
+      inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
+      outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
+      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);
     }
+    return path;
+  }
 
-    function normalize(vec) {
-        return div(vec, length(vec));
-    }
+  function initiateExpression(elem, data, property) {
+    var val = data.x;
+    var needsVelocity = /velocity(?![\w\d])/.test(val);
+    var _needsRandom = val.indexOf('random') !== -1;
+    var elemType = elem.data.ty;
+    var transform;
+    var $bm_transform;
+    var content;
+    var effect;
+    var thisProperty = property;
+    thisProperty.valueAtTime = thisProperty.getValueAtTime;
+    Object.defineProperty(thisProperty, 'value', {
+      get: function () {
+        return thisProperty.v;
+      },
+    });
+    elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate;
+    elem.comp.displayStartTime = 0;
+    var inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    var outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    var width = elem.data.sw ? elem.data.sw : 0;
+    var height = elem.data.sh ? elem.data.sh : 0;
+    var name = elem.data.nm;
+    var loopIn;
+    var loop_in;
+    var loopOut;
+    var loop_out;
+    var smooth;
+    var toWorld;
+    var fromWorld;
+    var fromComp;
+    var toComp;
+    var fromCompToSurface;
+    var position;
+    var rotation;
+    var anchorPoint;
+    var scale;
+    var thisLayer;
+    var thisComp;
+    var mask;
+    var valueAtTime;
+    var velocityAtTime;
 
-    function rgbToHsl(val) {
-        var r = val[0]; var g = val[1]; var b = val[2];
-        var max = Math.max(r, g, b), min = Math.min(r, g, b);
-        var h, s, l = (max + min) / 2;
+    var scoped_bm_rt;
+    var expression_function = eval('[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]')[0]; // eslint-disable-line no-eval
+    var numKeys = property.kf ? data.k.length : 0;
 
-        if(max == min){
-            h = s = 0; // achromatic
-        }else{
-            var d = max - min;
-            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
-            switch(max){
-                case r: h = (g - b) / d + (g < b ? 6 : 0); break;
-                case g: h = (b - r) / d + 2; break;
-                case b: h = (r - g) / d + 4; break;
-            }
-            h /= 6;
+    var active = !this.data || this.data.hd !== true;
+
+    var wiggle = function wiggle(freq, amp) {
+      var iWiggle;
+      var j;
+      var lenWiggle = this.pv.length ? this.pv.length : 1;
+      var addedAmps = createTypedArray('float32', lenWiggle);
+      freq = 5;
+      var iterations = Math.floor(time * freq);
+      iWiggle = 0;
+      j = 0;
+      while (iWiggle < iterations) {
+        // var rnd = BMMath.random();
+        for (j = 0; j < lenWiggle; j += 1) {
+          addedAmps[j] += -amp + amp * 2 * BMMath.random();
+          // addedAmps[j] += -amp + amp*2*rnd;
         }
-
-        return [h, s, l,val[3]];
-    }
-
-    function hue2rgb(p, q, t){
-        if(t < 0) t += 1;
-        if(t > 1) t -= 1;
-        if(t < 1/6) return p + (q - p) * 6 * t;
-        if(t < 1/2) return q;
-        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
-        return p;
-    }
-
-    function hslToRgb(val){
-        var h = val[0];
-        var s = val[1];
-        var l = val[2];
-
-        var r, g, b;
-
-        if(s === 0){
-            r = g = b = l; // achromatic
-        }else{
-
-            var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-            var p = 2 * l - q;
-            r = hue2rgb(p, q, h + 1/3);
-            g = hue2rgb(p, q, h);
-            b = hue2rgb(p, q, h - 1/3);
-        }
-
-        return [r, g , b, val[3]];
-    }
-
-    function linear(t, tMin, tMax, value1, value2){
-        if(value1 === undefined || value2 === undefined){
-            value1 = tMin;
-            value2 = tMax;
-            tMin = 0;
-            tMax = 1;
-        }
-        if(tMax < tMin) {
-            var _tMin = tMax;
-            tMax = tMin;
-            tMin = _tMin;
-        }
-        if(t <= tMin) {
-            return value1;
-        }else if(t >= tMax){
-            return value2;
-        }
-        var perc = tMax === tMin ? 0 : (t-tMin)/(tMax-tMin);
-        if(!value1.length){
-            return value1 + (value2-value1)*perc;
-        }
-        var i, len = value1.length;
-        var arr = createTypedArray('float32', len);
-        for(i=0;i<len;i+=1){
-            arr[i] = value1[i] + (value2[i]-value1[i])*perc;
+        iWiggle += 1;
+      }
+      // var rnd2 = BMMath.random();
+      var periods = time * freq;
+      var perc = periods - Math.floor(periods);
+      var arr = createTypedArray('float32', lenWiggle);
+      if (lenWiggle > 1) {
+        for (j = 0; j < lenWiggle; j += 1) {
+          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;
+          // arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
         }
         return arr;
-    }
-    function random(min,max){
-        if(max === undefined){
-            if(min === undefined){
-                min = 0;
-                max = 1;
-            } else {
-                max = min;
-                min = undefined;
-            }
-        }
-        if(max.length){
-            var i, len = max.length;
-            if(!min){
-                min = createTypedArray('float32', len);
-            }
-            var arr = createTypedArray('float32', len);
-            var rnd = BMMath.random();
-            for(i=0;i<len;i+=1){
-                arr[i] = min[i] + rnd*(max[i]-min[i]);
-            }
-            return arr;
-        }
-        if(min === undefined){
-            min = 0;
-        }
-        var rndm = BMMath.random();
-        return min + rndm*(max-min);
+      }
+      return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc;
+    }.bind(this);
+
+    if (thisProperty.loopIn) {
+      loopIn = thisProperty.loopIn.bind(thisProperty);
+      loop_in = loopIn;
     }
 
-    function createPath(points, inTangents, outTangents, closed) {
-        var i, len = points.length;
-        var path = shape_pool.newElement();
-        path.setPathData(!!closed, len);
-        var arrPlaceholder = [0,0], inVertexPoint, outVertexPoint;
-        for(i = 0; i < len; i += 1) {
-            inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
-            outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
-            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);
-        }
-        return path;
+    if (thisProperty.loopOut) {
+      loopOut = thisProperty.loopOut.bind(thisProperty);
+      loop_out = loopOut;
     }
 
-    function initiateExpression(elem,data,property){
-        var val = data.x;
-        var needsVelocity = /velocity(?![\w\d])/.test(val);
-        var _needsRandom = val.indexOf('random') !== -1;
-        var elemType = elem.data.ty;
-        var transform,$bm_transform,content,effect;
-        var thisProperty = property;
-        thisProperty.valueAtTime = thisProperty.getValueAtTime;
-        Object.defineProperty(thisProperty, 'value', {
-            get: function() {
-                return thisProperty.v
-            }
-        })
-        elem.comp.frameDuration = 1/elem.comp.globalData.frameRate;
-        elem.comp.displayStartTime = 0;
-        var inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        var outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        var width = elem.data.sw ? elem.data.sw : 0;
-        var height = elem.data.sh ? elem.data.sh : 0;
-        var name = elem.data.nm;
-        var loopIn, loop_in, loopOut, loop_out, smooth;
-        var toWorld,fromWorld,fromComp,toComp,fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp,mask,valueAtTime,velocityAtTime;
-        var __expression_functions = [];
-        if(data.xf) {
-            var i, len = data.xf.length;
-            for(i = 0; i < len; i += 1) {
-                __expression_functions[i] = eval('(function(){ return ' + data.xf[i] + '}())');
-            }
-        }
-
-        var scoped_bm_rt;
-        var expression_function = eval('[function _expression_function(){' + val+';scoped_bm_rt=$bm_rt}' + ']')[0];
-        var numKeys = property.kf ? data.k.length : 0;
-
-        var active = !this.data || this.data.hd !== true;
-
-        var wiggle = function wiggle(freq,amp){
-            var i,j, len = this.pv.length ? this.pv.length : 1;
-            var addedAmps = createTypedArray('float32', len);
-            freq = 5;
-            var iterations = Math.floor(time*freq);
-            i = 0;
-            j = 0;
-            while(i<iterations){
-                //var rnd = BMMath.random();
-                for(j=0;j<len;j+=1){
-                    addedAmps[j] += -amp + amp*2*BMMath.random();
-                    //addedAmps[j] += -amp + amp*2*rnd;
-                }
-                i += 1;
-            }
-            //var rnd2 = BMMath.random();
-            var periods = time*freq;
-            var perc = periods - Math.floor(periods);
-            var arr = createTypedArray('float32', len);
-            if(len>1){
-                for(j=0;j<len;j+=1){
-                    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;
-                    //arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
-                }
-                return arr;
-            } else {
-                return this.pv + addedAmps[0] + (-amp + amp*2*BMMath.random())*perc;
-            }
-        }.bind(this);
-
-        if(thisProperty.loopIn) {
-            loopIn = thisProperty.loopIn.bind(thisProperty);
-            loop_in = loopIn;
-        }
-
-        if(thisProperty.loopOut) {
-            loopOut = thisProperty.loopOut.bind(thisProperty);
-            loop_out = loopOut;
-        }
-
-        if(thisProperty.smooth) {
-            smooth = thisProperty.smooth.bind(thisProperty);
-        }
-
-        function loopInDuration(type,duration){
-            return loopIn(type,duration,true);
-        }
-
-        function loopOutDuration(type,duration){
-            return loopOut(type,duration,true);
-        }
-
-        if(this.getValueAtTime) {
-            valueAtTime = this.getValueAtTime.bind(this);
-        }
-
-        if(this.getVelocityAtTime) {
-            velocityAtTime = this.getVelocityAtTime.bind(this);
-        }
-
-        var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
-
-        function lookAt(elem1,elem2){
-            var fVec = [elem2[0]-elem1[0],elem2[1]-elem1[1],elem2[2]-elem1[2]];
-            var pitch = Math.atan2(fVec[0],Math.sqrt(fVec[1]*fVec[1]+fVec[2]*fVec[2]))/degToRads;
-            var yaw = -Math.atan2(fVec[1],fVec[2])/degToRads;
-            return [yaw,pitch,0];
-        }
-
-        function easeOut(t, tMin, tMax, val1, val2){
-            return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function easeIn(t, tMin, tMax, val1, val2){
-            return applyEase(easeInBez, t, tMin, tMax, val1, val2);
-        }
-
-        function ease(t, tMin, tMax, val1, val2){
-            return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function applyEase(fn, t, tMin, tMax, val1, val2) {
-            if(val1 === undefined){
-                val1 = tMin;
-                val2 = tMax;
-            } else {
-                t = (t - tMin) / (tMax - tMin);
-            }
-            t = t > 1 ? 1 : t < 0 ? 0 : t;
-            var mult = fn(t);
-            if($bm_isInstanceOfArray(val1)) {
-                var i, len = val1.length;
-                var arr = createTypedArray('float32', len);
-                for (i = 0; i < len; i += 1) {
-                    arr[i] = (val2[i] - val1[i]) * mult + val1[i];
-                }
-                return arr;
-            } else {
-                return (val2 - val1) * mult + val1;
-            }
-        }
-
-        function nearestKey(time){
-            var i, len = data.k.length,index,keyTime;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                index = 0;
-                keyTime = 0;
-            } else {
-                index = -1;
-                time *= elem.comp.globalData.frameRate;
-                if (time < data.k[0].t) {
-                    index = 1;
-                    keyTime = data.k[0].t;
-                } else {
-                    for(i=0;i<len-1;i+=1){
-                        if(time === data.k[i].t){
-                            index = i + 1;
-                            keyTime = data.k[i].t;
-                            break;
-                        }else if(time>data.k[i].t && time<data.k[i+1].t){
-                            if(time-data.k[i].t > data.k[i+1].t - time){
-                                index = i + 2;
-                                keyTime = data.k[i+1].t;
-                            } else {
-                                index = i + 1;
-                                keyTime = data.k[i].t;
-                            }
-                            break;
-                        }
-                    }
-                    if(index === -1){
-                        index = i + 1;
-                        keyTime = data.k[i].t;
-                    }
-                }
-                
-            }
-            var ob = {};
-            ob.index = index;
-            ob.time = keyTime/elem.comp.globalData.frameRate;
-            return ob;
-        }
-
-        function key(ind){
-            var ob, i, len;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                throw new Error('The property has no keyframe at index ' + ind);
-            }
-            ind -= 1;
-            ob = {
-                time: data.k[ind].t/elem.comp.globalData.frameRate,
-                value: []
-            };
-            var arr = data.k[ind].hasOwnProperty('s') ? data.k[ind].s : data.k[ind - 1].e;
-
-            len = arr.length;
-            for(i=0;i<len;i+=1){
-                ob[i] = arr[i];
-                ob.value[i] = arr[i]
-            }
-            return ob;
-        }
-
-        function framesToTime(frames, fps) { 
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return frames / fps;
-        }
-
-        function timeToFrames(t, fps) {
-            if (!t && t !== 0) {
-                t = time;
-            }
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return t * fps;
-        }
-
-        function seedRandom(seed){
-            BMMath.seedrandom(randSeed + seed);
-        }
-
-        function sourceRectAtTime() {
-            return elem.sourceRectAtTime();
-        }
-
-        function substring(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substring(init)
-                }
-                return value.substring(init, end)
-            }
-            return '';
-        }
-
-        function substr(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substr(init)
-                }
-                return value.substr(init, end)
-            }
-            return '';
-        }
-
-        function posterizeTime(framesPerSecond) {
-            time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond
-            value = valueAtTime(time)
-        }
-
-        var time, velocity, value, text, textIndex, textTotal, selectorValue;
-        var index = elem.data.ind;
-        var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-        var parent;
-        var randSeed = Math.floor(Math.random()*1000000);
-        var globalData = elem.globalData;
-        function executeExpression(_value) {
-            // globalData.pushExpression();
-            value = _value;
-            if (_needsRandom) {
-                seedRandom(randSeed);
-            }
-            if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
-                return value;
-            }
-            if(this.propType === 'textSelector'){
-                textIndex = this.textIndex;
-                textTotal = this.textTotal;
-                selectorValue = this.selectorValue;
-            }
-            if (!thisLayer) {
-                text = elem.layerInterface.text;
-                thisLayer = elem.layerInterface;
-                thisComp = elem.comp.compInterface;
-                toWorld = thisLayer.toWorld.bind(thisLayer);
-                fromWorld = thisLayer.fromWorld.bind(thisLayer);
-                fromComp = thisLayer.fromComp.bind(thisLayer);
-                toComp = thisLayer.toComp.bind(thisLayer);
-                mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
-                fromCompToSurface = fromComp;
-            }
-            if (!transform) {
-                transform = elem.layerInterface("ADBE Transform Group");
-                $bm_transform = transform;
-                if(transform) {
-                    anchorPoint = transform.anchorPoint;
-                    /*position = transform.position;
-                    rotation = transform.rotation;
-                    scale = transform.scale;*/
-                }
-            }
-            
-            if (elemType === 4 && !content) {
-                content = thisLayer("ADBE Root Vectors Group");
-            }
-            if (!effect) {
-                effect = thisLayer(4);
-            }
-            hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-            if (hasParent && !parent) {
-                parent = elem.hierarchy[0].layerInterface;
-            }
-            time = this.comp.renderedFrame/this.comp.globalData.frameRate;
-            if (needsVelocity) {
-                velocity = velocityAtTime(time);
-            }
-            expression_function();
-            this.frameExpressionId = elem.globalData.frameId;
-
-            //TODO: Check if it's possible to return on ShapeInterface the .v value
-            if (scoped_bm_rt.propType === "shape") {
-                scoped_bm_rt = scoped_bm_rt.v;
-            }
-            // globalData.popExpression();
-            return scoped_bm_rt;
-        }
-        return executeExpression;
+    if (thisProperty.smooth) {
+      smooth = thisProperty.smooth.bind(thisProperty);
     }
 
-    ob.initiateExpression = initiateExpression;
-    return ob;
-}());
-var expressionHelpers = (function(){
-
-    function searchExpressions(elem,data,prop){
-        if(data.x){
-            prop.k = true;
-            prop.x = true;
-            prop.initiateExpression = ExpressionManager.initiateExpression;
-            prop.effectsSequence.push(prop.initiateExpression(elem,data,prop).bind(prop));
-        }
+    function loopInDuration(type, duration) {
+      return loopIn(type, duration, true);
     }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
+    function loopOutDuration(type, duration) {
+      return loopOut(type, duration, true);
     }
 
-    function getSpeedAtTime(frameNum) {
-        var delta = -0.01;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var speed = 0;
-        if(v1.length){
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                speed += Math.pow(v2[i] - v1[i], 2);
-            }
-            speed = Math.sqrt(speed) * 100;
+    if (this.getValueAtTime) {
+      valueAtTime = this.getValueAtTime.bind(this);
+    }
+
+    if (this.getVelocityAtTime) {
+      velocityAtTime = this.getVelocityAtTime.bind(this);
+    }
+
+    var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
+
+    function lookAt(elem1, elem2) {
+      var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]];
+      var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads;
+      var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads;
+      return [yaw, pitch, 0];
+    }
+
+    function easeOut(t, tMin, tMax, val1, val2) {
+      return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function easeIn(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInBez, t, tMin, tMax, val1, val2);
+    }
+
+    function ease(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function applyEase(fn, t, tMin, tMax, val1, val2) {
+      if (val1 === undefined) {
+        val1 = tMin;
+        val2 = tMax;
+      } else {
+        t = (t - tMin) / (tMax - tMin);
+      }
+      if (t > 1) {
+        t = 1;
+      } else if (t < 0) {
+        t = 0;
+      }
+      var mult = fn(t);
+      if ($bm_isInstanceOfArray(val1)) {
+        var iKey;
+        var lenKey = val1.length;
+        var arr = createTypedArray('float32', lenKey);
+        for (iKey = 0; iKey < lenKey; iKey += 1) {
+          arr[iKey] = (val2[iKey] - val1[iKey]) * mult + val1[iKey];
+        }
+        return arr;
+      }
+      return (val2 - val1) * mult + val1;
+    }
+
+    function nearestKey(time) {
+      var iKey;
+      var lenKey = data.k.length;
+      var index;
+      var keyTime;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        index = 0;
+        keyTime = 0;
+      } else {
+        index = -1;
+        time *= elem.comp.globalData.frameRate;
+        if (time < data.k[0].t) {
+          index = 1;
+          keyTime = data.k[0].t;
         } else {
-            speed = 0;
+          for (iKey = 0; iKey < lenKey - 1; iKey += 1) {
+            if (time === data.k[iKey].t) {
+              index = iKey + 1;
+              keyTime = data.k[iKey].t;
+              break;
+            } else if (time > data.k[iKey].t && time < data.k[iKey + 1].t) {
+              if (time - data.k[iKey].t > data.k[iKey + 1].t - time) {
+                index = iKey + 2;
+                keyTime = data.k[iKey + 1].t;
+              } else {
+                index = iKey + 1;
+                keyTime = data.k[iKey].t;
+              }
+              break;
+            }
+          }
+          if (index === -1) {
+            index = iKey + 1;
+            keyTime = data.k[iKey].t;
+          }
         }
-        return speed;
+      }
+      var obKey = {};
+      obKey.index = index;
+      obKey.time = keyTime / elem.comp.globalData.frameRate;
+      return obKey;
     }
 
-    function getVelocityAtTime(frameNum) {
-        if(this.vel !== undefined){
-            return this.vel;
-        }
-        var delta = -0.001;
-        //frameNum += this.elem.data.st;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var velocity;
-        if(v1.length){
-            velocity = createTypedArray('float32', v1.length);
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                //removing frameRate
-                //if needed, don't add it here
-                //velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
-                velocity[i] = (v2[i] - v1[i])/delta;
-            }
-        } else {
-            velocity = (v2 - v1)/delta;
-        }
-        return velocity;
+    function key(ind) {
+      var obKey;
+      var iKey;
+      var lenKey;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        throw new Error('The property has no keyframe at index ' + ind);
+      }
+      ind -= 1;
+      obKey = {
+        time: data.k[ind].t / elem.comp.globalData.frameRate,
+        value: [],
+      };
+      var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;
+
+      lenKey = arr.length;
+      for (iKey = 0; iKey < lenKey; iKey += 1) {
+        obKey[iKey] = arr[iKey];
+        obKey.value[iKey] = arr[iKey];
+      }
+      return obKey;
     }
 
-    function getStaticValueAtTime() {
-        return this.pv;
+    function framesToTime(frames, fps) {
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return frames / fps;
     }
 
-    function setGroupProperty(propertyGroup){
-        this.propertyGroup = propertyGroup;
+    function timeToFrames(t, fps) {
+      if (!t && t !== 0) {
+        t = time;
+      }
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return t * fps;
     }
 
-	return {
-		searchExpressions: searchExpressions,
-		getSpeedAtTime: getSpeedAtTime,
-		getVelocityAtTime: getVelocityAtTime,
-		getValueAtTime: getValueAtTime,
-		getStaticValueAtTime: getStaticValueAtTime,
-		setGroupProperty: setGroupProperty,
-	}
-}());
-(function addPropertyDecorator() {
-
-    function loopOut(type,duration,durationFlag){
-        if(!this.k || !this.keyframes){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var lastKeyFrame = keyframes[keyframes.length - 1].t;
-        if(currentFrame<=lastKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, firstKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,lastKeyFrame - this.elem.data.ip);
-                } else {
-                    cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate*duration);
-                }
-                firstKeyFrame = lastKeyFrame - cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(iterations % 2 !== 0){
-                    return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = (endV[i]-initV[i])*repeats + current[i];
-                    }
-                    return ret;
-                }
-                return (endV-initV)*repeats + current;
-            } else if(type === 'continue'){
-                var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(lastValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = lastValue[i] + (lastValue[i]-nextLastValue[i])*((currentFrame - lastKeyFrame)/ this.comp.globalData.frameRate)/0.0005;
-                    }
-                    return ret;
-                }
-                return lastValue + (lastValue-nextLastValue)*(((currentFrame - lastKeyFrame))/0.001);
-            }
-            return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function seedRandom(seed) {
+      BMMath.seedrandom(randSeed + seed);
     }
 
-    function loopIn(type,duration, durationFlag) {
-        if(!this.k){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var firstKeyFrame = keyframes[0].t;
-        if(currentFrame>=firstKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, lastKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                lastKeyFrame = keyframes[duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,this.elem.data.op - firstKeyFrame);
-                } else {
-                    cycleDuration = Math.abs(elem.comp.globalData.frameRate*duration);
-                }
-                lastKeyFrame = firstKeyFrame + cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((firstKeyFrame - currentFrame)/cycleDuration);
-                if(iterations % 2 === 0){
-                    return this.getValueAtTime((((firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((firstKeyFrame - currentFrame)/cycleDuration)+1;
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = current[i]-(endV[i]-initV[i])*repeats;
-                    }
-                    return ret;
-                }
-                return current-(endV-initV)*repeats;
-            } else if(type === 'continue'){
-                var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(firstValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = firstValue[i] + (firstValue[i]-nextFirstValue[i])*(firstKeyFrame - currentFrame)/0.001;
-                    }
-                    return ret;
-                }
-                return firstValue + (firstValue-nextFirstValue)*(firstKeyFrame - currentFrame)/0.001;
-            }
-            return this.getValueAtTime(((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function sourceRectAtTime() {
+      return elem.sourceRectAtTime();
     }
 
-    function smooth(width, samples) {
-        if (!this.k){
-            return this.pv;
+    function substring(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substring(init);
         }
-        width = (width || 0.4) * 0.5;
-        samples = Math.floor(samples || 5);
-        if (samples <= 1) {
-            return this.pv;
+        return value.substring(init, end);
+      }
+      return '';
+    }
+
+    function substr(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substr(init);
         }
-        var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
-        var initFrame = currentTime - width;
-        var endFrame = currentTime + width;
-        var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
-        var i = 0, j = 0;
-        var value;
-        if (this.pv.length) {
-            value = createTypedArray('float32', this.pv.length);
-        } else {
-            value = 0;
-        }
-        var sampleValue;
-        while (i < samples) {
-            sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
-            if(this.pv.length) {
-                for (j = 0; j < this.pv.length; j += 1) {
-                    value[j] += sampleValue[j];
-                }
-            } else {
-                value += sampleValue;
-            }
-            i += 1;
-        }
-        if(this.pv.length) {
-            for (j = 0; j < this.pv.length; j += 1) {
-                value[j] /= samples;
-            }
-        } else {
-            value /= samples;
-        }
+        return value.substr(init, end);
+      }
+      return '';
+    }
+
+    function posterizeTime(framesPerSecond) {
+      time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond;
+      value = valueAtTime(time);
+    }
+
+    var time;
+    var velocity;
+    var value;
+    var text;
+    var textIndex;
+    var textTotal;
+    var selectorValue;
+    var index = elem.data.ind;
+    var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+    var parent;
+    var randSeed = Math.floor(Math.random() * 1000000);
+    var globalData = elem.globalData;
+    function executeExpression(_value) {
+      // globalData.pushExpression();
+      value = _value;
+      if (_needsRandom) {
+        seedRandom(randSeed);
+      }
+      if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
         return value;
+      }
+      if (this.propType === 'textSelector') {
+        textIndex = this.textIndex;
+        textTotal = this.textTotal;
+        selectorValue = this.selectorValue;
+      }
+      if (!thisLayer) {
+        text = elem.layerInterface.text;
+        thisLayer = elem.layerInterface;
+        thisComp = elem.comp.compInterface;
+        toWorld = thisLayer.toWorld.bind(thisLayer);
+        fromWorld = thisLayer.fromWorld.bind(thisLayer);
+        fromComp = thisLayer.fromComp.bind(thisLayer);
+        toComp = thisLayer.toComp.bind(thisLayer);
+        mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
+        fromCompToSurface = fromComp;
+      }
+      if (!transform) {
+        transform = elem.layerInterface('ADBE Transform Group');
+        $bm_transform = transform;
+        if (transform) {
+          anchorPoint = transform.anchorPoint;
+          /* position = transform.position;
+                    rotation = transform.rotation;
+                    scale = transform.scale; */
+        }
+      }
+
+      if (elemType === 4 && !content) {
+        content = thisLayer('ADBE Root Vectors Group');
+      }
+      if (!effect) {
+        effect = thisLayer(4);
+      }
+      hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+      if (hasParent && !parent) {
+        parent = elem.hierarchy[0].layerInterface;
+      }
+      time = this.comp.renderedFrame / this.comp.globalData.frameRate;
+      if (needsVelocity) {
+        velocity = velocityAtTime(time);
+      }
+      expression_function();
+      this.frameExpressionId = elem.globalData.frameId;
+
+      // TODO: Check if it's possible to return on ShapeInterface the .v value
+      if (scoped_bm_rt.propType === 'shape') {
+        scoped_bm_rt = scoped_bm_rt.v;
+      }
+      // globalData.popExpression();
+      return scoped_bm_rt;
     }
+    return executeExpression;
+  }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
-    }
-
-    function getTransformValueAtTime(time) {
-        if (!this._transformCachingAtTime) {
-            this._transformCachingAtTime = {
-                v: new Matrix(),
-            };
-        }
-        ////
-        var matrix = this._transformCachingAtTime.v;
-        matrix.cloneFromProps(this.pre.props);
-        if (this.appliedTransformations < 1) {
-            var anchor = this.a.getValueAtTime(time);
-            matrix.translate(
-                -anchor[0] * this.a.mult,
-                -anchor[1] * this.a.mult,
-                anchor[2] * this.a.mult
-            );
-        }
-        if (this.appliedTransformations < 2) {
-            var scale = this.s.getValueAtTime(time);
-            matrix.scale(
-                scale[0] * this.s.mult,
-                scale[1] * this.s.mult,
-                scale[2] * this.s.mult
-            );
-        }
-        if (this.sk && this.appliedTransformations < 3) {
-            var skew = this.sk.getValueAtTime(time);
-            var skewAxis = this.sa.getValueAtTime(time);
-            matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
-        }
-        if (this.r && this.appliedTransformations < 4) {
-            var rotation = this.r.getValueAtTime(time);
-            matrix.rotate(-rotation * this.r.mult);
-        } else if (!this.r && this.appliedTransformations < 4){
-            var rotationZ = this.rz.getValueAtTime(time);
-            var rotationY = this.ry.getValueAtTime(time);
-            var rotationX = this.rx.getValueAtTime(time);
-            var orientation = this.or.getValueAtTime(time);
-            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);
-        }
-        if (this.data.p && this.data.p.s) {
-            var positionX = this.px.getValueAtTime(time);
-            var positionY = this.py.getValueAtTime(time);
-            if (this.data.p.z) {
-                var positionZ = this.pz.getValueAtTime(time);
-                matrix.translate(
-                    positionX * this.px.mult,
-                    positionY * this.py.mult,
-                    -positionZ * this.pz.mult
-                );
-            } else {
-                matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
-            }
-        } else {
-            var position = this.p.getValueAtTime(time);
-            matrix.translate(
-                position[0] * this.p.mult,
-                position[1] * this.p.mult,
-                -position[2] * this.p.mult
-            );
-        }
-        return matrix;
-        ////
-    }
-
-    function getTransformStaticValueAtTime(time) {
-        return this.v.clone(new Matrix());
-    }
-
-    var getTransformProperty = TransformPropertyFactory.getTransformProperty;
-    TransformPropertyFactory.getTransformProperty = function(elem, data, container) {
-        var prop = getTransformProperty(elem, data, container);
-        if(prop.dynamicProperties.length) {
-            prop.getValueAtTime = getTransformValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        return prop;
-    };
-
-    var propertyGetProp = PropertyFactory.getProp;
-    PropertyFactory.getProp = function(elem,data,type, mult, container){
-        var prop = propertyGetProp(elem,data,type, mult, container);
-        //prop.getVelocityAtTime = getVelocityAtTime;
-        //prop.loopOut = loopOut;
-        //prop.loopIn = loopIn;
-        if(prop.kf){
-            prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        prop.loopOut = loopOut;
-        prop.loopIn = loopIn;
-        prop.smooth = smooth;
-        prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
-        prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
-        prop.numKeys = data.a === 1 ? data.k.length : 0;
-        prop.propertyIndex = data.ix;
-        var value = 0;
-        if(type !== 0) {
-            value = createTypedArray('float32', data.a === 1 ?  data.k[0].s.length : data.k.length);
-        }
-        prop._cachingAtTime = {
-            lastFrame: initialDefaultFrame,
-            lastIndex: 0,
-            value: value
-        };
-        expressionHelpers.searchExpressions(elem,data,prop);
-        if(prop.k){
-            container.addDynamicProperty(prop);
-        }
-
-        return prop;
-    };
-
-    function getShapeValueAtTime(frameNum) {
-        //For now this caching object is created only when needed instead of creating it when the shape is initialized.
-        if (!this._cachingAtTime) {
-            this._cachingAtTime = {
-                shapeValue: shape_pool.clone(this.pv),
-                lastIndex: 0,
-                lastTime: initialDefaultFrame
-            };
-        }
-        
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastTime) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
-            this._cachingAtTime.lastTime = frameNum;
-            this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
-        }
-        return this._cachingAtTime.shapeValue;
-    }
-
-    var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
-    var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
-
-    function ShapeExpressions(){}
-    ShapeExpressions.prototype = {
-        vertices: function(prop, time){
-            if (this.k) {
-                this.getValue();
-            }
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            var i, len = shapePath._length;
-            var vertices = shapePath[prop];
-            var points = shapePath.v;
-            var arr = createSizedArray(len);
-            for(i = 0; i < len; i += 1) {
-                if(prop === 'i' || prop === 'o') {
-                    arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
-                } else {
-                    arr[i] = [vertices[i][0], vertices[i][1]];
-                }
-                
-            }
-            return arr;
-        },
-        points: function(time){
-            return this.vertices('v', time);
-        },
-        inTangents: function(time){
-            return this.vertices('i', time);
-        },
-        outTangents: function(time){
-            return this.vertices('o', time);
-        },
-        isClosed: function(){
-            return this.v.c;
-        },
-        pointOnPath: function(perc, time){
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            if(!this._segmentsLength) {
-                this._segmentsLength = bez.getSegmentsLength(shapePath);
-            }
-
-            var segmentsLength = this._segmentsLength;
-            var lengths = segmentsLength.lengths;
-            var lengthPos = segmentsLength.totalLength * perc;
-            var i = 0, len = lengths.length;
-            var j = 0, jLen;
-            var accumulatedLength = 0, pt;
-            while(i < len) {
-                if(accumulatedLength + lengths[i].addedLength > lengthPos) {
-                    var initIndex = i;
-                    var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
-                    var segmentPerc = (lengthPos - accumulatedLength)/lengths[i].addedLength;
-                    pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
-                    break;
-                } else {
-                    accumulatedLength += lengths[i].addedLength;
-                }
-                i += 1;
-            }
-            if(!pt){
-                pt = shapePath.c ? [shapePath.v[0][0],shapePath.v[0][1]]:[shapePath.v[shapePath._length-1][0],shapePath.v[shapePath._length-1][1]];
-            }
-            return pt;
-        },
-        vectorOnPath: function(perc, time, vectorType){
-            //perc doesn't use triple equality because it can be a Number object as well as a primitive.
-            perc = perc == 1 ? this.v.c ? 0 : 0.999 : perc;
-            var pt1 = this.pointOnPath(perc, time);
-            var pt2 = this.pointOnPath(perc + 0.001, time);
-            var xLength = pt2[0] - pt1[0];
-            var yLength = pt2[1] - pt1[1];
-            var magnitude = Math.sqrt(Math.pow(xLength,2) + Math.pow(yLength,2));
-            if (magnitude === 0) {
-                return [0,0];
-            }
-            var unitVector = vectorType === 'tangent' ? [xLength/magnitude, yLength/magnitude] : [-yLength/magnitude, xLength/magnitude];
-            return unitVector;
-        },
-        tangentOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'tangent');
-        },
-        normalOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'normal');
-        },
-        setGroupProperty: expressionHelpers.setGroupProperty,
-        getValueAtTime: expressionHelpers.getStaticValueAtTime
-    };
-    extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
-    extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
-    KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
-    KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
-
-    var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
-    ShapePropertyFactory.getShapeProp = function(elem,data,type, arr, trims){
-        var prop = propertyGetShapeProp(elem,data,type, arr, trims);
-        prop.propertyIndex = data.ix;
-        prop.lock = false;
-        if(type === 3){
-            expressionHelpers.searchExpressions(elem,data.pt,prop);
-        } else if(type === 4){
-            expressionHelpers.searchExpressions(elem,data.ks,prop);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    };
+  ob.initiateExpression = initiateExpression;
+  return ob;
 }());
+
+/* global ExpressionManager, createTypedArray */
+/* exported expressionHelpers */
+
+var expressionHelpers = (function () {
+  function searchExpressions(elem, data, prop) {
+    if (data.x) {
+      prop.k = true;
+      prop.x = true;
+      prop.initiateExpression = ExpressionManager.initiateExpression;
+      prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop));
+    }
+  }
+
+  function getValueAtTime(frameNum) {
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastFrame) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
+      this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
+      this._cachingAtTime.lastFrame = frameNum;
+    }
+    return this._cachingAtTime.value;
+  }
+
+  function getSpeedAtTime(frameNum) {
+    var delta = -0.01;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var speed = 0;
+    if (v1.length) {
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        speed += Math.pow(v2[i] - v1[i], 2);
+      }
+      speed = Math.sqrt(speed) * 100;
+    } else {
+      speed = 0;
+    }
+    return speed;
+  }
+
+  function getVelocityAtTime(frameNum) {
+    if (this.vel !== undefined) {
+      return this.vel;
+    }
+    var delta = -0.001;
+    // frameNum += this.elem.data.st;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var velocity;
+    if (v1.length) {
+      velocity = createTypedArray('float32', v1.length);
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        // removing frameRate
+        // if needed, don't add it here
+        // velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
+        velocity[i] = (v2[i] - v1[i]) / delta;
+      }
+    } else {
+      velocity = (v2 - v1) / delta;
+    }
+    return velocity;
+  }
+
+  function getStaticValueAtTime() {
+    return this.pv;
+  }
+
+  function setGroupProperty(propertyGroup) {
+    this.propertyGroup = propertyGroup;
+  }
+
+  return {
+    searchExpressions: searchExpressions,
+    getSpeedAtTime: getSpeedAtTime,
+    getVelocityAtTime: getVelocityAtTime,
+    getValueAtTime: getValueAtTime,
+    getStaticValueAtTime: getStaticValueAtTime,
+    setGroupProperty: setGroupProperty,
+  };
+}());
+
+/* global createTypedArray, Matrix, TransformPropertyFactory, expressionHelpers, PropertyFactory, expressionHelpers,
+initialDefaultFrame, shapePool, ShapePropertyFactory, bez, extendPrototype, ExpressionManager, createSizedArray */
+
+(function addPropertyDecorator() {
+  function loopOut(type, duration, durationFlag) {
+    if (!this.k || !this.keyframes) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var lastKeyFrame = keyframes[keyframes.length - 1].t;
+    if (currentFrame <= lastKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var firstKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip);
+      } else {
+        cycleDuration = Math.abs(lastKeyFrame - this.elem.comp.globalData.frameRate * duration);
+      }
+      firstKeyFrame = lastKeyFrame - cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (iterations % 2 !== 0) {
+          return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+        var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = (endV[i] - initV[i]) * repeats + current[i];
+        }
+        return ret;
+      }
+      return (endV - initV) * repeats + current;
+    } else if (type === 'continue') {
+      var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(lastValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+            ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005; // eslint-disable-line
+        }
+        return ret;
+      }
+      return lastValue + (lastValue - nextLastValue) * (((currentFrame - lastKeyFrame)) / 0.001);
+    }
+      return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function loopIn(type, duration, durationFlag) {
+    if (!this.k) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var firstKeyFrame = keyframes[0].t;
+    if (currentFrame >= firstKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var lastKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      lastKeyFrame = keyframes[duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame);
+      } else {
+        cycleDuration = Math.abs(this.elem.comp.globalData.frameRate * duration);
+      }
+      lastKeyFrame = firstKeyFrame + cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration);
+      if (iterations % 2 === 0) {
+          return this.getValueAtTime((((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var current = this.getValueAtTime((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration) + firstKeyFrame) / this.comp.globalData.frameRate, 0);
+      var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1;
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = current[i] - (endV[i] - initV[i]) * repeats;
+        }
+        return ret;
+      }
+      return current - (endV - initV) * repeats;
+    } else if (type === 'continue') {
+      var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(firstValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = firstValue[i] + ((firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame)) / 0.001;
+        }
+        return ret;
+      }
+      return firstValue + ((firstValue - nextFirstValue) * (firstKeyFrame - currentFrame)) / 0.001;
+    }
+      return this.getValueAtTime(((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame))) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function smooth(width, samples) {
+    if (!this.k) {
+      return this.pv;
+    }
+    width = (width || 0.4) * 0.5;
+    samples = Math.floor(samples || 5);
+    if (samples <= 1) {
+      return this.pv;
+    }
+    var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
+    var initFrame = currentTime - width;
+    var endFrame = currentTime + width;
+    var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
+    var i = 0;
+    var j = 0;
+    var value;
+    if (this.pv.length) {
+      value = createTypedArray('float32', this.pv.length);
+    } else {
+      value = 0;
+    }
+    var sampleValue;
+    while (i < samples) {
+      sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
+      if (this.pv.length) {
+        for (j = 0; j < this.pv.length; j += 1) {
+          value[j] += sampleValue[j];
+        }
+      } else {
+        value += sampleValue;
+      }
+      i += 1;
+    }
+    if (this.pv.length) {
+      for (j = 0; j < this.pv.length; j += 1) {
+        value[j] /= samples;
+      }
+    } else {
+      value /= samples;
+    }
+    return value;
+  }
+
+  function getTransformValueAtTime(time) {
+    if (!this._transformCachingAtTime) {
+      this._transformCachingAtTime = {
+        v: new Matrix(),
+      };
+    }
+    /// /
+    var matrix = this._transformCachingAtTime.v;
+    matrix.cloneFromProps(this.pre.props);
+    if (this.appliedTransformations < 1) {
+      var anchor = this.a.getValueAtTime(time);
+      matrix.translate(
+        -anchor[0] * this.a.mult,
+        -anchor[1] * this.a.mult,
+        anchor[2] * this.a.mult
+      );
+    }
+    if (this.appliedTransformations < 2) {
+      var scale = this.s.getValueAtTime(time);
+      matrix.scale(
+        scale[0] * this.s.mult,
+        scale[1] * this.s.mult,
+        scale[2] * this.s.mult
+      );
+    }
+    if (this.sk && this.appliedTransformations < 3) {
+      var skew = this.sk.getValueAtTime(time);
+      var skewAxis = this.sa.getValueAtTime(time);
+      matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
+    }
+    if (this.r && this.appliedTransformations < 4) {
+      var rotation = this.r.getValueAtTime(time);
+      matrix.rotate(-rotation * this.r.mult);
+    } else if (!this.r && this.appliedTransformations < 4) {
+      var rotationZ = this.rz.getValueAtTime(time);
+      var rotationY = this.ry.getValueAtTime(time);
+      var rotationX = this.rx.getValueAtTime(time);
+      var orientation = this.or.getValueAtTime(time);
+      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);
+    }
+    if (this.data.p && this.data.p.s) {
+      var positionX = this.px.getValueAtTime(time);
+      var positionY = this.py.getValueAtTime(time);
+      if (this.data.p.z) {
+        var positionZ = this.pz.getValueAtTime(time);
+        matrix.translate(
+          positionX * this.px.mult,
+          positionY * this.py.mult,
+          -positionZ * this.pz.mult
+        );
+      } else {
+        matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
+      }
+    } else {
+      var position = this.p.getValueAtTime(time);
+      matrix.translate(
+        position[0] * this.p.mult,
+        position[1] * this.p.mult,
+        -position[2] * this.p.mult
+      );
+    }
+    return matrix;
+    /// /
+  }
+
+  function getTransformStaticValueAtTime() {
+    return this.v.clone(new Matrix());
+  }
+
+  var getTransformProperty = TransformPropertyFactory.getTransformProperty;
+  TransformPropertyFactory.getTransformProperty = function (elem, data, container) {
+    var prop = getTransformProperty(elem, data, container);
+    if (prop.dynamicProperties.length) {
+      prop.getValueAtTime = getTransformValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    return prop;
+  };
+
+  var propertyGetProp = PropertyFactory.getProp;
+  PropertyFactory.getProp = function (elem, data, type, mult, container) {
+    var prop = propertyGetProp(elem, data, type, mult, container);
+    // prop.getVelocityAtTime = getVelocityAtTime;
+    // prop.loopOut = loopOut;
+    // prop.loopIn = loopIn;
+    if (prop.kf) {
+      prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    prop.loopOut = loopOut;
+    prop.loopIn = loopIn;
+    prop.smooth = smooth;
+    prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
+    prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
+    prop.numKeys = data.a === 1 ? data.k.length : 0;
+    prop.propertyIndex = data.ix;
+    var value = 0;
+    if (type !== 0) {
+      value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);
+    }
+    prop._cachingAtTime = {
+      lastFrame: initialDefaultFrame,
+      lastIndex: 0,
+      value: value,
+    };
+    expressionHelpers.searchExpressions(elem, data, prop);
+    if (prop.k) {
+      container.addDynamicProperty(prop);
+    }
+
+    return prop;
+  };
+
+  function getShapeValueAtTime(frameNum) {
+    // For now this caching object is created only when needed instead of creating it when the shape is initialized.
+    if (!this._cachingAtTime) {
+      this._cachingAtTime = {
+        shapeValue: shapePool.clone(this.pv),
+        lastIndex: 0,
+        lastTime: initialDefaultFrame,
+      };
+    }
+
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastTime) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
+      this._cachingAtTime.lastTime = frameNum;
+      this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
+    }
+    return this._cachingAtTime.shapeValue;
+  }
+
+  var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
+  var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
+
+  function ShapeExpressions() {}
+  ShapeExpressions.prototype = {
+    vertices: function (prop, time) {
+      if (this.k) {
+        this.getValue();
+      }
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      var i;
+      var len = shapePath._length;
+      var vertices = shapePath[prop];
+      var points = shapePath.v;
+      var arr = createSizedArray(len);
+      for (i = 0; i < len; i += 1) {
+        if (prop === 'i' || prop === 'o') {
+          arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
+        } else {
+          arr[i] = [vertices[i][0], vertices[i][1]];
+        }
+      }
+      return arr;
+    },
+    points: function (time) {
+      return this.vertices('v', time);
+    },
+    inTangents: function (time) {
+      return this.vertices('i', time);
+    },
+    outTangents: function (time) {
+      return this.vertices('o', time);
+    },
+    isClosed: function () {
+      return this.v.c;
+    },
+    pointOnPath: function (perc, time) {
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      if (!this._segmentsLength) {
+        this._segmentsLength = bez.getSegmentsLength(shapePath);
+      }
+
+      var segmentsLength = this._segmentsLength;
+      var lengths = segmentsLength.lengths;
+      var lengthPos = segmentsLength.totalLength * perc;
+      var i = 0;
+      var len = lengths.length;
+      var accumulatedLength = 0;
+      var pt;
+      while (i < len) {
+        if (accumulatedLength + lengths[i].addedLength > lengthPos) {
+          var initIndex = i;
+          var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
+          var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength;
+          pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
+          break;
+        } else {
+          accumulatedLength += lengths[i].addedLength;
+        }
+        i += 1;
+      }
+      if (!pt) {
+        pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]];
+      }
+      return pt;
+    },
+    vectorOnPath: function (perc, time, vectorType) {
+      // perc doesn't use triple equality because it can be a Number object as well as a primitive.
+      if (perc == 1) { // eslint-disable-line eqeqeq
+        perc = this.v.c;
+      } else if (perc == 0) { // eslint-disable-line eqeqeq
+        perc = 0.999;
+      }
+      var pt1 = this.pointOnPath(perc, time);
+      var pt2 = this.pointOnPath(perc + 0.001, time);
+      var xLength = pt2[0] - pt1[0];
+      var yLength = pt2[1] - pt1[1];
+      var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2));
+      if (magnitude === 0) {
+        return [0, 0];
+      }
+      var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude];
+      return unitVector;
+    },
+    tangentOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'tangent');
+    },
+    normalOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'normal');
+    },
+    setGroupProperty: expressionHelpers.setGroupProperty,
+    getValueAtTime: expressionHelpers.getStaticValueAtTime,
+  };
+  extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
+  extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
+  KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
+  KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
+
+  var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
+  ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) {
+    var prop = propertyGetShapeProp(elem, data, type, arr, trims);
+    prop.propertyIndex = data.ix;
+    prop.lock = false;
+    if (type === 3) {
+      expressionHelpers.searchExpressions(elem, data.pt, prop);
+    } else if (type === 4) {
+      expressionHelpers.searchExpressions(elem, data.ks, prop);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  };
+}());
+
+/* global ExpressionManager, TextProperty */
+
 (function addDecorator() {
-
-    function searchExpressions(){
-        if(this.data.d.x){
-            this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this);
-            this.addEffect(this.getExpressionValue.bind(this));
-            return true;
-        }
+  function searchExpressions() {
+    if (this.data.d.x) {
+      this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this);
+      this.addEffect(this.getExpressionValue.bind(this));
+      return true;
     }
+    return null;
+  }
 
-    TextProperty.prototype.getExpressionValue = function(currentValue, text) {
-        var newValue = this.calculateExpression(text);
-        if(currentValue.t !== newValue) {
-            var newData = {};
-            this.copyData(newData, currentValue);
-            newData.t = newValue.toString();
-            newData.__complete = false;
-            return newData;
-        }
-        return currentValue;
+  TextProperty.prototype.getExpressionValue = function (currentValue, text) {
+    var newValue = this.calculateExpression(text);
+    if (currentValue.t !== newValue) {
+      var newData = {};
+      this.copyData(newData, currentValue);
+      newData.t = newValue.toString();
+      newData.__complete = false;
+      return newData;
     }
+    return currentValue;
+  };
 
-    TextProperty.prototype.searchProperty = function(){
+  TextProperty.prototype.searchProperty = function () {
+    var isKeyframed = this.searchKeyframes();
+    var hasExpressions = this.searchExpressions();
+    this.kf = isKeyframed || hasExpressions;
+    return this.kf;
+  };
 
-        var isKeyframed = this.searchKeyframes();
-        var hasExpressions = this.searchExpressions();
-        this.kf = isKeyframed || hasExpressions;
-        return this.kf;
-    };
-
-    TextProperty.prototype.searchExpressions = searchExpressions;
-    
+  TextProperty.prototype.searchExpressions = searchExpressions;
 }());
+
+/* global propertyGroupFactory, PropertyInterface */
+/* exported ShapePathInterface */
+
 var ShapePathInterface = (
 
-	function() {
+  function () {
+    return function pathInterfaceFactory(shape, view, propertyGroup) {
+      var prop = view.sh;
 
-		return function pathInterfaceFactory(shape,view,propertyGroup){
-		    var prop = view.sh;
-
-		    function interfaceFunction(val){
-		        if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2){
-		            return interfaceFunction.path;
-		        }
-		    }
-
-		    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-		    prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
-		    Object.defineProperties(interfaceFunction, {
-		        'path': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        'shape': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        '_name': { value: shape.nm },
-		        'ix': { value: shape.ix },
-		        'propertyIndex': { value: shape.ix },
-		        'mn': { value: shape.mn },
-		        'propertyGroup': {value: propertyGroup},
-		    });
-		    return interfaceFunction;
-		}
-	}()
-)
-var propertyGroupFactory = (function() {
-	return function(interfaceFunction, parentPropertyGroup) {
-		return function(val) {
-			val = val === undefined ? 1 : val
-			if(val <= 0){
-			    return interfaceFunction;
-			} else{
-			    return parentPropertyGroup(val-1);
-			}
-		}
-	}
-}())
-var PropertyInterface = (function() {
-	return function(propertyName, propertyGroup) {
-
-		var interfaceFunction = {
-			_name: propertyName
-		}
-
-		function _propertyGroup(val){
-		    val = val === undefined ? 1 : val
-		    if(val <= 0){
-		        return interfaceFunction;
-		    } else {
-		        return propertyGroup(--val);
-		    }
-		}
-
-		return _propertyGroup;
-	}
-}())
-var ShapeExpressionInterface = (function(){
-
-    function iterateElements(shapes,view, propertyGroup){
-        var arr = [];
-        var i, len = shapes ? shapes.length : 0;
-        for(i=0;i<len;i+=1){
-            if(shapes[i].ty == 'gr'){
-                arr.push(groupInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'fl'){
-                arr.push(fillInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'st'){
-                arr.push(strokeInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tm'){
-                arr.push(trimInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tr'){
-                //arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'el'){
-                arr.push(ellipseInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'sr'){
-                arr.push(starInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'sh'){
-                arr.push(ShapePathInterface(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rc'){
-                arr.push(rectInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rd'){
-                arr.push(roundedInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rp'){
-                arr.push(repeaterInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }
+      function interfaceFunction(val) {
+        if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {
+          return interfaceFunction.path;
         }
-        return arr;
-    }
+        return null;
+      }
 
-    function contentsInterfaceFactory(shape,view, propertyGroup){
-       var interfaces;
-       var interfaceFunction = function _interfaceFunction(value){
-           var i = 0, len = interfaces.length;
-            while(i<len){
-                if(interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value){
-                   return interfaces[i];
-                }
-                i+=1;
+      var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+      prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
+      Object.defineProperties(interfaceFunction, {
+        path: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-            if(typeof value === 'number'){
-               return interfaces[value-1];
+            return prop;
+          },
+        },
+        shape: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-       };
-
-       interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-       interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
-       interfaceFunction.numProperties = interfaces.length;
-       var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-       interfaceFunction.transform = transformInterface;
-       interfaceFunction.propertyIndex = shape.cix;
-       interfaceFunction._name = shape.nm;
-
-       return interfaceFunction;
-   }
-
-    function groupInterfaceFactory(shape,view, propertyGroup){
-        var interfaceFunction = function _interfaceFunction(value){
-            switch(value){
-                case 'ADBE Vectors Group':
-                case 'Contents':
-                case 2:
-                    return interfaceFunction.content;
-                //Not necessary for now. Keeping them here in case a new case appears
-                //case 'ADBE Vector Transform Group':
-                //case 3:
-                default:
-                    return interfaceFunction.transform;
-            }
-        };
-        interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var content = contentsInterfaceFactory(shape,view,interfaceFunction.propertyGroup);
-        var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-        interfaceFunction.content = content;
-        interfaceFunction.transform = transformInterface;
-        Object.defineProperty(interfaceFunction, '_name', {
-            get: function(){
-                return shape.nm;
-            }
-        });
-        //interfaceFunction.content = interfaceFunction;
-        interfaceFunction.numProperties = shape.np;
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.nm = shape.nm;
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function fillInterfaceFactory(shape,view,propertyGroup){
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
-        return interfaceFunction;
-    }
-
-    function strokeInterfaceFactory(shape,view,propertyGroup){
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
-        function addPropertyToDashOb(i) {
-            Object.defineProperty(dashOb, shape.d[i].nm, {
-                get: ExpressionPropertyInterface(view.d.dataProps[i].p)
-            });
-        }
-        var i, len = shape.d ? shape.d.length : 0;
-        var dashOb = {};
-        for (i = 0; i < len; i += 1) {
-            addPropertyToDashOb(i);
-            view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
-        }
-
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            } else if(val === 'Stroke Width' || val === 'stroke width'){
-                return interfaceFunction.strokeWidth;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            'strokeWidth': {
-                get: ExpressionPropertyInterface(view.w)
-            },
-            'dash': {
-                get: function() {
-                    return dashOb;
-                }
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
-        return interfaceFunction;
-    }
-
-    function trimInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(val){
-            if(val === shape.e.ix || val === 'End' || val === 'end'){
-                return interfaceFunction.end;
-            }
-            if(val === shape.s.ix){
-                return interfaceFunction.start;
-            }
-            if(val === shape.o.ix){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-
-        view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
-        view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.propertyGroup = propertyGroup;
-
-        Object.defineProperties(interfaceFunction, {
-            'start': {
-                get: ExpressionPropertyInterface(view.s)
-            },
-            'end': {
-                get: ExpressionPropertyInterface(view.e)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function transformInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.a.ix === value || value === 'Anchor Point'){
-                return interfaceFunction.anchorPoint;
-            }
-            if(shape.o.ix === value || value === 'Opacity'){
-                return interfaceFunction.opacity;
-            }
-            if(shape.p.ix === value || value === 'Position'){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation'){
-                return interfaceFunction.rotation;
-            }
-            if(shape.s.ix === value || value === 'Scale'){
-                return interfaceFunction.scale;
-            }
-            if(shape.sk && shape.sk.ix === value || value === 'Skew'){
-                return interfaceFunction.skew;
-            }
-            if(shape.sa && shape.sa.ix === value || value === 'Skew Axis'){
-                return interfaceFunction.skewAxis;
-            }
-        }
-        
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
-        view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
-        view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(view.transform.mProps.sk){
-            view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
-            view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
-        }
-        view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'opacity': {
-                get: ExpressionPropertyInterface(view.transform.mProps.o)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(view.transform.mProps.p)
-            },
-            'anchorPoint': {
-                get: ExpressionPropertyInterface(view.transform.mProps.a)
-            },
-            'scale': {
-                get: ExpressionPropertyInterface(view.transform.mProps.s)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(view.transform.mProps.r)
-            },
-            'skew': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sk)
-            },
-            'skewAxis': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sa)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.ty = 'tr';
-        interfaceFunction.mn = shape.mn;
-        interfaceFunction.propertyGroup = propertyGroup;
-        return interfaceFunction;
-    }
-
-    function ellipseInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.s.ix === value){
-                return interfaceFunction.size;
-            }
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function starInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.rotation;
-            }
-            if(shape.pt.ix === value){
-                return interfaceFunction.points;
-            }
-            if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
-                return interfaceFunction.outerRadius;
-            }
-            if(shape.os.ix === value){
-                return interfaceFunction.outerRoundness;
-            }
-            if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
-                return interfaceFunction.innerRadius;
-            }
-            if(shape.is && shape.is.ix === value){
-                return interfaceFunction.innerRoundness;
-            }
-
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
-        prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
-        prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(shape.ir){
-            prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
-            prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
-        }
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'points': {
-                get: ExpressionPropertyInterface(prop.pt)
-            },
-            'outerRadius': {
-                get: ExpressionPropertyInterface(prop.or)
-            },
-            'outerRoundness': {
-                get: ExpressionPropertyInterface(prop.os)
-            },
-            'innerRadius': {
-                get: ExpressionPropertyInterface(prop.ir)
-            },
-            'innerRoundness': {
-                get: ExpressionPropertyInterface(prop.is)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function rectInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.roundness;
-            }
-            if(shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size'){
-                return interfaceFunction.size;
-            }
-
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'roundness': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function roundedInterfaceFactory(shape,view,propertyGroup){
-       
-        function interfaceFunction(value){
-            if(shape.r.ix === value || 'Round Corners 1' === value){
-                return interfaceFunction.radius;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'radius': {
-                get: ExpressionPropertyInterface(prop.rd)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function repeaterInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.c.ix === value || 'Copies' === value){
-                return interfaceFunction.copies;
-            } else if(shape.o.ix === value || 'Offset' === value){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
-        prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'copies': {
-                get: ExpressionPropertyInterface(prop.c)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(prop.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    return function(shapes,view,propertyGroup) {
-        var interfaces;
-        function _interfaceFunction(value){
-            if(typeof value === 'number'){
-                value = value === undefined ? 1 : value
-                if (value === 0) {
-                    return propertyGroup
-                } else {
-                    return interfaces[value-1];
-                }
-            } else {
-                var i = 0, len = interfaces.length;
-                while(i<len){
-                    if(interfaces[i]._name === value){
-                        return interfaces[i];
-                    }
-                    i+=1;
-                }
-            }
-        }
-        function parentGroupWrapper() {
-            return propertyGroup
-        }
-        _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
-        interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
-        _interfaceFunction.numProperties = interfaces.length;
-        _interfaceFunction._name = 'Contents';
-        return _interfaceFunction;
+            return prop;
+          },
+        },
+        _name: { value: shape.nm },
+        ix: { value: shape.ix },
+        propertyIndex: { value: shape.ix },
+        mn: { value: shape.mn },
+        propertyGroup: { value: propertyGroup },
+      });
+      return interfaceFunction;
     };
+  }()
+);
+
+/* exported propertyGroupFactory */
+
+var propertyGroupFactory = (function () {
+  return function (interfaceFunction, parentPropertyGroup) {
+    return function (val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return parentPropertyGroup(val - 1);
+    };
+  };
 }());
 
-var TextExpressionInterface = (function(){
-	return function(elem){
-        var _prevValue, _sourceText;
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Text Document":
-                    return _thisLayerFunction.sourceText;
-            }
-        }
-        Object.defineProperty(_thisLayerFunction, "sourceText", {
-            get: function(){
-                elem.textProperty.getValue()
-                var stringValue = elem.textProperty.currentData.t;
-                if(stringValue !== _prevValue) {
-                    elem.textProperty.currentData.t = _prevValue;
-                    _sourceText = new String(stringValue);
-                    //If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
-                    _sourceText.value = stringValue ? stringValue : new String(stringValue);
-                }
-                return _sourceText;
-            }
-        });
-        return _thisLayerFunction;
+/* exported PropertyInterface */
+
+var PropertyInterface = (function () {
+  return function (propertyName, propertyGroup) {
+    var interfaceFunction = {
+      _name: propertyName,
     };
+
+    function _propertyGroup(val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return propertyGroup(val - 1);
+    }
+
+    return _propertyGroup;
+  };
 }());
-var LayerExpressionInterface = (function (){
 
-    function getMatrix(time) {
-        var toWorldMat = new Matrix();
-        if (time !== undefined) {
-            var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
-            propMatrix.clone(toWorldMat);
-        } else {
-            var transformMat = this._elem.finalTransform.mProp;
-            transformMat.applyToMatrix(toWorldMat);
+/* global ExpressionPropertyInterface, PropertyInterface, propertyGroupFactory, ShapePathInterface */
+/* exported ShapeExpressionInterface */
+
+var ShapeExpressionInterface = (function () {
+  function iterateElements(shapes, view, propertyGroup) {
+    var arr = [];
+    var i;
+    var len = shapes ? shapes.length : 0;
+    for (i = 0; i < len; i += 1) {
+      if (shapes[i].ty === 'gr') {
+        arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'fl') {
+        arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'st') {
+        arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tm') {
+        arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tr') {
+        // arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
+      } else if (shapes[i].ty === 'el') {
+        arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sr') {
+        arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sh') {
+        arr.push(ShapePathInterface(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rc') {
+        arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rd') {
+        arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rp') {
+        arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup));
+      }
+    }
+    return arr;
+  }
+
+  function contentsInterfaceFactory(shape, view, propertyGroup) {
+    var interfaces;
+    var interfaceFunction = function _interfaceFunction(value) {
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) {
+          return interfaces[i];
         }
-        return toWorldMat;
-    }
-
-    function toWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function toWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function fromWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function fromWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function applyPoint(matrix, arr) {
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.applyToPointArray(arr[0],arr[1],arr[2]||0);
-    }
-
-    function invertPoint(matrix, arr) {
-        if (this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.inversePoint(arr);
-    }
-
-    function fromComp(arr){
-        var toWorldMat = new Matrix();
-        toWorldMat.reset();
-        this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
-            }
-            return toWorldMat.inversePoint(arr);
-        }
-        return toWorldMat.inversePoint(arr);
-    }
-
-    function sampleImage() {
-        return [1,1,1,1];
-    }
-
-
-    return function(elem){
-
-        var transformInterface;
-
-        function _registerMaskInterface(maskManager){
-            _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
-        }
-        function _registerEffectsInterface(effects){
-            _thisLayerFunction.effect = effects;
-        }
-
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Root Vectors Group":
-                case "Contents":
-                case 2:
-                    return _thisLayerFunction.shapeInterface;
-                case 1:
-                case 6:
-                case "Transform":
-                case "transform":
-                case "ADBE Transform Group":
-                    return transformInterface;
-                case 4:
-                case "ADBE Effect Parade":
-                case "effects":
-                case "Effects":
-                    return _thisLayerFunction.effect;
-                case "ADBE Text Properties":
-                    return _thisLayerFunction.textInterface;
-            }
-        }
-        _thisLayerFunction.getMatrix = getMatrix;
-        _thisLayerFunction.invertPoint = invertPoint;
-        _thisLayerFunction.applyPoint = applyPoint;
-        _thisLayerFunction.toWorld = toWorld;
-        _thisLayerFunction.toWorldVec = toWorldVec;
-        _thisLayerFunction.fromWorld = fromWorld;
-        _thisLayerFunction.fromWorldVec = fromWorldVec;
-        _thisLayerFunction.toComp = toWorld;
-        _thisLayerFunction.fromComp = fromComp;
-        _thisLayerFunction.sampleImage = sampleImage;
-        _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
-        _thisLayerFunction._elem = elem;
-        transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
-        var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
-        Object.defineProperties(_thisLayerFunction,{
-            hasParent: {
-                get: function(){
-                    return elem.hierarchy.length;
-                }
-            },
-            parent: {
-                get: function(){
-                    return elem.hierarchy[0].layerInterface;
-                }
-            },
-            rotation: getDescriptor(transformInterface, 'rotation'),
-            scale: getDescriptor(transformInterface, 'scale'),
-            position: getDescriptor(transformInterface, 'position'),
-            opacity: getDescriptor(transformInterface, 'opacity'),
-            anchorPoint: anchorPointDescriptor,
-            anchor_point: anchorPointDescriptor,
-            transform: {
-                get: function () {
-                    return transformInterface;
-                }
-            },
-            active: {
-                get: function(){
-                    return elem.isInRange;
-                }
-            }
-        });
-
-        _thisLayerFunction.startTime = elem.data.st;
-        _thisLayerFunction.index = elem.data.ind;
-        _thisLayerFunction.source = elem.data.refId;
-        _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
-        _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
-        _thisLayerFunction.inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        _thisLayerFunction.outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        _thisLayerFunction._name = elem.data.nm;
-
-        _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
-        _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
-        return _thisLayerFunction;
+        i += 1;
+      }
+      if (typeof value === 'number') {
+        return interfaces[value - 1];
+      }
+      return null;
     };
+
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
+    interfaceFunction.numProperties = interfaces.length;
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.transform = transformInterface;
+    interfaceFunction.propertyIndex = shape.cix;
+    interfaceFunction._name = shape.nm;
+
+    return interfaceFunction;
+  }
+
+  function groupInterfaceFactory(shape, view, propertyGroup) {
+    var interfaceFunction = function _interfaceFunction(value) {
+      switch (value) {
+        case 'ADBE Vectors Group':
+        case 'Contents':
+        case 2:
+          return interfaceFunction.content;
+          // Not necessary for now. Keeping them here in case a new case appears
+          // case 'ADBE Vector Transform Group':
+          // case 3:
+        default:
+          return interfaceFunction.transform;
+      }
+    };
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup);
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.content = content;
+    interfaceFunction.transform = transformInterface;
+    Object.defineProperty(interfaceFunction, '_name', {
+      get: function () {
+        return shape.nm;
+      },
+    });
+    // interfaceFunction.content = interfaceFunction;
+    interfaceFunction.numProperties = shape.np;
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.nm = shape.nm;
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function fillInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
+    return interfaceFunction;
+  }
+
+  function strokeInterfaceFactory(shape, view, propertyGroup) {
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
+    function addPropertyToDashOb(i) {
+      Object.defineProperty(dashOb, shape.d[i].nm, {
+        get: ExpressionPropertyInterface(view.d.dataProps[i].p),
+      });
+    }
+    var i;
+    var len = shape.d ? shape.d.length : 0;
+    var dashOb = {};
+    for (i = 0; i < len; i += 1) {
+      addPropertyToDashOb(i);
+      view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
+    }
+
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      } if (val === 'Stroke Width' || val === 'stroke width') {
+        return interfaceFunction.strokeWidth;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      strokeWidth: {
+        get: ExpressionPropertyInterface(view.w),
+      },
+      dash: {
+        get: function () {
+          return dashOb;
+        },
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
+    return interfaceFunction;
+  }
+
+  function trimInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === shape.e.ix || val === 'End' || val === 'end') {
+        return interfaceFunction.end;
+      }
+      if (val === shape.s.ix) {
+        return interfaceFunction.start;
+      }
+      if (val === shape.o.ix) {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+
+    view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
+    view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.propertyGroup = propertyGroup;
+
+    Object.defineProperties(interfaceFunction, {
+      start: {
+        get: ExpressionPropertyInterface(view.s),
+      },
+      end: {
+        get: ExpressionPropertyInterface(view.e),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function transformInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.a.ix === value || value === 'Anchor Point') {
+        return interfaceFunction.anchorPoint;
+      }
+      if (shape.o.ix === value || value === 'Opacity') {
+        return interfaceFunction.opacity;
+      }
+      if (shape.p.ix === value || value === 'Position') {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') {
+        return interfaceFunction.rotation;
+      }
+      if (shape.s.ix === value || value === 'Scale') {
+        return interfaceFunction.scale;
+      }
+      if ((shape.sk && shape.sk.ix === value) || value === 'Skew') {
+        return interfaceFunction.skew;
+      }
+      if ((shape.sa && shape.sa.ix === value) || value === 'Skew Axis') {
+        return interfaceFunction.skewAxis;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
+    view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
+    view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (view.transform.mProps.sk) {
+      view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
+      view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
+    }
+    view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      opacity: {
+        get: ExpressionPropertyInterface(view.transform.mProps.o),
+      },
+      position: {
+        get: ExpressionPropertyInterface(view.transform.mProps.p),
+      },
+      anchorPoint: {
+        get: ExpressionPropertyInterface(view.transform.mProps.a),
+      },
+      scale: {
+        get: ExpressionPropertyInterface(view.transform.mProps.s),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(view.transform.mProps.r),
+      },
+      skew: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sk),
+      },
+      skewAxis: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sa),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.ty = 'tr';
+    interfaceFunction.mn = shape.mn;
+    interfaceFunction.propertyGroup = propertyGroup;
+    return interfaceFunction;
+  }
+
+  function ellipseInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.s.ix === value) {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function starInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.rotation;
+      }
+      if (shape.pt.ix === value) {
+        return interfaceFunction.points;
+      }
+      if (shape.or.ix === value || value === 'ADBE Vector Star Outer Radius') {
+        return interfaceFunction.outerRadius;
+      }
+      if (shape.os.ix === value) {
+        return interfaceFunction.outerRoundness;
+      }
+      if (shape.ir && (shape.ir.ix === value || value === 'ADBE Vector Star Inner Radius')) {
+        return interfaceFunction.innerRadius;
+      }
+      if (shape.is && shape.is.ix === value) {
+        return interfaceFunction.innerRoundness;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
+    prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
+    prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (shape.ir) {
+      prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
+      prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
+    }
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      points: {
+        get: ExpressionPropertyInterface(prop.pt),
+      },
+      outerRadius: {
+        get: ExpressionPropertyInterface(prop.or),
+      },
+      outerRoundness: {
+        get: ExpressionPropertyInterface(prop.os),
+      },
+      innerRadius: {
+        get: ExpressionPropertyInterface(prop.ir),
+      },
+      innerRoundness: {
+        get: ExpressionPropertyInterface(prop.is),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function rectInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.roundness;
+      }
+      if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      roundness: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function roundedInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.r.ix === value || value === 'Round Corners 1') {
+        return interfaceFunction.radius;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      radius: {
+        get: ExpressionPropertyInterface(prop.rd),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function repeaterInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.c.ix === value || value === 'Copies') {
+        return interfaceFunction.copies;
+      } if (shape.o.ix === value || value === 'Offset') {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
+    prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      copies: {
+        get: ExpressionPropertyInterface(prop.c),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(prop.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  return function (shapes, view, propertyGroup) {
+    var interfaces;
+    function _interfaceFunction(value) {
+      if (typeof value === 'number') {
+        value = value === undefined ? 1 : value;
+        if (value === 0) {
+          return propertyGroup;
+        }
+        return interfaces[value - 1];
+      }
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value) {
+          return interfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    }
+    function parentGroupWrapper() {
+      return propertyGroup;
+    }
+    _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
+    interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
+    _interfaceFunction.numProperties = interfaces.length;
+    _interfaceFunction._name = 'Contents';
+    return _interfaceFunction;
+  };
 }());
 
+/* exported TextExpressionInterface */
+
+var TextExpressionInterface = (function () {
+  return function (elem) {
+    var _prevValue;
+    var _sourceText;
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Text Document':
+          return _thisLayerFunction.sourceText;
+        default:
+          return null;
+      }
+    }
+    Object.defineProperty(_thisLayerFunction, 'sourceText', {
+      get: function () {
+        elem.textProperty.getValue();
+        var stringValue = elem.textProperty.currentData.t;
+        if (stringValue !== _prevValue) {
+          elem.textProperty.currentData.t = _prevValue;
+          _sourceText = new String(stringValue); // eslint-disable-line no-new-wrappers
+          // If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
+          _sourceText.value = stringValue || new String(stringValue); // eslint-disable-line no-new-wrappers
+        }
+        return _sourceText;
+      },
+    });
+    return _thisLayerFunction;
+  };
+}());
+
+/* global Matrix, MaskManagerInterface, TransformExpressionInterface, getDescriptor */
+/* exported LayerExpressionInterface */
+
+var LayerExpressionInterface = (function () {
+  function getMatrix(time) {
+    var toWorldMat = new Matrix();
+    if (time !== undefined) {
+      var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
+      propMatrix.clone(toWorldMat);
+    } else {
+      var transformMat = this._elem.finalTransform.mProp;
+      transformMat.applyToMatrix(toWorldMat);
+    }
+    return toWorldMat;
+  }
+
+  function toWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function toWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function fromWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function fromWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function applyPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.applyToPointArray(arr[0], arr[1], arr[2] || 0);
+  }
+
+  function invertPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.inversePoint(arr);
+  }
+
+  function fromComp(arr) {
+    var toWorldMat = new Matrix();
+    toWorldMat.reset();
+    this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
+      }
+      return toWorldMat.inversePoint(arr);
+    }
+    return toWorldMat.inversePoint(arr);
+  }
+
+  function sampleImage() {
+    return [1, 1, 1, 1];
+  }
+
+  return function (elem) {
+    var transformInterface;
+
+    function _registerMaskInterface(maskManager) {
+      _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
+    }
+    function _registerEffectsInterface(effects) {
+      _thisLayerFunction.effect = effects;
+    }
+
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Root Vectors Group':
+        case 'Contents':
+        case 2:
+          return _thisLayerFunction.shapeInterface;
+        case 1:
+        case 6:
+        case 'Transform':
+        case 'transform':
+        case 'ADBE Transform Group':
+          return transformInterface;
+        case 4:
+        case 'ADBE Effect Parade':
+        case 'effects':
+        case 'Effects':
+          return _thisLayerFunction.effect;
+        case 'ADBE Text Properties':
+          return _thisLayerFunction.textInterface;
+        default:
+          return null;
+      }
+    }
+    _thisLayerFunction.getMatrix = getMatrix;
+    _thisLayerFunction.invertPoint = invertPoint;
+    _thisLayerFunction.applyPoint = applyPoint;
+    _thisLayerFunction.toWorld = toWorld;
+    _thisLayerFunction.toWorldVec = toWorldVec;
+    _thisLayerFunction.fromWorld = fromWorld;
+    _thisLayerFunction.fromWorldVec = fromWorldVec;
+    _thisLayerFunction.toComp = toWorld;
+    _thisLayerFunction.fromComp = fromComp;
+    _thisLayerFunction.sampleImage = sampleImage;
+    _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
+    _thisLayerFunction._elem = elem;
+    transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
+    var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
+    Object.defineProperties(_thisLayerFunction, {
+      hasParent: {
+        get: function () {
+          return elem.hierarchy.length;
+        },
+      },
+      parent: {
+        get: function () {
+          return elem.hierarchy[0].layerInterface;
+        },
+      },
+      rotation: getDescriptor(transformInterface, 'rotation'),
+      scale: getDescriptor(transformInterface, 'scale'),
+      position: getDescriptor(transformInterface, 'position'),
+      opacity: getDescriptor(transformInterface, 'opacity'),
+      anchorPoint: anchorPointDescriptor,
+      anchor_point: anchorPointDescriptor,
+      transform: {
+        get: function () {
+          return transformInterface;
+        },
+      },
+      active: {
+        get: function () {
+          return elem.isInRange;
+        },
+      },
+    });
+
+    _thisLayerFunction.startTime = elem.data.st;
+    _thisLayerFunction.index = elem.data.ind;
+    _thisLayerFunction.source = elem.data.refId;
+    _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
+    _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
+    _thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    _thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    _thisLayerFunction._name = elem.data.nm;
+
+    _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
+    _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
+    return _thisLayerFunction;
+  };
+}());
+
+/* exported CompExpressionInterface */
+
 var CompExpressionInterface = (function () {
-    return function(comp) {
-        function _thisLayerFunction(name) {
-            var i = 0, len = comp.layers.length;
-            while ( i < len) {
-                if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
-                    return comp.elements[i].layerInterface;
-                }
-                i += 1;
-            }
-            return null;
-            //return {active:false};
+  return function (comp) {
+    function _thisLayerFunction(name) {
+      var i = 0;
+      var len = comp.layers.length;
+      while (i < len) {
+        if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
+          return comp.elements[i].layerInterface;
         }
-        Object.defineProperty(_thisLayerFunction, "_name", { value: comp.data.nm });
-        _thisLayerFunction.layer = _thisLayerFunction;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
-        _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
-        _thisLayerFunction.displayStartTime = 0;
-        _thisLayerFunction.numLayers = comp.layers.length;
-        return _thisLayerFunction;
-    };
-}());
-var TransformExpressionInterface = (function (){
-    return function(transform){
-        function _thisFunction(name){
-            switch(name){
-                case "scale":
-                case "Scale":
-                case "ADBE Scale":
-                case 6:
-                    return _thisFunction.scale;
-                case "rotation":
-                case "Rotation":
-                case "ADBE Rotation":
-                case "ADBE Rotate Z":
-                case 10:
-                    return _thisFunction.rotation;
-                case "ADBE Rotate X":
-                    return _thisFunction.xRotation;
-                case "ADBE Rotate Y":
-                    return _thisFunction.yRotation;
-                case "position":
-                case "Position":
-                case "ADBE Position":
-                case 2:
-                    return _thisFunction.position;
-                case 'ADBE Position_0':
-                    return _thisFunction.xPosition;
-                case 'ADBE Position_1':
-                    return _thisFunction.yPosition;
-                case 'ADBE Position_2':
-                    return _thisFunction.zPosition;
-                case "anchorPoint":
-                case "AnchorPoint":
-                case "Anchor Point":
-                case "ADBE AnchorPoint":
-                case 1:
-                    return _thisFunction.anchorPoint;
-                case "opacity":
-                case "Opacity":
-                case 11:
-                    return _thisFunction.opacity;
-            }
-        }
-        Object.defineProperty(_thisFunction, "rotation", {
-            get: ExpressionPropertyInterface(transform.r || transform.rz)
-        });
-
-        Object.defineProperty(_thisFunction, "zRotation", {
-            get: ExpressionPropertyInterface(transform.rz || transform.r)
-        });
-
-        Object.defineProperty(_thisFunction, "xRotation", {
-            get: ExpressionPropertyInterface(transform.rx)
-        });
-
-        Object.defineProperty(_thisFunction, "yRotation", {
-            get: ExpressionPropertyInterface(transform.ry)
-        });
-        Object.defineProperty(_thisFunction, "scale", {
-            get: ExpressionPropertyInterface(transform.s)
-        });
-
-        if(transform.p) {
-            var _transformFactory = ExpressionPropertyInterface(transform.p);
-        } else {
-            var _px = ExpressionPropertyInterface(transform.px);
-            var _py = ExpressionPropertyInterface(transform.py);
-            var _pz;
-            if (transform.pz) {
-                _pz = ExpressionPropertyInterface(transform.pz);
-            }
-        }
-        Object.defineProperty(_thisFunction, "position", {
-            get: function () {
-                if(transform.p) {
-                    return _transformFactory();
-                } else {
-                    return [
-                        _px(),
-                        _py(),
-                        _pz ? _pz() : 0];
-                }
-            }
-        });
-
-        Object.defineProperty(_thisFunction, "xPosition", {
-            get: ExpressionPropertyInterface(transform.px)
-        });
-
-        Object.defineProperty(_thisFunction, "yPosition", {
-            get: ExpressionPropertyInterface(transform.py)
-        });
-
-        Object.defineProperty(_thisFunction, "zPosition", {
-            get: ExpressionPropertyInterface(transform.pz)
-        });
-
-        Object.defineProperty(_thisFunction, "anchorPoint", {
-            get: ExpressionPropertyInterface(transform.a)
-        });
-
-        Object.defineProperty(_thisFunction, "opacity", {
-            get: ExpressionPropertyInterface(transform.o)
-        });
-
-        Object.defineProperty(_thisFunction, "skew", {
-            get: ExpressionPropertyInterface(transform.sk)
-        });
-
-        Object.defineProperty(_thisFunction, "skewAxis", {
-            get: ExpressionPropertyInterface(transform.sa)
-        });
-
-        Object.defineProperty(_thisFunction, "orientation", {
-            get: ExpressionPropertyInterface(transform.or)
-        });
-
-        return _thisFunction;
-    };
-}());
-var ProjectInterface = (function (){
-
-    function registerComposition(comp){
-        this.compositions.push(comp);
+        i += 1;
+      }
+      return null;
+      // return {active:false};
     }
-
-    return function(){
-        function _thisProjectFunction(name){
-            var i = 0, len = this.compositions.length;
-            while(i<len){
-                if(this.compositions[i].data && this.compositions[i].data.nm === name){
-                    if(this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
-                        this.compositions[i].prepareFrame(this.currentFrame);
-                    }
-                    return this.compositions[i].compInterface;
-                }
-                i+=1;
-            }
-        }
-
-        _thisProjectFunction.compositions = [];
-        _thisProjectFunction.currentFrame = 0;
-
-        _thisProjectFunction.registerComposition = registerComposition;
-
-
-
-        return _thisProjectFunction;
-    };
+    Object.defineProperty(_thisLayerFunction, '_name', { value: comp.data.nm });
+    _thisLayerFunction.layer = _thisLayerFunction;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
+    _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
+    _thisLayerFunction.displayStartTime = 0;
+    _thisLayerFunction.numLayers = comp.layers.length;
+    return _thisLayerFunction;
+  };
 }());
-var EffectsExpressionInterface = (function (){
-    var ob = {
-        createEffectsInterface: createEffectsInterface
-    };
 
-    function createEffectsInterface(elem, propertyGroup){
-        if(elem.effectsManager){
+/* global ExpressionPropertyInterface */
+/* exported TransformExpressionInterface */
 
-            var effectElements = [];
-            var effectsData = elem.data.ef;
-            var i, len = elem.effectsManager.effectElements.length;
-            for(i=0;i<len;i+=1){
-                effectElements.push(createGroupInterface(effectsData[i],elem.effectsManager.effectElements[i],propertyGroup,elem));
-            }
-
-            var effects = elem.data.ef || [];
-            var groupInterface = function(name){
-                i = 0, len = effects.length;
-                while(i<len) {
-                    if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                        return effectElements[i];
-                    }
-                    i += 1;
-                }
-            };
-            Object.defineProperty(groupInterface, 'numProperties', {
-                get: function(){
-                    return effects.length;
-                }
-            });
-            return groupInterface
-        }
+var TransformExpressionInterface = (function () {
+  return function (transform) {
+    function _thisFunction(name) {
+      switch (name) {
+        case 'scale':
+        case 'Scale':
+        case 'ADBE Scale':
+        case 6:
+          return _thisFunction.scale;
+        case 'rotation':
+        case 'Rotation':
+        case 'ADBE Rotation':
+        case 'ADBE Rotate Z':
+        case 10:
+          return _thisFunction.rotation;
+        case 'ADBE Rotate X':
+          return _thisFunction.xRotation;
+        case 'ADBE Rotate Y':
+          return _thisFunction.yRotation;
+        case 'position':
+        case 'Position':
+        case 'ADBE Position':
+        case 2:
+          return _thisFunction.position;
+        case 'ADBE Position_0':
+          return _thisFunction.xPosition;
+        case 'ADBE Position_1':
+          return _thisFunction.yPosition;
+        case 'ADBE Position_2':
+          return _thisFunction.zPosition;
+        case 'anchorPoint':
+        case 'AnchorPoint':
+        case 'Anchor Point':
+        case 'ADBE AnchorPoint':
+        case 1:
+          return _thisFunction.anchorPoint;
+        case 'opacity':
+        case 'Opacity':
+        case 11:
+          return _thisFunction.opacity;
+        default:
+          return null;
+      }
     }
-
-    function createGroupInterface(data,elements, propertyGroup, elem){
-
-        function groupInterface(name){
-            var effects = data.ef, i = 0, len = effects.length;
-            while(i<len) {
-                if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                    if(effects[i].ty === 5){
-                        return effectElements[i];
-                    } else {
-                        return effectElements[i]();
-                    }
-                }
-                i += 1;
-            }
-            throw new Error();
-        };
-        var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
-
-        var effectElements = [];
-        var i, len = data.ef.length;
-        for(i=0;i<len;i+=1){
-            if(data.ef[i].ty === 5){
-                effectElements.push(createGroupInterface(data.ef[i],elements.effectElements[i],elements.effectElements[i].propertyGroup, elem));
-            } else {
-                effectElements.push(createValueInterface(elements.effectElements[i],data.ef[i].ty, elem, _propertyGroup));
-            }
-        }
-
-        if(data.mn === 'ADBE Color Control'){
-            Object.defineProperty(groupInterface, 'color', {
-                get: function(){
-                    return effectElements[0]();
-                }
-            });
-        }
-        Object.defineProperties(groupInterface, {
-            numProperties: {
-                get: function(){
-                    return data.np;
-                }
-            },
-            _name: { value: data.nm },
-            propertyGroup: {value: _propertyGroup},
-        });
-        groupInterface.active = groupInterface.enabled = data.en !== 0;
-        return groupInterface;
-    }
-
-    function createValueInterface(element, type, elem, propertyGroup){
-        var expressionProperty = ExpressionPropertyInterface(element.p);
-        function interfaceFunction(){
-            if(type === 10){
-                return elem.comp.compInterface(element.p.v);
-            }
-            return expressionProperty();
-        }
-
-        if(element.p.setGroupProperty) {
-            element.p.setGroupProperty(PropertyInterface('', propertyGroup));
-        }
-
-        return interfaceFunction;
-    }
-
-    return ob;
-
-}());
-var MaskManagerInterface = (function(){
-
-	function MaskInterface(mask, data){
-		this._mask = mask;
-		this._data = data;
-	}
-	Object.defineProperty(MaskInterface.prototype, 'maskPath', {
-        get: function(){
-            if(this._mask.prop.k){
-                this._mask.prop.getValue();
-            }
-            return this._mask.prop;
-        }
-    });
-	Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
-        get: function(){
-            if(this._mask.op.k){
-                this._mask.op.getValue();
-            }
-            return this._mask.op.v * 100;
-        }
+    Object.defineProperty(_thisFunction, 'rotation', {
+      get: ExpressionPropertyInterface(transform.r || transform.rz),
     });
 
-	var MaskManager = function(maskManager, elem){
-		var _maskManager = maskManager;
-		var _elem = elem;
-		var _masksInterfaces = createSizedArray(maskManager.viewData.length);
-		var i, len = maskManager.viewData.length;
-		for(i = 0; i < len; i += 1) {
-			_masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
-		}
+    Object.defineProperty(_thisFunction, 'zRotation', {
+      get: ExpressionPropertyInterface(transform.rz || transform.r),
+    });
 
-		var maskFunction = function(name){
-			i = 0;
-		    while(i<len){
-		        if(maskManager.masksProperties[i].nm === name){
-		            return _masksInterfaces[i];
-		        }
-		        i += 1;
-		    }
-		};
-		return maskFunction;
-	};
-	return MaskManager;
+    Object.defineProperty(_thisFunction, 'xRotation', {
+      get: ExpressionPropertyInterface(transform.rx),
+    });
+
+    Object.defineProperty(_thisFunction, 'yRotation', {
+      get: ExpressionPropertyInterface(transform.ry),
+    });
+    Object.defineProperty(_thisFunction, 'scale', {
+      get: ExpressionPropertyInterface(transform.s),
+    });
+    var _px;
+    var _py;
+    var _pz;
+    var _transformFactory;
+    if (transform.p) {
+      _transformFactory = ExpressionPropertyInterface(transform.p);
+    } else {
+      _px = ExpressionPropertyInterface(transform.px);
+      _py = ExpressionPropertyInterface(transform.py);
+      if (transform.pz) {
+        _pz = ExpressionPropertyInterface(transform.pz);
+      }
+    }
+    Object.defineProperty(_thisFunction, 'position', {
+      get: function () {
+        if (transform.p) {
+          return _transformFactory();
+        }
+        return [
+          _px(),
+          _py(),
+          _pz ? _pz() : 0];
+      },
+    });
+
+    Object.defineProperty(_thisFunction, 'xPosition', {
+      get: ExpressionPropertyInterface(transform.px),
+    });
+
+    Object.defineProperty(_thisFunction, 'yPosition', {
+      get: ExpressionPropertyInterface(transform.py),
+    });
+
+    Object.defineProperty(_thisFunction, 'zPosition', {
+      get: ExpressionPropertyInterface(transform.pz),
+    });
+
+    Object.defineProperty(_thisFunction, 'anchorPoint', {
+      get: ExpressionPropertyInterface(transform.a),
+    });
+
+    Object.defineProperty(_thisFunction, 'opacity', {
+      get: ExpressionPropertyInterface(transform.o),
+    });
+
+    Object.defineProperty(_thisFunction, 'skew', {
+      get: ExpressionPropertyInterface(transform.sk),
+    });
+
+    Object.defineProperty(_thisFunction, 'skewAxis', {
+      get: ExpressionPropertyInterface(transform.sa),
+    });
+
+    Object.defineProperty(_thisFunction, 'orientation', {
+      get: ExpressionPropertyInterface(transform.or),
+    });
+
+    return _thisFunction;
+  };
 }());
 
-var ExpressionPropertyInterface = (function() {
+/* exported ProjectInterface */
 
-    var defaultUnidimensionalValue = {pv:0, v:0, mult: 1}
-    var defaultMultidimensionalValue = {pv:[0,0,0], v:[0,0,0], mult: 1}
+var ProjectInterface = (function () {
+  function registerComposition(comp) {
+    this.compositions.push(comp);
+  }
 
-    function completeProperty(expressionValue, property, type) {
-        Object.defineProperty(expressionValue, 'velocity', {
-            get: function(){
-                return property.getVelocityAtTime(property.comp.currentFrame);
-            }
-        });
-        expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
-        expressionValue.key = function(pos) {
-            if (!expressionValue.numKeys) {
-                return 0;
-            } else {
-                var value = '';
-                if ('s' in property.keyframes[pos-1]) {
-                    value = property.keyframes[pos-1].s;
-                } else if ('e' in property.keyframes[pos-2]) {
-                    value = property.keyframes[pos-2].e;
-                } else {
-                    value = property.keyframes[pos-2].s;
-                }
-                var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value);
-                valueProp.time = property.keyframes[pos-1].t / property.elem.comp.globalData.frameRate;
-                valueProp.value = type === 'unidimensional' ? value[0] : value;
-                return valueProp;
-            }
-        };
-        expressionValue.valueAtTime = property.getValueAtTime;
-        expressionValue.speedAtTime = property.getSpeedAtTime;
-        expressionValue.velocityAtTime = property.getVelocityAtTime;
-        expressionValue.propertyGroup = property.propertyGroup;
+  return function () {
+    function _thisProjectFunction(name) {
+      var i = 0;
+      var len = this.compositions.length;
+      while (i < len) {
+        if (this.compositions[i].data && this.compositions[i].data.nm === name) {
+          if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
+            this.compositions[i].prepareFrame(this.currentFrame);
+          }
+          return this.compositions[i].compInterface;
+        }
+        i += 1;
+      }
+      return null;
     }
 
-    function UnidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultUnidimensionalValue;
+    _thisProjectFunction.compositions = [];
+    _thisProjectFunction.currentFrame = 0;
+
+    _thisProjectFunction.registerComposition = registerComposition;
+
+    return _thisProjectFunction;
+  };
+}());
+
+/* global propertyGroupFactory, ExpressionPropertyInterface, PropertyInterface */
+/* exported EffectsExpressionInterface */
+
+var EffectsExpressionInterface = (function () {
+  var ob = {
+    createEffectsInterface: createEffectsInterface,
+  };
+
+  function createEffectsInterface(elem, propertyGroup) {
+    if (elem.effectsManager) {
+      var effectElements = [];
+      var effectsData = elem.data.ef;
+      var i;
+      var len = elem.effectsManager.effectElements.length;
+      for (i = 0; i < len; i += 1) {
+        effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem));
+      }
+
+      var effects = elem.data.ef || [];
+      var groupInterface = function (name) {
+        i = 0;
+        len = effects.length;
+        while (i < len) {
+          if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+            return effectElements[i];
+          }
+          i += 1;
         }
-        var mult = 1 / property.mult;
-        var val = property.pv * mult;
-        var expressionValue = new Number(val);
+        return null;
+      };
+      Object.defineProperty(groupInterface, 'numProperties', {
+        get: function () {
+          return effects.length;
+        },
+      });
+      return groupInterface;
+    }
+    return null;
+  }
+
+  function createGroupInterface(data, elements, propertyGroup, elem) {
+    function groupInterface(name) {
+      var effects = data.ef;
+      var i = 0;
+      var len = effects.length;
+      while (i < len) {
+        if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+          if (effects[i].ty === 5) {
+            return effectElements[i];
+          }
+          return effectElements[i]();
+        }
+        i += 1;
+      }
+      throw new Error();
+    }
+    var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
+
+    var effectElements = [];
+    var i;
+    var len = data.ef.length;
+    for (i = 0; i < len; i += 1) {
+      if (data.ef[i].ty === 5) {
+        effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem));
+      } else {
+        effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup));
+      }
+    }
+
+    if (data.mn === 'ADBE Color Control') {
+      Object.defineProperty(groupInterface, 'color', {
+        get: function () {
+          return effectElements[0]();
+        },
+      });
+    }
+    Object.defineProperties(groupInterface, {
+      numProperties: {
+        get: function () {
+          return data.np;
+        },
+      },
+      _name: { value: data.nm },
+      propertyGroup: { value: _propertyGroup },
+    });
+    groupInterface.enabled = data.en !== 0;
+    groupInterface.active = groupInterface.enabled;
+    return groupInterface;
+  }
+
+  function createValueInterface(element, type, elem, propertyGroup) {
+    var expressionProperty = ExpressionPropertyInterface(element.p);
+    function interfaceFunction() {
+      if (type === 10) {
+        return elem.comp.compInterface(element.p.v);
+      }
+      return expressionProperty();
+    }
+
+    if (element.p.setGroupProperty) {
+      element.p.setGroupProperty(PropertyInterface('', propertyGroup));
+    }
+
+    return interfaceFunction;
+  }
+
+  return ob;
+}());
+
+/* global createSizedArray */
+/* exported MaskManagerInterface */
+
+var MaskManagerInterface = (function () {
+  function MaskInterface(mask, data) {
+    this._mask = mask;
+    this._data = data;
+  }
+  Object.defineProperty(MaskInterface.prototype, 'maskPath', {
+    get: function () {
+      if (this._mask.prop.k) {
+        this._mask.prop.getValue();
+      }
+      return this._mask.prop;
+    },
+  });
+  Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
+    get: function () {
+      if (this._mask.op.k) {
+        this._mask.op.getValue();
+      }
+      return this._mask.op.v * 100;
+    },
+  });
+
+  var MaskManager = function (maskManager) {
+    var _masksInterfaces = createSizedArray(maskManager.viewData.length);
+    var i;
+    var len = maskManager.viewData.length;
+    for (i = 0; i < len; i += 1) {
+      _masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
+    }
+
+    var maskFunction = function (name) {
+      i = 0;
+      while (i < len) {
+        if (maskManager.masksProperties[i].nm === name) {
+          return _masksInterfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    };
+    return maskFunction;
+  };
+  return MaskManager;
+}());
+
+/* global createTypedArray */
+/* exported ExpressionPropertyInterface */
+
+var ExpressionPropertyInterface = (function () {
+  var defaultUnidimensionalValue = { pv: 0, v: 0, mult: 1 };
+  var defaultMultidimensionalValue = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 };
+
+  function completeProperty(expressionValue, property, type) {
+    Object.defineProperty(expressionValue, 'velocity', {
+      get: function () {
+        return property.getVelocityAtTime(property.comp.currentFrame);
+      },
+    });
+    expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
+    expressionValue.key = function (pos) {
+      if (!expressionValue.numKeys) {
+        return 0;
+      }
+      var value = '';
+      if ('s' in property.keyframes[pos - 1]) {
+        value = property.keyframes[pos - 1].s;
+      } else if ('e' in property.keyframes[pos - 2]) {
+        value = property.keyframes[pos - 2].e;
+      } else {
+        value = property.keyframes[pos - 2].s;
+      }
+      var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value); // eslint-disable-line no-new-wrappers
+      valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate;
+      valueProp.value = type === 'unidimensional' ? value[0] : value;
+      return valueProp;
+    };
+    expressionValue.valueAtTime = property.getValueAtTime;
+    expressionValue.speedAtTime = property.getSpeedAtTime;
+    expressionValue.velocityAtTime = property.getVelocityAtTime;
+    expressionValue.propertyGroup = property.propertyGroup;
+  }
+
+  function UnidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultUnidimensionalValue;
+    }
+    var mult = 1 / property.mult;
+    var val = property.pv * mult;
+    var expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
+    expressionValue.value = val;
+    completeProperty(expressionValue, property, 'unidimensional');
+
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      val = property.v * mult;
+      if (expressionValue.value !== val) {
+        expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
         expressionValue.value = val;
         completeProperty(expressionValue, property, 'unidimensional');
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            val = property.v * mult;
-            if(expressionValue.value !== val) {
-                expressionValue = new Number(val);
-                expressionValue.value = val;
-                completeProperty(expressionValue, property, 'unidimensional');
-            }
-            return expressionValue;
-        }
+  function MultidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultMultidimensionalValue;
     }
+    var mult = 1 / property.mult;
+    var len = (property.data && property.data.l) || property.pv.length;
+    var expressionValue = createTypedArray('float32', len);
+    var arrValue = createTypedArray('float32', len);
+    expressionValue.value = arrValue;
+    completeProperty(expressionValue, property, 'multidimensional');
 
-    function MultidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultMultidimensionalValue;
-        }
-        var mult = 1 / property.mult;
-        var len = (property.data && property.data.l) || property.pv.length;
-        var expressionValue = createTypedArray('float32', len);
-        var arrValue = createTypedArray('float32', len);
-        expressionValue.value = arrValue;
-        completeProperty(expressionValue, property, 'multidimensional');
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      for (var i = 0; i < len; i += 1) {
+        arrValue[i] = property.v[i] * mult;
+        expressionValue[i] = arrValue[i];
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            for (var i = 0; i < len; i += 1) {
-                expressionValue[i] = arrValue[i] = property.v[i] * mult;
-            }
-            return expressionValue;
-        }
-    }
+  // TODO: try to avoid using this getter
+  function defaultGetter() {
+    return defaultUnidimensionalValue;
+  }
 
-    //TODO: try to avoid using this getter
-    function defaultGetter() {
-        return defaultUnidimensionalValue;
+  return function (property) {
+    if (!property) {
+      return defaultGetter;
+    } if (property.propType === 'unidimensional') {
+      return UnidimensionalPropertyInterface(property);
     }
-    
-    return function(property) {
-        if(!property) {
-            return defaultGetter;
-        } else if (property.propType === 'unidimensional') {
-            return UnidimensionalPropertyInterface(property);
-        } else {
-            return MultidimensionalPropertyInterface(property);
-        }
-    }
+    return MultidimensionalPropertyInterface(property);
+  };
 }());
 
-(function(){
+/* global expressionHelpers, TextSelectorProp, ExpressionManager */
+/* exported TextExpressionSelectorProp */
 
-    var TextExpressionSelectorProp = (function(){
-
-        function getValueProxy(index,total){
-            this.textIndex = index+1;
-            this.textTotal = total;
-            this.v = this.getValue() * this.mult;
-            return this.v;
-        }
-
-        return function TextExpressionSelectorProp(elem,data){
-            this.pv = 1;
-            this.comp = elem.comp;
-            this.elem = elem;
-            this.mult = 0.01;
-            this.propType = 'textSelector';
-            this.textTotal = data.totalChars;
-            this.selectorValue = 100;
-            this.lastValue = [1,1,1];
-            this.k = true;
-            this.x = true;
-            this.getValue = ExpressionManager.initiateExpression.bind(this)(elem,data,this);
-            this.getMult = getValueProxy;
-            this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
-            if(this.kf){
-                this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
-            } else {
-                this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
-            }
-            this.setGroupProperty = expressionHelpers.setGroupProperty;
-        };
-    }());
-
-	var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
-	TextSelectorProp.getTextSelectorProp = function(elem, data,arr){
-	    if(data.t === 1){
-	        return new TextExpressionSelectorProp(elem, data,arr);
-	    } else {
-	        return propertyGetTextProp(elem,data,arr);
-	    }
-	};
-}());
-function SliderEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function AngleEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function ColorEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function PointEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function LayerIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function MaskIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function CheckboxEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function NoValueEffect(){
-    this.p = {};
-}
-function EffectsManager(data,element){
-    var effects = data.ef || [];
-    this.effectElements = [];
-    var i,len = effects.length;
-    var effectItem;
-    for(i=0;i<len;i++) {
-        effectItem = new GroupEffect(effects[i],element);
-        this.effectElements.push(effectItem);
+(function () {
+  var TextExpressionSelectorProp = (function () { // eslint-disable-line no-unused-vars
+    function getValueProxy(index, total) {
+      this.textIndex = index + 1;
+      this.textTotal = total;
+      this.v = this.getValue() * this.mult;
+      return this.v;
     }
+
+    return function TextExpressionSelectorPropFactory(elem, data) {
+      this.pv = 1;
+      this.comp = elem.comp;
+      this.elem = elem;
+      this.mult = 0.01;
+      this.propType = 'textSelector';
+      this.textTotal = data.totalChars;
+      this.selectorValue = 100;
+      this.lastValue = [1, 1, 1];
+      this.k = true;
+      this.x = true;
+      this.getValue = ExpressionManager.initiateExpression.bind(this)(elem, data, this);
+      this.getMult = getValueProxy;
+      this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
+      if (this.kf) {
+        this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
+      } else {
+        this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
+      }
+      this.setGroupProperty = expressionHelpers.setGroupProperty;
+    };
+  }());
+
+  var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
+  TextSelectorProp.getTextSelectorProp = function (elem, data, arr) {
+    if (data.t === 1) {
+      return new TextExpressionSelectorPropFactory(elem, data, arr); // eslint-disable-line no-undef
+    }
+    return propertyGetTextProp(elem, data, arr);
+  };
+}());
+
+/* global PropertyFactory */
+/* exported SliderEffect, AngleEffect, ColorEffect, PointEffect, LayerIndexEffect, MaskIndexEffect, CheckboxEffect, NoValueEffect */
+
+function SliderEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function AngleEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function ColorEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function PointEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function LayerIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function MaskIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function CheckboxEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function NoValueEffect() {
+  this.p = {};
 }
 
-function GroupEffect(data,element){
-    this.init(data,element);
+/* global extendPrototype, SliderEffect, AngleEffect, ColorEffect, PointEffect, CheckboxEffect, LayerIndexEffect,
+MaskIndexEffect, NoValueEffect, DynamicPropertyContainer */
+
+function EffectsManager(data, element) {
+  var effects = data.ef || [];
+  this.effectElements = [];
+  var i;
+  var len = effects.length;
+  var effectItem;
+  for (i = 0; i < len; i += 1) {
+    effectItem = new GroupEffect(effects[i], element);
+    this.effectElements.push(effectItem);
+  }
+}
+
+function GroupEffect(data, element) {
+  this.init(data, element);
 }
 
 extendPrototype([DynamicPropertyContainer], GroupEffect);
 
 GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
 
-GroupEffect.prototype.init = function(data,element){
-    this.data = data;
-    this.effectElements = [];
-    this.initDynamicPropertyContainer(element);
-    var i, len = this.data.ef.length;
-    var eff, effects = this.data.ef;
-    for(i=0;i<len;i+=1){
-        eff = null;
-        switch(effects[i].ty){
-            case 0:
-                eff = new SliderEffect(effects[i],element,this);
-                break;
-            case 1:
-                eff = new AngleEffect(effects[i],element,this);
-                break;
-            case 2:
-                eff = new ColorEffect(effects[i],element,this);
-                break;
-            case 3:
-                eff = new PointEffect(effects[i],element,this);
-                break;
-            case 4:
-            case 7:
-                eff = new CheckboxEffect(effects[i],element,this);
-                break;
-            case 10:
-                eff = new LayerIndexEffect(effects[i],element,this);
-                break;
-            case 11:
-                eff = new MaskIndexEffect(effects[i],element,this);
-                break;
-            case 5:
-                eff = new EffectsManager(effects[i],element,this);
-                break;
-            //case 6:
-            default:
-                eff = new NoValueEffect(effects[i],element,this);
-                break;
-        }
-        if(eff) {
-            this.effectElements.push(eff);
-        }
+GroupEffect.prototype.init = function (data, element) {
+  this.data = data;
+  this.effectElements = [];
+  this.initDynamicPropertyContainer(element);
+  var i;
+  var len = this.data.ef.length;
+  var eff;
+  var effects = this.data.ef;
+  for (i = 0; i < len; i += 1) {
+    eff = null;
+    switch (effects[i].ty) {
+      case 0:
+        eff = new SliderEffect(effects[i], element, this);
+        break;
+      case 1:
+        eff = new AngleEffect(effects[i], element, this);
+        break;
+      case 2:
+        eff = new ColorEffect(effects[i], element, this);
+        break;
+      case 3:
+        eff = new PointEffect(effects[i], element, this);
+        break;
+      case 4:
+      case 7:
+        eff = new CheckboxEffect(effects[i], element, this);
+        break;
+      case 10:
+        eff = new LayerIndexEffect(effects[i], element, this);
+        break;
+      case 11:
+        eff = new MaskIndexEffect(effects[i], element, this);
+        break;
+      case 5:
+        eff = new EffectsManager(effects[i], element, this);
+        break;
+        // case 6:
+      default:
+        eff = new NoValueEffect(effects[i], element, this);
+        break;
     }
+    if (eff) {
+      this.effectElements.push(eff);
+    }
+  }
 };
 
+
 var lottie = {};
 
-var _isFrozen = false;
-
-function setLocationHref (href) {
-    locationHref = href;
+function setLocationHref(href) {
+  locationHref = href;
 }
 
 function searchAnimations() {
-    if (standalone === true) {
-        animationManager.searchAnimations(animationData, standalone, renderer);
-    } else {
-        animationManager.searchAnimations();
-    }
+  if (standalone === true) {
+    animationManager.searchAnimations(animationData, standalone, renderer);
+  } else {
+    animationManager.searchAnimations();
+  }
 }
 
 function setSubframeRendering(flag) {
-    subframeEnabled = flag;
+  subframeEnabled = flag;
 }
 
 function loadAnimation(params) {
-    if (standalone === true) {
-        params.animationData = JSON.parse(animationData);
-    }
-    return animationManager.loadAnimation(params);
+  if (standalone === true) {
+    params.animationData = JSON.parse(animationData);
+  }
+  return animationManager.loadAnimation(params);
 }
 
 function setQuality(value) {
-    if (typeof value === 'string') {
-        switch (value) {
-            case 'high':
-                defaultCurveSegments = 200;
-                break;
-            case 'medium':
-                defaultCurveSegments = 50;
-                break;
-            case 'low':
-                defaultCurveSegments = 10;
-                break;
-        }
-    } else if (!isNaN(value) && value > 1) {
-        defaultCurveSegments = value;
+  if (typeof value === 'string') {
+    switch (value) {
+      case 'high':
+        defaultCurveSegments = 200;
+        break;
+      default:
+      case 'medium':
+        defaultCurveSegments = 50;
+        break;
+      case 'low':
+        defaultCurveSegments = 10;
+        break;
     }
-    if (defaultCurveSegments >= 50) {
-        roundValues(false);
-    } else {
-        roundValues(true);
-    }
+  } else if (!isNaN(value) && value > 1) {
+    defaultCurveSegments = value;
+  }
+  if (defaultCurveSegments >= 50) {
+    roundValues(false);
+  } else {
+    roundValues(true);
+  }
 }
 
 function inBrowser() {
-    return typeof navigator !== 'undefined';
+  return typeof navigator !== 'undefined';
 }
 
 function installPlugin(type, plugin) {
-    if (type === 'expressions') {
-        expressionsPlugin = plugin;
-    }
+  if (type === 'expressions') {
+    expressionsPlugin = plugin;
+  }
 }
 
 function getFactory(name) {
-    switch (name) {
-        case "propertyFactory":
-            return PropertyFactory;
-        case "shapePropertyFactory":
-            return ShapePropertyFactory;
-        case "matrix":
-            return Matrix;
-    }
+  switch (name) {
+    case 'propertyFactory':
+      return PropertyFactory;
+    case 'shapePropertyFactory':
+      return ShapePropertyFactory;
+    case 'matrix':
+      return Matrix;
+    default:
+      return null;
+  }
 }
 
 lottie.play = animationManager.play;
@@ -14979,7 +15890,7 @@
 lottie.loadAnimation = loadAnimation;
 lottie.setSubframeRendering = setSubframeRendering;
 lottie.resize = animationManager.resize;
-//lottie.start = start;
+// lottie.start = start;
 lottie.goToAndStop = animationManager.goToAndStop;
 lottie.destroy = animationManager.destroy;
 lottie.setQuality = setQuality;
@@ -14992,35 +15903,37 @@
 lottie.unmute = animationManager.unmute;
 lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
 lottie.__getFactory = getFactory;
-lottie.version = '5.7.5';
+lottie.version = '5.7.6';
 
 function checkReady() {
-    if (document.readyState === "complete") {
-        clearInterval(readyStateCheckInterval);
-        searchAnimations();
-    }
+  if (document.readyState === 'complete') {
+    clearInterval(readyStateCheckInterval);
+    searchAnimations();
+  }
 }
 
 function getQueryVariable(variable) {
-    var vars = queryString.split('&');
-    for (var i = 0; i < vars.length; i++) {
-        var pair = vars[i].split('=');
-        if (decodeURIComponent(pair[0]) == variable) {
-            return decodeURIComponent(pair[1]);
-        }
+  var vars = queryString.split('&');
+  for (var i = 0; i < vars.length; i += 1) {
+    var pair = vars[i].split('=');
+    if (decodeURIComponent(pair[0]) == variable) { // eslint-disable-line eqeqeq
+      return decodeURIComponent(pair[1]);
     }
+  }
+  return null;
 }
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
+var queryString;
 if (standalone) {
-    var scripts = document.getElementsByTagName('script');
-    var index = scripts.length - 1;
-    var myScript = scripts[index] || {
-        src: ''
-    };
-    var queryString = myScript.src.replace(/^[^\?]+\??/, '');
-    renderer = getQueryVariable('renderer');
+  var scripts = document.getElementsByTagName('script');
+  var index = scripts.length - 1;
+  var myScript = scripts[index] || {
+    src: '',
+  };
+  queryString = myScript.src.replace(/^[^\?]+\??/, ''); // eslint-disable-line no-useless-escape
+  renderer = getQueryVariable('renderer');
 }
 var readyStateCheckInterval = setInterval(checkReady, 100);
 
diff --git a/build/player/lottie.min.js b/build/player/lottie.min.js
index 0d379ce..32cb749 100644
--- a/build/player/lottie.min.js
+++ b/build/player/lottie.min.js
@@ -10,6 +10,6 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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"],i=e.length;for(t=0;t<i;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,i=createSizedArray(t.length),r=t.length;for(e=0;e<r;e+=1)i[e]=Math.abs(t[e]);return i}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,i,r){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=r<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,i,r){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=r<0?-1:1}function BMSegmentStartEvent(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e,this.currentTime=currentTime}roundValues(!1);var createElementID=(G=0,function(){return"__lottie_element_"+ ++G}),G;function HSVtoRGB(t,e,i){var r,s,a,n,o,h,l,p;switch(h=i*(1-e),l=i*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=i*(1-(1-o)*e),n%6){case 0:r=i,s=p,a=h;break;case 1:r=l,s=i,a=h;break;case 2:r=h,s=i,a=p;break;case 3:r=h,s=l,a=i;break;case 4:r=p,s=h,a=i;break;case 5:r=i,s=h,a=l}return[r,s,a]}function RGBtoHSV(t,e,i){var r,s=Math.max(t,e,i),a=Math.min(t,e,i),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:r=0;break;case t:r=e-i+n*(e<i?6:0),r/=6*n;break;case e:r=i-t+2*n,r/=6*n;break;case i:r=t-e+4*n,r/=6*n}return[r,o,h]}function addSaturationToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[1]+=e,1<i[1]?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[2]+=e,1<i[2]?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,1<i[0]?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t,e,r=[];for(t=0;t<256;t+=1)e=t.toString(16),r[t]=1==e.length?"0"+e:e;return function(t,e,i){return t<0&&(t=0),e<0&&(e=0),i<0&&(i=0),"#"+r[t]+r[e]+r[i]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t].length,r=0;r<i;r++)this._cbs[t][r](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var i=0,r=this._cbs[t].length;i<r;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,r-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var i,r=0,s=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(r=0;r<e;r+=1)s.push(i);return s};function createSizedArray(t){return Array.apply(null,{length:t})}function createNS(t){return document.createElementNS(svgNS,t)}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Pa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Pa[t]||""}),Pa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,r=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),i=a(t);return this._t(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1)}function i(t){if(0===t)return this;var e=s(t),i=a(t);return this._t(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),i=a(t);return this._t(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),i=a(t);return this._t(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function m(t,e){var i=s(e),r=a(e);return this._t(i,r,0,0,-r,i,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(i,-r,0,0,r,i,0,0,0,0,1,0,0,0,0,1)}function f(t,e,i){return i||0===i||(i=1),1===t&&1===e&&1===i?this:this._t(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)}function c(t,e,i,r,s,a,n,o,h,l,p,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=i,this.props[3]=r,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,i){return i=i||0,0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}function u(t,e,i,r,s,a,n,o,h,l,p,m,f,c,d,u){var y=this.props;if(1===t&&0===e&&0===i&&0===r&&0===s&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return y[12]=y[12]*t+y[15]*f,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*p+y[15]*d,y[15]=y[15]*u,this._identityCalculated=!1,this;var g=y[0],v=y[1],b=y[2],E=y[3],x=y[4],P=y[5],S=y[6],_=y[7],C=y[8],A=y[9],T=y[10],k=y[11],M=y[12],D=y[13],w=y[14],F=y[15];return y[0]=g*t+v*s+b*h+E*f,y[1]=g*e+v*a+b*l+E*c,y[2]=g*i+v*n+b*p+E*d,y[3]=g*r+v*o+b*m+E*u,y[4]=x*t+P*s+S*h+_*f,y[5]=x*e+P*a+S*l+_*c,y[6]=x*i+P*n+S*p+_*d,y[7]=x*r+P*o+S*m+_*u,y[8]=C*t+A*s+T*h+k*f,y[9]=C*e+A*a+T*l+k*c,y[10]=C*i+A*n+T*p+k*d,y[11]=C*r+A*o+T*m+k*u,y[12]=M*t+D*s+w*h+F*f,y[13]=M*e+D*a+w*l+F*c,y[14]=M*i+D*n+w*p+F*d,y[15]=M*r+D*o+w*m+F*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function E(t,e,i){return{x:t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}}function x(t,e,i){return t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12]}function P(t,e,i){return t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13]}function S(t,e,i){return t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}function _(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,i=-this.props[1]/t,r=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=i,o.props[4]=r,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function C(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function A(t){var e,i=t.length,r=[];for(e=0;e<i;e+=1)r[e]=C(t[e]);return r}function T(t,e,i){var r=createTypedArray("float32",6);if(this.isIdentity())r[0]=t[0],r[1]=t[1],r[2]=e[0],r[3]=e[1],r[4]=i[0],r[5]=i[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];r[0]=t[0]*s+t[1]*n+h,r[1]=t[0]*a+t[1]*o+l,r[2]=e[0]*s+e[1]*n+h,r[3]=e[0]*a+e[1]*o+l,r[4]=i[0]*s+i[1]*n+h,r[5]=i[0]*a+i[1]*o+l}return r}function k(t,e,i){return this.isIdentity()?[t,e,i]:[t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]]}function M(t,e){if(this.isIdentity())return t+","+e;var i=this.props;return Math.round(100*(t*i[0]+e*i[4]+i[12]))/100+","+Math.round(100*(t*i[1]+e*i[5]+i[13]))/100}function D(){for(var t=0,e=this.props,i="matrix3d(";t<16;)i+=r(1e4*e[t])/1e4,i+=15===t?")":",",t+=1;return i}function w(t){return t<1e-6&&0<t||-1e-6<t&&t<0?r(1e4*t)/1e4:t}function F(){var t=this.props;return"matrix("+w(t[0])+","+w(t[1])+","+w(t[4])+","+w(t[5])+","+w(t[12])+","+w(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=i,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=m,this.shear=l,this.scale=f,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=E,this.applyToX=x,this.applyToY=P,this.applyToZ=S,this.applyToPointArray=k,this.applyToTriplePoints=T,this.applyToPointStringified=M,this.toCSS=D,this.to2dCSS=F,this.clone=v,this.cloneFromProps=b,this.equals=g,this.inversePoints=A,this.inversePoint=C,this.getInverseMatrix=_,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var l,p=this,m=256,f=6,c="random",d=h.pow(m,f),u=h.pow(2,52),y=2*u,g=m-1;function v(t){var e,i=t.length,n=this,r=0,s=n.i=n.j=0,a=n.S=[];for(i||(t=[i++]);r<m;)a[r]=r++;for(r=0;r<m;r++)a[r]=a[s=g&s+t[r%i]+(e=a[r])],a[s]=e;n.g=function(t){for(var e,i=0,r=n.i,s=n.j,a=n.S;t--;)e=a[r=g&r+1],i=i*m+a[g&(a[r]=a[s=g&s+e])+(a[s]=e)];return n.i=r,n.j=s,i}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function E(t,e){for(var i,r=t+"",s=0;s<r.length;)e[g&s]=g&(i^=19*e[g&s])+r.charCodeAt(s++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,i){var r=[],s=E(function t(e,i){var r,s=[],a=typeof e;if(i&&"object"==a)for(r in e)try{s.push(t(e[r],i-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,x(o)]:null===t?function(){try{if(l)return x(l.randomBytes(m));var t=new Uint8Array(m);return(p.crypto||p.msCrypto).getRandomValues(t),x(t)}catch(t){var e=p.navigator,i=e&&e.plugins;return[+new Date,p,i,p.screen,x(o)]}}():t,3),r),a=new v(r),n=function(){for(var t=a.g(f),e=d,i=0;t<u;)t=(t+i)*m,e*=m,i=a.g(1);for(;y<=t;)t/=2,e/=2,i>>>=1;return(t+i)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,E(x(a.S),o),(e.pass||i||function(t,e,i,r){return r&&(r.S&&b(r,a),t.state=function(){return b(a,{})}),i?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},E(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,i,r,s){var a=s||("bez_"+t+"_"+e+"_"+i+"_"+r).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,i,r]);return o[a]=n}},o={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function r(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function m(t,e,i){return((r(e,i)*t+s(e,i))*t+a(e))*t}function f(t,e,i){return 3*r(e,i)*t*t+2*s(e,i)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],i=this._p[1],r=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===i&&r===s?t:0===t?0:1===t?1:m(this._getTForX(t),i,s)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],r=this._p[3];this._precomputed=!0,t===e&&i===r||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],i=0;i<l;++i)this._mSampleValues[i]=m(i*p,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],r=this._mSampleValues,s=0,a=1,n=l-1;a!==n&&r[a]<=t;++a)s+=p;var o=s+(t-r[--a])/(r[a+1]-r[a])*p,h=f(o,e,i);return.001<=h?function(t,e,i,r){for(var s=0;s<4;++s){var a=f(e,i,r);if(0===a)return e;e-=(m(e,i,r)-t)/a}return e}(t,o,e,i):0===h?o:function(t,e,i,r,s){for(var a,n,o=0;0<(a=m(n=e+(i-e)/2,r,s)-t)?i=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+p,e,i)}},t}();function extendPrototype(t,e){var i,r,s=t.length;for(i=0;i<s;i+=1)for(var a in r=t[i].prototype)r.hasOwnProperty(a)&&(e.prototype[a]=r[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){Math;function y(t,e,i,r,s,a){var n=t*r+e*s+i*a-s*r-a*t-i*e;return-.001<n&&n<.001}var p=function(t,e,i,r){var s,a,n,o,h,l,p=defaultCurveSegments,m=0,f=[],c=[],d=bezier_length_pool.newElement();for(n=i.length,s=0;s<p;s+=1){for(h=s/(p-1),a=l=0;a<n;a+=1)o=bm_pow(1-h,3)*t[a]+3*bm_pow(1-h,2)*h*i[a]+3*(1-h)*bm_pow(h,2)*r[a]+bm_pow(h,3)*e[a],f[a]=o,null!==c[a]&&(l+=bm_pow(f[a]-c[a],2)),c[a]=f[a];l&&(m+=l=bm_sqrt(l)),d.percents[s]=h,d.lengths[s]=m}return d.addedLength=m,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,i,r){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+i[0]+"_"+i[1]+"_"+r[0]+"_"+r[1]).replace(/\./g,"p");if(!b[s]){var a,n,o,h,l,p,m,f=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&y(t[0],t[1],e[0],e[1],t[0]+i[0],t[1]+i[1])&&y(t[0],t[1],e[0],e[1],e[0]+r[0],e[1]+r[1])&&(f=2);var u=new g(f);for(o=i.length,a=0;a<f;a+=1){for(m=createSizedArray(o),l=a/(f-1),n=p=0;n<o;n+=1)h=bm_pow(1-l,3)*t[n]+3*bm_pow(1-l,2)*l*(t[n]+i[n])+3*(1-l)*bm_pow(l,2)*(e[n]+r[n])+bm_pow(l,3)*e[n],m[n]=h,null!==d&&(p+=bm_pow(m[n]-d[n],2));c+=p=bm_sqrt(p),u.points[a]=new v(p,m),d=m}u.segmentLength=c,b[s]=u}return b[s]});function M(t,e){var i=e.percents,r=e.lengths,s=i.length,a=bm_floor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===r[a])return i[a];for(var h=r[a]>n?-1:1,l=!0;l;)if(r[a]<=n&&r[a+1]>n?(o=(n-r[a])/(r[a+1]-r[a]),l=!1):a+=h,a<0||s-1<=a){if(a===s-1)return i[a];l=!1}return i[a]+(i[a+1]-i[a])*o}var D=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,i=segments_length_pool.newElement(),r=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=i.lengths,l=0;for(e=0;e<o-1;e+=1)h[e]=p(s[e],s[e+1],a[e],n[e+1]),l+=h[e].addedLength;return r&&o&&(h[e]=p(s[e],s[0],a[e],n[0]),l+=h[e].addedLength),i.totalLength=l,i},getNewSegment:function(t,e,i,r,s,a,n){var o,h=M(s=s<0?0:1<s?1:s,n),l=M(a=1<a?1:a,n),p=t.length,m=1-h,f=1-l,c=m*m*m,d=h*m*m*3,u=h*h*m*3,y=h*h*h,g=m*m*f,v=h*m*f+m*h*f+m*m*l,b=h*h*f+m*h*l+h*m*l,E=h*h*l,x=m*f*f,P=h*f*f+m*l*f+m*f*l,S=h*l*f+m*l*l+h*f*l,_=h*l*l,C=f*f*f,A=l*f*f+f*l*f+f*f*l,T=l*l*f+f*l*l+l*f*l,k=l*l*l;for(o=0;o<p;o+=1)D[4*o]=Math.round(1e3*(c*t[o]+d*i[o]+u*r[o]+y*e[o]))/1e3,D[4*o+1]=Math.round(1e3*(g*t[o]+v*i[o]+b*r[o]+E*e[o]))/1e3,D[4*o+2]=Math.round(1e3*(x*t[o]+P*i[o]+S*r[o]+_*e[o]))/1e3,D[4*o+3]=Math.round(1e3*(C*t[o]+A*i[o]+T*r[o]+k*e[o]))/1e3;return D},getPointInSegment:function(t,e,i,r,s,a){var n=M(s,a),o=1-n;return[Math.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*i[0]+(n*n*o+o*n*n+n*o*n)*r[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*i[1]+(n*n*o+o*n*n+n*o*n)*r[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,i,r,s,a,n,o,h){if(0===i&&0===a&&0===h)return y(t,e,r,s,n,o);var l,p=Math.sqrt(Math.pow(r-t,2)+Math.pow(s-e,2)+Math.pow(a-i,2)),m=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-i,2)),f=Math.sqrt(Math.pow(n-r,2)+Math.pow(o-s,2)+Math.pow(h-a,2));return-1e-4<(l=m<p?f<p?p-m-f:f-m-p:m<f?f-m-p:m-p-f)&&l<1e-4}}}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var i=(new Date).getTime(),r=Math.max(0,16-(i-a)),s=setTimeout(function(){t(i+r)},r);return a=i+r,s}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function m(t,e,i){var r,s,a,n,o,h,l=t.length;for(s=0;s<l;s+=1)if("ks"in(r=t[s])&&!r.completed){if(r.completed=!0,r.tt&&(t[s-1].td=r.tt),[],-1,r.hasMask){var p=r.masksProperties;for(n=p.length,a=0;a<n;a+=1)if(p[a].pt.k.i)d(p[a].pt.k);else for(h=p[a].pt.k.length,o=0;o<h;o+=1)p[a].pt.k[o].s&&d(p[a].pt.k[o].s[0]),p[a].pt.k[o].e&&d(p[a].pt.k[o].e[0])}0===r.ty?(r.layers=f(r.refId,e),m(r.layers,e,i)):4===r.ty?c(r.shapes):5==r.ty&&u(r,i)}}function f(t,e){for(var i=0,r=e.length;i<r;){if(e[i].id===t)return e[i].layers.__used?JSON.parse(JSON.stringify(e[i].layers)):(e[i].layers.__used=!0,e[i].layers);i+=1}}function c(t){var e,i,r;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)d(t[e].ks.k);else for(r=t[e].ks.k.length,i=0;i<r;i+=1)t[e].ks.k[i].s&&d(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&d(t[e].ks.k[i].e[0]);!0}else"gr"==t[e].ty&&c(t[e].it)}function d(t){var e,i=t.i.length;for(e=0;e<i;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var i=e?e.split("."):[100,100,100];return t[0]>i[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&void 0))}var h,i=function(){var r=[4,4,14];function s(t){var e,i,r,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(i=t[e],void 0,r=i.t.d,i.t.d={k:[{s:r,t:0}]})}return function(t){if(o(r,t.v)&&(s(t.layers),t.assets)){var e,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),r=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,i,r,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(r=(a=t.chars[e].data.shapes[0].it).length,i=0;i<r;i+=1)(s=a[i].ks.k).__converted||(d(a[i].ks.k),s.__converted=!0)}}),s=function(){var r=[4,1,9];function a(t){var e,i,r,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(r=t[e].c.k.length,i=0;i<r;i+=1)t[e].c.k[i].s&&(t[e].c.k[i].s[0]/=255,t[e].c.k[i].s[1]/=255,t[e].c.k[i].s[2]/=255,t[e].c.k[i].s[3]/=255),t[e].c.k[i].e&&(t[e].c.k[i].e[0]/=255,t[e].c.k[i].e[1]/=255,t[e].c.k[i].e[2]/=255,t[e].c.k[i].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,i=t.length;for(e=0;e<i;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(r,t.v)&&(s(t.layers),t.assets)){var e,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var r=[4,4,18];function l(t){var e,i,r;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(r=t[e].ks.k.length,i=0;i<r;i+=1)t[e].ks.k[i].s&&(t[e].ks.k[i].s[0].c=t[e].closed),t[e].ks.k[i].e&&(t[e].ks.k[i].e[0].c=t[e].closed);!0}else"gr"==t[e].ty&&l(t[e].it)}function s(t){var e,i,r,s,a,n,o=t.length;for(i=0;i<o;i+=1){if((e=t[i]).hasMask){var h=e.masksProperties;for(s=h.length,r=0;r<s;r+=1)if(h[r].pt.k.i)h[r].pt.k.c=h[r].cl;else for(n=h[r].pt.k.length,a=0;a<n;a+=1)h[r].pt.k[a].s&&(h[r].pt.k[a].s[0].c=h[r].cl),h[r].pt.k[a].e&&(h[r].pt.k[a].e[0].c=h[r].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(o(r,t.v)&&(s(t.layers),t.assets)){var e,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t,e){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),i(t),r(t),a(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=r,t.checkShapes=a,t.completeLayers=m,t}var dataManager=dataFunctionManager(),FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function u(t,e){var i=createTag("span");i.style.fontFamily=e;var r=createTag("span");r.innerText="giItT1WQy@!-/#",i.style.position="absolute",i.style.left="-10000px",i.style.top="-10000px",i.style.fontSize="300px",i.style.fontVariant="normal",i.style.fontStyle="normal",i.style.fontWeight="normal",i.style.letterSpacing="0",i.appendChild(r),document.body.appendChild(i);var s=r.offsetWidth;return r.style.fontFamily=function(t){var e,i=t.split(","),r=i.length,s=[];for(e=0;e<r;e+=1)"sans-serif"!==i[e]&&"monospace"!==i[e]&&s.push(i[e]);return s.join(",")}(t)+", "+e,{node:r,w:s,parent:i}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){this.chars||(this.chars=[]);var e,i,r,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(i=0,r=!1;i<a;)this.chars[i].style===t[e].style&&this.chars[i].fFamily===t[e].fFamily&&this.chars[i].ch===t[e].ch&&(r=!0),i+=1;r||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var i,r,s,a,n=t.list,o=n.length,h=o;for(i=0;i<o;i+=1){var l,p,m=!0;if(n[i].loaded=!1,n[i].monoCase=u(n[i].fFamily,"monospace"),n[i].sansCase=u(n[i].fFamily,"sans-serif"),n[i].fPath){if("p"===n[i].fOrigin||3===n[i].origin){if(0<(l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[i].fFamily+'"], style[f-origin="3"][f-family="'+n[i].fFamily+'"]')).length&&(m=!1),m){var f=createTag("style");f.setAttribute("f-forigin",n[i].fOrigin),f.setAttribute("f-origin",n[i].origin),f.setAttribute("f-family",n[i].fFamily),f.type="text/css",f.innerText="@font-face {font-family: "+n[i].fFamily+"; font-style: normal; src: url('"+n[i].fPath+"');}",e.appendChild(f)}}else if("g"===n[i].fOrigin||1===n[i].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),p=0;p<l.length;p++)-1!==l[p].href.indexOf(n[i].fPath)&&(m=!1);if(m){var c=createTag("link");c.setAttribute("f-forigin",n[i].fOrigin),c.setAttribute("f-origin",n[i].origin),c.type="text/css",c.rel="stylesheet",c.href=n[i].fPath,document.body.appendChild(c)}}else if("t"===n[i].fOrigin||2===n[i].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),p=0;p<l.length;p++)n[i].fPath===l[p].src&&(m=!1);if(m){var d=createTag("link");d.setAttribute("f-forigin",n[i].fOrigin),d.setAttribute("f-origin",n[i].origin),d.setAttribute("rel","stylesheet"),d.setAttribute("href",n[i].fPath),e.appendChild(d)}}}else n[i].loaded=!0,h-=1;n[i].helper=(r=e,s=n[i],a=void 0,(a=createNS("text")).style.fontSize="100px",a.setAttribute("font-family",s.fFamily),a.setAttribute("font-style",s.fStyle),a.setAttribute("font-weight",s.fWeight),a.textContent="1",s.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",s.fClass)):a.style.fontFamily=s.fFamily,r.appendChild(a),createTag("canvas").getContext("2d").font=s.fWeight+" "+s.fStyle+" 100px "+s.fFamily,a),n[i].cache={},this.fonts.push(n[i])}0===h?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,i){for(var r=0,s=this.chars.length;r<s;){if(this.chars[r].ch===t&&this.chars[r].style===e&&this.chars[r].fFamily===i)return this.chars[r];r+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,i)),a},getFontByName:function(t){for(var e=0,i=this.fonts.length;e<i;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,i){var r=this.getFontByName(e),s=t.charCodeAt(0);if(!r.cache[s+1]){var a=r.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();r.cache[s+1]=(n-o)/100}else a.textContent=t,r.cache[s+1]=a.getComputedTextLength()/100}return r.cache[s+1]*i},checkLoadedFonts:function(){var t,e,i,r=this.fonts.length,s=r;for(t=0;t<r;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,i=this.fonts[t].monoCase.w,e.offsetWidth!==i?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,i=this.fonts[t].sansCase.w,e.offsetWidth!==i&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),PropertyFactory=function(){var m=initialDefaultFrame,s=Math.abs;function f(t,e){var i,r=this.offsetTime;"multidimensional"===this.propType&&(i=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,l,p,m,f=e.lastIndex,c=f,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-r){s.h&&(s=a),f=0;break}if(a.t-r>t){f=c;break}c<d-1?c+=1:(f=0,u=!1)}var y,g,v,b,E,x,P,S,_,C,A=a.t-r,T=s.t-r;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var k=s.bezierData;if(A<=t||t<T){var M=A<=t?k.points.length-1:0;for(o=k.points[M].point.length,n=0;n<o;n+=1)i[n]=k.points[M].point[n]}else{s.__fnct?m=s.__fnct:(m=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=m),h=m((t-T)/(A-T));var D,w=k.segmentLength*h,F=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,l=k.points.length;u;){if(F+=k.points[p].partialLength,0===w||0===h||p===k.points.length-1){for(o=k.points[p].point.length,n=0;n<o;n+=1)i[n]=k.points[p].point[n];break}if(F<=w&&w<F+k.points[p+1].partialLength){for(D=(w-F)/k.points[p+1].partialLength,o=k.points[p].point.length,n=0;n<o;n+=1)i[n]=k.points[p].point[n]+(k.points[p+1].point[n]-k.points[p].point[n])*D;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=F-k.points[p].partialLength,e._lastKeyframeIndex=c}}else{var I,V,B,R,L;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(A<=t)i[0]=y[0],i[1]=y[1],i[2]=y[2];else if(t<=T)i[0]=s.s[0],i[1]=s.s[1],i[2]=s.s[2];else{var G=N(s.s),z=N(y);g=i,v=function(t,e,i){var r,s,a,n,o,h=[],l=t[0],p=t[1],m=t[2],f=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=l*c+p*d+m*u+f*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(r=Math.acos(s),a=Math.sin(r),n=Math.sin((1-i)*r)/a,Math.sin(i*r)/a):(n=1-i,i);return h[0]=n*l+o*c,h[1]=n*p+o*d,h[2]=n*m+o*u,h[3]=n*f+o*y,h}(G,z,(t-T)/(A-T)),b=v[0],E=v[1],x=v[2],P=v[3],S=Math.atan2(2*E*P-2*b*x,1-2*E*E-2*x*x),_=Math.asin(2*b*E+2*x*P),C=Math.atan2(2*b*P-2*E*x,1-2*b*b-2*x*x),g[0]=S/degToRads,g[1]=_/degToRads,g[2]=C/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=A<=t?1:t<T?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?m=s.__fnct[c]:(I=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],V=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],B=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],R=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],m=BezierFactory.getBezierEasing(I,V,B,R).get,s.__fnct[c]=m)):s.__fnct?m=s.__fnct:(I=s.o.x,V=s.o.y,B=s.i.x,R=s.i.y,m=BezierFactory.getBezierEasing(I,V,B,R).get,s.__fnct=m),m((t-T)/(A-T)))),y=a.s||s.e,L=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?i[c]=L:i=L}return e.lastIndex=f,i}function N(t){var e=t[0]*degToRads,i=t[1]*degToRads,r=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(r/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(r/2);return[o*h*n+s*a*l,o*a*n+s*h*l,s*h*n-o*a*l,s*a*n-o*h*l]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==m&&(this._caching.lastFrame>=i&&i<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(t,this._caching);this.pv=r}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var i=0,r=this.v.length;i<r;)e=t[i]*this.mult,1e-5<s(this.v[i]-e)&&(this.v[i]=e,this._mdf=!0),i+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,i,r){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,i,r){this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,a=e.k.length;this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a);createTypedArray("float32",a);for(this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,i,r){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:m,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=r,this.comp=t.comp,this.v=m,this.pv=m,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.effectsSequence=[c.bind(this)],this.addEffect=y}function l(t,e,i,r){this.propType="multidimensional";var s,a,n,o,h,l=e.k.length;for(s=0;s<l-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=r,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.frameId=-1;var p=e.k[0].s.length;for(this.v=createTypedArray("float32",p),this.pv=createTypedArray("float32",p),s=0;s<p;s+=1)this.v[s]=m,this.pv[s]=m;this._caching={lastFrame:m,lastIndex:0,value:createTypedArray("float32",p)},this.addEffect=y}return{getProp:function(t,e,i,r,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,r,s);else switch(i){case 0:a=new h(t,e,r,s);break;case 1:a=new l(t,e,r,s)}else a=new n(t,e,r,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function r(t,e,i){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(i||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var r,s=e.or.k.length;for(r=0;r<s;r+=1)e.or.k[r].to=e.or.k[r].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return r.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,i,r=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/r,0),this.p.getValueAtTime(this.p.keyframes[0].t/r,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/r,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/r,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/r,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(e[0]=s.getValueAtTime((s.keyframes[0].t+.01)/r,0),e[1]=a.getValueAtTime((a.keyframes[0].t+.01)/r,0),i[0]=s.getValueAtTime(s.keyframes[0].t/r,0),i[1]=a.getValueAtTime(a.keyframes[0].t/r,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(e[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/r,0),e[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/r,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/r,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/r,0)):(e=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/r,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/r,a.offsetTime))}else e=i=n;this.v.rotate(-Math.atan2(e[1]-i[1],e[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],r),r.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},r.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,i){return new r(t,e,i)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=point_pool.newElement(),this.o[i]=point_pool.newElement(),this.i[i]=point_pool.newElement(),i+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,i,r,s){var a;switch(this._length=Math.max(this._length,r+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}(!a[r]||a[r]&&!s)&&(a[r]=point_pool.newElement()),a[r][0]=t,a[r][1]=e},ShapePath.prototype.setTripleAt=function(t,e,i,r,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(i,r,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,r=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],r[0][0],r[0][1],i[0][0],i[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],r[n][0],r[n][1],i[n][0],i[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,i){var r,s,a,n,o,h,l,p,m,f=i.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)r=c[0].s[0],a=!0,f=0;else if(t>=c[c.length-1].t-this.offsetTime)r=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(f=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<d.t-this.offsetTime)p=0;else{var b;d.__fnct?b=d.__fnct:(b=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=b),p=b((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}r=d.s[0]}for(h=e._length,l=r.i[0].length,i.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<l;o+=1)m=a?r.i[n][o]:r.i[n][o]+(s.i[n][o]-r.i[n][o])*p,e.i[n][o]=m,m=a?r.o[n][o]:r.o[n][o]+(s.o[n][o]-r.o[n][o])*p,e.o[n][o]=m,m=a?r.v[n][o]:r.v[n][o]+(s.v[n][o]-r.v[n][o])*p,e.v[n][o]=m}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var i,r=t._length;for(i=0;i<r;i+=1)if(t.v[i][0]!==e.v[i][0]||t.v[i][1]!==e.v[i][1]||t.o[i][0]!==e.o[i][0]||t.o[i][1]!==e.o[i][1]||t.i[i][0]!==e.i[i][0]||t.i[i][1]!==e.i[i][1])return!1;return!0})(this.v,t)||(this.v=shape_pool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function i(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,i=this.effectsSequence.length;for(t=0;t<i;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,i){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var r=3===i?e.pt.k:e.ks.k;this.v=shape_pool.clone(r),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function r(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,i){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===i?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var r=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=shape_pool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,r),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime,r=this._caching.lastFrame;return r!==s&&(r<e&&t<e||i<r&&i<t)||(this._caching.lastIndex=r<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=i,n.prototype.setVValue=e,n.prototype.addEffect=r,o.prototype.getValue=i,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=r;var h=function(){var n=roundCorner;function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,r=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-r,a.v[1][0]=s?t+i:t-i,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+r,a.v[3][0]=s?t-i:t+i,a.v[3][1]=e,a.i[0][0]=s?t-i*n:t+i*n,a.i[0][1]=e-r,a.i[1][0]=s?t+i:t-i,a.i[1][1]=e-r*n,a.i[2][0]=s?t+i*n:t-i*n,a.i[2][1]=e+r,a.i[3][0]=s?t-i:t+i,a.i[3][1]=e+r*n,a.o[0][0]=s?t+i*n:t-i*n,a.o[0][1]=e-r,a.o[1][0]=s?t+i:t-i,a.o[1][1]=e+r*n,a.o[2][0]=s?t-i*n:t+i*n,a.o[2][1]=e+r,a.o[3][0]=s?t-i:t+i,a.o[3][1]=e-r*n}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,i,r,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,m=2*Math.PI*o/(2*s),f=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){i=n?l:p,r=n?m:f;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*r*i*d,y-v*r*i*d,u+g*r*i*d,y+v*r*i*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),i=2*Math.PI/e,r=this.or.v,s=this.os.v,a=2*Math.PI*r/(4*e),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=r*Math.cos(n),l=r*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),m=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*s*o,l-m*a*s*o,h+p*a*s*o,l+m*a*s*o,t,!0),n+=i*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,r=this.s.v[1]/2,s=bm_min(i,r,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+i,e-r+s,t+i,e-r+s,t+i,e-r+a,0,!0),this.v.setTripleAt(t+i,e+r-s,t+i,e+r-a,t+i,e+r-s,1,!0),0!==s?(this.v.setTripleAt(t+i-s,e+r,t+i-s,e+r,t+i-a,e+r,2,!0),this.v.setTripleAt(t-i+s,e+r,t-i+a,e+r,t-i+s,e+r,3,!0),this.v.setTripleAt(t-i,e+r-s,t-i,e+r-s,t-i,e+r-a,4,!0),this.v.setTripleAt(t-i,e-r+s,t-i,e-r+a,t-i,e-r+s,5,!0),this.v.setTripleAt(t-i+s,e-r,t-i+s,e-r,t-i+a,e-r,6,!0),this.v.setTripleAt(t+i-s,e-r,t+i-a,e-r,t+i-s,e-r,7,!0)):(this.v.setTripleAt(t-i,e+r,t-i+a,e+r,t-i,e+r,2),this.v.setTripleAt(t-i,e-r,t-i,e-r+a,t-i,e-r,3))):(this.v.setTripleAt(t+i,e-r+s,t+i,e-r+a,t+i,e-r+s,0,!0),0!==s?(this.v.setTripleAt(t+i-s,e-r,t+i-s,e-r,t+i-a,e-r,1,!0),this.v.setTripleAt(t-i+s,e-r,t-i+a,e-r,t-i+s,e-r,2,!0),this.v.setTripleAt(t-i,e-r+s,t-i,e-r+s,t-i,e-r+a,3,!0),this.v.setTripleAt(t-i,e+r-s,t-i,e+r-a,t-i,e+r-s,4,!0),this.v.setTripleAt(t-i+s,e+r,t-i+s,e+r,t-i+a,e+r,5,!0),this.v.setTripleAt(t+i-s,e+r,t+i-a,e+r,t+i-s,e+r,6,!0),this.v.setTripleAt(t+i,e+r-s,t+i,e+r-s,t+i,e+r-a,7,!0)):(this.v.setTripleAt(t-i,e-r,t-i+a,e-r,t-i,e-r,1,!0),this.v.setTripleAt(t-i,e+r,t-i,e+r-a,t-i,e+r,2,!0),this.v.setTripleAt(t+i,e+r,t+i-a,e+r,t+i,e+r,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var m={getShapeProp:function(t,e,i){var r;return 3===i||4===i?r=(3===i?e.pt:e.ks).k.length?new o(t,e,i):new n(t,e,i):5===i?r=new p(t,e):6===i?r=new h(t,e):7===i&&(r=new l(t,e)),r.k&&t.addDynamicProperty(r),r},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return m}(),ShapeModifiers=(fs={},gs={},fs.registerModifier=function(t,e){gs[t]||(gs[t]=e)},fs.getModifier=function(t,e,i){return new gs[t](e,i)},fs),fs,gs;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,i,r){this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=i,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(r);var s,a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,i){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var r=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",r),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=r,this.initDynamicPropertyContainer(i),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollection_pool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,r,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;n<l;n+=1){var p,m;if((o=a[n]).e*s<r||o.s*s>r+i);else p=o.s*s<=r?0:(o.s*s-r)/i,m=o.e*s>=r+i?1:(o.e*s-r)/i,h.push([p,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e<i;e+=1)segments_length_pool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,i,r;if(this._mdf||t){var s=this.o.v%360/360;if(s<0&&(s+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+s,(i=(1<this.e.v?1:this.e.v<0?0:this.e.v)+s)<e){var a=e;e=i,i=a}e=1e-4*Math.round(1e4*e),i=1e-4*Math.round(1e4*i),this.sValue=e,this.eValue=i}else e=this.sValue,i=this.eValue;var n,o,h,l,p,m,f=this.shapes.length,c=0;if(i===e)for(n=0;n<f;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===i&&0===e||0===i&&1===e){if(this._mdf)for(n=0;n<f;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var d,u,y=[];for(n=0;n<f;n+=1)if((d=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(h=(r=d.shape.paths)._length,m=0,!d.shape._mdf&&d.pathsData.length)m=d.totalShapeLength;else{for(l=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)p=bez.getSegmentsLength(r.shapes[o]),l.push(p),m+=p.totalLength;d.totalShapeLength=m,d.pathsData=l}c+=m,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,b=i,E=0;for(n=f-1;0<=n;n-=1)if((d=this.shapes[n]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<f?(g=this.calculateShapeEdges(e,i,d.totalShapeLength,E,c),E+=d.totalShapeLength):g=[[v,b]],h=g.length,o=0;o<h;o+=1){v=g[o][0],b=g[o][1],y.length=0,b<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*b}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(b-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(b-1)}));var x=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var P=x.pop();this.addPaths(x,u),x=this.addShapes(d,y[1],P)}else this.addPaths(x,u),x=this.addShapes(d,y[1]);this.addPaths(x,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)e.addShape(t[i])},TrimModifier.prototype.addSegment=function(t,e,i,r,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(i[0],i[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(r[0],r[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,i,r){e.setXYAt(t[1],t[5],"o",i),e.setXYAt(t[2],t[6],"i",i+1),r&&e.setXYAt(t[0],t[4],"v",i),e.setXYAt(t[3],t[7],"v",i+1)},TrimModifier.prototype.addShapes=function(t,e,i){var r,s,a,n,o,h,l,p,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(p=i?(o=i._length,i._length):(i=shape_pool.newElement(),o=0),u.push(i),r=0;r<c;r+=1){for(h=m[r].lengths,i.c=f[r].c,a=f[r].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,i.c=!1;else{if(d>e.e){i.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[r].v[s-1],f[r].o[s-1],f[r].i[s],f[r].v[s],i,o,y),y=!1):(l=bez.getNewSegment(f[r].v[s-1],f[r].v[s],f[r].o[s-1],f[r].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,i,o,y),y=!1,i.c=!1),d+=n.addedLength,o+=1}if(f[r].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[r].v[s-1],f[r].o[s-1],f[r].i[0],f[r].v[0],i,o,y),y=!1):(l=bez.getNewSegment(f[r].v[s-1],f[r].v[0],f[r].o[s-1],f[r].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(l,i,o,y),y=!1,i.c=!1)}else i.c=!1;d+=n.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[p][0],i.v[p][1],"i",p),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),d>e.e)break;r<c-1&&(i=shape_pool.newElement(),y=!0,u.push(i),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var i=shape_pool.newElement();i.c=t.c;var r,s,a,n,o,h,l,p,m,f,c,d,u,y=t._length,g=0;for(r=0;r<y;r+=1)s=t.v[r],n=t.o[r],a=t.i[r],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==r&&r!==y-1||t.c?(o=0===r?t.v[y-1]:t.v[r-1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=d=s[0]+(o[0]-s[0])*l,m=u=s[1]-(s[1]-o[1])*l,f=p-(p-s[0])*roundCorner,c=m-(m-s[1])*roundCorner,i.setTripleAt(p,m,f,c,d,u,g),g+=1,o=r===y-1?t.v[0]:t.v[r+1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=f=s[0]+(o[0]-s[0])*l,m=c=s[1]+(o[1]-s[1])*l,d=p-(p-s[0])*roundCorner,u=m-(m-s[1])*roundCorner,i.setTripleAt(p,m,f,c,d,u,g)):i.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):i.setTripleAt(t.v[r][0],t.v[r][1],t.o[r][0],t.o[r][1],t.i[r][0],t.i[r][1],g),g+=1;return i},RoundCornersModifier.prototype.processShapes=function(t){var e,i,r,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(i=0;i<o;i+=1){if((a=this.shapes[i]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,r=0;r<s;r+=1)n.addShape(this.processPath(e[r],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var i=e/100,r=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)r[0]+=t.v[a][0],r[1]+=t.v[a][1];r[0]/=s,r[1]/=s;var n,o,h,l,p,m,f=shape_pool.newElement();for(f.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(r[0]-t.v[a][0])*i,o=t.v[a][1]+(r[1]-t.v[a][1])*i,h=t.o[a][0]+(r[0]-t.o[a][0])*-i,l=t.o[a][1]+(r[1]-t.o[a][1])*-i,p=t.i[a][0]+(r[0]-t.i[a][0])*-i,m=t.i[a][1]+(r[1]-t.i[a][1])*-i,f.setTripleAt(n,o,h,l,p,m,a);return f},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,i,r,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(i=0;i<o;i+=1){if((a=this.shapes[i]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,r=0;r<s;r+=1)n.addShape(this.processPath(e[r],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,i,r,s,a){var n=a?-1:1,o=r.s.v[0]+(1-r.s.v[0])*(1-s),h=r.s.v[1]+(1-r.s.v[1])*(1-s);t.translate(r.p.v[0]*n*s,r.p.v[1]*n*s,r.p.v[2]),e.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),e.rotate(-r.r.v*n*s),e.translate(r.a.v[0],r.a.v[1],r.a.v[2]),i.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),i.scale(a?1/o:o,a?1/h:h),i.translate(r.a.v[0],r.a.v[1],r.a.v[2])},RepeaterModifier.prototype.init=function(t,e,i,r){this.elem=t,this.arr=e,this.pos=i,this.elemsData=r,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[i]);for(;0<i;)i-=1,this._elements.unshift(e[i]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)t[i]._render=e,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,i,r,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(r=a=0;r<=this._groups.length-1;r+=1)n=a<o,this._groups[r]._render=n,this.changeGroupRender(this._groups[r].it,n),a+=1;this._currentCopies=o;var l=this.o.v,p=l%1,m=0<l?Math.floor(l):Math.ceil(l),f=(this.tr.v.props,this.pMatrix.props),c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<l){for(;g<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),g+=p)}else if(l<0){for(;m<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),g-=p)}for(r=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(i=(e=this.elemsData[r].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),0!==g){for((0!==r&&1===s||r!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),u=0;u<y;u+=1)i[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)i[u]=this.matrix.props[u];g+=1,a-=1,r+=s}}else for(a=this._currentCopies,r=0,s=1;a;)i=(e=this.elemsData[r].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,r+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shape_pool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,i=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<i;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var i=0,r=this.o.length/2;i<r;){if(.01<Math.abs(t[4*i]-t[4*e+2*i]))return!1;i+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,i,r,s=4*this.data.p;for(e=0;e<s;e+=1)i=e%4==0?100:255,r=Math.round(this.prop.v[e]*i),this.c[e]!==r&&(this.c[e]=r,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)i=e%2==0?100:1,r=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==r&&(this.o[e-4*this.data.p]=r,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,i,r){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+r.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+r.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+r.applyToPointStringified(n[s][0],n[s][1])+" "+r.applyToPointStringified(o[s][0],o[s][1]);return i&&e&&(h+=" C"+r.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+r.applyToPointStringified(n[0][0],n[0][1])+" "+r.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(t){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,i){var r="";if(t.e)r=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),r=e+s}else r=i,r+=t.u?t.u:"",r+=t.p;return r}function t(t){this._imageLoaded=e.bind(this),this.testImageLoaded=function(t){var e=0,i=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return t.prototype={loadAssets:function(t,e){this.imagesLoadedCb=e;var i,r=t.length;for(i=0;i<r;i+=1)t[i].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[i])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,i=this.images.length;e<i;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}},createImgData:function(t){var e=a(t,this.assetsPath,this.path),i=createTag("img");i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){r.img=s,this._imageLoaded()}.bind(this),!1),i.src=e;var r={img:i,assetData:t};return r},createImageData:function(t){var e=a(t,this.assetsPath,this.path),i=createNS("image");isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){r.img=s,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(i);var r={img:i,assetData:t};return r},imageLoaded:e,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},t}(),featureSupport=(Ax={maskType:!0},(/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))&&(Ax.maskType=!1),Ax),Ax,filtersFactory=(Bx={},Bx.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},Bx.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},Bx),Bx,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,i){var r,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)r=a(s),e(r);else try{r=a(s),e(r)}catch(t){i&&i(t)}}}}}();function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function TextAnimatorDataProperty(t,e,i){var r={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,i):r,rx:a.rx?s(t,a.rx,0,degToRads,i):r,ry:a.ry?s(t,a.ry,0,degToRads,i):r,sk:a.sk?s(t,a.sk,0,degToRads,i):r,sa:a.sa?s(t,a.sa,0,degToRads,i):r,s:a.s?s(t,a.s,1,.01,i):r,a:a.a?s(t,a.a,1,0,i):r,o:a.o?s(t,a.o,0,.01,i):r,p:a.p?s(t,a.p,1,0,i):r,sw:a.sw?s(t,a.sw,0,0,i):r,sc:a.sc?s(t,a.sc,1,0,i):r,fc:a.fc?s(t,a.fc,1,0,i):r,fh:a.fh?s(t,a.fh,0,0,i):r,fs:a.fs?s(t,a.fs,0,.01,i):r,fb:a.fb?s(t,a.fb,0,.01,i):r,t:a.t?s(t,a.t,0,0,i):r},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function LetterProps(t,e,i,r,s,a){this.o=t,this.sw=e,this.sc=i,this.fc=r,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!r,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,r=PropertyFactory.getProp;for(t=0;t<i;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:r(this._elem,this._textData.p.f,0,0,this),l:r(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=r(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var i,r,s,a,n,o,h,l,p,m,f,c,d,u,y,g,v,b,E,x=this._moreOptions.alignment.v,P=this._animatorsData,S=this._textData,_=this.mHelper,C=this._renderType,A=this.renderedLetters.length,T=(this.data,t.l);if(this._hasMaskedPath){if(E=this._pathData.m,!this._pathData.n||this._pathData._mdf){var k,M=E.v;for(this._pathData.r&&(M=M.reverse()),n={tLength:0,segments:[]},a=M._length-1,s=g=0;s<a;s+=1)k=bez.buildBezierData(M.v[s],M.v[s+1],[M.o[s][0]-M.v[s][0],M.o[s][1]-M.v[s][1]],[M.i[s+1][0]-M.v[s+1][0],M.i[s+1][1]-M.v[s+1][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength;s=a,E.v.c&&(k=bez.buildBezierData(M.v[s],M.v[0],[M.o[s][0]-M.v[s][0],M.o[s][1]-M.v[s][1]],[M.i[0][0]-M.v[0][0],M.i[0][1]-M.v[0][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,m=1,p=!(l=f=0),u=n.segments,o<0&&E.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),m=(d=u[f=u.length-1].points).length-1;o<0;)o+=d[m].partialLength,(m-=1)<0&&(m=(d=u[f-=1].points).length-1);c=(d=u[f].points)[m-1],y=(h=d[m]).partialLength}a=T.length,r=i=0;var D,w,F,I,V=1.2*t.finalSize*.714,B=!0;F=P.length;var R,L,G,z,N,O,H,j,q,W,Y,X,K,$=-1,Z=o,J=f,U=m,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var it=0,rt=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(T[s].n){for(it&&(it+=rt);at<s;)T[at].animatorJustifyOffset=it,at+=1;nt=!(it=0)}else{for(w=0;w<F;w+=1)(D=P[w].a).t.propType&&(nt&&2===t.j&&(rt+=D.t.v*st),(R=P[w].s.getMult(T[s].anIndexes[w],S.a[w].s.totalChars)).length?it+=D.t.v*R[0]*st:it+=D.t.v*R*st);nt=!1}for(it&&(it+=rt);at<s;)T[at].animatorJustifyOffset=it,at+=1}for(s=0;s<a;s+=1){if(_.reset(),N=1,T[s].n)i=0,r+=t.yOffset,r+=B?1:0,o=Z,B=!1,0,this._hasMaskedPath&&(m=U,c=(d=u[f=J].points)[m-1],y=(h=d[m]).partialLength,l=0),K=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==T[s].line){switch(t.j){case 1:o+=g-t.lineWidths[T[s].line];break;case 2:o+=(g-t.lineWidths[T[s].line])/2}Q=T[s].line}$!==T[s].ind&&(T[$]&&(o+=T[$].extra),o+=T[s].an/2,$=T[s].ind),o+=x[0]*T[s].an/200;var ot=0;for(w=0;w<F;w+=1)(D=P[w].a).p.propType&&((R=P[w].s.getMult(T[s].anIndexes[w],S.a[w].s.totalChars)).length?ot+=D.p.v[0]*R[0]:ot+=D.p.v[0]*R),D.a.propType&&((R=P[w].s.getMult(T[s].anIndexes[w],S.a[w].s.totalChars)).length?ot+=D.a.v[0]*R[0]:ot+=D.a.v[0]*R);for(p=!0;p;)o+ot<=l+y||!d?(v=(o+ot-l)/h.partialLength,G=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,_.translate(-x[0]*T[s].an/200,-x[1]*V/100),p=!1):d&&(l+=h.partialLength,(m+=1)>=d.length&&(m=0,d=u[f+=1]?u[f].points:E.v.c?u[f=m=0].points:(l-=h.partialLength,null)),d&&(c=h,y=(h=d[m]).partialLength));L=T[s].an/2-T[s].add,_.translate(-L,0,0)}else L=T[s].an/2-T[s].add,_.translate(-L,0,0),_.translate(-x[0]*T[s].an/200,-x[1]*V/100,0);for(T[s].l/2,w=0;w<F;w+=1)(D=P[w].a).t.propType&&(R=P[w].s.getMult(T[s].anIndexes[w],S.a[w].s.totalChars),0===i&&0===t.j||(this._hasMaskedPath?R.length?o+=D.t.v*R[0]:o+=D.t.v*R:R.length?i+=D.t.v*R[0]:i+=D.t.v*R));for(T[s].l/2,t.strokeWidthAnim&&(H=t.sw||0),t.strokeColorAnim&&(O=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(j=[t.fc[0],t.fc[1],t.fc[2]]),w=0;w<F;w+=1)(D=P[w].a).a.propType&&((R=P[w].s.getMult(T[s].anIndexes[w],S.a[w].s.totalChars)).length?_.translate(-D.a.v[0]*R[0],-D.a.v[1]*R[1],D.a.v[2]*R[2]):_.translate(-D.a.v[0]*R,-D.a.v[1]*R,D.a.v[2]*R));for(w=0;w<F;w+=1)(D=P[w].a).s.propType&&((R=P[w].s.getMult(T[s].anIndexes[w],S.a[w].s.totalChars)).length?_.scale(1+(D.s.v[0]-1)*R[0],1+(D.s.v[1]-1)*R[1],1):_.scale(1+(D.s.v[0]-1)*R,1+(D.s.v[1]-1)*R,1));for(w=0;w<F;w+=1){if(D=P[w].a,R=P[w].s.getMult(T[s].anIndexes[w],S.a[w].s.totalChars),D.sk.propType&&(R.length?_.skewFromAxis(-D.sk.v*R[0],D.sa.v*R[1]):_.skewFromAxis(-D.sk.v*R,D.sa.v*R)),D.r.propType&&(R.length?_.rotateZ(-D.r.v*R[2]):_.rotateZ(-D.r.v*R)),D.ry.propType&&(R.length?_.rotateY(D.ry.v*R[1]):_.rotateY(D.ry.v*R)),D.rx.propType&&(R.length?_.rotateX(D.rx.v*R[0]):_.rotateX(D.rx.v*R)),D.o.propType&&(R.length?N+=(D.o.v*R[0]-N)*R[0]:N+=(D.o.v*R-N)*R),t.strokeWidthAnim&&D.sw.propType&&(R.length?H+=D.sw.v*R[0]:H+=D.sw.v*R),t.strokeColorAnim&&D.sc.propType)for(q=0;q<3;q+=1)R.length?O[q]=O[q]+(D.sc.v[q]-O[q])*R[0]:O[q]=O[q]+(D.sc.v[q]-O[q])*R;if(t.fillColorAnim&&t.fc){if(D.fc.propType)for(q=0;q<3;q+=1)R.length?j[q]=j[q]+(D.fc.v[q]-j[q])*R[0]:j[q]=j[q]+(D.fc.v[q]-j[q])*R;D.fh.propType&&(j=R.length?addHueToRGB(j,D.fh.v*R[0]):addHueToRGB(j,D.fh.v*R)),D.fs.propType&&(j=R.length?addSaturationToRGB(j,D.fs.v*R[0]):addSaturationToRGB(j,D.fs.v*R)),D.fb.propType&&(j=R.length?addBrightnessToRGB(j,D.fb.v*R[0]):addBrightnessToRGB(j,D.fb.v*R))}}for(w=0;w<F;w+=1)(D=P[w].a).p.propType&&(R=P[w].s.getMult(T[s].anIndexes[w],S.a[w].s.totalChars),this._hasMaskedPath?R.length?_.translate(0,D.p.v[1]*R[0],-D.p.v[2]*R[1]):_.translate(0,D.p.v[1]*R,-D.p.v[2]*R):R.length?_.translate(D.p.v[0]*R[0],D.p.v[1]*R[1],-D.p.v[2]*R[2]):_.translate(D.p.v[0]*R,D.p.v[1]*R,-D.p.v[2]*R));if(t.strokeWidthAnim&&(W=H<0?0:H),t.strokeColorAnim&&(Y="rgb("+Math.round(255*O[0])+","+Math.round(255*O[1])+","+Math.round(255*O[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),this._hasMaskedPath){if(_.translate(0,-t.ls),_.translate(0,x[1]*V/100+r,0),S.p.p){b=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(b)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),_.rotate(-ht*Math.PI/180)}_.translate(G,z,0),o-=x[0]*T[s].an/200,T[s+1]&&$!==T[s+1].ind&&(o+=T[s].an/2,o+=t.tr/1e3*t.finalSize)}else{switch(_.translate(i,r,0),t.ps&&_.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:_.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line]),0,0);break;case 2:_.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line])/2,0,0)}_.translate(0,-t.ls),_.translate(L,0,0),_.translate(x[0]*T[s].an/200,x[1]*V/100,0),i+=T[s].l+t.tr/1e3*t.finalSize}"html"===C?tt=_.toCSS():"svg"===C?tt=_.to2dCSS():et=[_.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]],K=N}this.lettersChangedFlag=A<=s?(I=new LetterProps(K,W,Y,X,tt,et),this.renderedLetters.push(I),A+=1,!0):(I=this.renderedLetters[s]).update(K,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,i,r,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==i&&(this.sc=i,n=this._mdf.sc=!0),this.fc!==r&&(this.fc=r,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var r,s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(r=0;r<s;r+=1)a=i!==this.keysIndex?this.effectsSequence[r](a,a.t):this.effectsSequence[r](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,i=0,r=t.length;i<=r-1&&(t[i].s,!(i===r-1||t[i+1].t>e));)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,i=FontManager.getCombinedCharacterCodes(),r=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==i.indexOf(e)?r[r.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(r.push(t.substr(s,2)),++s):r.push(t.charAt(s)),s+=1;return r},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,i,r,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],m=0,f=l.m.g,c=0,d=0,u=0,y=[],g=0,v=0,b=h.getFontByName(t.f),E=0,x=b.fStyle?b.fStyle.split(" "):[],P="normal",S="normal";for(i=x.length,e=0;e<i;e+=1)switch(x[e].toLowerCase()){case"italic":S="italic";break;case"bold":P="700";break;case"black":P="900";break;case"medium":P="500";break;case"regular":case"normal":P="400";break;case"light":case"thin":P="200"}t.fWeight=b.fWeight||P,t.fStyle=S,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),i=t.finalText.length,t.finalLineHeight=t.lh;var _,C=t.tr/1e3*t.finalSize;if(t.sz)for(var A,T,k=!0,M=t.sz[0],D=t.sz[1];k;){g=A=0,i=(T=this.buildFinalText(t.t)).length,C=t.tr/1e3*t.finalSize;var w=-1;for(e=0;e<i;e+=1)_=T[e].charCodeAt(0),r=!1," "===T[e]?w=e:13!==_&&3!==_||(r=!(g=0),A+=t.finalLineHeight||1.2*t.finalSize),M<g+(E=h.chars?(o=h.getCharData(T[e],b.fStyle,b.fFamily),r?0:o.w*t.finalSize/100):h.measureText(T[e],t.f,t.finalSize))&&" "!==T[e]?(-1===w?i+=1:e=w,A+=t.finalLineHeight||1.2*t.finalSize,T.splice(e,w===e?1:0,"\r"),w=-1,g=0):(g+=E,g+=C);A+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&D<A?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=T,i=t.finalText.length,k=!1)}g=-C;var F,I=E=0;for(e=0;e<i;e+=1)if(r=!1,13===(_=(F=t.finalText[e]).charCodeAt(0))||3===_?(I=0,y.push(g),v=v<g?g:v,g=-2*C,r=!(s=""),u+=1):s=F,E=h.chars?(o=h.getCharData(F,b.fStyle,h.getFontByName(t.f).fFamily),r?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===F?I+=E+C:(g+=E+C+I,I=0),p.push({l:E,an:E,add:c,n:r,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==f){if(c+=E,""===s||" "===s||e===i-1){for(""!==s&&" "!==s||(c-=E);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=E,d+=1;m+=1,c=0}}else if(3==f){if(c+=E,""===s||e===i-1){for(""===s&&(c-=E);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=E,d+=1;c=0,m+=1}}else p[m].ind=m,p[m].extra=0,m+=1;if(t.l=p,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var V,B,R=l.a;n=R.length;var L,G,z=[];for(a=0;a<n;a+=1){for((V=R[a]).a.sc&&(t.strokeColorAnim=!0),V.a.sw&&(t.strokeWidthAnim=!0),(V.a.fc||V.a.fh||V.a.fs||V.a.fb)&&(t.fillColorAnim=!0),G=0,L=V.s.b,e=0;e<i;e+=1)(B=p[e]).anIndexes[a]=G,(1==L&&""!==B.val||2==L&&""!==B.val&&" "!==B.val||3==L&&(B.n||" "==B.val||e==i-1)||4==L&&(B.n||e==i-1))&&(1===V.s.rn&&z.push(G),G+=1);l.a[a].s.totalChars=G;var N,O=-1;if(1===V.s.rn)for(e=0;e<i;e+=1)O!=(B=p[e]).anIndexes[a]&&(O=B.anIndexes[a],N=z.splice(Math.floor(Math.random()*z.length),1)[0]),B.anIndexes[a]=N}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var i=this.copyData({},this.data.d.k[e].s);i=this.copyData(i,t),this.data.d.k[e].s=i,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function r(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return r.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,i=0,r=1,s=1;0<this.ne.v?e=this.ne.v/100:i=-this.ne.v/100,0<this.xe.v?r=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,i,r,s).get,n=0,o=this.finalS,h=this.finalE,l=this.data.sh;if(2===l)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===l)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===l)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===l){if(h===o)n=0;else{var p=h-o,m=-p/2+(t=d(c(0,t+.5-o),h-o)),f=p/2;n=Math.sqrt(1-m*m/(f*f))}n=a(n)}else n=6===l?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/e,r=this.s.v/e+i,s=this.e.v/e+i;if(s<r){var a=r;r=s,s=a}this.finalS=r,this.finalE=s}},extendPrototype([DynamicPropertyContainer],r),{getTextSelectorProp:function(t,e,i){return new r(t,e,i)}}}(),pool_factory=function(t,e,i,r){var s=0,a=t,n=createSizedArray(a);function o(){return s?n[s-=1]:e()}return{newElement:o,release:function(t){s===a&&(n=pooling.double(n),a*=2),i&&i(t),n[s]=t,s+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},point_pool=pool_factory(8,function(){return createTypedArray("float32",2)}),shape_pool=(SB=pool_factory(4,function(){return new ShapePath},function(t){var e,i=t._length;for(e=0;e<i;e+=1)point_pool.release(t.v[e]),point_pool.release(t.i[e]),point_pool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),SB.clone=function(t){var e,i=SB.newElement(),r=void 0===t._length?t.v.length:t._length;for(i.setLength(r),i.c=t.c,e=0;e<r;e+=1)i.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return i},SB),SB,shapeCollection_pool=(_B={newShapeCollection:function(){var t;t=aC?cC[aC-=1]:new ShapeCollection;return t},release:function(t){var e,i=t._length;for(e=0;e<i;e+=1)shape_pool.release(t.shapes[e]);t._length=0,aC===bC&&(cC=pooling.double(cC),bC*=2);cC[aC]=t,aC+=1}},aC=0,bC=4,cC=createSizedArray(bC),_B),_B,aC,bC,cC,segments_length_pool=pool_factory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)bezier_length_pool.release(t.lengths[e]);t.lengths.length=0}),bezier_length_pool=pool_factory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var i="";if(e&&e.title){var r=createNS("title"),s=createElementID();r.setAttribute("id",s),r.textContent=e.title,this.svgElement.appendChild(r),i+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),i+=" "+n}i&&this.svgElement.setAttribute("aria-labelledby",i);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function HybridRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!e||!1!==e.hideOnTransparent,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function MaskElement(t,e,i){this.data=t,this.element=e,this.globalData=i,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var r,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var n,o,h,l,p,m,f,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(r=0;r<a;r++)if(("a"!==c[r].mode&&"n"!==c[r].mode||c[r].inv||100!==c[r].o.k||c[r].o.x)&&(v=g="mask"),"s"!=c[r].mode&&"i"!=c[r].mode||0!==d?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),n=createNS("path"),"n"!=c[r].mode){var b;if(d+=1,n.setAttribute("fill","s"===c[r].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==c[r].x.k?(v=g="mask",f=PropertyFactory.getProp(this.element,c[r].x,0,null,this.element),b=createElementID(),(p=createNS("filter")).setAttribute("id",b),(m=createNS("feMorphology")).setAttribute("operator","erode"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),p.appendChild(m),s.appendChild(p),n.setAttribute("stroke","s"===c[r].mode?"#000000":"#ffffff")):f=m=null,this.storedData[r]={elem:n,x:f,expan:m,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==c[r].mode){h=u.length;var E=createNS("g");for(o=0;o<h;o+=1)E.appendChild(u[o]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",y+"_"+d),x.appendChild(n),s.appendChild(x),E.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(E)}else u.push(n);c[r].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[r]={elem:n,lastPath:"",op:PropertyFactory.getProp(this.element,c[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[r],3),invRect:l},this.viewData[r].prop.k||this.drawPath(c[r],this.viewData[r].prop.v,this.viewData[r])}else this.viewData[r]={op:PropertyFactory.getProp(this.element,c[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[r],3),elem:n,lastPath:""},s.appendChild(n);for(this.maskElement=createNS(g),a=u.length,r=0;r<a;r+=1)this.maskElement.appendChild(u[r]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,i){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=i,this.lvl=e,this._isAnimated=!!i.k;for(var r=0,s=t.length;r<s;){if(t[r].mProps.dynamicProperties.length){this._isAnimated=!0;break}r+=1}}function SVGTransformData(t,e,i){this.transform={mProps:t,op:e,container:i},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function SVGStrokeStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=i,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=i}function SVGGradientFillStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,i)}function SVGGradientStrokeStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,i),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}BaseRenderer.prototype.checkLayers=function(t){var e,i,r=this.layers.length;for(this.completeLayers=!0,e=r-1;0<=e;e--)this.elements[e]||(i=this.layers[e]).ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t)}return this.createNull(t)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){this.completeLayers=!1;var e,i,r=t.length,s=this.layers.length;for(e=0;e<r;e+=1)for(i=0;i<s;){if(this.layers[i].id==t[e].id){this.layers[i]=t[e];break}i+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,i){for(var r=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(r[a]&&!0!==r[a]?(i.push(r[a]),r[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,i):t.setHierarchy(i)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,i=t.length;for(e=0;e<i;e+=1)if(t[e].xt){var r=this.createComp(t[e]);r.initExpressions(),this.globalData.projectInterface.registerComposition(r)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var i=createNS("clipPath"),r=createNS("rect");r.setAttribute("width",t.w),r.setAttribute("height",t.h),r.setAttribute("x",0),r.setAttribute("y",0);var s=createElementID();i.setAttribute("id",s),i.appendChild(r),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(i),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var i=this.createItem(this.layers[t]);e[t]=i,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(i),i.initExpressions()),this.appendElementInPos(i,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?i.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(i)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,i=this.elements.length;e<i;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=i-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<i;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){for(var r,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(r=this.elements[s].getBaseElement()),s+=1;r?this.layerElement.insertBefore(i,r):this.layerElement.appendChild(i)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],CanvasRenderer),CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRenderer.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var i=this.contextData.cTr.props;this.canvasContext.setTransform(i[0],i[1],i[4],i[5],i[12],i[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},CanvasRenderer.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},CanvasRenderer.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var i,r=this.contextData.saved[this.contextData.cArrPos];for(i=0;i<16;i+=1)r[i]=e[i];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},CanvasRenderer.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,i=this.contextData.saved[this.contextData.cArrPos],r=this.contextData.cTr.props;for(e=0;e<16;e+=1)r[e]=i[e];this.canvasContext.setTransform(i[0],i[1],i[4],i[5],i[12],i[13]),i=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=i,this.globalData.currentGlobalAlpha!==i&&(this.canvasContext.globalAlpha=i,this.globalData.currentGlobalAlpha=i)}else this.canvasContext.restore()},CanvasRenderer.prototype.configAnimation=function(t){this.animationItem.wrapper?(this.animationItem.container=createTag("canvas"),this.animationItem.container.style.width="100%",this.animationItem.container.style.height="100%",this.animationItem.container.style.transformOrigin=this.animationItem.container.style.mozTransformOrigin=this.animationItem.container.style.webkitTransformOrigin=this.animationItem.container.style["-webkit-transform"]="0px 0px 0px",this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)):this.canvasContext=this.renderConfig.context,this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){var t,e,i,r;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var s=this.renderConfig.preserveAspectRatio.split(" "),a=s[1]||"meet",n=s[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);i=t/e,r=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=i<r&&"meet"===a||r<i&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(r<i&&"meet"===a||i<r&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(r<i&&"meet"===a||i<r&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(i<r&&"meet"===a||r<i&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(i<r&&"meet"===a||r<i&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"==this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;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],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRenderer.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i,r=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=0;i<r;i++)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(t-this.layers[i].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=r-1;0<=i;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){var i=this.createItem(this.layers[t],this,this.globalData);(e[t]=i).initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([BaseRenderer],HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},HybridRenderer.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){var r=this.layers[e];if(r.ddd&&this.supports3d)this.addTo3dContainer(i,e);else if(this.threeDElements)this.addTo3dContainer(i,e);else{for(var s,a,n=0;n<e;)this.elements[n]&&!0!==this.elements[n]&&this.elements[n].getBaseElement&&(a=this.elements[n],s=(this.layers[n].ddd?this.getThreeDContainerByPos(n):a.getBaseElement())||s),n+=1;s?r.ddd&&this.supports3d||this.layerElement.insertBefore(i,s):r.ddd&&this.supports3d||this.layerElement.appendChild(i)}}},HybridRenderer.prototype.createShape=function(t){return this.supports3d?new HShapeElement(t,this.globalData,this):new SVGShapeElement(t,this.globalData,this)},HybridRenderer.prototype.createText=function(t){return this.supports3d?new HTextElement(t,this.globalData,this):new SVGTextElement(t,this.globalData,this)},HybridRenderer.prototype.createCamera=function(t){return this.camera=new HCameraElement(t,this.globalData,this),this.camera},HybridRenderer.prototype.createImage=function(t){return this.supports3d?new HImageElement(t,this.globalData,this):new IImageElement(t,this.globalData,this)},HybridRenderer.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.globalData,this):new SVGCompElement(t,this.globalData,this)},HybridRenderer.prototype.createSolid=function(t){return this.supports3d?new HSolidElement(t,this.globalData,this):new ISolidElement(t,this.globalData,this)},HybridRenderer.prototype.createNull=SVGRenderer.prototype.createNull,HybridRenderer.prototype.getThreeDContainerByPos=function(t){for(var e=0,i=this.threeDElements.length;e<i;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}},HybridRenderer.prototype.createThreeDContainer=function(t,e){var i=createTag("div");styleDiv(i);var r=createTag("div");styleDiv(r),"3d"===e&&(i.style.width=this.globalData.compSize.w+"px",i.style.height=this.globalData.compSize.h+"px",i.style.transformOrigin=i.style.mozTransformOrigin=i.style.webkitTransformOrigin="50% 50%",r.style.transform=r.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"),i.appendChild(r);var s={container:r,perspectiveElem:i,startPos:t,endPos:t,type:e};return this.threeDElements.push(s),s},HybridRenderer.prototype.build3dContainers=function(){var t,e,i=this.layers.length,r="";for(t=0;t<i;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?"3d"!==r&&(r="3d",e=this.createThreeDContainer(t,"3d")):"2d"!==r&&(r="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t);for(t=(i=this.threeDElements.length)-1;0<=t;t--)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRenderer.prototype.addTo3dContainer=function(t,e){for(var i=0,r=this.threeDElements.length;i<r;){if(e<=this.threeDElements[i].endPos){for(var s,a=this.threeDElements[i].startPos;a<e;)this.elements[a]&&this.elements[a].getBaseElement&&(s=this.elements[a].getBaseElement()),a+=1;s?this.threeDElements[i].container.insertBefore(t,s):this.threeDElements[i].container.appendChild(t);break}i+=1}},HybridRenderer.prototype.configAnimation=function(t){var e=createTag("div"),i=this.animationItem.wrapper;e.style.width=t.w+"px",e.style.height=t.h+"px",styleDiv(this.resizerElem=e),e.style.transformStyle=e.style.webkitTransformStyle=e.style.mozTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),i.appendChild(e),e.style.overflow="hidden";var r=createNS("svg");r.setAttribute("width","1"),r.setAttribute("height","1"),styleDiv(r),this.resizerElem.appendChild(r);var s=createNS("defs");r.appendChild(s),this.data=t,this.setupGlobalData(t,r),this.globalData.defs=s,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRenderer.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRenderer.prototype.updateContainerSize=function(){var t,e,i,r,s=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight;r=s/a<this.globalData.compSize.w/this.globalData.compSize.h?(t=s/this.globalData.compSize.w,e=s/this.globalData.compSize.w,i=0,(a-this.globalData.compSize.h*(s/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,i=(s-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,0),this.resizerElem.style.transform=this.resizerElem.style.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+i+","+r+",0,1)"},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,i=this.globalData.compSize.h,r=this.threeDElements.length;for(t=0;t<r;t+=1)this.threeDElements[t].perspectiveElem.style.perspective=this.threeDElements[t].perspectiveElem.style.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(i,2))+"px"}},HybridRenderer.prototype.searchExtraCompositions=function(t){var e,i=t.length,r=createTag("div");for(e=0;e<i;e+=1)if(t[e].xt){var s=this.createComp(t[e],r,this.globalData.comp,null);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,i=this.element.finalTransform.mat,r=this.masksProperties.length;for(e=0;e<r;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",i.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,i){var r,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,r=1;r<s;r+=1)a+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[r][0]+","+e.i[r][1]+" "+e.v[r][0]+","+e.v[r][1];if(e.c&&1<s&&(a+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==a){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),i.elem.setAttribute("d",n)),i.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var i,r=this.dynamicProperties.length;for(i=0;i<r;i+=1)(e||this._isParent&&"transform"===this.dynamicProperties[i].propType)&&(this.dynamicProperties[i].getValue(),this.dynamicProperties[i]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,i=0,r=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i<r;){if(this.hierarchy[i].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}i+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),i=0;i<r;i+=1)t=this.hierarchy[i].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var i=!0,r=this.comp;i;)r.finalTransform?(r.data.hasMask&&e.splice(0,0,r.finalTransform),r=r.comp):i=!1;var s,a,n=e.length;for(s=0;s<n;s+=1)a=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,i){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=i,this.stops=[],this.setGradientData(i.pElem,e),this.setGradientOpacity(e,i),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var i=createElementID(),r=createNS(1===e.t?"linearGradient":"radialGradient");r.setAttribute("id",i),r.setAttribute("spreadMethod","pad"),r.setAttribute("gradientUnits","userSpaceOnUse");var s,a,n,o=[];for(n=4*e.g.p,a=0;a<n;a+=4)s=createNS("stop"),r.appendChild(s),o.push(s);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+locationHref+"#"+i+")"),this.gf=r,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var i,r,s,a=createNS("mask"),n=createNS("path");a.appendChild(n);var o=createElementID(),h=createElementID();a.setAttribute("id",h);var l=createNS(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",o),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),s=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(r=4*t.g.p;r<s;r+=2)(i=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(i),p.push(i);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+locationHref+"#"+o+")"),this.of=l,this.ms=a,this.ost=p,this.maskId=h,e.msElem=n}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var SVGElementsRenderer=function(){var y=new Matrix,g=new Matrix;function e(t,e,i){(i||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(i||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function i(t,e,i){var r,s,a,n,o,h,l,p,m,f,c,d=e.styles.length,u=e.lvl;for(h=0;h<d;h+=1){if(n=e.sh._mdf||i,e.styles[h].lvl<u){for(p=g.reset(),f=u-e.styles[h].lvl,c=e.transformers.length-1;!n&&0<f;)n=e.transformers[c].mProps._mdf||n,f--,c--;if(n)for(f=u-e.styles[h].lvl,c=e.transformers.length-1;0<f;)m=e.transformers[c].mProps.v.props,p.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),f--,c--}else p=y;if(s=(l=e.sh.paths)._length,n){for(a="",r=0;r<s;r+=1)(o=l.shapes[r])&&o._length&&(a+=buildShapeString(o,o._length,o.c,p));e.caches[h]=a}else a=e.caches[h];e.styles[h].d+=!0===t.hd?"":a,e.styles[h]._mdf=n||e.styles[h]._mdf}}function r(t,e,i){var r=e.style;(e.c._mdf||i)&&r.pElem.setAttribute("fill","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i)&&r.pElem.setAttribute("fill-opacity",e.o.v)}function s(t,e,i){a(t,e,i),n(t,e,i)}function a(t,e,i){var r,s,a,n,o,h=e.gf,l=e.g._hasOpacity,p=e.s.v,m=e.e.v;if(e.o._mdf||i){var f="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(f,e.o.v)}if(e.s._mdf||i){var c=1===t.t?"x1":"cx",d="x1"===c?"y1":"cy";h.setAttribute(c,p[0]),h.setAttribute(d,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(c,p[0]),e.of.setAttribute(d,p[1]))}if(e.g._cmdf||i){r=e.cst;var u=e.g.c;for(a=r.length,s=0;s<a;s+=1)(n=r[s]).setAttribute("offset",u[4*s]+"%"),n.setAttribute("stop-color","rgb("+u[4*s+1]+","+u[4*s+2]+","+u[4*s+3]+")")}if(l&&(e.g._omdf||i)){var y=e.g.o;for(a=(r=e.g._collapsable?e.cst:e.ost).length,s=0;s<a;s+=1)n=r[s],e.g._collapsable||n.setAttribute("offset",y[2*s]+"%"),n.setAttribute("stop-opacity",y[2*s+1])}if(1===t.t)(e.e._mdf||i)&&(h.setAttribute("x2",m[0]),h.setAttribute("y2",m[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",m[0]),e.of.setAttribute("y2",m[1])));else if((e.s._mdf||e.e._mdf||i)&&(o=Math.sqrt(Math.pow(p[0]-m[0],2)+Math.pow(p[1]-m[1],2)),h.setAttribute("r",o),l&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.e._mdf||e.h._mdf||e.a._mdf||i){o||(o=Math.sqrt(Math.pow(p[0]-m[0],2)+Math.pow(p[1]-m[1],2)));var g=Math.atan2(m[1]-p[1],m[0]-p[0]),v=o*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),b=Math.cos(g+e.a.v)*v+p[0],E=Math.sin(g+e.a.v)*v+p[1];h.setAttribute("fx",b),h.setAttribute("fy",E),l&&!e.g._collapsable&&(e.of.setAttribute("fx",b),e.of.setAttribute("fy",E))}}function n(t,e,i){var r=e.style,s=e.d;s&&(s._mdf||i)&&s.dashStr&&(r.pElem.setAttribute("stroke-dasharray",s.dashStr),r.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||i)&&r.pElem.setAttribute("stroke","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i)&&r.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(r.pElem.setAttribute("stroke-width",e.w.v),r.msElem&&r.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){t.ty;switch(t.ty){case"fl":return r;case"gf":return a;case"gs":return s;case"st":return n;case"sh":case"el":case"rc":case"sr":return i;case"tr":return e}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(t,e,i,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var s=4;"rc"==e.ty?s=5:"el"==e.ty?s=6:"sr"==e.ty&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,s,t);var a,n,o=i.length;for(a=0;a<o;a+=1)i[a].closed||(n={transforms:r.addTransformSequence(i[a].transforms),trNodes:[]},this.styledShapes.push(n),i[a].elements.push(n))}function BaseElement(){}function NullElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initFrame(),this.initTransform(t,e,i),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,i),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,i){this.initElement(t,e,i)}function AudioElement(t,e,i){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,i),this._isPlaying=!1,this._canPlay=!1;var r=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(r),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGCompElement(t,e,i){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGTextElement(t,e,i){this.textSpans=[],this.renderType="svg",this.initElement(t,e,i)}function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[]}function SVGTintFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");if(i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.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"),i.setAttribute("result","f1"),t.appendChild(i),(i=createNS("feColorMatrix")).setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),i.setAttribute("result","f2"),t.appendChild(i),this.matrixFilter=i,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var r,s=createNS("feMerge");t.appendChild(s),(r=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),s.appendChild(r),(r=createNS("feMergeNode")).setAttribute("in","f2"),s.appendChild(r)}}function SVGFillFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(i),this.matrixFilter=i}function SVGGaussianBlurEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var i=createNS("feGaussianBlur");t.appendChild(i),this.feGaussianBlur=i}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.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"),i.setAttribute("result","f1"),t.appendChild(i);var r=createNS("feComponentTransfer");r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),this.matrixFilter=r;var s=createNS("feFuncR");s.setAttribute("type","table"),r.appendChild(s),this.feFuncR=s;var a=createNS("feFuncG");a.setAttribute("type","table"),r.appendChild(a),this.feFuncG=a;var n=createNS("feFuncB");n.setAttribute("type","table"),r.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var i=this.filterManager.effectElements,r=createNS("feComponentTransfer");(i[10].p.k||0!==i[10].p.v||i[11].p.k||1!==i[11].p.v||i[12].p.k||1!==i[12].p.v||i[13].p.k||0!==i[13].p.v||i[14].p.k||1!==i[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",r)),(i[17].p.k||0!==i[17].p.v||i[18].p.k||1!==i[18].p.v||i[19].p.k||1!==i[19].p.v||i[20].p.k||0!==i[20].p.v||i[21].p.k||1!==i[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",r)),(i[24].p.k||0!==i[24].p.v||i[25].p.k||1!==i[25].p.v||i[26].p.k||1!==i[26].p.v||i[27].p.k||0!==i[27].p.v||i[28].p.k||1!==i[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",r)),(i[31].p.k||0!==i[31].p.v||i[32].p.k||1!==i[32].p.v||i[33].p.k||1!==i[33].p.v||i[34].p.k||0!==i[34].p.v||i[35].p.k||1!==i[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",r)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),r=createNS("feComponentTransfer")),(i[3].p.k||0!==i[3].p.v||i[4].p.k||1!==i[4].p.v||i[5].p.k||1!==i[5].p.v||i[6].p.k||0!==i[6].p.v||i[7].p.k||1!==i[7].p.v)&&(r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),this.feFuncRComposed=this.createFeFunc("feFuncR",r),this.feFuncGComposed=this.createFeFunc("feFuncG",r),this.feFuncBComposed=this.createFeFunc("feFuncB",r))}function SVGDropShadowEffect(t,e){var i=e.container.globalData.renderConfig.filterSize;t.setAttribute("x",i.x),t.setAttribute("y",i.y),t.setAttribute("width",i.width),t.setAttribute("height",i.height),this.filterManager=e;var r=createNS("feGaussianBlur");r.setAttribute("in","SourceAlpha"),r.setAttribute("result","drop_shadow_1"),r.setAttribute("stdDeviation","0"),this.feGaussianBlur=r,t.appendChild(r);var s=createNS("feOffset");s.setAttribute("dx","25"),s.setAttribute("dy","0"),s.setAttribute("in","drop_shadow_1"),s.setAttribute("result","drop_shadow_2"),this.feOffset=s,t.appendChild(s);var a=createNS("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var n=createNS("feComposite");n.setAttribute("in","drop_shadow_3"),n.setAttribute("in2","drop_shadow_2"),n.setAttribute("operator","in"),n.setAttribute("result","drop_shadow_4"),t.appendChild(n);var o,h=createNS("feMerge");t.appendChild(h),o=createNS("feMergeNode"),h.appendChild(o),(o=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=h,this.originalNodeAdded=!1,h.appendChild(o)}ShapeTransformManager.prototype={addTransformSequence:function(t){var e,i=t.length,r="_";for(e=0;e<i;e+=1)r+=t[e].transform.key+"_";var s=this.sequences[r];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[r]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var i,r=0,s=t.transforms.length,a=e;r<s&&!e;){if(t.transforms[r].transform.mProps._mdf){a=!0;break}r+=1}if(a)for(t.finalTransform.reset(),r=s-1;0<=r;r-=1)i=t.transforms[r].transform.mProps.v.props,t.finalTransform.transform(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15]);t._mdf=a},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e<i;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return"_"+this.transform_key_count++}},CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,i){this.globalData=e,this.comp=i,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,i,r=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),r=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(i=createNS("g")).appendChild(this.layerElement),r=i,s.appendChild(i),i.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),r=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),n.appendChild(l),i.appendChild(this.layerElement),r=i,n.appendChild(i)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),r=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),m=createNS("path");m.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var f=createElementID();if(p.setAttribute("id",f),p.appendChild(m),this.globalData.defs.appendChild(p),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+f+")"),c.appendChild(this.layerElement),this.transformedElement=c,r?r.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+f+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,i=this.shapeModifiers.length;for(e=0;e<i;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,r=e.length;i<r;){if(e[i].elem===t)return e[i].pos;i+=1}return 0},addProcessedElement:function(t,e){for(var i=this.processedElements,r=i.length;r;)if(i[r-=1].elem===t)return void(i[r].pos=e);i.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,i){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,i),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var i,r,s=e.length,a="";for(i=0;i<s;i+=1)r=e[i].ks.k,a+=buildShapeString(r,r.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,i,r,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i])/2,0,0)}e.translate(r,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var i,r=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),i=r-1;0<=i;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextElement),SVGTextElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextElement.prototype.buildTextContents=function(t){for(var e=0,i=t.length,r=[],s="";e<i;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(r.push(s),s=""):s+=t[e],e+=1;return r.push(s),r},SVGTextElement.prototype.buildNewText=function(){var t,e,i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i?i.l.length:0),i.fc?this.layerElement.setAttribute("fill",this.buildColor(i.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),i.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(i.sc)),this.layerElement.setAttribute("stroke-width",i.sw)),this.layerElement.setAttribute("font-size",i.finalSize);var r=this.globalData.fontManager.getFontByName(i.f);if(r.fClass)this.layerElement.setAttribute("class",r.fClass);else{this.layerElement.setAttribute("font-family",r.fFamily);var s=i.fWeight,a=i.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",s)}this.layerElement.setAttribute("aria-label",i.t);var n,o=i.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var l,p=this.mHelper,m="",f=this.data.singleShape,c=0,d=0,u=!0,y=i.tr/1e3*i.finalSize;if(!f||h||i.sz){var g,v,b=this.textSpans.length;for(t=0;t<e;t+=1)h&&f&&0!==t||(n=t<b?this.textSpans[t]:createNS(h?"path":"text"),b<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(i.finalSize/100,i.finalSize/100),f&&(o[t].n&&(c=-y,d+=i.yOffset,d+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(i,p,o[t].line,c,d),c+=o[t].l||0,c+=y),h?(l=(g=(v=this.globalData.fontManager.getCharData(i.finalText[t],r.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily))&&v.data||{}).shapes?g.shapes[0].it:[],f?m+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(f&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));f&&n&&n.setAttribute("d",m)}else{var E=this.textContainer,x="start";switch(i.j){case 1:x="end";break;case 2:x="middle"}E.setAttribute("text-anchor",x),E.setAttribute("letter-spacing",y);var P=this.buildTextContents(i.finalText);for(e=P.length,d=i.ps?i.ps[1]+i.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||createNS("tspan")).textContent=P[t],n.setAttribute("x",0),n.setAttribute("y",d),n.style.display="inherit",E.appendChild(n),this.textSpans[t]=n,d+=i.finalLineHeight;this.layerElement.appendChild(E)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},SVGTextElement.prototype.sourceRectAtTime=function(t){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextElement.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var i,r,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(i=s[t],r=this.textSpans[t],i._mdf.m&&r.setAttribute("transform",i.m),i._mdf.o&&r.setAttribute("opacity",i.o),i._mdf.sw&&r.setAttribute("stroke-width",i.sw),i._mdf.sc&&r.setAttribute("stroke",i.sc),i._mdf.fc&&r.setAttribute("fill",i.fc))}},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,i,r,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(i=0;i<a;i+=1){for(r=this.stylesList[i],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(r)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var i,r=new SVGStyleData(t,e),s=r.pElem;if("st"===t.ty)i=new SVGStrokeStyleData(this,t,r);else if("fl"===t.ty)i=new SVGFillStyleData(this,t,r);else if("gf"===t.ty||"gs"===t.ty){i=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,r),this.globalData.defs.appendChild(i.gf),i.maskId&&(this.globalData.defs.appendChild(i.ms),this.globalData.defs.appendChild(i.of),s.setAttribute("mask","url("+locationHref+"#"+i.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(r),this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var i=TransformPropertyFactory.getTransformProperty(this,t,this),r=new SVGTransformData(i,i.o,e);return this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createShapeElement=function(t,e,i){var r=4;"rc"===t.ty?r=5:"el"===t.ty?r=6:"sr"===t.ty&&(r=7);var s=new SVGShapeData(e,i,ShapePropertyFactory.getShapeProp(this,t,r,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var i=0,r=this.animatedContents.length;i<r;){if(this.animatedContents[i].element===e)return;i+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,i=t.styles,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||i.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,i,r,s,a,n){var o,h,l,p,m,f,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((f=this.searchProcessedElement(t[o]))?e[o]=i[f-1]:t[o]._render=n,"fl"==t[o].ty||"st"==t[o].ty||"gf"==t[o].ty||"gs"==t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&r.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"==t[o].ty){if(f)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&r.appendChild(e[o].gr)}else"tr"==t[o].ty?(f||(e[o]=this.createTransformElement(t[o],r)),p=e[o].transform,c.push(p)):"sh"==t[o].ty||"rc"==t[o].ty||"el"==t[o].ty||"sr"==t[o].ty?(f||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"==t[o].ty||"rd"==t[o].ty||"ms"==t[o].ty||"pb"==t[o].ty?(f?(m=e[o]).closed=!1:((m=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=m,this.shapeModifiers.push(m)),y.push(m)):"rp"==t[o].ty&&(f?(m=e[o]).closed=!0:(m=ShapeModifiers.getModifier(t[o].ty),(e[o]=m).init(this,t,o,e),this.shapeModifiers.push(m),n=!1),y.push(m));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,i=this.animatedContents.length;for(t=0;t<i;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,r=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",i[0]-e[0]+" 0 0 0 "+e[0]+" "+(i[1]-e[1])+" 0 0 0 "+e[1]+" "+(i[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,i=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGGaussianBlurEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=.3*this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,r=3==i?0:e,s=2==i?0:e;this.feGaussianBlur.setAttribute("stdDeviation",r+" "+s);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},SVGStrokeEffect.prototype.initialize=function(){var t,e,i,r,s=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(r=this.elem.maskManager.masksProperties.length,i=0):r=(i=this.filterManager.effectElements[0].p.v-1)+1,(e=createNS("g")).setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1);i<r;i+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:i});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),n=createElementID();a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+locationHref+"#"+n+")");s[0];)o.appendChild(s[0]);this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(s=this.elem.layerElement.children||this.elem.layerElement.childNodes;s.length;)this.elem.layerElement.removeChild(s[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){this.initialized||this.initialize();var e,i,r,s=this.paths.length;for(e=0;e<s;e+=1)if(-1!==this.paths[e].m&&(i=this.elem.maskManager.viewData[this.paths[e].m],r=this.paths[e].p,(t||this.filterManager._mdf||i.prop._mdf)&&r.setAttribute("d",i.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||i.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,o=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,h=r.getTotalLength();a="0 0 0 "+h*n+" ";var l,p=h*(o-n),m=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100,f=Math.floor(p/m);for(l=0;l<f;l+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100;r.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bm_floor(255*c[0])+","+bm_floor(255*c[1])+","+bm_floor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,r=this.filterManager.effectElements[2].p.v,s=r[0]+" "+i[0]+" "+e[0],a=r[1]+" "+i[1]+" "+e[1],n=r[2]+" "+i[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",s),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var i=createNS(t);return i.setAttribute("type","table"),e.appendChild(i),i},SVGProLevelsFilter.prototype.getTableValue=function(t,e,i,r,s){for(var a,n,o=0,h=Math.min(t,e),l=Math.max(t,e),p=Array.call(null,{length:256}),m=0,f=s-r,c=e-t;o<=256;)n=(a=o/256)<=h?c<0?s:r:l<=a?c<0?r:s:r+f*Math.pow((a-t)/c,1/i),p[m++]=n,o+=256/255;return p.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,r=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=i*Math.cos(r),a=i*Math.sin(r);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,(this.elem=i).matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement}function SVGEffects(t){var e,i,r=t.data.ef?t.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s),n=0;for(this.filters=[],e=0;e<r;e+=1)i=null,20===t.data.ef[e].ty?(n+=1,i=new SVGTintFilter(a,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(n+=1,i=new SVGFillFilter(a,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?i=new SVGStrokeEffect(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(n+=1,i=new SVGTritoneFilter(a,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(n+=1,i=new SVGProLevelsFilter(a,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(n+=1,i=new SVGDropShadowEffect(a,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty?i=new SVGMatte3Effect(a,t.effectsManager.effectElements[e],t):29===t.data.ef[e].ty&&(n+=1,i=new SVGGaussianBlurEffect(a,t.effectsManager.effectElements[e])),i&&this.filters.push(i);n&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+locationHref+"#"+s+")")),this.filters.length&&t.addRenderableComponent(this)}function CVContextData(){this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;var t;for(this.savedOp=createTypedArray("float32",15),t=0;t<15;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=15}function CVBaseElement(){}function CVImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.img=e.imageLoader.getImage(this.assetData),this.initElement(t,e,i)}function CVCompElement(t,e,i){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CVMaskElement(t,e){this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var i,r=this.masksProperties.length,s=!1;for(i=0;i<r;i++)"n"!==this.masksProperties[i].mode&&(s=!0),this.viewData[i]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);(this.hasMasks=s)&&this.element.addRenderableComponent(this)}function CVShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(t,e,i)}function CVSolidElement(t,e,i){this.initElement(t,e,i)}function CVTextElement(t,e,i){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,i)}function CVEffects(){}function HBaseElement(t,e,i){}function HSolidElement(t,e,i){this.initElement(t,e,i)}function HCompElement(t,e,i){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function HShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,i),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(t,e,i){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,i)}function HImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,i)}function HCameraElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initHierarchy();var r=PropertyFactory.getProp;if(this.pe=r(this,t.pe,0,0,this),t.ks.p.s?(this.px=r(this,t.ks.p.x,1,0,this),this.py=r(this,t.ks.p.y,1,0,this),this.pz=r(this,t.ks.p.z,1,0,this)):this.p=r(this,t.ks.p,1,0,this),t.ks.a&&(this.a=r(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var s,a=t.ks.or.k.length;for(s=0;s<a;s+=1)t.ks.or.k[s].to=null,t.ks.or.k[s].ti=null}this.or=r(this,t.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=r(this,t.ks.rx,0,degToRads,this),this.ry=r(this,t.ks.ry,0,degToRads,this),this.rz=r(this,t.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HEffects(){}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;e<i;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var i=t.layerElement.parentNode;if(i){for(var r,s=i.children,a=0,n=s.length;a<n&&s[a]!==t.layerElement;)a+=1;a<=n-2&&(r=s[a+1]);var o=createNS("use");o.setAttribute("href","#"+e),r?i.insertBefore(o,r):i.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var i=createElementID(),r=createNS("mask");r.setAttribute("id",e.layerId),r.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var s=t.globalData.defs;s.appendChild(r);var a=createNS("symbol");a.setAttribute("id",i),this.replaceInParent(e,i),a.appendChild(e.layerElement),s.appendChild(a);var n=createNS("use");n.setAttribute("href","#"+i),r.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,i=0,r=e.length;i<r;)e[i]&&e[i].data.ind===t&&this.setElementAsMask(this.elem,e[i]),i+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGEffects.prototype.renderFrame=function(t){var e,i=this.filters.length;for(e=0;e<i;e+=1)this.filters[e].renderFrame(t)},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var i=0;for(i=this._length;i<t;i+=1)this.saved[i]=createTypedArray("float32",16);this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var t=createTag("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,i,r=t.getContext("2d"),s=this.img.width,a=this.img.height,n=s/a,o=this.assetData.w/this.assetData.h,h=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;o<n&&"xMidYMid slice"===h||n<o&&"xMidYMid slice"!==h?e=(i=a)*o:i=(e=s)/o,r.drawImage(this.img,(s-e)/2,(a-i)/2,e,i,0,0,this.assetData.w,this.assetData.h),this.img=t}},CVImageElement.prototype.renderInnerContent=function(t){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([CanvasRenderer,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,i,r,s=this.element.finalTransform.mat,a=this.element.canvasContext,n=this.masksProperties.length;for(a.beginPath(),t=0;t<n;t++)if("n"!==this.masksProperties[t].mode){this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),r=this.viewData[t].v,e=s.applyToPointArray(r.v[0][0],r.v[0][1],0),a.moveTo(e[0],e[1]);var o,h=r._length;for(o=1;o<h;o++)i=s.applyToTriplePoints(r.o[o-1],r.i[o],r.v[o]),a.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);i=s.applyToTriplePoints(r.o[o-1],r.i[0],r.v[0]),a.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var i={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},r={};if("fl"==t.ty||"st"==t.ty?(r.c=PropertyFactory.getProp(this,t.c,1,255,this),r.c.k||(i.co="rgb("+bm_floor(r.c.v[0])+","+bm_floor(r.c.v[1])+","+bm_floor(r.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(r.s=PropertyFactory.getProp(this,t.s,1,null,this),r.e=PropertyFactory.getProp(this,t.e,1,null,this),r.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),r.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),r.g=new GradientProperty(this,t.g,this)),r.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"==t.ty||"gs"==t.ty){if(i.lc=this.lcEnum[t.lc]||"round",i.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(i.ml=t.ml),r.w=PropertyFactory.getProp(this,t.w,0,null,this),r.w.k||(i.wi=r.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);r.d=s,r.d.k||(i.da=r.d.dashArray,i.do=r.d.dashoffset[0])}}else i.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(i),r.style=i,r},CVShapeElement.prototype.createGroupElement=function(t){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(t){var e,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},CVShapeElement.prototype.closeStyles=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e].closed=!0},CVShapeElement.prototype.searchShapes=function(t,e,i,r,s){var a,n,o,h,l,p,m=t.length-1,f=[],c=[],d=[].concat(s);for(a=m;0<=a;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=i[h-1]:t[a]._shouldRender=r,"fl"==t[a].ty||"st"==t[a].ty||"gf"==t[a].ty||"gs"==t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),f.push(e[a].style);else if("gr"==t[a].ty){if(h)for(o=e[a].it.length,n=0;n<o;n+=1)e[a].prevViewData[n]=e[a].it[n];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,r,d)}else"tr"==t[a].ty?(h||(p=this.createTransformElement(t[a]),e[a]=p),d.push(e[a]),this.addTransformToStyleList(e[a])):"sh"==t[a].ty||"rc"==t[a].ty||"el"==t[a].ty||"sr"==t[a].ty?h||(e[a]=this.createShapeElement(t[a])):"tm"==t[a].ty||"rd"==t[a].ty||"pb"==t[a].ty?(h?(l=e[a]).closed=!1:((l=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=l,this.shapeModifiers.push(l)),c.push(l)):"rp"==t[a].ty&&(h?(l=e[a]).closed=!0:(l=ShapeModifiers.getModifier(t[a].ty),(e[a]=l).init(this,t,a,e),this.shapeModifiers.push(l),r=!1),c.push(l));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(f),m=c.length,a=0;a<m;a+=1)c[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var t,e,i,r,s,a,n,o,h,l=this.stylesList.length,p=this.globalData.renderer,m=this.globalData.canvasContext;for(t=0;t<l;t+=1)if(("st"!==(o=(h=this.stylesList[t]).type)&&"gs"!==o||0!==h.wi)&&h.data._shouldRender&&0!==h.coOp&&0!==this.globalData.currentGlobalAlpha){for(p.save(),a=h.elements,"st"===o||"gs"===o?(m.strokeStyle="st"===o?h.co:h.grd,m.lineWidth=h.wi,m.lineCap=h.lc,m.lineJoin=h.lj,m.miterLimit=h.ml||0):m.fillStyle="fl"===o?h.co:h.grd,p.ctxOpacity(h.coOp),"st"!==o&&"gs"!==o&&m.beginPath(),p.ctxTransform(h.preTransforms.finalTransform.props),i=a.length,e=0;e<i;e+=1){for("st"!==o&&"gs"!==o||(m.beginPath(),h.da&&(m.setLineDash(h.da),m.lineDashOffset=h.do)),s=(n=a[e].trNodes).length,r=0;r<s;r+=1)"m"==n[r].t?m.moveTo(n[r].p[0],n[r].p[1]):"c"==n[r].t?m.bezierCurveTo(n[r].pts[0],n[r].pts[1],n[r].pts[2],n[r].pts[3],n[r].pts[4],n[r].pts[5]):m.closePath();"st"!==o&&"gs"!==o||(m.stroke(),h.da&&m.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&m.fill(h.r),p.restore()}},CVShapeElement.prototype.renderShape=function(t,e,i,r){var s,a;for(a=t,s=e.length-1;0<=s;s-=1)"tr"==e[s].ty?(a=i[s].transform,this.renderShapeTransform(t,a)):"sh"==e[s].ty||"el"==e[s].ty||"rc"==e[s].ty||"sr"==e[s].ty?this.renderPath(e[s],i[s]):"fl"==e[s].ty?this.renderFill(e[s],i[s],a):"st"==e[s].ty?this.renderStroke(e[s],i[s],a):"gf"==e[s].ty||"gs"==e[s].ty?this.renderGradientFill(e[s],i[s],a):"gr"==e[s].ty?this.renderShape(a,e[s].it,i[s].it):e[s].ty;r&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i,r,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(s=0;s<o;s+=1){var l=n.shapes[s];if(l&&l.v){for(r=l._length,i=1;i<r;i+=1)1===i&&a.push({t:"m",p:h.applyToPointArray(l.v[0][0],l.v[0][1],0)}),a.push({t:"c",pts:h.applyToTriplePoints(l.o[i-1],l.i[i],l.v[i])});1===r&&a.push({t:"m",p:h.applyToPointArray(l.v[0][0],l.v[0][1],0)}),l.c&&r&&(a.push({t:"c",pts:h.applyToTriplePoints(l.o[i-1],l.i[0],l.v[0])}),a.push({t:"z"}))}}t.trNodes=a}},CVShapeElement.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var i,r=e.styledShapes.length;for(i=0;i<r;i+=1)this.renderStyledShape(e.styledShapes[i],e.sh)}},CVShapeElement.prototype.renderFill=function(t,e,i){var r=e.style;(e.c._mdf||this._isFirstFrame)&&(r.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i._opMdf||this._isFirstFrame)&&(r.coOp=e.o.v*i.opacity)},CVShapeElement.prototype.renderGradientFill=function(t,e,i){var r=e.style;if(!r.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var s=this.globalData.canvasContext,a=e.s.v,n=e.e.v;if(1===t.t)f=s.createLinearGradient(a[0],a[1],n[0],n[1]);else var o=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)),h=Math.atan2(n[1]-a[1],n[0]-a[0]),l=o*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),p=Math.cos(h+e.a.v)*l+a[0],m=Math.sin(h+e.a.v)*l+a[1],f=s.createRadialGradient(p,m,0,a[0],a[1],o);var c,d=t.g.p,u=e.g.c,y=1;for(c=0;c<d;c+=1)e.g._hasOpacity&&e.g._collapsable&&(y=e.g.o[2*c+1]),f.addColorStop(u[4*c]/100,"rgba("+u[4*c+1]+","+u[4*c+2]+","+u[4*c+3]+","+y+")");r.grd=f}r.coOp=e.o.v*i.opacity},CVShapeElement.prototype.renderStroke=function(t,e,i){var r=e.style,s=e.d;s&&(s._mdf||this._isFirstFrame)&&(r.da=s.dashArray,r.do=s.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(r.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i._opMdf||this._isFirstFrame)&&(r.coOp=e.o.v*i.opacity),(e.w._mdf||this._isFirstFrame)&&(r.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var i=!1;t.sc&&(i=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var r,s,a=this.globalData.fontManager.getFontByName(t.f),n=t.l,o=this.mHelper;this.stroke=i,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,s=t.finalText.length;var h,l,p,m,f,c,d,u,y,g,v=this.data.singleShape,b=t.tr/1e3*t.finalSize,E=0,x=0,P=!0,S=0;for(r=0;r<s;r+=1){for(l=(h=this.globalData.fontManager.getCharData(t.finalText[r],a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&h.data||{},o.reset(),v&&n[r].n&&(E=-b,x+=t.yOffset,x+=P?1:0,P=!1),d=(f=l.shapes?l.shapes[0].it:[]).length,o.scale(t.finalSize/100,t.finalSize/100),v&&this.applyTextPropertiesToMatrix(t,o,n[r].line,E,x),y=createSizedArray(d),c=0;c<d;c+=1){for(m=f[c].ks.k.i.length,u=f[c].ks.k,g=[],p=1;p<m;p+=1)1==p&&g.push(o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),g.push(o.applyToX(u.o[p-1][0],u.o[p-1][1],0),o.applyToY(u.o[p-1][0],u.o[p-1][1],0),o.applyToX(u.i[p][0],u.i[p][1],0),o.applyToY(u.i[p][0],u.i[p][1],0),o.applyToX(u.v[p][0],u.v[p][1],0),o.applyToY(u.v[p][0],u.v[p][1],0));g.push(o.applyToX(u.o[p-1][0],u.o[p-1][1],0),o.applyToY(u.o[p-1][0],u.o[p-1][1],0),o.applyToX(u.i[0][0],u.i[0][1],0),o.applyToY(u.i[0][0],u.i[0][1],0),o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),y[c]=g}v&&(E+=n[r].l,E+=b),this.textSpans[S]?this.textSpans[S].elem=y:this.textSpans[S]={elem:y},S+=1}},CVTextElement.prototype.renderInnerContent=function(){var t,e,i,r,s,a,n=this.canvasContext;this.finalTransform.mat.props;n.font=this.values.fValue,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,h=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;e=l.length;var p,m,f=null,c=null,d=null;for(t=0;t<e;t+=1)if(!l[t].n){if((o=h[t])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(o.p),this.globalData.renderer.ctxOpacity(o.o)),this.fill){for(o&&o.fc?f!==o.fc&&(f=o.fc,n.fillStyle=o.fc):f!==this.values.fill&&(f=this.values.fill,n.fillStyle=this.values.fill),r=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),i=0;i<r;i+=1)for(a=(m=p[i]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(o&&o.sw?d!==o.sw&&(d=o.sw,n.lineWidth=o.sw):d!==this.values.sWidth&&(d=this.values.sWidth,n.lineWidth=this.values.sWidth),o&&o.sc?c!==o.sc&&(c=o.sc,n.strokeStyle=o.sc):c!==this.values.stroke&&(c=this.values.stroke,n.strokeStyle=this.values.stroke),r=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),i=0;i<r;i+=1)for(a=(m=p[i]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}o&&this.globalData.renderer.restore()}},CVEffects.prototype.renderFrame=function(){},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&(this.transformedElement.style.transform=this.transformedElement.style.webkitTransform=this.finalTransform.mat.toCSS()),this.finalTransform._opMdf&&(this.transformedElement.style.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=HybridRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([HybridRenderer,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(t,e){for(var i,r=0;r<e;)this.elements[r]&&this.elements[r].getBaseElement&&(i=this.elements[r].getBaseElement()),r+=1;i?this.layerElement.insertBefore(t,i):this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)e=t[i].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(t,e){var i,r,s,a,n,o=t.sh.v,h=t.transformers,l=o._length;if(!(l<=1)){for(i=0;i<l-1;i+=1)r=this.getTransformedPoint(h,o.v[i]),s=this.getTransformedPoint(h,o.o[i]),a=this.getTransformedPoint(h,o.i[i+1]),n=this.getTransformedPoint(h,o.v[i+1]),this.checkBounds(r,s,a,n,e);o.c&&(r=this.getTransformedPoint(h,o.v[i]),s=this.getTransformedPoint(h,o.o[i]),a=this.getTransformedPoint(h,o.i[0]),n=this.getTransformedPoint(h,o.v[0]),this.checkBounds(r,s,a,n,e))}},HShapeElement.prototype.checkBounds=function(t,e,i,r,s){this.getBoundsOfCurve(t,e,i,r);var a=this.shapeBoundingBox;s.x=bm_min(a.left,s.x),s.xMax=bm_max(a.right,s.xMax),s.y=bm_min(a.top,s.y),s.yMax=bm_max(a.bottom,s.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(t,e,i,r){for(var s,a,n,o,h,l,p,m=[[t[0],r[0]],[t[1],r[1]]],f=0;f<2;++f)if(a=6*t[f]-12*e[f]+6*i[f],s=-3*t[f]+9*e[f]-9*i[f]+3*r[f],n=3*e[f]-3*t[f],a|=0,n|=0,0!==(s|=0))(h=a*a-4*n*s)<0||(0<(l=(-a+bm_sqrt(h))/(2*s))&&l<1&&m[f].push(this.calculateF(l,t,e,i,r,f)),0<(p=(-a-bm_sqrt(h))/(2*s))&&p<1&&m[f].push(this.calculateF(p,t,e,i,r,f)));else{if(0===a)continue;0<(o=-n/a)&&o<1&&m[f].push(this.calculateF(o,t,e,i,r,f))}this.shapeBoundingBox.left=bm_min.apply(null,m[0]),this.shapeBoundingBox.top=bm_min.apply(null,m[1]),this.shapeBoundingBox.right=bm_max.apply(null,m[0]),this.shapeBoundingBox.bottom=bm_max.apply(null,m[1])},HShapeElement.prototype.calculateF=function(t,e,i,r,s,a){return bm_pow(1-t,3)*e[a]+3*bm_pow(1-t,2)*t*i[a]+3*(1-t)*bm_pow(t,2)*r[a]+bm_pow(t,3)*s[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)t[i]&&t[i].sh?this.calculateShapeBoundingBox(t[i],e):t[i]&&t[i].it&&this.calculateBoundingBox(t[i].it,e)},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var i=!1;this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),i=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),i=!0),(i||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y)&&(this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.shapeCont.style.transform=this.shapeCont.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=createNS("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=this.innerElem.style;e.color=e.fill=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)",t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var i,r,s=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",s.fClass)this.innerElem.className=s.fClass;else{e.fontFamily=s.fFamily;var a=t.fWeight,n=t.fStyle;e.fontStyle=n,e.fontWeight=a}var o,h,l,p=t.l;r=p.length;var m,f=this.mHelper,c="",d=0;for(i=0;i<r;i+=1){if(this.globalData.fontManager.chars?(this.textPaths[d]?o=this.textPaths[d]:((o=createNS("path")).setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[d]?l=(h=this.textSpans[d]).children[0]:((h=createTag("div")).style.lineHeight=0,(l=createNS("svg")).appendChild(o),styleDiv(h)))):this.isMasked?o=this.textPaths[d]?this.textPaths[d]:createNS("text"):this.textSpans[d]?(h=this.textSpans[d],o=this.textPaths[d]):(styleDiv(h=createTag("span")),styleDiv(o=createTag("span")),h.appendChild(o)),this.globalData.fontManager.chars){var u,y=this.globalData.fontManager.getCharData(t.finalText[i],s.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(u=y?y.data:null,f.reset(),u&&u.shapes&&(m=u.shapes[0].it,f.scale(t.finalSize/100,t.finalSize/100),c=this.createPathShape(f,m),o.setAttribute("d",c)),this.isMasked)this.innerElem.appendChild(o);else{if(this.innerElem.appendChild(h),u&&u.shapes){document.body.appendChild(l);var g=l.getBBox();l.setAttribute("width",g.width+2),l.setAttribute("height",g.height+2),l.setAttribute("viewBox",g.x-1+" "+(g.y-1)+" "+(g.width+2)+" "+(g.height+2)),l.style.transform=l.style.webkitTransform="translate("+(g.x-1)+"px,"+(g.y-1)+"px)",p[i].yOffset=g.y-1}else l.setAttribute("width",1),l.setAttribute("height",1);h.appendChild(l)}}else o.textContent=p[i].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked?this.innerElem.appendChild(o):(this.innerElem.appendChild(h),o.style.transform=o.style.webkitTransform="translate3d(0,"+-t.finalSize/1.2+"px,0)");this.isMasked?this.textSpans[d]=o:this.textSpans[d]=h,this.textSpans[d].style.display="block",this.textPaths[d]=o,d+=1}for(;d<this.textSpans.length;)this.textSpans[d].style.display="none",d+=1},HTextElement.prototype.renderInnerContent=function(){if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;this.isMasked&&this.finalTransform._matMdf&&(this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)")}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var t,e,i,r,s,a=0,n=this.textAnimator.renderedLetters,o=this.textProperty.currentData.l;for(e=o.length,t=0;t<e;t+=1)o[t].n?a+=1:(r=this.textSpans[t],s=this.textPaths[t],i=n[a],a+=1,i._mdf.m&&(this.isMasked?r.setAttribute("transform",i.m):r.style.transform=r.style.webkitTransform=i.m),r.style.opacity=i.o,i.sw&&i._mdf.sw&&s.setAttribute("stroke-width",i.sw),i.sc&&i._mdf.sc&&s.setAttribute("stroke",i.sc),i.fc&&i._mdf.fc&&(s.setAttribute("fill",i.fc),s.style.color=i.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var h=this.innerElem.getBBox();this.currentBBox.w!==h.width&&(this.currentBBox.w=h.width,this.svgElement.setAttribute("width",h.width)),this.currentBBox.h!==h.height&&(this.currentBBox.h=h.height,this.svgElement.setAttribute("height",h.height));this.currentBBox.w===h.width+2&&this.currentBBox.h===h.height+2&&this.currentBBox.x===h.x-1&&this.currentBBox.y===h.y-1||(this.currentBBox.w=h.width+2,this.currentBBox.h=h.height+2,this.currentBBox.x=h.x-1,this.currentBBox.y=h.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var t,e,i=this.comp.threeDElements.length;for(t=0;t<i;t+=1)"3d"===(e=this.comp.threeDElements[t]).type&&(e.perspectiveElem.style.perspective=e.perspectiveElem.style.webkitPerspective=this.pe.v+"px",e.container.style.transformOrigin=e.container.style.mozTransformOrigin=e.container.style.webkitTransformOrigin="0px 0px 0px",e.perspectiveElem.style.transform=e.perspectiveElem.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)")},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var t,e,i=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)i=this.hierarchy[t].finalTransform.mProp._mdf||i;if(i||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){if(this.mat.reset(),this.hierarchy)for(t=e=this.hierarchy.length-1;0<=t;t-=1){var r=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-r.p.v[0],-r.p.v[1],r.p.v[2]),this.mat.rotateX(-r.or.v[0]).rotateY(-r.or.v[1]).rotateZ(r.or.v[2]),this.mat.rotateX(-r.rx.v).rotateY(-r.ry.v).rotateZ(r.rz.v),this.mat.scale(1/r.s.v[0],1/r.s.v[1],1/r.s.v[2]),this.mat.translate(r.a.v[0],r.a.v[1],r.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s;s=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),n=[s[0]/a,s[1]/a,s[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],o),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-h)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var m;for(e=this.comp.threeDElements.length,t=0;t<e;t+=1)"3d"===(m=this.comp.threeDElements[t]).type&&(p&&(m.container.style.transform=m.container.style.webkitTransform=this.mat.toCSS()),this.pe._mdf&&(m.perspectiveElem.style.perspective=m.perspectiveElem.style.webkitPerspective=this.pe.v+"px"));this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},HEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],r=0,a=0,n=0,o=!0,h=!1;function i(t){for(var e=0,i=t.target;e<a;)s[e].animation===i&&(s.splice(e,1),e-=1,a-=1,i.isPaused||m()),e+=1}function l(t,e){if(!t)return null;for(var i=0;i<a;){if(s[i].elem==t&&null!==s[i].elem)return s[i].animation;i+=1}var r=new AnimationItem;return f(r,t),r.setData(t,e),r}function p(){n+=1,d()}function m(){n-=1}function f(t,e){t.addEventListener("destroy",i),t.addEventListener("_active",p),t.addEventListener("_idle",m),s.push({elem:e,animation:t}),a+=1}function c(t){var e,i=t-r;for(e=0;e<a;e+=1)s[e].animation.advanceTime(i);r=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){r=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new AnimationItem;return f(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var i;for(i=0;i<a;i+=1)s[i].animation.setSpeed(t,e)},t.setDirection=function(t,e){var i;for(i=0;i<a;i+=1)s[i].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,i){var r,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(r=0;r<a;r+=1)i&&s[r].setAttribute("data-bm-type",i),l(s[r],t);if(e&&0===a){i||(i="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),n.appendChild(o),l(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,i){var r;for(r=0;r<a;r+=1)s[r].animation.goToAndStop(t,e,i)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){var i;for(i=0;i<a;i+=1)s[i].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,i=[];for(t=0;t<e;t+=1)i.push(s[t].animation);return i},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){var i={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},r=t.attributes;i.path=r.getNamedItem("data-animation-path")?r.getNamedItem("data-animation-path").value:r.getNamedItem("data-bm-path")?r.getNamedItem("data-bm-path").value:r.getNamedItem("bm-path")?r.getNamedItem("bm-path").value:"",i.animType=r.getNamedItem("data-anim-type")?r.getNamedItem("data-anim-type").value:r.getNamedItem("data-bm-type")?r.getNamedItem("data-bm-type").value:r.getNamedItem("bm-type")?r.getNamedItem("bm-type").value:r.getNamedItem("data-bm-renderer")?r.getNamedItem("data-bm-renderer").value:r.getNamedItem("bm-renderer")?r.getNamedItem("bm-renderer").value:"canvas";var s=r.getNamedItem("data-anim-loop")?r.getNamedItem("data-anim-loop").value:r.getNamedItem("data-bm-loop")?r.getNamedItem("data-bm-loop").value:r.getNamedItem("bm-loop")?r.getNamedItem("bm-loop").value:"";""===s||(i.loop="false"!==s&&("true"===s||parseInt(s)));var a=r.getNamedItem("data-anim-autoplay")?r.getNamedItem("data-anim-autoplay").value:r.getNamedItem("data-bm-autoplay")?r.getNamedItem("data-bm-autoplay").value:!r.getNamedItem("bm-autoplay")||r.getNamedItem("bm-autoplay").value;i.autoplay="false"!==a,i.name=r.getNamedItem("data-name")?r.getNamedItem("data-name").value:r.getNamedItem("data-bm-name")?r.getNamedItem("data-bm-name").value:r.getNamedItem("bm-name")?r.getNamedItem("bm-name").value:"","false"===(r.getNamedItem("data-anim-prerender")?r.getNamedItem("data-anim-prerender").value:r.getNamedItem("data-bm-prerender")?r.getNamedItem("data-bm-prerender").value:r.getNamedItem("bm-prerender")?r.getNamedItem("bm-prerender").value:"")&&(i.prerender=!1),this.setParams(i)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,r=this.animationData.layers,s=r.length,a=t.layers,n=a.length;for(i=0;i<n;i+=1)for(e=0;e<s;){if(r[e].id==a[i].id){r[e]=a[i];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,i){i&&this.name!=i||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,i){this.goToAndStop(t,e,i),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?i=t:this.currentRawFrame+this.firstFrame>e&&(i=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==i&&this.goToAndStop(i,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var i,r=t.length;for(i=0;i<r;i+=1)this.segments.push(t[i])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,i=this.assets.length;e<i;){if(t==this.assets[e].id)return this.assets[e];e+=1}},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(lY={},lY.initExpressions=function(t){var e=0,i=[];function r(){var t,e=i.length;for(t=0;t<e;t+=1)i[t].release();i.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&r()},t.renderer.globalData.registerExpressionProperty=function(t){-1===i.indexOf(t)&&i.push(t)}},lY),lY;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var i,r=t.length,s=[];for(i=0;i<r;i+=1)s[i]=-t[i];return s}return t.propType?t.v:void 0}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var i=typeof t,r=typeof e;if("string"===i||"string"===r)return t+e;if(isNumerable(i,t)&&isNumerable(r,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(r,e))return(t=t.slice(0))[0]=t[0]+e,t;if(isNumerable(i,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var i=typeof t,r=typeof e;if(isNumerable(i,t)&&isNumerable(r,e))return"string"===i&&(t=parseInt(t)),"string"===r&&(e=parseInt(e)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(r,e))return(t=t.slice(0))[0]=t[0]-e,t;if(isNumerable(i,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var i,r,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,i=createTypedArray("float32",s),r=0;r<s;r+=1)i[r]=t[r]*e;return i}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,i=createTypedArray("float32",s),r=0;r<s;r+=1)i[r]=t*e[r];return i}return 0}function div(t,e){var i,r,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,i=createTypedArray("float32",s),r=0;r<s;r+=1)i[r]=t[r]/e;return i}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,i=createTypedArray("float32",s),r=0;r<s;r+=1)i[r]=t/e[r];return i}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t)),"string"==typeof e&&(e=parseInt(e)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,i){if(i<e){var r=i;i=e,e=r}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,r=Math.min(t.length,e.length),s=0;for(i=0;i<r;i+=1)s+=Math.pow(e[i]-t[i],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,i,r=t[0],s=t[1],a=t[2],n=Math.max(r,s,a),o=Math.min(r,s,a),h=(n+o)/2;if(n==o)e=i=0;else{var l=n-o;switch(i=.5<h?l/(2-n-o):l/(n+o),n){case r:e=(s-a)/l+(s<a?6:0);break;case s:e=(a-r)/l+2;break;case a:e=(r-s)/l+4}e/=6}return[e,i,h,t[3]]}function hue2rgb(t,e,i){return i<0&&(i+=1),1<i&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e,i,r,s=t[0],a=t[1],n=t[2];if(0===a)e=i=r=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),i=hue2rgb(h,o,s),r=hue2rgb(h,o,s-1/3)}return[e,i,r,t[3]]}function linear(t,e,i,r,s){if(void 0!==r&&void 0!==s||(r=e,s=i,e=0,i=1),i<e){var a=i;i=e,e=a}if(t<=e)return r;if(i<=t)return s;var n=i===e?0:(t-e)/(i-e);if(!r.length)return r+(s-r)*n;var o,h=r.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=r[o]+(s[o]-r[o])*n;return l}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var i,r=e.length;t||(t=createTypedArray("float32",r));var s=createTypedArray("float32",r),a=BMMath.random();for(i=0;i<r;i+=1)s[i]=t[i]+a*(e[i]-t[i]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,i,r){var s,a=t.length,n=shape_pool.newElement();n.setPathData(!!r,a);var o,h,l=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:l,h=i&&i[s]?i[s]:l,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,__expression_functions=[],scoped_bm_rt;if(data.xf){var i,len=data.xf.length;for(i=0;i<len;i+=1)__expression_functions[i]=eval("(function(){ return "+data.xf[i]+"}())")}var expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var i,r,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(r=i=0;i<n;){for(r=0;r<s;r+=1)a[r]+=-e+2*e*BMMath.random();i+=1}var o=5*time,h=o-Math.floor(o),l=createTypedArray("float32",s);if(1<s){for(r=0;r<s;r+=1)l[r]=this.pv[r]+a[r]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var i=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],r=Math.atan2(i[0],Math.sqrt(i[1]*i[1]+i[2]*i[2]))/degToRads;return[-Math.atan2(i[1],i[2])/degToRads,r,0]}function easeOut(t,e,i,r,s){return applyEase(easeOutBez,t,e,i,r,s)}function easeIn(t,e,i,r,s){return applyEase(easeInBez,t,e,i,r,s)}function ease(t,e,i,r,s){return applyEase(easeInOutBez,t,e,i,r,s)}function applyEase(t,e,i,r,s,a){void 0===s?(s=i,a=r):e=(e-i)/(r-i);var n=t(e=1<e?1:e<0?0:e);if($bm_isInstanceOfArray(s)){var o,h=s.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=(a[o]-s[o])*n+s[o];return l}return(a-s)*n+s}function nearestKey(t){var e,i,r,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(i=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)i=1,r=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){i=e+1,r=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){r=t-data.k[e].t>data.k[e+1].t-t?(i=e+2,data.k[e+1].t):(i=e+1,data.k[e].t);break}}-1===i&&(i=e+1,r=data.k[e].t)}else r=i=0;var a={};return a.index=i,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,r;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=data.k[t].hasOwnProperty("s")?data.k[t].s:data.k[t-1].e;for(r=s.length,i=0;i<r;i+=1)e[i]=s[i],e.value[i]=s[i];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,i){e.x&&(i.k=!0,i.x=!0,i.initiateExpression=ExpressionManager.initiateExpression,i.effectsSequence.push(i.initiateExpression(t,e,i).bind(i)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),i=this.getValueAtTime(t+-.01),r=0;if(e.length){var s;for(s=0;s<e.length;s+=1)r+=Math.pow(i[s]-e[s],2);r=100*Math.sqrt(r)}else r=0;return r},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,i,r=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(r.length)for(e=createTypedArray("float32",r.length),i=0;i<r.length;i+=1)e[i]=(s[i]-r[i])/-.001;else e=(s-r)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,i){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var r,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[l.length-1].t;if(h<=p)return this.pv;if(i?s=p-(r=e?Math.abs(p-elem.comp.globalData.frameRate*e):Math.max(0,p-this.elem.data.ip)):((!e||e>l.length-1)&&(e=l.length-1),r=p-(s=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/r)%2!=0)return this.getValueAtTime((r-(h-s)%r+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%r+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/r);if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=(f[a]-m[a])*d+c[a];return o}return(f-m)*d+c}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-p)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-p)/.001*(u-y)}}return this.getValueAtTime(((h-s)%r+s)/this.comp.globalData.frameRate,0)}function h(t,e,i){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var r,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[0].t;if(p<=h)return this.pv;if(i?s=p+(r=e?Math.abs(elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>l.length-1)&&(e=l.length-1),r=(s=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/r)%2==0)return this.getValueAtTime(((p-h)%r+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(p/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((r-(p-h)%r+p)/this.comp.globalData.frameRate,0),d=Math.floor((p-h)/r)+1;if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(f[a]-m[a])*d;return o}return c-(f-m)*d}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(p-h)/.001;return o}return u+(u-y)*(p-h)/.001}}return this.getValueAtTime((r-(p-h)%r+p)/this.comp.globalData.frameRate,0)}function l(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var i,r,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(i=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(r=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)i[h]+=r[h];else i+=r;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)i[h]/=e;else i/=e;return i}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,i){var r=s(t,e,i);return r.dynamicProperties.length?r.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var i=this.a.getValueAtTime(t);e.translate(-i[0]*this.a.mult,-i[1]*this.a.mult,i[2]*this.a.mult)}if(this.appliedTransformations<2){var r=this.s.getValueAtTime(t);e.scale(r[0]*this.s.mult,r[1]*this.s.mult,r[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),l=this.rx.getValueAtTime(t),p=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(l*this.rx.mult).rotateZ(-p[2]*this.or.mult).rotateY(p[1]*this.or.mult).rotateX(p[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var m=this.px.getValueAtTime(t),f=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(m*this.px.mult,f*this.py.mult,-c*this.pz.mult)}else e.translate(m*this.px.mult,f*this.py.mult,0)}else{var d=this.p.getValueAtTime(t);e.translate(d[0]*this.p.mult,d[1]*this.p.mult,-d[2]*this.p.mult)}return e}.bind(r):r.getValueAtTime=function(t){return this.v.clone(new Matrix)}.bind(r),r.setGroupProperty=expressionHelpers.setGroupProperty,r};var p=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,i,r,s){var a=p(t,e,i,r,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=l,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==i&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function i(){}i.prototype={vertices:function(t,e){this.k&&this.getValue();var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var r,s=i._length,a=i[t],n=i.v,o=createSizedArray(s);for(r=0;r<s;r+=1)o[r]="i"===t||"o"===t?[a[r][0]-n[r][0],a[r][1]-n[r][1]]:[a[r][0],a[r][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(i));for(var r,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,l=0;o<h;){if(l+a[o].addedLength>n){var p=o,m=i.c&&o===h-1?0:o+1,f=(n-l)/a[o].addedLength;r=bez.getPointInSegment(i.v[p],i.v[m],i.o[p],i.i[m],f,a[o]);break}l+=a[o].addedLength,o+=1}return r||(r=i.c?[i.v[0][0],i.v[0][1]]:[i.v[i._length-1][0],i.v[i._length-1][1]]),r},vectorOnPath:function(t,e,i){t=1==t?this.v.c?0:.999:t;var r=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-r[0],n=s[1]-r[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===i?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([i],t),extendPrototype([i],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,i,r,s){var a=n(t,e,i,r,s);return a.propertyIndex=e.ix,a.lock=!1,3===i?expressionHelpers.searchExpressions(t,e.pt,a):4===i&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var i=this.calculateExpression(e);if(t.t===i)return t;var r={};return this.copyData(r,t),r.t=i.toString(),r.__complete=!1,r},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){if(this.data.d.x)return this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0};var ShapePathInterface=function(t,e,i){var r=e.sh;function s(t){if("Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t)return s.path}var a=propertyGroupFactory(s,i);return r.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return r.k&&r.getValue(),r}},shape:{get:function(){return r.k&&r.getValue(),r}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:i}}),s},propertyGroupFactory=function(e,i){return function(t){return(t=void 0===t?1:t)<=0?e:i(t-1)}},PropertyInterface=function(t,e){var i={_name:t};return function(t){return(t=void 0===t?1:t)<=0?i:e(--t)}},ShapeExpressionInterface=function(){function n(t,e,i){var r,s=[],a=t?t.length:0;for(r=0;r<a;r+=1)"gr"==t[r].ty?s.push(o(t[r],e[r],i)):"fl"==t[r].ty?s.push(h(t[r],e[r],i)):"st"==t[r].ty?s.push(l(t[r],e[r],i)):"tm"==t[r].ty?s.push(p(t[r],e[r],i)):"tr"==t[r].ty||("el"==t[r].ty?s.push(f(t[r],e[r],i)):"sr"==t[r].ty?s.push(c(t[r],e[r],i)):"sh"==t[r].ty?s.push(ShapePathInterface(t[r],e[r],i)):"rc"==t[r].ty?s.push(d(t[r],e[r],i)):"rd"==t[r].ty?s.push(u(t[r],e[r],i)):"rp"==t[r].ty&&s.push(y(t[r],e[r],i)));return s}function o(t,e,i){var r=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return r.content;default:return r.transform}};r.propertyGroup=propertyGroupFactory(r,i);var s=function(t,e,i){var r,s=function(t){for(var e=0,i=r.length;e<i;){if(r[e]._name===t||r[e].mn===t||r[e].propertyIndex===t||r[e].ix===t||r[e].ind===t)return r[e];e+=1}if("number"==typeof t)return r[t-1]};s.propertyGroup=propertyGroupFactory(s,i),r=n(t.it,e.it,s.propertyGroup),s.numProperties=r.length;var a=m(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,r.propertyGroup),a=m(t.it[t.it.length-1],e.it[e.it.length-1],r.propertyGroup);return r.content=s,r.transform=a,Object.defineProperty(r,"_name",{get:function(){return t.nm}}),r.numProperties=t.np,r.propertyIndex=t.ix,r.nm=t.nm,r.mn=t.mn,r}function h(t,e,i){function r(t){return"Color"===t||"color"===t?r.color:"Opacity"===t||"opacity"===t?r.opacity:void 0}return Object.defineProperties(r,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",i)),e.o.setGroupProperty(PropertyInterface("Opacity",i)),r}function l(t,e,i){var r=propertyGroupFactory(l,i),s=propertyGroupFactory(h,r);var a,n,o=t.d?t.d.length:0,h={};for(a=0;a<o;a+=1)n=a,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[a].p.setGroupProperty(s);function l(t){return"Color"===t||"color"===t?l.color:"Opacity"===t||"opacity"===t?l.opacity:"Stroke Width"===t||"stroke width"===t?l.strokeWidth:void 0}return Object.defineProperties(l,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),e.w.setGroupProperty(PropertyInterface("Stroke Width",r)),l}function p(e,t,i){function r(t){return t===e.e.ix||"End"===t||"end"===t?r.end:t===e.s.ix?r.start:t===e.o.ix?r.offset:void 0}var s=propertyGroupFactory(r,i);return r.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),r.propertyIndex=e.ix,r.propertyGroup=i,Object.defineProperties(r,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),r.mn=e.mn,r}function m(e,t,i){function r(t){return e.a.ix===t||"Anchor Point"===t?r.anchorPoint:e.o.ix===t||"Opacity"===t?r.opacity:e.p.ix===t||"Position"===t?r.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?r.rotation:e.s.ix===t||"Scale"===t?r.scale:e.sk&&e.sk.ix===t||"Skew"===t?r.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?r.skewAxis:void 0}var s=propertyGroupFactory(r,i);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(r,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),r.ty="tr",r.mn=e.mn,r.propertyGroup=i,r}function f(e,t,i){function r(t){return e.p.ix===t?r.position:e.s.ix===t?r.size:void 0}var s=propertyGroupFactory(r,i);r.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(r,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),r.mn=e.mn,r}function c(e,t,i){function r(t){return e.p.ix===t?r.position:e.r.ix===t?r.rotation:e.pt.ix===t?r.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?r.outerRadius:e.os.ix===t?r.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?r.innerRoundness:void 0:r.innerRadius}var s=propertyGroupFactory(r,i),a="tm"===t.sh.ty?t.sh.prop:t.sh;return r.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(r,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),r.mn=e.mn,r}function d(e,t,i){function r(t){return e.p.ix===t?r.position:e.r.ix===t?r.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?r.size:void 0}var s=propertyGroupFactory(r,i),a="tm"===t.sh.ty?t.sh.prop:t.sh;return r.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(r,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),r.mn=e.mn,r}function u(e,t,i){function r(t){if(e.r.ix===t||"Round Corners 1"===t)return r.radius}var s=propertyGroupFactory(r,i),a=t;return r.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(r,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),r.mn=e.mn,r}function y(e,t,i){function r(t){return e.c.ix===t||"Copies"===t?r.copies:e.o.ix===t||"Offset"===t?r.offset:void 0}var s=propertyGroupFactory(r,i),a=t;return r.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(r,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),r.mn=e.mn,r}return function(t,e,r){var s;function i(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?r:s[t-1];for(var e=0,i=s.length;e<i;){if(s[e]._name===t)return s[e];e+=1}}return i.propertyGroup=propertyGroupFactory(i,function(){return r}),s=n(t,e,i.propertyGroup),i.numProperties=s.length,i._name="Contents",i}}(),TextExpressionInterface=function(e){var i;function r(t){switch(t){case"ADBE Text Document":return r.sourceText}}return Object.defineProperty(r,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(i=new String(t)).value=t||new String(t)),i}}),r},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var i=this.getMatrix(e);return i.props[12]=i.props[13]=i.props[14]=0,this.applyPoint(i,t)}function n(t,e){var i=this.getMatrix(e);return this.applyPoint(i,t)}function o(t,e){var i=this.getMatrix(e);return i.props[12]=i.props[13]=i.props[14]=0,this.invertPoint(i,t)}function h(t,e){var i=this.getMatrix(e);return this.invertPoint(i,t)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var i,r=this._elem.hierarchy.length;for(i=0;i<r;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var i,r=this._elem.hierarchy.length;for(i=0;i<r;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function m(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var i,r=this._elem.hierarchy.length;for(i=0;i<r;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function f(){return[1,1,1,1]}return function(e){var i;function r(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return r.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return i;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return r.effect;case"ADBE Text Properties":return r.textInterface}}r.getMatrix=s,r.invertPoint=p,r.applyPoint=l,r.toWorld=n,r.toWorldVec=a,r.fromWorld=h,r.fromWorldVec=o,r.toComp=n,r.fromComp=m,r.sampleImage=f,r.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(i=TransformExpressionInterface((r._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(r,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(i,"rotation"),scale:getDescriptor(i,"scale"),position:getDescriptor(i,"position"),opacity:getDescriptor(i,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return i}},active:{get:function(){return e.isInRange}}}),r.startTime=e.data.st,r.index=e.data.ind,r.source=e.data.refId,r.height=0===e.data.ty?e.data.h:100,r.width=0===e.data.ty?e.data.w:100,r.inPoint=e.data.ip/e.comp.globalData.frameRate,r.outPoint=e.data.op/e.comp.globalData.frameRate,r._name=e.data.nm,r.registerMaskInterface=function(t){r.mask=new MaskManagerInterface(t,e)},r.registerEffectsInterface=function(t){r.effect=t},r}}(),CompExpressionInterface=function(r){function t(t){for(var e=0,i=r.layers.length;e<i;){if(r.layers[e].nm===t||r.layers[e].ind===t)return r.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:r.data.nm}),(t.layer=t).pixelAspect=1,t.height=r.data.h||r.globalData.compSize.h,t.width=r.data.w||r.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/r.globalData.frameRate,t.displayStartTime=0,t.numLayers=r.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity}}if(Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p)var i=ExpressionPropertyInterface(t.p);else{var r,s=ExpressionPropertyInterface(t.px),a=ExpressionPropertyInterface(t.py);t.pz&&(r=ExpressionPropertyInterface(t.pz))}return Object.defineProperty(e,"position",{get:function(){return t.p?i():[s(),a(),r?r():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,i=this.compositions.length;e<i;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function l(s,t,e,i){function r(t){for(var e=s.ef,i=0,r=e.length;i<r;){if(t===e[i].nm||t===e[i].mn||t===e[i].ix)return 5===e[i].ty?o[i]:o[i]();i+=1}throw new Error}var a,n=propertyGroupFactory(r,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(l(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,i)):o.push(p(t.effectElements[a],s.ef[a].ty,i,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(r,"color",{get:function(){return o[0]()}}),Object.defineProperties(r,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),r.active=r.enabled=0!==s.en,r}function p(t,e,i,r){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",r)),function(){return 10===e?i.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var i,r=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(i=0;i<a;i+=1)r.push(l(s[i],t.effectsManager.effectElements[i],e,t));var n=t.data.ef||[],o=function(t){for(i=0,a=n.length;i<a;){if(t===n[i].nm||t===n[i].mn||t===n[i].ix)return r[i];i+=1}};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}}}}(),MaskManagerInterface=function(){function a(t,e){this._mask=t,this._data=e}Object.defineProperty(a.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(a.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e,t){var i,r=createSizedArray(e.viewData.length),s=e.viewData.length;for(i=0;i<s;i+=1)r[i]=new a(e.viewData[i],e.masksProperties[i]);return function(t){for(i=0;i<s;){if(e.masksProperties[i].nm===t)return r[i];i+=1}}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(r,s,a){Object.defineProperty(r,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),r.numKeys=s.keyframes?s.keyframes.length:0,r.key=function(t){if(r.numKeys){var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var i="unidimensional"===a?new Number(e):Object.assign({},e);return i.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,i.value="unidimensional"===a?e[0]:e,i}return 0},r.valueAtTime=s.getValueAtTime,r.speedAtTime=s.getSpeedAtTime,r.velocityAtTime=s.getVelocityAtTime,r.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,i=t.pv*e,r=new Number(i);return r.value=i,o(r,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*e,r.value!==i&&((r=new Number(i)).value=i,o(r,t,"unidimensional")),r}}(t):function(e){e&&"pv"in e||(e=n);var i=1/e.mult,r=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",r),a=createTypedArray("float32",r);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<r;t+=1)s[t]=a[t]=e.v[t]*i;return s}}(t):e}}(),z7,A7;function SliderEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function AngleEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function ColorEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,1,0,i)}function PointEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,1,0,i)}function LayerIndexEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function MaskIndexEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function CheckboxEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var i=t.ef||[];this.effectElements=[];var r,s,a=i.length;for(r=0;r<a;r++)s=new GroupEffect(i[r],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}z7=function(){function i(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}return function(t,e){this.pv=1,this.comp=t.comp,this.elem=t,this.mult=.01,this.propType="textSelector",this.textTotal=e.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],this.k=!0,this.x=!0,this.getValue=ExpressionManager.initiateExpression.bind(this)(t,e,this),this.getMult=i,this.getVelocityAtTime=expressionHelpers.getVelocityAtTime,this.kf?this.getValueAtTime=expressionHelpers.getValueAtTime.bind(this):this.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(this),this.setGroupProperty=expressionHelpers.setGroupProperty}}(),A7=TextSelectorProp.getTextSelectorProp,TextSelectorProp.getTextSelectorProp=function(t,e,i){return 1===e.t?new z7(t,e,i):A7(t,e,i)},extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i,r,s=this.data.ef.length,a=this.data.ef;for(i=0;i<s;i+=1){switch(r=null,a[i].ty){case 0:r=new SliderEffect(a[i],e,this);break;case 1:r=new AngleEffect(a[i],e,this);break;case 2:r=new ColorEffect(a[i],e,this);break;case 3:r=new PointEffect(a[i],e,this);break;case 4:case 7:r=new CheckboxEffect(a[i],e,this);break;case 10:r=new LayerIndexEffect(a[i],e,this);break;case 11:r=new MaskIndexEffect(a[i],e,this);break;case 5:r=new EffectsManager(a[i],e,this);break;default:r=new NoValueEffect(a[i],e,this)}r&&this.effectElements.push(r)}};var lottie={},_isFrozen=!1;function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i<e.length;i++){var r=e[i].split("=");if(decodeURIComponent(r[0])==t)return decodeURIComponent(r[1])}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.7.5";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""},queryString=myScript.src.replace(/^[^\?]+\??/,"");renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
+	"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bmRnd,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bmRnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e}roundValues(!1);var createElementID=(F=0,function(){return"__lottie_element_"+(F+=1)}),F;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,l,p;switch(h=r*(1-e),l=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=r*(1-(1-o)*e),n%6){case 0:i=r,s=p,a=h;break;case 1:i=l,s=r,a=h;break;case 2:i=h,s=r,a=p;break;case 3:i=h,s=l,a=r;break;case 4:i=p,s=h,a=r;break;case 5:i=r,s=h,a=l}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i+=1)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray=function(){function r(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):r(t,e)}:r}();function createSizedArray(t){return Array.apply(null,{length:t})}function createNS(t){return document.createElementNS(svgNS,t)}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Oa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Oa[t]||""}),Oa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function m(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function f(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,l,p,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function u(t,e,r,i,s,a,n,o,h,l,p,m,f,c,d,u){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return y[12]=y[12]*t+y[15]*f,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*p+y[15]*d,y[15]*=u,this._identityCalculated=!1,this;var g=y[0],v=y[1],b=y[2],P=y[3],x=y[4],E=y[5],S=y[6],A=y[7],C=y[8],_=y[9],T=y[10],k=y[11],D=y[12],M=y[13],F=y[14],w=y[15];return y[0]=g*t+v*s+b*h+P*f,y[1]=g*e+v*a+b*l+P*c,y[2]=g*r+v*n+b*p+P*d,y[3]=g*i+v*o+b*m+P*u,y[4]=x*t+E*s+S*h+A*f,y[5]=x*e+E*a+S*l+A*c,y[6]=x*r+E*n+S*p+A*d,y[7]=x*i+E*o+S*m+A*u,y[8]=C*t+_*s+T*h+k*f,y[9]=C*e+_*a+T*l+k*c,y[10]=C*r+_*n+T*p+k*d,y[11]=C*i+_*o+T*m+k*u,y[12]=D*t+M*s+F*h+w*f,y[13]=D*e+M*a+F*l+w*c,y[14]=D*r+M*n+F*p+w*d,y[15]=D*i+M*o+F*m+w*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function P(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function x(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function E(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function S(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function A(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function C(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function _(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=C(t[e]);return i}function T(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+l,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+l,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+l}return i}function k(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function D(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function M(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function F(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function w(){var t=this.props;return"matrix("+F(t[0])+","+F(t[1])+","+F(t[4])+","+F(t[5])+","+F(t[12])+","+F(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=m,this.shear=l,this.scale=f,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=P,this.applyToX=x,this.applyToY=E,this.applyToZ=S,this.applyToPointArray=k,this.applyToTriplePoints=T,this.applyToPointStringified=D,this.toCSS=M,this.to2dCSS=w,this.clone=v,this.cloneFromProps=b,this.equals=g,this.inversePoints=_,this.inversePoint=C,this.getInverseMatrix=A,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var l,p=this,m=256,f=6,c="random",d=h.pow(m,f),u=h.pow(2,52),y=2*u,g=m-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<m;)a[i]=i++;for(i=0;i<m;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*m+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function P(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=P(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,x(o)]:null===t?function(){try{if(l)return x(l.randomBytes(m));var t=new Uint8Array(m);return(p.crypto||p.msCrypto).getRandomValues(t),x(t)}catch(t){var e=p.navigator,r=e&&e.plugins;return[+new Date,p,r,p.screen,x(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(f),e=d,r=0;t<u;)t=(t+r)*m,e*=m,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,P(x(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&b(i,a),t.state=function(){return b(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},P(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function m(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function f(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:m(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<l;++r)this._mSampleValues[r]=m(r*p,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=l-1;a!==n&&i[a]<=t;++a)s+=p;var o=s+(t-i[--a])/(i[a+1]-i[a])*p,h=f(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=f(e,r,i);if(0===a)return e;e-=(m(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=m(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+p,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)Object.prototype.hasOwnProperty.call(i,a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){var D=Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var p=function(t,e,r,i){var s,a,n,o,h,l,p=defaultCurveSegments,m=0,f=[],c=[],d=bezierLengthPool.newElement();for(n=r.length,s=0;s<p;s+=1){for(h=s/(p-1),a=l=0;a<n;a+=1)o=bmPow(1-h,3)*t[a]+3*bmPow(1-h,2)*h*r[a]+3*(1-h)*bmPow(h,2)*i[a]+bmPow(h,3)*e[a],f[a]=o,null!==c[a]&&(l+=bmPow(f[a]-c[a],2)),c[a]=f[a];l&&(m+=l=bmSqrt(l)),d.percents[s]=h,d.lengths[s]=m}return d.addedLength=m,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!b[s]){var a,n,o,h,l,p,m,f=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(f=2);var u=new g(f);for(o=r.length,a=0;a<f;a+=1){for(m=createSizedArray(o),l=a/(f-1),n=p=0;n<o;n+=1)h=bmPow(1-l,3)*t[n]+3*bmPow(1-l,2)*l*(t[n]+r[n])+3*(1-l)*bmPow(l,2)*(e[n]+i[n])+bmPow(l,3)*e[n],m[n]=h,null!==d&&(p+=bmPow(m[n]-d[n],2));c+=p=bmSqrt(p),u.points[a]=new v(p,m),d=m}u.segmentLength=c,b[s]=u}return b[s]});function M(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bmFloor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,l=!0;l;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),l=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];l=!1}return r[a]+(r[a+1]-r[a])*o}var F=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segmentsLengthPool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,l=0;for(e=0;e<o-1;e+=1)h[e]=p(s[e],s[e+1],a[e],n[e+1]),l+=h[e].addedLength;return i&&o&&(h[e]=p(s[e],s[0],a[e],n[0]),l+=h[e].addedLength),r.totalLength=l,r},getNewSegment:function(t,e,r,i,s,a,n){s<0?s=0:1<s&&(s=1);var o,h=M(s,n),l=M(a=1<a?1:a,n),p=t.length,m=1-h,f=1-l,c=m*m*m,d=h*m*m*3,u=h*h*m*3,y=h*h*h,g=m*m*f,v=h*m*f+m*h*f+m*m*l,b=h*h*f+m*h*l+h*m*l,P=h*h*l,x=m*f*f,E=h*f*f+m*l*f+m*f*l,S=h*l*f+m*l*l+h*f*l,A=h*l*l,C=f*f*f,_=l*f*f+f*l*f+f*f*l,T=l*l*f+f*l*l+l*f*l,k=l*l*l;for(o=0;o<p;o+=1)F[4*o]=D.round(1e3*(c*t[o]+d*r[o]+u*i[o]+y*e[o]))/1e3,F[4*o+1]=D.round(1e3*(g*t[o]+v*r[o]+b*i[o]+P*e[o]))/1e3,F[4*o+2]=D.round(1e3*(x*t[o]+E*r[o]+S*i[o]+A*e[o]))/1e3,F[4*o+3]=D.round(1e3*(C*t[o]+_*r[o]+T*i[o]+k*e[o]))/1e3;return F},getPointInSegment:function(t,e,r,i,s,a){var n=M(s,a),o=1-n;return[D.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,D.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var l,p=D.sqrt(D.pow(i-t,2)+D.pow(s-e,2)+D.pow(a-r,2)),m=D.sqrt(D.pow(n-t,2)+D.pow(o-e,2)+D.pow(h-r,2)),f=D.sqrt(D.pow(n-i,2)+D.pow(o-s,2)+D.pow(h-a,2));return-1e-4<(l=m<p?f<p?p-m-f:f-m-p:m<f?f-m-p:m-p-f)&&l<1e-4}}}!function(){for(var s=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),r=Math.max(0,16-(e-s)),i=setTimeout(function(){t(e+r)},r);return s=e+r,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function m(t,e,r){var i,s,a,n,o,h,l=t.length;for(s=0;s<l;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),i.hasMask){var p=i.masksProperties;for(n=p.length,a=0;a<n;a+=1)if(p[a].pt.k.i)d(p[a].pt.k);else for(h=p[a].pt.k.length,o=0;o<h;o+=1)p[a].pt.k[o].s&&d(p[a].pt.k[o].s[0]),p[a].pt.k[o].e&&d(p[a].pt.k[o].e[0])}0===i.ty?(i.layers=f(i.refId,e),m(i.layers,e,r)):4===i.ty?c(i.shapes):5===i.ty&&u(i)}}function f(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}return null}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)d(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&d(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&d(t[e].ks.k[r].e[0]);else"gr"===t[e].ty&&c(t[e].it)}function d(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&null))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(d(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function l(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);else"gr"===t[e].ty&&l(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=m,t}var dataManager=dataFunctionManager();function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],r="normal",i="normal",s=e.length,a=0;a<s;a+=1)switch(e[a].toLowerCase()){case"italic":i="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:i,weight:t.fWeight||r}}var FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function f(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=function(t){var e,r=t.split(","),i=r.length,s=[];for(e=0;e<i;e+=1)"sans-serif"!==r[e]&&"monospace"!==r[e]&&s.push(r[e]);return s.join(",")}(t)+", "+e,{node:i,w:s,parent:r}}function c(t,e){var r=createNS("text");r.style.fontSize="100px";var i=getFontProperties(e);return r.setAttribute("font-family",e.fFamily),r.setAttribute("font-style",i.style),r.setAttribute("font-weight",i.weight),r.textContent="1",e.fClass?(r.style.fontFamily="inherit",r.setAttribute("class",e.fClass)):r.style.fontFamily=e.fFamily,t.appendChild(r),createTag("canvas").getContext("2d").font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,r}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i=t.list,s=i.length,a=s;for(r=0;r<s;r+=1){var n,o,h=!0;if(i[r].loaded=!1,i[r].monoCase=f(i[r].fFamily,"monospace"),i[r].sansCase=f(i[r].fFamily,"sans-serif"),i[r].fPath){if("p"===i[r].fOrigin||3===i[r].origin){if(0<(n=document.querySelectorAll('style[f-forigin="p"][f-family="'+i[r].fFamily+'"], style[f-origin="3"][f-family="'+i[r].fFamily+'"]')).length&&(h=!1),h){var l=createTag("style");l.setAttribute("f-forigin",i[r].fOrigin),l.setAttribute("f-origin",i[r].origin),l.setAttribute("f-family",i[r].fFamily),l.type="text/css",l.innerText="@font-face {font-family: "+i[r].fFamily+"; font-style: normal; src: url('"+i[r].fPath+"');}",e.appendChild(l)}}else if("g"===i[r].fOrigin||1===i[r].origin){for(n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),o=0;o<n.length;o+=1)-1!==n[o].href.indexOf(i[r].fPath)&&(h=!1);if(h){var p=createTag("link");p.setAttribute("f-forigin",i[r].fOrigin),p.setAttribute("f-origin",i[r].origin),p.type="text/css",p.rel="stylesheet",p.href=i[r].fPath,document.body.appendChild(p)}}else if("t"===i[r].fOrigin||2===i[r].origin){for(n=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),o=0;o<n.length;o+=1)i[r].fPath===n[o].src&&(h=!1);if(h){var m=createTag("link");m.setAttribute("f-forigin",i[r].fOrigin),m.setAttribute("f-origin",i[r].origin),m.setAttribute("rel","stylesheet"),m.setAttribute("href",i[r].fPath),e.appendChild(m)}}}else i[r].loaded=!0,a-=1;i[r].helper=c(e,i[r]),i[r].cache={},this.fonts.push(i[r])}0===a?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,r)),a},getFontByName:function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},checkLoadedFonts:function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),PropertyFactory=function(){var m=initialDefaultFrame,s=Math.abs;function f(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,l,p,m,f=e.lastIndex,c=f,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>t){f=c;break}c<d-1?c+=1:(f=0,u=!1)}var y,g,v,b,P,x,E,S,A,C,_=a.t-i,T=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var k=s.bezierData;if(_<=t||t<T){var D=_<=t?k.points.length-1:0;for(o=k.points[D].point.length,n=0;n<o;n+=1)r[n]=k.points[D].point[n]}else{s.__fnct?m=s.__fnct:(m=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=m),h=m((t-T)/(_-T));var M,F=k.segmentLength*h,w=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,l=k.points.length;u;){if(w+=k.points[p].partialLength,0===F||0===h||p===k.points.length-1){for(o=k.points[p].point.length,n=0;n<o;n+=1)r[n]=k.points[p].point[n];break}if(w<=F&&F<w+k.points[p+1].partialLength){for(M=(F-w)/k.points[p+1].partialLength,o=k.points[p].point.length,n=0;n<o;n+=1)r[n]=k.points[p].point[n]+(k.points[p+1].point[n]-k.points[p].point[n])*M;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=w-k.points[p].partialLength,e._lastKeyframeIndex=c}}else{var I,V,B,R,L;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(_<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=T)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var G=N(s.s),z=N(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],l=t[0],p=t[1],m=t[2],f=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=l*c+p*d+m*u+f*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*l+o*c,h[1]=n*p+o*d,h[2]=n*m+o*u,h[3]=n*f+o*y,h}(G,z,(t-T)/(_-T)),b=v[0],P=v[1],x=v[2],E=v[3],S=Math.atan2(2*P*E-2*b*x,1-2*P*P-2*x*x),A=Math.asin(2*b*P+2*x*E),C=Math.atan2(2*b*E-2*P*x,1-2*b*b-2*x*x),g[0]=S/degToRads,g[1]=A/degToRads,g[2]=C/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=_<=t?1:t<T?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?m=s.__fnct[c]:(I=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],V=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],B=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],R=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],m=BezierFactory.getBezierEasing(I,V,B,R).get,s.__fnct[c]=m)):s.__fnct?m=s.__fnct:(I=s.o.x,V=s.o.y,B=s.i.x,R=s.i.y,m=BezierFactory.getBezierEasing(I,V,B,R).get,s.__fnct=m),m((t-T)/(_-T)))),y=a.s||s.e,L=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=L:r=L}return e.lastIndex=f,r}function N(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),l=Math.sin(i/2);return[o*h*n+s*a*l,o*a*n+s*h*l,s*h*n-o*a*l,s*a*n-o*h*l]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==m&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,r,i){var s;this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:m,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=m,this.pv=m,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.effectsSequence=[c.bind(this)],this.addEffect=y}function l(t,e,r,i){var s;this.propType="multidimensional";var a,n,o,h,l=e.k.length;for(s=0;s<l-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.frameId=-1;var p=e.k[0].s.length;for(this.v=createTypedArray("float32",p),this.pv=createTypedArray("float32",p),s=0;s<p;s+=1)this.v[s]=m,this.pv[s]=m;this._caching={lastFrame:m,lastIndex:0,value:createTypedArray("float32",p)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new l(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=null,e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var e;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var r,i;if(e=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(r=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(r=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(r[0]=s.getValueAtTime((s.keyframes[0].t+.01)/e,0),r[1]=a.getValueAtTime((a.keyframes[0].t+.01)/e,0),i[0]=s.getValueAtTime(s.keyframes[0].t/e,0),i[1]=a.getValueAtTime(a.keyframes[0].t/e,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(r[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/e,0),r[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/e,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/e,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/e,0)):(r=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/e,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/e,a.offsetTime))}else r=i=n;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[i]||a[i]&&!s)&&(a[i]=pointPool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,l,p,m,f=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,f=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(f=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<d.t-this.offsetTime)p=0;else{var b;d.__fnct?b=d.__fnct:(b=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=b),p=b((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}i=d.s[0]}for(h=e._length,l=i.i[0].length,r.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<l;o+=1)m=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*p,e.i[n][o]=m,m=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*p,e.o[n][o]=m,m=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*p,e.v[n][o]=m}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shapePool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(e=0;e<r;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,m=2*Math.PI*o/(2*s),f=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?l:p,i=n?m:f;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*i*r*d,y-v*i*r*d,u+g*i*r*d,y+v*i*r*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=.5*-Math.PI,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),l=i*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),m=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*s*o,l-m*a*s*o,h+p*a*s*o,l+m*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bmMin(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var m={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new p(t,e):6===r?i=new h(t,e):7===r&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return m}(),ShapeModifiers=(Yr={},Zr={},Yr.registerModifier=function(t,e){Zr[t]||(Zr[t]=e)},Yr.getModifier=function(t,e,r){return new Zr[t](e,r)},Yr),Yr,Zr;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){var s;this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;n<l;n+=1){var p,m;if(!((o=a[n]).e*s<i||o.s*s>i+r))p=o.s*s<=i?0:(o.s*s-i)/r,m=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([p,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segmentsLengthPool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i,s;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),e=1<this.s.v?1+a:this.s.v<0?0+a:this.s.v+a,(r=1<this.e.v?1+a:this.e.v<0?0+a:this.e.v+a)<e){var n=e;e=r,r=n}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var o,h,l,p,m,f=this.shapes.length,c=0;if(r===e)for(s=0;s<f;s+=1)this.shapes[s].localShapeCollection.releaseShapes(),this.shapes[s].shape._mdf=!0,this.shapes[s].shape.paths=this.shapes[s].localShapeCollection,this._mdf&&(this.shapes[s].pathsData.length=0);else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(s=0;s<f;s+=1)this.shapes[s].pathsData.length=0,this.shapes[s].shape._mdf=!0}else{var d,u,y=[];for(s=0;s<f;s+=1)if((d=this.shapes[s]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=d.shape.paths)._length,m=0,!d.shape._mdf&&d.pathsData.length)m=d.totalShapeLength;else{for(l=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)p=bez.getSegmentsLength(i.shapes[o]),l.push(p),m+=p.totalLength;d.totalShapeLength=m,d.pathsData=l}c+=m,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,b=r,P=0;for(s=f-1;0<=s;s-=1)if((d=this.shapes[s]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<f?(g=this.calculateShapeEdges(e,r,d.totalShapeLength,P,c),P+=d.totalShapeLength):g=[[v,b]],h=g.length,o=0;o<h;o+=1){v=g[o][0],b=g[o][1],y.length=0,b<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*b}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(b-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(b-1)}));var x=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var E=x.pop();this.addPaths(x,u),x=this.addShapes(d,y[1],E)}else this.addPaths(x,u),x=this.addShapes(d,y[1]);this.addPaths(x,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,l,p,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(p=r?(o=r._length,r._length):(r=shapePool.newElement(),o=0),u.push(r),i=0;i<c;i+=1){for(h=m[i].lengths,r.c=f[i].c,a=f[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,r.c=!1;else{if(d>e.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[s],f[i].v[s],r,o,y),y=!1):(l=bez.getNewSegment(f[i].v[s-1],f[i].v[s],f[i].o[s-1],f[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[i].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[0],f[i].v[0],r,o,y),y=!1):(l=bez.getNewSegment(f[i].v[s-1],f[i].v[0],f[i].o[s-1],f[i].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[p][0],r.v[p][1],"i",p),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;i<c-1&&(r=shapePool.newElement(),y=!0,u.push(r),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r,i=shapePool.newElement();i.c=t.c;var s,a,n,o,h,l,p,m,f,c,d,u,y=t._length,g=0;for(r=0;r<y;r+=1)s=t.v[r],n=t.o[r],a=t.i[r],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==r&&r!==y-1||t.c?(o=0===r?t.v[y-1]:t.v[r-1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=d=s[0]+(o[0]-s[0])*l,m=u=s[1]-(s[1]-o[1])*l,f=p-(p-s[0])*roundCorner,c=m-(m-s[1])*roundCorner,i.setTripleAt(p,m,f,c,d,u,g),g+=1,o=r===y-1?t.v[0]:t.v[r+1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=f=s[0]+(o[0]-s[0])*l,m=c=s[1]+(o[1]-s[1])*l,d=p-(p-s[0])*roundCorner,u=m-(m-s[1])*roundCorner,i.setTripleAt(p,m,f,c,d,u,g)):i.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):i.setTripleAt(t.v[r][0],t.v[r][1],t.o[r][0],t.o[r][1],t.i[r][0],t.i[r][1],g),g+=1;return i},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var r=e/100,i=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)i[0]+=t.v[a][0],i[1]+=t.v[a][1];i[0]/=s,i[1]/=s;var n,o,h,l,p,m,f=shapePool.newElement();for(f.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(i[0]-t.v[a][0])*r,o=t.v[a][1]+(i[1]-t.v[a][1])*r,h=t.o[a][0]+(i[0]-t.o[a][0])*-r,l=t.o[a][1]+(i[1]-t.o[a][1])*-r,p=t.i[a][0]+(i[0]-t.i[a][0])*-r,m=t.i[a][1]+(i[1]-t.i[a][1])*-r,f.setTripleAt(n,o,h,l,p,m,a);return f},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){for(this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);0<r;)r-=1,this._elements.unshift(e[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var l=this.o.v,p=l%1,m=0<l?Math.floor(l):Math.ceil(l),f=this.pMatrix.props,c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<l){for(;g<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),g+=p)}else if(l<0){for(;m<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),g-=p)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),u=0;u<y;u+=1)r[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)r[u]=this.matrix.props[u];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shapePool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,r){var i="";if(t.e)i=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),i=e+s}else i=r,i+=t.u?t.u:"",i+=t.p;return i}function e(){this._imageLoaded=t.bind(this),this.testImageLoaded=function(t){var e=0,r=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(r)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return e.prototype={loadAssets:function(t,e){var r;this.imagesLoadedCb=e;var i=t.length;for(r=0;r<i;r+=1)t[r].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[r])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,r=this.images.length;e<r;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function(t){var e=a(t,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.src=e;var i={img:r,assetData:t};return i},createImageData:function(t){var e=a(t,this.assetsPath,this.path),r=createNS("image");isSafari?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(r);var i={img:r,assetData:t};return i},imageLoaded:t,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},e}(),featureSupport=(fx={maskType:!0},(/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))&&(fx.maskType=!1),fx),fx,filtersFactory=(gx={},gx.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},gx.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},gx),gx,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}();function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,l,p,m,f,c,d,u,y,g,v,b,P,x=this._moreOptions.alignment.v,E=this._animatorsData,S=this._textData,A=this.mHelper,C=this._renderType,_=this.renderedLetters.length,T=t.l;if(this._hasMaskedPath){if(P=this._pathData.m,!this._pathData.n||this._pathData._mdf){var k,D=P.v;for(this._pathData.r&&(D=D.reverse()),n={tLength:0,segments:[]},a=D._length-1,s=g=0;s<a;s+=1)k=bez.buildBezierData(D.v[s],D.v[s+1],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[s+1][0]-D.v[s+1][0],D.i[s+1][1]-D.v[s+1][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength;s=a,P.v.c&&(k=bez.buildBezierData(D.v[s],D.v[0],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[0][0]-D.v[0][0],D.i[0][1]-D.v[0][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,m=1,p=!(l=f=0),u=n.segments,o<0&&P.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),m=(d=u[f=u.length-1].points).length-1;o<0;)o+=d[m].partialLength,(m-=1)<0&&(m=(d=u[f-=1].points).length-1);c=(d=u[f].points)[m-1],y=(h=d[m]).partialLength}a=T.length,i=r=0;var M,F,w,I,V,B=1.2*t.finalSize*.714,R=!0;w=E.length;var L,G,z,N,O,H,j,q,W,Y,X,K,$=-1,Z=o,J=f,U=m,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(T[s].n){for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(F=0;F<w;F+=1)(M=E[F].a).t.propType&&(nt&&2===t.j&&(it+=M.t.v*st),(V=E[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?rt+=M.t.v*V[0]*st:rt+=M.t.v*V*st);nt=!1}for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(A.reset(),N=1,T[s].n)r=0,i+=t.yOffset,i+=R?1:0,o=Z,R=!1,this._hasMaskedPath&&(m=U,c=(d=u[f=J].points)[m-1],y=(h=d[m]).partialLength,l=0),K=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==T[s].line){switch(t.j){case 1:o+=g-t.lineWidths[T[s].line];break;case 2:o+=(g-t.lineWidths[T[s].line])/2}Q=T[s].line}$!==T[s].ind&&(T[$]&&(o+=T[$].extra),o+=T[s].an/2,$=T[s].ind),o+=x[0]*T[s].an*.005;var ot=0;for(F=0;F<w;F+=1)(M=E[F].a).p.propType&&((V=E[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?ot+=M.p.v[0]*V[0]:ot+=M.p.v[0]*V),M.a.propType&&((V=E[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?ot+=M.a.v[0]*V[0]:ot+=M.a.v[0]*V);for(p=!0;p;)o+ot<=l+y||!d?(v=(o+ot-l)/h.partialLength,G=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,A.translate(-x[0]*T[s].an*.005,-x[1]*B*.01),p=!1):d&&(l+=h.partialLength,(m+=1)>=d.length&&(m=0,d=u[f+=1]?u[f].points:P.v.c?u[f=m=0].points:(l-=h.partialLength,null)),d&&(c=h,y=(h=d[m]).partialLength));L=T[s].an/2-T[s].add,A.translate(-L,0,0)}else L=T[s].an/2-T[s].add,A.translate(-L,0,0),A.translate(-x[0]*T[s].an*.005,-x[1]*B*.01,0);for(F=0;F<w;F+=1)(M=E[F].a).t.propType&&(V=E[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?V.length?o+=M.t.v*V[0]:o+=M.t.v*V:V.length?r+=M.t.v*V[0]:r+=M.t.v*V));for(t.strokeWidthAnim&&(H=t.sw||0),t.strokeColorAnim&&(O=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(j=[t.fc[0],t.fc[1],t.fc[2]]),F=0;F<w;F+=1)(M=E[F].a).a.propType&&((V=E[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?A.translate(-M.a.v[0]*V[0],-M.a.v[1]*V[1],M.a.v[2]*V[2]):A.translate(-M.a.v[0]*V,-M.a.v[1]*V,M.a.v[2]*V));for(F=0;F<w;F+=1)(M=E[F].a).s.propType&&((V=E[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?A.scale(1+(M.s.v[0]-1)*V[0],1+(M.s.v[1]-1)*V[1],1):A.scale(1+(M.s.v[0]-1)*V,1+(M.s.v[1]-1)*V,1));for(F=0;F<w;F+=1){if(M=E[F].a,V=E[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars),M.sk.propType&&(V.length?A.skewFromAxis(-M.sk.v*V[0],M.sa.v*V[1]):A.skewFromAxis(-M.sk.v*V,M.sa.v*V)),M.r.propType&&(V.length?A.rotateZ(-M.r.v*V[2]):A.rotateZ(-M.r.v*V)),M.ry.propType&&(V.length?A.rotateY(M.ry.v*V[1]):A.rotateY(M.ry.v*V)),M.rx.propType&&(V.length?A.rotateX(M.rx.v*V[0]):A.rotateX(M.rx.v*V)),M.o.propType&&(V.length?N+=(M.o.v*V[0]-N)*V[0]:N+=(M.o.v*V-N)*V),t.strokeWidthAnim&&M.sw.propType&&(V.length?H+=M.sw.v*V[0]:H+=M.sw.v*V),t.strokeColorAnim&&M.sc.propType)for(q=0;q<3;q+=1)V.length?O[q]+=(M.sc.v[q]-O[q])*V[0]:O[q]+=(M.sc.v[q]-O[q])*V;if(t.fillColorAnim&&t.fc){if(M.fc.propType)for(q=0;q<3;q+=1)V.length?j[q]+=(M.fc.v[q]-j[q])*V[0]:j[q]+=(M.fc.v[q]-j[q])*V;M.fh.propType&&(j=V.length?addHueToRGB(j,M.fh.v*V[0]):addHueToRGB(j,M.fh.v*V)),M.fs.propType&&(j=V.length?addSaturationToRGB(j,M.fs.v*V[0]):addSaturationToRGB(j,M.fs.v*V)),M.fb.propType&&(j=V.length?addBrightnessToRGB(j,M.fb.v*V[0]):addBrightnessToRGB(j,M.fb.v*V))}}for(F=0;F<w;F+=1)(M=E[F].a).p.propType&&(V=E[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars),this._hasMaskedPath?V.length?A.translate(0,M.p.v[1]*V[0],-M.p.v[2]*V[1]):A.translate(0,M.p.v[1]*V,-M.p.v[2]*V):V.length?A.translate(M.p.v[0]*V[0],M.p.v[1]*V[1],-M.p.v[2]*V[2]):A.translate(M.p.v[0]*V,M.p.v[1]*V,-M.p.v[2]*V));if(t.strokeWidthAnim&&(W=H<0?0:H),t.strokeColorAnim&&(Y="rgb("+Math.round(255*O[0])+","+Math.round(255*O[1])+","+Math.round(255*O[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),this._hasMaskedPath){if(A.translate(0,-t.ls),A.translate(0,x[1]*B*.01+i,0),S.p.p){b=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(b)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),A.rotate(-ht*Math.PI/180)}A.translate(G,z,0),o-=x[0]*T[s].an*.005,T[s+1]&&$!==T[s+1].ind&&(o+=T[s].an/2,o+=.001*t.tr*t.finalSize)}else{switch(A.translate(r,i,0),t.ps&&A.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:A.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line]),0,0);break;case 2:A.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line])/2,0,0)}A.translate(0,-t.ls),A.translate(L,0,0),A.translate(x[0]*T[s].an*.005,x[1]*B*.01,0),r+=T[s].l+.001*t.tr*t.finalSize}"html"===C?tt=A.toCSS():"svg"===C?tt=A.to2dCSS():et=[A.props[0],A.props[1],A.props[2],A.props[3],A.props[4],A.props[5],A.props[6],A.props[7],A.props[8],A.props[9],A.props[10],A.props[11],A.props[12],A.props[13],A.props[14],A.props[15]],K=N}this.lettersChangedFlag=_<=s?(I=new LetterProps(K,W,Y,X,tt,et),this.renderedLetters.push(I),_+=1,!0):(I=this.renderedLetters[s]).update(K,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&!(r===i-1||t[r+1].t>e);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),s+=1):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],m=0,f=l.m.g,c=0,d=0,u=0,y=[],g=0,v=0,b=h.getFontByName(t.f),P=0,x=getFontProperties(b);t.fWeight=x.weight,t.fStyle=x.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var E,S=t.tr/1e3*t.finalSize;if(t.sz)for(var A,C,_=!0,T=t.sz[0],k=t.sz[1];_;){g=A=0,r=(C=this.buildFinalText(t.t)).length,S=t.tr/1e3*t.finalSize;var D=-1;for(e=0;e<r;e+=1)E=C[e].charCodeAt(0),i=!1," "===C[e]?D=e:13!==E&&3!==E||(i=!(g=0),A+=t.finalLineHeight||1.2*t.finalSize),T<g+(P=h.chars?(o=h.getCharData(C[e],b.fStyle,b.fFamily),i?0:o.w*t.finalSize/100):h.measureText(C[e],t.f,t.finalSize))&&" "!==C[e]?(-1===D?r+=1:e=D,A+=t.finalLineHeight||1.2*t.finalSize,C.splice(e,D===e?1:0,"\r"),D=-1,g=0):(g+=P,g+=S);A+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&k<A?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=C,r=t.finalText.length,_=!1)}g=-S;var M,F=P=0;for(e=0;e<r;e+=1)if(i=!1,13===(E=(M=t.finalText[e]).charCodeAt(0))||3===E?(F=0,y.push(g),v=v<g?g:v,g=-2*S,i=!(s=""),u+=1):s=M,P=h.chars?(o=h.getCharData(M,b.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===M?F+=P+S:(g+=P+S+F,F=0),p.push({l:P,an:P,add:c,n:i,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==f){if(c+=P,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=P);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=P,d+=1;m+=1,c=0}}else if(3==f){if(c+=P,""===s||e===r-1){for(""===s&&(c-=P);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=P,d+=1;c=0,m+=1}}else p[m].ind=m,p[m].extra=0,m+=1;if(t.l=p,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var w,I,V,B,R=l.a;n=R.length;var L=[];for(a=0;a<n;a+=1){for((w=R[a]).a.sc&&(t.strokeColorAnim=!0),w.a.sw&&(t.strokeWidthAnim=!0),(w.a.fc||w.a.fh||w.a.fs||w.a.fb)&&(t.fillColorAnim=!0),B=0,V=w.s.b,e=0;e<r;e+=1)(I=p[e]).anIndexes[a]=B,(1==V&&""!==I.val||2==V&&""!==I.val&&" "!==I.val||3==V&&(I.n||" "==I.val||e==r-1)||4==V&&(I.n||e==r-1))&&(1===w.s.rn&&L.push(B),B+=1);l.a[a].s.totalChars=B;var G,z=-1;if(1===w.s.rn)for(e=0;e<r;e+=1)z!=(I=p[e]).anIndexes[a]&&(z=I.anIndexes[a],G=L.splice(Math.floor(Math.random()*L.length),1)[0]),I.anIndexes[a]=G}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,l=this.data.sh;if(2===l)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===l)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===l)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===l){if(h===o)n=0;else{var p=h-o,m=-p/2+(t=d(c(0,t+.5-o),h-o)),f=p/2;n=Math.sqrt(1-m*m/(f*f))}n=a(n)}else n=6===l?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),poolFactory=function(t,e,r){var i=0,s=t,a=createSizedArray(s);return{newElement:function(){return i?a[i-=1]:e()},release:function(t){i===s&&(a=pooling.double(a),s*=2),r&&r(t),a[i]=t,i+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},pointPool=poolFactory(8,function(){return createTypedArray("float32",2)}),shapePool=(mB=poolFactory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)pointPool.release(t.v[e]),pointPool.release(t.i[e]),pointPool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),mB.clone=function(t){var e,r=mB.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},mB),mB,shapeCollectionPool=(uB={newShapeCollection:function(){var t;t=vB?xB[vB-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shapePool.release(t.shapes[e]);t._length=0,vB===wB&&(xB=pooling.double(xB),wB*=2);xB[vB]=t,vB+=1}},vB=0,wB=4,xB=createSizedArray(wB),uB),uB,vB,wB,xB,segmentsLengthPool=poolFactory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezierLengthPool.release(t.lengths[e]);t.lengths.length=0}),bezierLengthPool=poolFactory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function HybridRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&!1===e.hideOnTransparent),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s,a=this.globalData.defs,n=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(n),this.solidPath="";var o,h,l,p,m,f,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<n;i+=1)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!==c[i].mode&&"i"!==c[i].mode||0!==d?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),s=createNS("path"),"n"===c[i].mode)this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:s,lastPath:""},a.appendChild(s);else{var b;if(d+=1,s.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),s.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",f=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),b=createElementID(),(p=createNS("filter")).setAttribute("id",b),(m=createNS("feMorphology")).setAttribute("operator","erode"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),p.appendChild(m),a.appendChild(p),s.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):f=m=null,this.storedData[i]={elem:s,x:f,expan:m,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===c[i].mode){h=u.length;var P=createNS("g");for(o=0;o<h;o+=1)P.appendChild(u[o]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",y+"_"+d),x.appendChild(s),a.appendChild(x),P.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(P)}else u.push(s);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:s,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}for(this.maskElement=createNS(g),n=u.length,i=0;i<n;i+=1)this.maskElement.appendChild(u[i]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function SVGTransformData(t,e,r){this.transform={mProps:t,op:e,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function SVGStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r}function SVGGradientFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,r)}function SVGGradientStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e-=1)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id===t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextLottieElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],CanvasRenderer),CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRenderer.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var r=this.contextData.cTr.props;this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},CanvasRenderer.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},CanvasRenderer.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e,r=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var i=this.contextData.saved[this.contextData.cArrPos];for(e=0;e<16;e+=1)i[e]=r[e];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},CanvasRenderer.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,r=this.contextData.saved[this.contextData.cArrPos],i=this.contextData.cTr.props;for(e=0;e<16;e+=1)i[e]=r[e];this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),r=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=r,this.globalData.currentGlobalAlpha!==r&&(this.canvasContext.globalAlpha=r,this.globalData.currentGlobalAlpha=r)}else this.canvasContext.restore()},CanvasRenderer.prototype.configAnimation=function(t){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var e=this.animationItem.container.style;e.width="100%",e.height="100%";var r="0px 0px 0px";e.transformOrigin=r,e.mozTransformOrigin=r,e.webkitTransformOrigin=r,e["-webkit-transform"]=r,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){var t,e,r,i;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var s=this.renderConfig.preserveAspectRatio.split(" "),a=s[1]||"meet",n=s[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);r=t/e,i=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=r<i&&"meet"===a||i<r&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;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],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRenderer.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){var r;this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i=this.layers.length;for(this.completeLayers||this.checkLayers(t),r=0;r<i;r+=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(t-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var r=this.createItem(this.layers[t],this,this.globalData);(e[t]=r).initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([BaseRenderer],HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},HybridRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){var i=this.layers[e];if(i.ddd&&this.supports3d)this.addTo3dContainer(r,e);else if(this.threeDElements)this.addTo3dContainer(r,e);else{for(var s,a,n=0;n<e;)this.elements[n]&&!0!==this.elements[n]&&this.elements[n].getBaseElement&&(a=this.elements[n],s=(this.layers[n].ddd?this.getThreeDContainerByPos(n):a.getBaseElement())||s),n+=1;s?i.ddd&&this.supports3d||this.layerElement.insertBefore(r,s):i.ddd&&this.supports3d||this.layerElement.appendChild(r)}}},HybridRenderer.prototype.createShape=function(t){return this.supports3d?new HShapeElement(t,this.globalData,this):new SVGShapeElement(t,this.globalData,this)},HybridRenderer.prototype.createText=function(t){return this.supports3d?new HTextElement(t,this.globalData,this):new SVGTextLottieElement(t,this.globalData,this)},HybridRenderer.prototype.createCamera=function(t){return this.camera=new HCameraElement(t,this.globalData,this),this.camera},HybridRenderer.prototype.createImage=function(t){return this.supports3d?new HImageElement(t,this.globalData,this):new IImageElement(t,this.globalData,this)},HybridRenderer.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.globalData,this):new SVGCompElement(t,this.globalData,this)},HybridRenderer.prototype.createSolid=function(t){return this.supports3d?new HSolidElement(t,this.globalData,this):new ISolidElement(t,this.globalData,this)},HybridRenderer.prototype.createNull=SVGRenderer.prototype.createNull,HybridRenderer.prototype.getThreeDContainerByPos=function(t){for(var e=0,r=this.threeDElements.length;e<r;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRenderer.prototype.createThreeDContainer=function(t,e){var r,i,s=createTag("div");styleDiv(s);var a=createTag("div");if(styleDiv(a),"3d"===e){(r=s.style).width=this.globalData.compSize.w+"px",r.height=this.globalData.compSize.h+"px";var n="50% 50%";r.webkitTransformOrigin=n,r.mozTransformOrigin=n,r.transformOrigin=n;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(i=a.style).transform=o,i.webkitTransform=o}s.appendChild(a);var h={container:a,perspectiveElem:s,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRenderer.prototype.build3dContainers=function(){var t,e,r=this.layers.length,i="";for(t=0;t<r;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?"3d"!==i&&(i="3d",e=this.createThreeDContainer(t,"3d")):"2d"!==i&&(i="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t);for(t=(r=this.threeDElements.length)-1;0<=t;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRenderer.prototype.addTo3dContainer=function(t,e){for(var r=0,i=this.threeDElements.length;r<i;){if(e<=this.threeDElements[r].endPos){for(var s,a=this.threeDElements[r].startPos;a<e;)this.elements[a]&&this.elements[a].getBaseElement&&(s=this.elements[a].getBaseElement()),a+=1;s?this.threeDElements[r].container.insertBefore(t,s):this.threeDElements[r].container.appendChild(t);break}r+=1}},HybridRenderer.prototype.configAnimation=function(t){var e=createTag("div"),r=this.animationItem.wrapper,i=e.style;i.width=t.w+"px",i.height=t.h+"px",styleDiv(this.resizerElem=e),i.transformStyle="flat",i.mozTransformStyle="flat",i.webkitTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),r.appendChild(e),i.overflow="hidden";var s=createNS("svg");s.setAttribute("width","1"),s.setAttribute("height","1"),styleDiv(s),this.resizerElem.appendChild(s);var a=createNS("defs");s.appendChild(a),this.data=t,this.setupGlobalData(t,s),this.globalData.defs=a,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRenderer.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRenderer.prototype.updateContainerSize=function(){var t,e,r,i,s=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight;i=s/a<this.globalData.compSize.w/this.globalData.compSize.h?(t=s/this.globalData.compSize.w,e=s/this.globalData.compSize.w,r=0,(a-this.globalData.compSize.h*(s/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,r=(s-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,0);var n=this.resizerElem.style;n.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+r+","+i+",0,1)",n.transform=n.webkitTransform},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,r=this.globalData.compSize.h,i=this.threeDElements.length;for(t=0;t<i;t+=1){var s=this.threeDElements[t].perspectiveElem.style;s.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(r,2))+"px",s.perspective=s.webkitPerspective}}},HybridRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length,i=createTag("div");for(e=0;e<r;e+=1)if(t[e].xt){var s=this.createComp(t[e],i,this.globalData.comp,null);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r,i=!0,s=this.comp;i;)s.finalTransform?(s.data.hasMask&&e.splice(0,0,s.finalTransform),s=s.comp):i=!1;var a,n=e.length;for(r=0;r<n;r+=1)a=e[r].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,r){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,e),this.setGradientOpacity(e,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var r=createElementID(),i=createNS(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",r),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var s,a,n,o=[];for(n=4*e.g.p,a=0;a<n;a+=4)s=createNS("stop"),i.appendChild(s),o.push(s);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+locationHref+"#"+r+")"),this.gf=i,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var r,i,s,a=createNS("mask"),n=createNS("path");a.appendChild(n);var o=createElementID(),h=createElementID();a.setAttribute("id",h);var l=createNS(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",o),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),s=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(i=4*t.g.p;i<s;i+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(r),p.push(r);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+locationHref+"#"+o+")"),this.of=l,this.ms=a,this.ost=p,this.maskId=h,e.msElem=n}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var SVGElementsRenderer=function(){var y=new Matrix,g=new Matrix;function e(t,e,r){(r||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(r||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function r(t,e,r){var i,s,a,n,o,h,l,p,m,f,c,d=e.styles.length,u=e.lvl;for(h=0;h<d;h+=1){if(n=e.sh._mdf||r,e.styles[h].lvl<u){for(p=g.reset(),f=u-e.styles[h].lvl,c=e.transformers.length-1;!n&&0<f;)n=e.transformers[c].mProps._mdf||n,f-=1,c-=1;if(n)for(f=u-e.styles[h].lvl,c=e.transformers.length-1;0<f;)m=e.transformers[c].mProps.v.props,p.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),f-=1,c-=1}else p=y;if(s=(l=e.sh.paths)._length,n){for(a="",i=0;i<s;i+=1)(o=l.shapes[i])&&o._length&&(a+=buildShapeString(o,o._length,o.c,p));e.caches[h]=a}else a=e.caches[h];e.styles[h].d+=!0===t.hd?"":a,e.styles[h]._mdf=n||e.styles[h]._mdf}}function i(t,e,r){var i=e.style;(e.c._mdf||r)&&i.pElem.setAttribute("fill","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function s(t,e,r){a(t,e,r),n(t,e,r)}function a(t,e,r){var i,s,a,n,o,h=e.gf,l=e.g._hasOpacity,p=e.s.v,m=e.e.v;if(e.o._mdf||r){var f="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(f,e.o.v)}if(e.s._mdf||r){var c=1===t.t?"x1":"cx",d="x1"===c?"y1":"cy";h.setAttribute(c,p[0]),h.setAttribute(d,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(c,p[0]),e.of.setAttribute(d,p[1]))}if(e.g._cmdf||r){i=e.cst;var u=e.g.c;for(a=i.length,s=0;s<a;s+=1)(n=i[s]).setAttribute("offset",u[4*s]+"%"),n.setAttribute("stop-color","rgb("+u[4*s+1]+","+u[4*s+2]+","+u[4*s+3]+")")}if(l&&(e.g._omdf||r)){var y=e.g.o;for(a=(i=e.g._collapsable?e.cst:e.ost).length,s=0;s<a;s+=1)n=i[s],e.g._collapsable||n.setAttribute("offset",y[2*s]+"%"),n.setAttribute("stop-opacity",y[2*s+1])}if(1===t.t)(e.e._mdf||r)&&(h.setAttribute("x2",m[0]),h.setAttribute("y2",m[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",m[0]),e.of.setAttribute("y2",m[1])));else if((e.s._mdf||e.e._mdf||r)&&(o=Math.sqrt(Math.pow(p[0]-m[0],2)+Math.pow(p[1]-m[1],2)),h.setAttribute("r",o),l&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.e._mdf||e.h._mdf||e.a._mdf||r){o||(o=Math.sqrt(Math.pow(p[0]-m[0],2)+Math.pow(p[1]-m[1],2)));var g=Math.atan2(m[1]-p[1],m[0]-p[0]),v=e.h.v;1<=v?v=.99:v<=-1&&(v=-.99);var b=o*v,P=Math.cos(g+e.a.v)*b+p[0],x=Math.sin(g+e.a.v)*b+p[1];h.setAttribute("fx",P),h.setAttribute("fy",x),l&&!e.g._collapsable&&(e.of.setAttribute("fx",P),e.of.setAttribute("fy",x))}}function n(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||r)&&s.dashStr&&(i.pElem.setAttribute("stroke-dasharray",s.dashStr),i.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||r)&&i.pElem.setAttribute("stroke","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||r)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return i;case"gf":return a;case"gs":return s;case"st":return n;case"sh":case"el":case"rc":case"sr":return r;case"tr":return e;default:return null}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(t,e,r,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var s,a=4;"rc"===e.ty?a=5:"el"===e.ty?a=6:"sr"===e.ty&&(a=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,a,t);var n,o=r.length;for(s=0;s<o;s+=1)r[s].closed||(n={transforms:i.addTransformSequence(r[s].transforms),trNodes:[]},this.styledShapes.push(n),r[s].elements.push(n))}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function AudioElement(t,e,r){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,r),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGCompElement(t,e,r){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGTextLottieElement(t,e,r){this.textSpans=[],this.renderType="svg",this.initElement(t,e,r)}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function SVGTintFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");if(r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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.setAttribute("result","f1"),t.appendChild(r),(r=createNS("feColorMatrix")).setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result","f2"),t.appendChild(r),this.matrixFilter=r,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var i,s=createNS("feMerge");t.appendChild(s),(i=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),s.appendChild(i),(i=createNS("feMergeNode")).setAttribute("in","f2"),s.appendChild(i)}}function SVGFillFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(r),this.matrixFilter=r}function SVGGaussianBlurEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var r=createNS("feGaussianBlur");t.appendChild(r),this.feGaussianBlur=r}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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.setAttribute("result","f1"),t.appendChild(r);var i=createNS("feComponentTransfer");i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.matrixFilter=i;var s=createNS("feFuncR");s.setAttribute("type","table"),i.appendChild(s),this.feFuncR=s;var a=createNS("feFuncG");a.setAttribute("type","table"),i.appendChild(a),this.feFuncG=a;var n=createNS("feFuncB");n.setAttribute("type","table"),i.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var r=this.filterManager.effectElements,i=createNS("feComponentTransfer");(r[10].p.k||0!==r[10].p.v||r[11].p.k||1!==r[11].p.v||r[12].p.k||1!==r[12].p.v||r[13].p.k||0!==r[13].p.v||r[14].p.k||1!==r[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",i)),(r[17].p.k||0!==r[17].p.v||r[18].p.k||1!==r[18].p.v||r[19].p.k||1!==r[19].p.v||r[20].p.k||0!==r[20].p.v||r[21].p.k||1!==r[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",i)),(r[24].p.k||0!==r[24].p.v||r[25].p.k||1!==r[25].p.v||r[26].p.k||1!==r[26].p.v||r[27].p.k||0!==r[27].p.v||r[28].p.k||1!==r[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",i)),(r[31].p.k||0!==r[31].p.v||r[32].p.k||1!==r[32].p.v||r[33].p.k||1!==r[33].p.v||r[34].p.k||0!==r[34].p.v||r[35].p.k||1!==r[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",i)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),i=createNS("feComponentTransfer")),(r[3].p.k||0!==r[3].p.v||r[4].p.k||1!==r[4].p.v||r[5].p.k||1!==r[5].p.v||r[6].p.k||0!==r[6].p.v||r[7].p.k||1!==r[7].p.v)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.feFuncRComposed=this.createFeFunc("feFuncR",i),this.feFuncGComposed=this.createFeFunc("feFuncG",i),this.feFuncBComposed=this.createFeFunc("feFuncB",i))}function SVGDropShadowEffect(t,e){var r=e.container.globalData.renderConfig.filterSize;t.setAttribute("x",r.x),t.setAttribute("y",r.y),t.setAttribute("width",r.width),t.setAttribute("height",r.height),this.filterManager=e;var i=createNS("feGaussianBlur");i.setAttribute("in","SourceAlpha"),i.setAttribute("result","drop_shadow_1"),i.setAttribute("stdDeviation","0"),this.feGaussianBlur=i,t.appendChild(i);var s=createNS("feOffset");s.setAttribute("dx","25"),s.setAttribute("dy","0"),s.setAttribute("in","drop_shadow_1"),s.setAttribute("result","drop_shadow_2"),this.feOffset=s,t.appendChild(s);var a=createNS("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var n=createNS("feComposite");n.setAttribute("in","drop_shadow_3"),n.setAttribute("in2","drop_shadow_2"),n.setAttribute("operator","in"),n.setAttribute("result","drop_shadow_4"),t.appendChild(n);var o,h=createNS("feMerge");t.appendChild(h),o=createNS("feMergeNode"),h.appendChild(o),(o=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=h,this.originalNodeAdded=!1,h.appendChild(o)}ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}},CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(l),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),m=createNS("path");m.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var f=createElementID();if(p.setAttribute("id",f),p.appendChild(m),this.globalData.defs.appendChild(p),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+f+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+f+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(t){for(var e=0,r=t.length,i=[],s="";e<r;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(s),s=""):s+=t[e],e+=1;return i.push(s),i},SVGTextLottieElement.prototype.buildNewText=function(){var t,e,r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var i=this.globalData.fontManager.getFontByName(r.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var s=r.fWeight,a=r.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",s)}this.layerElement.setAttribute("aria-label",r.t);var n,o=r.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var l,p=this.mHelper,m="",f=this.data.singleShape,c=0,d=0,u=!0,y=.001*r.tr*r.finalSize;if(!f||h||r.sz){var g,v,b=this.textSpans.length;for(t=0;t<e;t+=1)h&&f&&0!==t||(n=t<b?this.textSpans[t]:createNS(h?"path":"text"),b<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(r.finalSize/100,r.finalSize/100),f&&(o[t].n&&(c=-y,d+=r.yOffset,d+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(r,p,o[t].line,c,d),c+=o[t].l||0,c+=y),h?(l=(g=(v=this.globalData.fontManager.getCharData(r.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily))&&v.data||{}).shapes?g.shapes[0].it:[],f?m+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(f&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));f&&n&&n.setAttribute("d",m)}else{var P=this.textContainer,x="start";switch(r.j){case 1:x="end";break;case 2:x="middle";break;default:x="start"}P.setAttribute("text-anchor",x),P.setAttribute("letter-spacing",y);var E=this.buildTextContents(r.finalText);for(e=E.length,d=r.ps?r.ps[1]+r.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||createNS("tspan")).textContent=E[t],n.setAttribute("x",0),n.setAttribute("y",d),n.style.display="inherit",P.appendChild(n),this.textSpans[t]=n,d+=r.finalLineHeight;this.layerElement.appendChild(P)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var t=this.layerElement.getBBox();this.bbox={top:t.y,left:t.x,width:t.width,height:t.height}}return this.bbox},SVGTextLottieElement.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var r,i,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(r=s[t],i=this.textSpans[t],r._mdf.m&&i.setAttribute("transform",r.m),r._mdf.o&&i.setAttribute("opacity",r.o),r._mdf.sw&&i.setAttribute("stroke-width",r.sw),r._mdf.sc&&i.setAttribute("stroke",r.sc),r._mdf.fc&&i.setAttribute("fill",r.fc))}},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,l,p,m,f,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((f=this.searchProcessedElement(t[o]))?e[o]=r[f-1]:t[o]._render=n,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"===t[o].ty){if(f)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"===t[o].ty?(f||(e[o]=this.createTransformElement(t[o],i)),p=e[o].transform,c.push(p)):"sh"===t[o].ty||"rc"===t[o].ty||"el"===t[o].ty||"sr"===t[o].ty?(f||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"===t[o].ty||"rd"===t[o].ty||"ms"===t[o].ty||"pb"===t[o].ty?(f?(m=e[o]).closed=!1:((m=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=m,this.shapeModifiers.push(m)),y.push(m)):"rp"===t[o].ty&&(f?(m=e[o]).closed=!0:(m=ShapeModifiers.getModifier(t[o].ty),(e[o]=m).init(this,t,o,e),this.shapeModifiers.push(m),n=!1),y.push(m));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",r[0]-e[0]+" 0 0 0 "+e[0]+" "+(r[1]-e[1])+" 0 0 0 "+e[1]+" "+(r[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGGaussianBlurEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=3==r?0:e,s=2==r?0:e;this.feGaussianBlur.setAttribute("stdDeviation",i+" "+s);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},SVGStrokeEffect.prototype.initialize=function(){var t,e,r,i,s=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(i=this.elem.maskManager.masksProperties.length,r=0):i=(r=this.filterManager.effectElements[0].p.v-1)+1,(e=createNS("g")).setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1);r<i;r+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:r});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),n=createElementID();a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+locationHref+"#"+n+")");s[0];)o.appendChild(s[0]);this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(s=this.elem.layerElement.children||this.elem.layerElement.childNodes;s.length;)this.elem.layerElement.removeChild(s[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){var e;this.initialized||this.initialize();var r,i,s=this.paths.length;for(e=0;e<s;e+=1)if(-1!==this.paths[e].m&&(r=this.elem.maskManager.viewData[this.paths[e].m],i=this.paths[e].p,(t||this.filterManager._mdf||r.prop._mdf)&&i.setAttribute("d",r.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),o=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),h=i.getTotalLength();a="0 0 0 "+h*n+" ";var l,p=h*(o-n),m=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,f=Math.floor(p/m);for(l=0;l<f;l+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;i.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*c[0])+","+bmFloor(255*c[1])+","+bmFloor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v,s=i[0]+" "+r[0]+" "+e[0],a=i[1]+" "+r[1]+" "+e[1],n=i[2]+" "+r[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",s),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var r=createNS(t);return r.setAttribute("type","table"),e.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(t,e,r,i,s){for(var a,n,o=0,h=Math.min(t,e),l=Math.max(t,e),p=Array.call(null,{length:256}),m=0,f=s-i,c=e-t;o<=256;)n=(a=o/256)<=h?c<0?s:i:l<=a?c<0?i:s:i+f*Math.pow((a-t)/c,1/r),p[m]=n,m+=1,o+=256/255;return p.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(t||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(e=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(e=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(e=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(e=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(e=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=r*Math.cos(i),a=r*Math.sin(i);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,r){this.initialized=!1,this.filterManager=e,this.filterElem=t,(this.elem=r).matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGEffects(t){var e,r,i=t.data.ef?t.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s),n=0;for(this.filters=[],e=0;e<i;e+=1)r=null,20===t.data.ef[e].ty?(n+=1,r=new SVGTintFilter(a,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(n+=1,r=new SVGFillFilter(a,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?r=new SVGStrokeEffect(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(n+=1,r=new SVGTritoneFilter(a,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(n+=1,r=new SVGProLevelsFilter(a,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(n+=1,r=new SVGDropShadowEffect(a,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty?r=new SVGMatte3Effect(a,t.effectsManager.effectElements[e],t):29===t.data.ef[e].ty&&(n+=1,r=new SVGGaussianBlurEffect(a,t.effectsManager.effectElements[e])),r&&this.filters.push(r);n&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+locationHref+"#"+s+")")),this.filters.length&&t.addRenderableComponent(this)}function CVContextData(){var t;this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;for(this.savedOp=createTypedArray("float32",15),t=0;t<15;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=15}function CVBaseElement(){}function CVImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.img=e.imageLoader.getImage(this.assetData),this.initElement(t,e,r)}function CVCompElement(t,e,r){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CVMaskElement(t,e){var r;this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var i=this.masksProperties.length,s=!1;for(r=0;r<i;r+=1)"n"!==this.masksProperties[r].mode&&(s=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);(this.hasMasks=s)&&this.element.addRenderableComponent(this)}function CVShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(t,e,r)}function CVSolidElement(t,e,r){this.initElement(t,e,r)}function CVTextElement(t,e,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,r)}function CVEffects(){}function HBaseElement(){}function HSolidElement(t,e,r){this.initElement(t,e,r)}function HCompElement(t,e,r){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function HShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(t,e,r){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,r)}function HImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r)}function HCameraElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initHierarchy();var i=PropertyFactory.getProp;if(this.pe=i(this,t.pe,0,0,this),t.ks.p.s?(this.px=i(this,t.ks.p.x,1,0,this),this.py=i(this,t.ks.p.y,1,0,this),this.pz=i(this,t.ks.p.z,1,0,this)):this.p=i(this,t.ks.p,1,0,this),t.ks.a&&(this.a=i(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var s,a=t.ks.or.k.length;for(s=0;s<a;s+=1)t.ks.or.k[s].to=null,t.ks.or.k[s].ti=null}this.or=i(this,t.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=i(this,t.ks.rx,0,degToRads,this),this.ry=i(this,t.ks.ry,0,degToRads,this),this.rz=i(this,t.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HEffects(){}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,r=_svgMatteSymbols.length;e<r;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var r=t.layerElement.parentNode;if(r){for(var i,s=r.children,a=0,n=s.length;a<n&&s[a]!==t.layerElement;)a+=1;a<=n-2&&(i=s[a+1]);var o=createNS("use");o.setAttribute("href","#"+e),i?r.insertBefore(o,i):r.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var r=createElementID(),i=createNS("mask");i.setAttribute("id",e.layerId),i.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var s=t.globalData.defs;s.appendChild(i);var a=createNS("symbol");a.setAttribute("id",r),this.replaceInParent(e,r),a.appendChild(e.layerElement),s.appendChild(a);var n=createNS("use");n.setAttribute("href","#"+r),i.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,r=0,i=e.length;r<i;)e[r]&&e[r].data.ind===t&&this.setElementAsMask(this.elem,e[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGEffects.prototype.renderFrame=function(t){var e,r=this.filters.length;for(e=0;e<r;e+=1)this.filters[e].renderFrame(t)},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var r=0;for(r=this._length;r<t;r+=1)this.saved[r]=createTypedArray("float32",16);this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var t=createTag("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,r,i=t.getContext("2d"),s=this.img.width,a=this.img.height,n=s/a,o=this.assetData.w/this.assetData.h,h=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;o<n&&"xMidYMid slice"===h||n<o&&"xMidYMid slice"!==h?e=(r=a)*o:r=(e=s)/o,i.drawImage(this.img,(s-e)/2,(a-r)/2,e,r,0,0,this.assetData.w,this.assetData.h),this.img=t}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([CanvasRenderer,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,r,i,s=this.element.finalTransform.mat,a=this.element.canvasContext,n=this.masksProperties.length;for(a.beginPath(),t=0;t<n;t+=1)if("n"!==this.masksProperties[t].mode){var o;this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),i=this.viewData[t].v,e=s.applyToPointArray(i.v[0][0],i.v[0][1],0),a.moveTo(e[0],e[1]);var h=i._length;for(o=1;o<h;o+=1)r=s.applyToTriplePoints(i.o[o-1],i.i[o],i.v[o]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=s.applyToTriplePoints(i.o[o-1],i.i[0],i.v[0]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var r={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"===t.ty||"st"===t.ty?(i.c=PropertyFactory.getProp(this,t.c,1,255,this),i.c.k||(r.co="rgb("+bmFloor(i.c.v[0])+","+bmFloor(i.c.v[1])+","+bmFloor(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=PropertyFactory.getProp(this,t.s,1,null,this),i.e=PropertyFactory.getProp(this,t.e,1,null,this),i.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),i.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),i.g=new GradientProperty(this,t.g,this)),i.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(r.lc=this.lcEnum[t.lc]||"round",r.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(r.ml=t.ml),i.w=PropertyFactory.getProp(this,t.w,0,null,this),i.w.k||(r.wi=i.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);i.d=s,i.d.k||(r.da=i.d.dashArray,r.do=i.d.dashoffset[0])}}else r.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(r),i.style=r,i},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(t){var e,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},CVShapeElement.prototype.closeStyles=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].closed=!0},CVShapeElement.prototype.searchShapes=function(t,e,r,i,s){var a,n,o,h,l,p,m=t.length-1,f=[],c=[],d=[].concat(s);for(a=m;0<=a;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=r[h-1]:t[a]._shouldRender=i,"fl"===t[a].ty||"st"===t[a].ty||"gf"===t[a].ty||"gs"===t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),f.push(e[a].style);else if("gr"===t[a].ty){if(h)for(o=e[a].it.length,n=0;n<o;n+=1)e[a].prevViewData[n]=e[a].it[n];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,i,d)}else"tr"===t[a].ty?(h||(p=this.createTransformElement(t[a]),e[a]=p),d.push(e[a]),this.addTransformToStyleList(e[a])):"sh"===t[a].ty||"rc"===t[a].ty||"el"===t[a].ty||"sr"===t[a].ty?h||(e[a]=this.createShapeElement(t[a])):"tm"===t[a].ty||"rd"===t[a].ty||"pb"===t[a].ty?(h?(l=e[a]).closed=!1:((l=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=l,this.shapeModifiers.push(l)),c.push(l)):"rp"===t[a].ty&&(h?(l=e[a]).closed=!0:(l=ShapeModifiers.getModifier(t[a].ty),(e[a]=l).init(this,t,a,e),this.shapeModifiers.push(l),i=!1),c.push(l));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(f),m=c.length,a=0;a<m;a+=1)c[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var t,e,r,i,s,a,n,o,h,l=this.stylesList.length,p=this.globalData.renderer,m=this.globalData.canvasContext;for(t=0;t<l;t+=1)if(("st"!==(o=(h=this.stylesList[t]).type)&&"gs"!==o||0!==h.wi)&&h.data._shouldRender&&0!==h.coOp&&0!==this.globalData.currentGlobalAlpha){for(p.save(),a=h.elements,"st"===o||"gs"===o?(m.strokeStyle="st"===o?h.co:h.grd,m.lineWidth=h.wi,m.lineCap=h.lc,m.lineJoin=h.lj,m.miterLimit=h.ml||0):m.fillStyle="fl"===o?h.co:h.grd,p.ctxOpacity(h.coOp),"st"!==o&&"gs"!==o&&m.beginPath(),p.ctxTransform(h.preTransforms.finalTransform.props),r=a.length,e=0;e<r;e+=1){for("st"!==o&&"gs"!==o||(m.beginPath(),h.da&&(m.setLineDash(h.da),m.lineDashOffset=h.do)),s=(n=a[e].trNodes).length,i=0;i<s;i+=1)"m"===n[i].t?m.moveTo(n[i].p[0],n[i].p[1]):"c"===n[i].t?m.bezierCurveTo(n[i].pts[0],n[i].pts[1],n[i].pts[2],n[i].pts[3],n[i].pts[4],n[i].pts[5]):m.closePath();"st"!==o&&"gs"!==o||(m.stroke(),h.da&&m.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&m.fill(h.r),p.restore()}},CVShapeElement.prototype.renderShape=function(t,e,r,i){var s,a;for(a=t,s=e.length-1;0<=s;s-=1)"tr"===e[s].ty?(a=r[s].transform,this.renderShapeTransform(t,a)):"sh"===e[s].ty||"el"===e[s].ty||"rc"===e[s].ty||"sr"===e[s].ty?this.renderPath(e[s],r[s]):"fl"===e[s].ty?this.renderFill(e[s],r[s],a):"st"===e[s].ty?this.renderStroke(e[s],r[s],a):"gf"===e[s].ty||"gs"===e[s].ty?this.renderGradientFill(e[s],r[s],a):"gr"===e[s].ty?this.renderShape(a,e[s].it,r[s].it):e[s].ty;i&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var r,i,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(s=0;s<o;s+=1){var l=n.shapes[s];if(l&&l.v){for(i=l._length,r=1;r<i;r+=1)1===r&&a.push({t:"m",p:h.applyToPointArray(l.v[0][0],l.v[0][1],0)}),a.push({t:"c",pts:h.applyToTriplePoints(l.o[r-1],l.i[r],l.v[r])});1===i&&a.push({t:"m",p:h.applyToPointArray(l.v[0][0],l.v[0][1],0)}),l.c&&i&&(a.push({t:"c",pts:h.applyToTriplePoints(l.o[r-1],l.i[0],l.v[0])}),a.push({t:"z"}))}}t.trNodes=a}},CVShapeElement.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var r,i=e.styledShapes.length;for(r=0;r<i;r+=1)this.renderStyledShape(e.styledShapes[r],e.sh)}},CVShapeElement.prototype.renderFill=function(t,e,r){var i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(t,e,r){var i,s=e.style;if(!s.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var a,n=this.globalData.canvasContext,o=e.s.v,h=e.e.v;if(1===t.t)i=n.createLinearGradient(o[0],o[1],h[0],h[1]);else{var l=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)),p=Math.atan2(h[1]-o[1],h[0]-o[0]),m=e.h.v;1<=m?m=.99:m<=-1&&(m=-.99);var f=l*m,c=Math.cos(p+e.a.v)*f+o[0],d=Math.sin(p+e.a.v)*f+o[1];i=n.createRadialGradient(c,d,0,o[0],o[1],l)}var u=t.g.p,y=e.g.c,g=1;for(a=0;a<u;a+=1)e.g._hasOpacity&&e.g._collapsable&&(g=e.g.o[2*a+1]),i.addColorStop(y[4*a]/100,"rgba("+y[4*a+1]+","+y[4*a+2]+","+y[4*a+3]+","+g+")");s.grd=i}s.coOp=e.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||this._isFirstFrame)&&(i.da=s.dashArray,i.do=s.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity),(e.w._mdf||this._isFirstFrame)&&(i.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var r=!1;t.sc&&(r=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var i,s,a,n,o,h,l,p,m,f,c,d,u=this.globalData.fontManager.getFontByName(t.f),y=t.l,g=this.mHelper;this.stroke=r,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,s=t.finalText.length;var v=this.data.singleShape,b=.001*t.tr*t.finalSize,P=0,x=0,E=!0,S=0;for(i=0;i<s;i+=1){for(n=(a=this.globalData.fontManager.getCharData(t.finalText[i],u.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&a.data||{},g.reset(),v&&y[i].n&&(P=-b,x+=t.yOffset,x+=E?1:0,E=!1),m=(l=n.shapes?n.shapes[0].it:[]).length,g.scale(t.finalSize/100,t.finalSize/100),v&&this.applyTextPropertiesToMatrix(t,g,y[i].line,P,x),c=createSizedArray(m),p=0;p<m;p+=1){for(h=l[p].ks.k.i.length,f=l[p].ks.k,d=[],o=1;o<h;o+=1)1===o&&d.push(g.applyToX(f.v[0][0],f.v[0][1],0),g.applyToY(f.v[0][0],f.v[0][1],0)),d.push(g.applyToX(f.o[o-1][0],f.o[o-1][1],0),g.applyToY(f.o[o-1][0],f.o[o-1][1],0),g.applyToX(f.i[o][0],f.i[o][1],0),g.applyToY(f.i[o][0],f.i[o][1],0),g.applyToX(f.v[o][0],f.v[o][1],0),g.applyToY(f.v[o][0],f.v[o][1],0));d.push(g.applyToX(f.o[o-1][0],f.o[o-1][1],0),g.applyToY(f.o[o-1][0],f.o[o-1][1],0),g.applyToX(f.i[0][0],f.i[0][1],0),g.applyToY(f.i[0][0],f.i[0][1],0),g.applyToX(f.v[0][0],f.v[0][1],0),g.applyToY(f.v[0][0],f.v[0][1],0)),c[p]=d}v&&(P+=y[i].l,P+=b),this.textSpans[S]?this.textSpans[S].elem=c:this.textSpans[S]={elem:c},S+=1}},CVTextElement.prototype.renderInnerContent=function(){var t,e,r,i,s,a,n=this.canvasContext;n.font=this.values.fValue,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,h=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;e=l.length;var p,m,f=null,c=null,d=null;for(t=0;t<e;t+=1)if(!l[t].n){if((o=h[t])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(o.p),this.globalData.renderer.ctxOpacity(o.o)),this.fill){for(o&&o.fc?f!==o.fc&&(f=o.fc,n.fillStyle=o.fc):f!==this.values.fill&&(f=this.values.fill,n.fillStyle=this.values.fill),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<i;r+=1)for(a=(m=p[r]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(o&&o.sw?d!==o.sw&&(d=o.sw,n.lineWidth=o.sw):d!==this.values.sWidth&&(d=this.values.sWidth,n.lineWidth=this.values.sWidth),o&&o.sc?c!==o.sc&&(c=o.sc,n.strokeStyle=o.sc):c!==this.values.stroke&&(c=this.values.stroke,n.strokeStyle=this.values.stroke),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<i;r+=1)for(a=(m=p[r]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}o&&this.globalData.renderer.restore()}},CVEffects.prototype.renderFrame=function(){},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=HybridRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([HybridRenderer,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(t,e){for(var r,i=0;i<e;)this.elements[i]&&this.elements[i].getBaseElement&&(r=this.elements[i].getBaseElement()),i+=1;r?this.layerElement.insertBefore(t,r):this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e=t[r].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(t,e){var r,i,s,a,n,o=t.sh.v,h=t.transformers,l=o._length;if(!(l<=1)){for(r=0;r<l-1;r+=1)i=this.getTransformedPoint(h,o.v[r]),s=this.getTransformedPoint(h,o.o[r]),a=this.getTransformedPoint(h,o.i[r+1]),n=this.getTransformedPoint(h,o.v[r+1]),this.checkBounds(i,s,a,n,e);o.c&&(i=this.getTransformedPoint(h,o.v[r]),s=this.getTransformedPoint(h,o.o[r]),a=this.getTransformedPoint(h,o.i[0]),n=this.getTransformedPoint(h,o.v[0]),this.checkBounds(i,s,a,n,e))}},HShapeElement.prototype.checkBounds=function(t,e,r,i,s){this.getBoundsOfCurve(t,e,r,i);var a=this.shapeBoundingBox;s.x=bmMin(a.left,s.x),s.xMax=bmMax(a.right,s.xMax),s.y=bmMin(a.top,s.y),s.yMax=bmMax(a.bottom,s.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(t,e,r,i){for(var s,a,n,o,h,l,p,m=[[t[0],i[0]],[t[1],i[1]]],f=0;f<2;++f)a=6*t[f]-12*e[f]+6*r[f],s=-3*t[f]+9*e[f]-9*r[f]+3*i[f],n=3*e[f]-3*t[f],a|=0,n|=0,0===(s|=0)&&0===a||(0===s?0<(o=-n/a)&&o<1&&m[f].push(this.calculateF(o,t,e,r,i,f)):0<=(h=a*a-4*n*s)&&(0<(l=(-a+bmSqrt(h))/(2*s))&&l<1&&m[f].push(this.calculateF(l,t,e,r,i,f)),0<(p=(-a-bmSqrt(h))/(2*s))&&p<1&&m[f].push(this.calculateF(p,t,e,r,i,f))));this.shapeBoundingBox.left=bmMin.apply(null,m[0]),this.shapeBoundingBox.top=bmMin.apply(null,m[1]),this.shapeBoundingBox.right=bmMax.apply(null,m[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,m[1])},HShapeElement.prototype.calculateF=function(t,e,r,i,s,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*r[a]+3*(1-t)*bmPow(t,2)*i[a]+bmPow(t,3)*s[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]&&t[r].sh?this.calculateShapeBoundingBox(t[r],e):t[r]&&t[r].it&&this.calculateBoundingBox(t[r].it,e)},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var r=!1;if(this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),r=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),r=!0),r||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y){this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var i=this.shapeCont.style,s="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";i.transform=s,i.webkitTransform=s}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=createNS("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=this.innerElem.style,r=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)";e.fill=r,e.color=r,t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var i,s,a=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",a.fClass)this.innerElem.className=a.fClass;else{e.fontFamily=a.fFamily;var n=t.fWeight,o=t.fStyle;e.fontStyle=o,e.fontWeight=n}var h,l,p,m=t.l;s=m.length;var f,c=this.mHelper,d="",u=0;for(i=0;i<s;i+=1){if(this.globalData.fontManager.chars?(this.textPaths[u]?h=this.textPaths[u]:((h=createNS("path")).setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[u]?p=(l=this.textSpans[u]).children[0]:((l=createTag("div")).style.lineHeight=0,(p=createNS("svg")).appendChild(h),styleDiv(l)))):this.isMasked?h=this.textPaths[u]?this.textPaths[u]:createNS("text"):this.textSpans[u]?(l=this.textSpans[u],h=this.textPaths[u]):(styleDiv(l=createTag("span")),styleDiv(h=createTag("span")),l.appendChild(h)),this.globalData.fontManager.chars){var y,g=this.globalData.fontManager.getCharData(t.finalText[i],a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(y=g?g.data:null,c.reset(),y&&y.shapes&&(f=y.shapes[0].it,c.scale(t.finalSize/100,t.finalSize/100),d=this.createPathShape(c,f),h.setAttribute("d",d)),this.isMasked)this.innerElem.appendChild(h);else{if(this.innerElem.appendChild(l),y&&y.shapes){document.body.appendChild(p);var v=p.getBBox();p.setAttribute("width",v.width+2),p.setAttribute("height",v.height+2),p.setAttribute("viewBox",v.x-1+" "+(v.y-1)+" "+(v.width+2)+" "+(v.height+2));var b=p.style,P="translate("+(v.x-1)+"px,"+(v.y-1)+"px)";b.transform=P,b.webkitTransform=P,m[i].yOffset=v.y-1}else p.setAttribute("width",1),p.setAttribute("height",1);l.appendChild(p)}}else if(h.textContent=m[i].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(h);else{this.innerElem.appendChild(l);var x=h.style,E="translate3d(0,"+-t.finalSize/1.2+"px,0)";x.transform=E,x.webkitTransform=E}this.isMasked?this.textSpans[u]=h:this.textSpans[u]=l,this.textSpans[u].style.display="block",this.textPaths[u]=h,u+=1}for(;u<this.textSpans.length;)this.textSpans[u].style.display="none",u+=1},HTextElement.prototype.renderInnerContent=function(){var t;if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),t=this.svgElement.style;var e="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";t.transform=e,t.webkitTransform=e}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var r,i,s,a,n,o=0,h=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;for(i=l.length,r=0;r<i;r+=1)l[r].n?o+=1:(a=this.textSpans[r],n=this.textPaths[r],s=h[o],o+=1,s._mdf.m&&(this.isMasked?a.setAttribute("transform",s.m):(a.style.webkitTransform=s.m,a.style.transform=s.m)),a.style.opacity=s.o,s.sw&&s._mdf.sw&&n.setAttribute("stroke-width",s.sw),s.sc&&s._mdf.sc&&n.setAttribute("stroke",s.sc),s.fc&&s._mdf.fc&&(n.setAttribute("fill",s.fc),n.style.color=s.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var p=this.innerElem.getBBox();this.currentBBox.w!==p.width&&(this.currentBBox.w=p.width,this.svgElement.setAttribute("width",p.width)),this.currentBBox.h!==p.height&&(this.currentBBox.h=p.height,this.svgElement.setAttribute("height",p.height));if(this.currentBBox.w!==p.width+2||this.currentBBox.h!==p.height+2||this.currentBBox.x!==p.x-1||this.currentBBox.y!==p.y-1){this.currentBBox.w=p.width+2,this.currentBBox.h=p.height+2,this.currentBBox.x=p.x-1,this.currentBBox.y=p.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),t=this.svgElement.style;var m="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";t.transform=m,t.webkitTransform=m}}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var t,e,r,i,s=this.comp.threeDElements.length;for(t=0;t<s;t+=1)if("3d"===(e=this.comp.threeDElements[t]).type){r=e.perspectiveElem.style,i=e.container.style;var a=this.pe.v+"px",n="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.perspective=a,r.webkitPerspective=a,i.transformOrigin=n,i.mozTransformOrigin=n,i.webkitTransformOrigin=n,r.transform=o,r.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var t,e,r=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)r=this.hierarchy[t].finalTransform.mProp._mdf||r;if(r||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){if(this.mat.reset(),this.hierarchy)for(t=e=this.hierarchy.length-1;0<=t;t-=1){var i=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-i.p.v[0],-i.p.v[1],i.p.v[2]),this.mat.rotateX(-i.or.v[0]).rotateY(-i.or.v[1]).rotateZ(i.or.v[2]),this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v),this.mat.scale(1/i.s.v[0],1/i.s.v[1],1/i.s.v[2]),this.mat.translate(i.a.v[0],i.a.v[1],i.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s;s=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),n=[s[0]/a,s[1]/a,s[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],o),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-h)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var m,f,c;for(e=this.comp.threeDElements.length,t=0;t<e;t+=1)if("3d"===(m=this.comp.threeDElements[t]).type){if(p){var d=this.mat.toCSS();(c=m.container.style).transform=d,c.webkitTransform=d}this.pe._mdf&&((f=m.perspectiveElem.style).perspective=this.pe.v+"px",f.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},HEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||m()),e+=1}function l(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem===t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return f(i,t),i.setData(t,e),i}function p(){n+=1,d()}function m(){n-=1}function f(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",p),t.addEventListener("_idle",m),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new AnimationItem;return f(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),l(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),l(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){e&&"object"!=typeof e&&(e=JSON.parse(e));var r={wrapper:t,animationData:e},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";"false"===s?r.loop=!1:"true"===s?r.loop=!0:""!==s&&(r.loop=parseInt(s,10));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id===a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!==r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(KX={},KX.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},KX),KX;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:-t}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]+=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t,10)),"string"===i&&(e=parseInt(e,10)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]-=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t,10)),"string"==typeof e&&(e=parseInt(e,10)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var r;e||(e=helperLengthArray);var i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n===o)r=e=0;else{var l=n-o;switch(r=.5<h?l/(2-n-o):l/(n+o),n){case i:e=(s-a)/l+(s<a?6:0);break;case s:e=(a-i)/l+2;break;case a:e=(i-s)/l+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)r=i=e=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n,o=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*o;var h=i.length,l=createTypedArray("float32",h);for(n=0;n<h;n+=1)l[n]=i[n]+(s[n]-i[n])*o;return l}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shapePool.newElement();n.setPathData(!!i,a);var o,h,l=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:l,h=r&&r[s]?r[s]:l,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),l=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)l[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r),1<e?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(s)){var o,h=s.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=(a[o]-s[o])*n+s[o];return l}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[l.length-1].t;if(h<=p)return this.pv;if(r?s=p-(i=e?Math.abs(p-this.elem.comp.globalData.frameRate*e):Math.max(0,p-this.elem.data.ip)):((!e||e>l.length-1)&&(e=l.length-1),i=p-(s=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=(f[a]-m[a])*d+c[a];return o}return(f-m)*d+c}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-p)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-p)/.001*(u-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[0].t;if(p<=h)return this.pv;if(r?s=p+(i=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>l.length-1)&&(e=l.length-1),i=(s=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/i)%2==0)return this.getValueAtTime(((p-h)%i+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(p/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(p-h)%i+p)/this.comp.globalData.frameRate,0),d=Math.floor((p-h)/i)+1;if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(f[a]-m[a])*d;return o}return c-(f-m)*d}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(p-h)/.001;return o}return u+(u-y)*(p-h)/.001}}return this.getValueAtTime((i-((p-h)%i+p))/this.comp.globalData.frameRate,0)}function l(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(t);e.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var i=this.s.getValueAtTime(t);e.scale(i[0]*this.s.mult,i[1]*this.s.mult,i[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),l=this.rx.getValueAtTime(t),p=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(l*this.rx.mult).rotateZ(-p[2]*this.or.mult).rotateY(p[1]*this.or.mult).rotateX(p[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var m=this.px.getValueAtTime(t),f=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(m*this.px.mult,f*this.py.mult,-c*this.pz.mult)}else e.translate(m*this.px.mult,f*this.py.mult,0)}else{var d=this.p.getValueAtTime(t);e.translate(d[0]*this.p.mult,d[1]*this.p.mult,-d[2]*this.p.mult)}return e}.bind(i):i.getValueAtTime=function(){return this.v.clone(new Matrix)}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var p=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=p(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=l,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r,i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var s=i._length,a=i[t],n=i.v,o=createSizedArray(s);for(r=0;r<s;r+=1)o[r]="i"===t||"o"===t?[a[r][0]-n[r][0],a[r][1]-n[r][1]]:[a[r][0],a[r][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,l=0;o<h;){if(l+a[o].addedLength>n){var p=o,m=r.c&&o===h-1?0:o+1,f=(n-l)/a[o].addedLength;i=bez.getPointInSegment(r.v[p],r.v[m],r.o[p],r.i[m],f,a[o]);break}l+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){1==t?t=this.v.c:0==t&&(t=.999);var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null};var ShapePathInterface=function(t,e,r){var i=e.sh;function s(t){return"Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t?s.path:null}var a=propertyGroupFactory(s,r);return i.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:r}}),s},propertyGroupFactory=function(e,r){return function(t){return(t=void 0===t?1:t)<=0?e:r(t-1)}},PropertyInterface=function(t,e){var r={_name:t};return function(t){return(t=void 0===t?1:t)<=0?r:e(t-1)}},ShapeExpressionInterface=function(){function n(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"===t[i].ty?s.push(o(t[i],e[i],r)):"fl"===t[i].ty?s.push(h(t[i],e[i],r)):"st"===t[i].ty?s.push(l(t[i],e[i],r)):"tm"===t[i].ty?s.push(p(t[i],e[i],r)):"tr"===t[i].ty||("el"===t[i].ty?s.push(f(t[i],e[i],r)):"sr"===t[i].ty?s.push(c(t[i],e[i],r)):"sh"===t[i].ty?s.push(ShapePathInterface(t[i],e[i],r)):"rc"===t[i].ty?s.push(d(t[i],e[i],r)):"rd"===t[i].ty?s.push(u(t[i],e[i],r)):"rp"===t[i].ty&&s.push(y(t[i],e[i],r)));return s}function o(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,e,r){var i,s=function(t){for(var e=0,r=i.length;e<r;){if(i[e]._name===t||i[e].mn===t||i[e].propertyIndex===t||i[e].ix===t||i[e].ind===t)return i[e];e+=1}return"number"==typeof t?i[t-1]:null};s.propertyGroup=propertyGroupFactory(s,r),i=n(t.it,e.it,s.propertyGroup),s.numProperties=i.length;var a=m(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,i.propertyGroup),a=m(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function h(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:null}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),i}function l(t,e,r){var i,s=propertyGroupFactory(l,r),a=propertyGroupFactory(h,s);var n,o=t.d?t.d.length:0,h={};for(i=0;i<o;i+=1)n=i,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[i].p.setGroupProperty(a);function l(t){return"Color"===t||"color"===t?l.color:"Opacity"===t||"opacity"===t?l.opacity:"Stroke Width"===t||"stroke width"===t?l.strokeWidth:null}return Object.defineProperties(l,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",s)),e.o.setGroupProperty(PropertyInterface("Opacity",s)),e.w.setGroupProperty(PropertyInterface("Stroke Width",s)),l}function p(e,t,r){function i(t){return t===e.e.ix||"End"===t||"end"===t?i.end:t===e.s.ix?i.start:t===e.o.ix?i.offset:null}var s=propertyGroupFactory(i,r);return i.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),i.propertyIndex=e.ix,i.propertyGroup=r,Object.defineProperties(i,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),i.mn=e.mn,i}function m(e,t,r){function i(t){return e.a.ix===t||"Anchor Point"===t?i.anchorPoint:e.o.ix===t||"Opacity"===t?i.opacity:e.p.ix===t||"Position"===t?i.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?i.rotation:e.s.ix===t||"Scale"===t?i.scale:e.sk&&e.sk.ix===t||"Skew"===t?i.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?i.skewAxis:null}var s=propertyGroupFactory(i,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(i,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),i.ty="tr",i.mn=e.mn,i.propertyGroup=r,i}function f(e,t,r){function i(t){return e.p.ix===t?i.position:e.s.ix===t?i.size:null}var s=propertyGroupFactory(i,r);i.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(i,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),i.mn=e.mn,i}function c(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.rotation:e.pt.ix===t?i.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?i.outerRadius:e.os.ix===t?i.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?i.innerRoundness:null:i.innerRadius}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),i.mn=e.mn,i}function d(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?i.size:null}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),i.mn=e.mn,i}function u(e,t,r){function i(t){return e.r.ix===t||"Round Corners 1"===t?i.radius:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(i,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),i.mn=e.mn,i}function y(e,t,r){function i(t){return e.c.ix===t||"Copies"===t?i.copies:e.o.ix===t||"Offset"===t?i.offset:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(i,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),i.mn=e.mn,i}return function(t,e,i){var s;function r(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,r=s.length;e<r;){if(s[e]._name===t)return s[e];e+=1}return null}return r.propertyGroup=propertyGroupFactory(r,function(){return i}),s=n(t,e,r.propertyGroup),r.numProperties=s.length,r._name="Contents",r}}(),TextExpressionInterface=function(e){var r;function i(t){switch(t){case"ADBE Text Document":return i.sourceText;default:return null}}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),i},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,t)}function n(t,e){var r=this.getMatrix(e);return this.applyPoint(r,t)}function o(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,t)}function h(t,e){var r=this.getMatrix(e);return this.invertPoint(r,t)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function m(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function f(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect;case"ADBE Text Properties":return i.textInterface;default:return null}}i.getMatrix=s,i.invertPoint=p,i.applyPoint=l,i.toWorld=n,i.toWorldVec=a,i.fromWorld=h,i.fromWorldVec=o,i.toComp=n,i.fromComp=m,i.sampleImage=f,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity;default:return null}}var r,i,s,a;return Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p?a=ExpressionPropertyInterface(t.p):(r=ExpressionPropertyInterface(t.px),i=ExpressionPropertyInterface(t.py),t.pz&&(s=ExpressionPropertyInterface(t.pz))),Object.defineProperty(e,"position",{get:function(){return t.p?a():[r(),i(),s?s():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function l(s,t,e,r){function i(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?o[r]:o[r]();r+=1}throw new Error}var a,n=propertyGroupFactory(i,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(l(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,r)):o.push(p(t.effectElements[a],s.ef[a].ty,r,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(i,"color",{get:function(){return o[0]()}}),Object.defineProperties(i,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),i.enabled=0!==s.en,i.active=i.enabled,i}function p(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",i)),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(l(s[r],t.effectsManager.effectElements[r],e,t));var n=t.data.ef||[],o=function(t){for(r=0,a=n.length;r<a;){if(t===n[r].nm||t===n[r].mn||t===n[r].ix)return i[r];r+=1}return null};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}return null}}}(),MaskManagerInterface=function(){function t(t,e){this._mask=t,this._data=e}Object.defineProperty(t.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(t.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new t(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(!i.numKeys)return 0;var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r.value="unidimensional"===a?e[0]:e,r},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)a[t]=e.v[t]*r,s[t]=a[t];return s}}(t):e}}();function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var r,i=t.ef||[];this.effectElements=[];var s,a=i.length;for(r=0;r<a;r+=1)s=new GroupEffect(i[r],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}!function(){!function(){function t(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}}();var i=TextSelectorProp.getTextSelectorProp;TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new TextExpressionSelectorPropFactory(t,e,r):i(t,e,r)}}(),extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){var r;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottie={};function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;default:case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r<e.length;r+=1){var i=e[r].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.7.6";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="",queryString;if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src.replace(/^[^\?]+\??/,""),renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
 return lottie;
 }));
\ No newline at end of file
diff --git a/build/player/lottie_canvas.js b/build/player/lottie_canvas.js
index 770de2d..4155917 100644
--- a/build/player/lottie_canvas.js
+++ b/build/player/lottie_canvas.js
@@ -10,360 +10,399 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";
-var svgNS = "http://www.w3.org/2000/svg";
+	/* global locationHref:writable, animationManager, subframeEnabled:writable, defaultCurveSegments:writable, roundValues,
+expressionsPlugin:writable, PropertyFactory, ShapePropertyFactory, Matrix */
+/* exported locationHref, subframeEnabled, expressionsPlugin */
+
+'use strict';
+
+/* exported svgNS, locationHref, initialDefaultFrame */
+
+var svgNS = 'http://www.w3.org/2000/svg';
 
 var locationHref = '';
 
 var initialDefaultFrame = -999999;
 
+/* global createSizedArray */
+/* exported subframeEnabled, expressionsPlugin, isSafari, cachedColors, bmPow, bmSqrt, bmFloor, bmMax, bmMin, ProjectInterface,
+defaultCurveSegments, degToRads, roundCorner, bmRnd, styleDiv, BMEnterFrameEvent, BMCompleteEvent, BMCompleteLoopEvent,
+BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, BMAnimationConfigErrorEvent, createElementID,
+addSaturationToRGB, addBrightnessToRGB, addHueToRGB, rgbToHex */
+
 var subframeEnabled = true;
 var expressionsPlugin;
 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
+var bmRnd;
+var bmPow = Math.pow;
+var bmSqrt = Math.sqrt;
+var bmFloor = Math.floor;
+var bmMax = Math.max;
+var bmMin = Math.min;
 
 var BMMath = {};
-(function(){
-    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"];
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
+(function () {
+  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'];
+  var i;
+  var len = propertyNames.length;
+  for (i = 0; i < len; i += 1) {
+    BMMath[propertyNames[i]] = Math[propertyNames[i]];
+  }
 }());
 
-function ProjectInterface(){return {};}
+function ProjectInterface() { return {}; }
 
 BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = createSizedArray(val.length);
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
+BMMath.abs = function (val) {
+  var tOfVal = typeof val;
+  if (tOfVal === 'object' && val.length) {
+    var absArr = createSizedArray(val.length);
+    var i;
+    var len = val.length;
+    for (i = 0; i < len; i += 1) {
+      absArr[i] = Math.abs(val[i]);
     }
-    return Math.abs(val);
-
+    return absArr;
+  }
+  return Math.abs(val);
 };
 var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
+var degToRads = Math.PI / 180;
 var roundCorner = 0.5519;
 
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
+function roundValues(flag) {
+  if (flag) {
+    bmRnd = Math.round;
+  } else {
+    bmRnd = function (val) {
+      return val;
+    };
+  }
 }
 roundValues(false);
 
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
+function styleDiv(element) {
+  element.style.position = 'absolute';
+  element.style.top = 0;
+  element.style.left = 0;
+  element.style.display = 'block';
+  element.style.transformOrigin = '0 0';
+  element.style.webkitTransformOrigin = '0 0';
+  element.style.backfaceVisibility = 'visible';
+  element.style.webkitBackfaceVisibility = 'visible';
+  element.style.transformStyle = 'preserve-3d';
+  element.style.webkitTransformStyle = 'preserve-3d';
+  element.style.mozTransformStyle = 'preserve-3d';
 }
 
-function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
-    this.type = type;
-    this.currentTime = currentTime;
-    this.totalTime = totalTime;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
+  this.type = type;
+  this.currentTime = currentTime;
+  this.totalTime = totalTime;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteEvent(type, frameMultiplier){
-    this.type = type;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteEvent(type, frameMultiplier) {
+  this.type = type;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
-    this.type = type;
-    this.currentLoop = currentLoop;
-    this.totalLoops = totalLoops;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
+  this.type = type;
+  this.currentLoop = currentLoop;
+  this.totalLoops = totalLoops;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMSegmentStartEvent(type, firstFrame, totalFrames){
-    this.type = type;
-    this.firstFrame = firstFrame;
-    this.totalFrames = totalFrames;
+function BMSegmentStartEvent(type, firstFrame, totalFrames) {
+  this.type = type;
+  this.firstFrame = firstFrame;
+  this.totalFrames = totalFrames;
 }
 
-function BMDestroyEvent(type, target){
-    this.type = type;
-    this.target = target;
+function BMDestroyEvent(type, target) {
+  this.type = type;
+  this.target = target;
 }
 
 function BMRenderFrameErrorEvent(nativeError, currentTime) {
-    this.type = 'renderFrameError';
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = 'renderFrameError';
+  this.nativeError = nativeError;
+  this.currentTime = currentTime;
 }
 
 function BMConfigErrorEvent(nativeError) {
-    this.type = 'configError';
-    this.nativeError = nativeError;
+  this.type = 'configError';
+  this.nativeError = nativeError;
 }
 
 function BMAnimationConfigErrorEvent(type, nativeError) {
-    this.type = type;
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = type;
+  this.nativeError = nativeError;
 }
 
-var createElementID = (function(){
-    var _count = 0;
-    return function createID() {
-        return '__lottie_element_' + ++_count
-    }
-}())
+var createElementID = (function () {
+  var _count = 0;
+  return function createID() {
+    _count += 1;
+    return '__lottie_element_' + _count;
+  };
+}());
 
 function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v; g = t; b = p; break;
-        case 1: r = q; g = v; b = p; break;
-        case 2: r = p; g = v; b = t; break;
-        case 3: r = p; g = q; b = v; break;
-        case 4: r = t; g = p; b = v; break;
-        case 5: r = v; g = p; b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
+  var r;
+  var g;
+  var b;
+  var i;
+  var f;
+  var p;
+  var q;
+  var t;
+  i = Math.floor(h * 6);
+  f = h * 6 - i;
+  p = v * (1 - s);
+  q = v * (1 - f * s);
+  t = v * (1 - (1 - f) * s);
+  switch (i % 6) {
+    case 0: r = v; g = t; b = p; break;
+    case 1: r = q; g = v; b = p; break;
+    case 2: r = p; g = v; b = t; break;
+    case 3: r = p; g = q; b = v; break;
+    case 4: r = t; g = p; b = v; break;
+    case 5: r = v; g = p; b = q; break;
+    default: break;
+  }
+  return [r,
+    g,
+    b];
 }
 
 function RGBtoHSV(r, g, b) {
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
+  var max = Math.max(r, g, b);
+  var min = Math.min(r, g, b);
+  var d = max - min;
+  var h;
+  var s = (max === 0 ? 0 : d / max);
+  var v = max / 255;
 
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
+  switch (max) {
+    case min: h = 0; break;
+    case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break;
+    case g: h = (b - r) + d * 2; h /= 6 * d; break;
+    case b: h = (r - g) + d * 4; h /= 6 * d; break;
+    default: break;
+  }
 
-    return [
-         h,
-         s,
-         v
-    ];
+  return [
+    h,
+    s,
+    v,
+  ];
 }
 
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addSaturationToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[1] += offset;
+  if (hsv[1] > 1) {
+    hsv[1] = 1;
+  } else if (hsv[1] <= 0) {
+    hsv[1] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addBrightnessToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[2] += offset;
+  if (hsv[2] > 1) {
+    hsv[2] = 1;
+  } else if (hsv[2] < 0) {
+    hsv[2] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addHueToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[0] += offset / 360;
+  if (hsv[0] > 1) {
+    hsv[0] -= 1;
+  } else if (hsv[0] < 0) {
+    hsv[0] += 1;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
+var rgbToHex = (function () {
+  var colorMap = [];
+  var i;
+  var hex;
+  for (i = 0; i < 256; i += 1) {
+    hex = i.toString(16);
+    colorMap[i] = hex.length === 1 ? '0' + hex : hex;
+  }
 
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
+  return function (r, g, b) {
+    if (r < 0) {
+      r = 0;
+    }
+    if (g < 0) {
+      g = 0;
+    }
+    if (b < 0) {
+      b = 0;
+    }
+    return '#' + colorMap[r] + colorMap[g] + colorMap[b];
+  };
 }());
-function BaseEvent(){}
-BaseEvent.prototype = {
-	triggerEvent: function (eventName, args) {
-	    if (this._cbs[eventName]) {
-	        var len = this._cbs[eventName].length;
-	        for (var i = 0; i < len; i++){
-	            this._cbs[eventName][i](args);
-	        }
-	    }
-	},
-	addEventListener: function (eventName, callback) {
-	    if (!this._cbs[eventName]){
-	        this._cbs[eventName] = [];
-	    }
-	    this._cbs[eventName].push(callback);
 
-		return function() {
-			this.removeEventListener(eventName, callback);
-		}.bind(this);
-	},
-	removeEventListener: function (eventName,callback){
-	    if (!callback){
-	        this._cbs[eventName] = null;
-	    }else if(this._cbs[eventName]){
-	        var i = 0, len = this._cbs[eventName].length;
-	        while(i<len){
-	            if(this._cbs[eventName][i] === callback){
-	                this._cbs[eventName].splice(i,1);
-	                i -=1;
-	                len -= 1;
-	            }
-	            i += 1;
-	        }
-	        if(!this._cbs[eventName].length){
-	            this._cbs[eventName] = null;
-	        }
-	    }
-	}
+function BaseEvent() {}
+BaseEvent.prototype = {
+  triggerEvent: function (eventName, args) {
+    if (this._cbs[eventName]) {
+      var len = this._cbs[eventName].length;
+      for (var i = 0; i < len; i += 1) {
+        this._cbs[eventName][i](args);
+      }
+    }
+  },
+  addEventListener: function (eventName, callback) {
+    if (!this._cbs[eventName]) {
+      this._cbs[eventName] = [];
+    }
+    this._cbs[eventName].push(callback);
+
+    return function () {
+      this.removeEventListener(eventName, callback);
+    }.bind(this);
+  },
+  removeEventListener: function (eventName, callback) {
+    if (!callback) {
+      this._cbs[eventName] = null;
+    } else if (this._cbs[eventName]) {
+      var i = 0;
+      var len = this._cbs[eventName].length;
+      while (i < len) {
+        if (this._cbs[eventName][i] === callback) {
+          this._cbs[eventName].splice(i, 1);
+          i -= 1;
+          len -= 1;
+        }
+        i += 1;
+      }
+      if (!this._cbs[eventName].length) {
+        this._cbs[eventName] = null;
+      }
+    }
+  },
 };
-var createTypedArray = (function(){
-	function createRegularArray(type, len){
-		var i = 0, arr = [], value;
-		switch(type) {
-			case 'int16':
-			case 'uint8c':
-				value = 1;
-				break;
-			default:
-				value = 1.1;
-				break;
-		}
-		for(i = 0; i < len; i += 1) {
-			arr.push(value);
-		}
-		return arr;
-	}
-	function createTypedArray(type, len){
-		if(type === 'float32') {
-			return new Float32Array(len);
-		} else if(type === 'int16') {
-			return new Int16Array(len);
-		} else if(type === 'uint8c') {
-			return new Uint8ClampedArray(len);
-		}
-	}
-	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
-		return createTypedArray;
-	} else {
-		return createRegularArray;
-	}
+
+/* exported createTypedArray, createSizedArray */
+
+var createTypedArray = (function () {
+  function createRegularArray(type, len) {
+    var i = 0;
+    var arr = [];
+    var value;
+    switch (type) {
+      case 'int16':
+      case 'uint8c':
+        value = 1;
+        break;
+      default:
+        value = 1.1;
+        break;
+    }
+    for (i = 0; i < len; i += 1) {
+      arr.push(value);
+    }
+    return arr;
+  }
+  function createTypedArrayFactory(type, len) {
+    if (type === 'float32') {
+      return new Float32Array(len);
+    } if (type === 'int16') {
+      return new Int16Array(len);
+    } if (type === 'uint8c') {
+      return new Uint8ClampedArray(len);
+    }
+    return createRegularArray(type, len);
+  }
+  if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+    return createTypedArrayFactory;
+  }
+  return createRegularArray;
 }());
 
 function createSizedArray(len) {
-	return Array.apply(null,{length:len});
+  return Array.apply(null, { length: len });
 }
+
+/* exported createTag */
+
 function createTag(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElement(type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElement(type);
 }
-function DynamicPropertyContainer(){};
+
+function DynamicPropertyContainer() {}
 DynamicPropertyContainer.prototype = {
-	addDynamicProperty: function(prop) {
-		if(this.dynamicProperties.indexOf(prop) === -1) {
-	        this.dynamicProperties.push(prop);
-	        this.container.addDynamicProperty(this);
-	    	this._isAnimated = true;
-	    }
-	},
-	iterateDynamicProperties: function(){
-	    this._mdf = false;
-	    var i, len = this.dynamicProperties.length;
-	    for(i=0;i<len;i+=1){
-	        this.dynamicProperties[i].getValue();
-	        if(this.dynamicProperties[i]._mdf) {
-	            this._mdf = true;
-	        }
-	    }
-	},
-	initDynamicPropertyContainer: function(container){
-	    this.container = container;
-	    this.dynamicProperties = [];
-	    this._mdf = false;
-	    this._isAnimated = false;
-	}
-}
-var getBlendMode = (function() {
-
-	var blendModeEnums = {
-        0:'source-over',
-        1:'multiply',
-        2:'screen',
-        3:'overlay',
-        4:'darken',
-        5:'lighten',
-        6:'color-dodge',
-        7:'color-burn',
-        8:'hard-light',
-        9:'soft-light',
-        10:'difference',
-        11:'exclusion',
-        12:'hue',
-        13:'saturation',
-        14:'color',
-        15:'luminosity'
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+      this.container.addDynamicProperty(this);
+      this._isAnimated = true;
     }
+  },
+  iterateDynamicProperties: function () {
+    this._mdf = false;
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      this.dynamicProperties[i].getValue();
+      if (this.dynamicProperties[i]._mdf) {
+        this._mdf = true;
+      }
+    }
+  },
+  initDynamicPropertyContainer: function (container) {
+    this.container = container;
+    this.dynamicProperties = [];
+    this._mdf = false;
+    this._isAnimated = false;
+  },
+};
 
-	return function(mode) {
-		return blendModeEnums[mode] || '';
-	}
-}())
+/* exported getBlendMode */
+
+var getBlendMode = (function () {
+  var blendModeEnums = {
+    0: 'source-over',
+    1: 'multiply',
+    2: 'screen',
+    3: 'overlay',
+    4: 'darken',
+    5: 'lighten',
+    6: 'color-dodge',
+    7: 'color-burn',
+    8: 'hard-light',
+    9: 'soft-light',
+    10: 'difference',
+    11: 'exclusion',
+    12: 'hue',
+    13: 'saturation',
+    14: 'color',
+    15: 'luminosity',
+  };
+
+  return function (mode) {
+    return blendModeEnums[mode] || '';
+  };
+}());
+
+/* global createTypedArray */
+
 /*!
  Transformation Matrix v2.0
  (c) Epistemex 2014-2015
@@ -393,394 +432,399 @@
  * @constructor
  */
 
-var Matrix = (function(){
+var Matrix = (function () {
+  var _cos = Math.cos;
+  var _sin = Math.sin;
+  var _tan = Math.tan;
+  var _rnd = Math.round;
 
-    var _cos = Math.cos;
-    var _sin = Math.sin;
-    var _tan = Math.tan;
-    var _rnd = Math.round;
+  function reset() {
+    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;
+    return this;
+  }
 
-    function reset(){
-        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;
-        return this;
+  function rotate(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function rotateX(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateY(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateZ(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function shear(sx, sy) {
+    return this._t(1, sy, sx, 1, 0, 0);
+  }
+
+  function skew(ax, ay) {
+    return this.shear(_tan(ax), _tan(ay));
+  }
+
+  function skewFromAxis(ax, angle) {
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    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);
+  }
+
+  function scale(sx, sy, sz) {
+    if (!sz && sz !== 0) {
+      sz = 1;
+    }
+    if (sx === 1 && sy === 1 && sz === 1) {
+      return this;
+    }
+    return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
+  }
+
+  function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
+    this.props[0] = a;
+    this.props[1] = b;
+    this.props[2] = c;
+    this.props[3] = d;
+    this.props[4] = e;
+    this.props[5] = f;
+    this.props[6] = g;
+    this.props[7] = h;
+    this.props[8] = i;
+    this.props[9] = j;
+    this.props[10] = k;
+    this.props[11] = l;
+    this.props[12] = m;
+    this.props[13] = n;
+    this.props[14] = o;
+    this.props[15] = p;
+    return this;
+  }
+
+  function translate(tx, ty, tz) {
+    tz = tz || 0;
+    if (tx !== 0 || ty !== 0 || tz !== 0) {
+      return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
+    }
+    return this;
+  }
+
+  function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
+    var _p = this.props;
+
+    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) {
+      // NOTE: commenting this condition because TurboFan deoptimizes code when present
+      // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+      _p[12] = _p[12] * a2 + _p[15] * m2;
+      _p[13] = _p[13] * f2 + _p[15] * n2;
+      _p[14] = _p[14] * k2 + _p[15] * o2;
+      _p[15] *= p2;
+      // }
+      this._identityCalculated = false;
+      return this;
     }
 
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
+    var a1 = _p[0];
+    var b1 = _p[1];
+    var c1 = _p[2];
+    var d1 = _p[3];
+    var e1 = _p[4];
+    var f1 = _p[5];
+    var g1 = _p[6];
+    var h1 = _p[7];
+    var i1 = _p[8];
+    var j1 = _p[9];
+    var k1 = _p[10];
+    var l1 = _p[11];
+    var m1 = _p[12];
+    var n1 = _p[13];
+    var o1 = _p[14];
+    var p1 = _p[15];
 
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(_tan(ax), _tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        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);
-    }
-
-    function scale(sx, sy, sz) {
-        if(!sz && sz !== 0) {
-            sz = 1;
-        }
-        if(sx === 1 && sy === 1 && sz === 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        var _p = this.props;
-
-        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){
-            //NOTE: commenting this condition because TurboFan deoptimizes code when present
-            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-                _p[12] = _p[12] * a2 + _p[15] * m2;
-                _p[13] = _p[13] * f2 + _p[15] * n2;
-                _p[14] = _p[14] * k2 + _p[15] * o2;
-                _p[15] = _p[15] * p2;
-            //}
-            this._identityCalculated = false;
-            return this;
-        }
-
-        var a1 = _p[0];
-        var b1 = _p[1];
-        var c1 = _p[2];
-        var d1 = _p[3];
-        var e1 = _p[4];
-        var f1 = _p[5];
-        var g1 = _p[6];
-        var h1 = _p[7];
-        var i1 = _p[8];
-        var j1 = _p[9];
-        var k1 = _p[10];
-        var l1 = _p[11];
-        var m1 = _p[12];
-        var n1 = _p[13];
-        var o1 = _p[14];
-        var p1 = _p[15];
-
-        /* matrix order (canvas compatible):
+    /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+    _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+    _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
+    _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
+    _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
 
-        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+    _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
+    _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
+    _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
+    _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
 
-        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+    _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
+    _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
+    _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
+    _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
 
-        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+    _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
+    _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
+    _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
+    _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
 
-        this._identityCalculated = false;
-        return this;
+    this._identityCalculated = false;
+    return this;
+  }
+
+  function isIdentity() {
+    if (!this._identityCalculated) {
+      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);
+      this._identityCalculated = true;
     }
+    return this._identity;
+  }
 
-    function isIdentity() {
-        if(!this._identityCalculated){
-            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);
-            this._identityCalculated = true;
-        }
-        return this._identity;
+  function equals(matr) {
+    var i = 0;
+    while (i < 16) {
+      if (matr.props[i] !== this.props[i]) {
+        return false;
+      }
+      i += 1;
     }
+    return true;
+  }
 
-    function equals(matr){
-        var i = 0;
-        while (i < 16) {
-            if(matr.props[i] !== this.props[i]) {
-                return false;
-            }
-            i+=1;
-        }
-        return true;
+  function clone(matr) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      matr.props[i] = this.props[i];
     }
+    return matr;
+  }
 
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-        return matr;
+  function cloneFromProps(props) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      this.props[i] = props[i];
     }
+  }
 
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
+  function applyToPoint(x, y, z) {
+    return {
+      x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
+      y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
+      z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14],
+    };
+    /* return {
          x: x * me.a + y * me.c + me.e,
          y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
+         }; */
+  }
+  function applyToX(x, y, z) {
+    return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
+  }
+  function applyToY(x, y, z) {
+    return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
+  }
+  function applyToZ(x, y, z) {
+    return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
+  }
 
-    function getInverseMatrix() {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        var inverseMatrix = new Matrix();
-        inverseMatrix.props[0] = a;
-        inverseMatrix.props[1] = b;
-        inverseMatrix.props[4] = c;
-        inverseMatrix.props[5] = d;
-        inverseMatrix.props[12] = e;
-        inverseMatrix.props[13] = f;
-        return inverseMatrix;
-    }
+  function getInverseMatrix() {
+    var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
+    var a = this.props[5] / determinant;
+    var b = -this.props[1] / determinant;
+    var c = -this.props[4] / determinant;
+    var d = this.props[0] / determinant;
+    var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
+    var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
+    var inverseMatrix = new Matrix();
+    inverseMatrix.props[0] = a;
+    inverseMatrix.props[1] = b;
+    inverseMatrix.props[4] = c;
+    inverseMatrix.props[5] = d;
+    inverseMatrix.props[12] = e;
+    inverseMatrix.props[13] = f;
+    return inverseMatrix;
+  }
 
-    function inversePoint(pt) {
-        var inverseMatrix = this.getInverseMatrix();
-        return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
-    }
+  function inversePoint(pt) {
+    var inverseMatrix = this.getInverseMatrix();
+    return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
+  }
 
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
+  function inversePoints(pts) {
+    var i;
+    var len = pts.length;
+    var retPts = [];
+    for (i = 0; i < len; i += 1) {
+      retPts[i] = inversePoint(pts[i]);
     }
+    return retPts;
+  }
 
-    function applyToTriplePoints(pt1, pt2, pt3) {
-        var arr = createTypedArray('float32', 6);
-        if(this.isIdentity()) {
-            arr[0] = pt1[0];
-            arr[1] = pt1[1];
-            arr[2] = pt2[0];
-            arr[3] = pt2[1];
-            arr[4] = pt3[0];
-            arr[5] = pt3[1];
-        } else {
-            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
-            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
-            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
-            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
-            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
-            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
-            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
-        }
-        return arr;
+  function applyToTriplePoints(pt1, pt2, pt3) {
+    var arr = createTypedArray('float32', 6);
+    if (this.isIdentity()) {
+      arr[0] = pt1[0];
+      arr[1] = pt1[1];
+      arr[2] = pt2[0];
+      arr[3] = pt2[1];
+      arr[4] = pt3[0];
+      arr[5] = pt3[1];
+    } else {
+      var p0 = this.props[0];
+      var p1 = this.props[1];
+      var p4 = this.props[4];
+      var p5 = this.props[5];
+      var p12 = this.props[12];
+      var p13 = this.props[13];
+      arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+      arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+      arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+      arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+      arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+      arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
     }
+    return arr;
+  }
 
-    function applyToPointArray(x,y,z){
-        var arr;
-        if(this.isIdentity()) {
-            arr = [x,y,z];
-        } else {
-            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]
-            ];
-        }
-        return arr;
+  function applyToPointArray(x, y, z) {
+    var arr;
+    if (this.isIdentity()) {
+      arr = [x, y, z];
+    } else {
+      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],
+      ];
     }
+    return arr;
+  }
 
-    function applyToPointStringified(x, y) {
-        if(this.isIdentity()) {
-            return x + ',' + y;
-        }
-        var _p = this.props;
-        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;
+  function applyToPointStringified(x, y) {
+    if (this.isIdentity()) {
+      return x + ',' + y;
     }
+    var _p = this.props;
+    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;
+  }
 
-    function toCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function toCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var i = 0;
-        var props = this.props;
-        var cssValue = 'matrix3d(';
-        var v = 10000;
-        while(i<16){
-            cssValue += _rnd(props[i]*v)/v;
-            cssValue += i === 15 ? ')':',';
-            i += 1;
-        }
-        return cssValue;
+        } */
+    var i = 0;
+    var props = this.props;
+    var cssValue = 'matrix3d(';
+    var v = 10000;
+    while (i < 16) {
+      cssValue += _rnd(props[i] * v) / v;
+      cssValue += i === 15 ? ')' : ',';
+      i += 1;
     }
+    return cssValue;
+  }
 
-    function roundMatrixProperty(val) {
-        var v = 10000;
-        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
-            return _rnd(val * v) / v;
-        }
-        return val;
+  function roundMatrixProperty(val) {
+    var v = 10000;
+    if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+      return _rnd(val * v) / v;
     }
+    return val;
+  }
 
-    function to2dCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function to2dCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var props = this.props;
-        var _a = roundMatrixProperty(props[0]);
-        var _b = roundMatrixProperty(props[1]);
-        var _c = roundMatrixProperty(props[4]);
-        var _d = roundMatrixProperty(props[5]);
-        var _e = roundMatrixProperty(props[12]);
-        var _f = roundMatrixProperty(props[13]);
-        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
-    }
+        } */
+    var props = this.props;
+    var _a = roundMatrixProperty(props[0]);
+    var _b = roundMatrixProperty(props[1]);
+    var _c = roundMatrixProperty(props[4]);
+    var _d = roundMatrixProperty(props[5]);
+    var _e = roundMatrixProperty(props[12]);
+    var _f = roundMatrixProperty(props[13]);
+    return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
+  }
 
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToTriplePoints = applyToTriplePoints;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.equals = equals;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this.getInverseMatrix = getInverseMatrix;
-        this._t = this.transform;
-        this.isIdentity = isIdentity;
-        this._identity = true;
-        this._identityCalculated = false;
+  return function () {
+    this.reset = reset;
+    this.rotate = rotate;
+    this.rotateX = rotateX;
+    this.rotateY = rotateY;
+    this.rotateZ = rotateZ;
+    this.skew = skew;
+    this.skewFromAxis = skewFromAxis;
+    this.shear = shear;
+    this.scale = scale;
+    this.setTransform = setTransform;
+    this.translate = translate;
+    this.transform = transform;
+    this.applyToPoint = applyToPoint;
+    this.applyToX = applyToX;
+    this.applyToY = applyToY;
+    this.applyToZ = applyToZ;
+    this.applyToPointArray = applyToPointArray;
+    this.applyToTriplePoints = applyToTriplePoints;
+    this.applyToPointStringified = applyToPointStringified;
+    this.toCSS = toCSS;
+    this.to2dCSS = to2dCSS;
+    this.clone = clone;
+    this.cloneFromProps = cloneFromProps;
+    this.equals = equals;
+    this.inversePoints = inversePoints;
+    this.inversePoint = inversePoint;
+    this.getInverseMatrix = getInverseMatrix;
+    this._t = this.transform;
+    this.isIdentity = isIdentity;
+    this._identity = true;
+    this._identityCalculated = false;
 
-        this.props = createTypedArray('float32', 16);
-        this.reset();
-    };
+    this.props = createTypedArray('float32', 16);
+    this.reset();
+  };
 }());
 
+/* eslint-disable */
 /*
  Copyright 2014 David Bau.
 
@@ -1014,8 +1058,9 @@
     [],     // pool: entropy pool starts empty
     BMMath    // math: package containing random, pow, and seedrandom
 );
-var BezierFactory = (function(){
-    /**
+/* eslint-disable */
+var BezierFactory = (function () {
+  /**
      * BezierEasing - use bezier curve for transition easing function
      * by Gaëtan Renaudeau 2014 - 2015 – MIT License
      *
@@ -1026,6803 +1071,7182 @@
      *
      */
 
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
+  var ob = {};
+  ob.getBezierEasing = getBezierEasing;
+  var beziers = {};
 
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
+  function getBezierEasing(a, b, c, d, nm) {
+    var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
+    if (beziers[str]) {
+      return beziers[str];
     }
+    var bezEasing = new BezierEasing([a, b, c, d]);
+    beziers[str] = bezEasing;
+    return bezEasing;
+  }
 
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
+  // These values are established by empiricism with tests (tradeoff: performance VS precision)
+  var NEWTON_ITERATIONS = 4;
+  var NEWTON_MIN_SLOPE = 0.001;
+  var SUBDIVISION_PRECISION = 0.0000001;
+  var SUBDIVISION_MAX_ITERATIONS = 10;
 
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+  var kSplineTableSize = 11;
+  var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
 
-    var float32ArraySupported = typeof Float32Array === "function";
+  var float32ArraySupported = typeof Float32Array === 'function';
 
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
+  function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+  function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+  function C(aA1) { return 3.0 * aA1; }
 
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
+  // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+  function calcBezier(aT, aA1, aA2) {
+    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
+  }
+
+  // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+  function getSlope(aT, aA1, aA2) {
+    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
+  }
+
+  function binarySubdivide(aX, aA, aB, mX1, mX2) {
+    var currentX,
+      currentT,
+      i = 0;
+    do {
+      currentT = aA + (aB - aA) / 2.0;
+      currentX = calcBezier(currentT, mX1, mX2) - aX;
+      if (currentX > 0.0) {
+        aB = currentT;
+      } else {
+        aA = currentT;
+      }
+    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+    return currentT;
+  }
+
+  function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
+    for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+      var currentSlope = getSlope(aGuessT, mX1, mX2);
+      if (currentSlope === 0.0) return aGuessT;
+      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+      aGuessT -= currentX / currentSlope;
     }
+    return aGuessT;
+  }
 
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
+  /**
      * points is an array of [ mX1, mY1, mX2, mY2 ]
      */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
+  function BezierEasing(points) {
+    this._p = points;
+    this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+    this._precomputed = false;
 
-        this.get = this.get.bind(this);
-    }
+    this.get = this.get.bind(this);
+  }
 
-    BezierEasing.prototype = {
+  BezierEasing.prototype = {
 
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
+    get: function (x) {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      if (!this._precomputed) this._precompute();
+      if (mX1 === mY1 && mX2 === mY2) return x; // linear
+      // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+      if (x === 0) return 0;
+      if (x === 1) return 1;
+      return calcBezier(this._getTForX(x), mY1, mY2);
+    },
 
-        // Private part
+    // Private part
 
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
+    _precompute: function () {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      this._precomputed = true;
+      if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); }
+    },
 
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
+    _calcSampleValues: function () {
+      var mX1 = this._p[0],
+        mX2 = this._p[2];
+      for (var i = 0; i < kSplineTableSize; ++i) {
+        this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+      }
+    },
 
-        /**
+    /**
          * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
          */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
+    _getTForX: function (aX) {
+      var mX1 = this._p[0],
+        mX2 = this._p[2],
+        mSampleValues = this._mSampleValues;
 
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
+      var intervalStart = 0.0;
+      var currentSample = 1;
+      var lastSample = kSplineTableSize - 1;
 
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
+      for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
+        intervalStart += kSampleStepSize;
+      }
+      --currentSample;
 
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
+      // Interpolate to provide an initial guess for t
+      var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
+      var guessForT = intervalStart + dist * kSampleStepSize;
 
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
+      var initialSlope = getSlope(guessForT, mX1, mX2);
+      if (initialSlope >= NEWTON_MIN_SLOPE) {
+        return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+      } if (initialSlope === 0.0) {
+        return guessForT;
+      }
+      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+    },
+  };
 
-    return ob;
-
+  return ob;
 }());
+
 (function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
+  var lastTime = 0;
+  var vendors = ['ms', 'moz', 'webkit', 'o'];
+  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { // eslint-disable-line no-plusplus
+    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
+    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
+  }
+  if (!window.requestAnimationFrame) {
+    window.requestAnimationFrame = function (callback) {
+      var currTime = new Date().getTime();
+      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+      var id = setTimeout(function () {
+        callback(currTime + timeToCall);
+      },
+      timeToCall);
+      lastTime = currTime + timeToCall;
+      return id;
+    };
+  }
+  if (!window.cancelAnimationFrame) {
+    window.cancelAnimationFrame = function (id) {
+      clearTimeout(id);
+    };
+  }
 }());
 
-function extendPrototype(sources,destination){
-    var i, len = sources.length, sourcePrototype;
-    for (i = 0;i < len;i += 1) {
-        sourcePrototype = sources[i].prototype;
-        for (var attr in sourcePrototype) {
-            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
-        }
+/* exported extendPrototype, getDescriptor, createProxyFunction */
+
+function extendPrototype(sources, destination) {
+  var i;
+  var len = sources.length;
+  var sourcePrototype;
+  for (i = 0; i < len; i += 1) {
+    sourcePrototype = sources[i].prototype;
+    for (var attr in sourcePrototype) {
+      if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
     }
+  }
 }
 
 function getDescriptor(object, prop) {
-    return Object.getOwnPropertyDescriptor(object, prop);
+  return Object.getOwnPropertyDescriptor(object, prop);
 }
 
 function createProxyFunction(prototype) {
-	function ProxyFunction(){}
-	ProxyFunction.prototype = prototype;
-	return ProxyFunction;
+  function ProxyFunction() {}
+  ProxyFunction.prototype = prototype;
+  return ProxyFunction;
 }
-function bezFunction(){
 
-    var easingFunctions = [];
-    var math = Math;
+/* global segmentsLengthPool, defaultCurveSegments, createSizedArray, bmPow, bmSqrt, bmFloor, createTypedArray, bezierLengthPool */
+/* exported bez */
 
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.001 && det1 < 0.001;
+function bezFunction() {
+  var math = Math;
+
+  function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
+    var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1);
+    return det1 > -0.001 && det1 < 0.001;
+  }
+
+  function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
+    if (z1 === 0 && z2 === 0 && z3 === 0) {
+      return pointOnLine2D(x1, y1, x2, y2, x3, y3);
     }
+    var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
+    var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
+    var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
+    var diffDist;
+    if (dist1 > dist2) {
+      if (dist1 > dist3) {
+        diffDist = dist1 - dist2 - dist3;
+      } else {
+        diffDist = dist3 - dist2 - dist1;
+      }
+    } else if (dist3 > dist2) {
+      diffDist = dist3 - dist2 - dist1;
+    } else {
+      diffDist = dist2 - dist1 - dist3;
+    }
+    return diffDist > -0.0001 && diffDist < 0.0001;
+  }
 
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        if(z1 === 0 && z2 === 0 && z3 === 0) {
-            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+  var getBezierLength = (function () {
+    return function (pt1, pt2, pt3, pt4) {
+      var curveSegments = defaultCurveSegments;
+      var k;
+      var i;
+      var len;
+      var ptCoord;
+      var perc;
+      var addedLength = 0;
+      var ptDistance;
+      var point = [];
+      var lastPoint = [];
+      var lengthData = bezierLengthPool.newElement();
+      len = pt3.length;
+      for (k = 0; k < curveSegments; k += 1) {
+        perc = k / (curveSegments - 1);
+        ptDistance = 0;
+        for (i = 0; i < len; i += 1) {
+          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];
+          point[i] = ptCoord;
+          if (lastPoint[i] !== null) {
+            ptDistance += bmPow(point[i] - lastPoint[i], 2);
+          }
+          lastPoint[i] = point[i];
         }
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
+        if (ptDistance) {
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
         }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    var getBezierLength = (function(){
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = bezier_length_pool.newElement();
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.percents[k] = perc;
-                lengthData.lengths[k] = addedLength;
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function getSegmentsLength(shapeData) {
-        var segmentsLength = segments_length_pool.newElement();
-        var closed = shapeData.c;
-        var pathV = shapeData.v;
-        var pathO = shapeData.o;
-        var pathI = shapeData.i;
-        var i, len = shapeData._length;
-        var lengths = segmentsLength.lengths;
-        var totalLength = 0;
-        for(i=0;i<len-1;i+=1){
-            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-            totalLength += lengths[i].addedLength;
-        }
-        if(closed && len){
-            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-            totalLength += lengths[i].addedLength;
-        }
-        segmentsLength.totalLength = totalLength;
-        return segmentsLength;
-    }
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (pt1, pt2, pt3, pt4){
-            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
-            if(!storedData[bezierName]){
-                var curveSegments = defaultCurveSegments;
-                var k, i, len;
-                var ptCoord,perc,addedLength = 0;
-                var ptDistance;
-                var point,lastPoint = null;
-                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])){
-                    curveSegments = 2;
-                }
-                var bezierData = new BezierData(curveSegments);
-                len = pt3.length;
-                for (k = 0; k < curveSegments; k += 1) {
-                    point = createSizedArray(len);
-                    perc = k / (curveSegments - 1);
-                    ptDistance = 0;
-                    for (i = 0; i < len; i += 1){
-                        ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                        point[i] = ptCoord;
-                        if(lastPoint !== null){
-                            ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                        }
-                    }
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                    bezierData.points[k] = new PointData(ptDistance, point);
-                    lastPoint = point;
-                }
-                bezierData.segmentLength = addedLength;
-                storedData[bezierName] = bezierData;
-            }
-            return storedData[bezierName];
-        };
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var percents = bezierData.percents;
-        var lengths = bezierData.lengths;
-        var len = percents.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
-            return percents[initPos];
-        }else{
-            var dir = lengths[initPos] > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
-                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    //FIX for TypedArrays that don't store floating point values with enough accuracy
-                    if(initPos === len - 1) {
-                        return percents[initPos];
-                    }
-                    flag = false;
-                }
-            }
-            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
-        }
-    }
-
-    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
-        var t1 = getDistancePerc(percent,bezierData);
-        var u0 = 1;
-        var u1 = 1 - t1;
-        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;
-        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;
-        return [ptX, ptY];
-    }
-
-    function getSegmentArray() {
-
-    }
-
-    var bezier_segment_points = createTypedArray('float32', 8);
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        var u0u0u0 = u0*u0*u0;
-        var t0u0u0_3 = t0*u0*u0*3;
-        var t0t0u0_3 = t0*t0*u0*3;
-        var t0t0t0 = t0*t0*t0;
-        //
-        var u0u0u1 = u0*u0*u1;
-        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
-        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
-        var t0t0t1 = t0*t0*t1;
-        //
-        var u0u1u1 = u0*u1*u1;
-        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
-        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
-        var t0t1t1 = t0*t1*t1;
-        //
-        var u1u1u1 = u1*u1*u1;
-        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
-        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
-        var t1t1t1 = t1*t1*t1;
-        for(i=0;i<len;i+=1){
-            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
-        }
-
-        return bezier_segment_points;
-    }
-
-    return {
-        getSegmentsLength : getSegmentsLength,
-        getNewSegment : getNewSegment,
-        getPointInSegment : getPointInSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
+        lengthData.percents[k] = perc;
+        lengthData.lengths[k] = addedLength;
+      }
+      lengthData.addedLength = addedLength;
+      return lengthData;
     };
+  }());
+
+  function getSegmentsLength(shapeData) {
+    var segmentsLength = segmentsLengthPool.newElement();
+    var closed = shapeData.c;
+    var pathV = shapeData.v;
+    var pathO = shapeData.o;
+    var pathI = shapeData.i;
+    var i;
+    var len = shapeData._length;
+    var lengths = segmentsLength.lengths;
+    var totalLength = 0;
+    for (i = 0; i < len - 1; i += 1) {
+      lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
+      totalLength += lengths[i].addedLength;
+    }
+    if (closed && len) {
+      lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
+      totalLength += lengths[i].addedLength;
+    }
+    segmentsLength.totalLength = totalLength;
+    return segmentsLength;
+  }
+
+  function BezierData(length) {
+    this.segmentLength = 0;
+    this.points = new Array(length);
+  }
+
+  function PointData(partial, point) {
+    this.partialLength = partial;
+    this.point = point;
+  }
+
+  var buildBezierData = (function () {
+    var storedData = {};
+
+    return function (pt1, pt2, pt3, pt4) {
+      var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
+      if (!storedData[bezierName]) {
+        var curveSegments = defaultCurveSegments;
+        var k;
+        var i;
+        var len;
+        var ptCoord;
+        var perc;
+        var addedLength = 0;
+        var ptDistance;
+        var point;
+        var lastPoint = null;
+        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])) {
+          curveSegments = 2;
+        }
+        var bezierData = new BezierData(curveSegments);
+        len = pt3.length;
+        for (k = 0; k < curveSegments; k += 1) {
+          point = createSizedArray(len);
+          perc = k / (curveSegments - 1);
+          ptDistance = 0;
+          for (i = 0; i < len; i += 1) {
+            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];
+            point[i] = ptCoord;
+            if (lastPoint !== null) {
+              ptDistance += bmPow(point[i] - lastPoint[i], 2);
+            }
+          }
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
+          bezierData.points[k] = new PointData(ptDistance, point);
+          lastPoint = point;
+        }
+        bezierData.segmentLength = addedLength;
+        storedData[bezierName] = bezierData;
+      }
+      return storedData[bezierName];
+    };
+  }());
+
+  function getDistancePerc(perc, bezierData) {
+    var percents = bezierData.percents;
+    var lengths = bezierData.lengths;
+    var len = percents.length;
+    var initPos = bmFloor((len - 1) * perc);
+    var lengthPos = perc * bezierData.addedLength;
+    var lPerc = 0;
+    if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
+      return percents[initPos];
+    }
+    var dir = lengths[initPos] > lengthPos ? -1 : 1;
+    var flag = true;
+    while (flag) {
+      if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
+        lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
+        flag = false;
+      } else {
+        initPos += dir;
+      }
+      if (initPos < 0 || initPos >= len - 1) {
+        // FIX for TypedArrays that don't store floating point values with enough accuracy
+        if (initPos === len - 1) {
+          return percents[initPos];
+        }
+        flag = false;
+      }
+    }
+    return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
+  }
+
+  function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+    var t1 = getDistancePerc(percent, bezierData);
+    var u1 = 1 - t1;
+    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;
+    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;
+    return [ptX, ptY];
+  }
+
+  var bezierSegmentPoints = createTypedArray('float32', 8);
+
+  function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
+    if (startPerc < 0) {
+      startPerc = 0;
+    } else if (startPerc > 1) {
+      startPerc = 1;
+    }
+    var t0 = getDistancePerc(startPerc, bezierData);
+    endPerc = endPerc > 1 ? 1 : endPerc;
+    var t1 = getDistancePerc(endPerc, bezierData);
+    var i;
+    var len = pt1.length;
+    var u0 = 1 - t0;
+    var u1 = 1 - t1;
+    var u0u0u0 = u0 * u0 * u0;
+    var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0t0 = t0 * t0 * t0;
+    //
+    var u0u0u1 = u0 * u0 * u1;
+    var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0t1 = t0 * t0 * t1;
+    //
+    var u0u1u1 = u0 * u1 * u1;
+    var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1t1 = t0 * t1 * t1;
+    //
+    var u1u1u1 = u1 * u1 * u1;
+    var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1t1 = t1 * t1 * t1;
+    for (i = 0; i < len; i += 1) {
+      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
+      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
+      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
+      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
+    }
+
+    return bezierSegmentPoints;
+  }
+
+  return {
+    getSegmentsLength: getSegmentsLength,
+    getNewSegment: getNewSegment,
+    getPointInSegment: getPointInSegment,
+    buildBezierData: buildBezierData,
+    pointOnLine2D: pointOnLine2D,
+    pointOnLine3D: pointOnLine3D,
+  };
 }
 
 var bez = bezFunction();
-function dataFunctionManager(){
 
-    //var tCanvasHelper = createTag('canvas').getContext('2d');
+/* exported dataManager */
 
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
+function dataFunctionManager() {
+  // var tCanvasHelper = createTag('canvas').getContext('2d');
+
+  function completeLayers(layers, comps, fontManager) {
+    var layerData;
+    var i;
+    var len = layers.length;
+    var j;
+    var jLen;
+    var k;
+    var kLen;
+    for (i = 0; i < len; i += 1) {
+      layerData = layers[i];
+      if (('ks' in layerData) && !layerData.completed) {
+        layerData.completed = true;
+        if (layerData.tt) {
+          layers[i - 1].td = layerData.tt;
         }
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              convertPathsToAbsoluteValues(maskProps[j].pt.k);
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
+                }
+              }
+            }
+          }
+        }
+        if (layerData.ty === 0) {
+          layerData.layers = findCompLayers(layerData.refId, comps);
+          completeLayers(layerData.layers, comps, fontManager);
+        } else if (layerData.ty === 4) {
+          completeShapes(layerData.shapes);
+        } else if (layerData.ty === 5) {
+          completeText(layerData, fontManager);
+        }
+      }
+    }
+  }
+
+  function findCompLayers(id, comps) {
+    var i = 0;
+    var len = comps.length;
+    while (i < len) {
+      if (comps[i].id === id) {
+        if (!comps[i].layers.__used) {
+          comps[i].layers.__used = true;
+          return comps[i].layers;
+        }
+        return JSON.parse(JSON.stringify(comps[i].layers));
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function completeShapes(arr) {
+    var i;
+    var len = arr.length;
+    var j;
+    var jLen;
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (arr[i].ty === 'sh') {
+        if (arr[i].ks.k.i) {
+          convertPathsToAbsoluteValues(arr[i].ks.k);
+        } else {
+          jLen = arr[i].ks.k.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (arr[i].ks.k[j].s) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
+            }
+            if (arr[i].ks.k[j].e) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
+            }
+          }
+        }
+      } else if (arr[i].ty === 'gr') {
+        completeShapes(arr[i].it);
+      }
+    }
+  }
+
+  function convertPathsToAbsoluteValues(path) {
+    var i;
+    var len = path.i.length;
+    for (i = 0; i < len; i += 1) {
+      path.i[i][0] += path.v[i][0];
+      path.i[i][1] += path.v[i][1];
+      path.o[i][0] += path.v[i][0];
+      path.o[i][1] += path.v[i][1];
+    }
+  }
+
+  function checkVersion(minimum, animVersionString) {
+    var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
+    if (minimum[0] > animVersion[0]) {
+      return true;
+    } if (animVersion[0] > minimum[0]) {
+      return false;
+    }
+    if (minimum[1] > animVersion[1]) {
+      return true;
+    } if (animVersion[1] > minimum[1]) {
+      return false;
+    }
+    if (minimum[2] > animVersion[2]) {
+      return true;
+    } if (animVersion[2] > minimum[2]) {
+      return false;
+    }
+    return null;
+  }
+
+  var checkText = (function () {
+    var minimumVersion = [4, 4, 14];
+
+    function updateTextLayer(textLayer) {
+      var documentData = textLayer.t.d;
+      textLayer.t.d = {
+        k: [
+          {
+            s: documentData,
+            t: 0,
+          },
+        ],
+      };
     }
 
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                if(!comps[i].layers.__used) {
-                    comps[i].layers.__used = true;
-                    return comps[i].layers;
-                }
-                return JSON.parse(JSON.stringify(comps[i].layers));
-            }
-            i += 1;
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 5) {
+          updateTextLayer(layers[i]);
         }
+      }
     }
 
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
             }
+          }
         }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
+      }
+    };
+  }());
+
+  var checkChars = (function () {
+    var minimumVersion = [4, 7, 99];
+    return function (animationData) {
+      if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
+        var i;
+        var len = animationData.chars.length;
+        var j;
+        var jLen;
+        var pathData;
+        var paths;
+        for (i = 0; i < len; i += 1) {
+          if (animationData.chars[i].data && animationData.chars[i].data.shapes) {
+            paths = animationData.chars[i].data.shapes[0].it;
+            jLen = paths.length;
+
+            for (j = 0; j < jLen; j += 1) {
+              pathData = paths[j].ks.k;
+              if (!pathData.__converted) {
+                convertPathsToAbsoluteValues(paths[j].ks.k);
+                pathData.__converted = true;
+              }
+            }
+          }
+        }
+      }
+    };
+  }());
+
+  var checkColors = (function () {
+    var minimumVersion = [4, 1, 9];
+
+    function iterateShapes(shapes) {
+      var i;
+      var len = shapes.length;
+      var j;
+      var jLen;
+      for (i = 0; i < len; i += 1) {
+        if (shapes[i].ty === 'gr') {
+          iterateShapes(shapes[i].it);
+        } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
+          if (shapes[i].c.k && shapes[i].c.k[0].i) {
+            jLen = shapes[i].c.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (shapes[i].c.k[j].s) {
+                shapes[i].c.k[j].s[0] /= 255;
+                shapes[i].c.k[j].s[1] /= 255;
+                shapes[i].c.k[j].s[2] /= 255;
+                shapes[i].c.k[j].s[3] /= 255;
+              }
+              if (shapes[i].c.k[j].e) {
+                shapes[i].c.k[j].e[0] /= 255;
+                shapes[i].c.k[j].e[1] /= 255;
+                shapes[i].c.k[j].e[2] /= 255;
+                shapes[i].c.k[j].e[3] /= 255;
+              }
+            }
+          } else {
+            shapes[i].c.k[0] /= 255;
+            shapes[i].c.k[1] /= 255;
+            shapes[i].c.k[2] /= 255;
+            shapes[i].c.k[3] /= 255;
+          }
+        }
+      }
     }
 
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 4) {
+          iterateShapes(layers[i].shapes);
         }
+      }
     }
 
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
+      }
+    };
+  }());
+
+  var checkShapes = (function () {
+    var minimumVersion = [4, 4, 18];
+
+    function completeClosingShapes(arr) {
+      var i;
+      var len = arr.length;
+      var j;
+      var jLen;
+      for (i = len - 1; i >= 0; i -= 1) {
+        if (arr[i].ty === 'sh') {
+          if (arr[i].ks.k.i) {
+            arr[i].ks.k.c = arr[i].closed;
+          } else {
+            jLen = arr[i].ks.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (arr[i].ks.k[j].s) {
+                arr[i].ks.k[j].s[0].c = arr[i].closed;
+              }
+              if (arr[i].ks.k[j].e) {
+                arr[i].ks.k[j].e[0].c = arr[i].closed;
+              }
+            }
+          }
+        } else if (arr[i].ty === 'gr') {
+          completeClosingShapes(arr[i].it);
         }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
+      }
     }
 
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            };
+    function iterateLayers(layers) {
+      var layerData;
+      var i;
+      var len = layers.length;
+      var j;
+      var jLen;
+      var k;
+      var kLen;
+      for (i = 0; i < len; i += 1) {
+        layerData = layers[i];
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              maskProps[j].pt.k.c = maskProps[j].cl;
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
+                }
+              }
+            }
+          }
         }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
+        if (layerData.ty === 4) {
+          completeClosingShapes(layerData.shapes);
         }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkChars = (function() {
-        var minimumVersion = [4,7,99];
-        return function (animationData){
-            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
-                var i, len = animationData.chars.length, j, jLen, k, kLen;
-                var pathData, paths;
-                for(i = 0; i < len; i += 1) {
-                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
-                        paths = animationData.chars[i].data.shapes[0].it;
-                        jLen = paths.length;
-
-                        for(j = 0; j < jLen; j += 1) {
-                            pathData = paths[j].ks.k;
-                            if(!pathData.__converted) {
-                                convertPathsToAbsoluteValues(paths[j].ks.k);
-                                pathData.__converted = true;
-                            }
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkChars(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
+      }
     }
 
-    function completeText(data, fontManager){
-        if(data.t.a.length === 0 && !('m' in data.t.p)){
-            data.singleShape = true;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
+      }
+    };
+  }());
+
+  function completeData(animationData, fontManager) {
+    if (animationData.__complete) {
+      return;
     }
+    checkColors(animationData);
+    checkText(animationData);
+    checkChars(animationData);
+    checkShapes(animationData);
+    completeLayers(animationData.layers, animationData.assets, fontManager);
+    animationData.__complete = true;
+  }
 
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-    moduleOb.checkColors = checkColors;
-    moduleOb.checkChars = checkChars;
-    moduleOb.checkShapes = checkShapes;
-    moduleOb.completeLayers = completeLayers;
+  function completeText(data) {
+    if (data.t.a.length === 0 && !('m' in data.t.p)) {
+      data.singleShape = true;
+    }
+  }
 
-    return moduleOb;
+  var moduleOb = {};
+  moduleOb.completeData = completeData;
+  moduleOb.checkColors = checkColors;
+  moduleOb.checkChars = checkChars;
+  moduleOb.checkShapes = checkShapes;
+  moduleOb.completeLayers = completeLayers;
+
+  return moduleOb;
 }
 
 var dataManager = dataFunctionManager();
 
-var FontManager = (function(){
+/* exported getFontProperties */
 
-    var maxWaitingTime = 5000;
-    var emptyChar = {
-        w: 0,
-        size:0,
-        shapes:[]
-    };
-    var combinedCharacters = [];
-    //Hindi characters
-    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]);
+function getFontProperties(fontData) {
+  var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
 
-    function trimFontOptions(font) {
-        var familyArray = font.split(',');
-        var i, len = familyArray.length;
-        var enabledFamilies = [];
-        for (i = 0; i < len; i += 1) {
-            if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
-                enabledFamilies.push(familyArray[i]);
-            }
-        }
-        return enabledFamilies.join(',');
+  var fWeight = 'normal'; var
+    fStyle = 'normal';
+  var len = styles.length;
+  var styleName;
+  for (var i = 0; i < len; i += 1) {
+    styleName = styles[i].toLowerCase();
+    switch (styleName) {
+      case 'italic':
+        fStyle = 'italic';
+        break;
+      case 'bold':
+        fWeight = '700';
+        break;
+      case 'black':
+        fWeight = '900';
+        break;
+      case 'medium':
+        fWeight = '500';
+        break;
+      case 'regular':
+      case 'normal':
+        fWeight = '400';
+        break;
+      case 'light':
+      case 'thin':
+        fWeight = '200';
+        break;
+      default:
+        break;
     }
+  }
 
-    function setUpNode(font, family){
-        var parentNode = createTag('span');
-        parentNode.style.fontFamily    = family;
-        var node = createTag('span');
-        // Characters that vary significantly among different fonts
-        node.innerText = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = trimFontOptions(font) + ', ' + family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(this.checkLoadedFontsBinded, 20);
-        }else{
-            setTimeout(this.setIsLoadedBinded, 10);
-
-        }
-    }
-
-    function createHelper(def, fontData){
-        var tHelper = createNS('text');
-        tHelper.style.fontSize = '100px';
-        //tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.setAttribute('font-family', fontData.fFamily);
-        tHelper.setAttribute('font-style', fontData.fStyle);
-        tHelper.setAttribute('font-weight', fontData.fWeight);
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.setAttribute('class', fontData.fClass);
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = createTag('canvas').getContext('2d');
-        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
-        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.isLoaded = true;
-            return;
-        }
-        if(this.chars){
-            this.isLoaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        var _pendingFonts = len;
-        for(i=0; i<len; i+= 1){
-            var shouldLoadFont = true;
-            var loadedSelector;
-            var j;
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-                _pendingFonts -= 1;
-            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
-                loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
-
-                if (loadedSelector.length > 0) {
-                    shouldLoadFont = false;
-                }
-
-                if (shouldLoadFont) {
-                    var s = createTag('style');
-                    s.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    s.setAttribute('f-origin', fontArr[i].origin);
-                    s.setAttribute('f-family', fontArr[i].fFamily);
-                    s.type = "text/css";
-                    s.innerText = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                    defs.appendChild(s);
-                }
-            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
-                loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var l = createTag('link');
-                    l.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    l.setAttribute('f-origin', fontArr[i].origin);
-                    l.type = "text/css";
-                    l.rel = "stylesheet";
-                    l.href = fontArr[i].fPath;
-                    document.body.appendChild(l);
-                }
-            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
-                loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (fontArr[i].fPath === loadedSelector[j].src) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var sc = createTag('link');
-                    sc.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    sc.setAttribute('f-origin', fontArr[i].origin);
-                    sc.setAttribute('rel','stylesheet');
-                    sc.setAttribute('href',fontArr[i].fPath);
-                    defs.appendChild(sc);
-                }
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            fontArr[i].cache = {};
-            this.fonts.push(fontArr[i]);
-        }
-        if (_pendingFonts === 0) {
-            this.isLoaded = true;
-        } else {
-            //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
-            //Adding this timeout seems to fix it
-           setTimeout(this.checkLoadedFonts.bind(this), 100);
-        }
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-        if ((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char)
-            && console
-            && console.warn
-            && !this._warned
-           ) {
-            this._warned = true
-            console.warn('Missing character from exported characters list: ', char, style, font);
-        }
-        return emptyChar;
-    }
-
-    function measureText(char, fontName, size) {
-        var fontData = this.getFontByName(fontName);
-        var index = char.charCodeAt(0);
-        if(!fontData.cache[index + 1]) {
-            var tHelper = fontData.helper;
-            //Canvas version
-            //fontData.cache[index] = tHelper.measureText(char).width / 100;
-            //SVG version
-            //console.log(tHelper.getBBox().width)
-            if (char === ' ') {
-                tHelper.textContent = '|' + char + '|';
-                var doubleSize = tHelper.getComputedTextLength();
-                tHelper.textContent = '||';
-                var singleSize = tHelper.getComputedTextLength();
-                fontData.cache[index + 1] = (doubleSize - singleSize)/100;
-            } else {
-                tHelper.textContent = char;
-                fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
-            }
-        }
-        return fontData.cache[index + 1] * size;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return this.fonts[0];
-    }
-
-    function getCombinedCharacterCodes() {
-        return combinedCharacters;
-    }
-
-    function setIsLoaded() {
-        this.isLoaded = true
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this._warned = false;
-        this.initTime = Date.now();
-        this.setIsLoadedBinded = this.setIsLoaded.bind(this)
-        this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)
-    };
-    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
-    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
-
-    var fontPrototype = {
-        addChars: addChars,
-        addFonts: addFonts,
-        getCharData: getCharData,
-        getFontByName: getFontByName,
-        measureText: measureText,
-        checkLoadedFonts: checkLoadedFonts,
-        setIsLoaded: setIsLoaded,
-    }
-
-    Font.prototype = fontPrototype;
-
-    return Font;
-
-}());
-
-var PropertyFactory = (function(){
-
-    var initFrame = initialDefaultFrame;
-    var math_abs = Math.abs;
-
-    function interpolateValue(frameNum, caching) {
-        var offsetTime = this.offsetTime;
-        var newValue;
-        if (this.propType === 'multidimensional') {
-            newValue = createTypedArray('float32', this.pv.length);
-        }
-        var iterationIndex = caching.lastIndex;
-        var i = iterationIndex;
-        var len = this.keyframes.length - 1, flag = true;
-        var keyData, nextKeyData;
-
-        while (flag) {
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i + 1];
-            if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                iterationIndex = 0;
-                break;
-            }
-            if ((nextKeyData.t - offsetTime) > frameNum){
-                iterationIndex = i;
-                break;
-            }
-            if (i < len - 1){
-                i += 1;
-            } else {
-                iterationIndex = 0;
-                flag = false;
-            }
-        }
-
-        var k, kLen, perc, jLen, j, fnc;
-        var nextKeyTime = nextKeyData.t - offsetTime;
-        var keyTime = keyData.t - offsetTime;
-        var endValue;
-        if (keyData.to) {
-            if (!keyData.bezierData) {
-                keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyTime || frameNum < keyTime) {
-                var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for (k = 0; k < kLen; k += 1) {
-                    newValue[k] = bezierData.points[ind].point[k];
-                }
-                // caching._lastKeyframeIndex = -1;
-            } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
-                } else {
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
-                }
-                perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
-                var distanceInLine = bezierData.segmentLength*perc;
-
-                var segmentPerc;
-                var addedLength =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
-                j =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
-                flag = true;
-                jLen = bezierData.points.length;
-                while (flag) {
-                    addedLength += bezierData.points[j].partialLength;
-                    if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
-                        segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1){
-                        j += 1;
-                    } else {
-                        flag = false;
-                    }
-                }
-                caching._lastPoint = j;
-                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                caching._lastKeyframeIndex = i;
-            }
-        } else {
-            var outX, outY, inX, inY, keyValue;
-            len = keyData.s.length;
-            endValue = nextKeyData.s || keyData.e;
-            if (this.sh && keyData.h !== 1) {
-                if (frameNum >= nextKeyTime) {
-                    newValue[0] = endValue[0];
-                    newValue[1] = endValue[1];
-                    newValue[2] = endValue[2];
-                } else if (frameNum <= keyTime) {
-                    newValue[0] = keyData.s[0];
-                    newValue[1] = keyData.s[1];
-                    newValue[2] = keyData.s[2];
-                } else {
-                    var quatStart = createQuaternion(keyData.s);
-                    var quatEnd = createQuaternion(endValue);
-                    var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
-                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
-                }
-                
-            } else {
-                for(i = 0; i < len; i += 1) {
-                    if (keyData.h !== 1) {
-                        if (frameNum >= nextKeyTime) {
-                            perc = 1;
-                        } else if(frameNum < keyTime) {
-                            perc = 0;
-                        } else {
-                            if(keyData.o.x.constructor === Array) {
-                                if (!keyData.__fnct) {
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
-                                    outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
-                                    inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
-                                    inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct = fnc;
-                                } else {
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
-                        }
-                    }
-
-                    endValue = nextKeyData.s || keyData.e;
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
-
-                    if (this.propType === 'multidimensional') {
-                        newValue[i] = keyValue;
-                    } else {
-                        newValue = keyValue;
-                    }
-                }
-            }
-        }
-        caching.lastIndex = iterationIndex;
-        return newValue;
-    }
-
-    //based on @Toji's https://github.com/toji/gl-matrix/
-    function slerp(a, b, t) {
-        var out = [];
-        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
-        bx = b[0], by = b[1], bz = b[2], bw = b[3]
-
-        var omega, cosom, sinom, scale0, scale1;
-
-        cosom = ax * bx + ay * by + az * bz + aw * bw;
-        if (cosom < 0.0) {
-            cosom = -cosom;
-            bx = -bx;
-            by = -by;
-            bz = -bz;
-            bw = -bw;
-        }
-        if ((1.0 - cosom) > 0.000001) {
-            omega = Math.acos(cosom);
-            sinom = Math.sin(omega);
-            scale0 = Math.sin((1.0 - t) * omega) / sinom;
-            scale1 = Math.sin(t * omega) / sinom;
-        } else {
-            scale0 = 1.0 - t;
-            scale1 = t;
-        }
-        out[0] = scale0 * ax + scale1 * bx;
-        out[1] = scale0 * ay + scale1 * by;
-        out[2] = scale0 * az + scale1 * bz;
-        out[3] = scale0 * aw + scale1 * bw;
-
-        return out;
-    }
-
-    function quaternionToEuler(out, quat) {
-        var qx = quat[0];
-        var qy = quat[1];
-        var qz = quat[2];
-        var qw = quat[3];
-        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
-        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
-        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
-        out[0] = heading/degToRads;
-        out[1] = attitude/degToRads;
-        out[2] = bank/degToRads;
-    }
-
-    function createQuaternion(values) {
-        var heading = values[0] * degToRads;
-        var attitude = values[1] * degToRads;
-        var bank = values[2] * degToRads;
-        var c1 = Math.cos(heading / 2);
-        var c2 = Math.cos(attitude / 2);
-        var c3 = Math.cos(bank / 2);
-        var s1 = Math.sin(heading / 2);
-        var s2 = Math.sin(attitude / 2);
-        var s3 = Math.sin(bank / 2);
-        var w = c1 * c2 * c3 - s1 * s2 * s3;
-        var x = s1 * s2 * c3 + c1 * c2 * s3;
-        var y = s1 * c2 * c3 + c1 * s2 * s3;
-        var z = c1 * s2 * c3 - s1 * c2 * s3;
-
-        return [x,y,z,w];
-    }
-
-    function getValueAtCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
-        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
-            if(this._caching.lastFrame >= frameNum) {
-                this._caching._lastKeyframeIndex = -1;
-                this._caching.lastIndex = 0;
-            }
-
-            var renderResult = this.interpolateValue(frameNum, this._caching);
-            this.pv = renderResult;
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
-    }
-
-    function setVValue(val) {
-        var multipliedValue;
-        if(this.propType === 'unidimensional') {
-            multipliedValue = val * this.mult;
-            if(math_abs(this.v - multipliedValue) > 0.00001) {
-                this.v = multipliedValue;
-                this._mdf = true;
-            }
-        } else {
-            var i = 0, len = this.v.length;
-            while (i < len) {
-                multipliedValue = val[i] * this.mult;
-                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
-                    this.v[i] = multipliedValue;
-                    this._mdf = true;
-                }
-                i += 1;
-            }
-        }
-    }
-
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
-            return;
-        }
-        if(this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = this._isFirstFrame;
-        var multipliedValue;
-        var i, len = this.effectsSequence.length;
-        var finalValue = this.kf ? this.pv : this.data.k;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this._isFirstFrame = false;
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
-    }
-
-    function ValueProperty(elem, data, mult, container){
-        this.propType = 'unidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.effectsSequence = [];
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function MultiDimensionalProperty(elem, data, mult, container) {
-        this.propType = 'multidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        var i, len = data.k.length;
-        this.v = createTypedArray('float32', len);
-        this.pv = createTypedArray('float32', len);
-        var arr = createTypedArray('float32', len);
-        this.vel = createTypedArray('float32', len);
-        for (i = 0; i < len; i += 1) {
-            this.v[i] = data.k[i] * this.mult;
-            this.pv[i] = data.k[i];
-        }
-        this._isFirstFrame = true;
-        this.effectsSequence = [];
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedValueProperty(elem, data, mult, container) {
-        this.propType = 'unidimensional';
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.frameId = -1;
-        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.v = initFrame;
-        this.pv = initFrame;
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult, container){
-        this.propType = 'multidimensional';
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for (i = 0; i < len - 1; i += 1) {
-            if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
-                s = data.k[i].s;
-                e = data.k[i + 1].s;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                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]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
-                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
-                        data.k[i].to = null;
-                        data.k[i].ti = null;
-                    }
-                }
-            }
-        }
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.data = data;
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this._isFirstFrame = true;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.frameId = -1;
-        var arrLen = data.k[0].s.length;
-        this.v = createTypedArray('float32', arrLen);
-        this.pv = createTypedArray('float32', arrLen);
-        for (i = 0; i < arrLen; i += 1) {
-            this.v[i] = initFrame;
-            this.pv[i] = initFrame;
-        }
-        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
-        this.addEffect = addEffect;
-    }
-
-    function getProp(elem,data,type, mult, container) {
-        var p;
-        if(!data.k.length){
-            p = new ValueProperty(elem,data, mult, container);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult, container);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult, container);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
-                    break;
-            }
-        }
-        if(p.effectsSequence.length){
-            container.addDynamicProperty(p);
-        }
-        return p;
-    }
-
-    var ob = {
-        getProp: getProp
-    };
-    return ob;
-}());
-var TransformPropertyFactory = (function() {
-
-    var defaultVector = [0,0]
-
-    function applyToMatrix(mat) {
-        var _mdf = this._mdf;
-        this.iterateDynamicProperties();
-        this._mdf = this._mdf || _mdf;
-        if (this.a) {
-            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-        }
-        if (this.s) {
-            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-        }
-        if (this.sk) {
-            mat.skewFromAxis(-this.sk.v, this.sa.v);
-        }
-        if (this.r) {
-            mat.rotate(-this.r.v);
-        } else {
-            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]);
-        }
-        if (this.data.p.s) {
-            if (this.data.p.z) {
-                mat.translate(this.px.v, this.py.v, -this.pz.v);
-            } else {
-                mat.translate(this.px.v, this.py.v, 0);
-            }
-        } else {
-            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-        }
-    }
-    function processKeys(forceRender){
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        }
-        if(this._isDirty) {
-            this.precalculateMatrix();
-            this._isDirty = false;
-        }
-
-        this.iterateDynamicProperties();
-
-        if (this._mdf || forceRender) {
-            this.v.cloneFromProps(this.pre.props);
-            if (this.appliedTransformations < 1) {
-                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if(this.appliedTransformations < 2) {
-                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.sk && this.appliedTransformations < 3) {
-                this.v.skewFromAxis(-this.sk.v, this.sa.v);
-            }
-            if (this.r && this.appliedTransformations < 4) {
-                this.v.rotate(-this.r.v);
-            } else if (!this.r && this.appliedTransformations < 4){
-                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]);
-            }
-            if (this.autoOriented) {
-                var v1,v2, frameRate = this.elem.globalData.frameRate;
-                if(this.p && this.p.keyframes && this.p.getValueAtTime) {
-                    if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
-                    } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
-                    }
-                } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
-                    v1 = [];
-                    v2 = [];
-                    var px = this.px, py = this.py, frameRate;
-                    if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
-                        v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
-                        v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
-                    } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
-                        v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
-                        v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
-                    } else {
-                        v1 = [px.pv, py.pv];
-                        v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
-                        v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
-                    }
-                } else {
-                    v1 = v2 = defaultVector
-                }
-                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-            }
-            if(this.data.p && this.data.p.s){
-                if(this.data.p.z) {
-                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    this.v.translate(this.px.v, this.py.v, 0);
-                }
-            }else{
-                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-            }
-        }
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function precalculateMatrix() {
-        if(!this.a.k) {
-            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            this.appliedTransformations = 1;
-        } else {
-            return;
-        }
-        if(!this.s.effectsSequence.length) {
-            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            this.appliedTransformations = 2;
-        } else {
-            return;
-        }
-        if(this.sk) {
-            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
-                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
-            this.appliedTransformations = 3;
-            } else {
-                return;
-            }
-        }
-        if (this.r) {
-            if(!this.r.effectsSequence.length) {
-                this.pre.rotate(-this.r.v);
-                this.appliedTransformations = 4;
-            } else {
-                return;
-            }
-        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
-            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]);
-            this.appliedTransformations = 4;
-        }
-    }
-
-    function autoOrient(){
-        //
-        //var prevP = this.getValueAtTime();
-    }
-
-    function addDynamicProperty(prop) {
-        this._addDynamicProperty(prop);
-        this.elem.addDynamicProperty(prop);
-        this._isDirty = true;
-    }
-
-    function TransformProperty(elem,data,container){
-        this.elem = elem;
-        this.frameId = -1;
-        this.propType = 'transform';
-        this.data = data;
-        this.v = new Matrix();
-        //Precalculated matrix with non animated properties
-        this.pre = new Matrix();
-        this.appliedTransformations = 0;
-        this.initDynamicPropertyContainer(container || elem);
-        if(data.p && data.p.s){
-            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
-            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
-            if(data.p.z){
-                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
-            }
-        }else{
-            this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
-        }
-        if(data.rx) {
-            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
-            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
-            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
-            if(data.or.k[0].ti) {
-                var i, len = data.or.k.length;
-                for(i=0;i<len;i+=1) {
-                    data.or.k[i].to = data.or.k[i].ti = null;
-                }
-            }
-            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
-            //sh Indicates it needs to be capped between -180 and 180
-            this.or.sh = true;
-        } else {
-            this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
-        }
-        if(data.sk){
-            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
-            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
-        }
-        this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},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.
-        if(data.o){
-            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
-        } else {
-            this.o = {_mdf:false,v:1};
-        }
-        this._isDirty = true;
-        if(!this.dynamicProperties.length){
-            this.getValue(true);
-        }
-    }
-
-    TransformProperty.prototype = {
-        applyToMatrix: applyToMatrix,
-        getValue: processKeys,
-        precalculateMatrix: precalculateMatrix,
-        autoOrient: autoOrient
-    }
-
-    extendPrototype([DynamicPropertyContainer], TransformProperty);
-    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
-    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
-
-    function getTransformProperty(elem,data,container){
-        return new TransformProperty(elem,data,container);
-    }
-
-    return {
-        getTransformProperty: getTransformProperty
-    };
-
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = createSizedArray(this._maxLength);
-	this.o = createSizedArray(this._maxLength);
-	this.i = createSizedArray(this._maxLength);
+  return {
+    style: fStyle,
+    weight: fontData.fWeight || fWeight,
+  };
 }
 
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	this.setLength(len);
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newElement();
-		this.o[i] = point_pool.newElement();
-		this.i[i] = point_pool.newElement();
-		i += 1;
-	}
-};
+/* global createNS, createTag, getFontProperties */
+/* exported FontManager */
 
-ShapePath.prototype.setLength = function(len) {
-	while(this._maxLength < len) {
-		this.doubleArrayLength();
-	}
-	this._length = len;
-};
+var FontManager = (function () {
+  var maxWaitingTime = 5000;
+  var emptyChar = {
+    w: 0,
+    size: 0,
+    shapes: [],
+  };
+  var combinedCharacters = [];
+  // Hindi characters
+  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]);
 
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(createSizedArray(this._maxLength));
-	this.i = this.i.concat(createSizedArray(this._maxLength));
-	this.o = this.o.concat(createSizedArray(this._maxLength));
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newElement();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-
-ShapePath.prototype.reverse = function() {
-	var newPath = new ShapePath();
-	newPath.setPathData(this.c, this._length);
-	var vertices = this.v, outPoints = this.o, inPoints = this.i;
-	var init = 0;
-	if (this.c) {
-		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
-        init = 1;
-    }
-    var cnt = this._length - 1;
-    var len = this._length;
-
+  function trimFontOptions(font) {
+    var familyArray = font.split(',');
     var i;
-    for (i = init; i < len; i += 1) {
-    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
-        cnt -= 1;
+    var len = familyArray.length;
+    var enabledFamilies = [];
+    for (i = 0; i < len; i += 1) {
+      if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
+        enabledFamilies.push(familyArray[i]);
+      }
     }
-    return newPath;
+    return enabledFamilies.join(',');
+  }
+
+  function setUpNode(font, family) {
+    var parentNode = createTag('span');
+    parentNode.style.fontFamily = family;
+    var node = createTag('span');
+    // Characters that vary significantly among different fonts
+    node.innerText = 'giItT1WQy@!-/#';
+    // Visible - so we can measure it - but not on the screen
+    parentNode.style.position = 'absolute';
+    parentNode.style.left = '-10000px';
+    parentNode.style.top = '-10000px';
+    // Large font size makes even subtle changes obvious
+    parentNode.style.fontSize = '300px';
+    // Reset any font properties
+    parentNode.style.fontVariant = 'normal';
+    parentNode.style.fontStyle = 'normal';
+    parentNode.style.fontWeight = 'normal';
+    parentNode.style.letterSpacing = '0';
+    parentNode.appendChild(node);
+    document.body.appendChild(parentNode);
+
+    // Remember width with no applied web font
+    var width = node.offsetWidth;
+    node.style.fontFamily = trimFontOptions(font) + ', ' + family;
+    return { node: node, w: width, parent: parentNode };
+  }
+
+  function checkLoadedFonts() {
+    var i;
+    var len = this.fonts.length;
+    var node;
+    var w;
+    var loadedCount = len;
+    for (i = 0; i < len; i += 1) {
+      if (this.fonts[i].loaded) {
+        loadedCount -= 1;
+      } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
+        this.fonts[i].loaded = true;
+      } else {
+        node = this.fonts[i].monoCase.node;
+        w = this.fonts[i].monoCase.w;
+        if (node.offsetWidth !== w) {
+          loadedCount -= 1;
+          this.fonts[i].loaded = true;
+        } else {
+          node = this.fonts[i].sansCase.node;
+          w = this.fonts[i].sansCase.w;
+          if (node.offsetWidth !== w) {
+            loadedCount -= 1;
+            this.fonts[i].loaded = true;
+          }
+        }
+        if (this.fonts[i].loaded) {
+          this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
+          this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
+        }
+      }
+    }
+
+    if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
+      setTimeout(this.checkLoadedFontsBinded, 20);
+    } else {
+      setTimeout(this.setIsLoadedBinded, 10);
+    }
+  }
+
+  function createHelper(def, fontData) {
+    var tHelper = createNS('text');
+    tHelper.style.fontSize = '100px';
+    // tHelper.style.fontFamily = fontData.fFamily;
+
+    var fontProps = getFontProperties(fontData);
+    tHelper.setAttribute('font-family', fontData.fFamily);
+    tHelper.setAttribute('font-style', fontProps.style);
+    tHelper.setAttribute('font-weight', fontProps.weight);
+    tHelper.textContent = '1';
+    if (fontData.fClass) {
+      tHelper.style.fontFamily = 'inherit';
+      tHelper.setAttribute('class', fontData.fClass);
+    } else {
+      tHelper.style.fontFamily = fontData.fFamily;
+    }
+    def.appendChild(tHelper);
+    var tCanvasHelper = createTag('canvas').getContext('2d');
+    tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px ' + fontData.fFamily;
+    // tCanvasHelper.font = ' 100px '+ fontData.fFamily;
+    return tHelper;
+  }
+
+  function addFonts(fontData, defs) {
+    if (!fontData) {
+      this.isLoaded = true;
+      return;
+    }
+    if (this.chars) {
+      this.isLoaded = true;
+      this.fonts = fontData.list;
+      return;
+    }
+
+    var fontArr = fontData.list;
+    var i;
+    var len = fontArr.length;
+    var _pendingFonts = len;
+    for (i = 0; i < len; i += 1) {
+      var shouldLoadFont = true;
+      var loadedSelector;
+      var j;
+      fontArr[i].loaded = false;
+      fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
+      fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
+      if (!fontArr[i].fPath) {
+        fontArr[i].loaded = true;
+        _pendingFonts -= 1;
+      } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
+        loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
+
+        if (loadedSelector.length > 0) {
+          shouldLoadFont = false;
+        }
+
+        if (shouldLoadFont) {
+          var s = createTag('style');
+          s.setAttribute('f-forigin', fontArr[i].fOrigin);
+          s.setAttribute('f-origin', fontArr[i].origin);
+          s.setAttribute('f-family', fontArr[i].fFamily);
+          s.type = 'text/css';
+          s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
+          defs.appendChild(s);
+        }
+      } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
+        loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var l = createTag('link');
+          l.setAttribute('f-forigin', fontArr[i].fOrigin);
+          l.setAttribute('f-origin', fontArr[i].origin);
+          l.type = 'text/css';
+          l.rel = 'stylesheet';
+          l.href = fontArr[i].fPath;
+          document.body.appendChild(l);
+        }
+      } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
+        loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (fontArr[i].fPath === loadedSelector[j].src) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var sc = createTag('link');
+          sc.setAttribute('f-forigin', fontArr[i].fOrigin);
+          sc.setAttribute('f-origin', fontArr[i].origin);
+          sc.setAttribute('rel', 'stylesheet');
+          sc.setAttribute('href', fontArr[i].fPath);
+          defs.appendChild(sc);
+        }
+      }
+      fontArr[i].helper = createHelper(defs, fontArr[i]);
+      fontArr[i].cache = {};
+      this.fonts.push(fontArr[i]);
+    }
+    if (_pendingFonts === 0) {
+      this.isLoaded = true;
+    } else {
+      // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
+      // Adding this timeout seems to fix it
+      setTimeout(this.checkLoadedFonts.bind(this), 100);
+    }
+  }
+
+  function addChars(chars) {
+    if (!chars) {
+      return;
+    }
+    if (!this.chars) {
+      this.chars = [];
+    }
+    var i;
+    var len = chars.length;
+    var j;
+    var jLen = this.chars.length;
+    var found;
+    for (i = 0; i < len; i += 1) {
+      j = 0;
+      found = false;
+      while (j < jLen) {
+        if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
+          found = true;
+        }
+        j += 1;
+      }
+      if (!found) {
+        this.chars.push(chars[i]);
+        jLen += 1;
+      }
+    }
+  }
+
+  function getCharData(char, style, font) {
+    var i = 0;
+    var len = this.chars.length;
+    while (i < len) {
+      if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) {
+        return this.chars[i];
+      }
+      i += 1;
+    }
+    if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char)
+            && console
+            && console.warn // eslint-disable-line no-console
+            && !this._warned
+    ) {
+      this._warned = true;
+      console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console
+    }
+    return emptyChar;
+  }
+
+  function measureText(char, fontName, size) {
+    var fontData = this.getFontByName(fontName);
+    var index = char.charCodeAt(0);
+    if (!fontData.cache[index + 1]) {
+      var tHelper = fontData.helper;
+      // Canvas version
+      // fontData.cache[index] = tHelper.measureText(char).width / 100;
+      // SVG version
+      // console.log(tHelper.getBBox().width)
+      if (char === ' ') {
+        tHelper.textContent = '|' + char + '|';
+        var doubleSize = tHelper.getComputedTextLength();
+        tHelper.textContent = '||';
+        var singleSize = tHelper.getComputedTextLength();
+        fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
+      } else {
+        tHelper.textContent = char;
+        fontData.cache[index + 1] = (tHelper.getComputedTextLength()) / 100;
+      }
+    }
+    return fontData.cache[index + 1] * size;
+  }
+
+  function getFontByName(name) {
+    var i = 0;
+    var len = this.fonts.length;
+    while (i < len) {
+      if (this.fonts[i].fName === name) {
+        return this.fonts[i];
+      }
+      i += 1;
+    }
+    return this.fonts[0];
+  }
+
+  function getCombinedCharacterCodes() {
+    return combinedCharacters;
+  }
+
+  function setIsLoaded() {
+    this.isLoaded = true;
+  }
+
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this._warned = false;
+    this.initTime = Date.now();
+    this.setIsLoadedBinded = this.setIsLoaded.bind(this);
+    this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
+  };
+    // TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
+  Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
+  var fontPrototype = {
+    addChars: addChars,
+    addFonts: addFonts,
+    getCharData: getCharData,
+    getFontByName: getFontByName,
+    measureText: measureText,
+    checkLoadedFonts: checkLoadedFonts,
+    setIsLoaded: setIsLoaded,
+  };
+
+  Font.prototype = fontPrototype;
+
+  return Font;
+}());
+
+/* global initialDefaultFrame, BezierFactory, degToRads, bez, createTypedArray */
+/* exported PropertyFactory */
+
+var PropertyFactory = (function () {
+  var initFrame = initialDefaultFrame;
+  var mathAbs = Math.abs;
+
+  function interpolateValue(frameNum, caching) {
+    var offsetTime = this.offsetTime;
+    var newValue;
+    if (this.propType === 'multidimensional') {
+      newValue = createTypedArray('float32', this.pv.length);
+    }
+    var iterationIndex = caching.lastIndex;
+    var i = iterationIndex;
+    var len = this.keyframes.length - 1;
+    var flag = true;
+    var keyData;
+    var nextKeyData;
+
+    while (flag) {
+      keyData = this.keyframes[i];
+      nextKeyData = this.keyframes[i + 1];
+      if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
+        if (keyData.h) {
+          keyData = nextKeyData;
+        }
+        iterationIndex = 0;
+        break;
+      }
+      if ((nextKeyData.t - offsetTime) > frameNum) {
+        iterationIndex = i;
+        break;
+      }
+      if (i < len - 1) {
+        i += 1;
+      } else {
+        iterationIndex = 0;
+        flag = false;
+      }
+    }
+
+    var k;
+    var kLen;
+    var perc;
+    var jLen;
+    var j;
+    var fnc;
+    var nextKeyTime = nextKeyData.t - offsetTime;
+    var keyTime = keyData.t - offsetTime;
+    var endValue;
+    if (keyData.to) {
+      if (!keyData.bezierData) {
+        keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
+      }
+      var bezierData = keyData.bezierData;
+      if (frameNum >= nextKeyTime || frameNum < keyTime) {
+        var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
+        kLen = bezierData.points[ind].point.length;
+        for (k = 0; k < kLen; k += 1) {
+          newValue[k] = bezierData.points[ind].point[k];
+        }
+        // caching._lastKeyframeIndex = -1;
+      } else {
+        if (keyData.__fnct) {
+          fnc = keyData.__fnct;
+        } else {
+          fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
+          keyData.__fnct = fnc;
+        }
+        perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+        var distanceInLine = bezierData.segmentLength * perc;
+
+        var segmentPerc;
+        var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+        j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
+        flag = true;
+        jLen = bezierData.points.length;
+        while (flag) {
+          addedLength += bezierData.points[j].partialLength;
+          if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k];
+            }
+            break;
+          } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
+            segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
+            }
+            break;
+          }
+          if (j < jLen - 1) {
+            j += 1;
+          } else {
+            flag = false;
+          }
+        }
+        caching._lastPoint = j;
+        caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+        caching._lastKeyframeIndex = i;
+      }
+    } else {
+      var outX;
+      var outY;
+      var inX;
+      var inY;
+      var keyValue;
+      len = keyData.s.length;
+      endValue = nextKeyData.s || keyData.e;
+      if (this.sh && keyData.h !== 1) {
+        if (frameNum >= nextKeyTime) {
+          newValue[0] = endValue[0];
+          newValue[1] = endValue[1];
+          newValue[2] = endValue[2];
+        } else if (frameNum <= keyTime) {
+          newValue[0] = keyData.s[0];
+          newValue[1] = keyData.s[1];
+          newValue[2] = keyData.s[2];
+        } else {
+          var quatStart = createQuaternion(keyData.s);
+          var quatEnd = createQuaternion(endValue);
+          var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
+          quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+        }
+      } else {
+        for (i = 0; i < len; i += 1) {
+          if (keyData.h !== 1) {
+            if (frameNum >= nextKeyTime) {
+              perc = 1;
+            } else if (frameNum < keyTime) {
+              perc = 0;
+            } else {
+              if (keyData.o.x.constructor === Array) {
+                if (!keyData.__fnct) {
+                  keyData.__fnct = [];
+                }
+                if (!keyData.__fnct[i]) {
+                  outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+                  outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+                  inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+                  inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
+                  fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                  keyData.__fnct[i] = fnc;
+                } else {
+                  fnc = keyData.__fnct[i];
+                }
+              } else if (!keyData.__fnct) {
+                outX = keyData.o.x;
+                outY = keyData.o.y;
+                inX = keyData.i.x;
+                inY = keyData.i.y;
+                fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                keyData.__fnct = fnc;
+              } else {
+                fnc = keyData.__fnct;
+              }
+              perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+            }
+          }
+
+          endValue = nextKeyData.s || keyData.e;
+          keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
+
+          if (this.propType === 'multidimensional') {
+            newValue[i] = keyValue;
+          } else {
+            newValue = keyValue;
+          }
+        }
+      }
+    }
+    caching.lastIndex = iterationIndex;
+    return newValue;
+  }
+
+  // based on @Toji's https://github.com/toji/gl-matrix/
+  function slerp(a, b, t) {
+    var out = [];
+    var ax = a[0];
+    var ay = a[1];
+    var az = a[2];
+    var aw = a[3];
+    var bx = b[0];
+    var by = b[1];
+    var bz = b[2];
+    var bw = b[3];
+
+    var omega;
+    var cosom;
+    var sinom;
+    var scale0;
+    var scale1;
+
+    cosom = ax * bx + ay * by + az * bz + aw * bw;
+    if (cosom < 0.0) {
+      cosom = -cosom;
+      bx = -bx;
+      by = -by;
+      bz = -bz;
+      bw = -bw;
+    }
+    if ((1.0 - cosom) > 0.000001) {
+      omega = Math.acos(cosom);
+      sinom = Math.sin(omega);
+      scale0 = Math.sin((1.0 - t) * omega) / sinom;
+      scale1 = Math.sin(t * omega) / sinom;
+    } else {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+    out[0] = scale0 * ax + scale1 * bx;
+    out[1] = scale0 * ay + scale1 * by;
+    out[2] = scale0 * az + scale1 * bz;
+    out[3] = scale0 * aw + scale1 * bw;
+
+    return out;
+  }
+
+  function quaternionToEuler(out, quat) {
+    var qx = quat[0];
+    var qy = quat[1];
+    var qz = quat[2];
+    var qw = quat[3];
+    var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
+    var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
+    var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
+    out[0] = heading / degToRads;
+    out[1] = attitude / degToRads;
+    out[2] = bank / degToRads;
+  }
+
+  function createQuaternion(values) {
+    var heading = values[0] * degToRads;
+    var attitude = values[1] * degToRads;
+    var bank = values[2] * degToRads;
+    var c1 = Math.cos(heading / 2);
+    var c2 = Math.cos(attitude / 2);
+    var c3 = Math.cos(bank / 2);
+    var s1 = Math.sin(heading / 2);
+    var s2 = Math.sin(attitude / 2);
+    var s3 = Math.sin(bank / 2);
+    var w = c1 * c2 * c3 - s1 * s2 * s3;
+    var x = s1 * s2 * c3 + c1 * c2 * s3;
+    var y = s1 * c2 * c3 + c1 * s2 * s3;
+    var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+    return [x, y, z, w];
+  }
+
+  function getValueAtCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) {
+      if (this._caching.lastFrame >= frameNum) {
+        this._caching._lastKeyframeIndex = -1;
+        this._caching.lastIndex = 0;
+      }
+
+      var renderResult = this.interpolateValue(frameNum, this._caching);
+      this.pv = renderResult;
+    }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
+
+  function setVValue(val) {
+    var multipliedValue;
+    if (this.propType === 'unidimensional') {
+      multipliedValue = val * this.mult;
+      if (mathAbs(this.v - multipliedValue) > 0.00001) {
+        this.v = multipliedValue;
+        this._mdf = true;
+      }
+    } else {
+      var i = 0;
+      var len = this.v.length;
+      while (i < len) {
+        multipliedValue = val[i] * this.mult;
+        if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
+          this.v[i] = multipliedValue;
+          this._mdf = true;
+        }
+        i += 1;
+      }
+    }
+  }
+
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+      return;
+    }
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
+    }
+    this.lock = true;
+    this._mdf = this._isFirstFrame;
+    var i;
+    var len = this.effectsSequence.length;
+    var finalValue = this.kf ? this.pv : this.data.k;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this._isFirstFrame = false;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
+
+  function ValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this.v = mult ? data.k * mult : data.k;
+    this.pv = data.k;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.vel = 0;
+    this.effectsSequence = [];
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function MultiDimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.frameId = -1;
+    var i;
+    var len = data.k.length;
+    this.v = createTypedArray('float32', len);
+    this.pv = createTypedArray('float32', len);
+    this.vel = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      this.v[i] = data.k[i] * this.mult;
+      this.pv[i] = data.k[i];
+    }
+    this._isFirstFrame = true;
+    this.effectsSequence = [];
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.frameId = -1;
+    this._caching = {
+      lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1,
+    };
+    this.k = true;
+    this.kf = true;
+    this.data = data;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.v = initFrame;
+    this.pv = initFrame;
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedMultidimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    var i;
+    var len = data.k.length;
+    var s;
+    var e;
+    var to;
+    var ti;
+    for (i = 0; i < len - 1; i += 1) {
+      if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
+        s = data.k[i].s;
+        e = data.k[i + 1].s;
+        to = data.k[i].to;
+        ti = data.k[i].ti;
+        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]))) {
+          data.k[i].to = null;
+          data.k[i].ti = null;
+        }
+        if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+          if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+            data.k[i].to = null;
+            data.k[i].ti = null;
+          }
+        }
+      }
+    }
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.data = data;
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.k = true;
+    this.kf = true;
+    this._isFirstFrame = true;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.frameId = -1;
+    var arrLen = data.k[0].s.length;
+    this.v = createTypedArray('float32', arrLen);
+    this.pv = createTypedArray('float32', arrLen);
+    for (i = 0; i < arrLen; i += 1) {
+      this.v[i] = initFrame;
+      this.pv[i] = initFrame;
+    }
+    this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) };
+    this.addEffect = addEffect;
+  }
+
+  function getProp(elem, data, type, mult, container) {
+    var p;
+    if (!data.k.length) {
+      p = new ValueProperty(elem, data, mult, container);
+    } else if (typeof (data.k[0]) === 'number') {
+      p = new MultiDimensionalProperty(elem, data, mult, container);
+    } else {
+      switch (type) {
+        case 0:
+          p = new KeyframedValueProperty(elem, data, mult, container);
+          break;
+        case 1:
+          p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
+          break;
+        default:
+          break;
+      }
+    }
+    if (p.effectsSequence.length) {
+      container.addDynamicProperty(p);
+    }
+    return p;
+  }
+
+  var ob = {
+    getProp: getProp,
+  };
+  return ob;
+}());
+
+/* global Matrix, degToRads, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+/* exported TransformPropertyFactory */
+
+var TransformPropertyFactory = (function () {
+  var defaultVector = [0, 0];
+
+  function applyToMatrix(mat) {
+    var _mdf = this._mdf;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || _mdf;
+    if (this.a) {
+      mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+    }
+    if (this.s) {
+      mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+    }
+    if (this.sk) {
+      mat.skewFromAxis(-this.sk.v, this.sa.v);
+    }
+    if (this.r) {
+      mat.rotate(-this.r.v);
+    } else {
+      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]);
+    }
+    if (this.data.p.s) {
+      if (this.data.p.z) {
+        mat.translate(this.px.v, this.py.v, -this.pz.v);
+      } else {
+        mat.translate(this.px.v, this.py.v, 0);
+      }
+    } else {
+      mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+    }
+  }
+  function processKeys(forceRender) {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    }
+    if (this._isDirty) {
+      this.precalculateMatrix();
+      this._isDirty = false;
+    }
+
+    this.iterateDynamicProperties();
+
+    if (this._mdf || forceRender) {
+      var frameRate;
+      this.v.cloneFromProps(this.pre.props);
+      if (this.appliedTransformations < 1) {
+        this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      }
+      if (this.appliedTransformations < 2) {
+        this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      }
+      if (this.sk && this.appliedTransformations < 3) {
+        this.v.skewFromAxis(-this.sk.v, this.sa.v);
+      }
+      if (this.r && this.appliedTransformations < 4) {
+        this.v.rotate(-this.r.v);
+      } else if (!this.r && this.appliedTransformations < 4) {
+        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]);
+      }
+      if (this.autoOriented) {
+        var v1;
+        var v2;
+        frameRate = this.elem.globalData.frameRate;
+        if (this.p && this.p.keyframes && this.p.getValueAtTime) {
+          if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
+            v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
+          } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
+            v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
+          } else {
+            v1 = this.p.pv;
+            v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
+          }
+        } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
+          v1 = [];
+          v2 = [];
+          var px = this.px;
+          var py = this.py;
+          if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
+            v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
+            v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0);
+          } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0);
+            v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0);
+            v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
+          } else {
+            v1 = [px.pv, py.pv];
+            v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
+            v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
+          }
+        } else {
+          v2 = defaultVector;
+          v1 = v2;
+        }
+        this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+      }
+      if (this.data.p && this.data.p.s) {
+        if (this.data.p.z) {
+          this.v.translate(this.px.v, this.py.v, -this.pz.v);
+        } else {
+          this.v.translate(this.px.v, this.py.v, 0);
+        }
+      } else {
+        this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+      }
+    }
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function precalculateMatrix() {
+    if (!this.a.k) {
+      this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      this.appliedTransformations = 1;
+    } else {
+      return;
+    }
+    if (!this.s.effectsSequence.length) {
+      this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      this.appliedTransformations = 2;
+    } else {
+      return;
+    }
+    if (this.sk) {
+      if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+        this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+        this.appliedTransformations = 3;
+      } else {
+        return;
+      }
+    }
+    if (this.r) {
+      if (!this.r.effectsSequence.length) {
+        this.pre.rotate(-this.r.v);
+        this.appliedTransformations = 4;
+      }
+    } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+      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]);
+      this.appliedTransformations = 4;
+    }
+  }
+
+  function autoOrient() {
+    //
+    // var prevP = this.getValueAtTime();
+  }
+
+  function addDynamicProperty(prop) {
+    this._addDynamicProperty(prop);
+    this.elem.addDynamicProperty(prop);
+    this._isDirty = true;
+  }
+
+  function TransformProperty(elem, data, container) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.propType = 'transform';
+    this.data = data;
+    this.v = new Matrix();
+    // Precalculated matrix with non animated properties
+    this.pre = new Matrix();
+    this.appliedTransformations = 0;
+    this.initDynamicPropertyContainer(container || elem);
+    if (data.p && data.p.s) {
+      this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
+      this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
+      if (data.p.z) {
+        this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
+      }
+    } else {
+      this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this);
+    }
+    if (data.rx) {
+      this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+      this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+      this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+      if (data.or.k[0].ti) {
+        var i;
+        var len = data.or.k.length;
+        for (i = 0; i < len; i += 1) {
+          data.or.k[i].to = null;
+          data.or.k[i].ti = null;
+        }
+      }
+      this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+      // sh Indicates it needs to be capped between -180 and 180
+      this.or.sh = true;
+    } else {
+      this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this);
+    }
+    if (data.sk) {
+      this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+      this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+    }
+    this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 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.
+    if (data.o) {
+      this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
+    } else {
+      this.o = { _mdf: false, v: 1 };
+    }
+    this._isDirty = true;
+    if (!this.dynamicProperties.length) {
+      this.getValue(true);
+    }
+  }
+
+  TransformProperty.prototype = {
+    applyToMatrix: applyToMatrix,
+    getValue: processKeys,
+    precalculateMatrix: precalculateMatrix,
+    autoOrient: autoOrient,
+  };
+
+  extendPrototype([DynamicPropertyContainer], TransformProperty);
+  TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+  TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+  function getTransformProperty(elem, data, container) {
+    return new TransformProperty(elem, data, container);
+  }
+
+  return {
+    getTransformProperty: getTransformProperty,
+  };
+}());
+
+/* global createSizedArray, createSizedArray, pointPool */
+
+function ShapePath() {
+  this.c = false;
+  this._length = 0;
+  this._maxLength = 8;
+  this.v = createSizedArray(this._maxLength);
+  this.o = createSizedArray(this._maxLength);
+  this.i = createSizedArray(this._maxLength);
+}
+
+ShapePath.prototype.setPathData = function (closed, len) {
+  this.c = closed;
+  this.setLength(len);
+  var i = 0;
+  while (i < len) {
+    this.v[i] = pointPool.newElement();
+    this.o[i] = pointPool.newElement();
+    this.i[i] = pointPool.newElement();
+    i += 1;
+  }
 };
-var ShapePropertyFactory = (function(){
 
-    var initFrame = -999999;
+ShapePath.prototype.setLength = function (len) {
+  while (this._maxLength < len) {
+    this.doubleArrayLength();
+  }
+  this._length = len;
+};
 
-    function interpolateShape(frameNum, previousValue, caching) {
-        var iterationIndex = caching.lastIndex;
-        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
-        var kf = this.keyframes;
-        if(frameNum < kf[0].t-this.offsetTime){
-            keyPropS = kf[0].s[0];
-            isHold = true;
-            iterationIndex = 0;
-        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
-            keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
-            /*if(kf[kf.length - 1].s){
+ShapePath.prototype.doubleArrayLength = function () {
+  this.v = this.v.concat(createSizedArray(this._maxLength));
+  this.i = this.i.concat(createSizedArray(this._maxLength));
+  this.o = this.o.concat(createSizedArray(this._maxLength));
+  this._maxLength *= 2;
+};
+
+ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
+  var arr;
+  this._length = Math.max(this._length, pos + 1);
+  if (this._length >= this._maxLength) {
+    this.doubleArrayLength();
+  }
+  switch (type) {
+    case 'v':
+      arr = this.v;
+      break;
+    case 'i':
+      arr = this.i;
+      break;
+    case 'o':
+      arr = this.o;
+      break;
+    default:
+      arr = [];
+      break;
+  }
+  if (!arr[pos] || (arr[pos] && !replace)) {
+    arr[pos] = pointPool.newElement();
+  }
+  arr[pos][0] = x;
+  arr[pos][1] = y;
+};
+
+ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
+  this.setXYAt(vX, vY, 'v', pos, replace);
+  this.setXYAt(oX, oY, 'o', pos, replace);
+  this.setXYAt(iX, iY, 'i', pos, replace);
+};
+
+ShapePath.prototype.reverse = function () {
+  var newPath = new ShapePath();
+  newPath.setPathData(this.c, this._length);
+  var vertices = this.v;
+  var outPoints = this.o;
+  var inPoints = this.i;
+  var init = 0;
+  if (this.c) {
+    newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+    init = 1;
+  }
+  var cnt = this._length - 1;
+  var len = this._length;
+
+  var i;
+  for (i = init; i < len; i += 1) {
+    newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+    cnt -= 1;
+  }
+  return newPath;
+};
+
+/* global extendPrototype, roundCorner, BezierFactory, shapePool, degToRads,
+  shapeCollectionPool, PropertyFactory, bmMin, DynamicPropertyContainer */
+/* exported ShapePropertyFactory */
+
+var ShapePropertyFactory = (function () {
+  var initFrame = -999999;
+
+  function interpolateShape(frameNum, previousValue, caching) {
+    var iterationIndex = caching.lastIndex;
+    var keyPropS;
+    var keyPropE;
+    var isHold;
+    var j;
+    var k;
+    var jLen;
+    var kLen;
+    var perc;
+    var vertexValue;
+    var kf = this.keyframes;
+    if (frameNum < kf[0].t - this.offsetTime) {
+      keyPropS = kf[0].s[0];
+      isHold = true;
+      iterationIndex = 0;
+    } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
+      keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
+      /* if(kf[kf.length - 1].s){
                 keyPropS = kf[kf.length - 1].s[0];
             }else{
                 keyPropS = kf[kf.length - 2].e[0];
-            }*/
-            isHold = true;
-        }else{
-            var i = iterationIndex;
-            var len = kf.length- 1,flag = true,keyData,nextKeyData;
-            while(flag){
-                keyData = kf[i];
-                nextKeyData = kf[i+1];
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-            isHold = keyData.h === 1;
-            iterationIndex = i;
-            if(!isHold){
-                if(frameNum >= nextKeyData.t-this.offsetTime){
-                    perc = 1;
-                }else if(frameNum < keyData.t-this.offsetTime){
-                    perc = 0;
-                }else{
-                    var fnc;
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                }
-                keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
-            }
-            keyPropS = keyData.s[0];
+            } */
+      isHold = true;
+    } else {
+      var i = iterationIndex;
+      var len = kf.length - 1;
+      var flag = true;
+      var keyData;
+      var nextKeyData;
+      while (flag) {
+        keyData = kf[i];
+        nextKeyData = kf[i + 1];
+        if ((nextKeyData.t - this.offsetTime) > frameNum) {
+          break;
         }
-        jLen = previousValue._length;
-        kLen = keyPropS.i[0].length;
-        caching.lastIndex = iterationIndex;
-
-        for(j=0;j<jLen;j+=1){
-            for(k=0;k<kLen;k+=1){
-                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                previousValue.i[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                previousValue.o[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                previousValue.v[j][k] = vertexValue;
-            }
+        if (i < len - 1) {
+          i += 1;
+        } else {
+          flag = false;
         }
+      }
+      isHold = keyData.h === 1;
+      iterationIndex = i;
+      if (!isHold) {
+        if (frameNum >= nextKeyData.t - this.offsetTime) {
+          perc = 1;
+        } else if (frameNum < keyData.t - this.offsetTime) {
+          perc = 0;
+        } else {
+          var fnc;
+          if (keyData.__fnct) {
+            fnc = keyData.__fnct;
+          } else {
+            fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
+            keyData.__fnct = fnc;
+          }
+          perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime)));
+        }
+        keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
+      }
+      keyPropS = keyData.s[0];
     }
+    jLen = previousValue._length;
+    kLen = keyPropS.i[0].length;
+    caching.lastIndex = iterationIndex;
 
-    function interpolateShapeCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
-        var lastFrame = this._caching.lastFrame;
-        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
-            ////
-            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
-            this.interpolateShape(frameNum, this.pv, this._caching);
-            ////
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
+    for (j = 0; j < jLen; j += 1) {
+      for (k = 0; k < kLen; k += 1) {
+        vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
+        previousValue.i[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
+        previousValue.o[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
+        previousValue.v[j][k] = vertexValue;
+      }
     }
+  }
 
-    function resetShape(){
-        this.paths = this.localShapeCollection;
+  function interpolateShapeCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    var lastFrame = this._caching.lastFrame;
+    if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) {
+      /// /
+      this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+      this.interpolateShape(frameNum, this.pv, this._caching);
+      /// /
     }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            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] 
+  function resetShape() {
+    this.paths = this.localShapeCollection;
+  }
+
+  function shapesEqual(shape1, shape2) {
+    if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
+      return false;
+    }
+    var i;
+    var len = shape1._length;
+    for (i = 0; i < len; i += 1) {
+      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]) {
-                return false;
-            }
-        }
-        return true;
+        return false;
+      }
     }
+    return true;
+  }
 
-    function setVValue(newPath) {
-        if(!shapesEqual(this.v, newPath)) {
-            this.v = shape_pool.clone(newPath);
-            this.localShapeCollection.releaseShapes();
-            this.localShapeCollection.addShape(this.v);
-            this._mdf = true;
-            this.paths = this.localShapeCollection;
-        }
+  function setVValue(newPath) {
+    if (!shapesEqual(this.v, newPath)) {
+      this.v = shapePool.clone(newPath);
+      this.localShapeCollection.releaseShapes();
+      this.localShapeCollection.addShape(this.v);
+      this._mdf = true;
+      this.paths = this.localShapeCollection;
     }
+  }
 
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        } else if (!this.effectsSequence.length) {
-            this._mdf = false;
-            return;
-        }
-        if (this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = false;
-        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
-        var i, len = this.effectsSequence.length;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    };
-
-    function ShapeProperty(elem, data, type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.container = elem;
-        this.elem = elem;
-        this.data = data;
-        this.k = false;
-        this.kf = false;
-        this._mdf = false;
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v = shape_pool.clone(pathData);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-        this.effectsSequence = [];
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    } if (!this.effectsSequence.length) {
+      this._mdf = false;
+      return;
     }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
     }
-
-    ShapeProperty.prototype.interpolateShape = interpolateShape;
-    ShapeProperty.prototype.getValue = processEffectsSequence;
-    ShapeProperty.prototype.setVValue = setVValue;
-    ShapeProperty.prototype.addEffect = addEffect;
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.container = elem;
-        this.offsetTime = elem.data.st;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newElement();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-        this._caching = {lastFrame: initFrame, lastIndex: 0};
-        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+    this.lock = true;
+    this._mdf = false;
+    var finalValue;
+    if (this.kf) {
+      finalValue = this.pv;
+    } else if (this.data.ks) {
+      finalValue = this.data.ks.k;
+    } else {
+      finalValue = this.data.pt.k;
     }
-    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
-    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
-    KeyframedShapeProperty.prototype.setVValue = setVValue;
-    KeyframedShapeProperty.prototype.addEffect = addEffect;
+    var i;
+    var len = this.effectsSequence.length;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
 
-    var EllShapeProperty = (function(){
+  function ShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.container = elem;
+    this.elem = elem;
+    this.data = data;
+    this.k = false;
+    this.kf = false;
+    this._mdf = false;
+    var pathData = type === 3 ? data.pt.k : data.ks.k;
+    this.v = shapePool.clone(pathData);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.reset = resetShape;
+    this.effectsSequence = [];
+  }
 
-        var cPoint = roundCorner;
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
 
-        function EllShapeProperty(elem,data) {
-            /*this.v = {
+  ShapeProperty.prototype.interpolateShape = interpolateShape;
+  ShapeProperty.prototype.getValue = processEffectsSequence;
+  ShapeProperty.prototype.setVValue = setVValue;
+  ShapeProperty.prototype.addEffect = addEffect;
+
+  function KeyframedShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.elem = elem;
+    this.container = elem;
+    this.offsetTime = elem.data.st;
+    this.keyframes = type === 3 ? data.pt.k : data.ks.k;
+    this.k = true;
+    this.kf = true;
+    var len = this.keyframes[0].s[0].i.length;
+    this.v = shapePool.newElement();
+    this.v.setPathData(this.keyframes[0].s[0].c, len);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.lastFrame = initFrame;
+    this.reset = resetShape;
+    this._caching = { lastFrame: initFrame, lastIndex: 0 };
+    this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+  }
+  KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+  KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+  KeyframedShapeProperty.prototype.setVValue = setVValue;
+  KeyframedShapeProperty.prototype.addEffect = addEffect;
+
+  var EllShapeProperty = (function () {
+    var cPoint = roundCorner;
+
+    function EllShapePropertyFactory(elem, data) {
+      /* this.v = {
                 v: createSizedArray(4),
                 i: createSizedArray(4),
                 o: createSizedArray(4),
                 c: true
-            };*/
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertEllToPath();
-            }
-        };
+            }; */
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 4);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.paths = this.localShapeCollection;
+      this.localShapeCollection.addShape(this.v);
+      this.d = data.d;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertEllToPath();
+      }
+    }
 
-        EllShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function (){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-
-                if(this._mdf){
-                    this.convertEllToPath();
-                }
-            },
-            convertEllToPath: function() {
-                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-                var _cw = this.d !== 3;
-                var _v = this.v;
-                _v.v[0][0] = p0;
-                _v.v[0][1] = p1 - s1;
-                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.v[1][1] = p1;
-                _v.v[2][0] = p0;
-                _v.v[2][1] = p1 + s1;
-                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.v[3][1] = p1;
-                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.i[0][1] = p1 - s1;
-                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.i[1][1] = p1 - s1 * cPoint;
-                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.i[2][1] = p1 + s1;
-                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.i[3][1] = p1 + s1 * cPoint;
-                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.o[0][1] = p1 - s1;
-                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.o[1][1] = p1 + s1 * cPoint;
-                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.o[2][1] = p1 + s1;
-                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.o[3][1] = p1 - s1 * cPoint;
-            }
+    EllShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
         }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
 
-        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+        if (this._mdf) {
+          this.convertEllToPath();
+        }
+      },
+      convertEllToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var s0 = this.s.v[0] / 2;
+        var s1 = this.s.v[1] / 2;
+        var _cw = this.d !== 3;
+        var _v = this.v;
+        _v.v[0][0] = p0;
+        _v.v[0][1] = p1 - s1;
+        _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.v[1][1] = p1;
+        _v.v[2][0] = p0;
+        _v.v[2][1] = p1 + s1;
+        _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.v[3][1] = p1;
+        _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.i[0][1] = p1 - s1;
+        _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.i[1][1] = p1 - s1 * cPoint;
+        _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.i[2][1] = p1 + s1;
+        _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.i[3][1] = p1 + s1 * cPoint;
+        _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.o[0][1] = p1 - s1;
+        _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.o[1][1] = p1 + s1 * cPoint;
+        _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.o[2][1] = p1 + s1;
+        _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.o[3][1] = p1 - s1 * cPoint;
+      },
+    };
 
-        return EllShapeProperty;
-    }());
+    extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
 
-    var StarShapeProperty = (function() {
+    return EllShapePropertyFactory;
+  }());
 
-        function StarShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
-                this.convertToPath = this.convertStarToPath;
-            } else {
-                this.convertToPath = this.convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertToPath();
-            }
-        };
+  var StarShapeProperty = (function () {
+    function StarShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 0);
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.data = data;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      if (data.sy === 1) {
+        this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
+        this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
+        this.convertToPath = this.convertStarToPath;
+      } else {
+        this.convertToPath = this.convertPolygonToPath;
+      }
+      this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+      this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
+      this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertToPath();
+      }
+    }
 
-        StarShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function() {
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertToPath();
-                }
-            },
-            convertStarToPath: function() {
-                var numPts = Math.floor(this.pt.v)*2;
-                var angle = Math.PI*2/numPts;
-                /*this.v.v.length = numPts;
+    StarShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertToPath();
+        }
+      },
+      convertStarToPath: function () {
+        var numPts = Math.floor(this.pt.v) * 2;
+        var angle = (Math.PI * 2) / numPts;
+        /* this.v.v.length = numPts;
                 this.v.i.length = numPts;
-                this.v.o.length = numPts;*/
-                var longFlag = true;
-                var longRad = this.or.v;
-                var shortRad = this.ir.v;
-                var longRound = this.os.v;
-                var shortRound = this.is.v;
-                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-                currentAng += this.r.v;
-                var dir = this.data.d === 3 ? -1 : 1;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    rad = longFlag ? longRad : shortRad;
-                    roundness = longFlag ? longRound : shortRound;
-                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
+                this.v.o.length = numPts; */
+        var longFlag = true;
+        var longRad = this.or.v;
+        var shortRad = this.ir.v;
+        var longRound = this.os.v;
+        var shortRound = this.is.v;
+        var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2);
+        var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2);
+        var i;
+        var rad;
+        var roundness;
+        var perimSegment;
+        var currentAng = -Math.PI / 2;
+        currentAng += this.r.v;
+        var dir = this.data.d === 3 ? -1 : 1;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          rad = longFlag ? longRad : shortRad;
+          roundness = longFlag ? longRound : shortRound;
+          perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
 
-                    /*this.v.v[i] = [x,y];
+          /* this.v.v[i] = [x,y];
                     this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
                     this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                    this.v._length = numPts;*/
-                    longFlag = !longFlag;
-                    currentAng += angle*dir;
-                }
-            },
-            convertPolygonToPath: function() {
-                var numPts = Math.floor(this.pt.v);
-                var angle = Math.PI*2/numPts;
-                var rad = this.or.v;
-                var roundness = this.os.v;
-                var perimSegment = 2*Math.PI*rad/(numPts*4);
-                var i, currentAng = -Math.PI/ 2;
-                var dir = this.data.d === 3 ? -1 : 1;
-                currentAng += this.r.v;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
-                    currentAng += angle*dir;
-                }
-                this.paths.length = 0;
-                this.paths[0] = this.v;
-            }
-
+                    this.v._length = numPts; */
+          longFlag = !longFlag;
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
-
-        return StarShapeProperty;
-    }());
-
-    var RectShapeProperty = (function() {
-
-         function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertRectToPath();
-            }
-        };
-
-        RectShapeProperty.prototype = {
-            convertRectToPath: function (){
-                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-                var round = bm_min(v0,v1,this.r.v);
-                var cPoint = round*(1-roundCorner);
-                this.v._length = 0;
-
-                if(this.d === 2 || this.d === 1) {
-                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                    }
-                }else{
-                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                    }
-                }
-            },
-            getValue: function(frameNum){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertRectToPath();
-                }
-
-            },
-            reset: resetShape
+      },
+      convertPolygonToPath: function () {
+        var numPts = Math.floor(this.pt.v);
+        var angle = (Math.PI * 2) / numPts;
+        var rad = this.or.v;
+        var roundness = this.os.v;
+        var perimSegment = (2 * Math.PI * rad) / (numPts * 4);
+        var i;
+        var currentAng = -Math.PI * 0.5;
+        var dir = this.data.d === 3 ? -1 : 1;
+        currentAng += this.r.v;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+        this.paths.length = 0;
+        this.paths[0] = this.v;
+      },
 
-        return RectShapeProperty;
-    }());
+    };
+    extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
 
-    function getShapeProp(elem,data,type){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    }
+    return StarShapePropertyFactory;
+  }());
 
-    function getConstructorFunction() {
-        return ShapeProperty;
-    }
-
-    function getKeyframedConstructorFunction() {
-        return KeyframedShapeProperty;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    ob.getConstructorFunction = getConstructorFunction;
-    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data){
-        return new modifiers[nm](elem, data);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if (!this.closed) {
-        // 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.
-        data.sh.container.addDynamicProperty(data.sh);
-        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
-        this.shapes.push(shapeData);
-        this.addShapeToModifier(shapeData);
-        if (this._isAnimated) {
-            data.setAsAnimated();
-        }
-    }
-};
-ShapeModifier.prototype.init = function(elem,data){
-    this.shapes = [];
-    this.elem = elem;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,data);
-    this.frameId = initialDefaultFrame;
-    this.closed = false;
-    this.k = false;
-    if(this.dynamicProperties.length){
+  var RectShapeProperty = (function () {
+    function RectShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.c = true;
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
+      if (this.dynamicProperties.length) {
         this.k = true;
-    }else{
-        this.getValue(true);
+      } else {
+        this.k = false;
+        this.convertRectToPath();
+      }
     }
+
+    RectShapePropertyFactory.prototype = {
+      convertRectToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var v0 = this.s.v[0] / 2;
+        var v1 = this.s.v[1] / 2;
+        var round = bmMin(v0, v1, this.r.v);
+        var cPoint = round * (1 - roundCorner);
+        this.v._length = 0;
+
+        if (this.d === 2 || this.d === 1) {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
+          this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
+          }
+        } else {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
+          }
+        }
+      },
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertRectToPath();
+        }
+      },
+      reset: resetShape,
+    };
+    extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
+
+    return RectShapePropertyFactory;
+  }());
+
+  function getShapeProp(elem, data, type) {
+    var prop;
+    if (type === 3 || type === 4) {
+      var dataProp = type === 3 ? data.pt : data.ks;
+      var keys = dataProp.k;
+      if (keys.length) {
+        prop = new KeyframedShapeProperty(elem, data, type);
+      } else {
+        prop = new ShapeProperty(elem, data, type);
+      }
+    } else if (type === 5) {
+      prop = new RectShapeProperty(elem, data);
+    } else if (type === 6) {
+      prop = new EllShapeProperty(elem, data);
+    } else if (type === 7) {
+      prop = new StarShapeProperty(elem, data);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  }
+
+  function getConstructorFunction() {
+    return ShapeProperty;
+  }
+
+  function getKeyframedConstructorFunction() {
+    return KeyframedShapeProperty;
+  }
+
+  var ob = {};
+  ob.getShapeProp = getShapeProp;
+  ob.getConstructorFunction = getConstructorFunction;
+  ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
+  return ob;
+}());
+
+/* global shapeCollectionPool, initialDefaultFrame, extendPrototype, DynamicPropertyContainer */
+/* exported ShapeModifiers */
+
+var ShapeModifiers = (function () {
+  var ob = {};
+  var modifiers = {};
+  ob.registerModifier = registerModifier;
+  ob.getModifier = getModifier;
+
+  function registerModifier(nm, factory) {
+    if (!modifiers[nm]) {
+      modifiers[nm] = factory;
+    }
+  }
+
+  function getModifier(nm, elem, data) {
+    return new modifiers[nm](elem, data);
+  }
+
+  return ob;
+}());
+
+function ShapeModifier() {}
+ShapeModifier.prototype.initModifierProperties = function () {};
+ShapeModifier.prototype.addShapeToModifier = function () {};
+ShapeModifier.prototype.addShape = function (data) {
+  if (!this.closed) {
+    // 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.
+    data.sh.container.addDynamicProperty(data.sh);
+    var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() };
+    this.shapes.push(shapeData);
+    this.addShapeToModifier(shapeData);
+    if (this._isAnimated) {
+      data.setAsAnimated();
+    }
+  }
 };
-ShapeModifier.prototype.processKeys = function(){
-    if(this.elem.globalData.frameId === this.frameId){
-        return;
-    }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
+ShapeModifier.prototype.init = function (elem, data) {
+  this.shapes = [];
+  this.elem = elem;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, data);
+  this.frameId = initialDefaultFrame;
+  this.closed = false;
+  this.k = false;
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
+};
+ShapeModifier.prototype.processKeys = function () {
+  if (this.elem.globalData.frameId === this.frameId) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 extendPrototype([DynamicPropertyContainer], ShapeModifier);
-function TrimModifier(){
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, segmentsLengthPool, bez, shapePool, ShapeModifiers */
+
+function TrimModifier() {
 }
 extendPrototype([ShapeModifier], TrimModifier);
-TrimModifier.prototype.initModifierProperties = function(elem, data) {
-    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
-    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
-    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
-    this.sValue = 0;
-    this.eValue = 0;
-    this.getValue = this.processKeys;
-    this.m = data.m;
-    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
+TrimModifier.prototype.initModifierProperties = function (elem, data) {
+  this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
+  this.sValue = 0;
+  this.eValue = 0;
+  this.getValue = this.processKeys;
+  this.m = data.m;
+  this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.addShapeToModifier = function(shapeData){
-    shapeData.pathsData = [];
+TrimModifier.prototype.addShapeToModifier = function (shapeData) {
+  shapeData.pathsData = [];
 };
 
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
+TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
+  var segments = [];
+  if (e <= 1) {
+    segments.push({
+      s: s,
+      e: e,
+    });
+  } else if (s >= 1) {
+    segments.push({
+      s: s - 1,
+      e: e - 1,
+    });
+  } else {
+    segments.push({
+      s: s,
+      e: 1,
+    });
+    segments.push({
+      s: 0,
+      e: e - 1,
+    });
+  }
+  var shapeSegments = [];
+  var i;
+  var len = segments.length;
+  var segmentOb;
+  for (i = 0; i < len; i += 1) {
+    segmentOb = segments[i];
+    if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
+      var shapeS;
+      var shapeE;
+      if (segmentOb.s * totalModifierLength <= addedLength) {
+        shapeS = 0;
+      } else {
+        shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
+      }
+      if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
+        shapeE = 1;
+      } else {
+        shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
+      }
+      shapeSegments.push([shapeS, shapeE]);
+    }
+  }
+  if (!shapeSegments.length) {
+    shapeSegments.push([0, 0]);
+  }
+  return shapeSegments;
+};
+
+TrimModifier.prototype.releasePathsData = function (pathsData) {
+  var i;
+  var len = pathsData.length;
+  for (i = 0; i < len; i += 1) {
+    segmentsLengthPool.release(pathsData[i]);
+  }
+  pathsData.length = 0;
+  return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function (_isFirstFrame) {
+  var s;
+  var e;
+  if (this._mdf || _isFirstFrame) {
+    var o = (this.o.v % 360) / 360;
+    if (o < 0) {
+      o += 1;
+    }
+    if (this.s.v > 1) {
+      s = 1 + o;
+    } else if (this.s.v < 0) {
+      s = 0 + o;
+    } else {
+      s = this.s.v + o;
+    }
+    if (this.e.v > 1) {
+      e = 1 + o;
+    } else if (this.e.v < 0) {
+      e = 0 + o;
+    } else {
+      e = this.e.v + o;
+    }
+
+    if (s > e) {
+      var _s = s;
+      s = e;
+      e = _s;
+    }
+    s = Math.round(s * 10000) * 0.0001;
+    e = Math.round(e * 10000) * 0.0001;
+    this.sValue = s;
+    this.eValue = e;
+  } else {
+    s = this.sValue;
+    e = this.eValue;
+  }
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var pathsData;
+  var pathData;
+  var totalShapeLength;
+  var totalModifierLength = 0;
+
+  if (e === s) {
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].localShapeCollection.releaseShapes();
+      this.shapes[i].shape._mdf = true;
+      this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+      if (this._mdf) {
+        this.shapes[i].pathsData.length = 0;
+      }
+    }
+  } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) {
     var segments = [];
-    if (e <= 1) {
-        segments.push({
-            s: s,
-            e: e
-        });
-    } else if (s >= 1) {
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        });
-    } else {
-        segments.push({
-            s: s,
-            e: 1
-        });
-        segments.push({
-            s: 0,
-            e: e - 1
-        });
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
+    var shapeData;
+    var localShapeCollection;
     for (i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
+      shapeData = this.shapes[i];
+      // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+      if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
+        shapeData.shape.paths = shapeData.localShapeCollection;
+      } else {
+        shapePaths = shapeData.shape.paths;
+        jLen = shapePaths._length;
+        totalShapeLength = 0;
+        if (!shapeData.shape._mdf && shapeData.pathsData.length) {
+          totalShapeLength = shapeData.totalShapeLength;
         } else {
-            var shapeS, shapeE;
-            if (segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
+          pathsData = this.releasePathsData(shapeData.pathsData);
+          for (j = 0; j < jLen; j += 1) {
+            pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
+            pathsData.push(pathData);
+            totalShapeLength += pathData.totalLength;
+          }
+          shapeData.totalShapeLength = totalShapeLength;
+          shapeData.pathsData = pathsData;
         }
+
+        totalModifierLength += totalShapeLength;
+        shapeData.shape._mdf = true;
+      }
     }
-    if (!shapeSegments.length) {
-        shapeSegments.push([0, 0]);
-    }
-    return shapeSegments;
-};
-
-TrimModifier.prototype.releasePathsData = function(pathsData) {
-    var i, len = pathsData.length;
-    for (i = 0; i < len; i += 1) {
-        segments_length_pool.release(pathsData[i]);
-    }
-    pathsData.length = 0;
-    return pathsData;
-};
-
-TrimModifier.prototype.processShapes = function(_isFirstFrame) {
-    var s, e;
-    if (this._mdf || _isFirstFrame) {
-        var o = (this.o.v % 360) / 360;
-        if (o < 0) {
-            o += 1;
-        }
-        s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
-        e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
-        if (s === e) {
-
-        }
-        if (s > e) {
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        s = Math.round(s * 10000) * 0.0001;
-        e = Math.round(e * 10000) * 0.0001;
-        this.sValue = s;
-        this.eValue = e;
-    } else {
-        s = this.sValue;
-        e = this.eValue;
-    }
-    var shapePaths;
-    var i, len = this.shapes.length, j, jLen;
-    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
-
-    if (e === s) {
-        for (i = 0; i < len; i += 1) {
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape._mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-            if (this._mdf) {
-                this.shapes[i].pathsData.length = 0;
-            }
-        }
-    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for (i = 0; i < len; i += 1) {
-            shapeData = this.shapes[i];
-            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
-            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = this.releasePathsData(shapeData.pathsData);
-                    for (j = 0; j < jLen; j += 1) {
-                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape._mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0, edges;
-        for (i = len - 1; i >= 0; i -= 1) {
-            shapeData = this.shapes[i];
-            if (shapeData.shape._mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
-                if (this.m === 2 && len > 1) {
-                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]];
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if (shapeE <= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        });
-                    } else if (shapeS >= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    } else {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        });
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        if (segments.length > 1) {
-                            var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
-                            if (lastShapeInCollection.c) {
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if (this._mdf) {
-        for (i = 0; i < len; i += 1) {
-            //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
-            //Don't remove this even if it's losing cached info.
-            this.shapes[i].pathsData.length = 0;
-            this.shapes[i].shape._mdf = true;
-        }
-    }
-};
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for (i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i]);
-    }
-};
-
-TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
-    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
-    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
-    }
-    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
-    shapePath.setXYAt(points[1], points[5], 'o', pos);
-    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(points[0], points[4], 'v', pos);
-    }
-    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
+    var shapeS = s;
+    var shapeE = e;
     var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if (!shapePath) {
-        shapePath = shape_pool.newElement();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
+    var edges;
+    for (i = len - 1; i >= 0; i -= 1) {
+      shapeData = this.shapes[i];
+      if (shapeData.shape._mdf) {
+        localShapeCollection = shapeData.localShapeCollection;
+        localShapeCollection.releaseShapes();
+        // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+        if (this.m === 2 && len > 1) {
+          edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+          addedLength += shapeData.totalShapeLength;
+        } else {
+          edges = [[shapeS, shapeE]];
+        }
+        jLen = edges.length;
+        for (j = 0; j < jLen; j += 1) {
+          shapeS = edges[j][0];
+          shapeE = edges[j][1];
+          segments.length = 0;
+          if (shapeE <= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength * shapeE,
+            });
+          } else if (shapeS >= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * (shapeS - 1),
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          } else {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength,
+            });
+            segments.push({
+              s: 0,
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          }
+          var newShapesData = this.addShapes(shapeData, segments[0]);
+          if (segments[0].s !== segments[0].e) {
+            if (segments.length > 1) {
+              var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
+              if (lastShapeInCollection.c) {
+                var lastShape = newShapesData.pop();
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
+              } else {
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1]);
+              }
+            }
+            this.addPaths(newShapesData, localShapeCollection);
+          }
+        }
+        shapeData.shape.paths = localShapeCollection;
+      }
     }
-    shapes.push(shapePath);
+  } else if (this._mdf) {
     for (i = 0; i < len; i += 1) {
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for (j = 1; j < jLen; j +=1) {
-            currentLengthData = lengths[j-1];
-            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e) {
-                shapePath.c = false;
-                break;
-            } else {
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if (shapePaths[i].c && lengths.length) {
-            currentLengthData = lengths[j - 1];
-            if (addedLength <= shapeSegment.e) {
-                var segmentLength = lengths[j - 1].addedLength;
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if (shapePath._length) {
-            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
-        }
-        if (addedLength > shapeSegment.e) {
-            break;
-        }
-        if (i < len - 1) {
-            shapePath = shape_pool.newElement();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
+      // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
+      // Don't remove this even if it's losing cached info.
+      this.shapes[i].pathsData.length = 0;
+      this.shapes[i].shape._mdf = true;
     }
-    return shapes;
+  }
 };
 
+TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
+  var i;
+  var len = newPaths.length;
+  for (i = 0; i < len; i += 1) {
+    localShapeCollection.addShape(newPaths[i]);
+  }
+};
+
+TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+  shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+  shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
+  }
+  shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
+  shapePath.setXYAt(points[1], points[5], 'o', pos);
+  shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(points[0], points[4], 'v', pos);
+  }
+  shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
+  var pathsData = shapeData.pathsData;
+  var shapePaths = shapeData.shape.paths.shapes;
+  var i;
+  var len = shapeData.shape.paths._length;
+  var j;
+  var jLen;
+  var addedLength = 0;
+  var currentLengthData;
+  var segmentCount;
+  var lengths;
+  var segment;
+  var shapes = [];
+  var initPos;
+  var newShape = true;
+  if (!shapePath) {
+    shapePath = shapePool.newElement();
+    segmentCount = 0;
+    initPos = 0;
+  } else {
+    segmentCount = shapePath._length;
+    initPos = shapePath._length;
+  }
+  shapes.push(shapePath);
+  for (i = 0; i < len; i += 1) {
+    lengths = pathsData[i].lengths;
+    shapePath.c = shapePaths[i].c;
+    jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
+    for (j = 1; j < jLen; j += 1) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
+        addedLength += currentLengthData.addedLength;
+        shapePath.c = false;
+      } else if (addedLength > shapeSegment.e) {
+        shapePath.c = false;
+        break;
+      } else {
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+        addedLength += currentLengthData.addedLength;
+        segmentCount += 1;
+      }
+    }
+    if (shapePaths[i].c && lengths.length) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength <= shapeSegment.e) {
+        var segmentLength = lengths[j - 1].addedLength;
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+      } else {
+        shapePath.c = false;
+      }
+      addedLength += currentLengthData.addedLength;
+      segmentCount += 1;
+    }
+    if (shapePath._length) {
+      shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+      shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
+    }
+    if (addedLength > shapeSegment.e) {
+      break;
+    }
+    if (i < len - 1) {
+      shapePath = shapePool.newElement();
+      newShape = true;
+      shapes.push(shapePath);
+      segmentCount = 0;
+    }
+  }
+  return shapes;
+};
 
 ShapeModifiers.registerModifier('tm', TrimModifier);
-function RoundCornersModifier(){}
-extendPrototype([ShapeModifier],RoundCornersModifier);
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
-    this._isAnimated = !!this.rd.effectsSequence.length;
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, roundCorner, ShapeModifiers */
+
+function RoundCornersModifier() {}
+extendPrototype([ShapeModifier], RoundCornersModifier);
+RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
+  this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-            }
+RoundCornersModifier.prototype.processPath = function (path, round) {
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var i;
+  var len = path._length;
+  var currentV;
+  var currentI;
+  var currentO;
+  var closerV;
+  var distance;
+  var newPosPerc;
+  var index = 0;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < len; i += 1) {
+    currentV = path.v[i];
+    currentO = path.o[i];
+    currentI = path.i[i];
+    if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
+      if ((i === 0 || i === len - 1) && !path.c) {
+        clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
+        /* clonedPath.v[index] = currentV;
+                clonedPath.o[index] = currentO;
+                clonedPath.i[index] = currentI; */
+        index += 1;
+      } else {
+        if (i === 0) {
+          closerV = path.v[len - 1];
         } else {
-            cloned_path.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);
-            index += 1;
+          closerV = path.v[i - 1];
         }
-    }
-    return cloned_path;
-};
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = iX;
+        iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
+        vY = iY;
+        oX = vX - (vX - currentV[0]) * roundCorner;
+        oY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
 
-RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+        if (i === len - 1) {
+          closerV = path.v[0];
+        } else {
+          closerV = path.v[i + 1];
         }
-
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = oX;
+        oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
+        vY = oY;
+        iX = vX - (vX - currentV[0]) * roundCorner;
+        iY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
+      }
+    } else {
+      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);
+      index += 1;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  return clonedPath;
 };
 
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function PuckerAndBloatModifier(){}
-extendPrototype([ShapeModifier],PuckerAndBloatModifier);
-PuckerAndBloatModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.amount = PropertyFactory.getProp(elem,data.a,0,null,this);
-    this._isAnimated = !!this.amount.effectsSequence.length;
-};
+RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var rd = this.rd.v;
 
-PuckerAndBloatModifier.prototype.processPath = function(path, amount){
-    var percent = amount / 100;
-    var centerPoint = [0, 0];
-    var pathLength = path._length, i = 0;
-    for (i = 0; i < pathLength; i += 1) {
-        centerPoint[0] += path.v[i][0];
-        centerPoint[1] += path.v[i][1];
-    }
-    centerPoint[0] /= pathLength;
-    centerPoint[1] /= pathLength;
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var vX, vY, oX, oY, iX, iY;
-    for(i = 0; i < pathLength; i += 1) {
-        vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
-        vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
-        oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
-        oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
-        iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
-        iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
-        cloned_path.setTripleAt(vX, vY, oX, oY, iX, iY, i);
-    }
-    return cloned_path;
-};
-
-PuckerAndBloatModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var amount = this.amount.v;
-
-    if(amount !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+  if (rd !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
         }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
 };
-ShapeModifiers.registerModifier('pb',PuckerAndBloatModifier);
-function RepeaterModifier(){}
+
+ShapeModifiers.registerModifier('rd', RoundCornersModifier);
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, ShapeModifiers */
+
+function PuckerAndBloatModifier() {}
+extendPrototype([ShapeModifier], PuckerAndBloatModifier);
+PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
+  this._isAnimated = !!this.amount.effectsSequence.length;
+};
+
+PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
+  var percent = amount / 100;
+  var centerPoint = [0, 0];
+  var pathLength = path._length;
+  var i = 0;
+  for (i = 0; i < pathLength; i += 1) {
+    centerPoint[0] += path.v[i][0];
+    centerPoint[1] += path.v[i][1];
+  }
+  centerPoint[0] /= pathLength;
+  centerPoint[1] /= pathLength;
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < pathLength; i += 1) {
+    vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
+    vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
+    oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
+    oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
+    iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
+    iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
+    clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
+  }
+  return clonedPath;
+};
+
+PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var amount = this.amount.v;
+
+  if (amount !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
+        }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
+    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
+};
+ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
+
+/* global extendPrototype, ShapeModifier, TransformPropertyFactory, PropertyFactory, Matrix, ShapeModifiers */
+
+function RepeaterModifier() {}
 extendPrototype([ShapeModifier], RepeaterModifier);
 
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
-    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
-    this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
-    this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
-    this.data = data;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this._isAnimated = !!this.dynamicProperties.length;
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
+RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
+  this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
+  this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
+  this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
+  this.data = data;
+  if (!this.dynamicProperties.length) {
+    this.getValue(true);
+  }
+  this._isAnimated = !!this.dynamicProperties.length;
+  this.pMatrix = new Matrix();
+  this.rMatrix = new Matrix();
+  this.sMatrix = new Matrix();
+  this.tMatrix = new Matrix();
+  this.matrix = new Matrix();
 };
 
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
+  var dir = inv ? -1 : 1;
+  var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
+  var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
+  pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
+  rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  rMatrix.rotate(-transform.r.v * dir * perc);
+  rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+  sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
+  sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
 };
 
-RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
-    this.elem = elem;
-    this.arr = arr;
-    this.pos = pos;
-    this.elemsData = elemsData;
-    this._currentCopies = 0;
-    this._elements = [];
-    this._groups = [];
-    this.frameId = -1;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,arr[pos]);
-    var cont = 0;
-    while(pos>0){
-        pos -= 1;
-        //this._elements.unshift(arr.splice(pos,1)[0]);
-        this._elements.unshift(arr[pos]);
-        cont += 1;
-    }
-    if(this.dynamicProperties.length){
-        this.k = true;
-    }else{
-        this.getValue(true);
-    }
+RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
+  this.elem = elem;
+  this.arr = arr;
+  this.pos = pos;
+  this.elemsData = elemsData;
+  this._currentCopies = 0;
+  this._elements = [];
+  this._groups = [];
+  this.frameId = -1;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, arr[pos]);
+  while (pos > 0) {
+    pos -= 1;
+    // this._elements.unshift(arr.splice(pos,1)[0]);
+    this._elements.unshift(arr[pos]);
+  }
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
 };
 
-RepeaterModifier.prototype.resetElements = function(elements){
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._processed = false;
-        if(elements[i].ty === 'gr'){
-            this.resetElements(elements[i].it);
+RepeaterModifier.prototype.resetElements = function (elements) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._processed = false;
+    if (elements[i].ty === 'gr') {
+      this.resetElements(elements[i].it);
+    }
+  }
+};
+
+RepeaterModifier.prototype.cloneElements = function (elements) {
+  var newElements = JSON.parse(JSON.stringify(elements));
+  this.resetElements(newElements);
+  return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._render = renderFlag;
+    if (elements[i].ty === 'gr') {
+      this.changeGroupRender(elements[i].it, renderFlag);
+    }
+  }
+};
+
+RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
+  var items;
+  var itemsTransform;
+  var i;
+  var dir;
+  var cont;
+  if (this._mdf || _isFirstFrame) {
+    var copies = Math.ceil(this.c.v);
+    if (this._groups.length < copies) {
+      while (this._groups.length < copies) {
+        var group = {
+          it: this.cloneElements(this._elements),
+          ty: 'gr',
+        };
+        group.it.push({
+          a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr',
+        });
+
+        this.arr.splice(0, 0, group);
+        this._groups.splice(0, 0, group);
+        this._currentCopies += 1;
+      }
+      this.elem.reloadShapes();
+    }
+    cont = 0;
+    var renderFlag;
+    for (i = 0; i <= this._groups.length - 1; i += 1) {
+      renderFlag = cont < copies;
+      this._groups[i]._render = renderFlag;
+      this.changeGroupRender(this._groups[i].it, renderFlag);
+      cont += 1;
+    }
+
+    this._currentCopies = copies;
+    /// /
+
+    var offset = this.o.v;
+    var offsetModulo = offset % 1;
+    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+    var pProps = this.pMatrix.props;
+    var rProps = this.rMatrix.props;
+    var sProps = this.sMatrix.props;
+    this.pMatrix.reset();
+    this.rMatrix.reset();
+    this.sMatrix.reset();
+    this.tMatrix.reset();
+    this.matrix.reset();
+    var iteration = 0;
+
+    if (offset > 0) {
+      while (iteration < roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+        iteration += 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+        iteration += offsetModulo;
+      }
+    } else if (offset < 0) {
+      while (iteration > roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+        iteration -= 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
+        iteration -= offsetModulo;
+      }
+    }
+    i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+    dir = this.data.m === 1 ? 1 : -1;
+    cont = this._currentCopies;
+    var j;
+    var jLen;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      jLen = itemsTransform.length;
+      items[items.length - 1].transform.mProps._mdf = true;
+      items[items.length - 1].transform.op._mdf = true;
+      items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
+      if (iteration !== 0) {
+        if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
+          this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
         }
-    }
-};
+        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]);
+        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]);
+        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]);
 
-RepeaterModifier.prototype.cloneElements = function(elements){
-    var i, len = elements.length;
-    var newElements = JSON.parse(JSON.stringify(elements));
-    this.resetElements(newElements);
-    return newElements;
-};
-
-RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._render = renderFlag;
-        if(elements[i].ty === 'gr') {
-            this.changeGroupRender(elements[i].it, renderFlag);
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-    }
-};
-
-RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
-    var items, itemsTransform, i, dir, cont;
-    if(this._mdf || _isFirstFrame){
-        var copies = Math.ceil(this.c.v);
-        if(this._groups.length < copies){
-            while(this._groups.length < copies){
-                var group = {
-                    it:this.cloneElements(this._elements),
-                    ty:'gr'
-                };
-                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
-                
-                this.arr.splice(0,0,group);
-                this._groups.splice(0,0,group);
-                this._currentCopies += 1;
-            }
-            this.elem.reloadShapes();
-        }
-        cont = 0;
-        var renderFlag;
-        for(i = 0; i  <= this._groups.length - 1; i += 1){
-            renderFlag = cont < copies;
-            this._groups[i]._render = renderFlag;
-            this.changeGroupRender(this._groups[i].it, renderFlag);
-            cont += 1;
-        }
-        
-        this._currentCopies = copies;
-        ////
-
-        var offset = this.o.v;
-        var offsetModulo = offset%1;
-        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-        var k;
-        var tMat = this.tr.v.props;
-        var pProps = this.pMatrix.props;
-        var rProps = this.rMatrix.props;
-        var sProps = this.sMatrix.props;
-        this.pMatrix.reset();
-        this.rMatrix.reset();
-        this.sMatrix.reset();
-        this.tMatrix.reset();
         this.matrix.reset();
-        var iteration = 0;
-
-        if(offset > 0) {
-            while(iteration<roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                iteration += 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                iteration += offsetModulo;
-            }
-        } else if(offset < 0) {
-            while(iteration>roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                iteration -= 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                iteration -= offsetModulo;
-            }
+      } else {
+        this.matrix.reset();
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
-        dir = this.data.m === 1 ? 1 : -1;
-        cont = this._currentCopies;
-        var j, jLen;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            jLen = itemsTransform.length;
-            items[items.length - 1].transform.mProps._mdf = true;
-            items[items.length - 1].transform.op._mdf = true;
-            items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
-            if(iteration !== 0){
-                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                }
-                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]);
-                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]);
-                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]);
-                
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-                this.matrix.reset();
-            } else {
-                this.matrix.reset();
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-            }
-            iteration += 1;
-            cont -= 1;
-            i += dir;
-        }
-    } else {
-        cont = this._currentCopies;
-        i = 0;
-        dir = 1;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            items[items.length - 1].transform.mProps._mdf = false;
-            items[items.length - 1].transform.op._mdf = false;
-            cont -= 1;
-            i += dir;
-        }
+      }
+      iteration += 1;
+      cont -= 1;
+      i += dir;
     }
+  } else {
+    cont = this._currentCopies;
+    i = 0;
+    dir = 1;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      items[items.length - 1].transform.mProps._mdf = false;
+      items[items.length - 1].transform.op._mdf = false;
+      cont -= 1;
+      i += dir;
+    }
+  }
 };
 
-RepeaterModifier.prototype.addShape = function(){};
+RepeaterModifier.prototype.addShape = function () {};
 
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = createSizedArray(this._maxLength);
+ShapeModifiers.registerModifier('rp', RepeaterModifier);
+
+/* global createSizedArray, shapePool */
+
+function ShapeCollection() {
+  this._length = 0;
+  this._maxLength = 4;
+  this.shapes = createSizedArray(this._maxLength);
 }
 
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
+ShapeCollection.prototype.addShape = function (shapeData) {
+  if (this._length === this._maxLength) {
+    this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
+    this._maxLength *= 2;
+  }
+  this.shapes[this._length] = shapeData;
+  this._length += 1;
 };
 
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
+ShapeCollection.prototype.releaseShapes = function () {
+  var i;
+  for (i = 0; i < this._length; i += 1) {
+    shapePool.release(this.shapes[i]);
+  }
+  this._length = 0;
 };
+
+/* global createSizedArray, createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
 function DashProperty(elem, data, renderer, container) {
-    this.elem = elem;
-    this.frameId = -1;
-    this.dataProps = createSizedArray(data.length);
-    this.renderer = renderer;
-    this.k = false;
-    this.dashStr = '';
-    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
-    this.dashoffset = createTypedArray('float32',  1);
-    this.initDynamicPropertyContainer(container);
-    var i, len = data.length || 0, prop;
-    for(i = 0; i < len; i += 1) {
-        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
-        this.k = prop.k || this.k;
-        this.dataProps[i] = {n:data[i].n,p:prop};
-    }
-    if(!this.k){
-        this.getValue(true);
-    }
-    this._isAnimated = this.k;
+  this.elem = elem;
+  this.frameId = -1;
+  this.dataProps = createSizedArray(data.length);
+  this.renderer = renderer;
+  this.k = false;
+  this.dashStr = '';
+  this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
+  this.dashoffset = createTypedArray('float32', 1);
+  this.initDynamicPropertyContainer(container);
+  var i;
+  var len = data.length || 0;
+  var prop;
+  for (i = 0; i < len; i += 1) {
+    prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
+    this.k = prop.k || this.k;
+    this.dataProps[i] = { n: data[i].n, p: prop };
+  }
+  if (!this.k) {
+    this.getValue(true);
+  }
+  this._isAnimated = this.k;
 }
 
-DashProperty.prototype.getValue = function(forceRender) {
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
+DashProperty.prototype.getValue = function (forceRender) {
+  if (this.elem.globalData.frameId === this.frameId && !forceRender) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
+  this._mdf = this._mdf || forceRender;
+  if (this._mdf) {
+    var i = 0;
+    var len = this.dataProps.length;
+    if (this.renderer === 'svg') {
+      this.dashStr = '';
     }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
-    this._mdf = this._mdf || forceRender;
-    if (this._mdf) {
-        var i = 0, len = this.dataProps.length;
-        if(this.renderer === 'svg') {
-            this.dashStr = '';
+    for (i = 0; i < len; i += 1) {
+      if (this.dataProps[i].n !== 'o') {
+        if (this.renderer === 'svg') {
+          this.dashStr += ' ' + this.dataProps[i].p.v;
+        } else {
+          this.dashArray[i] = this.dataProps[i].p.v;
         }
-        for(i=0;i<len;i+=1){
-            if(this.dataProps[i].n != 'o'){
-                if(this.renderer === 'svg') {
-                    this.dashStr += ' ' + this.dataProps[i].p.v;
-                }else{
-                    this.dashArray[i] = this.dataProps[i].p.v;
-                }
-            }else{
-                this.dashoffset[0] = this.dataProps[i].p.v;
-            }
-        }
+      } else {
+        this.dashoffset[0] = this.dataProps[i].p.v;
+      }
     }
+  }
 };
 extendPrototype([DynamicPropertyContainer], DashProperty);
-function GradientProperty(elem,data,container){
-    this.data = data;
-    this.c = createTypedArray('uint8c', data.p*4);
-    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-    this.o = createTypedArray('float32', cLength);
-    this._cmdf = false;
-    this._omdf = false;
-    this._collapsable = this.checkCollapsable();
-    this._hasOpacity = cLength;
-    this.initDynamicPropertyContainer(container);
-    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
-    this.k = this.prop.k;
-    this.getValue(true);
+
+/* global createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+function GradientProperty(elem, data, container) {
+  this.data = data;
+  this.c = createTypedArray('uint8c', data.p * 4);
+  var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;
+  this.o = createTypedArray('float32', cLength);
+  this._cmdf = false;
+  this._omdf = false;
+  this._collapsable = this.checkCollapsable();
+  this._hasOpacity = cLength;
+  this.initDynamicPropertyContainer(container);
+  this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
+  this.k = this.prop.k;
+  this.getValue(true);
 }
 
-GradientProperty.prototype.comparePoints = function(values, points) {
-    var i = 0, len = this.o.length/2, diff;
-    while(i < len) {
-        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
-        if(diff > 0.01){
-            return false;
-        }
-        i += 1;
+GradientProperty.prototype.comparePoints = function (values, points) {
+  var i = 0;
+  var len = this.o.length / 2;
+  var diff;
+  while (i < len) {
+    diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
+    if (diff > 0.01) {
+      return false;
     }
-    return true;
+    i += 1;
+  }
+  return true;
 };
 
-GradientProperty.prototype.checkCollapsable = function() {
-    if (this.o.length/2 !== this.c.length/4) {
+GradientProperty.prototype.checkCollapsable = function () {
+  if (this.o.length / 2 !== this.c.length / 4) {
+    return false;
+  }
+  if (this.data.k.k[0].s) {
+    var i = 0;
+    var len = this.data.k.k.length;
+    while (i < len) {
+      if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
         return false;
+      }
+      i += 1;
     }
-    if (this.data.k.k[0].s) {
-        var i = 0, len = this.data.k.k.length;
-        while (i < len) {
-            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
-                return false;
-            }
-            i += 1;
-        }
-    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
-        return false;
-    }
-    return true;
+  } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
+    return false;
+  }
+  return true;
 };
 
-GradientProperty.prototype.getValue = function(forceRender){
-    this.prop.getValue();
-    this._mdf = false;
-    this._cmdf = false;
-    this._omdf = false;
-    if(this.prop._mdf || forceRender){
-        var i, len = this.data.p*4;
-        var mult, val;
-        for(i=0;i<len;i+=1){
-            mult = i%4 === 0 ? 100 : 255;
-            val = Math.round(this.prop.v[i]*mult);
-            if(this.c[i] !== val){
-                this.c[i] = val;
-                this._cmdf = !forceRender;
-            }
-        }
-        if(this.o.length){
-            len = this.prop.v.length;
-            for(i=this.data.p*4;i<len;i+=1){
-                mult = i%2 === 0 ? 100 : 1;
-                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                if(this.o[i-this.data.p*4] !== val){
-                    this.o[i-this.data.p*4] = val;
-                    this._omdf = !forceRender;
-                }
-            }
-        }
-        this._mdf = !forceRender;
+GradientProperty.prototype.getValue = function (forceRender) {
+  this.prop.getValue();
+  this._mdf = false;
+  this._cmdf = false;
+  this._omdf = false;
+  if (this.prop._mdf || forceRender) {
+    var i;
+    var len = this.data.p * 4;
+    var mult;
+    var val;
+    for (i = 0; i < len; i += 1) {
+      mult = i % 4 === 0 ? 100 : 255;
+      val = Math.round(this.prop.v[i] * mult);
+      if (this.c[i] !== val) {
+        this.c[i] = val;
+        this._cmdf = !forceRender;
+      }
     }
+    if (this.o.length) {
+      len = this.prop.v.length;
+      for (i = this.data.p * 4; i < len; i += 1) {
+        mult = i % 2 === 0 ? 100 : 1;
+        val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
+        if (this.o[i - this.data.p * 4] !== val) {
+          this.o[i - this.data.p * 4] = val;
+          this._omdf = !forceRender;
+        }
+      }
+    }
+    this._mdf = !forceRender;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], GradientProperty);
-var buildShapeString = function(pathNodes, length, closed, mat) {
-	if(length === 0) {
-            return '';
-        }
-        var _o = pathNodes.o;
-        var _i = pathNodes.i;
-        var _v = pathNodes.v;
-        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
-        for(i = 1; i < length; i += 1) {
-            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]);
-        }
-        if (closed && length) {
-            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]);
-            shapeString += 'z';
-        }
-        return shapeString;
-}
-var audioControllerFactory = (function() {
 
-	function AudioController(audioFactory) {
-		this.audios = [];
-		this.audioFactory = audioFactory;
-		this._volume = 1;
-		this._isMuted = false;
-	}
+/* exported buildShapeString */
 
-	AudioController.prototype = {
-		addAudio: function(audio) {
-			this.audios.push(audio);
-		},
-		pause: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].pause()
-			}
-		},
-		resume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].resume()
-			}
-		},
-		setRate: function(rateValue) {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].setRate(rateValue)
-			}
-		},
-		createAudio: function(assetPath) {
-			if (this.audioFactory) {
-				return this.audioFactory(assetPath);
-			} else if (Howl) {
-				return new Howl({
-					src: [assetPath]
-				})
-			} else {
-				return {
-					isPlaying: false,
-					play: function(){this.isPlaying = true},
-					seek: function(){this.isPlaying = false},
-					playing: function(){},
-					rate: function(){},
-					setVolume: function(){},
-				}
-			}
-		},
-		setAudioFactory: function(audioFactory) {
-			this.audioFactory = audioFactory;
-		},
-		setVolume: function(value) {
-			this._volume = value;
-			this._updateVolume();
-		},
-		mute: function() {
-			this._isMuted = true;
-			this._updateVolume();
-		},
-		unmute: function() {
-			this._isMuted = false;
-			this._updateVolume();
-		},
-		getVolume: function(value) {
-			return this._volume;
-		},
-		_updateVolume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1))
-			}
-		}
-	}
-
-	return function() {
-		return new AudioController()
-	}
-
-}())
-var ImagePreloader = (function(){
-
-    var proxyImage = (function(){
-        var canvas = createTag('canvas');
-        canvas.width = 1;
-        canvas.height = 1;
-        var ctx = canvas.getContext('2d');
-        ctx.fillStyle = 'rgba(0,0,0,0)';
-        ctx.fillRect(0, 0, 1, 1);
-        return canvas;
-    }())
-
-    function imageLoaded(){
-        this.loadedAssets += 1;
-        if(this.loadedAssets === this.totalImages){
-            if(this.imagesLoadedCb) {
-                this.imagesLoadedCb(null);
-            }
-        }
-    }
-
-    function getAssetsPath(assetData, assetsPath, original_path) {
-        var path = '';
-        if (assetData.e) {
-            path = assetData.p;
-        } else if(assetsPath) {
-            var imagePath = assetData.p;
-            if (imagePath.indexOf('images/') !== -1) {
-                imagePath = imagePath.split('/')[1];
-            }
-            path = assetsPath + imagePath;
-        } else {
-            path = original_path;
-            path += assetData.u ? assetData.u : '';
-            path += assetData.p;
-        }
-        return path;
-    }
-
-    function testImageLoaded(img) {
-        var _count = 0;
-        var intervalId = setInterval(function() {
-            var box = img.getBBox();
-            if (box.width || _count > 500) {
-                this._imageLoaded();
-                clearInterval(intervalId);
-            }
-            _count += 1;
-        }.bind(this), 50)
-    }
-
-    function createImageData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createNS('image');
-        if (isSafari) {
-            this.testImageLoaded(img)
-        } else {
-            img.addEventListener('load', this._imageLoaded, false);
-        }
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.setAttributeNS('http://www.w3.org/1999/xlink','href', path);
-        this._elementHelper.append(img);
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function createImgData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createTag('img');
-        img.crossOrigin = 'anonymous';
-        img.addEventListener('load', this._imageLoaded, false);
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.src = path;
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function loadAssets(assets, cb){
-        this.imagesLoadedCb = cb;
-        var i, len = assets.length;
-        for (i = 0; i < len; i += 1) {
-            if(!assets[i].layers){
-                this.totalImages += 1;
-                this.images.push(this._createImageData(assets[i]));
-            }
-        }
-    }
-
-    function setPath(path){
-        this.path = path || '';
-    }
-
-    function setAssetsPath(path){
-        this.assetsPath = path || '';
-    }
-
-    function getImage(assetData) {
-        var i = 0, len = this.images.length;
-        while (i < len) {
-            if (this.images[i].assetData === assetData) {
-                return this.images[i].img;
-            }
-            i += 1;
-        }
-    }
-
-    function destroy() {
-        this.imagesLoadedCb = null;
-        this.images.length = 0;
-    }
-
-    function loaded() {
-        return this.totalImages === this.loadedAssets;
-    }
-
-    function setCacheType(type, elementHelper) {
-        if (type === 'svg') {
-            this._elementHelper = elementHelper;
-            this._createImageData = this.createImageData.bind(this);
-        } else {
-            this._createImageData = this.createImgData.bind(this);
-        }
-    }
-
-    function ImagePreloader(type){
-        this._imageLoaded = imageLoaded.bind(this);
-        this.testImageLoaded = testImageLoaded.bind(this);
-        this.assetsPath = '';
-        this.path = '';
-        this.totalImages = 0;
-        this.loadedAssets = 0;
-        this.imagesLoadedCb = null;
-        this.images = [];
-    };
-
-    ImagePreloader.prototype = {
-        loadAssets: loadAssets,
-        setAssetsPath: setAssetsPath,
-        setPath: setPath,
-        loaded: loaded,
-        destroy: destroy,
-        getImage: getImage,
-        createImgData: createImgData,
-        createImageData: createImageData,
-        imageLoaded: imageLoaded,
-        setCacheType: setCacheType,
-    }
-
-    return ImagePreloader;
-}());
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	};
-	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)) {
-	   ob.maskType = false;
-	}
-	return ob;
-}());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
-
-	function createFilter(filId){
-        	var fil = createNS('filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
-
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = createNS('feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
-                return feColorMatrix;
-	}
-
-	return ob;
-}());
-var assetLoader = (function(){
-
-	function formatResponse(xhr) {
-		if(xhr.response && typeof xhr.response === 'object') {
-			return xhr.response;
-		} else if(xhr.response && typeof xhr.response === 'string') {
-			return JSON.parse(xhr.response);
-		} else if(xhr.responseText) {
-			return JSON.parse(xhr.responseText);
-		}
-	}
-
-	function loadAsset(path, callback, errorCallback) {
-		var response;
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', path, true);
-		// set responseType after calling open or IE will break.
-		try {
-		    // This crashes on Android WebView prior to KitKat
-		    xhr.responseType = "json";
-		} catch (err) {}
-	    xhr.send();
-	    xhr.onreadystatechange = function () {
-	        if (xhr.readyState == 4) {
-	            if(xhr.status == 200){
-	            	response = formatResponse(xhr);
-	            	callback(response);
-	            }else{
-	                try{
-	            		response = formatResponse(xhr);
-	            		callback(response);
-	                }catch(err){
-	                	if(errorCallback) {
-	                		errorCallback(err);
-	                	}
-	                }
-	            }
-	        }
-	    };
-	}
-	return {
-		load: loadAsset
-	}
-}())
-
-function TextAnimatorProperty(textData, renderType, elem){
-    this._isFirstFrame = true;
-	this._hasMaskedPath = false;
-	this._frameId = -1;
-	this._textData = textData;
-	this._renderType = renderType;
-    this._elem = elem;
-	this._animatorsData = createSizedArray(this._textData.a.length);
-	this._pathData = {};
-	this._moreOptions = {
-		alignment: {}
-	};
-	this.renderedLetters = [];
-    this.lettersChangedFlag = false;
-    this.initDynamicPropertyContainer(elem);
-
-}
-
-TextAnimatorProperty.prototype.searchProperties = function(){
-    var i, len = this._textData.a.length, animatorProps;
-    var getProp = PropertyFactory.getProp;
-    for(i=0;i<len;i+=1){
-        animatorProps = this._textData.a[i];
-        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
-    }
-    if(this._textData.p && 'm' in this._textData.p){
-        this._pathData = {
-            f: getProp(this._elem,this._textData.p.f,0,0,this),
-            l: getProp(this._elem,this._textData.p.l,0,0,this),
-            r: this._textData.p.r,
-            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
-        };
-        this._hasMaskedPath = true;
-    } else {
-        this._hasMaskedPath = false;
-    }
-    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+var buildShapeString = function (pathNodes, length, closed, mat) {
+  if (length === 0) {
+    return '';
+  }
+  var _o = pathNodes.o;
+  var _i = pathNodes.i;
+  var _v = pathNodes.v;
+  var i;
+  var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+  for (i = 1; i < length; i += 1) {
+    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]);
+  }
+  if (closed && length) {
+    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]);
+    shapeString += 'z';
+  }
+  return shapeString;
 };
 
-TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
-    this.lettersChangedFlag = lettersChangedFlag;
-    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
-        return;
+/* global Howl */
+/* exported audioControllerFactory */
+
+var audioControllerFactory = (function () {
+  function AudioController(audioFactory) {
+    this.audios = [];
+    this.audioFactory = audioFactory;
+    this._volume = 1;
+    this._isMuted = false;
+  }
+
+  AudioController.prototype = {
+    addAudio: function (audio) {
+      this.audios.push(audio);
+    },
+    pause: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].pause();
+      }
+    },
+    resume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].resume();
+      }
+    },
+    setRate: function (rateValue) {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].setRate(rateValue);
+      }
+    },
+    createAudio: function (assetPath) {
+      if (this.audioFactory) {
+        return this.audioFactory(assetPath);
+      } if (Howl) {
+        return new Howl({
+          src: [assetPath],
+        });
+      }
+      return {
+        isPlaying: false,
+        play: function () { this.isPlaying = true; },
+        seek: function () { this.isPlaying = false; },
+        playing: function () {},
+        rate: function () {},
+        setVolume: function () {},
+      };
+    },
+    setAudioFactory: function (audioFactory) {
+      this.audioFactory = audioFactory;
+    },
+    setVolume: function (value) {
+      this._volume = value;
+      this._updateVolume();
+    },
+    mute: function () {
+      this._isMuted = true;
+      this._updateVolume();
+    },
+    unmute: function () {
+      this._isMuted = false;
+      this._updateVolume();
+    },
+    getVolume: function () {
+      return this._volume;
+    },
+    _updateVolume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
+      }
+    },
+  };
+
+  return function () {
+    return new AudioController();
+  };
+}());
+
+/* global createTag, createNS, isSafari */
+/* exported ImagePreloader */
+
+var ImagePreloader = (function () {
+  var proxyImage = (function () {
+    var canvas = createTag('canvas');
+    canvas.width = 1;
+    canvas.height = 1;
+    var ctx = canvas.getContext('2d');
+    ctx.fillStyle = 'rgba(0,0,0,0)';
+    ctx.fillRect(0, 0, 1, 1);
+    return canvas;
+  }());
+
+  function imageLoaded() {
+    this.loadedAssets += 1;
+    if (this.loadedAssets === this.totalImages) {
+      if (this.imagesLoadedCb) {
+        this.imagesLoadedCb(null);
+      }
     }
-    this._isFirstFrame = false;
-    var alignment = this._moreOptions.alignment.v;
-    var animators = this._animatorsData;
-    var textData = this._textData;
-    var matrixHelper = this.mHelper;
-    var renderType = this._renderType;
-    var renderedLettersCount = this.renderedLetters.length;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
-    if(this._hasMaskedPath) {
-        mask = this._pathData.m;
-        if(!this._pathData.n || this._pathData._mdf){
-            var paths = mask.v;
-            if(this._pathData.r){
-                paths = paths.reverse();
-            }
-            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
-            pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths._length - 1;
-            var bezierData;
-            totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            this._pathData.pi = pathInfo;
-        }
-        pathInfo = this._pathData.pi;
+  }
 
-        currentLength = this._pathData.f.v;
-        segmentInd = 0;
-        pointInd = 1;
-        segmentLength = 0;
-        flag = true;
-        segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].points;
-                    pointInd = points.length - 1;
-                }
-            }
+  function getAssetsPath(assetData, assetsPath, originalPath) {
+    var path = '';
+    if (assetData.e) {
+      path = assetData.p;
+    } else if (assetsPath) {
+      var imagePath = assetData.p;
+      if (imagePath.indexOf('images/') !== -1) {
+        imagePath = imagePath.split('/')[1];
+      }
+      path = assetsPath + imagePath;
+    } else {
+      path = originalPath;
+      path += assetData.u ? assetData.u : '';
+      path += assetData.p;
+    }
+    return path;
+  }
 
+  function testImageLoaded(img) {
+    var _count = 0;
+    var intervalId = setInterval(function () {
+      var box = img.getBBox();
+      if (box.width || _count > 500) {
+        this._imageLoaded();
+        clearInterval(intervalId);
+      }
+      _count += 1;
+    }.bind(this), 50);
+  }
+
+  function createImageData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createNS('image');
+    if (isSafari) {
+      this.testImageLoaded(img);
+    } else {
+      img.addEventListener('load', this._imageLoaded, false);
+    }
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
+    this._elementHelper.append(img);
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function createImgData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createTag('img');
+    img.crossOrigin = 'anonymous';
+    img.addEventListener('load', this._imageLoaded, false);
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.src = path;
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function loadAssets(assets, cb) {
+    this.imagesLoadedCb = cb;
+    var i;
+    var len = assets.length;
+    for (i = 0; i < len; i += 1) {
+      if (!assets[i].layers) {
+        this.totalImages += 1;
+        this.images.push(this._createImageData(assets[i]));
+      }
+    }
+  }
+
+  function setPath(path) {
+    this.path = path || '';
+  }
+
+  function setAssetsPath(path) {
+    this.assetsPath = path || '';
+  }
+
+  function getImage(assetData) {
+    var i = 0;
+    var len = this.images.length;
+    while (i < len) {
+      if (this.images[i].assetData === assetData) {
+        return this.images[i].img;
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function destroy() {
+    this.imagesLoadedCb = null;
+    this.images.length = 0;
+  }
+
+  function loaded() {
+    return this.totalImages === this.loadedAssets;
+  }
+
+  function setCacheType(type, elementHelper) {
+    if (type === 'svg') {
+      this._elementHelper = elementHelper;
+      this._createImageData = this.createImageData.bind(this);
+    } else {
+      this._createImageData = this.createImgData.bind(this);
+    }
+  }
+
+  function ImagePreloaderFactory() {
+    this._imageLoaded = imageLoaded.bind(this);
+    this.testImageLoaded = testImageLoaded.bind(this);
+    this.assetsPath = '';
+    this.path = '';
+    this.totalImages = 0;
+    this.loadedAssets = 0;
+    this.imagesLoadedCb = null;
+    this.images = [];
+  }
+
+  ImagePreloaderFactory.prototype = {
+    loadAssets: loadAssets,
+    setAssetsPath: setAssetsPath,
+    setPath: setPath,
+    loaded: loaded,
+    destroy: destroy,
+    getImage: getImage,
+    createImgData: createImgData,
+    createImageData: createImageData,
+    imageLoaded: imageLoaded,
+    setCacheType: setCacheType,
+  };
+
+  return ImagePreloaderFactory;
+}());
+
+/* exported featureSupport */
+
+var featureSupport = (function () {
+  var ob = {
+    maskType: true,
+  };
+  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)) {
+    ob.maskType = false;
+  }
+  return ob;
+}());
+
+/* global createNS */
+/* exported filtersFactory */
+
+var filtersFactory = (function () {
+  var ob = {};
+  ob.createFilter = createFilter;
+  ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
+
+  function createFilter(filId) {
+    var fil = createNS('filter');
+    fil.setAttribute('id', filId);
+    fil.setAttribute('filterUnits', 'objectBoundingBox');
+    fil.setAttribute('x', '0%');
+    fil.setAttribute('y', '0%');
+    fil.setAttribute('width', '100%');
+    fil.setAttribute('height', '100%');
+    return fil;
+  }
+
+  function createAlphaToLuminanceFilter() {
+    var feColorMatrix = createNS('feColorMatrix');
+    feColorMatrix.setAttribute('type', 'matrix');
+    feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+    feColorMatrix.setAttribute('values', '0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
+    return feColorMatrix;
+  }
+
+  return ob;
+}());
+
+/* exported assetLoader */
+
+var assetLoader = (function () {
+  function formatResponse(xhr) {
+    if (xhr.response && typeof xhr.response === 'object') {
+      return xhr.response;
+    } if (xhr.response && typeof xhr.response === 'string') {
+      return JSON.parse(xhr.response);
+    } if (xhr.responseText) {
+      return JSON.parse(xhr.responseText);
+    }
+    return null;
+  }
+
+  function loadAsset(path, callback, errorCallback) {
+    var response;
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', path, true);
+    // set responseType after calling open or IE will break.
+    try {
+      // This crashes on Android WebView prior to KitKat
+      xhr.responseType = 'json';
+    } catch (err) {} // eslint-disable-line no-empty
+    xhr.send();
+    xhr.onreadystatechange = function () {
+      if (xhr.readyState === 4) {
+        if (xhr.status === 200) {
+          response = formatResponse(xhr);
+          callback(response);
+        } else {
+          try {
+            response = formatResponse(xhr);
+            callback(response);
+          } catch (err) {
+            if (errorCallback) {
+              errorCallback(err);
+            }
+          }
         }
+      }
+    };
+  }
+  return {
+    load: loadAsset,
+  };
+}());
+
+/* global createSizedArray, PropertyFactory, TextAnimatorDataProperty, bez, addHueToRGB,
+  addSaturationToRGB, addBrightnessToRGB, LetterProps, Matrix, extendPrototype, DynamicPropertyContainer */
+
+function TextAnimatorProperty(textData, renderType, elem) {
+  this._isFirstFrame = true;
+  this._hasMaskedPath = false;
+  this._frameId = -1;
+  this._textData = textData;
+  this._renderType = renderType;
+  this._elem = elem;
+  this._animatorsData = createSizedArray(this._textData.a.length);
+  this._pathData = {};
+  this._moreOptions = {
+    alignment: {},
+  };
+  this.renderedLetters = [];
+  this.lettersChangedFlag = false;
+  this.initDynamicPropertyContainer(elem);
+}
+
+TextAnimatorProperty.prototype.searchProperties = function () {
+  var i;
+  var len = this._textData.a.length;
+  var animatorProps;
+  var getProp = PropertyFactory.getProp;
+  for (i = 0; i < len; i += 1) {
+    animatorProps = this._textData.a[i];
+    this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+  }
+  if (this._textData.p && 'm' in this._textData.p) {
+    this._pathData = {
+      f: getProp(this._elem, this._textData.p.f, 0, 0, this),
+      l: getProp(this._elem, this._textData.p.l, 0, 0, this),
+      r: this._textData.p.r,
+      m: this._elem.maskManager.getMaskProperty(this._textData.p.m),
+    };
+    this._hasMaskedPath = true;
+  } else {
+    this._hasMaskedPath = false;
+  }
+  this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
+};
+
+TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
+  this.lettersChangedFlag = lettersChangedFlag;
+  if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+    return;
+  }
+  this._isFirstFrame = false;
+  var alignment = this._moreOptions.alignment.v;
+  var animators = this._animatorsData;
+  var textData = this._textData;
+  var matrixHelper = this.mHelper;
+  var renderType = this._renderType;
+  var renderedLettersCount = this.renderedLetters.length;
+  var xPos;
+  var yPos;
+  var i;
+  var len;
+  var letters = documentData.l;
+  var pathInfo;
+  var currentLength;
+  var currentPoint;
+  var segmentLength;
+  var flag;
+  var pointInd;
+  var segmentInd;
+  var prevPoint;
+  var points;
+  var segments;
+  var partialLength;
+  var totalLength;
+  var perc;
+  var tanAngle;
+  var mask;
+  if (this._hasMaskedPath) {
+    mask = this._pathData.m;
+    if (!this._pathData.n || this._pathData._mdf) {
+      var paths = mask.v;
+      if (this._pathData.r) {
+        paths = paths.reverse();
+      }
+      // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+      pathInfo = {
+        tLength: 0,
+        segments: [],
+      };
+      len = paths._length - 1;
+      var bezierData;
+      totalLength = 0;
+      for (i = 0; i < len; i += 1) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      i = len;
+      if (mask.v.c) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      this._pathData.pi = pathInfo;
+    }
+    pathInfo = this._pathData.pi;
+
+    currentLength = this._pathData.f.v;
+    segmentInd = 0;
+    pointInd = 1;
+    segmentLength = 0;
+    flag = true;
+    segments = pathInfo.segments;
+    if (currentLength < 0 && mask.v.c) {
+      if (pathInfo.tLength < Math.abs(currentLength)) {
+        currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+      }
+      segmentInd = segments.length - 1;
+      points = segments[segmentInd].points;
+      pointInd = points.length - 1;
+      while (currentLength < 0) {
+        currentLength += points[pointInd].partialLength;
+        pointInd -= 1;
+        if (pointInd < 0) {
+          segmentInd -= 1;
+          points = segments[segmentInd].points;
+          pointInd = points.length - 1;
+        }
+      }
+    }
+    points = segments[segmentInd].points;
+    prevPoint = points[pointInd - 1];
+    currentPoint = points[pointInd];
+    partialLength = currentPoint.partialLength;
+  }
+
+  len = letters.length;
+  xPos = 0;
+  yPos = 0;
+  var yOff = documentData.finalSize * 1.2 * 0.714;
+  var firstLine = true;
+  var animatorProps;
+  var animatorSelector;
+  var j;
+  var jLen;
+  var letterValue;
+
+  jLen = animators.length;
+
+  var mult;
+  var ind = -1;
+  var offf;
+  var xPathPos;
+  var yPathPos;
+  var initPathPos = currentLength;
+  var initSegmentInd = segmentInd;
+  var initPointInd = pointInd;
+  var currentLine = -1;
+  var elemOpacity;
+  var sc;
+  var sw;
+  var fc;
+  var k;
+  var letterSw;
+  var letterSc;
+  var letterFc;
+  var letterM = '';
+  var letterP = this.defaultPropsArray;
+  var letterO;
+
+  //
+  if (documentData.j === 2 || documentData.j === 1) {
+    var animatorJustifyOffset = 0;
+    var animatorFirstCharOffset = 0;
+    var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+    var lastIndex = 0;
+    var isNewLine = true;
+
+    for (i = 0; i < len; i += 1) {
+      if (letters[i].n) {
+        if (animatorJustifyOffset) {
+          animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while (lastIndex < i) {
+          letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+          lastIndex += 1;
+        }
+        animatorJustifyOffset = 0;
+        isNewLine = true;
+      } else {
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.t.propType) {
+            if (isNewLine && documentData.j === 2) {
+              animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+            }
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
+            } else {
+              animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
+            }
+          }
+        }
+        isNewLine = false;
+      }
+    }
+    if (animatorJustifyOffset) {
+      animatorJustifyOffset += animatorFirstCharOffset;
+    }
+    while (lastIndex < i) {
+      letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+      lastIndex += 1;
+    }
+  }
+  //
+
+  for (i = 0; i < len; i += 1) {
+    matrixHelper.reset();
+    elemOpacity = 1;
+    if (letters[i].n) {
+      xPos = 0;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      currentLength = initPathPos;
+      firstLine = false;
+      if (this._hasMaskedPath) {
+        segmentInd = initSegmentInd;
+        pointInd = initPointInd;
         points = segments[segmentInd].points;
         prevPoint = points[pointInd - 1];
         currentPoint = points[pointInd];
         partialLength = currentPoint.partialLength;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.finalSize * 1.2 * 0.714;
-    var firstLine = true;
-    var animatorProps, animatorSelector;
-    var j, jLen;
-    var letterValue;
-
-    jLen = animators.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
-
-    //
-    if(documentData.j === 2 || documentData.j === 1) {
-        var animatorJustifyOffset = 0;
-        var animatorFirstCharOffset = 0;
-        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
-        var lastIndex = 0;
-        var isNewLine = true;
-
-        for (i = 0; i < len; i += 1) {
-            if (letters[i].n) {
-                if(animatorJustifyOffset) {
-                    animatorJustifyOffset += animatorFirstCharOffset;
-                }
-                while (lastIndex < i) {
-                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-                    lastIndex += 1;
-                }
-                animatorJustifyOffset = 0;
-                isNewLine = true;
+        segmentLength = 0;
+      }
+      letterM = '';
+      letterFc = '';
+      letterSw = '';
+      letterO = '';
+      letterP = this.defaultPropsArray;
+    } else {
+      if (this._hasMaskedPath) {
+        if (currentLine !== letters[i].line) {
+          switch (documentData.j) {
+            case 1:
+              currentLength += totalLength - documentData.lineWidths[letters[i].line];
+              break;
+            case 2:
+              currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
+              break;
+            default:
+              break;
+          }
+          currentLine = letters[i].line;
+        }
+        if (ind !== letters[i].ind) {
+          if (letters[ind]) {
+            currentLength += letters[ind].extra;
+          }
+          currentLength += letters[i].an / 2;
+          ind = letters[i].ind;
+        }
+        currentLength += (alignment[0] * letters[i].an) * 0.005;
+        var animatorOffset = 0;
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.p.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.p.v[0] * mult[0];
             } else {
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.t.propType) {
-                        if (isNewLine && documentData.j === 2) {
-                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
-                        }
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
-                        if (mult.length) {
-                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
-                        } else {
-                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
-                        }
-                    }
-                }
-                isNewLine = false;
+              animatorOffset += animatorProps.p.v[0] * mult;
             }
+          }
+          if (animatorProps.a.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.a.v[0] * mult[0];
+            } else {
+              animatorOffset += animatorProps.a.v[0] * mult;
+            }
+          }
         }
-        if(animatorJustifyOffset) {
-            animatorJustifyOffset += animatorFirstCharOffset;
-        }
-        while(lastIndex < i) {
-            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-            lastIndex += 1;
-        }
-    }
-    //
-
-    for( i = 0; i < len; i += 1) {
-
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this._hasMaskedPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
+        flag = true;
+        while (flag) {
+          if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+            matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01);
+            flag = false;
+          } else if (points) {
+            segmentLength += currentPoint.partialLength;
+            pointInd += 1;
+            if (pointInd >= points.length) {
+              pointInd = 0;
+              segmentInd += 1;
+              if (!segments[segmentInd]) {
+                if (mask.v.c) {
+                  pointInd = 0;
+                  segmentInd = 0;
+                  points = segments[segmentInd].points;
+                } else {
+                  segmentLength -= currentPoint.partialLength;
+                  points = null;
+                }
+              } else {
                 points = segments[segmentInd].points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
+              }
             }
-            letterO = letterSw = letterFc = letterM = '';
-            letterP = this.defaultPropsArray;
-        }else{
-            if(this._hasMaskedPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += alignment[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.p.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
+            if (points) {
+              prevPoint = currentPoint;
+              currentPoint = points[pointInd];
+              partialLength = currentPoint.partialLength;
+            }
+          }
+        }
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
+      } else {
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
 
-                    }
-                    if (animatorProps.a.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
+        // Grouping alignment
+        matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0);
+      }
 
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.t.propType) {
+          animatorSelector = animators[j].s;
+          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"
+          if (xPos !== 0 || documentData.j !== 0) {
+            if (this._hasMaskedPath) {
+              if (mult.length) {
+                currentLength += animatorProps.t.v * mult[0];
+              } else {
+                currentLength += animatorProps.t.v * mult;
+              }
+            } else if (mult.length) {
+              xPos += animatorProps.t.v * mult[0];
             } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+              xPos += animatorProps.t.v * mult;
             }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.t.propType) {
-                    animatorSelector = animators[j].s;
-                    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"
-                    if(xPos !== 0 || documentData.j !== 0) {
-                        if(this._hasMaskedPath) {
-                            if(mult.length) {
-                                currentLength += animatorProps.t.v*mult[0];
-                            } else {
-                                currentLength += animatorProps.t.v*mult;
-                            }
-                        }else{
-                            if(mult.length) {
-                                xPos += animatorProps.t.v*mult[0];
-                            } else {
-                                xPos += animatorProps.t.v*mult;
-                            }
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim && documentData.fc) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.a.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.s.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = animators[j].a;
-                animatorSelector = animators[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                if (animatorProps.sk.propType) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if (animatorProps.r.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if (animatorProps.ry.propType) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if (animatorProps.rx.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if (animatorProps.o.propType) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
-                        } else {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim && documentData.fc) {
-                    if(animatorProps.fc.propType){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                            }
-                        }
-                    }
-                    if(animatorProps.fh.propType){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if(animatorProps.fs.propType){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if(animatorProps.fb.propType){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-
-                if (animatorProps.p.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(this._hasMaskedPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim && documentData.fc){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this._hasMaskedPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
-                if (textData.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= alignment[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.finalSize;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                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]];
-            }
-            letterO = elemOpacity;
+          }
         }
-
-        if(renderedLettersCount <= i) {
-            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            this.renderedLetters.push(letterValue);
-            renderedLettersCount += 1;
-            this.lettersChangedFlag = true;
+      }
+      if (documentData.strokeWidthAnim) {
+        sw = documentData.sw || 0;
+      }
+      if (documentData.strokeColorAnim) {
+        if (documentData.sc) {
+          sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
         } else {
-            letterValue = this.renderedLetters[i];
-            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+          sc = [0, 0, 0];
         }
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.a.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+
+          if (mult.length) {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.s.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (mult.length) {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1);
+          } else {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        animatorSelector = animators[j].s;
+        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+        if (animatorProps.sk.propType) {
+          if (mult.length) {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+          } else {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+          }
+        }
+        if (animatorProps.r.propType) {
+          if (mult.length) {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+          } else {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult);
+          }
+        }
+        if (animatorProps.ry.propType) {
+          if (mult.length) {
+            matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
+          } else {
+            matrixHelper.rotateY(animatorProps.ry.v * mult);
+          }
+        }
+        if (animatorProps.rx.propType) {
+          if (mult.length) {
+            matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
+          } else {
+            matrixHelper.rotateX(animatorProps.rx.v * mult);
+          }
+        }
+        if (animatorProps.o.propType) {
+          if (mult.length) {
+            elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0];
+          } else {
+            elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult;
+          }
+        }
+        if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+          if (mult.length) {
+            sw += animatorProps.sw.v * mult[0];
+          } else {
+            sw += animatorProps.sw.v * mult;
+          }
+        }
+        if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+          for (k = 0; k < 3; k += 1) {
+            if (mult.length) {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
+            } else {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
+            }
+          }
+        }
+        if (documentData.fillColorAnim && documentData.fc) {
+          if (animatorProps.fc.propType) {
+            for (k = 0; k < 3; k += 1) {
+              if (mult.length) {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
+              } else {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
+              }
+            }
+          }
+          if (animatorProps.fh.propType) {
+            if (mult.length) {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
+            } else {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult);
+            }
+          }
+          if (animatorProps.fs.propType) {
+            if (mult.length) {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
+            } else {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
+            }
+          }
+          if (animatorProps.fb.propType) {
+            if (mult.length) {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
+            } else {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
+            }
+          }
+        }
+      }
+
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+
+        if (animatorProps.p.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (this._hasMaskedPath) {
+            if (mult.length) {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+            } else {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+            }
+          } else if (mult.length) {
+            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+          }
+        }
+      }
+      if (documentData.strokeWidthAnim) {
+        letterSw = sw < 0 ? 0 : sw;
+      }
+      if (documentData.strokeColorAnim) {
+        letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
+      }
+
+      if (this._hasMaskedPath) {
+        matrixHelper.translate(0, -documentData.ls);
+
+        matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0);
+        if (textData.p.p) {
+          tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+          var rot = (Math.atan(tanAngle) * 180) / Math.PI;
+          if (currentPoint.point[0] < prevPoint.point[0]) {
+            rot += 180;
+          }
+          matrixHelper.rotate((-rot * Math.PI) / 180);
+        }
+        matrixHelper.translate(xPathPos, yPathPos, 0);
+        currentLength -= (alignment[0] * letters[i].an) * 0.005;
+        if (letters[i + 1] && ind !== letters[i + 1].ind) {
+          currentLength += letters[i].an / 2;
+          currentLength += (documentData.tr * 0.001) * documentData.finalSize;
+        }
+      } else {
+        matrixHelper.translate(xPos, yPos, 0);
+
+        if (documentData.ps) {
+          // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+          matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+        }
+        switch (documentData.j) {
+          case 1:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
+            break;
+          case 2:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
+            break;
+          default:
+            break;
+        }
+        matrixHelper.translate(0, -documentData.ls);
+        matrixHelper.translate(offf, 0, 0);
+        matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0);
+        xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize;
+      }
+      if (renderType === 'html') {
+        letterM = matrixHelper.toCSS();
+      } else if (renderType === 'svg') {
+        letterM = matrixHelper.to2dCSS();
+      } else {
+        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]];
+      }
+      letterO = elemOpacity;
     }
+
+    if (renderedLettersCount <= i) {
+      letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
+      this.renderedLetters.push(letterValue);
+      renderedLettersCount += 1;
+      this.lettersChangedFlag = true;
+    } else {
+      letterValue = this.renderedLetters[i];
+      this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+    }
+  }
 };
 
-TextAnimatorProperty.prototype.getValue = function(){
-	if(this._elem.globalData.frameId === this._frameId){
-        return;
-    }
-    this._frameId = this._elem.globalData.frameId;
-    this.iterateDynamicProperties();
+TextAnimatorProperty.prototype.getValue = function () {
+  if (this._elem.globalData.frameId === this._frameId) {
+    return;
+  }
+  this._frameId = this._elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 TextAnimatorProperty.prototype.mHelper = new Matrix();
 TextAnimatorProperty.prototype.defaultPropsArray = [];
 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
+
+/* global PropertyFactory, degToRads, TextSelectorProp */
+/* exported TextAnimatorDataProperty */
+
 function TextAnimatorDataProperty(elem, animatorProps, container) {
-	var defaultData = {propType:false};
-	var getProp = PropertyFactory.getProp;
-	var textAnimator_animatables = animatorProps.a;
-	this.a = {
-		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
-		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
-		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
-		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
-		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
-		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
-		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
-		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
-		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
-		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
-		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
-		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
-		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
-		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
-		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
-		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
-	};
+  var defaultData = { propType: false };
+  var getProp = PropertyFactory.getProp;
+  var textAnimatorAnimatables = animatorProps.a;
+  this.a = {
+    r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
+    rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
+    ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
+    sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
+    sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
+    s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
+    a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
+    o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
+    p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
+    sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
+    sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
+    fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
+    fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
+    fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
+    fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
+    t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData,
+  };
 
-	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
-    this.s.t = animatorProps.s.t;
+  this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
+  this.s.t = animatorProps.s.t;
 }
-function LetterProps(o, sw, sc, fc, m, p){
+
+function LetterProps(o, sw, sc, fc, m, p) {
+  this.o = o;
+  this.sw = sw;
+  this.sc = sc;
+  this.fc = fc;
+  this.m = m;
+  this.p = p;
+  this._mdf = {
+    o: true,
+    sw: !!sw,
+    sc: !!sc,
+    fc: !!fc,
+    m: true,
+    p: true,
+  };
+}
+
+LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
+  this._mdf.o = false;
+  this._mdf.sw = false;
+  this._mdf.sc = false;
+  this._mdf.fc = false;
+  this._mdf.m = false;
+  this._mdf.p = false;
+  var updated = false;
+
+  if (this.o !== o) {
     this.o = o;
+    this._mdf.o = true;
+    updated = true;
+  }
+  if (this.sw !== sw) {
     this.sw = sw;
+    this._mdf.sw = true;
+    updated = true;
+  }
+  if (this.sc !== sc) {
     this.sc = sc;
+    this._mdf.sc = true;
+    updated = true;
+  }
+  if (this.fc !== fc) {
     this.fc = fc;
+    this._mdf.fc = true;
+    updated = true;
+  }
+  if (this.m !== m) {
     this.m = m;
+    this._mdf.m = true;
+    updated = true;
+  }
+  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])) {
     this.p = p;
-    this._mdf = {
-    	o: true,
-    	sw: !!sw,
-    	sc: !!sc,
-    	fc: !!fc,
-    	m: true,
-    	p: true
-    };
-}
-
-LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
-	this._mdf.o = false;
-	this._mdf.sw = false;
-	this._mdf.sc = false;
-	this._mdf.fc = false;
-	this._mdf.m = false;
-	this._mdf.p = false;
-	var updated = false;
-
-	if(this.o !== o) {
-		this.o = o;
-		this._mdf.o = true;
-		updated = true;
-	}
-	if(this.sw !== sw) {
-		this.sw = sw;
-		this._mdf.sw = true;
-		updated = true;
-	}
-	if(this.sc !== sc) {
-		this.sc = sc;
-		this._mdf.sc = true;
-		updated = true;
-	}
-	if(this.fc !== fc) {
-		this.fc = fc;
-		this._mdf.fc = true;
-		updated = true;
-	}
-	if(this.m !== m) {
-		this.m = m;
-		this._mdf.m = true;
-		updated = true;
-	}
-	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])) {
-		this.p = p;
-		this._mdf.p = true;
-		updated = true;
-	}
-	return updated;
-};
-function TextProperty(elem, data){
-	this._frameId = initialDefaultFrame;
-	this.pv = '';
-	this.v = '';
-	this.kf = false;
-	this._isFirstFrame = true;
-	this._mdf = false;
-    this.data = data;
-	this.elem = elem;
-    this.comp = this.elem.comp;
-	this.keysIndex = 0;
-    this.canResize = false;
-    this.minimumFontSize = 1;
-    this.effectsSequence = [];
-	this.currentData = {
-		ascent: 0,
-        boxWidth: this.defaultBoxWidth,
-        f: '',
-        fStyle: '',
-        fWeight: '',
-        fc: '',
-        j: '',
-        justifyOffset: '',
-        l: [],
-        lh: 0,
-        lineWidths: [],
-        ls: '',
-        of: '',
-        s: '',
-        sc: '',
-        sw: 0,
-        t: 0,
-        tr: 0,
-        sz:0,
-        ps:null,
-        fillColorAnim: false,
-        strokeColorAnim: false,
-        strokeWidthAnim: false,
-        yOffset: 0,
-        finalSize:0,
-        finalText:[],
-        finalLineHeight: 0,
-        __complete: false
-
-	};
-    this.copyData(this.currentData, this.data.d.k[0].s);
-
-    if(!this.searchProperty()) {
-        this.completeTextData(this.currentData);
-    }
-}
-
-TextProperty.prototype.defaultBoxWidth = [0,0];
-
-TextProperty.prototype.copyData = function(obj, data) {
-    for(var s in data) {
-        if(data.hasOwnProperty(s)) {
-            obj[s] = data[s];
-        }
-    }
-    return obj;
-}
-
-TextProperty.prototype.setCurrentData = function(data){
-    if(!data.__complete) {
-        this.completeTextData(data);
-    }
-    this.currentData = data;
-    this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
-    this._mdf = true;
+    this._mdf.p = true;
+    updated = true;
+  }
+  return updated;
 };
 
-TextProperty.prototype.searchProperty = function() {
-    return this.searchKeyframes();
-};
+/* global FontManager, initialDefaultFrame, getFontProperties */
+/* exported TextProperty */
 
-TextProperty.prototype.searchKeyframes = function() {
-    this.kf = this.data.d.k.length > 1;
-    if(this.kf) {
-        this.addEffect(this.getKeyframeValue.bind(this));
-    }
-    return this.kf;
+function TextProperty(elem, data) {
+  this._frameId = initialDefaultFrame;
+  this.pv = '';
+  this.v = '';
+  this.kf = false;
+  this._isFirstFrame = true;
+  this._mdf = false;
+  this.data = data;
+  this.elem = elem;
+  this.comp = this.elem.comp;
+  this.keysIndex = 0;
+  this.canResize = false;
+  this.minimumFontSize = 1;
+  this.effectsSequence = [];
+  this.currentData = {
+    ascent: 0,
+    boxWidth: this.defaultBoxWidth,
+    f: '',
+    fStyle: '',
+    fWeight: '',
+    fc: '',
+    j: '',
+    justifyOffset: '',
+    l: [],
+    lh: 0,
+    lineWidths: [],
+    ls: '',
+    of: '',
+    s: '',
+    sc: '',
+    sw: 0,
+    t: 0,
+    tr: 0,
+    sz: 0,
+    ps: null,
+    fillColorAnim: false,
+    strokeColorAnim: false,
+    strokeWidthAnim: false,
+    yOffset: 0,
+    finalSize: 0,
+    finalText: [],
+    finalLineHeight: 0,
+    __complete: false,
+
+  };
+  this.copyData(this.currentData, this.data.d.k[0].s);
+
+  if (!this.searchProperty()) {
+    this.completeTextData(this.currentData);
+  }
 }
 
-TextProperty.prototype.addEffect = function(effectFunction) {
-	this.effectsSequence.push(effectFunction);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.defaultBoxWidth = [0, 0];
+
+TextProperty.prototype.copyData = function (obj, data) {
+  for (var s in data) {
+    if (Object.prototype.hasOwnProperty.call(data, s)) {
+      obj[s] = data[s];
+    }
+  }
+  return obj;
 };
 
-TextProperty.prototype.getValue = function(_finalValue) {
-    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
-        return;
-    }
-    this.currentData.t = this.data.d.k[this.keysIndex].s.t;
-    var currentValue = this.currentData;
-    var currentIndex = this.keysIndex;
-    if(this.lock) {
-        this.setCurrentData(this.currentData);
-        return;
-    }
-    this.lock = true;
-    this._mdf = false;
-    var multipliedValue;
-    var i, len = this.effectsSequence.length;
-    var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
-    for(i = 0; i < len; i += 1) {
-        //Checking if index changed to prevent creating a new object every time the expression updates.
-        if(currentIndex !== this.keysIndex) {
-            finalValue = this.effectsSequence[i](finalValue, finalValue.t);
-        } else {
-            finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
-        }
-    }
-    if(currentValue !== finalValue) {
-        this.setCurrentData(finalValue);
-    }
-    this.pv = this.v = this.currentData;
-    this.lock = false;
-    this.frameId = this.elem.globalData.frameId;
-}
+TextProperty.prototype.setCurrentData = function (data) {
+  if (!data.__complete) {
+    this.completeTextData(data);
+  }
+  this.currentData = data;
+  this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+  this._mdf = true;
+};
 
-TextProperty.prototype.getKeyframeValue = function() {
-    var textKeys = this.data.d.k, textDocumentData;
-    var frameNum = this.elem.comp.renderedFrame;
-    var i = 0, len = textKeys.length;
-    while(i <= len - 1) {
-        textDocumentData = textKeys[i].s;
-        if(i === len - 1 || textKeys[i+1].t > frameNum){
-            break;
-        }
+TextProperty.prototype.searchProperty = function () {
+  return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function () {
+  this.kf = this.data.d.k.length > 1;
+  if (this.kf) {
+    this.addEffect(this.getKeyframeValue.bind(this));
+  }
+  return this.kf;
+};
+
+TextProperty.prototype.addEffect = function (effectFunction) {
+  this.effectsSequence.push(effectFunction);
+  this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function (_finalValue) {
+  if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+    return;
+  }
+  this.currentData.t = this.data.d.k[this.keysIndex].s.t;
+  var currentValue = this.currentData;
+  var currentIndex = this.keysIndex;
+  if (this.lock) {
+    this.setCurrentData(this.currentData);
+    return;
+  }
+  this.lock = true;
+  this._mdf = false;
+  var i; var
+    len = this.effectsSequence.length;
+  var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
+  for (i = 0; i < len; i += 1) {
+    // Checking if index changed to prevent creating a new object every time the expression updates.
+    if (currentIndex !== this.keysIndex) {
+      finalValue = this.effectsSequence[i](finalValue, finalValue.t);
+    } else {
+      finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
+    }
+  }
+  if (currentValue !== finalValue) {
+    this.setCurrentData(finalValue);
+  }
+  this.v = this.currentData;
+  this.pv = this.v;
+  this.lock = false;
+  this.frameId = this.elem.globalData.frameId;
+};
+
+TextProperty.prototype.getKeyframeValue = function () {
+  var textKeys = this.data.d.k;
+  var frameNum = this.elem.comp.renderedFrame;
+  var i = 0; var
+    len = textKeys.length;
+  while (i <= len - 1) {
+    if (i === len - 1 || textKeys[i + 1].t > frameNum) {
+      break;
+    }
+    i += 1;
+  }
+  if (this.keysIndex !== i) {
+    this.keysIndex = i;
+  }
+  return this.data.d.k[this.keysIndex].s;
+};
+
+TextProperty.prototype.buildFinalText = function (text) {
+  var combinedCharacters = FontManager.getCombinedCharacterCodes();
+  var charactersArray = [];
+  var i = 0; var
+    len = text.length;
+  var charCode;
+  while (i < len) {
+    charCode = text.charCodeAt(i);
+    if (combinedCharacters.indexOf(charCode) !== -1) {
+      charactersArray[charactersArray.length - 1] += text.charAt(i);
+    } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      charCode = text.charCodeAt(i + 1);
+      if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
+        charactersArray.push(text.substr(i, 2));
         i += 1;
+      } else {
+        charactersArray.push(text.charAt(i));
+      }
+    } else {
+      charactersArray.push(text.charAt(i));
     }
-    if(this.keysIndex !== i) {
-        this.keysIndex = i;
-    }
-    return this.data.d.k[this.keysIndex].s;
+    i += 1;
+  }
+  return charactersArray;
 };
 
-TextProperty.prototype.buildFinalText = function(text) {
-    var combinedCharacters = FontManager.getCombinedCharacterCodes();
-    var charactersArray = [];
-    var i = 0, len = text.length;
-    var charCode;
-    while (i < len) {
-        charCode = text.charCodeAt(i);
-        if (combinedCharacters.indexOf(charCode) !== -1) {
-            charactersArray[charactersArray.length - 1] += text.charAt(i);
-        } else {
-            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
-                charCode = text.charCodeAt(i + 1);
-                if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
-                    charactersArray.push(text.substr(i, 2));
-                    ++i;
-                } else {
-                    charactersArray.push(text.charAt(i));
-                }
-            } else {
-                charactersArray.push(text.charAt(i));
-            }
-        }
-        i += 1;
-    }
-    return charactersArray;
-}
-
-TextProperty.prototype.completeTextData = function(documentData) {
-    documentData.__complete = true;
-    var fontManager = this.elem.globalData.fontManager;
-    var data = this.data;
-    var letters = [];
-    var i, len;
-    var newLineFlag, index = 0, val;
-    var anchorGrouping = data.m.g;
-    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-    var lineWidth = 0;
-    var maxLineWidth = 0;
-    var j, jLen;
-    var fontData = fontManager.getFontByName(documentData.f);
-    var charData, cLength = 0;
-    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
-
-    var fWeight = 'normal', fStyle = 'normal';
-    len = styles.length;
-    var styleName;
-    for(i=0;i<len;i+=1){
-        styleName = styles[i].toLowerCase();
-        switch(styleName) {
-            case 'italic':
-            fStyle = 'italic';
-            break;
-            case 'bold':
-            fWeight = '700';
-            break;
-            case 'black':
-            fWeight = '900';
-            break;
-            case 'medium':
-            fWeight = '500';
-            break;
-            case 'regular':
-            case 'normal':
-            fWeight = '400';
-            break;
-            case 'light':
-            case 'thin':
-            fWeight = '200';
-            break;
-        }
-    }
-    documentData.fWeight = fontData.fWeight || fWeight;
-    documentData.fStyle = fStyle;
-    documentData.finalSize = documentData.s;
-    documentData.finalText = this.buildFinalText(documentData.t);
-    len = documentData.finalText.length;
-    documentData.finalLineHeight = documentData.lh;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var charCode;
-    if(documentData.sz){
-        var flag = true;
-        var boxWidth = documentData.sz[0];
-        var boxHeight = documentData.sz[1];
-        var currentHeight, finalText;
-        while(flag) {
-            finalText = this.buildFinalText(documentData.t);
-            currentHeight = 0;
-            lineWidth = 0;
-            len = finalText.length;
-            trackingOffset = documentData.tr/1000*documentData.finalSize;
-            var lastSpaceIndex = -1;
-            for(i=0;i<len;i+=1){
-                charCode = finalText[i].charCodeAt(0);
-                newLineFlag = false;
-                if(finalText[i] === ' '){
-                    lastSpaceIndex = i;
-                }else if(charCode === 13 || charCode === 3){
-                    lineWidth = 0;
-                    newLineFlag = true;
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-                }else{
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
-                }
-                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
-                    if(lastSpaceIndex === -1){
-                        len += 1;
-                    } else {
-                        i = lastSpaceIndex;
-                    }
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
-                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
-                    lastSpaceIndex = -1;
-                    lineWidth = 0;
-                }else {
-                    lineWidth += cLength;
-                    lineWidth += trackingOffset;
-                }
-            }
-            currentHeight += fontData.ascent*documentData.finalSize/100;
-            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
-                documentData.finalSize -= 1;
-                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
-            } else {
-                documentData.finalText = finalText;
-                len = documentData.finalText.length;
-                flag = false;
-            }
-        }
-
-    }
-    lineWidth = - trackingOffset;
+TextProperty.prototype.completeTextData = function (documentData) {
+  documentData.__complete = true;
+  var fontManager = this.elem.globalData.fontManager;
+  var data = this.data;
+  var letters = [];
+  var i; var
+    len;
+  var newLineFlag; var index = 0; var
+    val;
+  var anchorGrouping = data.m.g;
+  var currentSize = 0; var currentPos = 0; var currentLine = 0; var
+    lineWidths = [];
+  var lineWidth = 0;
+  var maxLineWidth = 0;
+  var j; var
+    jLen;
+  var fontData = fontManager.getFontByName(documentData.f);
+  var charData; var
     cLength = 0;
-    var uncollapsedSpaces = 0;
-    var currentChar;
-    for (i = 0;i < len ;i += 1) {
+
+  var fontProps = getFontProperties(fontData);
+  documentData.fWeight = fontProps.weight;
+  documentData.fStyle = fontProps.style;
+  documentData.finalSize = documentData.s;
+  documentData.finalText = this.buildFinalText(documentData.t);
+  len = documentData.finalText.length;
+  documentData.finalLineHeight = documentData.lh;
+  var trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+  var charCode;
+  if (documentData.sz) {
+    var flag = true;
+    var boxWidth = documentData.sz[0];
+    var boxHeight = documentData.sz[1];
+    var currentHeight; var
+      finalText;
+    while (flag) {
+      finalText = this.buildFinalText(documentData.t);
+      currentHeight = 0;
+      lineWidth = 0;
+      len = finalText.length;
+      trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+      var lastSpaceIndex = -1;
+      for (i = 0; i < len; i += 1) {
+        charCode = finalText[i].charCodeAt(0);
         newLineFlag = false;
-        currentChar = documentData.finalText[i];
-        charCode = currentChar.charCodeAt(0);
-        if (charCode === 13 || charCode === 3) {
-            uncollapsedSpaces = 0;
-            lineWidths.push(lineWidth);
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidth = - 2 * trackingOffset;
-            val = '';
-            newLineFlag = true;
-            currentLine += 1;
-        }else{
-            val = currentChar;
+        if (finalText[i] === ' ') {
+          lastSpaceIndex = i;
+        } else if (charCode === 13 || charCode === 3) {
+          lineWidth = 0;
+          newLineFlag = true;
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
         }
-        if(fontManager.chars){
-            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-        }else{
-            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
-            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
-        }
-
-        //
-        if(currentChar === ' '){
-            uncollapsedSpaces += cLength + trackingOffset;
+        if (fontManager.chars) {
+          charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+          cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
         } else {
-            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
-            uncollapsedSpaces = 0;
+          // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+          cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
         }
-        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
-        if(anchorGrouping == 2){
-            currentSize += cLength;
-            if(val === '' || val === ' ' || i === len - 1){
-                if(val === '' || val === ' '){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                index += 1;
-                currentSize = 0;
-            }
-        }else if(anchorGrouping == 3){
-            currentSize += cLength;
-            if(val === '' || i === len - 1){
-                if(val === ''){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                currentSize = 0;
-                index += 1;
-            }
-        }else{
-            letters[index].ind = index;
-            letters[index].extra = 0;
-            index += 1;
+        if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
+          if (lastSpaceIndex === -1) {
+            len += 1;
+          } else {
+            i = lastSpaceIndex;
+          }
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
+          finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r');
+          // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+          lastSpaceIndex = -1;
+          lineWidth = 0;
+        } else {
+          lineWidth += cLength;
+          lineWidth += trackingOffset;
         }
+      }
+      currentHeight += (fontData.ascent * documentData.finalSize) / 100;
+      if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+        documentData.finalSize -= 1;
+        documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s;
+      } else {
+        documentData.finalText = finalText;
+        len = documentData.finalText.length;
+        flag = false;
+      }
     }
-    documentData.l = letters;
-    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-    lineWidths.push(lineWidth);
-    if(documentData.sz){
-        documentData.boxWidth = documentData.sz[0];
+  }
+  lineWidth = -trackingOffset;
+  cLength = 0;
+  var uncollapsedSpaces = 0;
+  var currentChar;
+  for (i = 0; i < len; i += 1) {
+    newLineFlag = false;
+    currentChar = documentData.finalText[i];
+    charCode = currentChar.charCodeAt(0);
+    if (charCode === 13 || charCode === 3) {
+      uncollapsedSpaces = 0;
+      lineWidths.push(lineWidth);
+      maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+      lineWidth = -2 * trackingOffset;
+      val = '';
+      newLineFlag = true;
+      currentLine += 1;
+    } else {
+      val = currentChar;
+    }
+    if (fontManager.chars) {
+      charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+      cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
+    } else {
+      // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+      // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+      cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+    }
+
+    //
+    if (currentChar === ' ') {
+      uncollapsedSpaces += cLength + trackingOffset;
+    } else {
+      lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+      uncollapsedSpaces = 0;
+    }
+    letters.push({
+      l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0,
+    });
+    if (anchorGrouping == 2) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || val === ' ' || i === len - 1) {
+        if (val === '' || val === ' ') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        index += 1;
+        currentSize = 0;
+      }
+    } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || i === len - 1) {
+        if (val === '') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        currentSize = 0;
+        index += 1;
+      }
+    } else {
+      letters[index].ind = index;
+      letters[index].extra = 0;
+      index += 1;
+    }
+  }
+  documentData.l = letters;
+  maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+  lineWidths.push(lineWidth);
+  if (documentData.sz) {
+    documentData.boxWidth = documentData.sz[0];
+    documentData.justifyOffset = 0;
+  } else {
+    documentData.boxWidth = maxLineWidth;
+    switch (documentData.j) {
+      case 1:
+        documentData.justifyOffset = -documentData.boxWidth;
+        break;
+      case 2:
+        documentData.justifyOffset = -documentData.boxWidth / 2;
+        break;
+      default:
         documentData.justifyOffset = 0;
-    }else{
-        documentData.boxWidth = maxLineWidth;
-        switch(documentData.j){
-            case 1:
-                documentData.justifyOffset = - documentData.boxWidth;
-                break;
-            case 2:
-                documentData.justifyOffset = - documentData.boxWidth/2;
-                break;
-            default:
-                documentData.justifyOffset = 0;
-        }
     }
-    documentData.lineWidths = lineWidths;
+  }
+  documentData.lineWidths = lineWidths;
 
-    var animators = data.a, animatorData, letterData;
-    jLen = animators.length;
-    var based, ind, indexes = [];
-    for(j=0;j<jLen;j+=1){
-        animatorData = animators[j];
-        if(animatorData.a.sc){
-            documentData.strokeColorAnim = true;
-        }
-        if(animatorData.a.sw){
-            documentData.strokeWidthAnim = true;
-        }
-        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
-            documentData.fillColorAnim = true;
-        }
-        ind = 0;
-        based = animatorData.s.b;
-        for(i=0;i<len;i+=1){
-            letterData = letters[i];
-            letterData.anIndexes[j] = ind;
-            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))){
-                if(animatorData.s.rn === 1){
-                    indexes.push(ind);
-                }
-                ind += 1;
-            }
-        }
-        data.a[j].s.totalChars = ind;
-        var currentInd = -1, newInd;
-        if(animatorData.s.rn === 1){
-            for(i = 0; i < len; i += 1){
-                letterData = letters[i];
-                if(currentInd != letterData.anIndexes[j]){
-                    currentInd = letterData.anIndexes[j];
-                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                }
-                letterData.anIndexes[j] = newInd;
-            }
-        }
+  var animators = data.a; var animatorData; var
+    letterData;
+  jLen = animators.length;
+  var based; var ind; var
+    indexes = [];
+  for (j = 0; j < jLen; j += 1) {
+    animatorData = animators[j];
+    if (animatorData.a.sc) {
+      documentData.strokeColorAnim = true;
     }
-    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
-    documentData.ls = documentData.ls || 0;
-    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+    if (animatorData.a.sw) {
+      documentData.strokeWidthAnim = true;
+    }
+    if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
+      documentData.fillColorAnim = true;
+    }
+    ind = 0;
+    based = animatorData.s.b;
+    for (i = 0; i < len; i += 1) {
+      letterData = letters[i];
+      letterData.anIndexes[j] = ind;
+      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))) { // eslint-disable-line eqeqeq
+        if (animatorData.s.rn === 1) {
+          indexes.push(ind);
+        }
+        ind += 1;
+      }
+    }
+    data.a[j].s.totalChars = ind;
+    var currentInd = -1; var
+      newInd;
+    if (animatorData.s.rn === 1) {
+      for (i = 0; i < len; i += 1) {
+        letterData = letters[i];
+        if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq
+          currentInd = letterData.anIndexes[j];
+          newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
+        }
+        letterData.anIndexes[j] = newInd;
+      }
+    }
+  }
+  documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
+  documentData.ls = documentData.ls || 0;
+  documentData.ascent = (fontData.ascent * documentData.finalSize) / 100;
 };
 
-TextProperty.prototype.updateDocumentData = function(newData, index) {
-	index = index === undefined ? this.keysIndex : index;
-    var dData = this.copyData({}, this.data.d.k[index].s);
-    dData = this.copyData(dData, newData);
-    this.data.d.k[index].s = dData;
-    this.recalculate(index);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.updateDocumentData = function (newData, index) {
+  index = index === undefined ? this.keysIndex : index;
+  var dData = this.copyData({}, this.data.d.k[index].s);
+  dData = this.copyData(dData, newData);
+  this.data.d.k[index].s = dData;
+  this.recalculate(index);
+  this.elem.addDynamicProperty(this);
 };
 
-TextProperty.prototype.recalculate = function(index) {
-    var dData = this.data.d.k[index].s;
-    dData.__complete = false;
-    this.keysIndex = 0;
-    this._isFirstFrame = true;
-    this.getValue(dData);
-}
-
-TextProperty.prototype.canResizeFont = function(_canResize) {
-    this.canResize = _canResize;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.recalculate = function (index) {
+  var dData = this.data.d.k[index].s;
+  dData.__complete = false;
+  this.keysIndex = 0;
+  this._isFirstFrame = true;
+  this.getValue(dData);
 };
 
-TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
-    this.minimumFontSize = Math.floor(_fontValue) || 1;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.canResizeFont = function (_canResize) {
+  this.canResize = _canResize;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
 };
 
-var TextSelectorProp = (function(){
-    var max = Math.max;
-    var min = Math.min;
-    var floor = Math.floor;
+TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
+  this.minimumFontSize = Math.floor(_fontValue) || 1;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
+};
 
-    function TextSelectorProp(elem,data){
-        this._currentTextLength = -1;
-        this.k = false;
-        this.data = data;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.finalS = 0;
-        this.finalE = 0;
-        this.initDynamicPropertyContainer(elem);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
-        if('e' in data){
-            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
-        }else{
-            this.e = {v:100};
+/* global extendPrototype, BezierFactory, PropertyFactory, DynamicPropertyContainer */
+/* exported TextSelectorProp */
+
+var TextSelectorProp = (function () {
+  var max = Math.max;
+  var min = Math.min;
+  var floor = Math.floor;
+
+  function TextSelectorPropFactory(elem, data) {
+    this._currentTextLength = -1;
+    this.k = false;
+    this.data = data;
+    this.elem = elem;
+    this.comp = elem.comp;
+    this.finalS = 0;
+    this.finalE = 0;
+    this.initDynamicPropertyContainer(elem);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this);
+    if ('e' in data) {
+      this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
+    } else {
+      this.e = { v: 100 };
+    }
+    this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this);
+    this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this);
+    this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this);
+    this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
+    if (!this.dynamicProperties.length) {
+      this.getValue();
+    }
+  }
+
+  TextSelectorPropFactory.prototype = {
+    getMult: function (ind) {
+      if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+        this.getValue();
+      }
+      // var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+      var x1 = 0;
+      var y1 = 0;
+      var x2 = 1;
+      var y2 = 1;
+      if (this.ne.v > 0) {
+        x1 = this.ne.v / 100.0;
+      } else {
+        y1 = -this.ne.v / 100.0;
+      }
+      if (this.xe.v > 0) {
+        x2 = 1.0 - this.xe.v / 100.0;
+      } else {
+        y2 = 1.0 + this.xe.v / 100.0;
+      }
+      var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
+
+      var mult = 0;
+      var s = this.finalS;
+      var e = this.finalE;
+      var type = this.data.sh;
+      if (type === 2) {
+        if (e === s) {
+          mult = ind >= e ? 1 : 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
-        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
-        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
-        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
-        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
-        if(!this.dynamicProperties.length){
-            this.getValue();
+        mult = easer(mult);
+      } else if (type === 3) {
+        if (e === s) {
+          mult = ind >= e ? 0 : 1;
+        } else {
+          mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
+
+        mult = easer(mult);
+      } else if (type === 4) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
+          if (mult < 0.5) {
+            mult *= 2;
+          } else {
+            mult = 1 - 2 * (mult - 0.5);
+          }
+        }
+        mult = easer(mult);
+      } else if (type === 5) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          var tot = e - s;
+          /* ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          var x = -tot / 2 + ind;
+          var a = tot / 2;
+          mult = Math.sqrt(1 - (x * x) / (a * a));
+        }
+        mult = easer(mult);
+      } else if (type === 6) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line
+        }
+        mult = easer(mult);
+      } else {
+        if (ind >= floor(s)) {
+          if (ind - s < 0) {
+            mult = max(0, min(min(e, 1) - (s - ind), 1));
+          } else {
+            mult = max(0, min(e - ind, 1));
+          }
+        }
+        mult = easer(mult);
+      }
+      return mult * this.a.v;
+    },
+    getValue: function (newCharsFlag) {
+      this.iterateDynamicProperties();
+      this._mdf = newCharsFlag || this._mdf;
+      this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+      if (newCharsFlag && this.data.r === 2) {
+        this.e.v = this._currentTextLength;
+      }
+      var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
+      var o = this.o.v / divisor;
+      var s = this.s.v / divisor + o;
+      var e = (this.e.v / divisor) + o;
+      if (s > e) {
+        var _s = s;
+        s = e;
+        e = _s;
+      }
+      this.finalS = s;
+      this.finalE = e;
+    },
+  };
+  extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
+
+  function getTextSelectorProp(elem, data, arr) {
+    return new TextSelectorPropFactory(elem, data, arr);
+  }
+
+  return {
+    getTextSelectorProp: getTextSelectorProp,
+  };
+}());
+
+/* global createSizedArray, pooling */
+/* exported poolFactory */
+
+var poolFactory = (function () {
+  return function (initialLength, _create, _release) {
+    var _length = 0;
+    var _maxLength = initialLength;
+    var pool = createSizedArray(_maxLength);
+
+    var ob = {
+      newElement: newElement,
+      release: release,
+    };
+
+    function newElement() {
+      var element;
+      if (_length) {
+        _length -= 1;
+        element = pool[_length];
+      } else {
+        element = _create();
+      }
+      return element;
     }
 
-    TextSelectorProp.prototype = {
-        getMult: function(ind) {
-            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
-                this.getValue();
-            }
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var x1 = 0;
-            var y1 = 0;
-            var x2 = 1;
-            var y2 = 1;
-            if(this.ne.v > 0) {
-                x1 = this.ne.v / 100.0;
-            }
-            else {
-                y1 = -this.ne.v / 100.0;
-            }
-            if(this.xe.v > 0) {
-                x2 = 1.0 - this.xe.v / 100.0;
-            }
-            else {
-                y2 = 1.0 + this.xe.v / 100.0;
-            }
-            var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
-
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if (type === 2){
-                if (e === s) {
-                    mult = ind >= e ? 1 : 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                }
-                mult = easer(mult);
-            } else if(type === 3) {
-                if (e === s) {
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
-                }
-
-                mult = easer(mult);
-            } else if (type === 4) {
-                if (e === s) {
-                    mult = 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                    if (mult < 0.5) {
-                        mult *= 2;
-                    } else {
-                        mult = 1 - 2 * (mult - 0.5);
-                    }
-                }
-                mult = easer(mult);
-            } else if (type === 5) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x * x) / (a * a));
-                }
-                mult = easer(mult);
-            } else if (type === 6) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
-                }
-                mult = easer(mult);
-            } else {
-                if (ind >= floor(s)) {
-                    if (ind - s < 0) {
-                        mult = max(0, min(min(e, 1) - (s - ind), 1));
-                    } else {
-                        mult = max(0, min(e - ind, 1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        },
-        getValue: function(newCharsFlag) {
-            this.iterateDynamicProperties();
-            this._mdf = newCharsFlag || this._mdf;
-            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
-            if(newCharsFlag && this.data.r === 2) {
-                this.e.v = this._currentTextLength;
-            }
-            var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-    }
-    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
+    function release(element) {
+      if (_length === _maxLength) {
+        pool = pooling.double(pool);
+        _maxLength *= 2;
+      }
+      if (_release) {
+        _release(element);
+      }
+      pool[_length] = element;
+      _length += 1;
     }
 
+    return ob;
+  };
+}());
+
+/* global createSizedArray */
+/* exported pooling */
+
+var pooling = (function () {
+  function double(arr) {
+    return arr.concat(createSizedArray(arr.length));
+  }
+
+  return {
+    double: double,
+  };
+}());
+
+/* global createTypedArray, poolFactory */
+/* exported pointPool */
+
+var pointPool = (function () {
+  function create() {
+    return createTypedArray('float32', 2);
+  }
+  return poolFactory(8, create);
+}());
+
+/* global ShapePath, pointPool, poolFactory */
+/* exported shapePool */
+
+var shapePool = (function () {
+  function create() {
+    return new ShapePath();
+  }
+
+  function release(shapePath) {
+    var len = shapePath._length;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      pointPool.release(shapePath.v[i]);
+      pointPool.release(shapePath.i[i]);
+      pointPool.release(shapePath.o[i]);
+      shapePath.v[i] = null;
+      shapePath.i[i] = null;
+      shapePath.o[i] = null;
+    }
+    shapePath._length = 0;
+    shapePath.c = false;
+  }
+
+  function clone(shape) {
+    var cloned = factory.newElement();
+    var i;
+    var len = shape._length === undefined ? shape.v.length : shape._length;
+    cloned.setLength(len);
+    cloned.c = shape.c;
+
+    for (i = 0; i < len; i += 1) {
+      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);
+    }
+    return cloned;
+  }
+
+  var factory = poolFactory(4, create, release);
+  factory.clone = clone;
+
+  return factory;
+}());
+
+/* global createSizedArray, ShapeCollection, shapePool, pooling */
+/* exported shapeCollectionPool */
+
+var shapeCollectionPool = (function () {
+  var ob = {
+    newShapeCollection: newShapeCollection,
+    release: release,
+  };
+
+  var _length = 0;
+  var _maxLength = 4;
+  var pool = createSizedArray(_maxLength);
+
+  function newShapeCollection() {
+    var shapeCollection;
+    if (_length) {
+      _length -= 1;
+      shapeCollection = pool[_length];
+    } else {
+      shapeCollection = new ShapeCollection();
+    }
+    return shapeCollection;
+  }
+
+  function release(shapeCollection) {
+    var i;
+    var len = shapeCollection._length;
+    for (i = 0; i < len; i += 1) {
+      shapePool.release(shapeCollection.shapes[i]);
+    }
+    shapeCollection._length = 0;
+
+    if (_length === _maxLength) {
+      pool = pooling.double(pool);
+      _maxLength *= 2;
+    }
+    pool[_length] = shapeCollection;
+    _length += 1;
+  }
+
+  return ob;
+}());
+
+/* global poolFactory, bezierLengthPool */
+/* exported segmentsLengthPool */
+
+var segmentsLengthPool = (function () {
+  function create() {
     return {
-        getTextSelectorProp: getTextSelectorProp
+      lengths: [],
+      totalLength: 0,
     };
-}());
+  }
 
-    
-var pool_factory = (function() {
-	return function(initialLength, _create, _release, _clone) {
-
-		var _length = 0;
-		var _maxLength = initialLength;
-		var pool = createSizedArray(_maxLength);
-
-		var ob = {
-			newElement: newElement,
-			release: release
-		};
-
-		function newElement(){
-			var element;
-			if(_length){
-				_length -= 1;
-				element = pool[_length];
-			} else {
-				element = _create();
-			}
-			return element;
-		}
-
-		function release(element) {
-			if(_length === _maxLength) {
-				pool = pooling.double(pool);
-				_maxLength = _maxLength*2;
-			}
-			if (_release) {
-				_release(element);
-			}
-			pool[_length] = element;
-			_length += 1;
-		}
-
-		function clone() {
-			var clonedElement = newElement();
-			return _clone(clonedElement);
-		}
-
-		return ob;
-	};
-}());
-
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(createSizedArray(arr.length));
-	}
-
-	return {
-		double: double
-	};
-}());
-var point_pool = (function(){
-
-	function create() {
-		return createTypedArray('float32', 2);
-	}
-	return pool_factory(8, create);
-}());
-var shape_pool = (function(){
-
-	function create() {
-		return new ShapePath();
-	}
-
-	function release(shapePath) {
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-	}
-
-	function clone(shape) {
-		var cloned = factory.newElement();
-		var i, len = shape._length === undefined ? shape.v.length : shape._length;
-		cloned.setLength(len);
-		cloned.c = shape.c;
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			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);
-		}
-		return cloned;
-	}
-
-	var factory = pool_factory(4, create, release);
-	factory.clone = clone;
-
-	return factory;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release
-	};
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = createSizedArray(_maxLength);
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	return ob;
-}());
-var segments_length_pool = (function(){
-
-	function create() {
-		return {
-			lengths: [],
-			totalLength: 0
-		};
-	}
-
-	function release(element) {
-		var i, len = element.lengths.length;
-		for(i=0;i<len;i+=1) {
-			bezier_length_pool.release(element.lengths[i]);
-		}
-		element.lengths.length = 0;
-	}
-
-	return pool_factory(8, create, release);
-}());
-var bezier_length_pool = (function(){
-
-	function create() {
-		return {
-            addedLength: 0,
-            percents: createTypedArray('float32', defaultCurveSegments),
-            lengths: createTypedArray('float32', defaultCurveSegments),
-        };
-	}
-	return pool_factory(8, create);
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
+  function release(element) {
+    var i;
+    var len = element.lengths.length;
+    for (i = 0; i < len; i += 1) {
+      bezierLengthPool.release(element.lengths[i]);
     }
-    this.checkPendingElements();
-};
+    element.lengths.length = 0;
+  }
 
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 3:
-            return this.createNull(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 6:
-            return this.createAudio(layer);
-        case 13:
-            return this.createCamera(layer);
-    }
-    return this.createNull(layer);
-};
+  return poolFactory(8, create, release);
+}());
 
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-};
+/* global createTypedArray, defaultCurveSegments, poolFactory */
+/* exported bezierLengthPool */
 
-BaseRenderer.prototype.createAudio = function(data){
-    return new AudioElement(data, this.globalData, this);
-};
+var bezierLengthPool = (function () {
+  function create() {
+    return {
+      addedLength: 0,
+      percents: createTypedArray('float32', defaultCurveSegments),
+      lengths: createTypedArray('float32', defaultCurveSegments),
+    };
+  }
+  return poolFactory(8, create);
+}());
 
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
+/* global AudioElement, FontManager */
+
+function BaseRenderer() {}
+BaseRenderer.prototype.checkLayers = function (num) {
+  var i;
+  var len = this.layers.length;
+  var data;
+  this.completeLayers = true;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (!this.elements[i]) {
+      data = this.layers[i];
+      if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) {
         this.buildItem(i);
+      }
     }
-    this.checkPendingElements();
+    this.completeLayers = this.elements[i] ? this.completeLayers : false;
+  }
+  this.checkPendingElements();
 };
 
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
+BaseRenderer.prototype.createItem = function (layer) {
+  switch (layer.ty) {
+    case 2:
+      return this.createImage(layer);
+    case 0:
+      return this.createComp(layer);
+    case 1:
+      return this.createSolid(layer);
+    case 3:
+      return this.createNull(layer);
+    case 4:
+      return this.createShape(layer);
+    case 5:
+      return this.createText(layer);
+    case 6:
+      return this.createAudio(layer);
+    case 13:
+      return this.createCamera(layer);
+    default:
+      return this.createNull(layer);
+  }
+};
+
+BaseRenderer.prototype.createCamera = function () {
+  throw new Error('You\'re using a 3d camera. Try the html renderer.');
+};
+
+BaseRenderer.prototype.createAudio = function (data) {
+  return new AudioElement(data, this.globalData, this);
+};
+
+BaseRenderer.prototype.buildAllItems = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    this.buildItem(i);
+  }
+  this.checkPendingElements();
+};
+
+BaseRenderer.prototype.includeLayers = function (newLayers) {
+  this.completeLayers = false;
+  var i;
+  var len = newLayers.length;
+  var j;
+  var jLen = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    j = 0;
+    while (j < jLen) {
+      if (this.layers[j].id === newLayers[i].id) {
+        this.layers[j] = newLayers[i];
+        break;
+      }
+      j += 1;
+    }
+  }
+};
+
+BaseRenderer.prototype.setProjectInterface = function (pInterface) {
+  this.globalData.projectInterface = pInterface;
+};
+
+BaseRenderer.prototype.initItems = function () {
+  if (!this.globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+};
+BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
+  var elements = this.elements;
+  var layers = this.layers;
+  var i = 0;
+  var len = layers.length;
+  while (i < len) {
+    if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq
+      if (!elements[i] || elements[i] === true) {
+        this.buildItem(i);
+        this.addPendingElement(element);
+      } else {
+        hierarchy.push(elements[i]);
+        elements[i].setAsParent();
+        if (layers[i].parent !== undefined) {
+          this.buildElementParenting(element, layers[i].parent, hierarchy);
+        } else {
+          element.setHierarchy(hierarchy);
         }
+      }
     }
+    i += 1;
+  }
 };
 
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
+BaseRenderer.prototype.addPendingElement = function (element) {
+  this.pendingElements.push(element);
 };
 
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
+BaseRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i]);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
     }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while (i < len) {
-        if (layers[i].ind == parentName) {
-            if (!elements[i] || elements[i] === true) {
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i].setAsParent();
-                if(layers[i].parent !== undefined) {
-                    this.buildElementParenting(element, layers[i].parent, hierarchy);
-                } else {
-                    element.setHierarchy(hierarchy);
-                }
-            }
-        }
-        i += 1;
-    }
+  }
 };
 
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
+BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
+  this.globalData.fontManager = new FontManager();
+  this.globalData.fontManager.addChars(animData.chars);
+  this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
+  this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+  this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
+  this.globalData.imageLoader = this.animationItem.imagePreloader;
+  this.globalData.audioController = this.animationItem.audioController;
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
 };
 
-BaseRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i]);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
+/* global createElementID, extendPrototype, BaseRenderer, NullElement, SVGShapeElement, SVGTextLottieElement,
+IImageElement, SVGCompElement, ISolidElement, createNS, locationHref, createSizedArray, expressionsPlugin */
 
-BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.imageLoader = this.animationItem.imagePreloader;
-    this.globalData.audioController = this.animationItem.audioController;
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-}
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.svgElement = createNS('svg');
-    var ariaLabel = '';
-    if (config && config.title) {
-        var titleElement = createNS('title');
-        var titleId = createElementID();
-        titleElement.setAttribute('id', titleId);
-        titleElement.textContent = config.title;
-        this.svgElement.appendChild(titleElement);
-        ariaLabel += titleId;
-    }
-    if (config && config.description) {
-        var descElement = createNS('desc');
-        var descId = createElementID();
-        descElement.setAttribute('id', descId);
-        descElement.textContent = config.description;
-        this.svgElement.appendChild(descElement);
-        ariaLabel += ' ' + descId;
-    }
-    if (ariaLabel) {
-        this.svgElement.setAttribute('aria-labelledby', ariaLabel)
-    }
-    var defs = createNS( 'defs');
-    this.svgElement.appendChild(defs);
-    var maskElement = createNS('g');
-    this.svgElement.appendChild(maskElement);
-    this.layerElement = maskElement;
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        viewBoxOnly: (config && config.viewBoxOnly) || false,
-        viewBoxSize: (config && config.viewBoxSize) || false,
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-        focusable: config && config.focusable,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '100%',
-            height: config && config.filterSize && config.filterSize.height || '100%',
-            x: config && config.filterSize && config.filterSize.x || '0%',
-            y: config && config.filterSize && config.filterSize.y || '0%',
-        }
-    };
+function SVGRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.svgElement = createNS('svg');
+  var ariaLabel = '';
+  if (config && config.title) {
+    var titleElement = createNS('title');
+    var titleId = createElementID();
+    titleElement.setAttribute('id', titleId);
+    titleElement.textContent = config.title;
+    this.svgElement.appendChild(titleElement);
+    ariaLabel += titleId;
+  }
+  if (config && config.description) {
+    var descElement = createNS('desc');
+    var descId = createElementID();
+    descElement.setAttribute('id', descId);
+    descElement.textContent = config.description;
+    this.svgElement.appendChild(descElement);
+    ariaLabel += ' ' + descId;
+  }
+  if (ariaLabel) {
+    this.svgElement.setAttribute('aria-labelledby', ariaLabel);
+  }
+  var defs = createNS('defs');
+  this.svgElement.appendChild(defs);
+  var maskElement = createNS('g');
+  this.svgElement.appendChild(maskElement);
+  this.layerElement = maskElement;
+  this.renderConfig = {
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    hideOnTransparent: !((config && config.hideOnTransparent === false)),
+    viewBoxOnly: (config && config.viewBoxOnly) || false,
+    viewBoxSize: (config && config.viewBoxSize) || false,
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+    focusable: config && config.focusable,
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '100%',
+      height: (config && config.filterSize && config.filterSize.height) || '100%',
+      x: (config && config.filterSize && config.filterSize.x) || '0%',
+      y: (config && config.filterSize && config.filterSize.y) || '0%',
+    },
+  };
 
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        defs: defs,
-        renderConfig: this.renderConfig
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-    this.rendererType = 'svg';
-
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    defs: defs,
+    renderConfig: this.renderConfig,
+  };
+  this.elements = [];
+  this.pendingElements = [];
+  this.destroyed = false;
+  this.rendererType = 'svg';
 }
 
-extendPrototype([BaseRenderer],SVGRenderer);
+extendPrototype([BaseRenderer], SVGRenderer);
 
 SVGRenderer.prototype.createNull = function (data) {
-    return new NullElement(data,this.globalData,this);
+  return new NullElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new SVGShapeElement(data,this.globalData,this);
+  return new SVGShapeElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data,this.globalData,this);
-
+  return new SVGTextLottieElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data,this.globalData,this);
+  return new IImageElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new SVGCompElement(data,this.globalData,this);
-
+  return new SVGCompElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data,this.globalData,this);
+  return new ISolidElement(data, this.globalData, this);
 };
 
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    if(this.renderConfig.viewBoxSize) {
-        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
-    } else {
-        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    }
+SVGRenderer.prototype.configAnimation = function (animData) {
+  this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+  if (this.renderConfig.viewBoxSize) {
+    this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
+  } else {
+    this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
+  }
 
-    if(!this.renderConfig.viewBoxOnly) {
-        this.svgElement.setAttribute('width',animData.w);
-        this.svgElement.setAttribute('height',animData.h);
-        this.svgElement.style.width = '100%';
-        this.svgElement.style.height = '100%';
-        this.svgElement.style.transform = 'translate3d(0,0,0)';
-    }
-    if (this.renderConfig.className) {
-        this.svgElement.setAttribute('class', this.renderConfig.className);
-    }
-    if (this.renderConfig.id) {
-        this.svgElement.setAttribute('id', this.renderConfig.id);
-    }
-    if (this.renderConfig.focusable !== undefined) {
-        this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
-    }
-    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.svgElement);
-    //Mask animation
-    var defs = this.globalData.defs;
+  if (!this.renderConfig.viewBoxOnly) {
+    this.svgElement.setAttribute('width', animData.w);
+    this.svgElement.setAttribute('height', animData.h);
+    this.svgElement.style.width = '100%';
+    this.svgElement.style.height = '100%';
+    this.svgElement.style.transform = 'translate3d(0,0,0)';
+  }
+  if (this.renderConfig.className) {
+    this.svgElement.setAttribute('class', this.renderConfig.className);
+  }
+  if (this.renderConfig.id) {
+    this.svgElement.setAttribute('id', this.renderConfig.id);
+  }
+  if (this.renderConfig.focusable !== undefined) {
+    this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
+  }
+  this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio);
+  // this.layerElement.style.transform = 'translate3d(0,0,0)';
+  // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
+  this.animationItem.wrapper.appendChild(this.svgElement);
+  // Mask animation
+  var defs = this.globalData.defs;
 
-    this.setupGlobalData(animData, defs);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.data = animData;
+  this.setupGlobalData(animData, defs);
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.data = animData;
 
-    var maskElement = createNS( 'clipPath');
-    var rect = createNS('rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = createElementID();
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+  var maskElement = createNS('clipPath');
+  var rect = createNS('rect');
+  rect.setAttribute('width', animData.w);
+  rect.setAttribute('height', animData.h);
+  rect.setAttribute('x', 0);
+  rect.setAttribute('y', 0);
+  var maskId = createElementID();
+  maskElement.setAttribute('id', maskId);
+  maskElement.appendChild(rect);
+  this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + maskId + ')');
 
-    defs.appendChild(maskElement);
-    this.layers = animData.layers;
-    this.elements = createSizedArray(animData.layers.length);
+  defs.appendChild(maskElement);
+  this.layers = animData.layers;
+  this.elements = createSizedArray(animData.layers.length);
 };
 
-
 SVGRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.layerElement = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 SVGRenderer.prototype.updateContainerSize = function () {
 };
 
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
+SVGRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  elements[pos] = true;
+  var element = this.createItem(this.layers[pos]);
 
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
+  elements[pos] = element;
+  if (expressionsPlugin) {
+    if (this.layers[pos].ty === 0) {
+      this.globalData.projectInterface.registerComposition(element);
     }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
+    element.initExpressions();
+  }
+  this.appendElementInPos(element, pos);
+  if (this.layers[pos].tt) {
+    if (!this.elements[pos - 1] || this.elements[pos - 1] === true) {
+      this.buildItem(pos - 1);
+      this.addPendingElement(element);
+    } else {
+      element.setMatte(elements[pos - 1].layerId);
     }
+  }
 };
 
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame === num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    // console.log('-------');
-    // console.log('FRAME ',num);
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    this.globalData._mdf = false;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    if(this.globalData._mdf) {
-        for (i = 0; i < len; i += 1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
+SVGRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+    if (element.data.tt) {
+      var i = 0;
+      var len = this.elements.length;
+      while (i < len) {
+        if (this.elements[i] === element) {
+          element.setMatte(this.elements[i - 1].layerId);
+          break;
         }
         i += 1;
+      }
     }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
-    } else {
-        this.layerElement.appendChild(newElement);
-    }
+  }
 };
 
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
-};
-
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
-};
-
-function CanvasRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.renderConfig = {
-        clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
-        context: (config && config.context) || null,
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-    };
-    this.renderConfig.dpr = (config && config.dpr) || 1;
-    if (this.animationItem.wrapper) {
-        this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
+SVGRenderer.prototype.renderFrame = function (num) {
+  if (this.renderedFrame === num || this.destroyed) {
+    return;
+  }
+  if (num === null) {
+    num = this.renderedFrame;
+  } else {
+    this.renderedFrame = num;
+  }
+  // console.log('-------');
+  // console.log('FRAME ',num);
+  this.globalData.frameNum = num;
+  this.globalData.frameId += 1;
+  this.globalData.projectInterface.currentFrame = num;
+  this.globalData._mdf = false;
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
-    this.renderedFrame = -1;
-    this.globalData = {
-        frameNum: -1,
-        _mdf: false,
-        renderConfig: this.renderConfig,
-        currentGlobalAlpha: -1
-    };
-    this.contextData = new CVContextData();
-    this.elements = [];
-    this.pendingElements = [];
-    this.transformMat = new Matrix();
-    this.completeLayers = false;
-    this.rendererType = 'canvas';
+  }
+  if (this.globalData._mdf) {
+    for (i = 0; i < len; i += 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+  }
+};
+
+SVGRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newElement = element.getBaseElement();
+  if (!newElement) {
+    return;
+  }
+  var i = 0;
+  var nextElement;
+  while (i < pos) {
+    if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
+      nextElement = this.elements[i].getBaseElement();
+    }
+    i += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(newElement, nextElement);
+  } else {
+    this.layerElement.appendChild(newElement);
+  }
+};
+
+SVGRenderer.prototype.hide = function () {
+  this.layerElement.style.display = 'none';
+};
+
+SVGRenderer.prototype.show = function () {
+  this.layerElement.style.display = 'block';
+};
+
+/* global CVContextData, Matrix, extendPrototype, BaseRenderer, CVShapeElement, CVTextElement,
+CVImageElement, CVCompElement, CVSolidElement, SVGRenderer, createTag, createSizedArray */
+
+function CanvasRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.renderConfig = {
+    clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
+    context: (config && config.context) || null,
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+  };
+  this.renderConfig.dpr = (config && config.dpr) || 1;
+  if (this.animationItem.wrapper) {
+    this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
+  }
+  this.renderedFrame = -1;
+  this.globalData = {
+    frameNum: -1,
+    _mdf: false,
+    renderConfig: this.renderConfig,
+    currentGlobalAlpha: -1,
+  };
+  this.contextData = new CVContextData();
+  this.elements = [];
+  this.pendingElements = [];
+  this.transformMat = new Matrix();
+  this.completeLayers = false;
+  this.rendererType = 'canvas';
 }
-extendPrototype([BaseRenderer],CanvasRenderer);
+extendPrototype([BaseRenderer], CanvasRenderer);
 
 CanvasRenderer.prototype.createShape = function (data) {
-    return new CVShapeElement(data, this.globalData, this);
+  return new CVShapeElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createText = function (data) {
-    return new CVTextElement(data, this.globalData, this);
+  return new CVTextElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createImage = function (data) {
-    return new CVImageElement(data, this.globalData, this);
+  return new CVImageElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createComp = function (data) {
-    return new CVCompElement(data, this.globalData, this);
+  return new CVCompElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createSolid = function (data) {
-    return new CVSolidElement(data, this.globalData, this);
+  return new CVSolidElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
 
-CanvasRenderer.prototype.ctxTransform = function(props){
-    if(props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0){
-        return;
-    }
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.transform(props[0],props[1],props[4],props[5],props[12],props[13]);
-        return;
-    }
-    this.transformMat.cloneFromProps(props);
-    var cProps = this.contextData.cTr.props;
-    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]);
-    //this.contextData.cTr.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]);
-    this.contextData.cTr.cloneFromProps(this.transformMat.props);
-    var trProps = this.contextData.cTr.props;
-    this.canvasContext.setTransform(trProps[0],trProps[1],trProps[4],trProps[5],trProps[12],trProps[13]);
+CanvasRenderer.prototype.ctxTransform = function (props) {
+  if (props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0) {
+    return;
+  }
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.transform(props[0], props[1], props[4], props[5], props[12], props[13]);
+    return;
+  }
+  this.transformMat.cloneFromProps(props);
+  var cProps = this.contextData.cTr.props;
+  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]);
+  // this.contextData.cTr.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]);
+  this.contextData.cTr.cloneFromProps(this.transformMat.props);
+  var trProps = this.contextData.cTr.props;
+  this.canvasContext.setTransform(trProps[0], trProps[1], trProps[4], trProps[5], trProps[12], trProps[13]);
 };
 
-CanvasRenderer.prototype.ctxOpacity = function(op){
-    /*if(op === 1){
+CanvasRenderer.prototype.ctxOpacity = function (op) {
+  /* if(op === 1){
         return;
-    }*/
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
-        this.globalData.currentGlobalAlpha = this.contextData.cO;
-        return;
-    }
-    this.contextData.cO *= op < 0 ? 0 : op;
-    if(this.globalData.currentGlobalAlpha !== this.contextData.cO) {
-        this.canvasContext.globalAlpha = this.contextData.cO;
-        this.globalData.currentGlobalAlpha = this.contextData.cO;
-    }
+    } */
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
+    this.globalData.currentGlobalAlpha = this.contextData.cO;
+    return;
+  }
+  this.contextData.cO *= op < 0 ? 0 : op;
+  if (this.globalData.currentGlobalAlpha !== this.contextData.cO) {
+    this.canvasContext.globalAlpha = this.contextData.cO;
+    this.globalData.currentGlobalAlpha = this.contextData.cO;
+  }
 };
 
-CanvasRenderer.prototype.reset = function(){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.restore();
-        return;
-    }
-    this.contextData.reset();
+CanvasRenderer.prototype.reset = function () {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.restore();
+    return;
+  }
+  this.contextData.reset();
 };
 
-CanvasRenderer.prototype.save = function(actionFlag){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.save();
-        return;
-    }
-    if(actionFlag){
-        this.canvasContext.save();
-    }
-    var props = this.contextData.cTr.props;
-    if(this.contextData._length <= this.contextData.cArrPos) {
-        this.contextData.duplicate();
-    }
-    var i, arr = this.contextData.saved[this.contextData.cArrPos];
-    for (i = 0; i < 16; i += 1) {
-        arr[i] = props[i];
-    }
-    this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
-    this.contextData.cArrPos += 1;
+CanvasRenderer.prototype.save = function (actionFlag) {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.save();
+    return;
+  }
+  if (actionFlag) {
+    this.canvasContext.save();
+  }
+  var props = this.contextData.cTr.props;
+  if (this.contextData._length <= this.contextData.cArrPos) {
+    this.contextData.duplicate();
+  }
+  var i;
+  var arr = this.contextData.saved[this.contextData.cArrPos];
+  for (i = 0; i < 16; i += 1) {
+    arr[i] = props[i];
+  }
+  this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
+  this.contextData.cArrPos += 1;
 };
 
-CanvasRenderer.prototype.restore = function(actionFlag){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.restore();
-        return;
-    }
-    if(actionFlag){
-        this.canvasContext.restore();
-        this.globalData.blendMode = 'source-over';
-    }
-    this.contextData.cArrPos -= 1;
-    var popped = this.contextData.saved[this.contextData.cArrPos];
-    var i,arr = this.contextData.cTr.props;
-    for(i=0;i<16;i+=1){
-        arr[i] = popped[i];
-    }
-    this.canvasContext.setTransform(popped[0],popped[1],popped[4],popped[5],popped[12],popped[13]);
-    popped = this.contextData.savedOp[this.contextData.cArrPos];
-    this.contextData.cO = popped;
-    if(this.globalData.currentGlobalAlpha !== popped) {
-        this.canvasContext.globalAlpha = popped;
-        this.globalData.currentGlobalAlpha = popped;
-    }
+CanvasRenderer.prototype.restore = function (actionFlag) {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.restore();
+    return;
+  }
+  if (actionFlag) {
+    this.canvasContext.restore();
+    this.globalData.blendMode = 'source-over';
+  }
+  this.contextData.cArrPos -= 1;
+  var popped = this.contextData.saved[this.contextData.cArrPos];
+  var i;
+  var arr = this.contextData.cTr.props;
+  for (i = 0; i < 16; i += 1) {
+    arr[i] = popped[i];
+  }
+  this.canvasContext.setTransform(popped[0], popped[1], popped[4], popped[5], popped[12], popped[13]);
+  popped = this.contextData.savedOp[this.contextData.cArrPos];
+  this.contextData.cO = popped;
+  if (this.globalData.currentGlobalAlpha !== popped) {
+    this.canvasContext.globalAlpha = popped;
+    this.globalData.currentGlobalAlpha = popped;
+  }
 };
 
-CanvasRenderer.prototype.configAnimation = function(animData){
-    if(this.animationItem.wrapper){
-        this.animationItem.container = createTag('canvas');
-        this.animationItem.container.style.width = '100%';
-        this.animationItem.container.style.height = '100%';
-        //this.animationItem.container.style.transform = 'translate3d(0,0,0)';
-        //this.animationItem.container.style.webkitTransform = 'translate3d(0,0,0)';
-        this.animationItem.container.style.transformOrigin = this.animationItem.container.style.mozTransformOrigin = this.animationItem.container.style.webkitTransformOrigin = this.animationItem.container.style['-webkit-transform'] = "0px 0px 0px";
-        this.animationItem.wrapper.appendChild(this.animationItem.container);
-        this.canvasContext = this.animationItem.container.getContext('2d');
-        if(this.renderConfig.className) {
-            this.animationItem.container.setAttribute('class', this.renderConfig.className);
-        }
-        if(this.renderConfig.id) {
-            this.animationItem.container.setAttribute('id', this.renderConfig.id);
-        }
-    }else{
-        this.canvasContext = this.renderConfig.context;
+CanvasRenderer.prototype.configAnimation = function (animData) {
+  if (this.animationItem.wrapper) {
+    this.animationItem.container = createTag('canvas');
+    var containerStyle = this.animationItem.container.style;
+    containerStyle.width = '100%';
+    containerStyle.height = '100%';
+    var origin = '0px 0px 0px';
+    containerStyle.transformOrigin = origin;
+    containerStyle.mozTransformOrigin = origin;
+    containerStyle.webkitTransformOrigin = origin;
+    containerStyle['-webkit-transform'] = origin;
+    this.animationItem.wrapper.appendChild(this.animationItem.container);
+    this.canvasContext = this.animationItem.container.getContext('2d');
+    if (this.renderConfig.className) {
+      this.animationItem.container.setAttribute('class', this.renderConfig.className);
     }
-    this.data = animData;
-    this.layers = animData.layers;
-    this.transformCanvas = {
-        w: animData.w,
-        h:animData.h,
-        sx:0,
-        sy:0,
-        tx:0,
-        ty:0
-    };
-    this.setupGlobalData(animData, document.body);
-    this.globalData.canvasContext = this.canvasContext;
-    this.globalData.renderer = this;
-    this.globalData.isDashed = false;
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.globalData.transformCanvas = this.transformCanvas;
-    this.elements = createSizedArray(animData.layers.length);
+    if (this.renderConfig.id) {
+      this.animationItem.container.setAttribute('id', this.renderConfig.id);
+    }
+  } else {
+    this.canvasContext = this.renderConfig.context;
+  }
+  this.data = animData;
+  this.layers = animData.layers;
+  this.transformCanvas = {
+    w: animData.w,
+    h: animData.h,
+    sx: 0,
+    sy: 0,
+    tx: 0,
+    ty: 0,
+  };
+  this.setupGlobalData(animData, document.body);
+  this.globalData.canvasContext = this.canvasContext;
+  this.globalData.renderer = this;
+  this.globalData.isDashed = false;
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.globalData.transformCanvas = this.transformCanvas;
+  this.elements = createSizedArray(animData.layers.length);
 
-    this.updateContainerSize();
+  this.updateContainerSize();
 };
 
 CanvasRenderer.prototype.updateContainerSize = function () {
-    this.reset();
-    var elementWidth,elementHeight;
-    if(this.animationItem.wrapper && this.animationItem.container){
-        elementWidth = this.animationItem.wrapper.offsetWidth;
-        elementHeight = this.animationItem.wrapper.offsetHeight;
-        this.animationItem.container.setAttribute('width',elementWidth * this.renderConfig.dpr );
-        this.animationItem.container.setAttribute('height',elementHeight * this.renderConfig.dpr);
-    }else{
-        elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
-        elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
+  this.reset();
+  var elementWidth;
+  var elementHeight;
+  if (this.animationItem.wrapper && this.animationItem.container) {
+    elementWidth = this.animationItem.wrapper.offsetWidth;
+    elementHeight = this.animationItem.wrapper.offsetHeight;
+    this.animationItem.container.setAttribute('width', elementWidth * this.renderConfig.dpr);
+    this.animationItem.container.setAttribute('height', elementHeight * this.renderConfig.dpr);
+  } else {
+    elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
+    elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
+  }
+  var elementRel;
+  var animationRel;
+  if (this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1) {
+    var par = this.renderConfig.preserveAspectRatio.split(' ');
+    var fillType = par[1] || 'meet';
+    var pos = par[0] || 'xMidYMid';
+    var xPos = pos.substr(0, 4);
+    var yPos = pos.substr(4);
+    elementRel = elementWidth / elementHeight;
+    animationRel = this.transformCanvas.w / this.transformCanvas.h;
+    if ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice')) {
+      this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+      this.transformCanvas.sy = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+    } else {
+      this.transformCanvas.sx = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
+      this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
     }
-    var elementRel,animationRel;
-    if(this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1){
-        var par = this.renderConfig.preserveAspectRatio.split(' ');
-        var fillType = par[1] || 'meet';
-        var pos = par[0] || 'xMidYMid';
-        var xPos = pos.substr(0,4);
-        var yPos = pos.substr(4);
-        elementRel = elementWidth/elementHeight;
-        animationRel = this.transformCanvas.w/this.transformCanvas.h;
-        if(animationRel>elementRel && fillType === 'meet' || animationRel<elementRel && fillType === 'slice'){
-            this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-            this.transformCanvas.sy = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-        }else{
-            this.transformCanvas.sx = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
-            this.transformCanvas.sy = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
-        }
 
-        if(xPos === 'xMid' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
-            this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))/2*this.renderConfig.dpr;
-        } else if(xPos === 'xMax' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
-            this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))*this.renderConfig.dpr;
-        } else {
-            this.transformCanvas.tx = 0;
-        }
-        if(yPos === 'YMid' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
-            this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w))/2)*this.renderConfig.dpr;
-        } else if(yPos === 'YMax' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
-            this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w)))*this.renderConfig.dpr;
-        } else {
-            this.transformCanvas.ty = 0;
-        }
-
-    }else if(this.renderConfig.preserveAspectRatio == 'none'){
-        this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-        this.transformCanvas.sy = elementHeight/(this.transformCanvas.h/this.renderConfig.dpr);
-        this.transformCanvas.tx = 0;
-        this.transformCanvas.ty = 0;
-    }else{
-        this.transformCanvas.sx = this.renderConfig.dpr;
-        this.transformCanvas.sy = this.renderConfig.dpr;
-        this.transformCanvas.tx = 0;
-        this.transformCanvas.ty = 0;
+    if (xPos === 'xMid' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) {
+      this.transformCanvas.tx = ((elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) / 2) * this.renderConfig.dpr;
+    } else if (xPos === 'xMax' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) {
+      this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) * this.renderConfig.dpr;
+    } else {
+      this.transformCanvas.tx = 0;
     }
-    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];
-    /*var i, len = this.elements.length;
+    if (yPos === 'YMid' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) {
+      this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) / 2) * this.renderConfig.dpr;
+    } else if (yPos === 'YMax' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) {
+      this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w))) * this.renderConfig.dpr;
+    } else {
+      this.transformCanvas.ty = 0;
+    }
+  } else if (this.renderConfig.preserveAspectRatio === 'none') {
+    this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+    this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
+    this.transformCanvas.tx = 0;
+    this.transformCanvas.ty = 0;
+  } else {
+    this.transformCanvas.sx = this.renderConfig.dpr;
+    this.transformCanvas.sy = this.renderConfig.dpr;
+    this.transformCanvas.tx = 0;
+    this.transformCanvas.ty = 0;
+  }
+  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];
+  /* var i, len = this.elements.length;
     for(i=0;i<len;i+=1){
         if(this.elements[i] && this.elements[i].data.ty === 0){
             this.elements[i].resize(this.globalData.transformCanvas);
         }
-    }*/
-    this.ctxTransform(this.transformCanvas.props);
-    this.canvasContext.beginPath();
-    this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
-    this.canvasContext.closePath();
-    this.canvasContext.clip();
+    } */
+  this.ctxTransform(this.transformCanvas.props);
+  this.canvasContext.beginPath();
+  this.canvasContext.rect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+  this.canvasContext.closePath();
+  this.canvasContext.clip();
 
-    this.renderFrame(this.renderedFrame, true);
+  this.renderFrame(this.renderedFrame, true);
 };
 
 CanvasRenderer.prototype.destroy = function () {
-    if(this.renderConfig.clearCanvas && this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.renderConfig.clearCanvas && this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = len - 1; i >= 0; i-=1) {
-        if(this.elements[i]) {
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.globalData.canvasContext = null;
-    this.animationItem.container = null;
-    this.destroyed = true;
+  }
+  this.elements.length = 0;
+  this.globalData.canvasContext = null;
+  this.animationItem.container = null;
+  this.destroyed = true;
 };
 
-CanvasRenderer.prototype.renderFrame = function(num, forceRender){
-    if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){
-        return;
-    }
-    this.renderedFrame = num;
-    this.globalData.frameNum = num - this.animationItem._isFirstFrame;
-    this.globalData.frameId += 1;
-    this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
-    this.globalData.projectInterface.currentFrame = num;
+CanvasRenderer.prototype.renderFrame = function (num, forceRender) {
+  if ((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1) {
+    return;
+  }
+  this.renderedFrame = num;
+  this.globalData.frameNum = num - this.animationItem._isFirstFrame;
+  this.globalData.frameId += 1;
+  this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
+  this.globalData.projectInterface.currentFrame = num;
 
-     // console.log('--------');
-     // console.log('NEW: ',num);
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
+  // console.log('--------');
+  // console.log('NEW: ',num);
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
 
-    for (i = 0; i < len; i++) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
-    if(this.globalData._mdf) {
-        if(this.renderConfig.clearCanvas === true){
-            this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
-        }else{
-            this.save();
-        }
-        for (i = len - 1; i >= 0; i-=1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-        if(this.renderConfig.clearCanvas !== true){
-            this.restore();
-        }
+  }
+  if (this.globalData._mdf) {
+    if (this.renderConfig.clearCanvas === true) {
+      this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+    } else {
+      this.save();
     }
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+    if (this.renderConfig.clearCanvas !== true) {
+      this.restore();
+    }
+  }
 };
 
-CanvasRenderer.prototype.buildItem = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    var element = this.createItem(this.layers[pos], this,this.globalData);
-    elements[pos] = element;
-    element.initExpressions();
-    /*if(this.layers[pos].ty === 0){
+CanvasRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  var element = this.createItem(this.layers[pos], this, this.globalData);
+  elements[pos] = element;
+  element.initExpressions();
+  /* if(this.layers[pos].ty === 0){
         element.resize(this.globalData.transformCanvas);
-    }*/
+    } */
 };
 
-CanvasRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-    }
+CanvasRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+  }
 };
 
-CanvasRenderer.prototype.hide = function(){
-    this.animationItem.container.style.display = 'none';
+CanvasRenderer.prototype.hide = function () {
+  this.animationItem.container.style.display = 'none';
 };
 
-CanvasRenderer.prototype.show = function(){
-    this.animationItem.container.style.display = 'block';
+CanvasRenderer.prototype.show = function () {
+  this.animationItem.container.style.display = 'block';
 };
 
-function MaskElement(data,element,globalData) {
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties || [];
-    this.maskElement = null;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties ? this.masksProperties.length : 0;
-    this.viewData = createSizedArray(len);
-    this.solidPath = '';
+/* global createSizedArray, createElementID, PropertyFactory, ShapePropertyFactory, createNS, locationHref */
 
+function MaskElement(data, element, globalData) {
+  this.data = data;
+  this.element = element;
+  this.globalData = globalData;
+  this.storedData = [];
+  this.masksProperties = this.data.masksProperties || [];
+  this.maskElement = null;
+  var defs = this.globalData.defs;
+  var i;
+  var len = this.masksProperties ? this.masksProperties.length : 0;
+  this.viewData = createSizedArray(len);
+  this.solidPath = '';
 
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = createElementID();
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
-            rect = createNS( 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w || 0);
-            rect.setAttribute('height', this.element.comp.data.h || 0);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = createNS( 'path');
-        if(properties[i].mode == 'n') {
-            // TODO move this to a factory or to a constructor
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-                elem: path,
-                lastPath: ''
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
-        path.setAttribute('clip-rule','nonzero');
-        var filterID;
-
-        if (properties[i].x.k !== 0) {
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
-            filterID = createElementID();
-            expansor = createNS('filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = createNS('feMorphology');
-            feMorph.setAttribute('operator','erode');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
-        } else {
-            feMorph = null;
-            x = null;
-        }
-
-        // TODO move this to a factory or to a constructor
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = createNS('g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = createNS('mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        // TODO move this to a factory or to a constructor
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-            invRect: rect
-        };
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
+  var path;
+  var properties = this.masksProperties;
+  var count = 0;
+  var currentMasks = [];
+  var j;
+  var jLen;
+  var layerId = createElementID();
+  var rect;
+  var expansor;
+  var feMorph;
+  var x;
+  var maskType = 'clipPath';
+  var maskRef = 'clip-path';
+  for (i = 0; i < len; i += 1) {
+    if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
+      maskType = 'mask';
+      maskRef = 'mask';
     }
 
-    this.maskElement = createNS( maskType);
-
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
+    if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
+      rect = createNS('rect');
+      rect.setAttribute('fill', '#ffffff');
+      rect.setAttribute('width', this.element.comp.data.w || 0);
+      rect.setAttribute('height', this.element.comp.data.h || 0);
+      currentMasks.push(rect);
+    } else {
+      rect = null;
     }
 
-    if(count > 0){
-        this.maskElement.setAttribute('id', layerId);
-        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
-        defs.appendChild(this.maskElement);
-    }
-    if (this.viewData.length) {
-        this.element.addRenderableComponent(this);
-    }
+    path = createNS('path');
+    if (properties[i].mode === 'n') {
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        elem: path,
+        lastPath: '',
+      };
+      defs.appendChild(path);
+    } else {
+      count += 1;
 
+      path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      path.setAttribute('clip-rule', 'nonzero');
+      var filterID;
+
+      if (properties[i].x.k !== 0) {
+        maskType = 'mask';
+        maskRef = 'mask';
+        x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
+        filterID = createElementID();
+        expansor = createNS('filter');
+        expansor.setAttribute('id', filterID);
+        feMorph = createNS('feMorphology');
+        feMorph.setAttribute('operator', 'erode');
+        feMorph.setAttribute('in', 'SourceGraphic');
+        feMorph.setAttribute('radius', '0');
+        expansor.appendChild(feMorph);
+        defs.appendChild(expansor);
+        path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      } else {
+        feMorph = null;
+        x = null;
+      }
+
+      // TODO move this to a factory or to a constructor
+      this.storedData[i] = {
+        elem: path,
+        x: x,
+        expan: feMorph,
+        lastPath: '',
+        lastOperator: '',
+        filterId: filterID,
+        lastRadius: 0,
+      };
+      if (properties[i].mode === 'i') {
+        jLen = currentMasks.length;
+        var g = createNS('g');
+        for (j = 0; j < jLen; j += 1) {
+          g.appendChild(currentMasks[j]);
+        }
+        var mask = createNS('mask');
+        mask.setAttribute('mask-type', 'alpha');
+        mask.setAttribute('id', layerId + '_' + count);
+        mask.appendChild(path);
+        defs.appendChild(mask);
+        g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
+
+        currentMasks.length = 0;
+        currentMasks.push(g);
+      } else {
+        currentMasks.push(path);
+      }
+      if (properties[i].inv && !this.solidPath) {
+        this.solidPath = this.createLayerSolidPath();
+      }
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        elem: path,
+        lastPath: '',
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        invRect: rect,
+      };
+      if (!this.viewData[i].prop.k) {
+        this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
+      }
+    }
+  }
+
+  this.maskElement = createNS(maskType);
+
+  len = currentMasks.length;
+  for (i = 0; i < len; i += 1) {
+    this.maskElement.appendChild(currentMasks[i]);
+  }
+
+  if (count > 0) {
+    this.maskElement.setAttribute('id', layerId);
+    this.element.maskedElement.setAttribute(maskRef, 'url(' + locationHref + '#' + layerId + ')');
+    defs.appendChild(this.maskElement);
+  }
+  if (this.viewData.length) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
+MaskElement.prototype.getMaskProperty = function (pos) {
+  return this.viewData[pos].prop;
 };
 
 MaskElement.prototype.renderFrame = function (isFirstFrame) {
-    var finalMat = this.element.finalTransform.mat;
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop._mdf || isFirstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op._mdf || isFirstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
-                this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
-            }
-            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
+  var finalMat = this.element.finalTransform.mat;
+  var i;
+  var len = this.masksProperties.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.viewData[i].prop._mdf || isFirstFrame) {
+      this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
     }
+    if (this.viewData[i].op._mdf || isFirstFrame) {
+      this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
+    }
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
+        this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
+      }
+      if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
+        var feMorph = this.storedData[i].expan;
+        if (this.storedData[i].x.v < 0) {
+          if (this.storedData[i].lastOperator !== 'erode') {
+            this.storedData[i].lastOperator = 'erode';
+            this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
+          }
+          feMorph.setAttribute('radius', -this.storedData[i].x.v);
+        } else {
+          if (this.storedData[i].lastOperator !== 'dilate') {
+            this.storedData[i].lastOperator = 'dilate';
+            this.storedData[i].elem.setAttribute('filter', null);
+          }
+          this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
+        }
+      }
+    }
+  }
 };
 
 MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
+  return this.maskElement;
 };
 
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
+MaskElement.prototype.createLayerSolidPath = function () {
+  var path = 'M0,0 ';
+  path += ' h' + this.globalData.compSize.w;
+  path += ' v' + this.globalData.compSize.h;
+  path += ' h-' + this.globalData.compSize.w;
+  path += ' v-' + this.globalData.compSize.h + ' ';
+  return path;
 };
 
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //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];
-        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];
-    }
-        //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];
-    if(pathNodes.c && len > 1){
-        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];
-    }
-    //pathNodes.__renderedString = pathString;
+MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
+  var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
+  var i;
+  var len;
+  len = pathNodes._length;
+  for (i = 1; i < len; i += 1) {
+    // 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];
+    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];
+  }
+  // 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];
+  if (pathNodes.c && len > 1) {
+    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];
+  }
+  // pathNodes.__renderedString = pathString;
 
-    if(viewData.lastPath !== pathString){
-        var pathShapeValue = '';
-        if(viewData.elem){
-            if(pathNodes.c){
-                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
-            }
-            viewData.elem.setAttribute('d',pathShapeValue);
-        }
-        viewData.lastPath = pathString;
+  if (viewData.lastPath !== pathString) {
+    var pathShapeValue = '';
+    if (viewData.elem) {
+      if (pathNodes.c) {
+        pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
+      }
+      viewData.elem.setAttribute('d', pathShapeValue);
     }
+    viewData.lastPath = pathString;
+  }
 };
 
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.masksProperties = null;
+MaskElement.prototype.destroy = function () {
+  this.element = null;
+  this.globalData = null;
+  this.maskElement = null;
+  this.data = null;
+  this.masksProperties = null;
 };
 
 /**
- * @file 
+ * @file
  * Handles AE's layer parenting property.
  *
  */
 
-function HierarchyElement(){}
+function HierarchyElement() {}
 
 HierarchyElement.prototype = {
-	/**
-     * @function 
+  /**
+     * @function
      * Initializes hierarchy properties
      *
      */
-	initHierarchy: function() {
-		//element's parent list
-	    this.hierarchy = [];
-	    //if element is parent of another layer _isParent will be true
-	    this._isParent = false;
-	    this.checkParenting();
-	},
-	/**
-     * @function 
+  initHierarchy: function () {
+    // element's parent list
+    this.hierarchy = [];
+    // if element is parent of another layer _isParent will be true
+    this._isParent = false;
+    this.checkParenting();
+  },
+  /**
+     * @function
      * Sets layer's hierarchy.
      * @param {array} hierarch
      * layer's parent list
      *
-     */ 
-	setHierarchy: function(hierarchy){
-	    this.hierarchy = hierarchy;
-	},
-	/**
-     * @function 
+     */
+  setHierarchy: function (hierarchy) {
+    this.hierarchy = hierarchy;
+  },
+  /**
+     * @function
      * Sets layer as parent.
      *
-     */ 
-	setAsParent: function() {
-	    this._isParent = true;
-	},
-	/**
-     * @function 
+     */
+  setAsParent: function () {
+    this._isParent = true;
+  },
+  /**
+     * @function
      * Searches layer's parenting chain
      *
-     */ 
-	checkParenting: function(){
-	    if (this.data.parent !== undefined){
-	        this.comp.buildElementParenting(this, this.data.parent, []);
-	    }
-	}
+     */
+  checkParenting: function () {
+    if (this.data.parent !== undefined) {
+      this.comp.buildElementParenting(this, this.data.parent, []);
+    }
+  },
 };
+
 /**
- * @file 
+ * @file
  * Handles element's layer frame update.
  * Checks layer in point and out point
  *
  */
 
-function FrameElement(){}
+function FrameElement() {}
 
 FrameElement.prototype = {
-    /**
-     * @function 
+  /**
+     * @function
      * Initializes frame related properties.
      *
      */
-    initFrame: function(){
-        //set to true when inpoint is rendered
-        this._isFirstFrame = false;
-        //list of animated properties
-        this.dynamicProperties = [];
-        // If layer has been modified in current tick this will be true
-        this._mdf = false;
-    },
-    /**
-     * @function 
+  initFrame: function () {
+    // set to true when inpoint is rendered
+    this._isFirstFrame = false;
+    // list of animated properties
+    this.dynamicProperties = [];
+    // If layer has been modified in current tick this will be true
+    this._mdf = false;
+  },
+  /**
+     * @function
      * Calculates all dynamic values
      *
      * @param {number} num
      * current frame number in Layer's time
      * @param {boolean} isVisible
      * if layers is currently in range
-     * 
+     *
      */
-    prepareProperties: function(num, isVisible) {
-        var i, len = this.dynamicProperties.length;
-        for (i = 0;i < len; i += 1) {
-            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i]._mdf) {
-                    this.globalData._mdf = true;
-                    this._mdf = true;
-                }
-            }
+  prepareProperties: function (num, isVisible) {
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+        this.dynamicProperties[i].getValue();
+        if (this.dynamicProperties[i]._mdf) {
+          this.globalData._mdf = true;
+          this._mdf = true;
         }
-    },
-    addDynamicProperty: function(prop) {
-        if(this.dynamicProperties.indexOf(prop) === -1) {
-            this.dynamicProperties.push(prop);
-        }
+      }
     }
+  },
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+    }
+  },
 };
-function TransformElement(){}
+
+/* global TransformPropertyFactory, Matrix */
+
+function TransformElement() {}
 
 TransformElement.prototype = {
-    initTransform: function() {
-        this.finalTransform = {
-            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
-            _matMdf: false,
-            _opMdf: false,
-            mat: new Matrix()
-        };
-        if (this.data.ao) {
-            this.finalTransform.mProp.autoOriented = true;
-        }
+  initTransform: function () {
+    this.finalTransform = {
+      mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 },
+      _matMdf: false,
+      _opMdf: false,
+      mat: new Matrix(),
+    };
+    if (this.data.ao) {
+      this.finalTransform.mProp.autoOriented = true;
+    }
 
-        //TODO: check TYPE 11: Guided elements
-        if (this.data.ty !== 11) {
-            //this.createElements();
-        }
-    },
-    renderTransform: function() {
+    // TODO: check TYPE 11: Guided elements
+    if (this.data.ty !== 11) {
+      // this.createElements();
+    }
+  },
+  renderTransform: function () {
+    this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+    this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
 
-        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
-        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+    if (this.hierarchy) {
+      var mat;
+      var finalMat = this.finalTransform.mat;
+      var i = 0;
+      var len = this.hierarchy.length;
+      // Checking if any of the transformation matrices in the hierarchy chain has changed.
+      if (!this.finalTransform._matMdf) {
+        while (i < len) {
+          if (this.hierarchy[i].finalTransform.mProp._mdf) {
+            this.finalTransform._matMdf = true;
+            break;
+          }
+          i += 1;
+        }
+      }
 
-        if (this.hierarchy) {
-            var mat;
-            var finalMat = this.finalTransform.mat;
-            var i = 0, len = this.hierarchy.length;
-            //Checking if any of the transformation matrices in the hierarchy chain has changed.
-            if (!this.finalTransform._matMdf) {
-                while (i < len) {
-                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
-                        this.finalTransform._matMdf = true;
-                        break;
-                    }
-                    i += 1;
-                }
-            }
-            
-            if (this.finalTransform._matMdf) {
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-                for (i = 0; i < len; i += 1) {
-                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                    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]);
-                }
-            }
-        }
-    },
-    globalToLocal: function(pt) {
-        var transforms = [];
-        transforms.push(this.finalTransform);
-        var flag = true;
-        var comp = this.comp;
-        while (flag) {
-            if (comp.finalTransform) {
-                if (comp.data.hasMask) {
-                    transforms.splice(0, 0, comp.finalTransform);
-                }
-                comp = comp.comp;
-            } else {
-                flag = false;
-            }
-        }
-        var i, len = transforms.length,ptNew;
+      if (this.finalTransform._matMdf) {
+        mat = this.finalTransform.mProp.v.props;
+        finalMat.cloneFromProps(mat);
         for (i = 0; i < len; i += 1) {
-            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
-            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+          mat = this.hierarchy[i].finalTransform.mProp.v.props;
+          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]);
         }
-        return pt;
-    },
-    mHelper: new Matrix()
+      }
+    }
+  },
+  globalToLocal: function (pt) {
+    var transforms = [];
+    transforms.push(this.finalTransform);
+    var flag = true;
+    var comp = this.comp;
+    while (flag) {
+      if (comp.finalTransform) {
+        if (comp.data.hasMask) {
+          transforms.splice(0, 0, comp.finalTransform);
+        }
+        comp = comp.comp;
+      } else {
+        flag = false;
+      }
+    }
+    var i;
+    var len = transforms.length;
+    var ptNew;
+    for (i = 0; i < len; i += 1) {
+      ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+      // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+      pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+    }
+    return pt;
+  },
+  mHelper: new Matrix(),
 };
-function RenderableElement(){
+
+function RenderableElement() {
 
 }
 
 RenderableElement.prototype = {
-    initRenderable: function() {
-        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
-        this.isInRange = false;
-        //layer's display state
-        this.hidden = false;
-        // If layer's transparency equals 0, it can be hidden
-        this.isTransparent = false;
-        //list of animated components
-        this.renderableComponents = [];
-    },
-    addRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) === -1) {
-            this.renderableComponents.push(component);
-        }
-    },
-    removeRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) !== -1) {
-            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
-        }
-    },
-    prepareRenderableFrame: function(num) {
-        this.checkLayerLimits(num);
-    },
-    checkTransparency: function(){
-        if(this.finalTransform.mProp.o.v <= 0) {
-            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
-                this.isTransparent = true;
-                this.hide();
-            }
-        } else if(this.isTransparent) {
-            this.isTransparent = false;
-            this.show();
-        }
-    },
-    /**
-     * @function 
+  initRenderable: function () {
+    // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+    this.isInRange = false;
+    // layer's display state
+    this.hidden = false;
+    // If layer's transparency equals 0, it can be hidden
+    this.isTransparent = false;
+    // list of animated components
+    this.renderableComponents = [];
+  },
+  addRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) === -1) {
+      this.renderableComponents.push(component);
+    }
+  },
+  removeRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) !== -1) {
+      this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+    }
+  },
+  prepareRenderableFrame: function (num) {
+    this.checkLayerLimits(num);
+  },
+  checkTransparency: function () {
+    if (this.finalTransform.mProp.o.v <= 0) {
+      if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
+        this.isTransparent = true;
+        this.hide();
+      }
+    } else if (this.isTransparent) {
+      this.isTransparent = false;
+      this.show();
+    }
+  },
+  /**
+     * @function
      * Initializes frame related properties.
      *
      * @param {number} num
      * current frame number in Layer's time
-     * 
+     *
      */
-    checkLayerLimits: function(num) {
-        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-        {
-            if(this.isInRange !== true){
-                this.globalData._mdf = true;
-                this._mdf = true;
-                this.isInRange = true;
-                this.show();
-            }
-        } else {
-            if(this.isInRange !== false){
-                this.globalData._mdf = true;
-                this.isInRange = false;
-                this.hide();
-            }
-        }
-    },
-    renderRenderable: function() {
-        var i, len = this.renderableComponents.length;
-        for(i = 0; i < len; i += 1) {
-            this.renderableComponents[i].renderFrame(this._isFirstFrame);
-        }
-        /*this.maskManager.renderFrame(this.finalTransform.mat);
-        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
-    },
-    sourceRectAtTime: function(){
-        return {
-            top:0,
-            left:0,
-            width:100,
-            height:100
-        };
-    },
-    getLayerSize: function(){
-        if(this.data.ty === 5){
-            return {w:this.data.textData.width,h:this.data.textData.height};
-        }else{
-            return {w:this.data.width,h:this.data.height};
-        }
+  checkLayerLimits: function (num) {
+    if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
+      if (this.isInRange !== true) {
+        this.globalData._mdf = true;
+        this._mdf = true;
+        this.isInRange = true;
+        this.show();
+      }
+    } else if (this.isInRange !== false) {
+      this.globalData._mdf = true;
+      this.isInRange = false;
+      this.hide();
     }
+  },
+  renderRenderable: function () {
+    var i;
+    var len = this.renderableComponents.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderableComponents[i].renderFrame(this._isFirstFrame);
+    }
+    /* this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
+  },
+  sourceRectAtTime: function () {
+    return {
+      top: 0,
+      left: 0,
+      width: 100,
+      height: 100,
+    };
+  },
+  getLayerSize: function () {
+    if (this.data.ty === 5) {
+      return { w: this.data.textData.width, h: this.data.textData.height };
+    }
+    return { w: this.data.width, h: this.data.height };
+  },
 };
+
+/* global extendPrototype, RenderableElement, createProxyFunction */
+
 function RenderableDOMElement() {}
 
-(function(){
-    var _prototype = {
-        initElement: function(data,globalData,comp) {
-            this.initFrame();
-            this.initBaseData(data, globalData, comp);
-            this.initTransform(data, globalData, comp);
-            this.initHierarchy();
-            this.initRenderable();
-            this.initRendererElement();
-            this.createContainerElements();
-            this.createRenderableComponents();
-            this.createContent();
-            this.hide();
-        },
-        hide: function(){
-            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-                var elem = this.baseElement || this.layerElement;
-                elem.style.display = 'none';
-                this.hidden = true;
-            }
-        },
-        show: function(){
-            if (this.isInRange && !this.isTransparent){
-                if (!this.data.hd) {
-                    var elem = this.baseElement || this.layerElement;
-                    elem.style.display = 'block';
-                }
-                this.hidden = false;
-                this._isFirstFrame = true;
-            }
-        },
-        renderFrame: function() {
-            //If it is exported as hidden (data.hd === true) no need to render
-            //If it is not visible no need to render
-            if (this.data.hd || this.hidden) {
-                return;
-            }
-            this.renderTransform();
-            this.renderRenderable();
-            this.renderElement();
-            this.renderInnerContent();
-            if (this._isFirstFrame) {
-                this._isFirstFrame = false;
-            }
-        },
-        renderInnerContent: function() {},
-        prepareFrame: function(num) {
-            this._mdf = false;
-            this.prepareRenderableFrame(num);
-            this.prepareProperties(num, this.isInRange);
-            this.checkTransparency();
-        },
-        destroy: function(){
-            this.innerElem =  null;
-            this.destroyBaseElement();
+(function () {
+  var _prototype = {
+    initElement: function (data, globalData, comp) {
+      this.initFrame();
+      this.initBaseData(data, globalData, comp);
+      this.initTransform(data, globalData, comp);
+      this.initHierarchy();
+      this.initRenderable();
+      this.initRendererElement();
+      this.createContainerElements();
+      this.createRenderableComponents();
+      this.createContent();
+      this.hide();
+    },
+    hide: function () {
+      if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+        var elem = this.baseElement || this.layerElement;
+        elem.style.display = 'none';
+        this.hidden = true;
+      }
+    },
+    show: function () {
+      if (this.isInRange && !this.isTransparent) {
+        if (!this.data.hd) {
+          var elem = this.baseElement || this.layerElement;
+          elem.style.display = 'block';
         }
-    };
-    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+        this.hidden = false;
+        this._isFirstFrame = true;
+      }
+    },
+    renderFrame: function () {
+      // If it is exported as hidden (data.hd === true) no need to render
+      // If it is not visible no need to render
+      if (this.data.hd || this.hidden) {
+        return;
+      }
+      this.renderTransform();
+      this.renderRenderable();
+      this.renderElement();
+      this.renderInnerContent();
+      if (this._isFirstFrame) {
+        this._isFirstFrame = false;
+      }
+    },
+    renderInnerContent: function () {},
+    prepareFrame: function (num) {
+      this._mdf = false;
+      this.prepareRenderableFrame(num);
+      this.prepareProperties(num, this.isInRange);
+      this.checkTransparency();
+    },
+    destroy: function () {
+      this.innerElem = null;
+      this.destroyBaseElement();
+    },
+  };
+  extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
 }());
+
+/* exported ProcessedElement */
+
 function ProcessedElement(element, position) {
-	this.elem = element;
-	this.pos = position;
-}
-function SVGShapeData(transformers, level, shape) {
-    this.caches = [];
-    this.styles = [];
-    this.transformers = transformers;
-    this.lStr = '';
-    this.sh = shape;
-    this.lvl = level;
-    //TODO find if there are some cases where _isAnimated can be false. 
-    // For now, since shapes add up with other shapes. They have to be calculated every time.
-    // One way of finding out is checking if all styles associated to this shape depend only of this shape
-    this._isAnimated = !!shape.k;
-    // TODO: commenting this for now since all shapes are animated
-    var i = 0, len = transformers.length;
-    while(i < len) {
-    	if(transformers[i].mProps.dynamicProperties.length) {
-    		this._isAnimated = true;
-    		break;
-    	}
-    	i += 1;
-    }
+  this.elem = element;
+  this.pos = position;
 }
 
-SVGShapeData.prototype.setAsAnimated = function() {
-    this._isAnimated = true;
+function SVGShapeData(transformers, level, shape) {
+  this.caches = [];
+  this.styles = [];
+  this.transformers = transformers;
+  this.lStr = '';
+  this.sh = shape;
+  this.lvl = level;
+  // TODO find if there are some cases where _isAnimated can be false.
+  // For now, since shapes add up with other shapes. They have to be calculated every time.
+  // One way of finding out is checking if all styles associated to this shape depend only of this shape
+  this._isAnimated = !!shape.k;
+  // TODO: commenting this for now since all shapes are animated
+  var i = 0;
+  var len = transformers.length;
+  while (i < len) {
+    if (transformers[i].mProps.dynamicProperties.length) {
+      this._isAnimated = true;
+      break;
+    }
+    i += 1;
+  }
 }
+
+SVGShapeData.prototype.setAsAnimated = function () {
+  this._isAnimated = true;
+};
+
+/* global createNS */
+/* exported ShapeGroupData */
+
 function ShapeGroupData() {
-	this.it = [];
-    this.prevViewData = [];
-    this.gr = createNS('g');
+  this.it = [];
+  this.prevViewData = [];
+  this.gr = createNS('g');
 }
+
+/* global Matrix */
+
 function ShapeTransformManager() {
-	this.sequences = {};
-	this.sequenceList = [];
-    this.transform_key_count = 0;
+  this.sequences = {};
+  this.sequenceList = [];
+  this.transform_key_count = 0;
 }
 
 ShapeTransformManager.prototype = {
-	addTransformSequence: function(transforms) {
-		var i, len = transforms.length;
-		var key = '_';
-		for(i = 0; i < len; i += 1) {
-			key += transforms[i].transform.key + '_';
-		}
-		var sequence = this.sequences[key];
-		if(!sequence) {
-			sequence = {
-				transforms: [].concat(transforms),
-				finalTransform: new Matrix(),
-				_mdf: false
-			};
-			this.sequences[key] = sequence;
-			this.sequenceList.push(sequence);
-		}
-		return sequence;
-	},
-	processSequence: function(sequence, isFirstFrame) {
-		var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
-		while (i < len && !isFirstFrame) {
-			if (sequence.transforms[i].transform.mProps._mdf) {
-				_mdf = true;
-				break;
-			}
-			i += 1
-		}
-		if (_mdf) {
-			var props;
-			sequence.finalTransform.reset();
-			for (i = len - 1; i >= 0; i -= 1) {
-		        props = sequence.transforms[i].transform.mProps.v.props;
-		        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]);
-			}
-		}
-		sequence._mdf = _mdf;
-		
-	},
-	processSequences: function(isFirstFrame) {
-		var i, len = this.sequenceList.length;
-		for (i = 0; i < len; i += 1) {
-			this.processSequence(this.sequenceList[i], isFirstFrame);
-		}
-
-	},
-	getNewKey: function() {
-		return '_' + this.transform_key_count++;
-	}
-}
-function CVShapeData(element, data, styles, transformsManager) {
-    this.styledShapes = [];
-    this.tr = [0,0,0,0,0,0];
-    var ty = 4;
-    if(data.ty == 'rc'){
-        ty = 5;
-    }else if(data.ty == 'el'){
-        ty = 6;
-    }else if(data.ty == 'sr'){
-        ty = 7;
-    }
-    this.sh = ShapePropertyFactory.getShapeProp(element,data,ty,element);
-    var i , len = styles.length,styledShape;
+  addTransformSequence: function (transforms) {
+    var i;
+    var len = transforms.length;
+    var key = '_';
     for (i = 0; i < len; i += 1) {
-        if (!styles[i].closed) {
-            styledShape = {
-                transforms: transformsManager.addTransformSequence(styles[i].transforms),
-                trNodes: []
-            }
-            this.styledShapes.push(styledShape);
-            styles[i].elements.push(styledShape);
-        }
+      key += transforms[i].transform.key + '_';
     }
+    var sequence = this.sequences[key];
+    if (!sequence) {
+      sequence = {
+        transforms: [].concat(transforms),
+        finalTransform: new Matrix(),
+        _mdf: false,
+      };
+      this.sequences[key] = sequence;
+      this.sequenceList.push(sequence);
+    }
+    return sequence;
+  },
+  processSequence: function (sequence, isFirstFrame) {
+    var i = 0;
+    var len = sequence.transforms.length;
+    var _mdf = isFirstFrame;
+    while (i < len && !isFirstFrame) {
+      if (sequence.transforms[i].transform.mProps._mdf) {
+        _mdf = true;
+        break;
+      }
+      i += 1;
+    }
+    if (_mdf) {
+      var props;
+      sequence.finalTransform.reset();
+      for (i = len - 1; i >= 0; i -= 1) {
+        props = sequence.transforms[i].transform.mProps.v.props;
+        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]);
+      }
+    }
+    sequence._mdf = _mdf;
+  },
+  processSequences: function (isFirstFrame) {
+    var i;
+    var len = this.sequenceList.length;
+    for (i = 0; i < len; i += 1) {
+      this.processSequence(this.sequenceList[i], isFirstFrame);
+    }
+  },
+  getNewKey: function () {
+    this.transform_key_count += 1;
+    return '_' + this.transform_key_count;
+  },
+};
+
+/* global ShapePropertyFactory, SVGShapeData */
+
+function CVShapeData(element, data, styles, transformsManager) {
+  this.styledShapes = [];
+  this.tr = [0, 0, 0, 0, 0, 0];
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  this.sh = ShapePropertyFactory.getShapeProp(element, data, ty, element);
+  var i;
+  var len = styles.length;
+  var styledShape;
+  for (i = 0; i < len; i += 1) {
+    if (!styles[i].closed) {
+      styledShape = {
+        transforms: transformsManager.addTransformSequence(styles[i].transforms),
+        trNodes: [],
+      };
+      this.styledShapes.push(styledShape);
+      styles[i].elements.push(styledShape);
+    }
+  }
 }
 
 CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;
-function BaseElement(){
+
+/* global LayerExpressionInterface, EffectsExpressionInterface, CompExpressionInterface, ShapeExpressionInterface,
+TextExpressionInterface, getBlendMode,createElementID, EffectsManager */
+
+function BaseElement() {
 }
 
 BaseElement.prototype = {
-    checkMasks: function(){
-        if(!this.data.hasMask){
-            return false;
-        }
-        var i = 0, len = this.data.masksProperties.length;
-        while(i<len) {
-            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-                return true;
-            }
-            i += 1;
-        }
-        return false;
-    },
-    initExpressions: function(){
-        this.layerInterface = LayerExpressionInterface(this);
-        if(this.data.hasMask && this.maskManager) {
-            this.layerInterface.registerMaskInterface(this.maskManager);
-        }
-        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-        this.layerInterface.registerEffectsInterface(effectsInterface);
-
-        if(this.data.ty === 0 || this.data.xt){
-            this.compInterface = CompExpressionInterface(this);
-        } else if(this.data.ty === 4){
-            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
-            this.layerInterface.content = this.layerInterface.shapeInterface;
-        } else if(this.data.ty === 5){
-            this.layerInterface.textInterface = TextExpressionInterface(this);
-            this.layerInterface.text = this.layerInterface.textInterface;
-        }
-    },
-    setBlendMode: function(){
-        var blendModeValue = getBlendMode(this.data.bm);
-        var elem = this.baseElement || this.layerElement;
-
-        elem.style['mix-blend-mode'] = blendModeValue;
-    },
-    initBaseData: function(data, globalData, comp){
-        this.globalData = globalData;
-        this.comp = comp;
-        this.data = data;
-        this.layerId = createElementID();
-        
-        //Stretch factor for old animations missing this property.
-        if(!this.data.sr){
-            this.data.sr = 1;
-        }
-        // effects manager
-        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-        
-    },
-    getType: function(){
-        return this.type;
+  checkMasks: function () {
+    if (!this.data.hasMask) {
+      return false;
     }
-    ,sourceRectAtTime: function(){}
-}
-function NullElement(data,globalData,comp){
-    this.initFrame();
-	this.initBaseData(data, globalData, comp);
-    this.initFrame();
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
+    var i = 0;
+    var len = this.data.masksProperties.length;
+    while (i < len) {
+      if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+        return true;
+      }
+      i += 1;
+    }
+    return false;
+  },
+  initExpressions: function () {
+    this.layerInterface = LayerExpressionInterface(this);
+    if (this.data.hasMask && this.maskManager) {
+      this.layerInterface.registerMaskInterface(this.maskManager);
+    }
+    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
+    this.layerInterface.registerEffectsInterface(effectsInterface);
+
+    if (this.data.ty === 0 || this.data.xt) {
+      this.compInterface = CompExpressionInterface(this);
+    } else if (this.data.ty === 4) {
+      this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
+      this.layerInterface.content = this.layerInterface.shapeInterface;
+    } else if (this.data.ty === 5) {
+      this.layerInterface.textInterface = TextExpressionInterface(this);
+      this.layerInterface.text = this.layerInterface.textInterface;
+    }
+  },
+  setBlendMode: function () {
+    var blendModeValue = getBlendMode(this.data.bm);
+    var elem = this.baseElement || this.layerElement;
+
+    elem.style['mix-blend-mode'] = blendModeValue;
+  },
+  initBaseData: function (data, globalData, comp) {
+    this.globalData = globalData;
+    this.comp = comp;
+    this.data = data;
+    this.layerId = createElementID();
+
+    // Stretch factor for old animations missing this property.
+    if (!this.data.sr) {
+      this.data.sr = 1;
+    }
+    // effects manager
+    this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
+  },
+  getType: function () {
+    return this.type;
+  },
+  sourceRectAtTime: function () {},
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement */
+
+function NullElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initFrame();
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
 }
 
-NullElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
+NullElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-NullElement.prototype.renderFrame = function() {
+NullElement.prototype.renderFrame = function () {
 };
 
-NullElement.prototype.getBaseElement = function() {
-	return null;
+NullElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-NullElement.prototype.destroy = function() {
+NullElement.prototype.destroy = function () {
 };
 
-NullElement.prototype.sourceRectAtTime = function() {
+NullElement.prototype.sourceRectAtTime = function () {
 };
 
-NullElement.prototype.hide = function() {
+NullElement.prototype.hide = function () {
 };
 
-extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
 
-function SVGBaseElement(){
+/* global filtersFactory, featureSupport, filtersFactory, createElementID, createNS, MaskElement, SVGEffects, locationHref */
+
+function SVGBaseElement() {
 }
 
 SVGBaseElement.prototype = {
-    initRendererElement: function() {
-        this.layerElement = createNS('g');
-    },
-    createContainerElements: function(){
-        this.matteElement = createNS('g');
-        this.transformedElement = this.layerElement;
-        this.maskedElement = this.layerElement;
-        this._sizeChanged = false;
-        var layerElementParent = null;
-        //If this layer acts as a mask for the following layer
-        var filId, fil, gg;
-        if (this.data.td) {
-            if (this.data.td == 3 || this.data.td == 1) {
-                var masker = createNS('mask');
-                masker.setAttribute('id', this.layerId);
-                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
-                masker.appendChild(this.layerElement);
-                layerElementParent = masker;
-                this.globalData.defs.appendChild(masker);
-                // This is only for IE and Edge when mask if of type alpha
-                if (!featureSupport.maskType && this.data.td == 1) {
-                    masker.setAttribute('mask-type', 'luminance');
-                    filId = createElementID();
-                    fil = filtersFactory.createFilter(filId);
-                    this.globalData.defs.appendChild(fil);
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    masker.appendChild(gg);
-                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
-                }
-            } else if(this.data.td == 2) {
-                var maskGroup = createNS('mask');
-                maskGroup.setAttribute('id', this.layerId);
-                maskGroup.setAttribute('mask-type','alpha');
-                var maskGrouper = createNS('g');
-                maskGroup.appendChild(maskGrouper);
-                filId = createElementID();
-                fil = filtersFactory.createFilter(filId);
-                ////
+  initRendererElement: function () {
+    this.layerElement = createNS('g');
+  },
+  createContainerElements: function () {
+    this.matteElement = createNS('g');
+    this.transformedElement = this.layerElement;
+    this.maskedElement = this.layerElement;
+    this._sizeChanged = false;
+    var layerElementParent = null;
+    // If this layer acts as a mask for the following layer
+    var filId;
+    var fil;
+    var gg;
+    if (this.data.td) {
+      if (this.data.td == 3 || this.data.td == 1) { // eslint-disable-line eqeqeq
+        var masker = createNS('mask');
+        masker.setAttribute('id', this.layerId);
+        masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha'); // eslint-disable-line eqeqeq
+        masker.appendChild(this.layerElement);
+        layerElementParent = masker;
+        this.globalData.defs.appendChild(masker);
+        // This is only for IE and Edge when mask if of type alpha
+        if (!featureSupport.maskType && this.data.td == 1) { // eslint-disable-line eqeqeq
+          masker.setAttribute('mask-type', 'luminance');
+          filId = createElementID();
+          fil = filtersFactory.createFilter(filId);
+          this.globalData.defs.appendChild(fil);
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          masker.appendChild(gg);
+          gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        }
+      } else if (this.data.td == 2) { // eslint-disable-line eqeqeq
+        var maskGroup = createNS('mask');
+        maskGroup.setAttribute('id', this.layerId);
+        maskGroup.setAttribute('mask-type', 'alpha');
+        var maskGrouper = createNS('g');
+        maskGroup.appendChild(maskGrouper);
+        filId = createElementID();
+        fil = filtersFactory.createFilter(filId);
+        /// /
 
-                // This solution doesn't work on Android when meta tag with viewport attribute is set
-                /*var feColorMatrix = createNS('feColorMatrix');
+        // This solution doesn't work on Android when meta tag with viewport attribute is set
+        /* var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type', 'matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
                 feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-                fil.appendChild(feColorMatrix);*/
-                ////
-                var feCTr = createNS('feComponentTransfer');
-                feCTr.setAttribute('in','SourceGraphic');
-                fil.appendChild(feCTr);
-                var feFunc = createNS('feFuncA');
-                feFunc.setAttribute('type','table');
-                feFunc.setAttribute('tableValues','1.0 0.0');
-                feCTr.appendChild(feFunc);
-                ////
-                this.globalData.defs.appendChild(fil);
-                var alphaRect = createNS('rect');
-                alphaRect.setAttribute('width',  this.comp.data.w);
-                alphaRect.setAttribute('height', this.comp.data.h);
-                alphaRect.setAttribute('x','0');
-                alphaRect.setAttribute('y','0');
-                alphaRect.setAttribute('fill','#ffffff');
-                alphaRect.setAttribute('opacity','0');
-                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
-                maskGrouper.appendChild(alphaRect);
-                maskGrouper.appendChild(this.layerElement);
-                layerElementParent = maskGrouper;
-                if (!featureSupport.maskType) {
-                    maskGroup.setAttribute('mask-type', 'luminance');
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    maskGrouper.appendChild(alphaRect);
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    maskGrouper.appendChild(gg);
-                }
-                this.globalData.defs.appendChild(maskGroup);
-            }
-        } else if (this.data.tt) {
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        } else {
-            this.baseElement = this.layerElement;
+                fil.appendChild(feColorMatrix); */
+        /// /
+        var feCTr = createNS('feComponentTransfer');
+        feCTr.setAttribute('in', 'SourceGraphic');
+        fil.appendChild(feCTr);
+        var feFunc = createNS('feFuncA');
+        feFunc.setAttribute('type', 'table');
+        feFunc.setAttribute('tableValues', '1.0 0.0');
+        feCTr.appendChild(feFunc);
+        /// /
+        this.globalData.defs.appendChild(fil);
+        var alphaRect = createNS('rect');
+        alphaRect.setAttribute('width', this.comp.data.w);
+        alphaRect.setAttribute('height', this.comp.data.h);
+        alphaRect.setAttribute('x', '0');
+        alphaRect.setAttribute('y', '0');
+        alphaRect.setAttribute('fill', '#ffffff');
+        alphaRect.setAttribute('opacity', '0');
+        maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        maskGrouper.appendChild(alphaRect);
+        maskGrouper.appendChild(this.layerElement);
+        layerElementParent = maskGrouper;
+        if (!featureSupport.maskType) {
+          maskGroup.setAttribute('mask-type', 'luminance');
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          maskGrouper.appendChild(alphaRect);
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          maskGrouper.appendChild(gg);
         }
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id', this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
-        if (this.data.ty === 0 && !this.data.hd) {
-            var cp = createNS( 'clipPath');
-            var pt = createNS('path');
-            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
-            var clipId = createElementID();
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-
-            if (this.checkMasks()) {
-                var cpGroup = createNS('g');
-                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
-                cpGroup.appendChild(this.layerElement);
-                this.transformedElement = cpGroup;
-                if (layerElementParent) {
-                    layerElementParent.appendChild(this.transformedElement);
-                } else {
-                    this.baseElement = this.transformedElement;
-                }
-            } else {
-                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
-            }
-            
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-
-    },
-    renderElement: function() {
-        if (this.finalTransform._matMdf) {
-            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
-        }
-        if (this.finalTransform._opMdf) {
-            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
-        }
-    },
-    destroyBaseElement: function() {
-        this.layerElement = null;
-        this.matteElement = null;
-        this.maskManager.destroy();
-    },
-    getBaseElement: function() {
-        if (this.data.hd) {
-            return null;
-        }
-        return this.baseElement;
-    },
-    createRenderableComponents: function() {
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-        this.renderableEffectsManager = new SVGEffects(this);
-    },
-    setMatte: function(id) {
-        if (!this.matteElement) {
-            return;
-        }
-        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
+        this.globalData.defs.appendChild(maskGroup);
+      }
+    } else if (this.data.tt) {
+      this.matteElement.appendChild(this.layerElement);
+      layerElementParent = this.matteElement;
+      this.baseElement = this.matteElement;
+    } else {
+      this.baseElement = this.layerElement;
     }
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+    if (this.data.ty === 0 && !this.data.hd) {
+      var cp = createNS('clipPath');
+      var pt = createNS('path');
+      pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+      var clipId = createElementID();
+      cp.setAttribute('id', clipId);
+      cp.appendChild(pt);
+      this.globalData.defs.appendChild(cp);
+
+      if (this.checkMasks()) {
+        var cpGroup = createNS('g');
+        cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+        cpGroup.appendChild(this.layerElement);
+        this.transformedElement = cpGroup;
+        if (layerElementParent) {
+          layerElementParent.appendChild(this.transformedElement);
+        } else {
+          this.baseElement = this.transformedElement;
+        }
+      } else {
+        this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+      }
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    if (this.finalTransform._matMdf) {
+      this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+    }
+    if (this.finalTransform._opMdf) {
+      this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+    }
+  },
+  destroyBaseElement: function () {
+    this.layerElement = null;
+    this.matteElement = null;
+    this.maskManager.destroy();
+  },
+  getBaseElement: function () {
+    if (this.data.hd) {
+      return null;
+    }
+    return this.baseElement;
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+    this.renderableEffectsManager = new SVGEffects(this);
+  },
+  setMatte: function (id) {
+    if (!this.matteElement) {
+      return;
+    }
+    this.matteElement.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+  },
 };
-function IShapeElement(){
+
+/* global ProcessedElement */
+
+function IShapeElement() {
 }
 
 IShapeElement.prototype = {
-    addShapeToModifiers: function(data) {
-        var i, len = this.shapeModifiers.length;
-        for(i=0;i<len;i+=1){
-            this.shapeModifiers[i].addShape(data);
-        }
-    },
-    isShapeInAnimatedModifiers: function(data) {
-        var i = 0, len = this.shapeModifiers.length;
-        while(i < len) {
-            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
-                return true;
-            }
-        }
-        return false;
-    },
-    renderModifiers: function() {
-        if(!this.shapeModifiers.length){
-            return;
-        }
-        var i, len = this.shapes.length;
-        for(i=0;i<len;i+=1){
-            this.shapes[i].sh.reset();
-        }
-
-        len = this.shapeModifiers.length;
-        for(i=len-1;i>=0;i-=1){
-            this.shapeModifiers[i].processShapes(this._isFirstFrame);
-        }
-    },
-    lcEnum: {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'square'
-    },
-    ljEnum: {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    },
-    searchProcessedElement: function(elem){
-        var elements = this.processedElements;
-        var i = 0, len = elements.length;
-        while (i < len) {
-            if (elements[i].elem === elem) {
-                return elements[i].pos;
-            }
-            i += 1;
-        }
-        return 0;
-    },
-    addProcessedElement: function(elem, pos){
-        var elements = this.processedElements;
-        var i = elements.length;
-        while(i) {
-            i -= 1;
-            if (elements[i].elem === elem) {
-                elements[i].pos = pos;
-                return;
-            }
-        }
-        elements.push(new ProcessedElement(elem, pos));
-    },
-    prepareFrame: function(num) {
-        this.prepareRenderableFrame(num);
-        this.prepareProperties(num, this.isInRange);
+  addShapeToModifiers: function (data) {
+    var i;
+    var len = this.shapeModifiers.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapeModifiers[i].addShape(data);
     }
-};
-function ITextElement(){
-}
+  },
+  isShapeInAnimatedModifiers: function (data) {
+    var i = 0;
+    var len = this.shapeModifiers.length;
+    while (i < len) {
+      if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  renderModifiers: function () {
+    if (!this.shapeModifiers.length) {
+      return;
+    }
+    var i;
+    var len = this.shapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].sh.reset();
+    }
 
-ITextElement.prototype.initElement = function(data,globalData,comp){
-    this.lettersChangedFlag = true;
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
-    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
-    this.initRenderable();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    this.createContent();
-    this.hide();
-    this.textAnimator.searchProperties(this.dynamicProperties);
-};
-
-ITextElement.prototype.prepareFrame = function(num) {
-    this._mdf = false;
+    len = this.shapeModifiers.length;
+    for (i = len - 1; i >= 0; i -= 1) {
+      this.shapeModifiers[i].processShapes(this._isFirstFrame);
+    }
+  },
+  lcEnum: {
+    1: 'butt',
+    2: 'round',
+    3: 'square',
+  },
+  ljEnum: {
+    1: 'miter',
+    2: 'round',
+    3: 'bevel',
+  },
+  searchProcessedElement: function (elem) {
+    var elements = this.processedElements;
+    var i = 0;
+    var len = elements.length;
+    while (i < len) {
+      if (elements[i].elem === elem) {
+        return elements[i].pos;
+      }
+      i += 1;
+    }
+    return 0;
+  },
+  addProcessedElement: function (elem, pos) {
+    var elements = this.processedElements;
+    var i = elements.length;
+    while (i) {
+      i -= 1;
+      if (elements[i].elem === elem) {
+        elements[i].pos = pos;
+        return;
+      }
+    }
+    elements.push(new ProcessedElement(elem, pos));
+  },
+  prepareFrame: function (num) {
     this.prepareRenderableFrame(num);
     this.prepareProperties(num, this.isInRange);
-    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
-        this.buildNewText();
-        this.textProperty._isFirstFrame = false;
-        this.textProperty._mdf = false;
-    }
+  },
 };
 
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        pathNodes = shapes[j].ks.k;
-        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
-    }
-    return shapeStr;
+/* global TextProperty, TextAnimatorProperty, buildShapeString, LetterProps */
+
+function ITextElement() {
+}
+
+ITextElement.prototype.initElement = function (data, globalData, comp) {
+  this.lettersChangedFlag = true;
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+  this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
+  this.initRenderable();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  this.createContent();
+  this.hide();
+  this.textAnimator.searchProperties(this.dynamicProperties);
 };
 
-ITextElement.prototype.updateDocumentData = function(newData, index) {
-    this.textProperty.updateDocumentData(newData, index);
+ITextElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
+    this.buildNewText();
+    this.textProperty._isFirstFrame = false;
+    this.textProperty._mdf = false;
+  }
 };
 
-ITextElement.prototype.canResizeFont = function(_canResize) {
-    this.textProperty.canResizeFont(_canResize);
+ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
+  var j;
+  var jLen = shapes.length;
+  var pathNodes;
+  var shapeStr = '';
+  for (j = 0; j < jLen; j += 1) {
+    pathNodes = shapes[j].ks.k;
+    shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
+  }
+  return shapeStr;
 };
 
-ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
-    this.textProperty.setMinimumFontSize(_fontSize);
+ITextElement.prototype.updateDocumentData = function (newData, index) {
+  this.textProperty.updateDocumentData(newData, index);
 };
 
-ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
-    if(documentData.ps){
-        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-    }
-    matrixHelper.translate(0,-documentData.ls,0);
-    switch(documentData.j){
-        case 1:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
-            break;
-        case 2:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
-            break;
-    }
-    matrixHelper.translate(xPos, yPos, 0);
+ITextElement.prototype.canResizeFont = function (_canResize) {
+  this.textProperty.canResizeFont(_canResize);
 };
 
+ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
+  this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-ITextElement.prototype.buildColor = function(colorData) {
-    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
+ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
+  if (documentData.ps) {
+    matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+  }
+  matrixHelper.translate(0, -documentData.ls, 0);
+  switch (documentData.j) {
+    case 1:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
+      break;
+    case 2:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
+      break;
+    default:
+      break;
+  }
+  matrixHelper.translate(xPos, yPos, 0);
+};
+
+ITextElement.prototype.buildColor = function (colorData) {
+  return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
 
-ITextElement.prototype.destroy = function(){
-    
+ITextElement.prototype.destroy = function () {
+
 };
-function ICompElement(){}
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement */
+
+function ICompElement() {}
 
 extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
 
-ICompElement.prototype.initElement = function(data,globalData,comp) {
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.initTransform(data, globalData, comp);
-    this.initRenderable();
-    this.initHierarchy();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-    this.hide();
+ICompElement.prototype.initElement = function (data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initTransform(data, globalData, comp);
+  this.initRenderable();
+  this.initHierarchy();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  if (this.data.xt || !globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+  this.hide();
 };
 
-/*ICompElement.prototype.hide = function(){
+/* ICompElement.prototype.hide = function(){
     if(!this.hidden){
         this.hideElement();
         var i,len = this.elements.length;
@@ -7832,4931 +8256,5236 @@
             }
         }
     }
-};*/
+}; */
 
-ICompElement.prototype.prepareFrame = function(num){
-    this._mdf = false;
-    this.prepareRenderableFrame(num);
-    this.prepareProperties(num, this.isInRange);
-    if(!this.isInRange && !this.data.xt){
-        return;
-    }
+ICompElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (!this.isInRange && !this.data.xt) {
+    return;
+  }
 
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    if (timeRemapped === this.data.op) {
+      timeRemapped = this.data.op - 1;
     }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
+    this.renderedFrame = timeRemapped;
+  } else {
+    this.renderedFrame = num / this.data.sr;
+  }
+  var i;
+  var len = this.elements.length;
+  if (!this.completeLayers) {
+    this.checkLayers(this.renderedFrame);
+  }
+  // This iteration needs to be backwards because of how expressions connect between each other
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+      if (this.elements[i]._mdf) {
+        this._mdf = true;
+      }
     }
-    //This iteration needs to be backwards because of how expressions connect between each other
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-            if(this.elements[i]._mdf) {
-                this._mdf = true;
-            }
-        }
-    }
+  }
 };
 
-ICompElement.prototype.renderInnerContent = function() {
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i += 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+ICompElement.prototype.renderInnerContent = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
+ICompElement.prototype.setElements = function (elems) {
+  this.elements = elems;
 };
 
-ICompElement.prototype.getElements = function(){
-    return this.elements;
+ICompElement.prototype.getElements = function () {
+  return this.elements;
 };
 
-ICompElement.prototype.destroyElements = function(){
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
+ICompElement.prototype.destroyElements = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
+  }
 };
 
-ICompElement.prototype.destroy = function(){
-    this.destroyElements();
-    this.destroyBaseElement();
+ICompElement.prototype.destroy = function () {
+  this.destroyElements();
+  this.destroyBaseElement();
 };
 
-function IImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
-    this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, createNS */
+
+function IImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
+  this.sourceRect = {
+    top: 0, left: 0, width: this.assetData.w, height: this.assetData.h,
+  };
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
 
-IImageElement.prototype.createContent = function(){
+IImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.innerElem = createNS('image');
+  this.innerElem.setAttribute('width', this.assetData.w + 'px');
+  this.innerElem.setAttribute('height', this.assetData.h + 'px');
+  this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
+  this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
 
-    this.innerElem = createNS('image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    
-    this.layerElement.appendChild(this.innerElem);
+  this.layerElement.appendChild(this.innerElem);
 };
 
-IImageElement.prototype.sourceRectAtTime = function() {
-	return this.sourceRect;
-}
-function ISolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
+IImageElement.prototype.sourceRectAtTime = function () {
+  return this.sourceRect;
+};
+
+/* global extendPrototype, IImageElement, createNS */
+
+function ISolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createContent = function(){
-
-    var rect = createNS('rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
+ISolidElement.prototype.createContent = function () {
+  var rect = createNS('rect');
+  /// /rect.style.width = this.data.sw;
+  /// /rect.style.height = this.data.sh;
+  /// /rect.style.fill = this.data.sc;
+  rect.setAttribute('width', this.data.sw);
+  rect.setAttribute('height', this.data.sh);
+  rect.setAttribute('fill', this.data.sc);
+  this.layerElement.appendChild(rect);
 };
-function AudioElement(data,globalData,comp){
-    this.initFrame();
-    this.initRenderable();
-    this.assetData = globalData.getAssetData(data.refId);
-	this.initBaseData(data, globalData, comp);
-	this._isPlaying = false;
-	this._canPlay = false;
-	var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.audio = this.globalData.audioController.createAudio(assetPath);
-    this._currentTime = 0;
-    this.globalData.audioController.addAudio(this);
-    this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate,this) : {_placeholder:true};
+
+/* global PropertyFactory, extendPrototype, RenderableElement, BaseElement, FrameElement */
+
+function AudioElement(data, globalData, comp) {
+  this.initFrame();
+  this.initRenderable();
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initBaseData(data, globalData, comp);
+  this._isPlaying = false;
+  this._canPlay = false;
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.audio = this.globalData.audioController.createAudio(assetPath);
+  this._currentTime = 0;
+  this.globalData.audioController.addAudio(this);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
-AudioElement.prototype.prepareFrame = function(num) {
-    this.prepareRenderableFrame(num, true);
-    this.prepareProperties(num, true);
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        this._currentTime = timeRemapped;
-    } else {
-        this._currentTime = num / this.data.sr;
+AudioElement.prototype.prepareFrame = function (num) {
+  this.prepareRenderableFrame(num, true);
+  this.prepareProperties(num, true);
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    this._currentTime = timeRemapped;
+  } else {
+    this._currentTime = num / this.data.sr;
+  }
+};
+
+extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
+
+AudioElement.prototype.renderFrame = function () {
+  if (this.isInRange && this._canPlay) {
+    if (!this._isPlaying) {
+      this.audio.play();
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
+      this._isPlaying = true;
+    } else if (!this.audio.playing()
+      || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
+    ) {
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
     }
+  }
 };
 
-extendPrototype([RenderableElement,BaseElement,FrameElement], AudioElement);
-
-AudioElement.prototype.renderFrame = function() {
-	if (this.isInRange && this._canPlay) {
-		if (!this._isPlaying) {
-			this.audio.play();
-			this.audio.seek(this._currentTime / this.globalData.frameRate);
-			this._isPlaying = true;
-		} else if (!this.audio.playing()
-			|| Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
-		) {
-			this.audio.seek(this._currentTime / this.globalData.frameRate)
-		}
-	}
+AudioElement.prototype.show = function () {
+  // this.audio.play()
 };
 
-AudioElement.prototype.show = function() {
-	// this.audio.play()
+AudioElement.prototype.hide = function () {
+  this.audio.pause();
+  this._isPlaying = false;
 };
 
-AudioElement.prototype.hide = function() {
-	this.audio.pause();
-	this._isPlaying = false;
+AudioElement.prototype.pause = function () {
+  this.audio.pause();
+  this._isPlaying = false;
+  this._canPlay = false;
 };
 
-AudioElement.prototype.pause = function() {
-	this.audio.pause();
-	this._isPlaying = false;
-	this._canPlay = false;
+AudioElement.prototype.resume = function () {
+  this._canPlay = true;
 };
 
-AudioElement.prototype.resume = function() {
-	this._canPlay = true;
+AudioElement.prototype.setRate = function (rateValue) {
+  this.audio.rate(rateValue);
 };
 
-AudioElement.prototype.setRate = function(rateValue) {
-	this.audio.rate(rateValue);
+AudioElement.prototype.volume = function (volumeValue) {
+  this.audio.volume(volumeValue);
 };
 
-AudioElement.prototype.volume = function(volumeValue) {
-	this.audio.volume(volumeValue);
+AudioElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-AudioElement.prototype.getBaseElement = function() {
-	return null;
+AudioElement.prototype.destroy = function () {
 };
 
-AudioElement.prototype.destroy = function() {
+AudioElement.prototype.sourceRectAtTime = function () {
 };
 
-AudioElement.prototype.sourceRectAtTime = function() {
+AudioElement.prototype.initExpressions = function () {
 };
 
-AudioElement.prototype.initExpressions = function() {
-};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement,
+FrameElement, RenderableDOMElement, Matrix, SVGStyleData, SVGStrokeStyleData, SVGFillStyleData,
+SVGGradientFillStyleData, SVGGradientStrokeStyleData, locationHref, getBlendMode, ShapeGroupData,
+TransformPropertyFactory, SVGTransformData, ShapePropertyFactory, SVGShapeData, SVGElementsRenderer, ShapeModifiers */
 
-
-function SVGShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
+function SVGShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
 
-SVGShapeElement.prototype.initSecondaryElement = function() {
+SVGShapeElement.prototype.initSecondaryElement = function () {
 };
 
 SVGShapeElement.prototype.identityMatrix = new Matrix();
 
-SVGShapeElement.prototype.buildExpressionInterface = function(){};
+SVGShapeElement.prototype.buildExpressionInterface = function () {};
 
-SVGShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
+SVGShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
 };
 
 /*
 This method searches for multiple shapes that affect a single element and one of them is animated
 */
-SVGShapeElement.prototype.filterUniqueShapes = function(){
-    var i, len = this.shapes.length, shape;
-    var j, jLen = this.stylesList.length;
-    var style, count = 0;
-    var tempShapes = [];
-    var areAnimated = false;
-    for(j = 0; j < jLen; j += 1) {
-        style = this.stylesList[j];
-        areAnimated = false;
-        tempShapes.length = 0;
-        for(i = 0; i < len; i += 1) {
-            shape = this.shapes[i];
-            if(shape.styles.indexOf(style) !== -1) {
-                tempShapes.push(shape);
-                areAnimated = shape._isAnimated || areAnimated;
-            }
-        }
-        if(tempShapes.length > 1 && areAnimated) {
-            this.setShapesAsAnimated(tempShapes);
-        }
-    }
-}
-
-SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
-    var i, len = shapes.length;
-    for(i = 0; i < len; i += 1) {
-        shapes[i].setAsAnimated();
-    }
-}
-
-SVGShapeElement.prototype.createStyleElement = function(data, level){
-    //TODO: prevent drawing of hidden styles
-    var elementData;
-    var styleOb = new SVGStyleData(data, level);
-
-    var pathElement = styleOb.pElem;
-    if(data.ty === 'st') {
-        elementData = new SVGStrokeStyleData(this, data, styleOb);
-    } else if(data.ty === 'fl') {
-        elementData = new SVGFillStyleData(this, data, styleOb);
-    } else if(data.ty === 'gf' || data.ty === 'gs') {
-        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
-        elementData = new gradientConstructor(this, data, styleOb);
-        this.globalData.defs.appendChild(elementData.gf);
-        if (elementData.maskId) {
-            this.globalData.defs.appendChild(elementData.ms);
-            this.globalData.defs.appendChild(elementData.of);
-            pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
-        }
-    }
-    
-    if(data.ty === 'st' || data.ty === 'gs') {
-        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
-        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
-        pathElement.setAttribute('fill-opacity','0');
-        if(data.lj === 1) {
-            pathElement.setAttribute('stroke-miterlimit',data.ml);
-        }
-    }
-
-    if(data.r === 2) {
-        pathElement.setAttribute('fill-rule', 'evenodd');
-    }
-
-    if(data.ln){
-        pathElement.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        pathElement.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    this.stylesList.push(styleOb);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = new ShapeGroupData();
-    if(data.ln){
-        elementData.gr.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        elementData.gr.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    return elementData;
-};
-
-SVGShapeElement.prototype.createTransformElement = function(data, container) {
-    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
-    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
-    var ty = 4;
-    if(data.ty === 'rc'){
-        ty = 5;
-    }else if(data.ty === 'el'){
-        ty = 6;
-    }else if(data.ty === 'sr'){
-        ty = 7;
-    }
-    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
-    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
-    var i = 0, len = this.animatedContents.length;
-    while(i < len) {
-        if(this.animatedContents[i].element === element) {
-            return;
-        }
-        i += 1;
-    }
-    this.animatedContents.push({
-        fn: SVGElementsRenderer.createRenderFunction(data),
-        element: element,
-        data: data
-    });
-};
-
-SVGShapeElement.prototype.setElementStyles = function(elementData){
-    var arr = elementData.styles;
-    var j, jLen = this.stylesList.length;
-    for (j = 0; j < jLen; j += 1) {
-        if (!this.stylesList[j].closed) {
-            arr.push(this.stylesList[j]);
-        }
-    }
-};
-
-SVGShapeElement.prototype.reloadShapes = function(){
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for( i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
-    len = this.dynamicProperties.length;
-    for(i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-};
-
-SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._render = render;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], level);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].style.pElem);
-            }
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].gr);
-            }
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                itemsData[i] = this.createTransformElement(arr[i], container);
-            }
-            currentTransform = itemsData[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
-            }
-            this.setElementStyles(itemsData[i]);
-
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        }else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                render = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    len = ownStyles.length;
-    for(i=0;i<len;i+=1){
-        ownStyles[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-SVGShapeElement.prototype.renderInnerContent = function() {
-    this.renderModifiers();
-    var i, len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        this.stylesList[i].reset();
-    }
-    this.renderShape();
-
+SVGShapeElement.prototype.filterUniqueShapes = function () {
+  var i;
+  var len = this.shapes.length;
+  var shape;
+  var j;
+  var jLen = this.stylesList.length;
+  var style;
+  var tempShapes = [];
+  var areAnimated = false;
+  for (j = 0; j < jLen; j += 1) {
+    style = this.stylesList[j];
+    areAnimated = false;
+    tempShapes.length = 0;
     for (i = 0; i < len; i += 1) {
-        if (this.stylesList[i]._mdf || this._isFirstFrame) {
-            if(this.stylesList[i].msElem){
-                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                //Adding M0 0 fixes same mask bug on all browsers
-                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
-            }
-            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
-        }
+      shape = this.shapes[i];
+      if (shape.styles.indexOf(style) !== -1) {
+        tempShapes.push(shape);
+        areAnimated = shape._isAnimated || areAnimated;
+      }
     }
+    if (tempShapes.length > 1 && areAnimated) {
+      this.setShapesAsAnimated(tempShapes);
+    }
+  }
 };
 
-SVGShapeElement.prototype.renderShape = function() {
-    var i, len = this.animatedContents.length;
-    var animatedContent;
-    for(i = 0; i < len; i += 1) {
-        animatedContent = this.animatedContents[i];
-        if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
-            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
-        }
-    }
-}
-
-SVGShapeElement.prototype.destroy = function(){
-    this.destroyBaseElement();
-    this.shapesData = null;
-    this.itemsData = null;
+SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
+  var i;
+  var len = shapes.length;
+  for (i = 0; i < len; i += 1) {
+    shapes[i].setAsAnimated();
+  }
 };
 
+SVGShapeElement.prototype.createStyleElement = function (data, level) {
+  // TODO: prevent drawing of hidden styles
+  var elementData;
+  var styleOb = new SVGStyleData(data, level);
+
+  var pathElement = styleOb.pElem;
+  if (data.ty === 'st') {
+    elementData = new SVGStrokeStyleData(this, data, styleOb);
+  } else if (data.ty === 'fl') {
+    elementData = new SVGFillStyleData(this, data, styleOb);
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+    elementData = new GradientConstructor(this, data, styleOb);
+    this.globalData.defs.appendChild(elementData.gf);
+    if (elementData.maskId) {
+      this.globalData.defs.appendChild(elementData.ms);
+      this.globalData.defs.appendChild(elementData.of);
+      pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
+    }
+  }
+
+  if (data.ty === 'st' || data.ty === 'gs') {
+    pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+    pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
+    pathElement.setAttribute('fill-opacity', '0');
+    if (data.lj === 1) {
+      pathElement.setAttribute('stroke-miterlimit', data.ml);
+    }
+  }
+
+  if (data.r === 2) {
+    pathElement.setAttribute('fill-rule', 'evenodd');
+  }
+
+  if (data.ln) {
+    pathElement.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    pathElement.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  this.stylesList.push(styleOb);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.createGroupElement = function (data) {
+  var elementData = new ShapeGroupData();
+  if (data.ln) {
+    elementData.gr.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    elementData.gr.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  return elementData;
+};
+
+SVGShapeElement.prototype.createTransformElement = function (data, container) {
+  var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
+  var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
+  var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
+  var i = 0;
+  var len = this.animatedContents.length;
+  while (i < len) {
+    if (this.animatedContents[i].element === element) {
+      return;
+    }
+    i += 1;
+  }
+  this.animatedContents.push({
+    fn: SVGElementsRenderer.createRenderFunction(data),
+    element: element,
+    data: data,
+  });
+};
+
+SVGShapeElement.prototype.setElementStyles = function (elementData) {
+  var arr = elementData.styles;
+  var j;
+  var jLen = this.stylesList.length;
+  for (j = 0; j < jLen; j += 1) {
+    if (!this.stylesList[j].closed) {
+      arr.push(this.stylesList[j]);
+    }
+  }
+};
+
+SVGShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
+  var ownTransformers = [].concat(transformers);
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var currentTransform;
+  var modifier;
+  var processedPos;
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._render = render;
+    } else {
+      itemsData[i] = prevViewData[processedPos - 1];
+    }
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], level);
+      } else {
+        itemsData[i].style.closed = false;
+      }
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].style.pElem);
+      }
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
+        for (j = 0; j < jLen; j += 1) {
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
+        }
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].gr);
+      }
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        itemsData[i] = this.createTransformElement(arr[i], container);
+      }
+      currentTransform = itemsData[i].transform;
+      ownTransformers.push(currentTransform);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+      }
+      this.setElementStyles(itemsData[i]);
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        render = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
+    }
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  len = ownStyles.length;
+  for (i = 0; i < len; i += 1) {
+    ownStyles[i].closed = true;
+  }
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
+};
+
+SVGShapeElement.prototype.renderInnerContent = function () {
+  this.renderModifiers();
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    this.stylesList[i].reset();
+  }
+  this.renderShape();
+
+  for (i = 0; i < len; i += 1) {
+    if (this.stylesList[i]._mdf || this._isFirstFrame) {
+      if (this.stylesList[i].msElem) {
+        this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+        // Adding M0 0 fixes same mask bug on all browsers
+        this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+      }
+      this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
+    }
+  }
+};
+
+SVGShapeElement.prototype.renderShape = function () {
+  var i;
+  var len = this.animatedContents.length;
+  var animatedContent;
+  for (i = 0; i < len; i += 1) {
+    animatedContent = this.animatedContents[i];
+    if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
+      animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
+    }
+  }
+};
+
+SVGShapeElement.prototype.destroy = function () {
+  this.destroyBaseElement();
+  this.shapesData = null;
+  this.itemsData = null;
+};
+
+/* global Matrix, createTypedArray */
+
 function CVContextData() {
-	this.saved = [];
-    this.cArrPos = 0;
-    this.cTr = new Matrix();
-    this.cO = 1;
-    var i, len = 15;
-    this.savedOp = createTypedArray('float32', len);
-    for(i=0;i<len;i+=1){
-        this.saved[i] = createTypedArray('float32', 16);
-    }
-    this._length = len;
+  this.saved = [];
+  this.cArrPos = 0;
+  this.cTr = new Matrix();
+  this.cO = 1;
+  var i;
+  var len = 15;
+  this.savedOp = createTypedArray('float32', len);
+  for (i = 0; i < len; i += 1) {
+    this.saved[i] = createTypedArray('float32', 16);
+  }
+  this._length = len;
 }
 
-CVContextData.prototype.duplicate = function() {
-	var newLength = this._length * 2;
-	var currentSavedOp = this.savedOp;
-    this.savedOp = createTypedArray('float32', newLength);
-    this.savedOp.set(currentSavedOp);
-    var i = 0;
-    for(i = this._length; i < newLength; i += 1) {
-        this.saved[i] = createTypedArray('float32', 16);
-    }
-    this._length = newLength;
+CVContextData.prototype.duplicate = function () {
+  var newLength = this._length * 2;
+  var currentSavedOp = this.savedOp;
+  this.savedOp = createTypedArray('float32', newLength);
+  this.savedOp.set(currentSavedOp);
+  var i = 0;
+  for (i = this._length; i < newLength; i += 1) {
+    this.saved[i] = createTypedArray('float32', 16);
+  }
+  this._length = newLength;
 };
 
-CVContextData.prototype.reset = function() {
-	this.cArrPos = 0;
-	this.cTr.reset();
-    this.cO = 1;
+CVContextData.prototype.reset = function () {
+  this.cArrPos = 0;
+  this.cTr.reset();
+  this.cO = 1;
 };
-function CVBaseElement(){
+
+/* global CVEffects, getBlendMode, CVMaskElement, Matrix */
+
+function CVBaseElement() {
 }
 
 CVBaseElement.prototype = {
-    createElements: function(){},
-    initRendererElement: function(){},
-    createContainerElements: function(){
-        this.canvasContext = this.globalData.canvasContext;
-        this.renderableEffectsManager = new CVEffects(this);
-    },
-    createContent: function(){},
-    setBlendMode: function(){
-        var globalData = this.globalData;
-        if(globalData.blendMode !== this.data.bm) {
-            globalData.blendMode = this.data.bm;
-            var blendModeValue = getBlendMode(this.data.bm);
-            globalData.canvasContext.globalCompositeOperation = blendModeValue;
-        }
-    },
-    createRenderableComponents: function(){
-        this.maskManager = new CVMaskElement(this.data, this);
-    },
-    hideElement: function(){
-        if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-            this.hidden = true;
-        }
-    },
-    showElement: function(){
-        if (this.isInRange && !this.isTransparent){
-            this.hidden = false;
-            this._isFirstFrame = true;
-            this.maskManager._isFirstFrame = true;
-        }
-    },
-    renderFrame: function() {
-        if (this.hidden || this.data.hd) {
-            return;
-        }
-        this.renderTransform();
-        this.renderRenderable();
-        this.setBlendMode();
-        var forceRealStack = this.data.ty === 0;
-        this.globalData.renderer.save(forceRealStack);
-        this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
-        this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
-        this.renderInnerContent();
-        this.globalData.renderer.restore(forceRealStack);
-        if(this.maskManager.hasMasks) {
-            this.globalData.renderer.restore(true);
-        }
-        if (this._isFirstFrame) {
-            this._isFirstFrame = false;
-        }
-    },
-    destroy: function(){
-        this.canvasContext = null;
-        this.data = null;
-        this.globalData = null;
-        this.maskManager.destroy();
-    },
-    mHelper: new Matrix()
+  createElements: function () {},
+  initRendererElement: function () {},
+  createContainerElements: function () {
+    this.canvasContext = this.globalData.canvasContext;
+    this.renderableEffectsManager = new CVEffects(this);
+  },
+  createContent: function () {},
+  setBlendMode: function () {
+    var globalData = this.globalData;
+    if (globalData.blendMode !== this.data.bm) {
+      globalData.blendMode = this.data.bm;
+      var blendModeValue = getBlendMode(this.data.bm);
+      globalData.canvasContext.globalCompositeOperation = blendModeValue;
+    }
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new CVMaskElement(this.data, this);
+  },
+  hideElement: function () {
+    if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+      this.hidden = true;
+    }
+  },
+  showElement: function () {
+    if (this.isInRange && !this.isTransparent) {
+      this.hidden = false;
+      this._isFirstFrame = true;
+      this.maskManager._isFirstFrame = true;
+    }
+  },
+  renderFrame: function () {
+    if (this.hidden || this.data.hd) {
+      return;
+    }
+    this.renderTransform();
+    this.renderRenderable();
+    this.setBlendMode();
+    var forceRealStack = this.data.ty === 0;
+    this.globalData.renderer.save(forceRealStack);
+    this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
+    this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
+    this.renderInnerContent();
+    this.globalData.renderer.restore(forceRealStack);
+    if (this.maskManager.hasMasks) {
+      this.globalData.renderer.restore(true);
+    }
+    if (this._isFirstFrame) {
+      this._isFirstFrame = false;
+    }
+  },
+  destroy: function () {
+    this.canvasContext = null;
+    this.data = null;
+    this.globalData = null;
+    this.maskManager.destroy();
+  },
+  mHelper: new Matrix(),
 };
 CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;
 CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;
 
-function CVImageElement(data, globalData, comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.img = globalData.imageLoader.getImage(this.assetData);
-    this.initElement(data,globalData,comp);
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement,HierarchyElement, FrameElement,
+RenderableElement, SVGShapeElement, IImageElement, createTag */
+
+function CVImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.img = globalData.imageLoader.getImage(this.assetData);
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement);
 
 CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement;
 CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
 
-CVImageElement.prototype.createContent = function(){
+CVImageElement.prototype.createContent = function () {
+  if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
+    var canvas = createTag('canvas');
+    canvas.width = this.assetData.w;
+    canvas.height = this.assetData.h;
+    var ctx = canvas.getContext('2d');
 
-    if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
-        var canvas = createTag('canvas');
-        canvas.width = this.assetData.w;
-        canvas.height = this.assetData.h;
-        var ctx = canvas.getContext('2d');
-
-        var imgW = this.img.width;
-        var imgH = this.img.height;
-        var imgRel = imgW / imgH;
-        var canvasRel = this.assetData.w/this.assetData.h;
-        var widthCrop, heightCrop;
-        var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
-        if((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) {
-            heightCrop = imgH;
-            widthCrop = heightCrop*canvasRel;
-        } else {
-            widthCrop = imgW;
-            heightCrop = widthCrop/canvasRel;
-        }
-        ctx.drawImage(this.img,(imgW-widthCrop)/2,(imgH-heightCrop)/2,widthCrop,heightCrop,0,0,this.assetData.w,this.assetData.h);
-        this.img = canvas;
+    var imgW = this.img.width;
+    var imgH = this.img.height;
+    var imgRel = imgW / imgH;
+    var canvasRel = this.assetData.w / this.assetData.h;
+    var widthCrop;
+    var heightCrop;
+    var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
+    if ((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) {
+      heightCrop = imgH;
+      widthCrop = heightCrop * canvasRel;
+    } else {
+      widthCrop = imgW;
+      heightCrop = widthCrop / canvasRel;
     }
-
+    ctx.drawImage(this.img, (imgW - widthCrop) / 2, (imgH - heightCrop) / 2, widthCrop, heightCrop, 0, 0, this.assetData.w, this.assetData.h);
+    this.img = canvas;
+  }
 };
 
-CVImageElement.prototype.renderInnerContent = function(parentMatrix){
-    this.canvasContext.drawImage(this.img, 0, 0);
+CVImageElement.prototype.renderInnerContent = function () {
+  this.canvasContext.drawImage(this.img, 0, 0);
 };
 
-CVImageElement.prototype.destroy = function(){
-    this.img = null;
+CVImageElement.prototype.destroy = function () {
+  this.img = null;
 };
+
+/* global createSizedArray, PropertyFactory, extendPrototype, CanvasRenderer, ICompElement, CVBaseElement */
+
 function CVCompElement(data, globalData, comp) {
-    this.completeLayers = false;
-    this.layers = data.layers;
-    this.pendingElements = [];
-    this.elements = createSizedArray(this.layers.length);
-    this.initElement(data, globalData, comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate, this) : {_placeholder:true};
+  this.completeLayers = false;
+  this.layers = data.layers;
+  this.pendingElements = [];
+  this.elements = createSizedArray(this.layers.length);
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([CanvasRenderer, ICompElement, CVBaseElement], CVCompElement);
 
-CVCompElement.prototype.renderInnerContent = function() {
-    var ctx = this.canvasContext;
-    ctx.beginPath();
-    ctx.moveTo(0, 0);
-    ctx.lineTo(this.data.w, 0);
-    ctx.lineTo(this.data.w, this.data.h);
-    ctx.lineTo(0, this.data.h);
-    ctx.lineTo(0, 0);
-    ctx.clip();
-    var i,len = this.layers.length;
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+CVCompElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.beginPath();
+  ctx.moveTo(0, 0);
+  ctx.lineTo(this.data.w, 0);
+  ctx.lineTo(this.data.w, this.data.h);
+  ctx.lineTo(0, this.data.h);
+  ctx.lineTo(0, 0);
+  ctx.clip();
+  var i;
+  var len = this.layers.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-CVCompElement.prototype.destroy = function(){
-    var i,len = this.layers.length;
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.elements[i]) {
-            this.elements[i].destroy();
-        }
+CVCompElement.prototype.destroy = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layers = null;
-    this.elements = null;
+  }
+  this.layers = null;
+  this.elements = null;
 };
 
-function CVMaskElement(data,element){
-    this.data = data;
-    this.element = element;
-    this.masksProperties = this.data.masksProperties || [];
-    this.viewData = createSizedArray(this.masksProperties.length);
-    var i, len = this.masksProperties.length, hasMasks = false;
-    for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode !== 'n'){
-            hasMasks = true;
-        }
-        this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);
+/* global createSizedArray, ShapePropertyFactory, MaskElement */
+
+function CVMaskElement(data, element) {
+  this.data = data;
+  this.element = element;
+  this.masksProperties = this.data.masksProperties || [];
+  this.viewData = createSizedArray(this.masksProperties.length);
+  var i;
+  var len = this.masksProperties.length;
+  var hasMasks = false;
+  for (i = 0; i < len; i += 1) {
+    if (this.masksProperties[i].mode !== 'n') {
+      hasMasks = true;
     }
-    this.hasMasks = hasMasks;
-    if(hasMasks) {
-        this.element.addRenderableComponent(this);
-    }
+    this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[i], 3);
+  }
+  this.hasMasks = hasMasks;
+  if (hasMasks) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
 CVMaskElement.prototype.renderFrame = function () {
-    if(!this.hasMasks){
-        return;
+  if (!this.hasMasks) {
+    return;
+  }
+  var transform = this.element.finalTransform.mat;
+  var ctx = this.element.canvasContext;
+  var i;
+  var len = this.masksProperties.length;
+  var pt;
+  var pts;
+  var data;
+  ctx.beginPath();
+  for (i = 0; i < len; i += 1) {
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.masksProperties[i].inv) {
+        ctx.moveTo(0, 0);
+        ctx.lineTo(this.element.globalData.compSize.w, 0);
+        ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
+        ctx.lineTo(0, this.element.globalData.compSize.h);
+        ctx.lineTo(0, 0);
+      }
+      data = this.viewData[i].v;
+      pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0);
+      ctx.moveTo(pt[0], pt[1]);
+      var j;
+      var jLen = data._length;
+      for (j = 1; j < jLen; j += 1) {
+        pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
+        ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
+      }
+      pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
+      ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
     }
-    var transform = this.element.finalTransform.mat;
-    var ctx = this.element.canvasContext;
-    var i, len = this.masksProperties.length;
-    var pt,pts,data;
-    ctx.beginPath();
-    for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode !== 'n'){
-            if (this.masksProperties[i].inv) {
-                ctx.moveTo(0, 0);
-                ctx.lineTo(this.element.globalData.compSize.w, 0);
-                ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
-                ctx.lineTo(0, this.element.globalData.compSize.h);
-                ctx.lineTo(0, 0);
-            }
-            data = this.viewData[i].v;
-            pt = transform.applyToPointArray(data.v[0][0],data.v[0][1],0);
-            ctx.moveTo(pt[0], pt[1]);
-            var j, jLen = data._length;
-            for (j = 1; j < jLen; j++) {
-                pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
-                ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
-            }
-            pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
-            ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
-        }
-    }
-    this.element.globalData.renderer.save(true);
-    ctx.clip();
+  }
+  this.element.globalData.renderer.save(true);
+  ctx.clip();
 };
 
 CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;
 
-CVMaskElement.prototype.destroy = function(){
-    this.element = null;
+CVMaskElement.prototype.destroy = function () {
+  this.element = null;
 };
+
+/* global ShapeTransformManager, extendPrototype, BaseElement, TransformElement, CVBaseElement, IShapeElement,
+HierarchyElement, FrameElement, RenderableElement, RenderableDOMElement, PropertyFactory, degToRads, GradientProperty,
+DashProperty, TransformPropertyFactory, CVShapeData, ShapeModifiers, bmFloor */
+
 function CVShapeElement(data, globalData, comp) {
-    this.shapes = [];
-    this.shapesData = data.shapes;
-    this.stylesList = [];
-    this.itemsData = [];
-    this.prevViewData = [];
-    this.shapeModifiers = [];
-    this.processedElements = [];
-    this.transformsManager = new ShapeTransformManager();
-    this.initElement(data, globalData, comp);
+  this.shapes = [];
+  this.shapesData = data.shapes;
+  this.stylesList = [];
+  this.itemsData = [];
+  this.prevViewData = [];
+  this.shapeModifiers = [];
+  this.processedElements = [];
+  this.transformsManager = new ShapeTransformManager();
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement], CVShapeElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement);
 
 CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;
 
-CVShapeElement.prototype.transformHelper = {opacity:1,_opMdf:false};
+CVShapeElement.prototype.transformHelper = { opacity: 1, _opMdf: false };
 
 CVShapeElement.prototype.dashResetter = [];
 
-CVShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
+CVShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
 };
 
-CVShapeElement.prototype.createStyleElement = function(data, transforms) {
-    var styleElem = {
-        data: data,
-        type: data.ty,
-        preTransforms: this.transformsManager.addTransformSequence(transforms),
-        transforms: [],
-        elements: [],
-        closed: data.hd === true
-    };
-    var elementData = {};
-    if(data.ty == 'fl' || data.ty == 'st'){
-        elementData.c = PropertyFactory.getProp(this,data.c,1,255,this);
-        if(!elementData.c.k){
-            styleElem.co = 'rgb('+bm_floor(elementData.c.v[0])+','+bm_floor(elementData.c.v[1])+','+bm_floor(elementData.c.v[2])+')';
-        }
-    } else if (data.ty === 'gf' || data.ty === 'gs') {
-        elementData.s = PropertyFactory.getProp(this,data.s,1,null,this);
-        elementData.e = PropertyFactory.getProp(this,data.e,1,null,this);
-        elementData.h = PropertyFactory.getProp(this,data.h||{k:0},0,0.01,this);
-        elementData.a = PropertyFactory.getProp(this,data.a||{k:0},0,degToRads,this);
-        elementData.g = new GradientProperty(this,data.g,this);
+CVShapeElement.prototype.createStyleElement = function (data, transforms) {
+  var styleElem = {
+    data: data,
+    type: data.ty,
+    preTransforms: this.transformsManager.addTransformSequence(transforms),
+    transforms: [],
+    elements: [],
+    closed: data.hd === true,
+  };
+  var elementData = {};
+  if (data.ty === 'fl' || data.ty === 'st') {
+    elementData.c = PropertyFactory.getProp(this, data.c, 1, 255, this);
+    if (!elementData.c.k) {
+      styleElem.co = 'rgb(' + bmFloor(elementData.c.v[0]) + ',' + bmFloor(elementData.c.v[1]) + ',' + bmFloor(elementData.c.v[2]) + ')';
     }
-    elementData.o = PropertyFactory.getProp(this,data.o,0,0.01,this);
-    if(data.ty == 'st' || data.ty == 'gs') {
-        styleElem.lc = this.lcEnum[data.lc] || 'round';
-        styleElem.lj = this.ljEnum[data.lj] || 'round';
-        if(data.lj == 1) {
-            styleElem.ml = data.ml;
-        }
-        elementData.w = PropertyFactory.getProp(this,data.w,0,null,this);
-        if(!elementData.w.k){
-            styleElem.wi = elementData.w.v;
-        }
-        if(data.d){
-            var d = new DashProperty(this,data.d,'canvas', this);
-            elementData.d = d;
-            if(!elementData.d.k){
-                styleElem.da = elementData.d.dashArray;
-                styleElem.do = elementData.d.dashoffset[0];
-            }
-        }
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    elementData.s = PropertyFactory.getProp(this, data.s, 1, null, this);
+    elementData.e = PropertyFactory.getProp(this, data.e, 1, null, this);
+    elementData.h = PropertyFactory.getProp(this, data.h || { k: 0 }, 0, 0.01, this);
+    elementData.a = PropertyFactory.getProp(this, data.a || { k: 0 }, 0, degToRads, this);
+    elementData.g = new GradientProperty(this, data.g, this);
+  }
+  elementData.o = PropertyFactory.getProp(this, data.o, 0, 0.01, this);
+  if (data.ty === 'st' || data.ty === 'gs') {
+    styleElem.lc = this.lcEnum[data.lc] || 'round';
+    styleElem.lj = this.ljEnum[data.lj] || 'round';
+    if (data.lj == 1) { // eslint-disable-line eqeqeq
+      styleElem.ml = data.ml;
+    }
+    elementData.w = PropertyFactory.getProp(this, data.w, 0, null, this);
+    if (!elementData.w.k) {
+      styleElem.wi = elementData.w.v;
+    }
+    if (data.d) {
+      var d = new DashProperty(this, data.d, 'canvas', this);
+      elementData.d = d;
+      if (!elementData.d.k) {
+        styleElem.da = elementData.d.dashArray;
+        styleElem.do = elementData.d.dashoffset[0];
+      }
+    }
+  } else {
+    styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+  }
+  this.stylesList.push(styleElem);
+  elementData.style = styleElem;
+  return elementData;
+};
+
+CVShapeElement.prototype.createGroupElement = function () {
+  var elementData = {
+    it: [],
+    prevViewData: [],
+  };
+  return elementData;
+};
+
+CVShapeElement.prototype.createTransformElement = function (data) {
+  var elementData = {
+    transform: {
+      opacity: 1,
+      _opMdf: false,
+      key: this.transformsManager.getNewKey(),
+      op: PropertyFactory.getProp(this, data.o, 0, 0.01, this),
+      mProps: TransformPropertyFactory.getTransformProperty(this, data, this),
+    },
+  };
+  return elementData;
+};
+
+CVShapeElement.prototype.createShapeElement = function (data) {
+  var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
+
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  return elementData;
+};
+
+CVShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+  this.transformsManager.processSequences(this._isFirstFrame);
+};
+
+CVShapeElement.prototype.addTransformToStyleList = function (transform) {
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    if (!this.stylesList[i].closed) {
+      this.stylesList[i].transforms.push(transform);
+    }
+  }
+};
+
+CVShapeElement.prototype.removeTransformFromStyleList = function () {
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    if (!this.stylesList[i].closed) {
+      this.stylesList[i].transforms.pop();
+    }
+  }
+};
+
+CVShapeElement.prototype.closeStyles = function (styles) {
+  var i;
+  var len = styles.length;
+  for (i = 0; i < len; i += 1) {
+    styles[i].closed = true;
+  }
+};
+
+CVShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, shouldRender, transforms) {
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var processedPos;
+  var modifier;
+  var currentTransform;
+  var ownTransforms = [].concat(transforms);
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._shouldRender = shouldRender;
     } else {
-        styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    this.stylesList.push(styleElem);
-    elementData.style = styleElem;
-    return elementData;
-};
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
+      } else {
+        itemsData[i].style.closed = false;
+      }
 
-CVShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = {
-        it: [],
-        prevViewData: []
-    };
-    return elementData;
-};
-
-CVShapeElement.prototype.createTransformElement = function(data) {
-    var elementData = {
-        transform : {
-            opacity: 1,
-            _opMdf:false,
-            key: this.transformsManager.getNewKey(),
-            op: PropertyFactory.getProp(this,data.o,0,0.01,this),
-            mProps: TransformPropertyFactory.getTransformProperty(this,data,this)
-        }
-    };
-    return elementData;
-};
-
-CVShapeElement.prototype.createShapeElement = function(data) {
-    var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
-    
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    return elementData;
-};
-
-CVShapeElement.prototype.reloadShapes = function() {
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for (i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
-    len = this.dynamicProperties.length;
-    for (i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-    this.transformsManager.processSequences(this._isFirstFrame);
-};
-
-CVShapeElement.prototype.addTransformToStyleList = function(transform) {
-    var i, len = this.stylesList.length;
-    for (i = 0; i < len; i += 1) {
-        if(!this.stylesList[i].closed) {
-            this.stylesList[i].transforms.push(transform);
-        }
-    }
-}
-
-CVShapeElement.prototype.removeTransformFromStyleList = function() {
-    var i, len = this.stylesList.length;
-    for (i = 0; i < len; i += 1) {
-        if(!this.stylesList[i].closed) {
-            this.stylesList[i].transforms.pop();
-        }
-    }
-}
-
-CVShapeElement.prototype.closeStyles = function(styles) {
-    var i, len = styles.length, j, jLen;
-    for (i = 0; i < len; i += 1) {
-        styles[i].closed = true;
-    }
-}
-
-CVShapeElement.prototype.searchShapes = function(arr,itemsData, prevViewData, shouldRender, transforms){
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], processedPos, modifier, currentTransform;
-    var ownTransforms = [].concat(transforms);
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._shouldRender = shouldRender;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st'|| arr[i].ty == 'gf'|| arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData, shouldRender, ownTransforms);
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                currentTransform = this.createTransformElement(arr[i]);
-                itemsData[i] = currentTransform;
-            }
-            ownTransforms.push(itemsData[i]);
-            this.addTransformToStyleList(itemsData[i]);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i]);
-            }
-            
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        } else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                shouldRender = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    this.removeTransformFromStyleList();
-    this.closeStyles(ownStyles);
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-CVShapeElement.prototype.renderInnerContent = function() {
-    this.transformHelper.opacity = 1;
-    this.transformHelper._opMdf = false;
-    this.renderModifiers();
-    this.transformsManager.processSequences(this._isFirstFrame);
-    this.renderShape(this.transformHelper,this.shapesData,this.itemsData,true);
-};
-
-CVShapeElement.prototype.renderShapeTransform = function(parentTransform, groupTransform) {
-    var props, groupMatrix;
-    if(parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
-        groupTransform.opacity = parentTransform.opacity;
-        groupTransform.opacity *= groupTransform.op.v;
-        groupTransform._opMdf = true;
-    }
-};
-
-CVShapeElement.prototype.drawLayer = function() {
-    var i, len = this.stylesList.length;
-    var j, jLen, k, kLen,elems,nodes, renderer = this.globalData.renderer, ctx = this.globalData.canvasContext, type, currentStyle;
-    for(i=0;i<len;i+=1){
-        currentStyle = this.stylesList[i];
-        type = currentStyle.type;
-
-        //Skipping style when
-        //Stroke width equals 0
-        //style should not be rendered (extra unused repeaters)
-        //current opacity equals 0
-        //global opacity equals 0
-        if(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0){
-            continue;
-        }
-        renderer.save();
-        elems = currentStyle.elements;
-        if(type === 'st' || type === 'gs'){
-            ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
-            ctx.lineWidth = currentStyle.wi;
-            ctx.lineCap = currentStyle.lc;
-            ctx.lineJoin = currentStyle.lj;
-            ctx.miterLimit = currentStyle.ml || 0;
-        } else {
-            ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
-        }
-        renderer.ctxOpacity(currentStyle.coOp);
-        if(type !== 'st' && type !== 'gs'){
-            ctx.beginPath();
-        }
-        renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
-        jLen = elems.length;
-        for(j=0;j<jLen;j+=1){
-            if(type === 'st' || type === 'gs'){
-                ctx.beginPath();
-                if(currentStyle.da){
-                    ctx.setLineDash(currentStyle.da);
-                    ctx.lineDashOffset = currentStyle.do;
-                }
-            }
-            nodes = elems[j].trNodes;
-            kLen = nodes.length;
-
-            for(k=0;k<kLen;k+=1){
-                if(nodes[k].t == 'm'){
-                    ctx.moveTo(nodes[k].p[0],nodes[k].p[1]);
-                }else if(nodes[k].t == 'c'){
-                    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]);
-                }else{
-                    ctx.closePath();
-                }
-            }
-            if(type === 'st' || type === 'gs'){
-                ctx.stroke();
-                if(currentStyle.da){
-                    ctx.setLineDash(this.dashResetter);
-                }
-            }
-        }
-        if(type !== 'st' && type !== 'gs'){
-            ctx.fill(currentStyle.r);
-        }
-        renderer.restore();
-    }
-};
-
-CVShapeElement.prototype.renderShape = function(parentTransform,items,data,isMain){
-    var i, len = items.length - 1;
-    var groupTransform;
-    groupTransform = parentTransform;
-    for(i=len;i>=0;i-=1){
-        if(items[i].ty == 'tr'){
-            groupTransform = data[i].transform;
-            this.renderShapeTransform(parentTransform, groupTransform);
-        }else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc' || items[i].ty == 'sr'){
-            this.renderPath(items[i],data[i]);
-        }else if(items[i].ty == 'fl'){
-            this.renderFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'st'){
-            this.renderStroke(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gf' || items[i].ty == 'gs'){
-            this.renderGradientFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gr'){
-            this.renderShape(groupTransform,items[i].it,data[i].it);
-        }else if(items[i].ty == 'tm'){
-            //
-        }
-    }
-    if(isMain){
-        this.drawLayer();
-    }
-    
-};
-
-CVShapeElement.prototype.renderStyledShape = function(styledShape, shape){
-    if(this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
-        var shapeNodes = styledShape.trNodes;
-        var paths = shape.paths;
-        var i, len, j, jLen = paths._length;
-        shapeNodes.length = 0;
-        var groupTransformMat = styledShape.transforms.finalTransform;
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
         for (j = 0; j < jLen; j += 1) {
-            var pathNodes = paths.shapes[j];
-            if(pathNodes && pathNodes.v){
-                len = pathNodes._length;
-                for (i = 1; i < len; i += 1) {
-                    if (i === 1) {
-                        shapeNodes.push({
-                            t: 'm',
-                            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
-                        });
-                    }
-                    shapeNodes.push({
-                        t: 'c',
-                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])
-                    });
-                }
-                if (len === 1) {
-                    shapeNodes.push({
-                        t: 'm',
-                        p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
-                    });
-                }
-                if (pathNodes.c && len) {
-                    shapeNodes.push({
-                        t: 'c',
-                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])
-                    });
-                    shapeNodes.push({
-                        t: 'z'
-                    });
-                }
-            }
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        styledShape.trNodes = shapeNodes;
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, shouldRender, ownTransforms);
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        currentTransform = this.createTransformElement(arr[i]);
+        itemsData[i] = currentTransform;
+      }
+      ownTransforms.push(itemsData[i]);
+      this.addTransformToStyleList(itemsData[i]);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i]);
+      }
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        shouldRender = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-}
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  this.removeTransformFromStyleList();
+  this.closeStyles(ownStyles);
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
+};
 
-CVShapeElement.prototype.renderPath = function(pathData,itemData){
-    if(pathData.hd !== true && pathData._shouldRender) {
-        var i, len = itemData.styledShapes.length;
-        for (i = 0; i < len; i += 1) {
-            this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
+CVShapeElement.prototype.renderInnerContent = function () {
+  this.transformHelper.opacity = 1;
+  this.transformHelper._opMdf = false;
+  this.renderModifiers();
+  this.transformsManager.processSequences(this._isFirstFrame);
+  this.renderShape(this.transformHelper, this.shapesData, this.itemsData, true);
+};
+
+CVShapeElement.prototype.renderShapeTransform = function (parentTransform, groupTransform) {
+  if (parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
+    groupTransform.opacity = parentTransform.opacity;
+    groupTransform.opacity *= groupTransform.op.v;
+    groupTransform._opMdf = true;
+  }
+};
+
+CVShapeElement.prototype.drawLayer = function () {
+  var i;
+  var len = this.stylesList.length;
+  var j;
+  var jLen;
+  var k;
+  var kLen;
+  var elems;
+  var nodes;
+  var renderer = this.globalData.renderer;
+  var ctx = this.globalData.canvasContext;
+  var type;
+  var currentStyle;
+  for (i = 0; i < len; i += 1) {
+    currentStyle = this.stylesList[i];
+    type = currentStyle.type;
+
+    // Skipping style when
+    // Stroke width equals 0
+    // style should not be rendered (extra unused repeaters)
+    // current opacity equals 0
+    // global opacity equals 0
+    if (!(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0)) {
+      renderer.save();
+      elems = currentStyle.elements;
+      if (type === 'st' || type === 'gs') {
+        ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
+        ctx.lineWidth = currentStyle.wi;
+        ctx.lineCap = currentStyle.lc;
+        ctx.lineJoin = currentStyle.lj;
+        ctx.miterLimit = currentStyle.ml || 0;
+      } else {
+        ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
+      }
+      renderer.ctxOpacity(currentStyle.coOp);
+      if (type !== 'st' && type !== 'gs') {
+        ctx.beginPath();
+      }
+      renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
+      jLen = elems.length;
+      for (j = 0; j < jLen; j += 1) {
+        if (type === 'st' || type === 'gs') {
+          ctx.beginPath();
+          if (currentStyle.da) {
+            ctx.setLineDash(currentStyle.da);
+            ctx.lineDashOffset = currentStyle.do;
+          }
         }
-    }
-};
+        nodes = elems[j].trNodes;
+        kLen = nodes.length;
 
-CVShapeElement.prototype.renderFill = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-
-    if (itemData.c._mdf || this._isFirstFrame) {
-        styleElem.co = 'rgb(' 
-        + bm_floor(itemData.c.v[0]) + ',' 
-        + bm_floor(itemData.c.v[1]) + ',' 
-        + bm_floor(itemData.c.v[2]) + ')';
-    }
-    if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
-        styleElem.coOp = itemData.o.v * groupTransform.opacity;
-    }
-};
-
-CVShapeElement.prototype.renderGradientFill = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-    if(!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
-        var ctx = this.globalData.canvasContext;
-        var grd;
-        var pt1 = itemData.s.v, pt2 = itemData.e.v;
-        if (styleData.t === 1) {
-            grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
-        } else {
-            var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
-
-            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-            var dist = rad * percent;
-            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-            var grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
+        for (k = 0; k < kLen; k += 1) {
+          if (nodes[k].t === 'm') {
+            ctx.moveTo(nodes[k].p[0], nodes[k].p[1]);
+          } else if (nodes[k].t === 'c') {
+            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]);
+          } else {
+            ctx.closePath();
+          }
         }
-
-        var i, len = styleData.g.p;
-        var cValues = itemData.g.c;
-        var opacity = 1;
-
-        for (i = 0; i < len; i += 1){
-            if(itemData.g._hasOpacity && itemData.g._collapsable) {
-                opacity = itemData.g.o[i*2 + 1];
-            }
-            grd.addColorStop(cValues[i * 4] / 100,'rgba('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ',' + opacity + ')');
+        if (type === 'st' || type === 'gs') {
+          ctx.stroke();
+          if (currentStyle.da) {
+            ctx.setLineDash(this.dashResetter);
+          }
         }
-        styleElem.grd = grd;
+      }
+      if (type !== 'st' && type !== 'gs') {
+        ctx.fill(currentStyle.r);
+      }
+      renderer.restore();
     }
-    styleElem.coOp = itemData.o.v*groupTransform.opacity;
-    
+  }
 };
 
-CVShapeElement.prototype.renderStroke = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-    var d = itemData.d;
-    if(d && (d._mdf  || this._isFirstFrame)){
-        styleElem.da = d.dashArray;
-        styleElem.do = d.dashoffset[0];
+CVShapeElement.prototype.renderShape = function (parentTransform, items, data, isMain) {
+  var i;
+  var len = items.length - 1;
+  var groupTransform;
+  groupTransform = parentTransform;
+  for (i = len; i >= 0; i -= 1) {
+    if (items[i].ty === 'tr') {
+      groupTransform = data[i].transform;
+      this.renderShapeTransform(parentTransform, groupTransform);
+    } else if (items[i].ty === 'sh' || items[i].ty === 'el' || items[i].ty === 'rc' || items[i].ty === 'sr') {
+      this.renderPath(items[i], data[i]);
+    } else if (items[i].ty === 'fl') {
+      this.renderFill(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'st') {
+      this.renderStroke(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'gf' || items[i].ty === 'gs') {
+      this.renderGradientFill(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'gr') {
+      this.renderShape(groupTransform, items[i].it, data[i].it);
+    } else if (items[i].ty === 'tm') {
+      //
     }
-    if(itemData.c._mdf || this._isFirstFrame){
-        styleElem.co = 'rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')';
-    }
-    if(itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame){
-        styleElem.coOp = itemData.o.v*groupTransform.opacity;
-    }
-    if(itemData.w._mdf || this._isFirstFrame){
-        styleElem.wi = itemData.w.v;
-    }
+  }
+  if (isMain) {
+    this.drawLayer();
+  }
 };
 
-
-CVShapeElement.prototype.destroy = function(){
-    this.shapesData = null;
-    this.globalData = null;
-    this.canvasContext = null;
-    this.stylesList.length = 0;
-    this.itemsData.length = 0;
+CVShapeElement.prototype.renderStyledShape = function (styledShape, shape) {
+  if (this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
+    var shapeNodes = styledShape.trNodes;
+    var paths = shape.paths;
+    var i;
+    var len;
+    var j;
+    var jLen = paths._length;
+    shapeNodes.length = 0;
+    var groupTransformMat = styledShape.transforms.finalTransform;
+    for (j = 0; j < jLen; j += 1) {
+      var pathNodes = paths.shapes[j];
+      if (pathNodes && pathNodes.v) {
+        len = pathNodes._length;
+        for (i = 1; i < len; i += 1) {
+          if (i === 1) {
+            shapeNodes.push({
+              t: 'm',
+              p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0),
+            });
+          }
+          shapeNodes.push({
+            t: 'c',
+            pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i]),
+          });
+        }
+        if (len === 1) {
+          shapeNodes.push({
+            t: 'm',
+            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0),
+          });
+        }
+        if (pathNodes.c && len) {
+          shapeNodes.push({
+            t: 'c',
+            pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0]),
+          });
+          shapeNodes.push({
+            t: 'z',
+          });
+        }
+      }
+    }
+    styledShape.trNodes = shapeNodes;
+  }
 };
 
+CVShapeElement.prototype.renderPath = function (pathData, itemData) {
+  if (pathData.hd !== true && pathData._shouldRender) {
+    var i;
+    var len = itemData.styledShapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
+    }
+  }
+};
+
+CVShapeElement.prototype.renderFill = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+
+  if (itemData.c._mdf || this._isFirstFrame) {
+    styleElem.co = 'rgb('
+        + bmFloor(itemData.c.v[0]) + ','
+        + bmFloor(itemData.c.v[1]) + ','
+        + bmFloor(itemData.c.v[2]) + ')';
+  }
+  if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
+    styleElem.coOp = itemData.o.v * groupTransform.opacity;
+  }
+};
+
+CVShapeElement.prototype.renderGradientFill = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+  var grd;
+  if (!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
+    var ctx = this.globalData.canvasContext;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
+    if (styleData.t === 1) {
+      grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
+    } else {
+      var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+      var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+
+      var percent = itemData.h.v;
+      if (percent >= 1) {
+        percent = 0.99;
+      } else if (percent <= -1) {
+        percent = -0.99;
+      }
+      var dist = rad * percent;
+      var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+      var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+      grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
+    }
+
+    var i;
+    var len = styleData.g.p;
+    var cValues = itemData.g.c;
+    var opacity = 1;
+
+    for (i = 0; i < len; i += 1) {
+      if (itemData.g._hasOpacity && itemData.g._collapsable) {
+        opacity = itemData.g.o[i * 2 + 1];
+      }
+      grd.addColorStop(cValues[i * 4] / 100, 'rgba(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ',' + opacity + ')');
+    }
+    styleElem.grd = grd;
+  }
+  styleElem.coOp = itemData.o.v * groupTransform.opacity;
+};
+
+CVShapeElement.prototype.renderStroke = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+  var d = itemData.d;
+  if (d && (d._mdf || this._isFirstFrame)) {
+    styleElem.da = d.dashArray;
+    styleElem.do = d.dashoffset[0];
+  }
+  if (itemData.c._mdf || this._isFirstFrame) {
+    styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')';
+  }
+  if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
+    styleElem.coOp = itemData.o.v * groupTransform.opacity;
+  }
+  if (itemData.w._mdf || this._isFirstFrame) {
+    styleElem.wi = itemData.w.v;
+  }
+};
+
+CVShapeElement.prototype.destroy = function () {
+  this.shapesData = null;
+  this.globalData = null;
+  this.canvasContext = null;
+  this.stylesList.length = 0;
+  this.itemsData.length = 0;
+};
+
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement,
+SVGShapeElement, IImageElement */
 
 function CVSolidElement(data, globalData, comp) {
-    this.initElement(data,globalData,comp);
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);
 
 CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;
 CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
 
-CVSolidElement.prototype.renderInnerContent = function() {
-    var ctx = this.canvasContext;
-    ctx.fillStyle = this.data.sc;
-    ctx.fillRect(0, 0, this.data.sw, this.data.sh);
-    //
+CVSolidElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.fillStyle = this.data.sc;
+  ctx.fillRect(0, 0, this.data.sw, this.data.sh);
+  //
 };
-function CVTextElement(data, globalData, comp){
-    this.textSpans = [];
-    this.yOffset = 0;
-    this.fillColorAnim = false;
-    this.strokeColorAnim = false;
-    this.strokeWidthAnim = false;
-    this.stroke = false;
-    this.fill = false;
-    this.justifyOffset = 0;
-    this.currentRender = null;
-    this.renderType = 'canvas';
-    this.values = {
-        fill: 'rgba(0,0,0,0)',
-        stroke: 'rgba(0,0,0,0)',
-        sWidth: 0,
-        fValue: ''
-    };
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement,
+RenderableElement, ITextElement, createTag, createSizedArray */
+
+function CVTextElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.yOffset = 0;
+  this.fillColorAnim = false;
+  this.strokeColorAnim = false;
+  this.strokeWidthAnim = false;
+  this.stroke = false;
+  this.fill = false;
+  this.justifyOffset = 0;
+  this.currentRender = null;
+  this.renderType = 'canvas';
+  this.values = {
+    fill: 'rgba(0,0,0,0)',
+    stroke: 'rgba(0,0,0,0)',
+    sWidth: 0,
+    fValue: '',
+  };
+  this.initElement(data, globalData, comp);
 }
-extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement], CVTextElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement);
 
 CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d');
 
-CVTextElement.prototype.buildNewText = function(){
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
+CVTextElement.prototype.buildNewText = function () {
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
 
-    var hasFill = false;
-    if(documentData.fc) {
-        hasFill = true;
-        this.values.fill = this.buildColor(documentData.fc);
-    }else{
-        this.values.fill = 'rgba(0,0,0,0)';
+  var hasFill = false;
+  if (documentData.fc) {
+    hasFill = true;
+    this.values.fill = this.buildColor(documentData.fc);
+  } else {
+    this.values.fill = 'rgba(0,0,0,0)';
+  }
+  this.fill = hasFill;
+  var hasStroke = false;
+  if (documentData.sc) {
+    hasStroke = true;
+    this.values.stroke = this.buildColor(documentData.sc);
+    this.values.sWidth = documentData.sw;
+  }
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  var i;
+  var len;
+  var letters = documentData.l;
+  var matrixHelper = this.mHelper;
+  this.stroke = hasStroke;
+  this.values.fValue = documentData.finalSize + 'px ' + this.globalData.fontManager.getFontByName(documentData.f).fFamily;
+  len = documentData.finalText.length;
+  // this.tHelper.font = this.values.fValue;
+  var charData;
+  var shapeData;
+  var k;
+  var kLen;
+  var shapes;
+  var j;
+  var jLen;
+  var pathNodes;
+  var commands;
+  var pathArr;
+  var singleShape = this.data.singleShape;
+  var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
+  var xPos = 0;
+  var yPos = 0;
+  var firstLine = true;
+  var cnt = 0;
+  for (i = 0; i < len; i += 1) {
+    charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+    shapeData = (charData && charData.data) || {};
+    matrixHelper.reset();
+    if (singleShape && letters[i].n) {
+      xPos = -trackingOffset;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      firstLine = false;
     }
-    this.fill = hasFill;
-    var hasStroke = false;
-    if(documentData.sc){
-        hasStroke = true;
-        this.values.stroke = this.buildColor(documentData.sc);
-        this.values.sWidth = documentData.sw;
-    }
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    var i, len;
-    var letters = documentData.l;
-    var matrixHelper = this.mHelper;
-    this.stroke = hasStroke;
-    this.values.fValue = documentData.finalSize + 'px '+ this.globalData.fontManager.getFontByName(documentData.f).fFamily;
-    len = documentData.finalText.length;
-    //this.tHelper.font = this.values.fValue;
-    var charData, shapeData, k, kLen, shapes, j, jLen, pathNodes, commands, pathArr, singleShape = this.data.singleShape;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var xPos = 0, yPos = 0, firstLine = true;
-    var cnt = 0;
-    for (i = 0; i < len; i += 1) {
-        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-        shapeData = charData && charData.data || {};
-        matrixHelper.reset();
-        if(singleShape && letters[i].n) {
-            xPos = -trackingOffset;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            firstLine = false;
-        }
 
-        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
-        jLen = shapes.length;
-        matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
-        if(singleShape){
-            this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
-        }
-        commands = createSizedArray(jLen);
-        for(j=0;j<jLen;j+=1){
-            kLen = shapes[j].ks.k.i.length;
-            pathNodes = shapes[j].ks.k;
-            pathArr = [];
-            for(k=1;k<kLen;k+=1){
-                if(k==1){
-                    pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0],pathNodes.v[0][1],0),matrixHelper.applyToY(pathNodes.v[0][0],pathNodes.v[0][1],0));
-                }
-                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));
-            }
-            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));
-            commands[j] = pathArr;
-        }
-        if(singleShape){
-            xPos += letters[i].l;
-            xPos += trackingOffset;
-        }
-        if(this.textSpans[cnt]){
-            this.textSpans[cnt].elem = commands;
-        } else {
-            this.textSpans[cnt] = {elem: commands};
-        }
-        cnt +=1;
+    shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+    jLen = shapes.length;
+    matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+    if (singleShape) {
+      this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
     }
+    commands = createSizedArray(jLen);
+    for (j = 0; j < jLen; j += 1) {
+      kLen = shapes[j].ks.k.i.length;
+      pathNodes = shapes[j].ks.k;
+      pathArr = [];
+      for (k = 1; k < kLen; k += 1) {
+        if (k === 1) {
+          pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));
+        }
+        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));
+      }
+      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));
+      commands[j] = pathArr;
+    }
+    if (singleShape) {
+      xPos += letters[i].l;
+      xPos += trackingOffset;
+    }
+    if (this.textSpans[cnt]) {
+      this.textSpans[cnt].elem = commands;
+    } else {
+      this.textSpans[cnt] = { elem: commands };
+    }
+    cnt += 1;
+  }
 };
 
-CVTextElement.prototype.renderInnerContent = function(){
-    var ctx = this.canvasContext;
-    var finalMat = this.finalTransform.mat.props;
-    ctx.font = this.values.fValue;
-    ctx.lineCap = 'butt';
-    ctx.lineJoin = 'miter';
-    ctx.miterLimit = 4;
+CVTextElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.font = this.values.fValue;
+  ctx.lineCap = 'butt';
+  ctx.lineJoin = 'miter';
+  ctx.miterLimit = 4;
 
-    if(!this.data.singleShape){
-        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  if (!this.data.singleShape) {
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  }
+
+  var i;
+  var len;
+  var j;
+  var jLen;
+  var k;
+  var kLen;
+  var renderedLetters = this.textAnimator.renderedLetters;
+
+  var letters = this.textProperty.currentData.l;
+
+  len = letters.length;
+  var renderedLetter;
+  var lastFill = null;
+  var lastStroke = null;
+  var lastStrokeW = null;
+  var commands;
+  var pathArr;
+  for (i = 0; i < len; i += 1) {
+    if (!letters[i].n) {
+      renderedLetter = renderedLetters[i];
+      if (renderedLetter) {
+        this.globalData.renderer.save();
+        this.globalData.renderer.ctxTransform(renderedLetter.p);
+        this.globalData.renderer.ctxOpacity(renderedLetter.o);
+      }
+      if (this.fill) {
+        if (renderedLetter && renderedLetter.fc) {
+          if (lastFill !== renderedLetter.fc) {
+            lastFill = renderedLetter.fc;
+            ctx.fillStyle = renderedLetter.fc;
+          }
+        } else if (lastFill !== this.values.fill) {
+          lastFill = this.values.fill;
+          ctx.fillStyle = this.values.fill;
+        }
+        commands = this.textSpans[i].elem;
+        jLen = commands.length;
+        this.globalData.canvasContext.beginPath();
+        for (j = 0; j < jLen; j += 1) {
+          pathArr = commands[j];
+          kLen = pathArr.length;
+          this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
+          for (k = 2; k < kLen; k += 6) {
+            this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
+          }
+        }
+        this.globalData.canvasContext.closePath();
+        this.globalData.canvasContext.fill();
+        /// ctx.fillText(this.textSpans[i].val,0,0);
+      }
+      if (this.stroke) {
+        if (renderedLetter && renderedLetter.sw) {
+          if (lastStrokeW !== renderedLetter.sw) {
+            lastStrokeW = renderedLetter.sw;
+            ctx.lineWidth = renderedLetter.sw;
+          }
+        } else if (lastStrokeW !== this.values.sWidth) {
+          lastStrokeW = this.values.sWidth;
+          ctx.lineWidth = this.values.sWidth;
+        }
+        if (renderedLetter && renderedLetter.sc) {
+          if (lastStroke !== renderedLetter.sc) {
+            lastStroke = renderedLetter.sc;
+            ctx.strokeStyle = renderedLetter.sc;
+          }
+        } else if (lastStroke !== this.values.stroke) {
+          lastStroke = this.values.stroke;
+          ctx.strokeStyle = this.values.stroke;
+        }
+        commands = this.textSpans[i].elem;
+        jLen = commands.length;
+        this.globalData.canvasContext.beginPath();
+        for (j = 0; j < jLen; j += 1) {
+          pathArr = commands[j];
+          kLen = pathArr.length;
+          this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
+          for (k = 2; k < kLen; k += 6) {
+            this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
+          }
+        }
+        this.globalData.canvasContext.closePath();
+        this.globalData.canvasContext.stroke();
+        /// ctx.strokeText(letters[i].val,0,0);
+      }
+      if (renderedLetter) {
+        this.globalData.renderer.restore();
+      }
     }
-
-    var  i,len, j, jLen, k, kLen;
-    var renderedLetters = this.textAnimator.renderedLetters;
-
-    var letters = this.textProperty.currentData.l;
-
-    len = letters.length;
-    var renderedLetter;
-    var lastFill = null, lastStroke = null, lastStrokeW = null, commands, pathArr;
-    for(i=0;i<len;i+=1){
-        if(letters[i].n){
-            continue;
-        }
-        renderedLetter = renderedLetters[i];
-        if(renderedLetter){
-            this.globalData.renderer.save();
-            this.globalData.renderer.ctxTransform(renderedLetter.p);
-            this.globalData.renderer.ctxOpacity(renderedLetter.o);
-        }
-        if(this.fill){
-            if(renderedLetter && renderedLetter.fc){
-                if(lastFill !== renderedLetter.fc){
-                    lastFill = renderedLetter.fc;
-                    ctx.fillStyle = renderedLetter.fc;
-                }
-            }else if(lastFill !== this.values.fill){
-                lastFill = this.values.fill;
-                ctx.fillStyle = this.values.fill;
-            }
-            commands = this.textSpans[i].elem;
-            jLen = commands.length;
-            this.globalData.canvasContext.beginPath();
-            for(j=0;j<jLen;j+=1) {
-                pathArr = commands[j];
-                kLen = pathArr.length;
-                this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
-                for (k = 2; k < kLen; k += 6) {
-                    this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
-                }
-            }
-            this.globalData.canvasContext.closePath();
-            this.globalData.canvasContext.fill();
-            ///ctx.fillText(this.textSpans[i].val,0,0);
-        }
-        if(this.stroke){
-            if(renderedLetter && renderedLetter.sw){
-                if(lastStrokeW !== renderedLetter.sw){
-                    lastStrokeW = renderedLetter.sw;
-                    ctx.lineWidth = renderedLetter.sw;
-                }
-            }else if(lastStrokeW !== this.values.sWidth){
-                lastStrokeW = this.values.sWidth;
-                ctx.lineWidth = this.values.sWidth;
-            }
-            if(renderedLetter && renderedLetter.sc){
-                if(lastStroke !== renderedLetter.sc){
-                    lastStroke = renderedLetter.sc;
-                    ctx.strokeStyle = renderedLetter.sc;
-                }
-            }else if(lastStroke !== this.values.stroke){
-                lastStroke = this.values.stroke;
-                ctx.strokeStyle = this.values.stroke;
-            }
-            commands = this.textSpans[i].elem;
-            jLen = commands.length;
-            this.globalData.canvasContext.beginPath();
-            for(j=0;j<jLen;j+=1) {
-                pathArr = commands[j];
-                kLen = pathArr.length;
-                this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
-                for (k = 2; k < kLen; k += 6) {
-                    this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
-                }
-            }
-            this.globalData.canvasContext.closePath();
-            this.globalData.canvasContext.stroke();
-            ///ctx.strokeText(letters[i].val,0,0);
-        }
-        if(renderedLetter) {
-            this.globalData.renderer.restore();
-        }
-    }
+  }
 };
+
 function CVEffects() {
 
 }
-CVEffects.prototype.renderFrame = function(){};
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
+CVEffects.prototype.renderFrame = function () {};
 
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+/* global createTag, AnimationItem */
+/* exported animationManager */
+
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
+    while (i < len) {
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      window.requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            window.requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    window.requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        window.requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations(animationData, standalone, renderer) {
+    var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+      [].slice.call(document.getElementsByClassName('bodymovin')));
+    var i;
+    var lenAnims = animElements.length;
+    for (i = 0; i < lenAnims; i += 1) {
+      if (renderer) {
+        animElements[i].setAttribute('data-bm-type', renderer);
+      }
+      registerAnimation(animElements[i], animationData);
     }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
-                  [].slice.call(document.getElementsByClassName('bodymovin')));
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerText = '';
-            var div = createTag('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
+    if (standalone && lenAnims === 0) {
+      if (!renderer) {
+        renderer = 'svg';
+      }
+      var body = document.getElementsByTagName('body')[0];
+      body.innerText = '';
+      var div = createTag('div');
+      div.style.width = '100%';
+      div.style.height = '100%';
+      div.setAttribute('data-bm-type', renderer);
+      body.appendChild(div);
+      registerAnimation(div, animationData);
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                window.requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        window.requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function freeze() {
-        _isFrozen = true;
+  function freeze() {
+    _isFrozen = true;
+  }
+
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
+
+  function setVolume(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setVolume(val, animation);
     }
+  }
 
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
+  function mute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.mute(animation);
     }
+  }
 
-    function setVolume(val,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setVolume(val, animation);
-        }
+  function unmute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.unmute(animation);
     }
+  }
 
-    function mute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.mute(animation);
-        }
-    }
-
-    function unmute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.unmute(animation);
-        }
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.setVolume = setVolume;
-    moduleOb.mute = mute;
-    moduleOb.unmute = unmute;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.setVolume = setVolume;
+  moduleOb.mute = mute;
+  moduleOb.unmute = unmute;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
+/* global createElementID, subframeEnabled, ProjectInterface, ImagePreloader, audioControllerFactory, extendPrototype, BaseEvent,
+CanvasRenderer, SVGRenderer, HybridRenderer, assetLoader, dataManager, expressionsPlugin, BMEnterFrameEvent, BMCompleteLoopEvent,
+BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent,
+BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent */
+
 var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.firstFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.playCount = 0;
-    this.animationData = {};
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = createElementID();
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.isSubframeEnabled = subframeEnabled;
-    this.segments = [];
-    this._idle = true;
-    this._completedLoop = false;
-    this.projectInterface = ProjectInterface();
-    this.imagePreloader = new ImagePreloader();
-    this.audioController = audioControllerFactory();
+  this._cbs = [];
+  this.name = '';
+  this.path = '';
+  this.isLoaded = false;
+  this.currentFrame = 0;
+  this.currentRawFrame = 0;
+  this.firstFrame = 0;
+  this.totalFrames = 0;
+  this.frameRate = 0;
+  this.frameMult = 0;
+  this.playSpeed = 1;
+  this.playDirection = 1;
+  this.playCount = 0;
+  this.animationData = {};
+  this.assets = [];
+  this.isPaused = true;
+  this.autoplay = false;
+  this.loop = true;
+  this.renderer = null;
+  this.animationID = createElementID();
+  this.assetsPath = '';
+  this.timeCompleted = 0;
+  this.segmentPos = 0;
+  this.isSubframeEnabled = subframeEnabled;
+  this.segments = [];
+  this._idle = true;
+  this._completedLoop = false;
+  this.projectInterface = ProjectInterface();
+  this.imagePreloader = new ImagePreloader();
+  this.audioController = audioControllerFactory();
 };
 
 extendPrototype([BaseEvent], AnimationItem);
 
-AnimationItem.prototype.setParams = function(params) {
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-    if (params.loop === ''
+AnimationItem.prototype.setParams = function (params) {
+  if (params.wrapper || params.container) {
+    this.wrapper = params.wrapper || params.container;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    case 'svg':
+      this.renderer = new SVGRenderer(this, params.rendererSettings);
+      break;
+    default:
+      this.renderer = new HybridRenderer(this, params.rendererSettings);
+      break;
+  }
+  this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+  if (params.loop === ''
         || params.loop === null
         || params.loop === undefined
-        || params.loop === true)
-    {
-        this.loop = true;
-    } else if (params.loop === false) {
-        this.loop = false;
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = params.assetsPath;
+  this.initialSegment = params.initialSegment;
+  if (params.audioFactory) {
+    this.audioController.setAudioFactory(params.audioFactory);
+  }
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    if (params.path.lastIndexOf('\\') !== -1) {
+      this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
     } else {
-        this.loop = parseInt(params.loop);
+      this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
     }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = params.assetsPath;
-    this.initialSegment = params.initialSegment;
-    if (params.audioFactory) {
-        this.audioController.setAudioFactory(params.audioFactory);
-    }
-    if (params.animationData) {
-        this.configAnimation(params.animationData);
-    } else if(params.path){
+    this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
+    this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
 
-        if( params.path.lastIndexOf('\\') !== -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        } else {
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-
-        assetLoader.load(params.path, this.configAnimation.bind(this), function() {
-            this.trigger('data_failed');
-        }.bind(this));
-    }
-
+    assetLoader.load(params.path, this.configAnimation.bind(this), function () {
+      this.trigger('data_failed');
+    }.bind(this));
+  }
 };
 
 AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
+  if (animationData) {
+    if (typeof animationData !== 'object') {
+      animationData = JSON.parse(animationData);
     }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
+  }
+  var params = {
+    wrapper: wrapper,
+    animationData: animationData,
+  };
+  var wrapperAttributes = wrapper.attributes;
 
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
+  params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-animation-path').value
+    : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-path').value
+      : wrapperAttributes.getNamedItem('bm-path')
+        ? wrapperAttributes.getNamedItem('bm-path').value
+        : '';
+  params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-type').value
+    : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-type').value
+      : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
+        ? wrapperAttributes.getNamedItem('bm-type').value
+        : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
+          ? wrapperAttributes.getNamedItem('data-bm-renderer').value
+          : wrapperAttributes.getNamedItem('bm-renderer')
+            ? wrapperAttributes.getNamedItem('bm-renderer').value
+            : 'canvas';
 
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
+  var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-loop').value
+    : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-loop').value
+      : wrapperAttributes.getNamedItem('bm-loop')
+        ? wrapperAttributes.getNamedItem('bm-loop').value
+        : '';
+  if (loop === 'false') {
+    params.loop = false;
+  } else if (loop === 'true') {
+    params.loop = true;
+  } else if (loop !== '') {
+    params.loop = parseInt(loop, 10);
+  }
+  var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-autoplay').value
+    : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-autoplay').value
+      : wrapperAttributes.getNamedItem('bm-autoplay')
+        ? wrapperAttributes.getNamedItem('bm-autoplay').value
+        : true;
+  params.autoplay = autoplay !== 'false';
+
+  params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-name').value
+    : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-name').value
+      : wrapperAttributes.getNamedItem('bm-name')
+        ? wrapperAttributes.getNamedItem('bm-name').value
+        : '';
+  var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-prerender').value
+    : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-prerender').value
+      : wrapperAttributes.getNamedItem('bm-prerender')
+        ? wrapperAttributes.getNamedItem('bm-prerender').value
+        : '';
+
+  if (prerender === 'false') {
+    params.prerender = false;
+  }
+  this.setParams(params);
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
+  }
+  if (data.chars || data.fonts) {
+    this.renderer.globalData.fontManager.addChars(data.chars);
+    this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
+  }
+  if (data.assets) {
+    len = data.assets.length;
+    for (i = 0; i < len; i += 1) {
+      this.animationData.assets.push(data.assets[i]);
     }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
-        this.trigger('data_failed');
-    }.bind(this));
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.trigger('data_ready');
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  var segment = segments.shift();
+  this.timeCompleted = segment.time * this.frameRate;
+  var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
+  this.segmentPos += 1;
+  assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
+    this.trigger('data_failed');
+  }.bind(this));
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
-    }
-    this.loadNextSegment();
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.imagesLoaded = function() {
-    this.trigger('loaded_images');
-    this.checkLoaded()
-}
+AnimationItem.prototype.imagesLoaded = function () {
+  this.trigger('loaded_images');
+  this.checkLoaded();
+};
 
-AnimationItem.prototype.preloadImages = function() {
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
-}
+AnimationItem.prototype.preloadImages = function () {
+  this.imagePreloader.setAssetsPath(this.assetsPath);
+  this.imagePreloader.setPath(this.path);
+  this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
+};
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    try {
-        this.animationData = animData;
+  if (!this.renderer) {
+    return;
+  }
+  try {
+    this.animationData = animData;
 
-        if (this.initialSegment) {
-            this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
-            this.firstFrame = Math.round(this.initialSegment[0]);
-        } else {
-            this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-            this.firstFrame = Math.round(this.animationData.ip);
-        }
-        this.renderer.configAnimation(animData);
-        if(!animData.assets){
-            animData.assets = [];
-        }
-
-        this.assets = this.animationData.assets;
-        this.frameRate = this.animationData.fr;
-        this.frameMult = this.animationData.fr / 1000;
-        this.renderer.searchExtraCompositions(animData.assets);
-        this.trigger('config_ready');
-        this.preloadImages();
-        this.loadSegments();
-        this.updaFrameModifier();
-        this.waitForFontsLoaded();
-        if (this.isPaused) {
-            this.audioController.pause();
-        }
-    } catch(error) {
-        this.triggerConfigError(error);
+    if (this.initialSegment) {
+      this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+      this.firstFrame = Math.round(this.initialSegment[0]);
+    } else {
+      this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+      this.firstFrame = Math.round(this.animationData.ip);
     }
+    this.renderer.configAnimation(animData);
+    if (!animData.assets) {
+      animData.assets = [];
+    }
+
+    this.assets = this.animationData.assets;
+    this.frameRate = this.animationData.fr;
+    this.frameMult = this.animationData.fr / 1000;
+    this.renderer.searchExtraCompositions(animData.assets);
+    this.trigger('config_ready');
+    this.preloadImages();
+    this.loadSegments();
+    this.updaFrameModifier();
+    this.waitForFontsLoaded();
+    if (this.isPaused) {
+      this.audioController.pause();
+    }
+  } catch (error) {
+    this.triggerConfigError(error);
+  }
 };
 
-AnimationItem.prototype.waitForFontsLoaded = function(){
-    if(!this.renderer) {
-        return;
-    }
-    if(this.renderer.globalData.fontManager.isLoaded){
-        this.checkLoaded();
-    }else{
-        setTimeout(this.waitForFontsLoaded.bind(this),20);
-    }
-}
+AnimationItem.prototype.waitForFontsLoaded = function () {
+  if (!this.renderer) {
+    return;
+  }
+  if (this.renderer.globalData.fontManager.isLoaded) {
+    this.checkLoaded();
+  } else {
+    setTimeout(this.waitForFontsLoaded.bind(this), 20);
+  }
+};
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded 
+  if (!this.isLoaded
         && this.renderer.globalData.fontManager.isLoaded
         && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')
-    ) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function() {
-            this.trigger('DOMLoaded');
-        }.bind(this), 0);
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
+  ) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    setTimeout(function () {
+      this.trigger('DOMLoaded');
+    }.bind(this), 0);
+    this.gotoFrame();
+    if (this.autoplay) {
+      this.play();
+    }
+  }
 };
 
 AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
+  this.renderer.updateContainerSize();
 };
 
-AnimationItem.prototype.setSubframe = function(flag){
-    this.isSubframeEnabled = !!flag;
+AnimationItem.prototype.setSubframe = function (flag) {
+  this.isSubframeEnabled = !!flag;
 };
 
 AnimationItem.prototype.gotoFrame = function () {
-    this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
+  this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
 
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
+  if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
+    this.currentFrame = this.timeCompleted;
+  }
+  this.trigger('enterFrame');
+  this.renderFrame();
 };
 
 AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    try {
-        this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-    } catch(error) {
-        this.triggerRenderFrameError(error);
-    }
+  if (this.isLoaded === false) {
+    return;
+  }
+  try {
+    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
+  } catch (error) {
+    this.triggerRenderFrameError(error);
+  }
 };
 
 AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.isPaused = false;
+    this.audioController.resume();
+    if (this._idle) {
+      this._idle = false;
+      this.trigger('_active');
     }
-    if (this.isPaused === true) {
-        this.isPaused = false;
-        this.audioController.resume();
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
+  }
 };
 
 AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        this._idle = true;
-        this.trigger('_idle');
-        this.audioController.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === false) {
+    this.isPaused = true;
+    this._idle = true;
+    this.trigger('_idle');
+    this.audioController.pause();
+  }
 };
 
 AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.play();
+  } else {
+    this.pause();
+  }
 };
 
 AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.playCount = 0;
-    this._completedLoop = false;
-    this.setCurrentRawFrameValue(0);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.pause();
+  this.playCount = 0;
+  this._completedLoop = false;
+  this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
+  if (name && this.name !== name) {
+    return;
+  }
+  if (isFrame) {
+    this.setCurrentRawFrameValue(value);
+  } else {
+    this.setCurrentRawFrameValue(value * this.frameModifier);
+  }
+  this.pause();
 };
 
 AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
+  this.goToAndStop(value, isFrame, name);
+  this.play();
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    var nextValue = this.currentRawFrame + value * this.frameModifier;
-    var _isComplete = false;
-    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
-    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
-    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
-        if (!this.loop || this.playCount === this.loop) {
-            if (!this.checkSegments(nextValue >  this.totalFrames ? nextValue % this.totalFrames : 0)) {
-                _isComplete = true;
-                nextValue = this.totalFrames - 1;
-            }
-        } else if (nextValue >= this.totalFrames) {
-            this.playCount += 1;
-            if (!this.checkSegments(nextValue % this.totalFrames)) {
-                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
-                this._completedLoop = true;
-                this.trigger('loopComplete');
-            }
-        } else {
-            this.setCurrentRawFrameValue(nextValue);
-        }
-    } else if(nextValue < 0) {
-        if (!this.checkSegments(nextValue % this.totalFrames)) {
-            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
-                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
-                if(!this._completedLoop) {
-                    this._completedLoop = true;
-                } else {
-                    this.trigger('loopComplete');
-                }
-            } else {
-                _isComplete = true;
-                nextValue = 0;
-            }
-        }
+  if (this.isPaused === true || this.isLoaded === false) {
+    return;
+  }
+  var nextValue = this.currentRawFrame + value * this.frameModifier;
+  var _isComplete = false;
+  // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+  // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+  if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+    if (!this.loop || this.playCount === this.loop) {
+      if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
+        _isComplete = true;
+        nextValue = this.totalFrames - 1;
+      }
+    } else if (nextValue >= this.totalFrames) {
+      this.playCount += 1;
+      if (!this.checkSegments(nextValue % this.totalFrames)) {
+        this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+        this._completedLoop = true;
+        this.trigger('loopComplete');
+      }
     } else {
-        this.setCurrentRawFrameValue(nextValue);
+      this.setCurrentRawFrameValue(nextValue);
     }
-    if (_isComplete) {
-        this.setCurrentRawFrameValue(nextValue);
-        this.pause();
-        this.trigger('complete');
+  } else if (nextValue < 0) {
+    if (!this.checkSegments(nextValue % this.totalFrames)) {
+      if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) { // eslint-disable-line no-plusplus
+        this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+        if (!this._completedLoop) {
+          this._completedLoop = true;
+        } else {
+          this.trigger('loopComplete');
+        }
+      } else {
+        _isComplete = true;
+        nextValue = 0;
+      }
     }
+  } else {
+    this.setCurrentRawFrameValue(nextValue);
+  }
+  if (_isComplete) {
+    this.setCurrentRawFrameValue(nextValue);
+    this.pause();
+    this.trigger('complete');
+  }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr, offset){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0.001 + offset);
+AnimationItem.prototype.adjustSegment = function (arr, offset) {
+  this.playCount = 0;
+  if (arr[1] < arr[0]) {
+    if (this.frameModifier > 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(-1);
+      }
     }
-    this.trigger('segmentStart');
+    this.totalFrames = arr[0] - arr[1];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[1];
+    this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
+  } else if (arr[1] > arr[0]) {
+    if (this.frameModifier < 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(1);
+      }
+    }
+    this.totalFrames = arr[1] - arr[0];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[0];
+    this.setCurrentRawFrameValue(0.001 + offset);
+  }
+  this.trigger('segmentStart');
 };
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init;
-        }
+AnimationItem.prototype.setSegment = function (init, end) {
+  var pendingFrame = -1;
+  if (this.isPaused) {
+    if (this.currentRawFrame + this.firstFrame < init) {
+      pendingFrame = init;
+    } else if (this.currentRawFrame + this.firstFrame > end) {
+      pendingFrame = end - init;
     }
+  }
 
-    this.firstFrame = init;
-    this.timeCompleted = this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
+  this.firstFrame = init;
+  this.totalFrames = end - init;
+  this.timeCompleted = this.totalFrames;
+  if (pendingFrame !== -1) {
+    this.goToAndStop(pendingFrame, true);
+  }
 };
 
 AnimationItem.prototype.playSegments = function (arr, forceFlag) {
-    if (forceFlag) {
-        this.segments.length = 0;
+  if (forceFlag) {
+    this.segments.length = 0;
+  }
+  if (typeof arr[0] === 'object') {
+    var i;
+    var len = arr.length;
+    for (i = 0; i < len; i += 1) {
+      this.segments.push(arr[i]);
     }
-    if (typeof arr[0] === 'object') {
-        var i, len = arr.length;
-        for (i = 0; i < len; i += 1) {
-            this.segments.push(arr[i]);
-        }
-    } else {
-        this.segments.push(arr);
-    }
-    if (this.segments.length && forceFlag) {
-        this.adjustSegment(this.segments.shift(), 0);
-    }
-    if (this.isPaused) {
-        this.play();
-    }
+  } else {
+    this.segments.push(arr);
+  }
+  if (this.segments.length && forceFlag) {
+    this.adjustSegment(this.segments.shift(), 0);
+  }
+  if (this.isPaused) {
+    this.play();
+  }
 };
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip,this.animationData.op]);
-    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if (forceFlag) {
-        this.checkSegments(0);
-    }
+  this.segments.length = 0;
+  this.segments.push([this.animationData.ip, this.animationData.op]);
+  // this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+  if (forceFlag) {
+    this.checkSegments(0);
+  }
 };
-AnimationItem.prototype.checkSegments = function(offset) {
-    if (this.segments.length) {
-        this.adjustSegment(this.segments.shift(), offset);
-        return true;
-    }
-    return false;
+AnimationItem.prototype.checkSegments = function (offset) {
+  if (this.segments.length) {
+    this.adjustSegment(this.segments.shift(), offset);
+    return true;
+  }
+  return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this.imagePreloader.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this.imagePreloader.destroy();
+  this.trigger('destroy');
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
+  this.renderer = null;
+  this.imagePreloader = null;
+  this.projectInterface = null;
 };
 
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    this.gotoFrame();
+AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
+  this.currentRawFrame = value;
+  this.gotoFrame();
 };
 
 AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
+  this.playSpeed = val;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
+  this.playDirection = val < 0 ? -1 : 1;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setVolume = function (val, name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.setVolume(val);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.setVolume(val);
 };
 
 AnimationItem.prototype.getVolume = function () {
-    return this.audioController.getVolume();
+  return this.audioController.getVolume();
 };
 
 AnimationItem.prototype.mute = function (name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.mute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.mute();
 };
 
 AnimationItem.prototype.unmute = function (name) {
-    if(name && this.name !== name){
-        return;
-    }
-    this.audioController.unmute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.unmute();
 };
 
 AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-    this.audioController.setRate(this.playSpeed * this.playDirection)
+  this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
+  this.audioController.setRate(this.playSpeed * this.playDirection);
 };
 
 AnimationItem.prototype.getPath = function () {
-    return this.path;
+  return this.path;
 };
 
 AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(assetData.e) {
-        path = assetData.p;
-    } else if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
+  var path = '';
+  if (assetData.e) {
+    path = assetData.p;
+  } else if (this.assetsPath) {
+    var imagePath = assetData.p;
+    if (imagePath.indexOf('images/') !== -1) {
+      imagePath = imagePath.split('/')[1];
     }
-    return path;
+    path = this.assetsPath + imagePath;
+  } else {
+    path = this.path;
+    path += assetData.u ? assetData.u : '';
+    path += assetData.p;
+  }
+  return path;
 };
 
 AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
+  var i = 0;
+  var len = this.assets.length;
+  while (i < len) {
+    if (id === this.assets[i].id) {
+      return this.assets[i];
     }
+    i += 1;
+  }
+  return null;
 };
 
 AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
+  this.renderer.hide();
 };
 
 AnimationItem.prototype.show = function () {
-    this.renderer.show();
+  this.renderer.show();
 };
 
 AnimationItem.prototype.getDuration = function (isFrame) {
-    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+  return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
 };
 
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
+AnimationItem.prototype.trigger = function (name) {
+  if (this._cbs && this._cbs[name]) {
+    switch (name) {
+      case 'enterFrame':
+        this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
+        break;
+      case 'loopComplete':
+        this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+        break;
+      case 'complete':
+        this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
+        break;
+      case 'segmentStart':
+        this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+        break;
+      case 'destroy':
+        this.triggerEvent(name, new BMDestroyEvent(name, this));
+        break;
+      default:
+        this.triggerEvent(name);
     }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
+  }
+  if (name === 'enterFrame' && this.onEnterFrame) {
+    this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
+  }
+  if (name === 'loopComplete' && this.onLoopComplete) {
+    this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+  }
+  if (name === 'complete' && this.onComplete) {
+    this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
+  }
+  if (name === 'segmentStart' && this.onSegmentStart) {
+    this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+  }
+  if (name === 'destroy' && this.onDestroy) {
+    this.onDestroy.call(this, new BMDestroyEvent(name, this));
+  }
 };
 
-AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
+AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
+  var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-    var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
 
-    if (this.onError) {
-        this.onError.call(this, error);
+AnimationItem.prototype.triggerConfigError = function (nativeError) {
+  var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
+
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
+
+/* global CompExpressionInterface, expressionsPlugin: writable */
+/* exported expressionsPlugin */
+
+var Expressions = (function () {
+  var ob = {};
+  ob.initExpressions = initExpressions;
+
+  function initExpressions(animation) {
+    var stackCount = 0;
+    var registers = [];
+
+    function pushExpression() {
+      stackCount += 1;
     }
-}
 
-AnimationItem.prototype.triggerConfigError = function(nativeError) {
-
-    var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
+    function popExpression() {
+      stackCount -= 1;
+      if (stackCount === 0) {
+        releaseInstances();
+      }
     }
-}
-var Expressions = (function(){
-    var ob = {};
-    ob.initExpressions = initExpressions;
 
-
-    function initExpressions(animation){
-
-    	var stackCount = 0;
-    	var registers = [];
-
-    	function pushExpression() {
-			stackCount += 1;
-    	}
-
-    	function popExpression() {
-			stackCount -= 1;
-			if (stackCount === 0) {
-				releaseInstances();
-			}
-    	}
-
-    	function registerExpressionProperty(expression) {
-    		if (registers.indexOf(expression) === -1) {
-				registers.push(expression)
-    		}
-    	}
-
-    	function releaseInstances() {
-    		var i, len = registers.length;
-    		for (i = 0; i < len; i += 1) {
-				registers[i].release();
-    		}
-    		registers.length = 0;
-    	}
-
-        animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
-        animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
-        animation.renderer.globalData.pushExpression = pushExpression;
-        animation.renderer.globalData.popExpression = popExpression;
-        animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+    function registerExpressionProperty(expression) {
+      if (registers.indexOf(expression) === -1) {
+        registers.push(expression);
+      }
     }
-   return ob;
+
+    function releaseInstances() {
+      var i;
+      var len = registers.length;
+      for (i = 0; i < len; i += 1) {
+        registers[i].release();
+      }
+      registers.length = 0;
+    }
+
+    animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
+    animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
+    animation.renderer.globalData.pushExpression = pushExpression;
+    animation.renderer.globalData.popExpression = popExpression;
+    animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+  }
+  return ob;
 }());
 
 expressionsPlugin = Expressions;
 
-var ExpressionManager = (function(){
-    'use strict';
-    var ob = {};
-    var Math = BMMath;
-    var window = null;
-    var document = null;
+/* eslint-disable camelcase, no-unused-vars */
+/* global BMMath, BezierFactory, createTypedArray, degToRads, shapePool */
 
-    function $bm_isInstanceOfArray(arr) {
-        return arr.constructor === Array || arr.constructor === Float32Array;
+var ExpressionManager = (function () {
+  'use strict';
+
+  var ob = {};
+  var Math = BMMath;
+  var window = null;
+  var document = null;
+
+  function $bm_isInstanceOfArray(arr) {
+    return arr.constructor === Array || arr.constructor === Float32Array;
+  }
+
+  function isNumerable(tOfV, v) {
+    return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+  }
+
+  function $bm_neg(a) {
+    var tOfA = typeof a;
+    if (tOfA === 'number' || tOfA === 'boolean' || a instanceof Number) {
+      return -a;
+    }
+    if ($bm_isInstanceOfArray(a)) {
+      var i;
+      var lenA = a.length;
+      var retArr = [];
+      for (i = 0; i < lenA; i += 1) {
+        retArr[i] = -a[i];
+      }
+      return retArr;
+    }
+    if (a.propType) {
+      return a.v;
+    }
+    return -a;
+  }
+
+  var easeInBez = BezierFactory.getBezierEasing(0.333, 0, 0.833, 0.833, 'easeIn').get;
+  var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, 0.667, 1, 'easeOut').get;
+  var easeInOutBez = BezierFactory.getBezierEasing(0.33, 0, 0.667, 1, 'easeInOut').get;
+
+  function sum(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (tOfA === 'string' || tOfB === 'string') {
+      return a + b;
+    }
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a + b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] += b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a + b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] + b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+  var add = sum;
+
+  function sub(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      if (tOfA === 'string') {
+        a = parseInt(a, 10);
+      }
+      if (tOfB === 'string') {
+        b = parseInt(b, 10);
+      }
+      return a - b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] -= b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a - b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] - b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+
+  function mul(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a * b;
     }
 
-    function isNumerable(tOfV, v) {
-        return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] * b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a * b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+
+  function div(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a / b;
+    }
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] / b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a / b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+  function mod(a, b) {
+    if (typeof a === 'string') {
+      a = parseInt(a, 10);
+    }
+    if (typeof b === 'string') {
+      b = parseInt(b, 10);
+    }
+    return a % b;
+  }
+  var $bm_sum = sum;
+  var $bm_sub = sub;
+  var $bm_mul = mul;
+  var $bm_div = div;
+  var $bm_mod = mod;
+
+  function clamp(num, min, max) {
+    if (min > max) {
+      var mm = max;
+      max = min;
+      min = mm;
+    }
+    return Math.min(Math.max(num, min), max);
+  }
+
+  function radiansToDegrees(val) {
+    return val / degToRads;
+  }
+  var radians_to_degrees = radiansToDegrees;
+
+  function degreesToRadians(val) {
+    return val * degToRads;
+  }
+  var degrees_to_radians = radiansToDegrees;
+
+  var helperLengthArray = [0, 0, 0, 0, 0, 0];
+
+  function length(arr1, arr2) {
+    if (typeof arr1 === 'number' || arr1 instanceof Number) {
+      arr2 = arr2 || 0;
+      return Math.abs(arr1 - arr2);
+    }
+    if (!arr2) {
+      arr2 = helperLengthArray;
+    }
+    var i;
+    var len = Math.min(arr1.length, arr2.length);
+    var addedLength = 0;
+    for (i = 0; i < len; i += 1) {
+      addedLength += Math.pow(arr2[i] - arr1[i], 2);
+    }
+    return Math.sqrt(addedLength);
+  }
+
+  function normalize(vec) {
+    return div(vec, length(vec));
+  }
+
+  function rgbToHsl(val) {
+    var r = val[0]; var g = val[1]; var b = val[2];
+    var max = Math.max(r, g, b);
+    var min = Math.min(r, g, b);
+    var h;
+    var s;
+    var l = (max + min) / 2;
+
+    if (max === min) {
+      h = 0; // achromatic
+      s = 0; // achromatic
+    } else {
+      var d = max - min;
+      s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+      switch (max) {
+        case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+        case g: h = (b - r) / d + 2; break;
+        case b: h = (r - g) / d + 4; break;
+        default: break;
+      }
+      h /= 6;
     }
 
-    function $bm_neg(a){
-        var tOfA = typeof a;
-        if(tOfA === 'number' || tOfA === 'boolean'  || a instanceof Number ){
-            return -a;
-        }
-        if($bm_isInstanceOfArray(a)){
-            var i, lenA = a.length;
-            var retArr = [];
-            for(i=0;i<lenA;i+=1){
-                retArr[i] = -a[i];
-            }
-            return retArr;
-        }
-        if (a.propType) {
-            return a.v;
-        }
+    return [h, s, l, val[3]];
+  }
+
+  function hue2rgb(p, q, t) {
+    if (t < 0) t += 1;
+    if (t > 1) t -= 1;
+    if (t < 1 / 6) return p + (q - p) * 6 * t;
+    if (t < 1 / 2) return q;
+    if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
+    return p;
+  }
+
+  function hslToRgb(val) {
+    var h = val[0];
+    var s = val[1];
+    var l = val[2];
+
+    var r;
+    var g;
+    var b;
+
+    if (s === 0) {
+      r = l; // achromatic
+      b = l; // achromatic
+      g = l; // achromatic
+    } else {
+      var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+      var p = 2 * l - q;
+      r = hue2rgb(p, q, h + 1 / 3);
+      g = hue2rgb(p, q, h);
+      b = hue2rgb(p, q, h - 1 / 3);
     }
 
-    var easeInBez = BezierFactory.getBezierEasing(0.333,0,.833,.833, 'easeIn').get;
-    var easeOutBez = BezierFactory.getBezierEasing(0.167,0.167,.667,1, 'easeOut').get;
-    var easeInOutBez = BezierFactory.getBezierEasing(.33,0,.667,1, 'easeInOut').get;
+    return [r, g, b, val[3]];
+  }
 
-    function sum(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(tOfA === 'string' || tOfB === 'string'){
-            return a + b;
-        }
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a + b;
-        }
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] + b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a + b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] + b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+  function linear(t, tMin, tMax, value1, value2) {
+    if (value1 === undefined || value2 === undefined) {
+      value1 = tMin;
+      value2 = tMax;
+      tMin = 0;
+      tMax = 1;
     }
-    var add = sum;
-
-    function sub(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            if(tOfA === 'string') {
-                a = parseInt(a);
-            }
-            if(tOfB === 'string') {
-                b = parseInt(b);
-            }
-            return a - b;
-        }
-        if( $bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] - b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) &&  $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a - b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] - b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+    if (tMax < tMin) {
+      var _tMin = tMax;
+      tMax = tMin;
+      tMin = _tMin;
     }
-
-    function mul(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a * b;
-        }
-
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] * b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a * b[i];
-            }
-            return arr;
-        }
-        return 0;
+    if (t <= tMin) {
+      return value1;
+    } if (t >= tMax) {
+      return value2;
     }
-
-    function div(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a / b;
-        }
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] / b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a / b[i];
-            }
-            return arr;
-        }
-        return 0;
+    var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin);
+    if (!value1.length) {
+      return value1 + (value2 - value1) * perc;
     }
-    function mod(a,b) {
-        if(typeof a === 'string') {
-            a = parseInt(a);
-        }
-        if(typeof b === 'string') {
-            b = parseInt(b);
-        }
-        return a % b;
+    var i;
+    var len = value1.length;
+    var arr = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      arr[i] = value1[i] + (value2[i] - value1[i]) * perc;
     }
-    var $bm_sum = sum;
-    var $bm_sub = sub;
-    var $bm_mul = mul;
-    var $bm_div = div;
-    var $bm_mod = mod;
-
-    function clamp(num, min, max) {
-        if(min > max){
-            var mm = max;
-            max = min;
-            min = mm;
-        }
-        return Math.min(Math.max(num, min), max);
+    return arr;
+  }
+  function random(min, max) {
+    if (max === undefined) {
+      if (min === undefined) {
+        min = 0;
+        max = 1;
+      } else {
+        max = min;
+        min = undefined;
+      }
     }
-
-    function radiansToDegrees(val) {
-        return val/degToRads;
+    if (max.length) {
+      var i;
+      var len = max.length;
+      if (!min) {
+        min = createTypedArray('float32', len);
+      }
+      var arr = createTypedArray('float32', len);
+      var rnd = BMMath.random();
+      for (i = 0; i < len; i += 1) {
+        arr[i] = min[i] + rnd * (max[i] - min[i]);
+      }
+      return arr;
     }
-    var radians_to_degrees = radiansToDegrees;
-
-    function degreesToRadians(val) {
-        return val*degToRads;
+    if (min === undefined) {
+      min = 0;
     }
-    var degrees_to_radians = radiansToDegrees;
+    var rndm = BMMath.random();
+    return min + rndm * (max - min);
+  }
 
-    var helperLengthArray = [0,0,0,0,0,0];
-
-    function length(arr1, arr2) {
-        if (typeof arr1 === 'number' || arr1 instanceof Number) {
-            arr2 = arr2 || 0;
-            return Math.abs(arr1 - arr2);
-        }
-        if(!arr2) {
-            arr2 = helperLengthArray;
-        }
-        var i, len = Math.min(arr1.length, arr2.length);
-        var addedLength = 0;
-        for (i = 0; i < len; i += 1) {
-            addedLength += Math.pow(arr2[i] - arr1[i], 2);
-        }
-        return Math.sqrt(addedLength);
+  function createPath(points, inTangents, outTangents, closed) {
+    var i;
+    var len = points.length;
+    var path = shapePool.newElement();
+    path.setPathData(!!closed, len);
+    var arrPlaceholder = [0, 0];
+    var inVertexPoint;
+    var outVertexPoint;
+    for (i = 0; i < len; i += 1) {
+      inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
+      outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
+      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);
     }
+    return path;
+  }
 
-    function normalize(vec) {
-        return div(vec, length(vec));
-    }
+  function initiateExpression(elem, data, property) {
+    var val = data.x;
+    var needsVelocity = /velocity(?![\w\d])/.test(val);
+    var _needsRandom = val.indexOf('random') !== -1;
+    var elemType = elem.data.ty;
+    var transform;
+    var $bm_transform;
+    var content;
+    var effect;
+    var thisProperty = property;
+    thisProperty.valueAtTime = thisProperty.getValueAtTime;
+    Object.defineProperty(thisProperty, 'value', {
+      get: function () {
+        return thisProperty.v;
+      },
+    });
+    elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate;
+    elem.comp.displayStartTime = 0;
+    var inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    var outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    var width = elem.data.sw ? elem.data.sw : 0;
+    var height = elem.data.sh ? elem.data.sh : 0;
+    var name = elem.data.nm;
+    var loopIn;
+    var loop_in;
+    var loopOut;
+    var loop_out;
+    var smooth;
+    var toWorld;
+    var fromWorld;
+    var fromComp;
+    var toComp;
+    var fromCompToSurface;
+    var position;
+    var rotation;
+    var anchorPoint;
+    var scale;
+    var thisLayer;
+    var thisComp;
+    var mask;
+    var valueAtTime;
+    var velocityAtTime;
 
-    function rgbToHsl(val) {
-        var r = val[0]; var g = val[1]; var b = val[2];
-        var max = Math.max(r, g, b), min = Math.min(r, g, b);
-        var h, s, l = (max + min) / 2;
+    var scoped_bm_rt;
+    var expression_function = eval('[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]')[0]; // eslint-disable-line no-eval
+    var numKeys = property.kf ? data.k.length : 0;
 
-        if(max == min){
-            h = s = 0; // achromatic
-        }else{
-            var d = max - min;
-            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
-            switch(max){
-                case r: h = (g - b) / d + (g < b ? 6 : 0); break;
-                case g: h = (b - r) / d + 2; break;
-                case b: h = (r - g) / d + 4; break;
-            }
-            h /= 6;
+    var active = !this.data || this.data.hd !== true;
+
+    var wiggle = function wiggle(freq, amp) {
+      var iWiggle;
+      var j;
+      var lenWiggle = this.pv.length ? this.pv.length : 1;
+      var addedAmps = createTypedArray('float32', lenWiggle);
+      freq = 5;
+      var iterations = Math.floor(time * freq);
+      iWiggle = 0;
+      j = 0;
+      while (iWiggle < iterations) {
+        // var rnd = BMMath.random();
+        for (j = 0; j < lenWiggle; j += 1) {
+          addedAmps[j] += -amp + amp * 2 * BMMath.random();
+          // addedAmps[j] += -amp + amp*2*rnd;
         }
-
-        return [h, s, l,val[3]];
-    }
-
-    function hue2rgb(p, q, t){
-        if(t < 0) t += 1;
-        if(t > 1) t -= 1;
-        if(t < 1/6) return p + (q - p) * 6 * t;
-        if(t < 1/2) return q;
-        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
-        return p;
-    }
-
-    function hslToRgb(val){
-        var h = val[0];
-        var s = val[1];
-        var l = val[2];
-
-        var r, g, b;
-
-        if(s === 0){
-            r = g = b = l; // achromatic
-        }else{
-
-            var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-            var p = 2 * l - q;
-            r = hue2rgb(p, q, h + 1/3);
-            g = hue2rgb(p, q, h);
-            b = hue2rgb(p, q, h - 1/3);
-        }
-
-        return [r, g , b, val[3]];
-    }
-
-    function linear(t, tMin, tMax, value1, value2){
-        if(value1 === undefined || value2 === undefined){
-            value1 = tMin;
-            value2 = tMax;
-            tMin = 0;
-            tMax = 1;
-        }
-        if(tMax < tMin) {
-            var _tMin = tMax;
-            tMax = tMin;
-            tMin = _tMin;
-        }
-        if(t <= tMin) {
-            return value1;
-        }else if(t >= tMax){
-            return value2;
-        }
-        var perc = tMax === tMin ? 0 : (t-tMin)/(tMax-tMin);
-        if(!value1.length){
-            return value1 + (value2-value1)*perc;
-        }
-        var i, len = value1.length;
-        var arr = createTypedArray('float32', len);
-        for(i=0;i<len;i+=1){
-            arr[i] = value1[i] + (value2[i]-value1[i])*perc;
+        iWiggle += 1;
+      }
+      // var rnd2 = BMMath.random();
+      var periods = time * freq;
+      var perc = periods - Math.floor(periods);
+      var arr = createTypedArray('float32', lenWiggle);
+      if (lenWiggle > 1) {
+        for (j = 0; j < lenWiggle; j += 1) {
+          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;
+          // arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
         }
         return arr;
-    }
-    function random(min,max){
-        if(max === undefined){
-            if(min === undefined){
-                min = 0;
-                max = 1;
-            } else {
-                max = min;
-                min = undefined;
-            }
-        }
-        if(max.length){
-            var i, len = max.length;
-            if(!min){
-                min = createTypedArray('float32', len);
-            }
-            var arr = createTypedArray('float32', len);
-            var rnd = BMMath.random();
-            for(i=0;i<len;i+=1){
-                arr[i] = min[i] + rnd*(max[i]-min[i]);
-            }
-            return arr;
-        }
-        if(min === undefined){
-            min = 0;
-        }
-        var rndm = BMMath.random();
-        return min + rndm*(max-min);
+      }
+      return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc;
+    }.bind(this);
+
+    if (thisProperty.loopIn) {
+      loopIn = thisProperty.loopIn.bind(thisProperty);
+      loop_in = loopIn;
     }
 
-    function createPath(points, inTangents, outTangents, closed) {
-        var i, len = points.length;
-        var path = shape_pool.newElement();
-        path.setPathData(!!closed, len);
-        var arrPlaceholder = [0,0], inVertexPoint, outVertexPoint;
-        for(i = 0; i < len; i += 1) {
-            inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
-            outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
-            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);
-        }
-        return path;
+    if (thisProperty.loopOut) {
+      loopOut = thisProperty.loopOut.bind(thisProperty);
+      loop_out = loopOut;
     }
 
-    function initiateExpression(elem,data,property){
-        var val = data.x;
-        var needsVelocity = /velocity(?![\w\d])/.test(val);
-        var _needsRandom = val.indexOf('random') !== -1;
-        var elemType = elem.data.ty;
-        var transform,$bm_transform,content,effect;
-        var thisProperty = property;
-        thisProperty.valueAtTime = thisProperty.getValueAtTime;
-        Object.defineProperty(thisProperty, 'value', {
-            get: function() {
-                return thisProperty.v
-            }
-        })
-        elem.comp.frameDuration = 1/elem.comp.globalData.frameRate;
-        elem.comp.displayStartTime = 0;
-        var inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        var outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        var width = elem.data.sw ? elem.data.sw : 0;
-        var height = elem.data.sh ? elem.data.sh : 0;
-        var name = elem.data.nm;
-        var loopIn, loop_in, loopOut, loop_out, smooth;
-        var toWorld,fromWorld,fromComp,toComp,fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp,mask,valueAtTime,velocityAtTime;
-        var __expression_functions = [];
-        if(data.xf) {
-            var i, len = data.xf.length;
-            for(i = 0; i < len; i += 1) {
-                __expression_functions[i] = eval('(function(){ return ' + data.xf[i] + '}())');
-            }
-        }
-
-        var scoped_bm_rt;
-        var expression_function = eval('[function _expression_function(){' + val+';scoped_bm_rt=$bm_rt}' + ']')[0];
-        var numKeys = property.kf ? data.k.length : 0;
-
-        var active = !this.data || this.data.hd !== true;
-
-        var wiggle = function wiggle(freq,amp){
-            var i,j, len = this.pv.length ? this.pv.length : 1;
-            var addedAmps = createTypedArray('float32', len);
-            freq = 5;
-            var iterations = Math.floor(time*freq);
-            i = 0;
-            j = 0;
-            while(i<iterations){
-                //var rnd = BMMath.random();
-                for(j=0;j<len;j+=1){
-                    addedAmps[j] += -amp + amp*2*BMMath.random();
-                    //addedAmps[j] += -amp + amp*2*rnd;
-                }
-                i += 1;
-            }
-            //var rnd2 = BMMath.random();
-            var periods = time*freq;
-            var perc = periods - Math.floor(periods);
-            var arr = createTypedArray('float32', len);
-            if(len>1){
-                for(j=0;j<len;j+=1){
-                    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;
-                    //arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
-                }
-                return arr;
-            } else {
-                return this.pv + addedAmps[0] + (-amp + amp*2*BMMath.random())*perc;
-            }
-        }.bind(this);
-
-        if(thisProperty.loopIn) {
-            loopIn = thisProperty.loopIn.bind(thisProperty);
-            loop_in = loopIn;
-        }
-
-        if(thisProperty.loopOut) {
-            loopOut = thisProperty.loopOut.bind(thisProperty);
-            loop_out = loopOut;
-        }
-
-        if(thisProperty.smooth) {
-            smooth = thisProperty.smooth.bind(thisProperty);
-        }
-
-        function loopInDuration(type,duration){
-            return loopIn(type,duration,true);
-        }
-
-        function loopOutDuration(type,duration){
-            return loopOut(type,duration,true);
-        }
-
-        if(this.getValueAtTime) {
-            valueAtTime = this.getValueAtTime.bind(this);
-        }
-
-        if(this.getVelocityAtTime) {
-            velocityAtTime = this.getVelocityAtTime.bind(this);
-        }
-
-        var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
-
-        function lookAt(elem1,elem2){
-            var fVec = [elem2[0]-elem1[0],elem2[1]-elem1[1],elem2[2]-elem1[2]];
-            var pitch = Math.atan2(fVec[0],Math.sqrt(fVec[1]*fVec[1]+fVec[2]*fVec[2]))/degToRads;
-            var yaw = -Math.atan2(fVec[1],fVec[2])/degToRads;
-            return [yaw,pitch,0];
-        }
-
-        function easeOut(t, tMin, tMax, val1, val2){
-            return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function easeIn(t, tMin, tMax, val1, val2){
-            return applyEase(easeInBez, t, tMin, tMax, val1, val2);
-        }
-
-        function ease(t, tMin, tMax, val1, val2){
-            return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function applyEase(fn, t, tMin, tMax, val1, val2) {
-            if(val1 === undefined){
-                val1 = tMin;
-                val2 = tMax;
-            } else {
-                t = (t - tMin) / (tMax - tMin);
-            }
-            t = t > 1 ? 1 : t < 0 ? 0 : t;
-            var mult = fn(t);
-            if($bm_isInstanceOfArray(val1)) {
-                var i, len = val1.length;
-                var arr = createTypedArray('float32', len);
-                for (i = 0; i < len; i += 1) {
-                    arr[i] = (val2[i] - val1[i]) * mult + val1[i];
-                }
-                return arr;
-            } else {
-                return (val2 - val1) * mult + val1;
-            }
-        }
-
-        function nearestKey(time){
-            var i, len = data.k.length,index,keyTime;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                index = 0;
-                keyTime = 0;
-            } else {
-                index = -1;
-                time *= elem.comp.globalData.frameRate;
-                if (time < data.k[0].t) {
-                    index = 1;
-                    keyTime = data.k[0].t;
-                } else {
-                    for(i=0;i<len-1;i+=1){
-                        if(time === data.k[i].t){
-                            index = i + 1;
-                            keyTime = data.k[i].t;
-                            break;
-                        }else if(time>data.k[i].t && time<data.k[i+1].t){
-                            if(time-data.k[i].t > data.k[i+1].t - time){
-                                index = i + 2;
-                                keyTime = data.k[i+1].t;
-                            } else {
-                                index = i + 1;
-                                keyTime = data.k[i].t;
-                            }
-                            break;
-                        }
-                    }
-                    if(index === -1){
-                        index = i + 1;
-                        keyTime = data.k[i].t;
-                    }
-                }
-                
-            }
-            var ob = {};
-            ob.index = index;
-            ob.time = keyTime/elem.comp.globalData.frameRate;
-            return ob;
-        }
-
-        function key(ind){
-            var ob, i, len;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                throw new Error('The property has no keyframe at index ' + ind);
-            }
-            ind -= 1;
-            ob = {
-                time: data.k[ind].t/elem.comp.globalData.frameRate,
-                value: []
-            };
-            var arr = data.k[ind].hasOwnProperty('s') ? data.k[ind].s : data.k[ind - 1].e;
-
-            len = arr.length;
-            for(i=0;i<len;i+=1){
-                ob[i] = arr[i];
-                ob.value[i] = arr[i]
-            }
-            return ob;
-        }
-
-        function framesToTime(frames, fps) { 
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return frames / fps;
-        }
-
-        function timeToFrames(t, fps) {
-            if (!t && t !== 0) {
-                t = time;
-            }
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return t * fps;
-        }
-
-        function seedRandom(seed){
-            BMMath.seedrandom(randSeed + seed);
-        }
-
-        function sourceRectAtTime() {
-            return elem.sourceRectAtTime();
-        }
-
-        function substring(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substring(init)
-                }
-                return value.substring(init, end)
-            }
-            return '';
-        }
-
-        function substr(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substr(init)
-                }
-                return value.substr(init, end)
-            }
-            return '';
-        }
-
-        function posterizeTime(framesPerSecond) {
-            time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond
-            value = valueAtTime(time)
-        }
-
-        var time, velocity, value, text, textIndex, textTotal, selectorValue;
-        var index = elem.data.ind;
-        var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-        var parent;
-        var randSeed = Math.floor(Math.random()*1000000);
-        var globalData = elem.globalData;
-        function executeExpression(_value) {
-            // globalData.pushExpression();
-            value = _value;
-            if (_needsRandom) {
-                seedRandom(randSeed);
-            }
-            if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
-                return value;
-            }
-            if(this.propType === 'textSelector'){
-                textIndex = this.textIndex;
-                textTotal = this.textTotal;
-                selectorValue = this.selectorValue;
-            }
-            if (!thisLayer) {
-                text = elem.layerInterface.text;
-                thisLayer = elem.layerInterface;
-                thisComp = elem.comp.compInterface;
-                toWorld = thisLayer.toWorld.bind(thisLayer);
-                fromWorld = thisLayer.fromWorld.bind(thisLayer);
-                fromComp = thisLayer.fromComp.bind(thisLayer);
-                toComp = thisLayer.toComp.bind(thisLayer);
-                mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
-                fromCompToSurface = fromComp;
-            }
-            if (!transform) {
-                transform = elem.layerInterface("ADBE Transform Group");
-                $bm_transform = transform;
-                if(transform) {
-                    anchorPoint = transform.anchorPoint;
-                    /*position = transform.position;
-                    rotation = transform.rotation;
-                    scale = transform.scale;*/
-                }
-            }
-            
-            if (elemType === 4 && !content) {
-                content = thisLayer("ADBE Root Vectors Group");
-            }
-            if (!effect) {
-                effect = thisLayer(4);
-            }
-            hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-            if (hasParent && !parent) {
-                parent = elem.hierarchy[0].layerInterface;
-            }
-            time = this.comp.renderedFrame/this.comp.globalData.frameRate;
-            if (needsVelocity) {
-                velocity = velocityAtTime(time);
-            }
-            expression_function();
-            this.frameExpressionId = elem.globalData.frameId;
-
-            //TODO: Check if it's possible to return on ShapeInterface the .v value
-            if (scoped_bm_rt.propType === "shape") {
-                scoped_bm_rt = scoped_bm_rt.v;
-            }
-            // globalData.popExpression();
-            return scoped_bm_rt;
-        }
-        return executeExpression;
+    if (thisProperty.smooth) {
+      smooth = thisProperty.smooth.bind(thisProperty);
     }
 
-    ob.initiateExpression = initiateExpression;
-    return ob;
-}());
-var expressionHelpers = (function(){
-
-    function searchExpressions(elem,data,prop){
-        if(data.x){
-            prop.k = true;
-            prop.x = true;
-            prop.initiateExpression = ExpressionManager.initiateExpression;
-            prop.effectsSequence.push(prop.initiateExpression(elem,data,prop).bind(prop));
-        }
+    function loopInDuration(type, duration) {
+      return loopIn(type, duration, true);
     }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
+    function loopOutDuration(type, duration) {
+      return loopOut(type, duration, true);
     }
 
-    function getSpeedAtTime(frameNum) {
-        var delta = -0.01;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var speed = 0;
-        if(v1.length){
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                speed += Math.pow(v2[i] - v1[i], 2);
-            }
-            speed = Math.sqrt(speed) * 100;
+    if (this.getValueAtTime) {
+      valueAtTime = this.getValueAtTime.bind(this);
+    }
+
+    if (this.getVelocityAtTime) {
+      velocityAtTime = this.getVelocityAtTime.bind(this);
+    }
+
+    var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
+
+    function lookAt(elem1, elem2) {
+      var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]];
+      var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads;
+      var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads;
+      return [yaw, pitch, 0];
+    }
+
+    function easeOut(t, tMin, tMax, val1, val2) {
+      return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function easeIn(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInBez, t, tMin, tMax, val1, val2);
+    }
+
+    function ease(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function applyEase(fn, t, tMin, tMax, val1, val2) {
+      if (val1 === undefined) {
+        val1 = tMin;
+        val2 = tMax;
+      } else {
+        t = (t - tMin) / (tMax - tMin);
+      }
+      if (t > 1) {
+        t = 1;
+      } else if (t < 0) {
+        t = 0;
+      }
+      var mult = fn(t);
+      if ($bm_isInstanceOfArray(val1)) {
+        var iKey;
+        var lenKey = val1.length;
+        var arr = createTypedArray('float32', lenKey);
+        for (iKey = 0; iKey < lenKey; iKey += 1) {
+          arr[iKey] = (val2[iKey] - val1[iKey]) * mult + val1[iKey];
+        }
+        return arr;
+      }
+      return (val2 - val1) * mult + val1;
+    }
+
+    function nearestKey(time) {
+      var iKey;
+      var lenKey = data.k.length;
+      var index;
+      var keyTime;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        index = 0;
+        keyTime = 0;
+      } else {
+        index = -1;
+        time *= elem.comp.globalData.frameRate;
+        if (time < data.k[0].t) {
+          index = 1;
+          keyTime = data.k[0].t;
         } else {
-            speed = 0;
+          for (iKey = 0; iKey < lenKey - 1; iKey += 1) {
+            if (time === data.k[iKey].t) {
+              index = iKey + 1;
+              keyTime = data.k[iKey].t;
+              break;
+            } else if (time > data.k[iKey].t && time < data.k[iKey + 1].t) {
+              if (time - data.k[iKey].t > data.k[iKey + 1].t - time) {
+                index = iKey + 2;
+                keyTime = data.k[iKey + 1].t;
+              } else {
+                index = iKey + 1;
+                keyTime = data.k[iKey].t;
+              }
+              break;
+            }
+          }
+          if (index === -1) {
+            index = iKey + 1;
+            keyTime = data.k[iKey].t;
+          }
         }
-        return speed;
+      }
+      var obKey = {};
+      obKey.index = index;
+      obKey.time = keyTime / elem.comp.globalData.frameRate;
+      return obKey;
     }
 
-    function getVelocityAtTime(frameNum) {
-        if(this.vel !== undefined){
-            return this.vel;
-        }
-        var delta = -0.001;
-        //frameNum += this.elem.data.st;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var velocity;
-        if(v1.length){
-            velocity = createTypedArray('float32', v1.length);
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                //removing frameRate
-                //if needed, don't add it here
-                //velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
-                velocity[i] = (v2[i] - v1[i])/delta;
-            }
-        } else {
-            velocity = (v2 - v1)/delta;
-        }
-        return velocity;
+    function key(ind) {
+      var obKey;
+      var iKey;
+      var lenKey;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        throw new Error('The property has no keyframe at index ' + ind);
+      }
+      ind -= 1;
+      obKey = {
+        time: data.k[ind].t / elem.comp.globalData.frameRate,
+        value: [],
+      };
+      var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;
+
+      lenKey = arr.length;
+      for (iKey = 0; iKey < lenKey; iKey += 1) {
+        obKey[iKey] = arr[iKey];
+        obKey.value[iKey] = arr[iKey];
+      }
+      return obKey;
     }
 
-    function getStaticValueAtTime() {
-        return this.pv;
+    function framesToTime(frames, fps) {
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return frames / fps;
     }
 
-    function setGroupProperty(propertyGroup){
-        this.propertyGroup = propertyGroup;
+    function timeToFrames(t, fps) {
+      if (!t && t !== 0) {
+        t = time;
+      }
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return t * fps;
     }
 
-	return {
-		searchExpressions: searchExpressions,
-		getSpeedAtTime: getSpeedAtTime,
-		getVelocityAtTime: getVelocityAtTime,
-		getValueAtTime: getValueAtTime,
-		getStaticValueAtTime: getStaticValueAtTime,
-		setGroupProperty: setGroupProperty,
-	}
-}());
-(function addPropertyDecorator() {
-
-    function loopOut(type,duration,durationFlag){
-        if(!this.k || !this.keyframes){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var lastKeyFrame = keyframes[keyframes.length - 1].t;
-        if(currentFrame<=lastKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, firstKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,lastKeyFrame - this.elem.data.ip);
-                } else {
-                    cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate*duration);
-                }
-                firstKeyFrame = lastKeyFrame - cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(iterations % 2 !== 0){
-                    return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = (endV[i]-initV[i])*repeats + current[i];
-                    }
-                    return ret;
-                }
-                return (endV-initV)*repeats + current;
-            } else if(type === 'continue'){
-                var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(lastValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = lastValue[i] + (lastValue[i]-nextLastValue[i])*((currentFrame - lastKeyFrame)/ this.comp.globalData.frameRate)/0.0005;
-                    }
-                    return ret;
-                }
-                return lastValue + (lastValue-nextLastValue)*(((currentFrame - lastKeyFrame))/0.001);
-            }
-            return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function seedRandom(seed) {
+      BMMath.seedrandom(randSeed + seed);
     }
 
-    function loopIn(type,duration, durationFlag) {
-        if(!this.k){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var firstKeyFrame = keyframes[0].t;
-        if(currentFrame>=firstKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, lastKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                lastKeyFrame = keyframes[duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,this.elem.data.op - firstKeyFrame);
-                } else {
-                    cycleDuration = Math.abs(elem.comp.globalData.frameRate*duration);
-                }
-                lastKeyFrame = firstKeyFrame + cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((firstKeyFrame - currentFrame)/cycleDuration);
-                if(iterations % 2 === 0){
-                    return this.getValueAtTime((((firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((firstKeyFrame - currentFrame)/cycleDuration)+1;
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = current[i]-(endV[i]-initV[i])*repeats;
-                    }
-                    return ret;
-                }
-                return current-(endV-initV)*repeats;
-            } else if(type === 'continue'){
-                var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(firstValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = firstValue[i] + (firstValue[i]-nextFirstValue[i])*(firstKeyFrame - currentFrame)/0.001;
-                    }
-                    return ret;
-                }
-                return firstValue + (firstValue-nextFirstValue)*(firstKeyFrame - currentFrame)/0.001;
-            }
-            return this.getValueAtTime(((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function sourceRectAtTime() {
+      return elem.sourceRectAtTime();
     }
 
-    function smooth(width, samples) {
-        if (!this.k){
-            return this.pv;
+    function substring(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substring(init);
         }
-        width = (width || 0.4) * 0.5;
-        samples = Math.floor(samples || 5);
-        if (samples <= 1) {
-            return this.pv;
+        return value.substring(init, end);
+      }
+      return '';
+    }
+
+    function substr(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substr(init);
         }
-        var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
-        var initFrame = currentTime - width;
-        var endFrame = currentTime + width;
-        var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
-        var i = 0, j = 0;
-        var value;
-        if (this.pv.length) {
-            value = createTypedArray('float32', this.pv.length);
-        } else {
-            value = 0;
-        }
-        var sampleValue;
-        while (i < samples) {
-            sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
-            if(this.pv.length) {
-                for (j = 0; j < this.pv.length; j += 1) {
-                    value[j] += sampleValue[j];
-                }
-            } else {
-                value += sampleValue;
-            }
-            i += 1;
-        }
-        if(this.pv.length) {
-            for (j = 0; j < this.pv.length; j += 1) {
-                value[j] /= samples;
-            }
-        } else {
-            value /= samples;
-        }
+        return value.substr(init, end);
+      }
+      return '';
+    }
+
+    function posterizeTime(framesPerSecond) {
+      time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond;
+      value = valueAtTime(time);
+    }
+
+    var time;
+    var velocity;
+    var value;
+    var text;
+    var textIndex;
+    var textTotal;
+    var selectorValue;
+    var index = elem.data.ind;
+    var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+    var parent;
+    var randSeed = Math.floor(Math.random() * 1000000);
+    var globalData = elem.globalData;
+    function executeExpression(_value) {
+      // globalData.pushExpression();
+      value = _value;
+      if (_needsRandom) {
+        seedRandom(randSeed);
+      }
+      if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
         return value;
+      }
+      if (this.propType === 'textSelector') {
+        textIndex = this.textIndex;
+        textTotal = this.textTotal;
+        selectorValue = this.selectorValue;
+      }
+      if (!thisLayer) {
+        text = elem.layerInterface.text;
+        thisLayer = elem.layerInterface;
+        thisComp = elem.comp.compInterface;
+        toWorld = thisLayer.toWorld.bind(thisLayer);
+        fromWorld = thisLayer.fromWorld.bind(thisLayer);
+        fromComp = thisLayer.fromComp.bind(thisLayer);
+        toComp = thisLayer.toComp.bind(thisLayer);
+        mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
+        fromCompToSurface = fromComp;
+      }
+      if (!transform) {
+        transform = elem.layerInterface('ADBE Transform Group');
+        $bm_transform = transform;
+        if (transform) {
+          anchorPoint = transform.anchorPoint;
+          /* position = transform.position;
+                    rotation = transform.rotation;
+                    scale = transform.scale; */
+        }
+      }
+
+      if (elemType === 4 && !content) {
+        content = thisLayer('ADBE Root Vectors Group');
+      }
+      if (!effect) {
+        effect = thisLayer(4);
+      }
+      hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+      if (hasParent && !parent) {
+        parent = elem.hierarchy[0].layerInterface;
+      }
+      time = this.comp.renderedFrame / this.comp.globalData.frameRate;
+      if (needsVelocity) {
+        velocity = velocityAtTime(time);
+      }
+      expression_function();
+      this.frameExpressionId = elem.globalData.frameId;
+
+      // TODO: Check if it's possible to return on ShapeInterface the .v value
+      if (scoped_bm_rt.propType === 'shape') {
+        scoped_bm_rt = scoped_bm_rt.v;
+      }
+      // globalData.popExpression();
+      return scoped_bm_rt;
     }
+    return executeExpression;
+  }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
-    }
-
-    function getTransformValueAtTime(time) {
-        if (!this._transformCachingAtTime) {
-            this._transformCachingAtTime = {
-                v: new Matrix(),
-            };
-        }
-        ////
-        var matrix = this._transformCachingAtTime.v;
-        matrix.cloneFromProps(this.pre.props);
-        if (this.appliedTransformations < 1) {
-            var anchor = this.a.getValueAtTime(time);
-            matrix.translate(
-                -anchor[0] * this.a.mult,
-                -anchor[1] * this.a.mult,
-                anchor[2] * this.a.mult
-            );
-        }
-        if (this.appliedTransformations < 2) {
-            var scale = this.s.getValueAtTime(time);
-            matrix.scale(
-                scale[0] * this.s.mult,
-                scale[1] * this.s.mult,
-                scale[2] * this.s.mult
-            );
-        }
-        if (this.sk && this.appliedTransformations < 3) {
-            var skew = this.sk.getValueAtTime(time);
-            var skewAxis = this.sa.getValueAtTime(time);
-            matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
-        }
-        if (this.r && this.appliedTransformations < 4) {
-            var rotation = this.r.getValueAtTime(time);
-            matrix.rotate(-rotation * this.r.mult);
-        } else if (!this.r && this.appliedTransformations < 4){
-            var rotationZ = this.rz.getValueAtTime(time);
-            var rotationY = this.ry.getValueAtTime(time);
-            var rotationX = this.rx.getValueAtTime(time);
-            var orientation = this.or.getValueAtTime(time);
-            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);
-        }
-        if (this.data.p && this.data.p.s) {
-            var positionX = this.px.getValueAtTime(time);
-            var positionY = this.py.getValueAtTime(time);
-            if (this.data.p.z) {
-                var positionZ = this.pz.getValueAtTime(time);
-                matrix.translate(
-                    positionX * this.px.mult,
-                    positionY * this.py.mult,
-                    -positionZ * this.pz.mult
-                );
-            } else {
-                matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
-            }
-        } else {
-            var position = this.p.getValueAtTime(time);
-            matrix.translate(
-                position[0] * this.p.mult,
-                position[1] * this.p.mult,
-                -position[2] * this.p.mult
-            );
-        }
-        return matrix;
-        ////
-    }
-
-    function getTransformStaticValueAtTime(time) {
-        return this.v.clone(new Matrix());
-    }
-
-    var getTransformProperty = TransformPropertyFactory.getTransformProperty;
-    TransformPropertyFactory.getTransformProperty = function(elem, data, container) {
-        var prop = getTransformProperty(elem, data, container);
-        if(prop.dynamicProperties.length) {
-            prop.getValueAtTime = getTransformValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        return prop;
-    };
-
-    var propertyGetProp = PropertyFactory.getProp;
-    PropertyFactory.getProp = function(elem,data,type, mult, container){
-        var prop = propertyGetProp(elem,data,type, mult, container);
-        //prop.getVelocityAtTime = getVelocityAtTime;
-        //prop.loopOut = loopOut;
-        //prop.loopIn = loopIn;
-        if(prop.kf){
-            prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        prop.loopOut = loopOut;
-        prop.loopIn = loopIn;
-        prop.smooth = smooth;
-        prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
-        prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
-        prop.numKeys = data.a === 1 ? data.k.length : 0;
-        prop.propertyIndex = data.ix;
-        var value = 0;
-        if(type !== 0) {
-            value = createTypedArray('float32', data.a === 1 ?  data.k[0].s.length : data.k.length);
-        }
-        prop._cachingAtTime = {
-            lastFrame: initialDefaultFrame,
-            lastIndex: 0,
-            value: value
-        };
-        expressionHelpers.searchExpressions(elem,data,prop);
-        if(prop.k){
-            container.addDynamicProperty(prop);
-        }
-
-        return prop;
-    };
-
-    function getShapeValueAtTime(frameNum) {
-        //For now this caching object is created only when needed instead of creating it when the shape is initialized.
-        if (!this._cachingAtTime) {
-            this._cachingAtTime = {
-                shapeValue: shape_pool.clone(this.pv),
-                lastIndex: 0,
-                lastTime: initialDefaultFrame
-            };
-        }
-        
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastTime) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
-            this._cachingAtTime.lastTime = frameNum;
-            this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
-        }
-        return this._cachingAtTime.shapeValue;
-    }
-
-    var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
-    var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
-
-    function ShapeExpressions(){}
-    ShapeExpressions.prototype = {
-        vertices: function(prop, time){
-            if (this.k) {
-                this.getValue();
-            }
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            var i, len = shapePath._length;
-            var vertices = shapePath[prop];
-            var points = shapePath.v;
-            var arr = createSizedArray(len);
-            for(i = 0; i < len; i += 1) {
-                if(prop === 'i' || prop === 'o') {
-                    arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
-                } else {
-                    arr[i] = [vertices[i][0], vertices[i][1]];
-                }
-                
-            }
-            return arr;
-        },
-        points: function(time){
-            return this.vertices('v', time);
-        },
-        inTangents: function(time){
-            return this.vertices('i', time);
-        },
-        outTangents: function(time){
-            return this.vertices('o', time);
-        },
-        isClosed: function(){
-            return this.v.c;
-        },
-        pointOnPath: function(perc, time){
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            if(!this._segmentsLength) {
-                this._segmentsLength = bez.getSegmentsLength(shapePath);
-            }
-
-            var segmentsLength = this._segmentsLength;
-            var lengths = segmentsLength.lengths;
-            var lengthPos = segmentsLength.totalLength * perc;
-            var i = 0, len = lengths.length;
-            var j = 0, jLen;
-            var accumulatedLength = 0, pt;
-            while(i < len) {
-                if(accumulatedLength + lengths[i].addedLength > lengthPos) {
-                    var initIndex = i;
-                    var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
-                    var segmentPerc = (lengthPos - accumulatedLength)/lengths[i].addedLength;
-                    pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
-                    break;
-                } else {
-                    accumulatedLength += lengths[i].addedLength;
-                }
-                i += 1;
-            }
-            if(!pt){
-                pt = shapePath.c ? [shapePath.v[0][0],shapePath.v[0][1]]:[shapePath.v[shapePath._length-1][0],shapePath.v[shapePath._length-1][1]];
-            }
-            return pt;
-        },
-        vectorOnPath: function(perc, time, vectorType){
-            //perc doesn't use triple equality because it can be a Number object as well as a primitive.
-            perc = perc == 1 ? this.v.c ? 0 : 0.999 : perc;
-            var pt1 = this.pointOnPath(perc, time);
-            var pt2 = this.pointOnPath(perc + 0.001, time);
-            var xLength = pt2[0] - pt1[0];
-            var yLength = pt2[1] - pt1[1];
-            var magnitude = Math.sqrt(Math.pow(xLength,2) + Math.pow(yLength,2));
-            if (magnitude === 0) {
-                return [0,0];
-            }
-            var unitVector = vectorType === 'tangent' ? [xLength/magnitude, yLength/magnitude] : [-yLength/magnitude, xLength/magnitude];
-            return unitVector;
-        },
-        tangentOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'tangent');
-        },
-        normalOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'normal');
-        },
-        setGroupProperty: expressionHelpers.setGroupProperty,
-        getValueAtTime: expressionHelpers.getStaticValueAtTime
-    };
-    extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
-    extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
-    KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
-    KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
-
-    var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
-    ShapePropertyFactory.getShapeProp = function(elem,data,type, arr, trims){
-        var prop = propertyGetShapeProp(elem,data,type, arr, trims);
-        prop.propertyIndex = data.ix;
-        prop.lock = false;
-        if(type === 3){
-            expressionHelpers.searchExpressions(elem,data.pt,prop);
-        } else if(type === 4){
-            expressionHelpers.searchExpressions(elem,data.ks,prop);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    };
+  ob.initiateExpression = initiateExpression;
+  return ob;
 }());
+
+/* global ExpressionManager, createTypedArray */
+/* exported expressionHelpers */
+
+var expressionHelpers = (function () {
+  function searchExpressions(elem, data, prop) {
+    if (data.x) {
+      prop.k = true;
+      prop.x = true;
+      prop.initiateExpression = ExpressionManager.initiateExpression;
+      prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop));
+    }
+  }
+
+  function getValueAtTime(frameNum) {
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastFrame) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
+      this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
+      this._cachingAtTime.lastFrame = frameNum;
+    }
+    return this._cachingAtTime.value;
+  }
+
+  function getSpeedAtTime(frameNum) {
+    var delta = -0.01;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var speed = 0;
+    if (v1.length) {
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        speed += Math.pow(v2[i] - v1[i], 2);
+      }
+      speed = Math.sqrt(speed) * 100;
+    } else {
+      speed = 0;
+    }
+    return speed;
+  }
+
+  function getVelocityAtTime(frameNum) {
+    if (this.vel !== undefined) {
+      return this.vel;
+    }
+    var delta = -0.001;
+    // frameNum += this.elem.data.st;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var velocity;
+    if (v1.length) {
+      velocity = createTypedArray('float32', v1.length);
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        // removing frameRate
+        // if needed, don't add it here
+        // velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
+        velocity[i] = (v2[i] - v1[i]) / delta;
+      }
+    } else {
+      velocity = (v2 - v1) / delta;
+    }
+    return velocity;
+  }
+
+  function getStaticValueAtTime() {
+    return this.pv;
+  }
+
+  function setGroupProperty(propertyGroup) {
+    this.propertyGroup = propertyGroup;
+  }
+
+  return {
+    searchExpressions: searchExpressions,
+    getSpeedAtTime: getSpeedAtTime,
+    getVelocityAtTime: getVelocityAtTime,
+    getValueAtTime: getValueAtTime,
+    getStaticValueAtTime: getStaticValueAtTime,
+    setGroupProperty: setGroupProperty,
+  };
+}());
+
+/* global createTypedArray, Matrix, TransformPropertyFactory, expressionHelpers, PropertyFactory, expressionHelpers,
+initialDefaultFrame, shapePool, ShapePropertyFactory, bez, extendPrototype, ExpressionManager, createSizedArray */
+
+(function addPropertyDecorator() {
+  function loopOut(type, duration, durationFlag) {
+    if (!this.k || !this.keyframes) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var lastKeyFrame = keyframes[keyframes.length - 1].t;
+    if (currentFrame <= lastKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var firstKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip);
+      } else {
+        cycleDuration = Math.abs(lastKeyFrame - this.elem.comp.globalData.frameRate * duration);
+      }
+      firstKeyFrame = lastKeyFrame - cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (iterations % 2 !== 0) {
+          return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+        var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = (endV[i] - initV[i]) * repeats + current[i];
+        }
+        return ret;
+      }
+      return (endV - initV) * repeats + current;
+    } else if (type === 'continue') {
+      var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(lastValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+            ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005; // eslint-disable-line
+        }
+        return ret;
+      }
+      return lastValue + (lastValue - nextLastValue) * (((currentFrame - lastKeyFrame)) / 0.001);
+    }
+      return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function loopIn(type, duration, durationFlag) {
+    if (!this.k) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var firstKeyFrame = keyframes[0].t;
+    if (currentFrame >= firstKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var lastKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      lastKeyFrame = keyframes[duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame);
+      } else {
+        cycleDuration = Math.abs(this.elem.comp.globalData.frameRate * duration);
+      }
+      lastKeyFrame = firstKeyFrame + cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration);
+      if (iterations % 2 === 0) {
+          return this.getValueAtTime((((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var current = this.getValueAtTime((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration) + firstKeyFrame) / this.comp.globalData.frameRate, 0);
+      var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1;
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = current[i] - (endV[i] - initV[i]) * repeats;
+        }
+        return ret;
+      }
+      return current - (endV - initV) * repeats;
+    } else if (type === 'continue') {
+      var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(firstValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = firstValue[i] + ((firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame)) / 0.001;
+        }
+        return ret;
+      }
+      return firstValue + ((firstValue - nextFirstValue) * (firstKeyFrame - currentFrame)) / 0.001;
+    }
+      return this.getValueAtTime(((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame))) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function smooth(width, samples) {
+    if (!this.k) {
+      return this.pv;
+    }
+    width = (width || 0.4) * 0.5;
+    samples = Math.floor(samples || 5);
+    if (samples <= 1) {
+      return this.pv;
+    }
+    var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
+    var initFrame = currentTime - width;
+    var endFrame = currentTime + width;
+    var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
+    var i = 0;
+    var j = 0;
+    var value;
+    if (this.pv.length) {
+      value = createTypedArray('float32', this.pv.length);
+    } else {
+      value = 0;
+    }
+    var sampleValue;
+    while (i < samples) {
+      sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
+      if (this.pv.length) {
+        for (j = 0; j < this.pv.length; j += 1) {
+          value[j] += sampleValue[j];
+        }
+      } else {
+        value += sampleValue;
+      }
+      i += 1;
+    }
+    if (this.pv.length) {
+      for (j = 0; j < this.pv.length; j += 1) {
+        value[j] /= samples;
+      }
+    } else {
+      value /= samples;
+    }
+    return value;
+  }
+
+  function getTransformValueAtTime(time) {
+    if (!this._transformCachingAtTime) {
+      this._transformCachingAtTime = {
+        v: new Matrix(),
+      };
+    }
+    /// /
+    var matrix = this._transformCachingAtTime.v;
+    matrix.cloneFromProps(this.pre.props);
+    if (this.appliedTransformations < 1) {
+      var anchor = this.a.getValueAtTime(time);
+      matrix.translate(
+        -anchor[0] * this.a.mult,
+        -anchor[1] * this.a.mult,
+        anchor[2] * this.a.mult
+      );
+    }
+    if (this.appliedTransformations < 2) {
+      var scale = this.s.getValueAtTime(time);
+      matrix.scale(
+        scale[0] * this.s.mult,
+        scale[1] * this.s.mult,
+        scale[2] * this.s.mult
+      );
+    }
+    if (this.sk && this.appliedTransformations < 3) {
+      var skew = this.sk.getValueAtTime(time);
+      var skewAxis = this.sa.getValueAtTime(time);
+      matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
+    }
+    if (this.r && this.appliedTransformations < 4) {
+      var rotation = this.r.getValueAtTime(time);
+      matrix.rotate(-rotation * this.r.mult);
+    } else if (!this.r && this.appliedTransformations < 4) {
+      var rotationZ = this.rz.getValueAtTime(time);
+      var rotationY = this.ry.getValueAtTime(time);
+      var rotationX = this.rx.getValueAtTime(time);
+      var orientation = this.or.getValueAtTime(time);
+      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);
+    }
+    if (this.data.p && this.data.p.s) {
+      var positionX = this.px.getValueAtTime(time);
+      var positionY = this.py.getValueAtTime(time);
+      if (this.data.p.z) {
+        var positionZ = this.pz.getValueAtTime(time);
+        matrix.translate(
+          positionX * this.px.mult,
+          positionY * this.py.mult,
+          -positionZ * this.pz.mult
+        );
+      } else {
+        matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
+      }
+    } else {
+      var position = this.p.getValueAtTime(time);
+      matrix.translate(
+        position[0] * this.p.mult,
+        position[1] * this.p.mult,
+        -position[2] * this.p.mult
+      );
+    }
+    return matrix;
+    /// /
+  }
+
+  function getTransformStaticValueAtTime() {
+    return this.v.clone(new Matrix());
+  }
+
+  var getTransformProperty = TransformPropertyFactory.getTransformProperty;
+  TransformPropertyFactory.getTransformProperty = function (elem, data, container) {
+    var prop = getTransformProperty(elem, data, container);
+    if (prop.dynamicProperties.length) {
+      prop.getValueAtTime = getTransformValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    return prop;
+  };
+
+  var propertyGetProp = PropertyFactory.getProp;
+  PropertyFactory.getProp = function (elem, data, type, mult, container) {
+    var prop = propertyGetProp(elem, data, type, mult, container);
+    // prop.getVelocityAtTime = getVelocityAtTime;
+    // prop.loopOut = loopOut;
+    // prop.loopIn = loopIn;
+    if (prop.kf) {
+      prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    prop.loopOut = loopOut;
+    prop.loopIn = loopIn;
+    prop.smooth = smooth;
+    prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
+    prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
+    prop.numKeys = data.a === 1 ? data.k.length : 0;
+    prop.propertyIndex = data.ix;
+    var value = 0;
+    if (type !== 0) {
+      value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);
+    }
+    prop._cachingAtTime = {
+      lastFrame: initialDefaultFrame,
+      lastIndex: 0,
+      value: value,
+    };
+    expressionHelpers.searchExpressions(elem, data, prop);
+    if (prop.k) {
+      container.addDynamicProperty(prop);
+    }
+
+    return prop;
+  };
+
+  function getShapeValueAtTime(frameNum) {
+    // For now this caching object is created only when needed instead of creating it when the shape is initialized.
+    if (!this._cachingAtTime) {
+      this._cachingAtTime = {
+        shapeValue: shapePool.clone(this.pv),
+        lastIndex: 0,
+        lastTime: initialDefaultFrame,
+      };
+    }
+
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastTime) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
+      this._cachingAtTime.lastTime = frameNum;
+      this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
+    }
+    return this._cachingAtTime.shapeValue;
+  }
+
+  var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
+  var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
+
+  function ShapeExpressions() {}
+  ShapeExpressions.prototype = {
+    vertices: function (prop, time) {
+      if (this.k) {
+        this.getValue();
+      }
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      var i;
+      var len = shapePath._length;
+      var vertices = shapePath[prop];
+      var points = shapePath.v;
+      var arr = createSizedArray(len);
+      for (i = 0; i < len; i += 1) {
+        if (prop === 'i' || prop === 'o') {
+          arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
+        } else {
+          arr[i] = [vertices[i][0], vertices[i][1]];
+        }
+      }
+      return arr;
+    },
+    points: function (time) {
+      return this.vertices('v', time);
+    },
+    inTangents: function (time) {
+      return this.vertices('i', time);
+    },
+    outTangents: function (time) {
+      return this.vertices('o', time);
+    },
+    isClosed: function () {
+      return this.v.c;
+    },
+    pointOnPath: function (perc, time) {
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      if (!this._segmentsLength) {
+        this._segmentsLength = bez.getSegmentsLength(shapePath);
+      }
+
+      var segmentsLength = this._segmentsLength;
+      var lengths = segmentsLength.lengths;
+      var lengthPos = segmentsLength.totalLength * perc;
+      var i = 0;
+      var len = lengths.length;
+      var accumulatedLength = 0;
+      var pt;
+      while (i < len) {
+        if (accumulatedLength + lengths[i].addedLength > lengthPos) {
+          var initIndex = i;
+          var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
+          var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength;
+          pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
+          break;
+        } else {
+          accumulatedLength += lengths[i].addedLength;
+        }
+        i += 1;
+      }
+      if (!pt) {
+        pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]];
+      }
+      return pt;
+    },
+    vectorOnPath: function (perc, time, vectorType) {
+      // perc doesn't use triple equality because it can be a Number object as well as a primitive.
+      if (perc == 1) { // eslint-disable-line eqeqeq
+        perc = this.v.c;
+      } else if (perc == 0) { // eslint-disable-line eqeqeq
+        perc = 0.999;
+      }
+      var pt1 = this.pointOnPath(perc, time);
+      var pt2 = this.pointOnPath(perc + 0.001, time);
+      var xLength = pt2[0] - pt1[0];
+      var yLength = pt2[1] - pt1[1];
+      var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2));
+      if (magnitude === 0) {
+        return [0, 0];
+      }
+      var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude];
+      return unitVector;
+    },
+    tangentOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'tangent');
+    },
+    normalOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'normal');
+    },
+    setGroupProperty: expressionHelpers.setGroupProperty,
+    getValueAtTime: expressionHelpers.getStaticValueAtTime,
+  };
+  extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
+  extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
+  KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
+  KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
+
+  var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
+  ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) {
+    var prop = propertyGetShapeProp(elem, data, type, arr, trims);
+    prop.propertyIndex = data.ix;
+    prop.lock = false;
+    if (type === 3) {
+      expressionHelpers.searchExpressions(elem, data.pt, prop);
+    } else if (type === 4) {
+      expressionHelpers.searchExpressions(elem, data.ks, prop);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  };
+}());
+
+/* global ExpressionManager, TextProperty */
+
 (function addDecorator() {
-
-    function searchExpressions(){
-        if(this.data.d.x){
-            this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this);
-            this.addEffect(this.getExpressionValue.bind(this));
-            return true;
-        }
+  function searchExpressions() {
+    if (this.data.d.x) {
+      this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this);
+      this.addEffect(this.getExpressionValue.bind(this));
+      return true;
     }
+    return null;
+  }
 
-    TextProperty.prototype.getExpressionValue = function(currentValue, text) {
-        var newValue = this.calculateExpression(text);
-        if(currentValue.t !== newValue) {
-            var newData = {};
-            this.copyData(newData, currentValue);
-            newData.t = newValue.toString();
-            newData.__complete = false;
-            return newData;
-        }
-        return currentValue;
+  TextProperty.prototype.getExpressionValue = function (currentValue, text) {
+    var newValue = this.calculateExpression(text);
+    if (currentValue.t !== newValue) {
+      var newData = {};
+      this.copyData(newData, currentValue);
+      newData.t = newValue.toString();
+      newData.__complete = false;
+      return newData;
     }
+    return currentValue;
+  };
 
-    TextProperty.prototype.searchProperty = function(){
+  TextProperty.prototype.searchProperty = function () {
+    var isKeyframed = this.searchKeyframes();
+    var hasExpressions = this.searchExpressions();
+    this.kf = isKeyframed || hasExpressions;
+    return this.kf;
+  };
 
-        var isKeyframed = this.searchKeyframes();
-        var hasExpressions = this.searchExpressions();
-        this.kf = isKeyframed || hasExpressions;
-        return this.kf;
-    };
-
-    TextProperty.prototype.searchExpressions = searchExpressions;
-    
+  TextProperty.prototype.searchExpressions = searchExpressions;
 }());
+
+/* global propertyGroupFactory, PropertyInterface */
+/* exported ShapePathInterface */
+
 var ShapePathInterface = (
 
-	function() {
+  function () {
+    return function pathInterfaceFactory(shape, view, propertyGroup) {
+      var prop = view.sh;
 
-		return function pathInterfaceFactory(shape,view,propertyGroup){
-		    var prop = view.sh;
-
-		    function interfaceFunction(val){
-		        if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2){
-		            return interfaceFunction.path;
-		        }
-		    }
-
-		    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-		    prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
-		    Object.defineProperties(interfaceFunction, {
-		        'path': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        'shape': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        '_name': { value: shape.nm },
-		        'ix': { value: shape.ix },
-		        'propertyIndex': { value: shape.ix },
-		        'mn': { value: shape.mn },
-		        'propertyGroup': {value: propertyGroup},
-		    });
-		    return interfaceFunction;
-		}
-	}()
-)
-var propertyGroupFactory = (function() {
-	return function(interfaceFunction, parentPropertyGroup) {
-		return function(val) {
-			val = val === undefined ? 1 : val
-			if(val <= 0){
-			    return interfaceFunction;
-			} else{
-			    return parentPropertyGroup(val-1);
-			}
-		}
-	}
-}())
-var PropertyInterface = (function() {
-	return function(propertyName, propertyGroup) {
-
-		var interfaceFunction = {
-			_name: propertyName
-		}
-
-		function _propertyGroup(val){
-		    val = val === undefined ? 1 : val
-		    if(val <= 0){
-		        return interfaceFunction;
-		    } else {
-		        return propertyGroup(--val);
-		    }
-		}
-
-		return _propertyGroup;
-	}
-}())
-var ShapeExpressionInterface = (function(){
-
-    function iterateElements(shapes,view, propertyGroup){
-        var arr = [];
-        var i, len = shapes ? shapes.length : 0;
-        for(i=0;i<len;i+=1){
-            if(shapes[i].ty == 'gr'){
-                arr.push(groupInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'fl'){
-                arr.push(fillInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'st'){
-                arr.push(strokeInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tm'){
-                arr.push(trimInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tr'){
-                //arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'el'){
-                arr.push(ellipseInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'sr'){
-                arr.push(starInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'sh'){
-                arr.push(ShapePathInterface(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rc'){
-                arr.push(rectInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rd'){
-                arr.push(roundedInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rp'){
-                arr.push(repeaterInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }
+      function interfaceFunction(val) {
+        if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {
+          return interfaceFunction.path;
         }
-        return arr;
-    }
+        return null;
+      }
 
-    function contentsInterfaceFactory(shape,view, propertyGroup){
-       var interfaces;
-       var interfaceFunction = function _interfaceFunction(value){
-           var i = 0, len = interfaces.length;
-            while(i<len){
-                if(interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value){
-                   return interfaces[i];
-                }
-                i+=1;
+      var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+      prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
+      Object.defineProperties(interfaceFunction, {
+        path: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-            if(typeof value === 'number'){
-               return interfaces[value-1];
+            return prop;
+          },
+        },
+        shape: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-       };
-
-       interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-       interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
-       interfaceFunction.numProperties = interfaces.length;
-       var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-       interfaceFunction.transform = transformInterface;
-       interfaceFunction.propertyIndex = shape.cix;
-       interfaceFunction._name = shape.nm;
-
-       return interfaceFunction;
-   }
-
-    function groupInterfaceFactory(shape,view, propertyGroup){
-        var interfaceFunction = function _interfaceFunction(value){
-            switch(value){
-                case 'ADBE Vectors Group':
-                case 'Contents':
-                case 2:
-                    return interfaceFunction.content;
-                //Not necessary for now. Keeping them here in case a new case appears
-                //case 'ADBE Vector Transform Group':
-                //case 3:
-                default:
-                    return interfaceFunction.transform;
-            }
-        };
-        interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var content = contentsInterfaceFactory(shape,view,interfaceFunction.propertyGroup);
-        var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-        interfaceFunction.content = content;
-        interfaceFunction.transform = transformInterface;
-        Object.defineProperty(interfaceFunction, '_name', {
-            get: function(){
-                return shape.nm;
-            }
-        });
-        //interfaceFunction.content = interfaceFunction;
-        interfaceFunction.numProperties = shape.np;
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.nm = shape.nm;
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function fillInterfaceFactory(shape,view,propertyGroup){
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
-        return interfaceFunction;
-    }
-
-    function strokeInterfaceFactory(shape,view,propertyGroup){
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
-        function addPropertyToDashOb(i) {
-            Object.defineProperty(dashOb, shape.d[i].nm, {
-                get: ExpressionPropertyInterface(view.d.dataProps[i].p)
-            });
-        }
-        var i, len = shape.d ? shape.d.length : 0;
-        var dashOb = {};
-        for (i = 0; i < len; i += 1) {
-            addPropertyToDashOb(i);
-            view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
-        }
-
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            } else if(val === 'Stroke Width' || val === 'stroke width'){
-                return interfaceFunction.strokeWidth;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            'strokeWidth': {
-                get: ExpressionPropertyInterface(view.w)
-            },
-            'dash': {
-                get: function() {
-                    return dashOb;
-                }
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
-        return interfaceFunction;
-    }
-
-    function trimInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(val){
-            if(val === shape.e.ix || val === 'End' || val === 'end'){
-                return interfaceFunction.end;
-            }
-            if(val === shape.s.ix){
-                return interfaceFunction.start;
-            }
-            if(val === shape.o.ix){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-
-        view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
-        view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.propertyGroup = propertyGroup;
-
-        Object.defineProperties(interfaceFunction, {
-            'start': {
-                get: ExpressionPropertyInterface(view.s)
-            },
-            'end': {
-                get: ExpressionPropertyInterface(view.e)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function transformInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.a.ix === value || value === 'Anchor Point'){
-                return interfaceFunction.anchorPoint;
-            }
-            if(shape.o.ix === value || value === 'Opacity'){
-                return interfaceFunction.opacity;
-            }
-            if(shape.p.ix === value || value === 'Position'){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation'){
-                return interfaceFunction.rotation;
-            }
-            if(shape.s.ix === value || value === 'Scale'){
-                return interfaceFunction.scale;
-            }
-            if(shape.sk && shape.sk.ix === value || value === 'Skew'){
-                return interfaceFunction.skew;
-            }
-            if(shape.sa && shape.sa.ix === value || value === 'Skew Axis'){
-                return interfaceFunction.skewAxis;
-            }
-        }
-        
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
-        view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
-        view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(view.transform.mProps.sk){
-            view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
-            view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
-        }
-        view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'opacity': {
-                get: ExpressionPropertyInterface(view.transform.mProps.o)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(view.transform.mProps.p)
-            },
-            'anchorPoint': {
-                get: ExpressionPropertyInterface(view.transform.mProps.a)
-            },
-            'scale': {
-                get: ExpressionPropertyInterface(view.transform.mProps.s)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(view.transform.mProps.r)
-            },
-            'skew': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sk)
-            },
-            'skewAxis': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sa)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.ty = 'tr';
-        interfaceFunction.mn = shape.mn;
-        interfaceFunction.propertyGroup = propertyGroup;
-        return interfaceFunction;
-    }
-
-    function ellipseInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.s.ix === value){
-                return interfaceFunction.size;
-            }
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function starInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.rotation;
-            }
-            if(shape.pt.ix === value){
-                return interfaceFunction.points;
-            }
-            if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
-                return interfaceFunction.outerRadius;
-            }
-            if(shape.os.ix === value){
-                return interfaceFunction.outerRoundness;
-            }
-            if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
-                return interfaceFunction.innerRadius;
-            }
-            if(shape.is && shape.is.ix === value){
-                return interfaceFunction.innerRoundness;
-            }
-
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
-        prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
-        prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(shape.ir){
-            prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
-            prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
-        }
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'points': {
-                get: ExpressionPropertyInterface(prop.pt)
-            },
-            'outerRadius': {
-                get: ExpressionPropertyInterface(prop.or)
-            },
-            'outerRoundness': {
-                get: ExpressionPropertyInterface(prop.os)
-            },
-            'innerRadius': {
-                get: ExpressionPropertyInterface(prop.ir)
-            },
-            'innerRoundness': {
-                get: ExpressionPropertyInterface(prop.is)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function rectInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.roundness;
-            }
-            if(shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size'){
-                return interfaceFunction.size;
-            }
-
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'roundness': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function roundedInterfaceFactory(shape,view,propertyGroup){
-       
-        function interfaceFunction(value){
-            if(shape.r.ix === value || 'Round Corners 1' === value){
-                return interfaceFunction.radius;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'radius': {
-                get: ExpressionPropertyInterface(prop.rd)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function repeaterInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.c.ix === value || 'Copies' === value){
-                return interfaceFunction.copies;
-            } else if(shape.o.ix === value || 'Offset' === value){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
-        prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'copies': {
-                get: ExpressionPropertyInterface(prop.c)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(prop.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    return function(shapes,view,propertyGroup) {
-        var interfaces;
-        function _interfaceFunction(value){
-            if(typeof value === 'number'){
-                value = value === undefined ? 1 : value
-                if (value === 0) {
-                    return propertyGroup
-                } else {
-                    return interfaces[value-1];
-                }
-            } else {
-                var i = 0, len = interfaces.length;
-                while(i<len){
-                    if(interfaces[i]._name === value){
-                        return interfaces[i];
-                    }
-                    i+=1;
-                }
-            }
-        }
-        function parentGroupWrapper() {
-            return propertyGroup
-        }
-        _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
-        interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
-        _interfaceFunction.numProperties = interfaces.length;
-        _interfaceFunction._name = 'Contents';
-        return _interfaceFunction;
+            return prop;
+          },
+        },
+        _name: { value: shape.nm },
+        ix: { value: shape.ix },
+        propertyIndex: { value: shape.ix },
+        mn: { value: shape.mn },
+        propertyGroup: { value: propertyGroup },
+      });
+      return interfaceFunction;
     };
+  }()
+);
+
+/* exported propertyGroupFactory */
+
+var propertyGroupFactory = (function () {
+  return function (interfaceFunction, parentPropertyGroup) {
+    return function (val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return parentPropertyGroup(val - 1);
+    };
+  };
 }());
 
-var TextExpressionInterface = (function(){
-	return function(elem){
-        var _prevValue, _sourceText;
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Text Document":
-                    return _thisLayerFunction.sourceText;
-            }
-        }
-        Object.defineProperty(_thisLayerFunction, "sourceText", {
-            get: function(){
-                elem.textProperty.getValue()
-                var stringValue = elem.textProperty.currentData.t;
-                if(stringValue !== _prevValue) {
-                    elem.textProperty.currentData.t = _prevValue;
-                    _sourceText = new String(stringValue);
-                    //If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
-                    _sourceText.value = stringValue ? stringValue : new String(stringValue);
-                }
-                return _sourceText;
-            }
-        });
-        return _thisLayerFunction;
+/* exported PropertyInterface */
+
+var PropertyInterface = (function () {
+  return function (propertyName, propertyGroup) {
+    var interfaceFunction = {
+      _name: propertyName,
     };
+
+    function _propertyGroup(val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return propertyGroup(val - 1);
+    }
+
+    return _propertyGroup;
+  };
 }());
-var LayerExpressionInterface = (function (){
 
-    function getMatrix(time) {
-        var toWorldMat = new Matrix();
-        if (time !== undefined) {
-            var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
-            propMatrix.clone(toWorldMat);
-        } else {
-            var transformMat = this._elem.finalTransform.mProp;
-            transformMat.applyToMatrix(toWorldMat);
+/* global ExpressionPropertyInterface, PropertyInterface, propertyGroupFactory, ShapePathInterface */
+/* exported ShapeExpressionInterface */
+
+var ShapeExpressionInterface = (function () {
+  function iterateElements(shapes, view, propertyGroup) {
+    var arr = [];
+    var i;
+    var len = shapes ? shapes.length : 0;
+    for (i = 0; i < len; i += 1) {
+      if (shapes[i].ty === 'gr') {
+        arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'fl') {
+        arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'st') {
+        arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tm') {
+        arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tr') {
+        // arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
+      } else if (shapes[i].ty === 'el') {
+        arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sr') {
+        arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sh') {
+        arr.push(ShapePathInterface(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rc') {
+        arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rd') {
+        arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rp') {
+        arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup));
+      }
+    }
+    return arr;
+  }
+
+  function contentsInterfaceFactory(shape, view, propertyGroup) {
+    var interfaces;
+    var interfaceFunction = function _interfaceFunction(value) {
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) {
+          return interfaces[i];
         }
-        return toWorldMat;
-    }
-
-    function toWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function toWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function fromWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function fromWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function applyPoint(matrix, arr) {
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.applyToPointArray(arr[0],arr[1],arr[2]||0);
-    }
-
-    function invertPoint(matrix, arr) {
-        if (this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.inversePoint(arr);
-    }
-
-    function fromComp(arr){
-        var toWorldMat = new Matrix();
-        toWorldMat.reset();
-        this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
-            }
-            return toWorldMat.inversePoint(arr);
-        }
-        return toWorldMat.inversePoint(arr);
-    }
-
-    function sampleImage() {
-        return [1,1,1,1];
-    }
-
-
-    return function(elem){
-
-        var transformInterface;
-
-        function _registerMaskInterface(maskManager){
-            _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
-        }
-        function _registerEffectsInterface(effects){
-            _thisLayerFunction.effect = effects;
-        }
-
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Root Vectors Group":
-                case "Contents":
-                case 2:
-                    return _thisLayerFunction.shapeInterface;
-                case 1:
-                case 6:
-                case "Transform":
-                case "transform":
-                case "ADBE Transform Group":
-                    return transformInterface;
-                case 4:
-                case "ADBE Effect Parade":
-                case "effects":
-                case "Effects":
-                    return _thisLayerFunction.effect;
-                case "ADBE Text Properties":
-                    return _thisLayerFunction.textInterface;
-            }
-        }
-        _thisLayerFunction.getMatrix = getMatrix;
-        _thisLayerFunction.invertPoint = invertPoint;
-        _thisLayerFunction.applyPoint = applyPoint;
-        _thisLayerFunction.toWorld = toWorld;
-        _thisLayerFunction.toWorldVec = toWorldVec;
-        _thisLayerFunction.fromWorld = fromWorld;
-        _thisLayerFunction.fromWorldVec = fromWorldVec;
-        _thisLayerFunction.toComp = toWorld;
-        _thisLayerFunction.fromComp = fromComp;
-        _thisLayerFunction.sampleImage = sampleImage;
-        _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
-        _thisLayerFunction._elem = elem;
-        transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
-        var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
-        Object.defineProperties(_thisLayerFunction,{
-            hasParent: {
-                get: function(){
-                    return elem.hierarchy.length;
-                }
-            },
-            parent: {
-                get: function(){
-                    return elem.hierarchy[0].layerInterface;
-                }
-            },
-            rotation: getDescriptor(transformInterface, 'rotation'),
-            scale: getDescriptor(transformInterface, 'scale'),
-            position: getDescriptor(transformInterface, 'position'),
-            opacity: getDescriptor(transformInterface, 'opacity'),
-            anchorPoint: anchorPointDescriptor,
-            anchor_point: anchorPointDescriptor,
-            transform: {
-                get: function () {
-                    return transformInterface;
-                }
-            },
-            active: {
-                get: function(){
-                    return elem.isInRange;
-                }
-            }
-        });
-
-        _thisLayerFunction.startTime = elem.data.st;
-        _thisLayerFunction.index = elem.data.ind;
-        _thisLayerFunction.source = elem.data.refId;
-        _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
-        _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
-        _thisLayerFunction.inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        _thisLayerFunction.outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        _thisLayerFunction._name = elem.data.nm;
-
-        _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
-        _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
-        return _thisLayerFunction;
+        i += 1;
+      }
+      if (typeof value === 'number') {
+        return interfaces[value - 1];
+      }
+      return null;
     };
+
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
+    interfaceFunction.numProperties = interfaces.length;
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.transform = transformInterface;
+    interfaceFunction.propertyIndex = shape.cix;
+    interfaceFunction._name = shape.nm;
+
+    return interfaceFunction;
+  }
+
+  function groupInterfaceFactory(shape, view, propertyGroup) {
+    var interfaceFunction = function _interfaceFunction(value) {
+      switch (value) {
+        case 'ADBE Vectors Group':
+        case 'Contents':
+        case 2:
+          return interfaceFunction.content;
+          // Not necessary for now. Keeping them here in case a new case appears
+          // case 'ADBE Vector Transform Group':
+          // case 3:
+        default:
+          return interfaceFunction.transform;
+      }
+    };
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup);
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.content = content;
+    interfaceFunction.transform = transformInterface;
+    Object.defineProperty(interfaceFunction, '_name', {
+      get: function () {
+        return shape.nm;
+      },
+    });
+    // interfaceFunction.content = interfaceFunction;
+    interfaceFunction.numProperties = shape.np;
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.nm = shape.nm;
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function fillInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
+    return interfaceFunction;
+  }
+
+  function strokeInterfaceFactory(shape, view, propertyGroup) {
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
+    function addPropertyToDashOb(i) {
+      Object.defineProperty(dashOb, shape.d[i].nm, {
+        get: ExpressionPropertyInterface(view.d.dataProps[i].p),
+      });
+    }
+    var i;
+    var len = shape.d ? shape.d.length : 0;
+    var dashOb = {};
+    for (i = 0; i < len; i += 1) {
+      addPropertyToDashOb(i);
+      view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
+    }
+
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      } if (val === 'Stroke Width' || val === 'stroke width') {
+        return interfaceFunction.strokeWidth;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      strokeWidth: {
+        get: ExpressionPropertyInterface(view.w),
+      },
+      dash: {
+        get: function () {
+          return dashOb;
+        },
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
+    return interfaceFunction;
+  }
+
+  function trimInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === shape.e.ix || val === 'End' || val === 'end') {
+        return interfaceFunction.end;
+      }
+      if (val === shape.s.ix) {
+        return interfaceFunction.start;
+      }
+      if (val === shape.o.ix) {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+
+    view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
+    view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.propertyGroup = propertyGroup;
+
+    Object.defineProperties(interfaceFunction, {
+      start: {
+        get: ExpressionPropertyInterface(view.s),
+      },
+      end: {
+        get: ExpressionPropertyInterface(view.e),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function transformInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.a.ix === value || value === 'Anchor Point') {
+        return interfaceFunction.anchorPoint;
+      }
+      if (shape.o.ix === value || value === 'Opacity') {
+        return interfaceFunction.opacity;
+      }
+      if (shape.p.ix === value || value === 'Position') {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') {
+        return interfaceFunction.rotation;
+      }
+      if (shape.s.ix === value || value === 'Scale') {
+        return interfaceFunction.scale;
+      }
+      if ((shape.sk && shape.sk.ix === value) || value === 'Skew') {
+        return interfaceFunction.skew;
+      }
+      if ((shape.sa && shape.sa.ix === value) || value === 'Skew Axis') {
+        return interfaceFunction.skewAxis;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
+    view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
+    view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (view.transform.mProps.sk) {
+      view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
+      view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
+    }
+    view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      opacity: {
+        get: ExpressionPropertyInterface(view.transform.mProps.o),
+      },
+      position: {
+        get: ExpressionPropertyInterface(view.transform.mProps.p),
+      },
+      anchorPoint: {
+        get: ExpressionPropertyInterface(view.transform.mProps.a),
+      },
+      scale: {
+        get: ExpressionPropertyInterface(view.transform.mProps.s),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(view.transform.mProps.r),
+      },
+      skew: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sk),
+      },
+      skewAxis: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sa),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.ty = 'tr';
+    interfaceFunction.mn = shape.mn;
+    interfaceFunction.propertyGroup = propertyGroup;
+    return interfaceFunction;
+  }
+
+  function ellipseInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.s.ix === value) {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function starInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.rotation;
+      }
+      if (shape.pt.ix === value) {
+        return interfaceFunction.points;
+      }
+      if (shape.or.ix === value || value === 'ADBE Vector Star Outer Radius') {
+        return interfaceFunction.outerRadius;
+      }
+      if (shape.os.ix === value) {
+        return interfaceFunction.outerRoundness;
+      }
+      if (shape.ir && (shape.ir.ix === value || value === 'ADBE Vector Star Inner Radius')) {
+        return interfaceFunction.innerRadius;
+      }
+      if (shape.is && shape.is.ix === value) {
+        return interfaceFunction.innerRoundness;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
+    prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
+    prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (shape.ir) {
+      prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
+      prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
+    }
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      points: {
+        get: ExpressionPropertyInterface(prop.pt),
+      },
+      outerRadius: {
+        get: ExpressionPropertyInterface(prop.or),
+      },
+      outerRoundness: {
+        get: ExpressionPropertyInterface(prop.os),
+      },
+      innerRadius: {
+        get: ExpressionPropertyInterface(prop.ir),
+      },
+      innerRoundness: {
+        get: ExpressionPropertyInterface(prop.is),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function rectInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.roundness;
+      }
+      if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      roundness: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function roundedInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.r.ix === value || value === 'Round Corners 1') {
+        return interfaceFunction.radius;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      radius: {
+        get: ExpressionPropertyInterface(prop.rd),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function repeaterInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.c.ix === value || value === 'Copies') {
+        return interfaceFunction.copies;
+      } if (shape.o.ix === value || value === 'Offset') {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
+    prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      copies: {
+        get: ExpressionPropertyInterface(prop.c),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(prop.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  return function (shapes, view, propertyGroup) {
+    var interfaces;
+    function _interfaceFunction(value) {
+      if (typeof value === 'number') {
+        value = value === undefined ? 1 : value;
+        if (value === 0) {
+          return propertyGroup;
+        }
+        return interfaces[value - 1];
+      }
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value) {
+          return interfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    }
+    function parentGroupWrapper() {
+      return propertyGroup;
+    }
+    _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
+    interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
+    _interfaceFunction.numProperties = interfaces.length;
+    _interfaceFunction._name = 'Contents';
+    return _interfaceFunction;
+  };
 }());
 
+/* exported TextExpressionInterface */
+
+var TextExpressionInterface = (function () {
+  return function (elem) {
+    var _prevValue;
+    var _sourceText;
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Text Document':
+          return _thisLayerFunction.sourceText;
+        default:
+          return null;
+      }
+    }
+    Object.defineProperty(_thisLayerFunction, 'sourceText', {
+      get: function () {
+        elem.textProperty.getValue();
+        var stringValue = elem.textProperty.currentData.t;
+        if (stringValue !== _prevValue) {
+          elem.textProperty.currentData.t = _prevValue;
+          _sourceText = new String(stringValue); // eslint-disable-line no-new-wrappers
+          // If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
+          _sourceText.value = stringValue || new String(stringValue); // eslint-disable-line no-new-wrappers
+        }
+        return _sourceText;
+      },
+    });
+    return _thisLayerFunction;
+  };
+}());
+
+/* global Matrix, MaskManagerInterface, TransformExpressionInterface, getDescriptor */
+/* exported LayerExpressionInterface */
+
+var LayerExpressionInterface = (function () {
+  function getMatrix(time) {
+    var toWorldMat = new Matrix();
+    if (time !== undefined) {
+      var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
+      propMatrix.clone(toWorldMat);
+    } else {
+      var transformMat = this._elem.finalTransform.mProp;
+      transformMat.applyToMatrix(toWorldMat);
+    }
+    return toWorldMat;
+  }
+
+  function toWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function toWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function fromWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function fromWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function applyPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.applyToPointArray(arr[0], arr[1], arr[2] || 0);
+  }
+
+  function invertPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.inversePoint(arr);
+  }
+
+  function fromComp(arr) {
+    var toWorldMat = new Matrix();
+    toWorldMat.reset();
+    this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
+      }
+      return toWorldMat.inversePoint(arr);
+    }
+    return toWorldMat.inversePoint(arr);
+  }
+
+  function sampleImage() {
+    return [1, 1, 1, 1];
+  }
+
+  return function (elem) {
+    var transformInterface;
+
+    function _registerMaskInterface(maskManager) {
+      _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
+    }
+    function _registerEffectsInterface(effects) {
+      _thisLayerFunction.effect = effects;
+    }
+
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Root Vectors Group':
+        case 'Contents':
+        case 2:
+          return _thisLayerFunction.shapeInterface;
+        case 1:
+        case 6:
+        case 'Transform':
+        case 'transform':
+        case 'ADBE Transform Group':
+          return transformInterface;
+        case 4:
+        case 'ADBE Effect Parade':
+        case 'effects':
+        case 'Effects':
+          return _thisLayerFunction.effect;
+        case 'ADBE Text Properties':
+          return _thisLayerFunction.textInterface;
+        default:
+          return null;
+      }
+    }
+    _thisLayerFunction.getMatrix = getMatrix;
+    _thisLayerFunction.invertPoint = invertPoint;
+    _thisLayerFunction.applyPoint = applyPoint;
+    _thisLayerFunction.toWorld = toWorld;
+    _thisLayerFunction.toWorldVec = toWorldVec;
+    _thisLayerFunction.fromWorld = fromWorld;
+    _thisLayerFunction.fromWorldVec = fromWorldVec;
+    _thisLayerFunction.toComp = toWorld;
+    _thisLayerFunction.fromComp = fromComp;
+    _thisLayerFunction.sampleImage = sampleImage;
+    _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
+    _thisLayerFunction._elem = elem;
+    transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
+    var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
+    Object.defineProperties(_thisLayerFunction, {
+      hasParent: {
+        get: function () {
+          return elem.hierarchy.length;
+        },
+      },
+      parent: {
+        get: function () {
+          return elem.hierarchy[0].layerInterface;
+        },
+      },
+      rotation: getDescriptor(transformInterface, 'rotation'),
+      scale: getDescriptor(transformInterface, 'scale'),
+      position: getDescriptor(transformInterface, 'position'),
+      opacity: getDescriptor(transformInterface, 'opacity'),
+      anchorPoint: anchorPointDescriptor,
+      anchor_point: anchorPointDescriptor,
+      transform: {
+        get: function () {
+          return transformInterface;
+        },
+      },
+      active: {
+        get: function () {
+          return elem.isInRange;
+        },
+      },
+    });
+
+    _thisLayerFunction.startTime = elem.data.st;
+    _thisLayerFunction.index = elem.data.ind;
+    _thisLayerFunction.source = elem.data.refId;
+    _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
+    _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
+    _thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    _thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    _thisLayerFunction._name = elem.data.nm;
+
+    _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
+    _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
+    return _thisLayerFunction;
+  };
+}());
+
+/* exported CompExpressionInterface */
+
 var CompExpressionInterface = (function () {
-    return function(comp) {
-        function _thisLayerFunction(name) {
-            var i = 0, len = comp.layers.length;
-            while ( i < len) {
-                if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
-                    return comp.elements[i].layerInterface;
-                }
-                i += 1;
-            }
-            return null;
-            //return {active:false};
+  return function (comp) {
+    function _thisLayerFunction(name) {
+      var i = 0;
+      var len = comp.layers.length;
+      while (i < len) {
+        if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
+          return comp.elements[i].layerInterface;
         }
-        Object.defineProperty(_thisLayerFunction, "_name", { value: comp.data.nm });
-        _thisLayerFunction.layer = _thisLayerFunction;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
-        _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
-        _thisLayerFunction.displayStartTime = 0;
-        _thisLayerFunction.numLayers = comp.layers.length;
-        return _thisLayerFunction;
-    };
-}());
-var TransformExpressionInterface = (function (){
-    return function(transform){
-        function _thisFunction(name){
-            switch(name){
-                case "scale":
-                case "Scale":
-                case "ADBE Scale":
-                case 6:
-                    return _thisFunction.scale;
-                case "rotation":
-                case "Rotation":
-                case "ADBE Rotation":
-                case "ADBE Rotate Z":
-                case 10:
-                    return _thisFunction.rotation;
-                case "ADBE Rotate X":
-                    return _thisFunction.xRotation;
-                case "ADBE Rotate Y":
-                    return _thisFunction.yRotation;
-                case "position":
-                case "Position":
-                case "ADBE Position":
-                case 2:
-                    return _thisFunction.position;
-                case 'ADBE Position_0':
-                    return _thisFunction.xPosition;
-                case 'ADBE Position_1':
-                    return _thisFunction.yPosition;
-                case 'ADBE Position_2':
-                    return _thisFunction.zPosition;
-                case "anchorPoint":
-                case "AnchorPoint":
-                case "Anchor Point":
-                case "ADBE AnchorPoint":
-                case 1:
-                    return _thisFunction.anchorPoint;
-                case "opacity":
-                case "Opacity":
-                case 11:
-                    return _thisFunction.opacity;
-            }
-        }
-        Object.defineProperty(_thisFunction, "rotation", {
-            get: ExpressionPropertyInterface(transform.r || transform.rz)
-        });
-
-        Object.defineProperty(_thisFunction, "zRotation", {
-            get: ExpressionPropertyInterface(transform.rz || transform.r)
-        });
-
-        Object.defineProperty(_thisFunction, "xRotation", {
-            get: ExpressionPropertyInterface(transform.rx)
-        });
-
-        Object.defineProperty(_thisFunction, "yRotation", {
-            get: ExpressionPropertyInterface(transform.ry)
-        });
-        Object.defineProperty(_thisFunction, "scale", {
-            get: ExpressionPropertyInterface(transform.s)
-        });
-
-        if(transform.p) {
-            var _transformFactory = ExpressionPropertyInterface(transform.p);
-        } else {
-            var _px = ExpressionPropertyInterface(transform.px);
-            var _py = ExpressionPropertyInterface(transform.py);
-            var _pz;
-            if (transform.pz) {
-                _pz = ExpressionPropertyInterface(transform.pz);
-            }
-        }
-        Object.defineProperty(_thisFunction, "position", {
-            get: function () {
-                if(transform.p) {
-                    return _transformFactory();
-                } else {
-                    return [
-                        _px(),
-                        _py(),
-                        _pz ? _pz() : 0];
-                }
-            }
-        });
-
-        Object.defineProperty(_thisFunction, "xPosition", {
-            get: ExpressionPropertyInterface(transform.px)
-        });
-
-        Object.defineProperty(_thisFunction, "yPosition", {
-            get: ExpressionPropertyInterface(transform.py)
-        });
-
-        Object.defineProperty(_thisFunction, "zPosition", {
-            get: ExpressionPropertyInterface(transform.pz)
-        });
-
-        Object.defineProperty(_thisFunction, "anchorPoint", {
-            get: ExpressionPropertyInterface(transform.a)
-        });
-
-        Object.defineProperty(_thisFunction, "opacity", {
-            get: ExpressionPropertyInterface(transform.o)
-        });
-
-        Object.defineProperty(_thisFunction, "skew", {
-            get: ExpressionPropertyInterface(transform.sk)
-        });
-
-        Object.defineProperty(_thisFunction, "skewAxis", {
-            get: ExpressionPropertyInterface(transform.sa)
-        });
-
-        Object.defineProperty(_thisFunction, "orientation", {
-            get: ExpressionPropertyInterface(transform.or)
-        });
-
-        return _thisFunction;
-    };
-}());
-var ProjectInterface = (function (){
-
-    function registerComposition(comp){
-        this.compositions.push(comp);
+        i += 1;
+      }
+      return null;
+      // return {active:false};
     }
-
-    return function(){
-        function _thisProjectFunction(name){
-            var i = 0, len = this.compositions.length;
-            while(i<len){
-                if(this.compositions[i].data && this.compositions[i].data.nm === name){
-                    if(this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
-                        this.compositions[i].prepareFrame(this.currentFrame);
-                    }
-                    return this.compositions[i].compInterface;
-                }
-                i+=1;
-            }
-        }
-
-        _thisProjectFunction.compositions = [];
-        _thisProjectFunction.currentFrame = 0;
-
-        _thisProjectFunction.registerComposition = registerComposition;
-
-
-
-        return _thisProjectFunction;
-    };
+    Object.defineProperty(_thisLayerFunction, '_name', { value: comp.data.nm });
+    _thisLayerFunction.layer = _thisLayerFunction;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
+    _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
+    _thisLayerFunction.displayStartTime = 0;
+    _thisLayerFunction.numLayers = comp.layers.length;
+    return _thisLayerFunction;
+  };
 }());
-var EffectsExpressionInterface = (function (){
-    var ob = {
-        createEffectsInterface: createEffectsInterface
-    };
 
-    function createEffectsInterface(elem, propertyGroup){
-        if(elem.effectsManager){
+/* global ExpressionPropertyInterface */
+/* exported TransformExpressionInterface */
 
-            var effectElements = [];
-            var effectsData = elem.data.ef;
-            var i, len = elem.effectsManager.effectElements.length;
-            for(i=0;i<len;i+=1){
-                effectElements.push(createGroupInterface(effectsData[i],elem.effectsManager.effectElements[i],propertyGroup,elem));
-            }
-
-            var effects = elem.data.ef || [];
-            var groupInterface = function(name){
-                i = 0, len = effects.length;
-                while(i<len) {
-                    if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                        return effectElements[i];
-                    }
-                    i += 1;
-                }
-            };
-            Object.defineProperty(groupInterface, 'numProperties', {
-                get: function(){
-                    return effects.length;
-                }
-            });
-            return groupInterface
-        }
+var TransformExpressionInterface = (function () {
+  return function (transform) {
+    function _thisFunction(name) {
+      switch (name) {
+        case 'scale':
+        case 'Scale':
+        case 'ADBE Scale':
+        case 6:
+          return _thisFunction.scale;
+        case 'rotation':
+        case 'Rotation':
+        case 'ADBE Rotation':
+        case 'ADBE Rotate Z':
+        case 10:
+          return _thisFunction.rotation;
+        case 'ADBE Rotate X':
+          return _thisFunction.xRotation;
+        case 'ADBE Rotate Y':
+          return _thisFunction.yRotation;
+        case 'position':
+        case 'Position':
+        case 'ADBE Position':
+        case 2:
+          return _thisFunction.position;
+        case 'ADBE Position_0':
+          return _thisFunction.xPosition;
+        case 'ADBE Position_1':
+          return _thisFunction.yPosition;
+        case 'ADBE Position_2':
+          return _thisFunction.zPosition;
+        case 'anchorPoint':
+        case 'AnchorPoint':
+        case 'Anchor Point':
+        case 'ADBE AnchorPoint':
+        case 1:
+          return _thisFunction.anchorPoint;
+        case 'opacity':
+        case 'Opacity':
+        case 11:
+          return _thisFunction.opacity;
+        default:
+          return null;
+      }
     }
-
-    function createGroupInterface(data,elements, propertyGroup, elem){
-
-        function groupInterface(name){
-            var effects = data.ef, i = 0, len = effects.length;
-            while(i<len) {
-                if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                    if(effects[i].ty === 5){
-                        return effectElements[i];
-                    } else {
-                        return effectElements[i]();
-                    }
-                }
-                i += 1;
-            }
-            throw new Error();
-        };
-        var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
-
-        var effectElements = [];
-        var i, len = data.ef.length;
-        for(i=0;i<len;i+=1){
-            if(data.ef[i].ty === 5){
-                effectElements.push(createGroupInterface(data.ef[i],elements.effectElements[i],elements.effectElements[i].propertyGroup, elem));
-            } else {
-                effectElements.push(createValueInterface(elements.effectElements[i],data.ef[i].ty, elem, _propertyGroup));
-            }
-        }
-
-        if(data.mn === 'ADBE Color Control'){
-            Object.defineProperty(groupInterface, 'color', {
-                get: function(){
-                    return effectElements[0]();
-                }
-            });
-        }
-        Object.defineProperties(groupInterface, {
-            numProperties: {
-                get: function(){
-                    return data.np;
-                }
-            },
-            _name: { value: data.nm },
-            propertyGroup: {value: _propertyGroup},
-        });
-        groupInterface.active = groupInterface.enabled = data.en !== 0;
-        return groupInterface;
-    }
-
-    function createValueInterface(element, type, elem, propertyGroup){
-        var expressionProperty = ExpressionPropertyInterface(element.p);
-        function interfaceFunction(){
-            if(type === 10){
-                return elem.comp.compInterface(element.p.v);
-            }
-            return expressionProperty();
-        }
-
-        if(element.p.setGroupProperty) {
-            element.p.setGroupProperty(PropertyInterface('', propertyGroup));
-        }
-
-        return interfaceFunction;
-    }
-
-    return ob;
-
-}());
-var MaskManagerInterface = (function(){
-
-	function MaskInterface(mask, data){
-		this._mask = mask;
-		this._data = data;
-	}
-	Object.defineProperty(MaskInterface.prototype, 'maskPath', {
-        get: function(){
-            if(this._mask.prop.k){
-                this._mask.prop.getValue();
-            }
-            return this._mask.prop;
-        }
-    });
-	Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
-        get: function(){
-            if(this._mask.op.k){
-                this._mask.op.getValue();
-            }
-            return this._mask.op.v * 100;
-        }
+    Object.defineProperty(_thisFunction, 'rotation', {
+      get: ExpressionPropertyInterface(transform.r || transform.rz),
     });
 
-	var MaskManager = function(maskManager, elem){
-		var _maskManager = maskManager;
-		var _elem = elem;
-		var _masksInterfaces = createSizedArray(maskManager.viewData.length);
-		var i, len = maskManager.viewData.length;
-		for(i = 0; i < len; i += 1) {
-			_masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
-		}
+    Object.defineProperty(_thisFunction, 'zRotation', {
+      get: ExpressionPropertyInterface(transform.rz || transform.r),
+    });
 
-		var maskFunction = function(name){
-			i = 0;
-		    while(i<len){
-		        if(maskManager.masksProperties[i].nm === name){
-		            return _masksInterfaces[i];
-		        }
-		        i += 1;
-		    }
-		};
-		return maskFunction;
-	};
-	return MaskManager;
+    Object.defineProperty(_thisFunction, 'xRotation', {
+      get: ExpressionPropertyInterface(transform.rx),
+    });
+
+    Object.defineProperty(_thisFunction, 'yRotation', {
+      get: ExpressionPropertyInterface(transform.ry),
+    });
+    Object.defineProperty(_thisFunction, 'scale', {
+      get: ExpressionPropertyInterface(transform.s),
+    });
+    var _px;
+    var _py;
+    var _pz;
+    var _transformFactory;
+    if (transform.p) {
+      _transformFactory = ExpressionPropertyInterface(transform.p);
+    } else {
+      _px = ExpressionPropertyInterface(transform.px);
+      _py = ExpressionPropertyInterface(transform.py);
+      if (transform.pz) {
+        _pz = ExpressionPropertyInterface(transform.pz);
+      }
+    }
+    Object.defineProperty(_thisFunction, 'position', {
+      get: function () {
+        if (transform.p) {
+          return _transformFactory();
+        }
+        return [
+          _px(),
+          _py(),
+          _pz ? _pz() : 0];
+      },
+    });
+
+    Object.defineProperty(_thisFunction, 'xPosition', {
+      get: ExpressionPropertyInterface(transform.px),
+    });
+
+    Object.defineProperty(_thisFunction, 'yPosition', {
+      get: ExpressionPropertyInterface(transform.py),
+    });
+
+    Object.defineProperty(_thisFunction, 'zPosition', {
+      get: ExpressionPropertyInterface(transform.pz),
+    });
+
+    Object.defineProperty(_thisFunction, 'anchorPoint', {
+      get: ExpressionPropertyInterface(transform.a),
+    });
+
+    Object.defineProperty(_thisFunction, 'opacity', {
+      get: ExpressionPropertyInterface(transform.o),
+    });
+
+    Object.defineProperty(_thisFunction, 'skew', {
+      get: ExpressionPropertyInterface(transform.sk),
+    });
+
+    Object.defineProperty(_thisFunction, 'skewAxis', {
+      get: ExpressionPropertyInterface(transform.sa),
+    });
+
+    Object.defineProperty(_thisFunction, 'orientation', {
+      get: ExpressionPropertyInterface(transform.or),
+    });
+
+    return _thisFunction;
+  };
 }());
 
-var ExpressionPropertyInterface = (function() {
+/* exported ProjectInterface */
 
-    var defaultUnidimensionalValue = {pv:0, v:0, mult: 1}
-    var defaultMultidimensionalValue = {pv:[0,0,0], v:[0,0,0], mult: 1}
+var ProjectInterface = (function () {
+  function registerComposition(comp) {
+    this.compositions.push(comp);
+  }
 
-    function completeProperty(expressionValue, property, type) {
-        Object.defineProperty(expressionValue, 'velocity', {
-            get: function(){
-                return property.getVelocityAtTime(property.comp.currentFrame);
-            }
-        });
-        expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
-        expressionValue.key = function(pos) {
-            if (!expressionValue.numKeys) {
-                return 0;
-            } else {
-                var value = '';
-                if ('s' in property.keyframes[pos-1]) {
-                    value = property.keyframes[pos-1].s;
-                } else if ('e' in property.keyframes[pos-2]) {
-                    value = property.keyframes[pos-2].e;
-                } else {
-                    value = property.keyframes[pos-2].s;
-                }
-                var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value);
-                valueProp.time = property.keyframes[pos-1].t / property.elem.comp.globalData.frameRate;
-                valueProp.value = type === 'unidimensional' ? value[0] : value;
-                return valueProp;
-            }
-        };
-        expressionValue.valueAtTime = property.getValueAtTime;
-        expressionValue.speedAtTime = property.getSpeedAtTime;
-        expressionValue.velocityAtTime = property.getVelocityAtTime;
-        expressionValue.propertyGroup = property.propertyGroup;
+  return function () {
+    function _thisProjectFunction(name) {
+      var i = 0;
+      var len = this.compositions.length;
+      while (i < len) {
+        if (this.compositions[i].data && this.compositions[i].data.nm === name) {
+          if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
+            this.compositions[i].prepareFrame(this.currentFrame);
+          }
+          return this.compositions[i].compInterface;
+        }
+        i += 1;
+      }
+      return null;
     }
 
-    function UnidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultUnidimensionalValue;
+    _thisProjectFunction.compositions = [];
+    _thisProjectFunction.currentFrame = 0;
+
+    _thisProjectFunction.registerComposition = registerComposition;
+
+    return _thisProjectFunction;
+  };
+}());
+
+/* global propertyGroupFactory, ExpressionPropertyInterface, PropertyInterface */
+/* exported EffectsExpressionInterface */
+
+var EffectsExpressionInterface = (function () {
+  var ob = {
+    createEffectsInterface: createEffectsInterface,
+  };
+
+  function createEffectsInterface(elem, propertyGroup) {
+    if (elem.effectsManager) {
+      var effectElements = [];
+      var effectsData = elem.data.ef;
+      var i;
+      var len = elem.effectsManager.effectElements.length;
+      for (i = 0; i < len; i += 1) {
+        effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem));
+      }
+
+      var effects = elem.data.ef || [];
+      var groupInterface = function (name) {
+        i = 0;
+        len = effects.length;
+        while (i < len) {
+          if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+            return effectElements[i];
+          }
+          i += 1;
         }
-        var mult = 1 / property.mult;
-        var val = property.pv * mult;
-        var expressionValue = new Number(val);
+        return null;
+      };
+      Object.defineProperty(groupInterface, 'numProperties', {
+        get: function () {
+          return effects.length;
+        },
+      });
+      return groupInterface;
+    }
+    return null;
+  }
+
+  function createGroupInterface(data, elements, propertyGroup, elem) {
+    function groupInterface(name) {
+      var effects = data.ef;
+      var i = 0;
+      var len = effects.length;
+      while (i < len) {
+        if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+          if (effects[i].ty === 5) {
+            return effectElements[i];
+          }
+          return effectElements[i]();
+        }
+        i += 1;
+      }
+      throw new Error();
+    }
+    var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
+
+    var effectElements = [];
+    var i;
+    var len = data.ef.length;
+    for (i = 0; i < len; i += 1) {
+      if (data.ef[i].ty === 5) {
+        effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem));
+      } else {
+        effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup));
+      }
+    }
+
+    if (data.mn === 'ADBE Color Control') {
+      Object.defineProperty(groupInterface, 'color', {
+        get: function () {
+          return effectElements[0]();
+        },
+      });
+    }
+    Object.defineProperties(groupInterface, {
+      numProperties: {
+        get: function () {
+          return data.np;
+        },
+      },
+      _name: { value: data.nm },
+      propertyGroup: { value: _propertyGroup },
+    });
+    groupInterface.enabled = data.en !== 0;
+    groupInterface.active = groupInterface.enabled;
+    return groupInterface;
+  }
+
+  function createValueInterface(element, type, elem, propertyGroup) {
+    var expressionProperty = ExpressionPropertyInterface(element.p);
+    function interfaceFunction() {
+      if (type === 10) {
+        return elem.comp.compInterface(element.p.v);
+      }
+      return expressionProperty();
+    }
+
+    if (element.p.setGroupProperty) {
+      element.p.setGroupProperty(PropertyInterface('', propertyGroup));
+    }
+
+    return interfaceFunction;
+  }
+
+  return ob;
+}());
+
+/* global createSizedArray */
+/* exported MaskManagerInterface */
+
+var MaskManagerInterface = (function () {
+  function MaskInterface(mask, data) {
+    this._mask = mask;
+    this._data = data;
+  }
+  Object.defineProperty(MaskInterface.prototype, 'maskPath', {
+    get: function () {
+      if (this._mask.prop.k) {
+        this._mask.prop.getValue();
+      }
+      return this._mask.prop;
+    },
+  });
+  Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
+    get: function () {
+      if (this._mask.op.k) {
+        this._mask.op.getValue();
+      }
+      return this._mask.op.v * 100;
+    },
+  });
+
+  var MaskManager = function (maskManager) {
+    var _masksInterfaces = createSizedArray(maskManager.viewData.length);
+    var i;
+    var len = maskManager.viewData.length;
+    for (i = 0; i < len; i += 1) {
+      _masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
+    }
+
+    var maskFunction = function (name) {
+      i = 0;
+      while (i < len) {
+        if (maskManager.masksProperties[i].nm === name) {
+          return _masksInterfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    };
+    return maskFunction;
+  };
+  return MaskManager;
+}());
+
+/* global createTypedArray */
+/* exported ExpressionPropertyInterface */
+
+var ExpressionPropertyInterface = (function () {
+  var defaultUnidimensionalValue = { pv: 0, v: 0, mult: 1 };
+  var defaultMultidimensionalValue = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 };
+
+  function completeProperty(expressionValue, property, type) {
+    Object.defineProperty(expressionValue, 'velocity', {
+      get: function () {
+        return property.getVelocityAtTime(property.comp.currentFrame);
+      },
+    });
+    expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
+    expressionValue.key = function (pos) {
+      if (!expressionValue.numKeys) {
+        return 0;
+      }
+      var value = '';
+      if ('s' in property.keyframes[pos - 1]) {
+        value = property.keyframes[pos - 1].s;
+      } else if ('e' in property.keyframes[pos - 2]) {
+        value = property.keyframes[pos - 2].e;
+      } else {
+        value = property.keyframes[pos - 2].s;
+      }
+      var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value); // eslint-disable-line no-new-wrappers
+      valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate;
+      valueProp.value = type === 'unidimensional' ? value[0] : value;
+      return valueProp;
+    };
+    expressionValue.valueAtTime = property.getValueAtTime;
+    expressionValue.speedAtTime = property.getSpeedAtTime;
+    expressionValue.velocityAtTime = property.getVelocityAtTime;
+    expressionValue.propertyGroup = property.propertyGroup;
+  }
+
+  function UnidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultUnidimensionalValue;
+    }
+    var mult = 1 / property.mult;
+    var val = property.pv * mult;
+    var expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
+    expressionValue.value = val;
+    completeProperty(expressionValue, property, 'unidimensional');
+
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      val = property.v * mult;
+      if (expressionValue.value !== val) {
+        expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
         expressionValue.value = val;
         completeProperty(expressionValue, property, 'unidimensional');
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            val = property.v * mult;
-            if(expressionValue.value !== val) {
-                expressionValue = new Number(val);
-                expressionValue.value = val;
-                completeProperty(expressionValue, property, 'unidimensional');
-            }
-            return expressionValue;
-        }
+  function MultidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultMultidimensionalValue;
     }
+    var mult = 1 / property.mult;
+    var len = (property.data && property.data.l) || property.pv.length;
+    var expressionValue = createTypedArray('float32', len);
+    var arrValue = createTypedArray('float32', len);
+    expressionValue.value = arrValue;
+    completeProperty(expressionValue, property, 'multidimensional');
 
-    function MultidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultMultidimensionalValue;
-        }
-        var mult = 1 / property.mult;
-        var len = (property.data && property.data.l) || property.pv.length;
-        var expressionValue = createTypedArray('float32', len);
-        var arrValue = createTypedArray('float32', len);
-        expressionValue.value = arrValue;
-        completeProperty(expressionValue, property, 'multidimensional');
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      for (var i = 0; i < len; i += 1) {
+        arrValue[i] = property.v[i] * mult;
+        expressionValue[i] = arrValue[i];
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            for (var i = 0; i < len; i += 1) {
-                expressionValue[i] = arrValue[i] = property.v[i] * mult;
-            }
-            return expressionValue;
-        }
-    }
+  // TODO: try to avoid using this getter
+  function defaultGetter() {
+    return defaultUnidimensionalValue;
+  }
 
-    //TODO: try to avoid using this getter
-    function defaultGetter() {
-        return defaultUnidimensionalValue;
+  return function (property) {
+    if (!property) {
+      return defaultGetter;
+    } if (property.propType === 'unidimensional') {
+      return UnidimensionalPropertyInterface(property);
     }
-    
-    return function(property) {
-        if(!property) {
-            return defaultGetter;
-        } else if (property.propType === 'unidimensional') {
-            return UnidimensionalPropertyInterface(property);
-        } else {
-            return MultidimensionalPropertyInterface(property);
-        }
-    }
+    return MultidimensionalPropertyInterface(property);
+  };
 }());
 
-(function(){
+/* global expressionHelpers, TextSelectorProp, ExpressionManager */
+/* exported TextExpressionSelectorProp */
 
-    var TextExpressionSelectorProp = (function(){
-
-        function getValueProxy(index,total){
-            this.textIndex = index+1;
-            this.textTotal = total;
-            this.v = this.getValue() * this.mult;
-            return this.v;
-        }
-
-        return function TextExpressionSelectorProp(elem,data){
-            this.pv = 1;
-            this.comp = elem.comp;
-            this.elem = elem;
-            this.mult = 0.01;
-            this.propType = 'textSelector';
-            this.textTotal = data.totalChars;
-            this.selectorValue = 100;
-            this.lastValue = [1,1,1];
-            this.k = true;
-            this.x = true;
-            this.getValue = ExpressionManager.initiateExpression.bind(this)(elem,data,this);
-            this.getMult = getValueProxy;
-            this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
-            if(this.kf){
-                this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
-            } else {
-                this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
-            }
-            this.setGroupProperty = expressionHelpers.setGroupProperty;
-        };
-    }());
-
-	var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
-	TextSelectorProp.getTextSelectorProp = function(elem, data,arr){
-	    if(data.t === 1){
-	        return new TextExpressionSelectorProp(elem, data,arr);
-	    } else {
-	        return propertyGetTextProp(elem,data,arr);
-	    }
-	};
-}());
-function SliderEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function AngleEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function ColorEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function PointEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function LayerIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function MaskIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function CheckboxEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function NoValueEffect(){
-    this.p = {};
-}
-function EffectsManager(data,element){
-    var effects = data.ef || [];
-    this.effectElements = [];
-    var i,len = effects.length;
-    var effectItem;
-    for(i=0;i<len;i++) {
-        effectItem = new GroupEffect(effects[i],element);
-        this.effectElements.push(effectItem);
+(function () {
+  var TextExpressionSelectorProp = (function () { // eslint-disable-line no-unused-vars
+    function getValueProxy(index, total) {
+      this.textIndex = index + 1;
+      this.textTotal = total;
+      this.v = this.getValue() * this.mult;
+      return this.v;
     }
+
+    return function TextExpressionSelectorPropFactory(elem, data) {
+      this.pv = 1;
+      this.comp = elem.comp;
+      this.elem = elem;
+      this.mult = 0.01;
+      this.propType = 'textSelector';
+      this.textTotal = data.totalChars;
+      this.selectorValue = 100;
+      this.lastValue = [1, 1, 1];
+      this.k = true;
+      this.x = true;
+      this.getValue = ExpressionManager.initiateExpression.bind(this)(elem, data, this);
+      this.getMult = getValueProxy;
+      this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
+      if (this.kf) {
+        this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
+      } else {
+        this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
+      }
+      this.setGroupProperty = expressionHelpers.setGroupProperty;
+    };
+  }());
+
+  var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
+  TextSelectorProp.getTextSelectorProp = function (elem, data, arr) {
+    if (data.t === 1) {
+      return new TextExpressionSelectorPropFactory(elem, data, arr); // eslint-disable-line no-undef
+    }
+    return propertyGetTextProp(elem, data, arr);
+  };
+}());
+
+/* global PropertyFactory */
+/* exported SliderEffect, AngleEffect, ColorEffect, PointEffect, LayerIndexEffect, MaskIndexEffect, CheckboxEffect, NoValueEffect */
+
+function SliderEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function AngleEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function ColorEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function PointEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function LayerIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function MaskIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function CheckboxEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function NoValueEffect() {
+  this.p = {};
 }
 
-function GroupEffect(data,element){
-    this.init(data,element);
+/* global extendPrototype, SliderEffect, AngleEffect, ColorEffect, PointEffect, CheckboxEffect, LayerIndexEffect,
+MaskIndexEffect, NoValueEffect, DynamicPropertyContainer */
+
+function EffectsManager(data, element) {
+  var effects = data.ef || [];
+  this.effectElements = [];
+  var i;
+  var len = effects.length;
+  var effectItem;
+  for (i = 0; i < len; i += 1) {
+    effectItem = new GroupEffect(effects[i], element);
+    this.effectElements.push(effectItem);
+  }
+}
+
+function GroupEffect(data, element) {
+  this.init(data, element);
 }
 
 extendPrototype([DynamicPropertyContainer], GroupEffect);
 
 GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
 
-GroupEffect.prototype.init = function(data,element){
-    this.data = data;
-    this.effectElements = [];
-    this.initDynamicPropertyContainer(element);
-    var i, len = this.data.ef.length;
-    var eff, effects = this.data.ef;
-    for(i=0;i<len;i+=1){
-        eff = null;
-        switch(effects[i].ty){
-            case 0:
-                eff = new SliderEffect(effects[i],element,this);
-                break;
-            case 1:
-                eff = new AngleEffect(effects[i],element,this);
-                break;
-            case 2:
-                eff = new ColorEffect(effects[i],element,this);
-                break;
-            case 3:
-                eff = new PointEffect(effects[i],element,this);
-                break;
-            case 4:
-            case 7:
-                eff = new CheckboxEffect(effects[i],element,this);
-                break;
-            case 10:
-                eff = new LayerIndexEffect(effects[i],element,this);
-                break;
-            case 11:
-                eff = new MaskIndexEffect(effects[i],element,this);
-                break;
-            case 5:
-                eff = new EffectsManager(effects[i],element,this);
-                break;
-            //case 6:
-            default:
-                eff = new NoValueEffect(effects[i],element,this);
-                break;
-        }
-        if(eff) {
-            this.effectElements.push(eff);
-        }
+GroupEffect.prototype.init = function (data, element) {
+  this.data = data;
+  this.effectElements = [];
+  this.initDynamicPropertyContainer(element);
+  var i;
+  var len = this.data.ef.length;
+  var eff;
+  var effects = this.data.ef;
+  for (i = 0; i < len; i += 1) {
+    eff = null;
+    switch (effects[i].ty) {
+      case 0:
+        eff = new SliderEffect(effects[i], element, this);
+        break;
+      case 1:
+        eff = new AngleEffect(effects[i], element, this);
+        break;
+      case 2:
+        eff = new ColorEffect(effects[i], element, this);
+        break;
+      case 3:
+        eff = new PointEffect(effects[i], element, this);
+        break;
+      case 4:
+      case 7:
+        eff = new CheckboxEffect(effects[i], element, this);
+        break;
+      case 10:
+        eff = new LayerIndexEffect(effects[i], element, this);
+        break;
+      case 11:
+        eff = new MaskIndexEffect(effects[i], element, this);
+        break;
+      case 5:
+        eff = new EffectsManager(effects[i], element, this);
+        break;
+        // case 6:
+      default:
+        eff = new NoValueEffect(effects[i], element, this);
+        break;
     }
+    if (eff) {
+      this.effectElements.push(eff);
+    }
+  }
 };
 
+
 var lottie = {};
 
-var _isFrozen = false;
-
-function setLocationHref (href) {
-    locationHref = href;
+function setLocationHref(href) {
+  locationHref = href;
 }
 
 function searchAnimations() {
-    if (standalone === true) {
-        animationManager.searchAnimations(animationData, standalone, renderer);
-    } else {
-        animationManager.searchAnimations();
-    }
+  if (standalone === true) {
+    animationManager.searchAnimations(animationData, standalone, renderer);
+  } else {
+    animationManager.searchAnimations();
+  }
 }
 
 function setSubframeRendering(flag) {
-    subframeEnabled = flag;
+  subframeEnabled = flag;
 }
 
 function loadAnimation(params) {
-    if (standalone === true) {
-        params.animationData = JSON.parse(animationData);
-    }
-    return animationManager.loadAnimation(params);
+  if (standalone === true) {
+    params.animationData = JSON.parse(animationData);
+  }
+  return animationManager.loadAnimation(params);
 }
 
 function setQuality(value) {
-    if (typeof value === 'string') {
-        switch (value) {
-            case 'high':
-                defaultCurveSegments = 200;
-                break;
-            case 'medium':
-                defaultCurveSegments = 50;
-                break;
-            case 'low':
-                defaultCurveSegments = 10;
-                break;
-        }
-    } else if (!isNaN(value) && value > 1) {
-        defaultCurveSegments = value;
+  if (typeof value === 'string') {
+    switch (value) {
+      case 'high':
+        defaultCurveSegments = 200;
+        break;
+      default:
+      case 'medium':
+        defaultCurveSegments = 50;
+        break;
+      case 'low':
+        defaultCurveSegments = 10;
+        break;
     }
-    if (defaultCurveSegments >= 50) {
-        roundValues(false);
-    } else {
-        roundValues(true);
-    }
+  } else if (!isNaN(value) && value > 1) {
+    defaultCurveSegments = value;
+  }
+  if (defaultCurveSegments >= 50) {
+    roundValues(false);
+  } else {
+    roundValues(true);
+  }
 }
 
 function inBrowser() {
-    return typeof navigator !== 'undefined';
+  return typeof navigator !== 'undefined';
 }
 
 function installPlugin(type, plugin) {
-    if (type === 'expressions') {
-        expressionsPlugin = plugin;
-    }
+  if (type === 'expressions') {
+    expressionsPlugin = plugin;
+  }
 }
 
 function getFactory(name) {
-    switch (name) {
-        case "propertyFactory":
-            return PropertyFactory;
-        case "shapePropertyFactory":
-            return ShapePropertyFactory;
-        case "matrix":
-            return Matrix;
-    }
+  switch (name) {
+    case 'propertyFactory':
+      return PropertyFactory;
+    case 'shapePropertyFactory':
+      return ShapePropertyFactory;
+    case 'matrix':
+      return Matrix;
+    default:
+      return null;
+  }
 }
 
 lottie.play = animationManager.play;
@@ -12771,7 +13500,7 @@
 lottie.loadAnimation = loadAnimation;
 lottie.setSubframeRendering = setSubframeRendering;
 lottie.resize = animationManager.resize;
-//lottie.start = start;
+// lottie.start = start;
 lottie.goToAndStop = animationManager.goToAndStop;
 lottie.destroy = animationManager.destroy;
 lottie.setQuality = setQuality;
@@ -12784,35 +13513,37 @@
 lottie.unmute = animationManager.unmute;
 lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
 lottie.__getFactory = getFactory;
-lottie.version = '5.7.5';
+lottie.version = '5.7.6';
 
 function checkReady() {
-    if (document.readyState === "complete") {
-        clearInterval(readyStateCheckInterval);
-        searchAnimations();
-    }
+  if (document.readyState === 'complete') {
+    clearInterval(readyStateCheckInterval);
+    searchAnimations();
+  }
 }
 
 function getQueryVariable(variable) {
-    var vars = queryString.split('&');
-    for (var i = 0; i < vars.length; i++) {
-        var pair = vars[i].split('=');
-        if (decodeURIComponent(pair[0]) == variable) {
-            return decodeURIComponent(pair[1]);
-        }
+  var vars = queryString.split('&');
+  for (var i = 0; i < vars.length; i += 1) {
+    var pair = vars[i].split('=');
+    if (decodeURIComponent(pair[0]) == variable) { // eslint-disable-line eqeqeq
+      return decodeURIComponent(pair[1]);
     }
+  }
+  return null;
 }
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
+var queryString;
 if (standalone) {
-    var scripts = document.getElementsByTagName('script');
-    var index = scripts.length - 1;
-    var myScript = scripts[index] || {
-        src: ''
-    };
-    var queryString = myScript.src.replace(/^[^\?]+\??/, '');
-    renderer = getQueryVariable('renderer');
+  var scripts = document.getElementsByTagName('script');
+  var index = scripts.length - 1;
+  var myScript = scripts[index] || {
+    src: '',
+  };
+  queryString = myScript.src.replace(/^[^\?]+\??/, ''); // eslint-disable-line no-useless-escape
+  renderer = getQueryVariable('renderer');
 }
 var readyStateCheckInterval = setInterval(checkReady, 100);
 
diff --git a/build/player/lottie_canvas.min.js b/build/player/lottie_canvas.min.js
index 58170f7..036fc30 100644
--- a/build/player/lottie_canvas.min.js
+++ b/build/player/lottie_canvas.min.js
@@ -10,6 +10,6 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e,this.currentTime=currentTime}roundValues(!1);var createElementID=(G=0,function(){return"__lottie_element_"+ ++G}),G;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,p,l;switch(h=r*(1-e),p=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),l=r*(1-(1-o)*e),n%6){case 0:i=r,s=l,a=h;break;case 1:i=p,s=r,a=h;break;case 2:i=h,s=r,a=l;break;case 3:i=h,s=p,a=r;break;case 4:i=l,s=h,a=r;break;case 5:i=r,s=h,a=p}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1==e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i++)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s};function createSizedArray(t){return Array.apply(null,{length:t})}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Oa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Oa[t]||""}),Oa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function p(t,e){return this._t(1,e,t,1,0,0)}function l(t,e){return this.shear(n(t),n(e))}function m(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function f(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,p,l,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=p,this.props[10]=l,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function u(t,e,r,i,s,a,n,o,h,p,l,m,f,c,d,u){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===p&&1===l&&0===m)return y[12]=y[12]*t+y[15]*f,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*l+y[15]*d,y[15]=y[15]*u,this._identityCalculated=!1,this;var g=y[0],v=y[1],P=y[2],b=y[3],x=y[4],_=y[5],S=y[6],T=y[7],C=y[8],E=y[9],A=y[10],k=y[11],D=y[12],I=y[13],M=y[14],F=y[15];return y[0]=g*t+v*s+P*h+b*f,y[1]=g*e+v*a+P*p+b*c,y[2]=g*r+v*n+P*l+b*d,y[3]=g*i+v*o+P*m+b*u,y[4]=x*t+_*s+S*h+T*f,y[5]=x*e+_*a+S*p+T*c,y[6]=x*r+_*n+S*l+T*d,y[7]=x*i+_*o+S*m+T*u,y[8]=C*t+E*s+A*h+k*f,y[9]=C*e+E*a+A*p+k*c,y[10]=C*r+E*n+A*l+k*d,y[11]=C*i+E*o+A*m+k*u,y[12]=D*t+I*s+M*h+F*f,y[13]=D*e+I*a+M*p+F*c,y[14]=D*r+I*n+M*l+F*d,y[15]=D*i+I*o+M*m+F*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function P(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function b(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function x(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function _(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function S(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function T(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function C(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function E(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=C(t[e]);return i}function A(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],p=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+p,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+p,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+p}return i}function k(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function D(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function I(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function M(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function F(){var t=this.props;return"matrix("+M(t[0])+","+M(t[1])+","+M(t[4])+","+M(t[5])+","+M(t[12])+","+M(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=l,this.skewFromAxis=m,this.shear=p,this.scale=f,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=b,this.applyToX=x,this.applyToY=_,this.applyToZ=S,this.applyToPointArray=k,this.applyToTriplePoints=A,this.applyToPointStringified=D,this.toCSS=I,this.to2dCSS=F,this.clone=v,this.cloneFromProps=P,this.equals=g,this.inversePoints=E,this.inversePoint=C,this.getInverseMatrix=T,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var p,l=this,m=256,f=6,c="random",d=h.pow(m,f),u=h.pow(2,52),y=2*u,g=m-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<m;)a[i]=i++;for(i=0;i<m;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*m+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function P(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function b(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=b(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,x(o)]:null===t?function(){try{if(p)return x(p.randomBytes(m));var t=new Uint8Array(m);return(l.crypto||l.msCrypto).getRandomValues(t),x(t)}catch(t){var e=l.navigator,r=e&&e.plugins;return[+new Date,l,r,l.screen,x(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(f),e=d,r=0;t<u;)t=(t+r)*m,e*=m,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,b(x(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&P(i,a),t.state=function(){return P(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},b(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var p=11,l=1/(p-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function m(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function f(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(p):new Array(p),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:m(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<p;++r)this._mSampleValues[r]=m(r*l,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=p-1;a!==n&&i[a]<=t;++a)s+=l;var o=s+(t-i[--a])/(i[a+1]-i[a])*l,h=f(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=f(e,r,i);if(0===a)return e;e-=(m(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=m(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+l,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)i.hasOwnProperty(a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var l=function(t,e,r,i){var s,a,n,o,h,p,l=defaultCurveSegments,m=0,f=[],c=[],d=bezier_length_pool.newElement();for(n=r.length,s=0;s<l;s+=1){for(h=s/(l-1),a=p=0;a<n;a+=1)o=bm_pow(1-h,3)*t[a]+3*bm_pow(1-h,2)*h*r[a]+3*(1-h)*bm_pow(h,2)*i[a]+bm_pow(h,3)*e[a],f[a]=o,null!==c[a]&&(p+=bm_pow(f[a]-c[a],2)),c[a]=f[a];p&&(m+=p=bm_sqrt(p)),d.percents[s]=h,d.lengths[s]=m}return d.addedLength=m,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var P,t=(P={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!P[s]){var a,n,o,h,p,l,m,f=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(f=2);var u=new g(f);for(o=r.length,a=0;a<f;a+=1){for(m=createSizedArray(o),p=a/(f-1),n=l=0;n<o;n+=1)h=bm_pow(1-p,3)*t[n]+3*bm_pow(1-p,2)*p*(t[n]+r[n])+3*(1-p)*bm_pow(p,2)*(e[n]+i[n])+bm_pow(p,3)*e[n],m[n]=h,null!==d&&(l+=bm_pow(m[n]-d[n],2));c+=l=bm_sqrt(l),u.points[a]=new v(l,m),d=m}u.segmentLength=c,P[s]=u}return P[s]});function D(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bm_floor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,p=!0;p;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),p=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];p=!1}return r[a]+(r[a+1]-r[a])*o}var I=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segments_length_pool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,p=0;for(e=0;e<o-1;e+=1)h[e]=l(s[e],s[e+1],a[e],n[e+1]),p+=h[e].addedLength;return i&&o&&(h[e]=l(s[e],s[0],a[e],n[0]),p+=h[e].addedLength),r.totalLength=p,r},getNewSegment:function(t,e,r,i,s,a,n){var o,h=D(s=s<0?0:1<s?1:s,n),p=D(a=1<a?1:a,n),l=t.length,m=1-h,f=1-p,c=m*m*m,d=h*m*m*3,u=h*h*m*3,y=h*h*h,g=m*m*f,v=h*m*f+m*h*f+m*m*p,P=h*h*f+m*h*p+h*m*p,b=h*h*p,x=m*f*f,_=h*f*f+m*p*f+m*f*p,S=h*p*f+m*p*p+h*f*p,T=h*p*p,C=f*f*f,E=p*f*f+f*p*f+f*f*p,A=p*p*f+f*p*p+p*f*p,k=p*p*p;for(o=0;o<l;o+=1)I[4*o]=Math.round(1e3*(c*t[o]+d*r[o]+u*i[o]+y*e[o]))/1e3,I[4*o+1]=Math.round(1e3*(g*t[o]+v*r[o]+P*i[o]+b*e[o]))/1e3,I[4*o+2]=Math.round(1e3*(x*t[o]+_*r[o]+S*i[o]+T*e[o]))/1e3,I[4*o+3]=Math.round(1e3*(C*t[o]+E*r[o]+A*i[o]+k*e[o]))/1e3;return I},getPointInSegment:function(t,e,r,i,s,a){var n=D(s,a),o=1-n;return[Math.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var p,l=Math.sqrt(Math.pow(i-t,2)+Math.pow(s-e,2)+Math.pow(a-r,2)),m=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-r,2)),f=Math.sqrt(Math.pow(n-i,2)+Math.pow(o-s,2)+Math.pow(h-a,2));return-1e-4<(p=m<l?f<l?l-m-f:f-m-l:m<f?f-m-l:m-l-f)&&p<1e-4}}}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var r=(new Date).getTime(),i=Math.max(0,16-(r-a)),s=setTimeout(function(){t(r+i)},i);return a=r+i,s}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function m(t,e,r){var i,s,a,n,o,h,p=t.length;for(s=0;s<p;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),[],-1,i.hasMask){var l=i.masksProperties;for(n=l.length,a=0;a<n;a+=1)if(l[a].pt.k.i)d(l[a].pt.k);else for(h=l[a].pt.k.length,o=0;o<h;o+=1)l[a].pt.k[o].s&&d(l[a].pt.k[o].s[0]),l[a].pt.k[o].e&&d(l[a].pt.k[o].e[0])}0===i.ty?(i.layers=f(i.refId,e),m(i.layers,e,r)):4===i.ty?c(i.shapes):5==i.ty&&u(i,r)}}function f(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)d(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&d(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&d(t[e].ks.k[r].e[0]);!0}else"gr"==t[e].ty&&c(t[e].it)}function d(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&void 0))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(d(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function p(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);!0}else"gr"==t[e].ty&&p(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&p(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t,e){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=m,t}var dataManager=dataFunctionManager(),FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function u(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=function(t){var e,r=t.split(","),i=r.length,s=[];for(e=0;e<i;e+=1)"sans-serif"!==r[e]&&"monospace"!==r[e]&&s.push(r[e]);return s.join(",")}(t)+", "+e,{node:i,w:s,parent:r}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){this.chars||(this.chars=[]);var e,r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i,s,a,n=t.list,o=n.length,h=o;for(r=0;r<o;r+=1){var p,l,m=!0;if(n[r].loaded=!1,n[r].monoCase=u(n[r].fFamily,"monospace"),n[r].sansCase=u(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){if(0<(p=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[r].fFamily+'"], style[f-origin="3"][f-family="'+n[r].fFamily+'"]')).length&&(m=!1),m){var f=createTag("style");f.setAttribute("f-forigin",n[r].fOrigin),f.setAttribute("f-origin",n[r].origin),f.setAttribute("f-family",n[r].fFamily),f.type="text/css",f.innerText="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",e.appendChild(f)}}else if("g"===n[r].fOrigin||1===n[r].origin){for(p=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),l=0;l<p.length;l++)-1!==p[l].href.indexOf(n[r].fPath)&&(m=!1);if(m){var c=createTag("link");c.setAttribute("f-forigin",n[r].fOrigin),c.setAttribute("f-origin",n[r].origin),c.type="text/css",c.rel="stylesheet",c.href=n[r].fPath,document.body.appendChild(c)}}else if("t"===n[r].fOrigin||2===n[r].origin){for(p=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),l=0;l<p.length;l++)n[r].fPath===p[l].src&&(m=!1);if(m){var d=createTag("link");d.setAttribute("f-forigin",n[r].fOrigin),d.setAttribute("f-origin",n[r].origin),d.setAttribute("rel","stylesheet"),d.setAttribute("href",n[r].fPath),e.appendChild(d)}}}else n[r].loaded=!0,h-=1;n[r].helper=(i=e,s=n[r],a=void 0,(a=createNS("text")).style.fontSize="100px",a.setAttribute("font-family",s.fFamily),a.setAttribute("font-style",s.fStyle),a.setAttribute("font-weight",s.fWeight),a.textContent="1",s.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",s.fClass)):a.style.fontFamily=s.fFamily,i.appendChild(a),createTag("canvas").getContext("2d").font=s.fWeight+" "+s.fStyle+" 100px "+s.fFamily,a),n[r].cache={},this.fonts.push(n[r])}0===h?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,r)),a},getFontByName:function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},checkLoadedFonts:function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),PropertyFactory=function(){var m=initialDefaultFrame,s=Math.abs;function f(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,p,l,m,f=e.lastIndex,c=f,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>t){f=c;break}c<d-1?c+=1:(f=0,u=!1)}var y,g,v,P,b,x,_,S,T,C,E=a.t-i,A=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var k=s.bezierData;if(E<=t||t<A){var D=E<=t?k.points.length-1:0;for(o=k.points[D].point.length,n=0;n<o;n+=1)r[n]=k.points[D].point[n]}else{s.__fnct?m=s.__fnct:(m=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=m),h=m((t-A)/(E-A));var I,M=k.segmentLength*h,F=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(l=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,p=k.points.length;u;){if(F+=k.points[l].partialLength,0===M||0===h||l===k.points.length-1){for(o=k.points[l].point.length,n=0;n<o;n+=1)r[n]=k.points[l].point[n];break}if(F<=M&&M<F+k.points[l+1].partialLength){for(I=(M-F)/k.points[l+1].partialLength,o=k.points[l].point.length,n=0;n<o;n+=1)r[n]=k.points[l].point[n]+(k.points[l+1].point[n]-k.points[l].point[n])*I;break}l<p-1?l+=1:u=!1}e._lastPoint=l,e._lastAddedLength=F-k.points[l].partialLength,e._lastKeyframeIndex=c}}else{var w,V,R,L,B;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(E<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=A)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var O=G(s.s),z=G(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],p=t[0],l=t[1],m=t[2],f=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=p*c+l*d+m*u+f*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*p+o*c,h[1]=n*l+o*d,h[2]=n*m+o*u,h[3]=n*f+o*y,h}(O,z,(t-A)/(E-A)),P=v[0],b=v[1],x=v[2],_=v[3],S=Math.atan2(2*b*_-2*P*x,1-2*b*b-2*x*x),T=Math.asin(2*P*b+2*x*_),C=Math.atan2(2*P*_-2*b*x,1-2*P*P-2*x*x),g[0]=S/degToRads,g[1]=T/degToRads,g[2]=C/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=E<=t?1:t<A?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?m=s.__fnct[c]:(w=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],V=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],R=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],L=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],m=BezierFactory.getBezierEasing(w,V,R,L).get,s.__fnct[c]=m)):s.__fnct?m=s.__fnct:(w=s.o.x,V=s.o.y,R=s.i.x,L=s.i.y,m=BezierFactory.getBezierEasing(w,V,R,L).get,s.__fnct=m),m((t-A)/(E-A)))),y=a.s||s.e,B=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=B:r=B}return e.lastIndex=f,r}function G(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),p=Math.sin(i/2);return[o*h*n+s*a*p,o*a*n+s*h*p,s*h*n-o*a*p,s*a*n-o*h*p]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==m&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,r,i){this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,a=e.k.length;this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a);createTypedArray("float32",a);for(this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:m,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=m,this.pv=m,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.effectsSequence=[c.bind(this)],this.addEffect=y}function p(t,e,r,i){this.propType="multidimensional";var s,a,n,o,h,p=e.k.length;for(s=0;s<p-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.frameId=-1;var l=e.k[0].s.length;for(this.v=createTypedArray("float32",l),this.pv=createTypedArray("float32",l),s=0;s<l;s+=1)this.v[s]=m,this.pv[s]=m;this._caching={lastFrame:m,lastIndex:0,value:createTypedArray("float32",l)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new p(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,r,i=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)r=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],r=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(e[0]=s.getValueAtTime((s.keyframes[0].t+.01)/i,0),e[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=s.getValueAtTime(s.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(e[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/i,0),e[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(e=[s.pv,a.pv],r[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/i,s.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else e=r=n;this.v.rotate(-Math.atan2(e[1]-r[1],e[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=point_pool.newElement(),this.o[r]=point_pool.newElement(),this.i[r]=point_pool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}(!a[i]||a[i]&&!s)&&(a[i]=point_pool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,p,l,m,f=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,f=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(f=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)l=1;else if(t<d.t-this.offsetTime)l=0;else{var P;d.__fnct?P=d.__fnct:(P=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=P),l=P((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}i=d.s[0]}for(h=e._length,p=i.i[0].length,r.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<p;o+=1)m=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*l,e.i[n][o]=m,m=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*l,e.o[n][o]=m,m=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*l,e.v[n][o]=m}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shape_pool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,r=this.effectsSequence.length;for(t=0;t<r;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shape_pool.clone(i),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=shape_pool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,p=this.os.v,l=this.is.v,m=2*Math.PI*o/(2*s),f=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?p:l,i=n?m:f;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*i*r*d,y-v*i*r*d,u+g*i*r*d,y+v*i*r*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),p=i*Math.sin(n),l=0===h&&0===p?0:p/Math.sqrt(h*h+p*p),m=0===h&&0===p?0:-h/Math.sqrt(h*h+p*p);h+=+this.p.v[0],p+=+this.p.v[1],this.v.setTripleAt(h,p,h-l*a*s*o,p-m*a*s*o,h+l*a*s*o,p+m*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bm_min(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var m={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new l(t,e):6===r?i=new h(t,e):7===r&&(i=new p(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return m}(),ShapeModifiers=(es={},fs={},es.registerModifier=function(t,e){fs[t]||(fs[t]=e)},es.getModifier=function(t,e,r){return new fs[t](e,r)},es),es,fs;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var s,a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollection_pool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],p=a.length;for(n=0;n<p;n+=1){var l,m;if((o=a[n]).e*s<i||o.s*s>i+r);else l=o.s*s<=i?0:(o.s*s-i)/r,m=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([l,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segments_length_pool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i;if(this._mdf||t){var s=this.o.v%360/360;if(s<0&&(s+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+s,(r=(1<this.e.v?1:this.e.v<0?0:this.e.v)+s)<e){var a=e;e=r,r=a}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var n,o,h,p,l,m,f=this.shapes.length,c=0;if(r===e)for(n=0;n<f;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(n=0;n<f;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var d,u,y=[];for(n=0;n<f;n+=1)if((d=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=d.shape.paths)._length,m=0,!d.shape._mdf&&d.pathsData.length)m=d.totalShapeLength;else{for(p=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)l=bez.getSegmentsLength(i.shapes[o]),p.push(l),m+=l.totalLength;d.totalShapeLength=m,d.pathsData=p}c+=m,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,P=r,b=0;for(n=f-1;0<=n;n-=1)if((d=this.shapes[n]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<f?(g=this.calculateShapeEdges(e,r,d.totalShapeLength,b,c),b+=d.totalShapeLength):g=[[v,P]],h=g.length,o=0;o<h;o+=1){v=g[o][0],P=g[o][1],y.length=0,P<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*P}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(P-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(P-1)}));var x=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var _=x.pop();this.addPaths(x,u),x=this.addShapes(d,y[1],_)}else this.addPaths(x,u),x=this.addShapes(d,y[1]);this.addPaths(x,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,p,l,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(l=r?(o=r._length,r._length):(r=shape_pool.newElement(),o=0),u.push(r),i=0;i<c;i+=1){for(h=m[i].lengths,r.c=f[i].c,a=f[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,r.c=!1;else{if(d>e.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[s],f[i].v[s],r,o,y),y=!1):(p=bez.getNewSegment(f[i].v[s-1],f[i].v[s],f[i].o[s-1],f[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[i].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[0],f[i].v[0],r,o,y),y=!1):(p=bez.getNewSegment(f[i].v[s-1],f[i].v[0],f[i].o[s-1],f[i].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[l][0],r.v[l][1],"i",l),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;i<c-1&&(r=shape_pool.newElement(),y=!0,u.push(r),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r=shape_pool.newElement();r.c=t.c;var i,s,a,n,o,h,p,l,m,f,c,d,u,y=t._length,g=0;for(i=0;i<y;i+=1)s=t.v[i],n=t.o[i],a=t.i[i],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==i&&i!==y-1||t.c?(o=0===i?t.v[y-1]:t.v[i-1],p=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,l=d=s[0]+(o[0]-s[0])*p,m=u=s[1]-(s[1]-o[1])*p,f=l-(l-s[0])*roundCorner,c=m-(m-s[1])*roundCorner,r.setTripleAt(l,m,f,c,d,u,g),g+=1,o=i===y-1?t.v[0]:t.v[i+1],p=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,l=f=s[0]+(o[0]-s[0])*p,m=c=s[1]+(o[1]-s[1])*p,d=l-(l-s[0])*roundCorner,u=m-(m-s[1])*roundCorner,r.setTripleAt(l,m,f,c,d,u,g)):r.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):r.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],g),g+=1;return r},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if((a=this.shapes[r]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var r=e/100,i=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)i[0]+=t.v[a][0],i[1]+=t.v[a][1];i[0]/=s,i[1]/=s;var n,o,h,p,l,m,f=shape_pool.newElement();for(f.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(i[0]-t.v[a][0])*r,o=t.v[a][1]+(i[1]-t.v[a][1])*r,h=t.o[a][0]+(i[0]-t.o[a][0])*-r,p=t.o[a][1]+(i[1]-t.o[a][1])*-r,l=t.i[a][0]+(i[0]-t.i[a][0])*-r,m=t.i[a][1]+(i[1]-t.i[a][1])*-r,f.setTripleAt(n,o,h,p,l,m,a);return f},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(r=0;r<o;r+=1){if((a=this.shapes[r]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);for(;0<r;)r-=1,this._elements.unshift(e[r]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var p=this.o.v,l=p%1,m=0<p?Math.floor(p):Math.ceil(p),f=(this.tr.v.props,this.pMatrix.props),c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<p){for(;g<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,l,!1),g+=l)}else if(p<0){for(;m<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-l,!0),g-=l)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),u=0;u<y;u+=1)r[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)r[u]=this.matrix.props[u];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shape_pool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(t){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,r){var i="";if(t.e)i=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),i=e+s}else i=r,i+=t.u?t.u:"",i+=t.p;return i}function t(t){this._imageLoaded=e.bind(this),this.testImageLoaded=function(t){var e=0,r=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(r)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return t.prototype={loadAssets:function(t,e){this.imagesLoadedCb=e;var r,i=t.length;for(r=0;r<i;r+=1)t[r].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[r])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,r=this.images.length;e<r;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}},createImgData:function(t){var e=a(t,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.src=e;var i={img:r,assetData:t};return i},createImageData:function(t){var e=a(t,this.assetsPath,this.path),r=createNS("image");isSafari?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(r);var i={img:r,assetData:t};return i},imageLoaded:e,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},t}(),featureSupport=(zx={maskType:!0},(/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))&&(zx.maskType=!1),zx),zx,filtersFactory=(Ax={},Ax.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},Ax.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},Ax),Ax,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}();function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,p,l,m,f,c,d,u,y,g,v,P,b,x=this._moreOptions.alignment.v,_=this._animatorsData,S=this._textData,T=this.mHelper,C=this._renderType,E=this.renderedLetters.length,A=(this.data,t.l);if(this._hasMaskedPath){if(b=this._pathData.m,!this._pathData.n||this._pathData._mdf){var k,D=b.v;for(this._pathData.r&&(D=D.reverse()),n={tLength:0,segments:[]},a=D._length-1,s=g=0;s<a;s+=1)k=bez.buildBezierData(D.v[s],D.v[s+1],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[s+1][0]-D.v[s+1][0],D.i[s+1][1]-D.v[s+1][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength;s=a,b.v.c&&(k=bez.buildBezierData(D.v[s],D.v[0],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[0][0]-D.v[0][0],D.i[0][1]-D.v[0][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,m=1,l=!(p=f=0),u=n.segments,o<0&&b.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),m=(d=u[f=u.length-1].points).length-1;o<0;)o+=d[m].partialLength,(m-=1)<0&&(m=(d=u[f-=1].points).length-1);c=(d=u[f].points)[m-1],y=(h=d[m]).partialLength}a=A.length,i=r=0;var I,M,F,w,V=1.2*t.finalSize*.714,R=!0;F=_.length;var L,B,O,z,G,N,j,q,H,W,Y,X,$,K=-1,J=o,Z=f,U=m,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(A[s].n){for(rt&&(rt+=it);at<s;)A[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(M=0;M<F;M+=1)(I=_[M].a).t.propType&&(nt&&2===t.j&&(it+=I.t.v*st),(L=_[M].s.getMult(A[s].anIndexes[M],S.a[M].s.totalChars)).length?rt+=I.t.v*L[0]*st:rt+=I.t.v*L*st);nt=!1}for(rt&&(rt+=it);at<s;)A[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(T.reset(),G=1,A[s].n)r=0,i+=t.yOffset,i+=R?1:0,o=J,R=!1,0,this._hasMaskedPath&&(m=U,c=(d=u[f=Z].points)[m-1],y=(h=d[m]).partialLength,p=0),$=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==A[s].line){switch(t.j){case 1:o+=g-t.lineWidths[A[s].line];break;case 2:o+=(g-t.lineWidths[A[s].line])/2}Q=A[s].line}K!==A[s].ind&&(A[K]&&(o+=A[K].extra),o+=A[s].an/2,K=A[s].ind),o+=x[0]*A[s].an/200;var ot=0;for(M=0;M<F;M+=1)(I=_[M].a).p.propType&&((L=_[M].s.getMult(A[s].anIndexes[M],S.a[M].s.totalChars)).length?ot+=I.p.v[0]*L[0]:ot+=I.p.v[0]*L),I.a.propType&&((L=_[M].s.getMult(A[s].anIndexes[M],S.a[M].s.totalChars)).length?ot+=I.a.v[0]*L[0]:ot+=I.a.v[0]*L);for(l=!0;l;)o+ot<=p+y||!d?(v=(o+ot-p)/h.partialLength,O=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,T.translate(-x[0]*A[s].an/200,-x[1]*V/100),l=!1):d&&(p+=h.partialLength,(m+=1)>=d.length&&(m=0,d=u[f+=1]?u[f].points:b.v.c?u[f=m=0].points:(p-=h.partialLength,null)),d&&(c=h,y=(h=d[m]).partialLength));B=A[s].an/2-A[s].add,T.translate(-B,0,0)}else B=A[s].an/2-A[s].add,T.translate(-B,0,0),T.translate(-x[0]*A[s].an/200,-x[1]*V/100,0);for(A[s].l/2,M=0;M<F;M+=1)(I=_[M].a).t.propType&&(L=_[M].s.getMult(A[s].anIndexes[M],S.a[M].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?L.length?o+=I.t.v*L[0]:o+=I.t.v*L:L.length?r+=I.t.v*L[0]:r+=I.t.v*L));for(A[s].l/2,t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(N=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(q=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<F;M+=1)(I=_[M].a).a.propType&&((L=_[M].s.getMult(A[s].anIndexes[M],S.a[M].s.totalChars)).length?T.translate(-I.a.v[0]*L[0],-I.a.v[1]*L[1],I.a.v[2]*L[2]):T.translate(-I.a.v[0]*L,-I.a.v[1]*L,I.a.v[2]*L));for(M=0;M<F;M+=1)(I=_[M].a).s.propType&&((L=_[M].s.getMult(A[s].anIndexes[M],S.a[M].s.totalChars)).length?T.scale(1+(I.s.v[0]-1)*L[0],1+(I.s.v[1]-1)*L[1],1):T.scale(1+(I.s.v[0]-1)*L,1+(I.s.v[1]-1)*L,1));for(M=0;M<F;M+=1){if(I=_[M].a,L=_[M].s.getMult(A[s].anIndexes[M],S.a[M].s.totalChars),I.sk.propType&&(L.length?T.skewFromAxis(-I.sk.v*L[0],I.sa.v*L[1]):T.skewFromAxis(-I.sk.v*L,I.sa.v*L)),I.r.propType&&(L.length?T.rotateZ(-I.r.v*L[2]):T.rotateZ(-I.r.v*L)),I.ry.propType&&(L.length?T.rotateY(I.ry.v*L[1]):T.rotateY(I.ry.v*L)),I.rx.propType&&(L.length?T.rotateX(I.rx.v*L[0]):T.rotateX(I.rx.v*L)),I.o.propType&&(L.length?G+=(I.o.v*L[0]-G)*L[0]:G+=(I.o.v*L-G)*L),t.strokeWidthAnim&&I.sw.propType&&(L.length?j+=I.sw.v*L[0]:j+=I.sw.v*L),t.strokeColorAnim&&I.sc.propType)for(H=0;H<3;H+=1)L.length?N[H]=N[H]+(I.sc.v[H]-N[H])*L[0]:N[H]=N[H]+(I.sc.v[H]-N[H])*L;if(t.fillColorAnim&&t.fc){if(I.fc.propType)for(H=0;H<3;H+=1)L.length?q[H]=q[H]+(I.fc.v[H]-q[H])*L[0]:q[H]=q[H]+(I.fc.v[H]-q[H])*L;I.fh.propType&&(q=L.length?addHueToRGB(q,I.fh.v*L[0]):addHueToRGB(q,I.fh.v*L)),I.fs.propType&&(q=L.length?addSaturationToRGB(q,I.fs.v*L[0]):addSaturationToRGB(q,I.fs.v*L)),I.fb.propType&&(q=L.length?addBrightnessToRGB(q,I.fb.v*L[0]):addBrightnessToRGB(q,I.fb.v*L))}}for(M=0;M<F;M+=1)(I=_[M].a).p.propType&&(L=_[M].s.getMult(A[s].anIndexes[M],S.a[M].s.totalChars),this._hasMaskedPath?L.length?T.translate(0,I.p.v[1]*L[0],-I.p.v[2]*L[1]):T.translate(0,I.p.v[1]*L,-I.p.v[2]*L):L.length?T.translate(I.p.v[0]*L[0],I.p.v[1]*L[1],-I.p.v[2]*L[2]):T.translate(I.p.v[0]*L,I.p.v[1]*L,-I.p.v[2]*L));if(t.strokeWidthAnim&&(W=j<0?0:j),t.strokeColorAnim&&(Y="rgb("+Math.round(255*N[0])+","+Math.round(255*N[1])+","+Math.round(255*N[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(T.translate(0,-t.ls),T.translate(0,x[1]*V/100+i,0),S.p.p){P=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(P)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),T.rotate(-ht*Math.PI/180)}T.translate(O,z,0),o-=x[0]*A[s].an/200,A[s+1]&&K!==A[s+1].ind&&(o+=A[s].an/2,o+=t.tr/1e3*t.finalSize)}else{switch(T.translate(r,i,0),t.ps&&T.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:T.translate(A[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[A[s].line]),0,0);break;case 2:T.translate(A[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[A[s].line])/2,0,0)}T.translate(0,-t.ls),T.translate(B,0,0),T.translate(x[0]*A[s].an/200,x[1]*V/100,0),r+=A[s].l+t.tr/1e3*t.finalSize}"html"===C?tt=T.toCSS():"svg"===C?tt=T.to2dCSS():et=[T.props[0],T.props[1],T.props[2],T.props[3],T.props[4],T.props[5],T.props[6],T.props[7],T.props[8],T.props[9],T.props[10],T.props[11],T.props[12],T.props[13],T.props[14],T.props[15]],$=G}this.lettersChangedFlag=E<=s?(w=new LetterProps($,W,Y,X,tt,et),this.renderedLetters.push(w),E+=1,!0):(w=this.renderedLetters[s]).update($,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var i,s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&(t[r].s,!(r===i-1||t[r+1].t>e));)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),++s):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,p=this.data,l=[],m=0,f=p.m.g,c=0,d=0,u=0,y=[],g=0,v=0,P=h.getFontByName(t.f),b=0,x=P.fStyle?P.fStyle.split(" "):[],_="normal",S="normal";for(r=x.length,e=0;e<r;e+=1)switch(x[e].toLowerCase()){case"italic":S="italic";break;case"bold":_="700";break;case"black":_="900";break;case"medium":_="500";break;case"regular":case"normal":_="400";break;case"light":case"thin":_="200"}t.fWeight=P.fWeight||_,t.fStyle=S,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var T,C=t.tr/1e3*t.finalSize;if(t.sz)for(var E,A,k=!0,D=t.sz[0],I=t.sz[1];k;){g=E=0,r=(A=this.buildFinalText(t.t)).length,C=t.tr/1e3*t.finalSize;var M=-1;for(e=0;e<r;e+=1)T=A[e].charCodeAt(0),i=!1," "===A[e]?M=e:13!==T&&3!==T||(i=!(g=0),E+=t.finalLineHeight||1.2*t.finalSize),D<g+(b=h.chars?(o=h.getCharData(A[e],P.fStyle,P.fFamily),i?0:o.w*t.finalSize/100):h.measureText(A[e],t.f,t.finalSize))&&" "!==A[e]?(-1===M?r+=1:e=M,E+=t.finalLineHeight||1.2*t.finalSize,A.splice(e,M===e?1:0,"\r"),M=-1,g=0):(g+=b,g+=C);E+=P.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&I<E?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=A,r=t.finalText.length,k=!1)}g=-C;var F,w=b=0;for(e=0;e<r;e+=1)if(i=!1,13===(T=(F=t.finalText[e]).charCodeAt(0))||3===T?(w=0,y.push(g),v=v<g?g:v,g=-2*C,i=!(s=""),u+=1):s=F,b=h.chars?(o=h.getCharData(F,P.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===F?w+=b+C:(g+=b+C+w,w=0),l.push({l:b,an:b,add:c,n:i,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==f){if(c+=b,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=b);d<=e;)l[d].an=c,l[d].ind=m,l[d].extra=b,d+=1;m+=1,c=0}}else if(3==f){if(c+=b,""===s||e===r-1){for(""===s&&(c-=b);d<=e;)l[d].an=c,l[d].ind=m,l[d].extra=b,d+=1;c=0,m+=1}}else l[m].ind=m,l[m].extra=0,m+=1;if(t.l=l,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var V,R,L=p.a;n=L.length;var B,O,z=[];for(a=0;a<n;a+=1){for((V=L[a]).a.sc&&(t.strokeColorAnim=!0),V.a.sw&&(t.strokeWidthAnim=!0),(V.a.fc||V.a.fh||V.a.fs||V.a.fb)&&(t.fillColorAnim=!0),O=0,B=V.s.b,e=0;e<r;e+=1)(R=l[e]).anIndexes[a]=O,(1==B&&""!==R.val||2==B&&""!==R.val&&" "!==R.val||3==B&&(R.n||" "==R.val||e==r-1)||4==B&&(R.n||e==r-1))&&(1===V.s.rn&&z.push(O),O+=1);p.a[a].s.totalChars=O;var G,N=-1;if(1===V.s.rn)for(e=0;e<r;e+=1)N!=(R=l[e]).anIndexes[a]&&(N=R.anIndexes[a],G=z.splice(Math.floor(Math.random()*z.length),1)[0]),R.anIndexes[a]=G}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=P.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,p=this.data.sh;if(2===p)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===p)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===p)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===p){if(h===o)n=0;else{var l=h-o,m=-l/2+(t=d(c(0,t+.5-o),h-o)),f=l/2;n=Math.sqrt(1-m*m/(f*f))}n=a(n)}else n=6===p?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),pool_factory=function(t,e,r,i){var s=0,a=t,n=createSizedArray(a);function o(){return s?n[s-=1]:e()}return{newElement:o,release:function(t){s===a&&(n=pooling.double(n),a*=2),r&&r(t),n[s]=t,s+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},point_pool=pool_factory(8,function(){return createTypedArray("float32",2)}),shape_pool=(RB=pool_factory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)point_pool.release(t.v[e]),point_pool.release(t.i[e]),point_pool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),RB.clone=function(t){var e,r=RB.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},RB),RB,shapeCollection_pool=($B={newShapeCollection:function(){var t;t=_B?bC[_B-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shape_pool.release(t.shapes[e]);t._length=0,_B===aC&&(bC=pooling.double(bC),aC*=2);bC[_B]=t,_B+=1}},_B=0,aC=4,bC=createSizedArray(aC),$B),$B,_B,aC,bC,segments_length_pool=pool_factory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezier_length_pool.release(t.lengths[e]);t.lengths.length=0}),bezier_length_pool=pool_factory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var n,o,h,p,l,m,f,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<a;i++)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!=c[i].mode&&"i"!=c[i].mode||0!==d?p=null:((p=createNS("rect")).setAttribute("fill","#ffffff"),p.setAttribute("width",this.element.comp.data.w||0),p.setAttribute("height",this.element.comp.data.h||0),u.push(p)),n=createNS("path"),"n"!=c[i].mode){var P;if(d+=1,n.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",f=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),P=createElementID(),(l=createNS("filter")).setAttribute("id",P),(m=createNS("feMorphology")).setAttribute("operator","erode"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),l.appendChild(m),s.appendChild(l),n.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):f=m=null,this.storedData[i]={elem:n,x:f,expan:m,lastPath:"",lastOperator:"",filterId:P,lastRadius:0},"i"==c[i].mode){h=u.length;var b=createNS("g");for(o=0;o<h;o+=1)b.appendChild(u[o]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",y+"_"+d),x.appendChild(n),s.appendChild(x),b.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(b)}else u.push(n);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:n,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:p},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:n,lastPath:""},s.appendChild(n);for(this.maskElement=createNS(g),a=u.length,i=0;i<a;i+=1)this.maskElement.appendChild(u[i]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(t,e,r,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var s=4;"rc"==e.ty?s=5:"el"==e.ty?s=6:"sr"==e.ty&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,s,t);var a,n,o=r.length;for(a=0;a<o;a+=1)r[a].closed||(n={transforms:i.addTransformSequence(r[a].transforms),trNodes:[]},this.styledShapes.push(n),r[a].elements.push(n))}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function AudioElement(t,e,r){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,r),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function CVContextData(){this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;var t;for(this.savedOp=createTypedArray("float32",15),t=0;t<15;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=15}function CVBaseElement(){}function CVImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.img=e.imageLoader.getImage(this.assetData),this.initElement(t,e,r)}function CVCompElement(t,e,r){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CVMaskElement(t,e){this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var r,i=this.masksProperties.length,s=!1;for(r=0;r<i;r++)"n"!==this.masksProperties[r].mode&&(s=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);(this.hasMasks=s)&&this.element.addRenderableComponent(this)}function CVShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(t,e,r)}function CVSolidElement(t,e,r){this.initElement(t,e,r)}function CVTextElement(t,e,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,r)}function CVEffects(){}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e--)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t)}return this.createNull(t)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){this.completeLayers=!1;var e,r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id==t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],CanvasRenderer),CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRenderer.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var r=this.contextData.cTr.props;this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},CanvasRenderer.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},CanvasRenderer.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var r,i=this.contextData.saved[this.contextData.cArrPos];for(r=0;r<16;r+=1)i[r]=e[r];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},CanvasRenderer.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,r=this.contextData.saved[this.contextData.cArrPos],i=this.contextData.cTr.props;for(e=0;e<16;e+=1)i[e]=r[e];this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),r=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=r,this.globalData.currentGlobalAlpha!==r&&(this.canvasContext.globalAlpha=r,this.globalData.currentGlobalAlpha=r)}else this.canvasContext.restore()},CanvasRenderer.prototype.configAnimation=function(t){this.animationItem.wrapper?(this.animationItem.container=createTag("canvas"),this.animationItem.container.style.width="100%",this.animationItem.container.style.height="100%",this.animationItem.container.style.transformOrigin=this.animationItem.container.style.mozTransformOrigin=this.animationItem.container.style.webkitTransformOrigin=this.animationItem.container.style["-webkit-transform"]="0px 0px 0px",this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)):this.canvasContext=this.renderConfig.context,this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){var t,e,r,i;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var s=this.renderConfig.preserveAspectRatio.split(" "),a=s[1]||"meet",n=s[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);r=t/e,i=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=r<i&&"meet"===a||i<r&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"==this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;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],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRenderer.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var r,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),r=0;r<i;r++)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(t-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){var r=this.createItem(this.layers[t],this,this.globalData);(e[t]=r).initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r=!0,i=this.comp;r;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):r=!1;var s,a,n=e.length;for(s=0;s<n;s+=1)a=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return"_"+this.transform_key_count++}},CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var p=createNS("rect");p.setAttribute("width",this.comp.data.w),p.setAttribute("height",this.comp.data.h),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("fill","#ffffff"),p.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(p),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(p),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var l=createNS("clipPath"),m=createNS("path");m.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var f=createElementID();if(l.setAttribute("id",f),l.appendChild(m),this.globalData.defs.appendChild(l),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+f+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+f+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,p,l,m,f,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((f=this.searchProcessedElement(t[o]))?e[o]=r[f-1]:t[o]._render=n,"fl"==t[o].ty||"st"==t[o].ty||"gf"==t[o].ty||"gs"==t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"==t[o].ty){if(f)for(p=e[o].it.length,h=0;h<p;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"==t[o].ty?(f||(e[o]=this.createTransformElement(t[o],i)),l=e[o].transform,c.push(l)):"sh"==t[o].ty||"rc"==t[o].ty||"el"==t[o].ty||"sr"==t[o].ty?(f||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"==t[o].ty||"rd"==t[o].ty||"ms"==t[o].ty||"pb"==t[o].ty?(f?(m=e[o]).closed=!1:((m=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=m,this.shapeModifiers.push(m)),y.push(m)):"rp"==t[o].ty&&(f?(m=e[o]).closed=!0:(m=ShapeModifiers.getModifier(t[o].ty),(e[o]=m).init(this,t,o,e),this.shapeModifiers.push(m),n=!1),y.push(m));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var r=0;for(r=this._length;r<t;r+=1)this.saved[r]=createTypedArray("float32",16);this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var t=createTag("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,r,i=t.getContext("2d"),s=this.img.width,a=this.img.height,n=s/a,o=this.assetData.w/this.assetData.h,h=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;o<n&&"xMidYMid slice"===h||n<o&&"xMidYMid slice"!==h?e=(r=a)*o:r=(e=s)/o,i.drawImage(this.img,(s-e)/2,(a-r)/2,e,r,0,0,this.assetData.w,this.assetData.h),this.img=t}},CVImageElement.prototype.renderInnerContent=function(t){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([CanvasRenderer,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,r,i,s=this.element.finalTransform.mat,a=this.element.canvasContext,n=this.masksProperties.length;for(a.beginPath(),t=0;t<n;t++)if("n"!==this.masksProperties[t].mode){this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),i=this.viewData[t].v,e=s.applyToPointArray(i.v[0][0],i.v[0][1],0),a.moveTo(e[0],e[1]);var o,h=i._length;for(o=1;o<h;o++)r=s.applyToTriplePoints(i.o[o-1],i.i[o],i.v[o]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=s.applyToTriplePoints(i.o[o-1],i.i[0],i.v[0]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var r={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"==t.ty||"st"==t.ty?(i.c=PropertyFactory.getProp(this,t.c,1,255,this),i.c.k||(r.co="rgb("+bm_floor(i.c.v[0])+","+bm_floor(i.c.v[1])+","+bm_floor(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=PropertyFactory.getProp(this,t.s,1,null,this),i.e=PropertyFactory.getProp(this,t.e,1,null,this),i.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),i.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),i.g=new GradientProperty(this,t.g,this)),i.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"==t.ty||"gs"==t.ty){if(r.lc=this.lcEnum[t.lc]||"round",r.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(r.ml=t.ml),i.w=PropertyFactory.getProp(this,t.w,0,null,this),i.w.k||(r.wi=i.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);i.d=s,i.d.k||(r.da=i.d.dashArray,r.do=i.d.dashoffset[0])}}else r.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(r),i.style=r,i},CVShapeElement.prototype.createGroupElement=function(t){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(t){var e,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},CVShapeElement.prototype.closeStyles=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].closed=!0},CVShapeElement.prototype.searchShapes=function(t,e,r,i,s){var a,n,o,h,p,l,m=t.length-1,f=[],c=[],d=[].concat(s);for(a=m;0<=a;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=r[h-1]:t[a]._shouldRender=i,"fl"==t[a].ty||"st"==t[a].ty||"gf"==t[a].ty||"gs"==t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),f.push(e[a].style);else if("gr"==t[a].ty){if(h)for(o=e[a].it.length,n=0;n<o;n+=1)e[a].prevViewData[n]=e[a].it[n];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,i,d)}else"tr"==t[a].ty?(h||(l=this.createTransformElement(t[a]),e[a]=l),d.push(e[a]),this.addTransformToStyleList(e[a])):"sh"==t[a].ty||"rc"==t[a].ty||"el"==t[a].ty||"sr"==t[a].ty?h||(e[a]=this.createShapeElement(t[a])):"tm"==t[a].ty||"rd"==t[a].ty||"pb"==t[a].ty?(h?(p=e[a]).closed=!1:((p=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=p,this.shapeModifiers.push(p)),c.push(p)):"rp"==t[a].ty&&(h?(p=e[a]).closed=!0:(p=ShapeModifiers.getModifier(t[a].ty),(e[a]=p).init(this,t,a,e),this.shapeModifiers.push(p),i=!1),c.push(p));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(f),m=c.length,a=0;a<m;a+=1)c[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var t,e,r,i,s,a,n,o,h,p=this.stylesList.length,l=this.globalData.renderer,m=this.globalData.canvasContext;for(t=0;t<p;t+=1)if(("st"!==(o=(h=this.stylesList[t]).type)&&"gs"!==o||0!==h.wi)&&h.data._shouldRender&&0!==h.coOp&&0!==this.globalData.currentGlobalAlpha){for(l.save(),a=h.elements,"st"===o||"gs"===o?(m.strokeStyle="st"===o?h.co:h.grd,m.lineWidth=h.wi,m.lineCap=h.lc,m.lineJoin=h.lj,m.miterLimit=h.ml||0):m.fillStyle="fl"===o?h.co:h.grd,l.ctxOpacity(h.coOp),"st"!==o&&"gs"!==o&&m.beginPath(),l.ctxTransform(h.preTransforms.finalTransform.props),r=a.length,e=0;e<r;e+=1){for("st"!==o&&"gs"!==o||(m.beginPath(),h.da&&(m.setLineDash(h.da),m.lineDashOffset=h.do)),s=(n=a[e].trNodes).length,i=0;i<s;i+=1)"m"==n[i].t?m.moveTo(n[i].p[0],n[i].p[1]):"c"==n[i].t?m.bezierCurveTo(n[i].pts[0],n[i].pts[1],n[i].pts[2],n[i].pts[3],n[i].pts[4],n[i].pts[5]):m.closePath();"st"!==o&&"gs"!==o||(m.stroke(),h.da&&m.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&m.fill(h.r),l.restore()}},CVShapeElement.prototype.renderShape=function(t,e,r,i){var s,a;for(a=t,s=e.length-1;0<=s;s-=1)"tr"==e[s].ty?(a=r[s].transform,this.renderShapeTransform(t,a)):"sh"==e[s].ty||"el"==e[s].ty||"rc"==e[s].ty||"sr"==e[s].ty?this.renderPath(e[s],r[s]):"fl"==e[s].ty?this.renderFill(e[s],r[s],a):"st"==e[s].ty?this.renderStroke(e[s],r[s],a):"gf"==e[s].ty||"gs"==e[s].ty?this.renderGradientFill(e[s],r[s],a):"gr"==e[s].ty?this.renderShape(a,e[s].it,r[s].it):e[s].ty;i&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var r,i,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(s=0;s<o;s+=1){var p=n.shapes[s];if(p&&p.v){for(i=p._length,r=1;r<i;r+=1)1===r&&a.push({t:"m",p:h.applyToPointArray(p.v[0][0],p.v[0][1],0)}),a.push({t:"c",pts:h.applyToTriplePoints(p.o[r-1],p.i[r],p.v[r])});1===i&&a.push({t:"m",p:h.applyToPointArray(p.v[0][0],p.v[0][1],0)}),p.c&&i&&(a.push({t:"c",pts:h.applyToTriplePoints(p.o[r-1],p.i[0],p.v[0])}),a.push({t:"z"}))}}t.trNodes=a}},CVShapeElement.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var r,i=e.styledShapes.length;for(r=0;r<i;r+=1)this.renderStyledShape(e.styledShapes[r],e.sh)}},CVShapeElement.prototype.renderFill=function(t,e,r){var i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(t,e,r){var i=e.style;if(!i.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var s=this.globalData.canvasContext,a=e.s.v,n=e.e.v;if(1===t.t)f=s.createLinearGradient(a[0],a[1],n[0],n[1]);else var o=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)),h=Math.atan2(n[1]-a[1],n[0]-a[0]),p=o*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),l=Math.cos(h+e.a.v)*p+a[0],m=Math.sin(h+e.a.v)*p+a[1],f=s.createRadialGradient(l,m,0,a[0],a[1],o);var c,d=t.g.p,u=e.g.c,y=1;for(c=0;c<d;c+=1)e.g._hasOpacity&&e.g._collapsable&&(y=e.g.o[2*c+1]),f.addColorStop(u[4*c]/100,"rgba("+u[4*c+1]+","+u[4*c+2]+","+u[4*c+3]+","+y+")");i.grd=f}i.coOp=e.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||this._isFirstFrame)&&(i.da=s.dashArray,i.do=s.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity),(e.w._mdf||this._isFirstFrame)&&(i.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var r=!1;t.sc&&(r=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var i,s,a=this.globalData.fontManager.getFontByName(t.f),n=t.l,o=this.mHelper;this.stroke=r,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,s=t.finalText.length;var h,p,l,m,f,c,d,u,y,g,v=this.data.singleShape,P=t.tr/1e3*t.finalSize,b=0,x=0,_=!0,S=0;for(i=0;i<s;i+=1){for(p=(h=this.globalData.fontManager.getCharData(t.finalText[i],a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&h.data||{},o.reset(),v&&n[i].n&&(b=-P,x+=t.yOffset,x+=_?1:0,_=!1),d=(f=p.shapes?p.shapes[0].it:[]).length,o.scale(t.finalSize/100,t.finalSize/100),v&&this.applyTextPropertiesToMatrix(t,o,n[i].line,b,x),y=createSizedArray(d),c=0;c<d;c+=1){for(m=f[c].ks.k.i.length,u=f[c].ks.k,g=[],l=1;l<m;l+=1)1==l&&g.push(o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),g.push(o.applyToX(u.o[l-1][0],u.o[l-1][1],0),o.applyToY(u.o[l-1][0],u.o[l-1][1],0),o.applyToX(u.i[l][0],u.i[l][1],0),o.applyToY(u.i[l][0],u.i[l][1],0),o.applyToX(u.v[l][0],u.v[l][1],0),o.applyToY(u.v[l][0],u.v[l][1],0));g.push(o.applyToX(u.o[l-1][0],u.o[l-1][1],0),o.applyToY(u.o[l-1][0],u.o[l-1][1],0),o.applyToX(u.i[0][0],u.i[0][1],0),o.applyToY(u.i[0][0],u.i[0][1],0),o.applyToX(u.v[0][0],u.v[0][1],0),o.applyToY(u.v[0][0],u.v[0][1],0)),y[c]=g}v&&(b+=n[i].l,b+=P),this.textSpans[S]?this.textSpans[S].elem=y:this.textSpans[S]={elem:y},S+=1}},CVTextElement.prototype.renderInnerContent=function(){var t,e,r,i,s,a,n=this.canvasContext;this.finalTransform.mat.props;n.font=this.values.fValue,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,h=this.textAnimator.renderedLetters,p=this.textProperty.currentData.l;e=p.length;var l,m,f=null,c=null,d=null;for(t=0;t<e;t+=1)if(!p[t].n){if((o=h[t])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(o.p),this.globalData.renderer.ctxOpacity(o.o)),this.fill){for(o&&o.fc?f!==o.fc&&(f=o.fc,n.fillStyle=o.fc):f!==this.values.fill&&(f=this.values.fill,n.fillStyle=this.values.fill),i=(l=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<i;r+=1)for(a=(m=l[r]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(o&&o.sw?d!==o.sw&&(d=o.sw,n.lineWidth=o.sw):d!==this.values.sWidth&&(d=this.values.sWidth,n.lineWidth=this.values.sWidth),o&&o.sc?c!==o.sc&&(c=o.sc,n.strokeStyle=o.sc):c!==this.values.stroke&&(c=this.values.stroke,n.strokeStyle=this.values.stroke),i=(l=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<i;r+=1)for(a=(m=l[r]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}o&&this.globalData.renderer.restore()}},CVEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||m()),e+=1}function p(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem==t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return f(i,t),i.setData(t,e),i}function l(){n+=1,d()}function m(){n-=1}function f(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",l),t.addEventListener("_idle",m),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=p,t.loadAnimation=function(t){var e=new AnimationItem;return f(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),p(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),p(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){var r={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===s||(r.loop="false"!==s&&("true"===s||parseInt(s)));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id==a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!=r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t==this.assets[e].id)return this.assets[e];e+=1}},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(tP={},tP.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},tP),tP;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:void 0}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]=t[0]+e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t)),"string"===i&&(e=parseInt(e)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]=t[0]-e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t)),"string"==typeof e&&(e=parseInt(e)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var r,i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n==o)e=r=0;else{var p=n-o;switch(r=.5<h?p/(2-n-o):p/(n+o),n){case i:e=(s-a)/p+(s<a?6:0);break;case s:e=(a-i)/p+2;break;case a:e=(i-s)/p+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)e=r=i=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*n;var o,h=i.length,p=createTypedArray("float32",h);for(o=0;o<h;o+=1)p[o]=i[o]+(s[o]-i[o])*n;return p}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shape_pool.newElement();n.setPathData(!!i,a);var o,h,p=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:p,h=r&&r[s]?r[s]:p,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,__expression_functions=[],scoped_bm_rt;if(data.xf){var i,len=data.xf.length;for(i=0;i<len;i+=1)__expression_functions[i]=eval("(function(){ return "+data.xf[i]+"}())")}var expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),p=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)p[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return p}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r);var n=t(e=1<e?1:e<0?0:e);if($bm_isInstanceOfArray(s)){var o,h=s.length,p=createTypedArray("float32",h);for(o=0;o<h;o+=1)p[o]=(a[o]-s[o])*n+s[o];return p}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=data.k[t].hasOwnProperty("s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,p=this.keyframes,l=p[p.length-1].t;if(h<=l)return this.pv;if(r?s=l-(i=e?Math.abs(l-elem.comp.globalData.frameRate*e):Math.max(0,l-this.elem.data.ip)):((!e||e>p.length-1)&&(e=p.length-1),i=l-(s=p[p.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(l/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=(f[a]-m[a])*d+c[a];return o}return(f-m)*d+c}if("continue"===t){var u=this.getValueAtTime(l/this.comp.globalData.frameRate,0),y=this.getValueAtTime((l-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-l)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-l)/.001*(u-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,p=this.keyframes,l=p[0].t;if(l<=h)return this.pv;if(r?s=l+(i=e?Math.abs(elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-l)):((!e||e>p.length-1)&&(e=p.length-1),i=(s=p[e].t)-l),"pingpong"===t){if(Math.floor((l-h)/i)%2==0)return this.getValueAtTime(((l-h)%i+l)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(l/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(l-h)%i+l)/this.comp.globalData.frameRate,0),d=Math.floor((l-h)/i)+1;if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(f[a]-m[a])*d;return o}return c-(f-m)*d}if("continue"===t){var u=this.getValueAtTime(l/this.comp.globalData.frameRate,0),y=this.getValueAtTime((l+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(l-h)/.001;return o}return u+(u-y)*(l-h)/.001}}return this.getValueAtTime((i-(l-h)%i+l)/this.comp.globalData.frameRate,0)}function p(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(t);e.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var i=this.s.getValueAtTime(t);e.scale(i[0]*this.s.mult,i[1]*this.s.mult,i[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),p=this.rx.getValueAtTime(t),l=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(p*this.rx.mult).rotateZ(-l[2]*this.or.mult).rotateY(l[1]*this.or.mult).rotateX(l[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var m=this.px.getValueAtTime(t),f=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(m*this.px.mult,f*this.py.mult,-c*this.pz.mult)}else e.translate(m*this.px.mult,f*this.py.mult,0)}else{var d=this.p.getValueAtTime(t);e.translate(d[0]*this.p.mult,d[1]*this.p.mult,-d[2]*this.p.mult)}return e}.bind(i):i.getValueAtTime=function(t){return this.v.clone(new Matrix)}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var l=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=l(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=p,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0));var i,s=r._length,a=r[t],n=r.v,o=createSizedArray(s);for(i=0;i<s;i+=1)o[i]="i"===t||"o"===t?[a[i][0]-n[i][0],a[i][1]-n[i][1]]:[a[i][0],a[i][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,p=0;o<h;){if(p+a[o].addedLength>n){var l=o,m=r.c&&o===h-1?0:o+1,f=(n-p)/a[o].addedLength;i=bez.getPointInSegment(r.v[l],r.v[m],r.o[l],r.i[m],f,a[o]);break}p+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){t=1==t?this.v.c?0:.999:t;var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){if(this.data.d.x)return this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0};var ShapePathInterface=function(t,e,r){var i=e.sh;function s(t){if("Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t)return s.path}var a=propertyGroupFactory(s,r);return i.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:r}}),s},propertyGroupFactory=function(e,r){return function(t){return(t=void 0===t?1:t)<=0?e:r(t-1)}},PropertyInterface=function(t,e){var r={_name:t};return function(t){return(t=void 0===t?1:t)<=0?r:e(--t)}},ShapeExpressionInterface=function(){function n(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"==t[i].ty?s.push(o(t[i],e[i],r)):"fl"==t[i].ty?s.push(h(t[i],e[i],r)):"st"==t[i].ty?s.push(p(t[i],e[i],r)):"tm"==t[i].ty?s.push(l(t[i],e[i],r)):"tr"==t[i].ty||("el"==t[i].ty?s.push(f(t[i],e[i],r)):"sr"==t[i].ty?s.push(c(t[i],e[i],r)):"sh"==t[i].ty?s.push(ShapePathInterface(t[i],e[i],r)):"rc"==t[i].ty?s.push(d(t[i],e[i],r)):"rd"==t[i].ty?s.push(u(t[i],e[i],r)):"rp"==t[i].ty&&s.push(y(t[i],e[i],r)));return s}function o(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,e,r){var i,s=function(t){for(var e=0,r=i.length;e<r;){if(i[e]._name===t||i[e].mn===t||i[e].propertyIndex===t||i[e].ix===t||i[e].ind===t)return i[e];e+=1}if("number"==typeof t)return i[t-1]};s.propertyGroup=propertyGroupFactory(s,r),i=n(t.it,e.it,s.propertyGroup),s.numProperties=i.length;var a=m(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,i.propertyGroup),a=m(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function h(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:void 0}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),i}function p(t,e,r){var i=propertyGroupFactory(p,r),s=propertyGroupFactory(h,i);var a,n,o=t.d?t.d.length:0,h={};for(a=0;a<o;a+=1)n=a,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[a].p.setGroupProperty(s);function p(t){return"Color"===t||"color"===t?p.color:"Opacity"===t||"opacity"===t?p.opacity:"Stroke Width"===t||"stroke width"===t?p.strokeWidth:void 0}return Object.defineProperties(p,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",i)),e.o.setGroupProperty(PropertyInterface("Opacity",i)),e.w.setGroupProperty(PropertyInterface("Stroke Width",i)),p}function l(e,t,r){function i(t){return t===e.e.ix||"End"===t||"end"===t?i.end:t===e.s.ix?i.start:t===e.o.ix?i.offset:void 0}var s=propertyGroupFactory(i,r);return i.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),i.propertyIndex=e.ix,i.propertyGroup=r,Object.defineProperties(i,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),i.mn=e.mn,i}function m(e,t,r){function i(t){return e.a.ix===t||"Anchor Point"===t?i.anchorPoint:e.o.ix===t||"Opacity"===t?i.opacity:e.p.ix===t||"Position"===t?i.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?i.rotation:e.s.ix===t||"Scale"===t?i.scale:e.sk&&e.sk.ix===t||"Skew"===t?i.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?i.skewAxis:void 0}var s=propertyGroupFactory(i,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(i,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),i.ty="tr",i.mn=e.mn,i.propertyGroup=r,i}function f(e,t,r){function i(t){return e.p.ix===t?i.position:e.s.ix===t?i.size:void 0}var s=propertyGroupFactory(i,r);i.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(i,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),i.mn=e.mn,i}function c(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.rotation:e.pt.ix===t?i.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?i.outerRadius:e.os.ix===t?i.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?i.innerRoundness:void 0:i.innerRadius}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),i.mn=e.mn,i}function d(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?i.size:void 0}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),i.mn=e.mn,i}function u(e,t,r){function i(t){if(e.r.ix===t||"Round Corners 1"===t)return i.radius}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(i,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),i.mn=e.mn,i}function y(e,t,r){function i(t){return e.c.ix===t||"Copies"===t?i.copies:e.o.ix===t||"Offset"===t?i.offset:void 0}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(i,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),i.mn=e.mn,i}return function(t,e,i){var s;function r(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,r=s.length;e<r;){if(s[e]._name===t)return s[e];e+=1}}return r.propertyGroup=propertyGroupFactory(r,function(){return i}),s=n(t,e,r.propertyGroup),r.numProperties=s.length,r._name="Contents",r}}(),TextExpressionInterface=function(e){var r;function i(t){switch(t){case"ADBE Text Document":return i.sourceText}}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),i},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var r=this.getMatrix(e);return r.props[12]=r.props[13]=r.props[14]=0,this.applyPoint(r,t)}function n(t,e){var r=this.getMatrix(e);return this.applyPoint(r,t)}function o(t,e){var r=this.getMatrix(e);return r.props[12]=r.props[13]=r.props[14]=0,this.invertPoint(r,t)}function h(t,e){var r=this.getMatrix(e);return this.invertPoint(r,t)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function m(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function f(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect;case"ADBE Text Properties":return i.textInterface}}i.getMatrix=s,i.invertPoint=l,i.applyPoint=p,i.toWorld=n,i.toWorldVec=a,i.fromWorld=h,i.fromWorldVec=o,i.toComp=n,i.fromComp=m,i.sampleImage=f,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity}}if(Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p)var r=ExpressionPropertyInterface(t.p);else{var i,s=ExpressionPropertyInterface(t.px),a=ExpressionPropertyInterface(t.py);t.pz&&(i=ExpressionPropertyInterface(t.pz))}return Object.defineProperty(e,"position",{get:function(){return t.p?r():[s(),a(),i?i():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function p(s,t,e,r){function i(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?o[r]:o[r]();r+=1}throw new Error}var a,n=propertyGroupFactory(i,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(p(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,r)):o.push(l(t.effectElements[a],s.ef[a].ty,r,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(i,"color",{get:function(){return o[0]()}}),Object.defineProperties(i,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),i.active=i.enabled=0!==s.en,i}function l(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",i)),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(p(s[r],t.effectsManager.effectElements[r],e,t));var n=t.data.ef||[],o=function(t){for(r=0,a=n.length;r<a;){if(t===n[r].nm||t===n[r].mn||t===n[r].ix)return i[r];r+=1}};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}}}}(),MaskManagerInterface=function(){function a(t,e){this._mask=t,this._data=e}Object.defineProperty(a.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(a.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e,t){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new a(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(i.numKeys){var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r.value="unidimensional"===a?e[0]:e,r}return 0},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)s[t]=a[t]=e.v[t]*r;return s}}(t):e}}(),H$,I$;function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var r=t.ef||[];this.effectElements=[];var i,s,a=r.length;for(i=0;i<a;i++)s=new GroupEffect(r[i],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}H$=function(){function r(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}return function(t,e){this.pv=1,this.comp=t.comp,this.elem=t,this.mult=.01,this.propType="textSelector",this.textTotal=e.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],this.k=!0,this.x=!0,this.getValue=ExpressionManager.initiateExpression.bind(this)(t,e,this),this.getMult=r,this.getVelocityAtTime=expressionHelpers.getVelocityAtTime,this.kf?this.getValueAtTime=expressionHelpers.getValueAtTime.bind(this):this.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(this),this.setGroupProperty=expressionHelpers.setGroupProperty}}(),I$=TextSelectorProp.getTextSelectorProp,TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new H$(t,e,r):I$(t,e,r)},extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var r,i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottie={},_isFrozen=!1;function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r<e.length;r++){var i=e[r].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.7.5";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""},queryString=myScript.src.replace(/^[^\?]+\??/,"");renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
+	"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bmRnd,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bmRnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e}roundValues(!1);var createElementID=(F=0,function(){return"__lottie_element_"+(F+=1)}),F;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,l,p;switch(h=r*(1-e),l=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=r*(1-(1-o)*e),n%6){case 0:i=r,s=p,a=h;break;case 1:i=l,s=r,a=h;break;case 2:i=h,s=r,a=p;break;case 3:i=h,s=l,a=r;break;case 4:i=p,s=h,a=r;break;case 5:i=r,s=h,a=l}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i+=1)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray=function(){function r(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):r(t,e)}:r}();function createSizedArray(t){return Array.apply(null,{length:t})}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Na={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Na[t]||""}),Na,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function m(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function f(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,l,p,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function u(t,e,r,i,s,a,n,o,h,l,p,m,f,c,d,u){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===m)return y[12]=y[12]*t+y[15]*f,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*p+y[15]*d,y[15]*=u,this._identityCalculated=!1,this;var g=y[0],v=y[1],P=y[2],b=y[3],x=y[4],S=y[5],T=y[6],E=y[7],C=y[8],_=y[9],A=y[10],k=y[11],D=y[12],I=y[13],M=y[14],F=y[15];return y[0]=g*t+v*s+P*h+b*f,y[1]=g*e+v*a+P*l+b*c,y[2]=g*r+v*n+P*p+b*d,y[3]=g*i+v*o+P*m+b*u,y[4]=x*t+S*s+T*h+E*f,y[5]=x*e+S*a+T*l+E*c,y[6]=x*r+S*n+T*p+E*d,y[7]=x*i+S*o+T*m+E*u,y[8]=C*t+_*s+A*h+k*f,y[9]=C*e+_*a+A*l+k*c,y[10]=C*r+_*n+A*p+k*d,y[11]=C*i+_*o+A*m+k*u,y[12]=D*t+I*s+M*h+F*f,y[13]=D*e+I*a+M*l+F*c,y[14]=D*r+I*n+M*p+F*d,y[15]=D*i+I*o+M*m+F*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function P(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function b(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function x(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function S(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function T(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function E(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function C(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function _(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=C(t[e]);return i}function A(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+l,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+l,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+l}return i}function k(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function D(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function I(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function M(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function F(){var t=this.props;return"matrix("+M(t[0])+","+M(t[1])+","+M(t[4])+","+M(t[5])+","+M(t[12])+","+M(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=m,this.shear=l,this.scale=f,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=b,this.applyToX=x,this.applyToY=S,this.applyToZ=T,this.applyToPointArray=k,this.applyToTriplePoints=A,this.applyToPointStringified=D,this.toCSS=I,this.to2dCSS=F,this.clone=v,this.cloneFromProps=P,this.equals=g,this.inversePoints=_,this.inversePoint=C,this.getInverseMatrix=E,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var l,p=this,m=256,f=6,c="random",d=h.pow(m,f),u=h.pow(2,52),y=2*u,g=m-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<m;)a[i]=i++;for(i=0;i<m;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*m+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function P(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function b(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=b(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,x(o)]:null===t?function(){try{if(l)return x(l.randomBytes(m));var t=new Uint8Array(m);return(p.crypto||p.msCrypto).getRandomValues(t),x(t)}catch(t){var e=p.navigator,r=e&&e.plugins;return[+new Date,p,r,p.screen,x(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(f),e=d,r=0;t<u;)t=(t+r)*m,e*=m,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,b(x(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&P(i,a),t.state=function(){return P(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},b(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function m(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function f(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:m(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<l;++r)this._mSampleValues[r]=m(r*p,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=l-1;a!==n&&i[a]<=t;++a)s+=p;var o=s+(t-i[--a])/(i[a+1]-i[a])*p,h=f(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=f(e,r,i);if(0===a)return e;e-=(m(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=m(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+p,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)Object.prototype.hasOwnProperty.call(i,a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){var D=Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var p=function(t,e,r,i){var s,a,n,o,h,l,p=defaultCurveSegments,m=0,f=[],c=[],d=bezierLengthPool.newElement();for(n=r.length,s=0;s<p;s+=1){for(h=s/(p-1),a=l=0;a<n;a+=1)o=bmPow(1-h,3)*t[a]+3*bmPow(1-h,2)*h*r[a]+3*(1-h)*bmPow(h,2)*i[a]+bmPow(h,3)*e[a],f[a]=o,null!==c[a]&&(l+=bmPow(f[a]-c[a],2)),c[a]=f[a];l&&(m+=l=bmSqrt(l)),d.percents[s]=h,d.lengths[s]=m}return d.addedLength=m,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var P,t=(P={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!P[s]){var a,n,o,h,l,p,m,f=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(f=2);var u=new g(f);for(o=r.length,a=0;a<f;a+=1){for(m=createSizedArray(o),l=a/(f-1),n=p=0;n<o;n+=1)h=bmPow(1-l,3)*t[n]+3*bmPow(1-l,2)*l*(t[n]+r[n])+3*(1-l)*bmPow(l,2)*(e[n]+i[n])+bmPow(l,3)*e[n],m[n]=h,null!==d&&(p+=bmPow(m[n]-d[n],2));c+=p=bmSqrt(p),u.points[a]=new v(p,m),d=m}u.segmentLength=c,P[s]=u}return P[s]});function I(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bmFloor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,l=!0;l;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),l=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];l=!1}return r[a]+(r[a+1]-r[a])*o}var M=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segmentsLengthPool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,l=0;for(e=0;e<o-1;e+=1)h[e]=p(s[e],s[e+1],a[e],n[e+1]),l+=h[e].addedLength;return i&&o&&(h[e]=p(s[e],s[0],a[e],n[0]),l+=h[e].addedLength),r.totalLength=l,r},getNewSegment:function(t,e,r,i,s,a,n){s<0?s=0:1<s&&(s=1);var o,h=I(s,n),l=I(a=1<a?1:a,n),p=t.length,m=1-h,f=1-l,c=m*m*m,d=h*m*m*3,u=h*h*m*3,y=h*h*h,g=m*m*f,v=h*m*f+m*h*f+m*m*l,P=h*h*f+m*h*l+h*m*l,b=h*h*l,x=m*f*f,S=h*f*f+m*l*f+m*f*l,T=h*l*f+m*l*l+h*f*l,E=h*l*l,C=f*f*f,_=l*f*f+f*l*f+f*f*l,A=l*l*f+f*l*l+l*f*l,k=l*l*l;for(o=0;o<p;o+=1)M[4*o]=D.round(1e3*(c*t[o]+d*r[o]+u*i[o]+y*e[o]))/1e3,M[4*o+1]=D.round(1e3*(g*t[o]+v*r[o]+P*i[o]+b*e[o]))/1e3,M[4*o+2]=D.round(1e3*(x*t[o]+S*r[o]+T*i[o]+E*e[o]))/1e3,M[4*o+3]=D.round(1e3*(C*t[o]+_*r[o]+A*i[o]+k*e[o]))/1e3;return M},getPointInSegment:function(t,e,r,i,s,a){var n=I(s,a),o=1-n;return[D.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,D.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var l,p=D.sqrt(D.pow(i-t,2)+D.pow(s-e,2)+D.pow(a-r,2)),m=D.sqrt(D.pow(n-t,2)+D.pow(o-e,2)+D.pow(h-r,2)),f=D.sqrt(D.pow(n-i,2)+D.pow(o-s,2)+D.pow(h-a,2));return-1e-4<(l=m<p?f<p?p-m-f:f-m-p:m<f?f-m-p:m-p-f)&&l<1e-4}}}!function(){for(var s=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),r=Math.max(0,16-(e-s)),i=setTimeout(function(){t(e+r)},r);return s=e+r,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function m(t,e,r){var i,s,a,n,o,h,l=t.length;for(s=0;s<l;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),i.hasMask){var p=i.masksProperties;for(n=p.length,a=0;a<n;a+=1)if(p[a].pt.k.i)d(p[a].pt.k);else for(h=p[a].pt.k.length,o=0;o<h;o+=1)p[a].pt.k[o].s&&d(p[a].pt.k[o].s[0]),p[a].pt.k[o].e&&d(p[a].pt.k[o].e[0])}0===i.ty?(i.layers=f(i.refId,e),m(i.layers,e,r)):4===i.ty?c(i.shapes):5===i.ty&&u(i)}}function f(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}return null}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)d(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&d(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&d(t[e].ks.k[r].e[0]);else"gr"===t[e].ty&&c(t[e].it)}function d(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&null))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(d(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function l(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);else"gr"===t[e].ty&&l(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=m,t}var dataManager=dataFunctionManager();function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],r="normal",i="normal",s=e.length,a=0;a<s;a+=1)switch(e[a].toLowerCase()){case"italic":i="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:i,weight:t.fWeight||r}}var FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function f(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=function(t){var e,r=t.split(","),i=r.length,s=[];for(e=0;e<i;e+=1)"sans-serif"!==r[e]&&"monospace"!==r[e]&&s.push(r[e]);return s.join(",")}(t)+", "+e,{node:i,w:s,parent:r}}function c(t,e){var r=createNS("text");r.style.fontSize="100px";var i=getFontProperties(e);return r.setAttribute("font-family",e.fFamily),r.setAttribute("font-style",i.style),r.setAttribute("font-weight",i.weight),r.textContent="1",e.fClass?(r.style.fontFamily="inherit",r.setAttribute("class",e.fClass)):r.style.fontFamily=e.fFamily,t.appendChild(r),createTag("canvas").getContext("2d").font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,r}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i=t.list,s=i.length,a=s;for(r=0;r<s;r+=1){var n,o,h=!0;if(i[r].loaded=!1,i[r].monoCase=f(i[r].fFamily,"monospace"),i[r].sansCase=f(i[r].fFamily,"sans-serif"),i[r].fPath){if("p"===i[r].fOrigin||3===i[r].origin){if(0<(n=document.querySelectorAll('style[f-forigin="p"][f-family="'+i[r].fFamily+'"], style[f-origin="3"][f-family="'+i[r].fFamily+'"]')).length&&(h=!1),h){var l=createTag("style");l.setAttribute("f-forigin",i[r].fOrigin),l.setAttribute("f-origin",i[r].origin),l.setAttribute("f-family",i[r].fFamily),l.type="text/css",l.innerText="@font-face {font-family: "+i[r].fFamily+"; font-style: normal; src: url('"+i[r].fPath+"');}",e.appendChild(l)}}else if("g"===i[r].fOrigin||1===i[r].origin){for(n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),o=0;o<n.length;o+=1)-1!==n[o].href.indexOf(i[r].fPath)&&(h=!1);if(h){var p=createTag("link");p.setAttribute("f-forigin",i[r].fOrigin),p.setAttribute("f-origin",i[r].origin),p.type="text/css",p.rel="stylesheet",p.href=i[r].fPath,document.body.appendChild(p)}}else if("t"===i[r].fOrigin||2===i[r].origin){for(n=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),o=0;o<n.length;o+=1)i[r].fPath===n[o].src&&(h=!1);if(h){var m=createTag("link");m.setAttribute("f-forigin",i[r].fOrigin),m.setAttribute("f-origin",i[r].origin),m.setAttribute("rel","stylesheet"),m.setAttribute("href",i[r].fPath),e.appendChild(m)}}}else i[r].loaded=!0,a-=1;i[r].helper=c(e,i[r]),i[r].cache={},this.fonts.push(i[r])}0===a?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,r)),a},getFontByName:function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},checkLoadedFonts:function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),PropertyFactory=function(){var m=initialDefaultFrame,s=Math.abs;function f(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,l,p,m,f=e.lastIndex,c=f,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>t){f=c;break}c<d-1?c+=1:(f=0,u=!1)}var y,g,v,P,b,x,S,T,E,C,_=a.t-i,A=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var k=s.bezierData;if(_<=t||t<A){var D=_<=t?k.points.length-1:0;for(o=k.points[D].point.length,n=0;n<o;n+=1)r[n]=k.points[D].point[n]}else{s.__fnct?m=s.__fnct:(m=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=m),h=m((t-A)/(_-A));var I,M=k.segmentLength*h,F=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,l=k.points.length;u;){if(F+=k.points[p].partialLength,0===M||0===h||p===k.points.length-1){for(o=k.points[p].point.length,n=0;n<o;n+=1)r[n]=k.points[p].point[n];break}if(F<=M&&M<F+k.points[p+1].partialLength){for(I=(M-F)/k.points[p+1].partialLength,o=k.points[p].point.length,n=0;n<o;n+=1)r[n]=k.points[p].point[n]+(k.points[p+1].point[n]-k.points[p].point[n])*I;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=F-k.points[p].partialLength,e._lastKeyframeIndex=c}}else{var w,V,R,L,B;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(_<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=A)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var O=G(s.s),z=G(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],l=t[0],p=t[1],m=t[2],f=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=l*c+p*d+m*u+f*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*l+o*c,h[1]=n*p+o*d,h[2]=n*m+o*u,h[3]=n*f+o*y,h}(O,z,(t-A)/(_-A)),P=v[0],b=v[1],x=v[2],S=v[3],T=Math.atan2(2*b*S-2*P*x,1-2*b*b-2*x*x),E=Math.asin(2*P*b+2*x*S),C=Math.atan2(2*P*S-2*b*x,1-2*P*P-2*x*x),g[0]=T/degToRads,g[1]=E/degToRads,g[2]=C/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=_<=t?1:t<A?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?m=s.__fnct[c]:(w=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],V=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],R=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],L=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],m=BezierFactory.getBezierEasing(w,V,R,L).get,s.__fnct[c]=m)):s.__fnct?m=s.__fnct:(w=s.o.x,V=s.o.y,R=s.i.x,L=s.i.y,m=BezierFactory.getBezierEasing(w,V,R,L).get,s.__fnct=m),m((t-A)/(_-A)))),y=a.s||s.e,B=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=B:r=B}return e.lastIndex=f,r}function G(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),l=Math.sin(i/2);return[o*h*n+s*a*l,o*a*n+s*h*l,s*h*n-o*a*l,s*a*n-o*h*l]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==m&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,r,i){var s;this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:m,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=m,this.pv=m,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.effectsSequence=[c.bind(this)],this.addEffect=y}function l(t,e,r,i){var s;this.propType="multidimensional";var a,n,o,h,l=e.k.length;for(s=0;s<l-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.frameId=-1;var p=e.k[0].s.length;for(this.v=createTypedArray("float32",p),this.pv=createTypedArray("float32",p),s=0;s<p;s+=1)this.v[s]=m,this.pv[s]=m;this._caching={lastFrame:m,lastIndex:0,value:createTypedArray("float32",p)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new l(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=null,e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var e;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var r,i;if(e=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(r=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(r=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(r[0]=s.getValueAtTime((s.keyframes[0].t+.01)/e,0),r[1]=a.getValueAtTime((a.keyframes[0].t+.01)/e,0),i[0]=s.getValueAtTime(s.keyframes[0].t/e,0),i[1]=a.getValueAtTime(a.keyframes[0].t/e,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(r[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/e,0),r[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/e,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/e,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/e,0)):(r=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/e,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/e,a.offsetTime))}else r=i=n;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[i]||a[i]&&!s)&&(a[i]=pointPool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,l,p,m,f=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,f=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(f=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<d.t-this.offsetTime)p=0;else{var P;d.__fnct?P=d.__fnct:(P=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=P),p=P((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}i=d.s[0]}for(h=e._length,l=i.i[0].length,r.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<l;o+=1)m=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*p,e.i[n][o]=m,m=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*p,e.o[n][o]=m,m=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*p,e.v[n][o]=m}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shapePool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(e=0;e<r;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,m=2*Math.PI*o/(2*s),f=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?l:p,i=n?m:f;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*i*r*d,y-v*i*r*d,u+g*i*r*d,y+v*i*r*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=.5*-Math.PI,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),l=i*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),m=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*s*o,l-m*a*s*o,h+p*a*s*o,l+m*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bmMin(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var m={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new p(t,e):6===r?i=new h(t,e):7===r&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return m}(),ShapeModifiers=(Xr={},Yr={},Xr.registerModifier=function(t,e){Yr[t]||(Yr[t]=e)},Xr.getModifier=function(t,e,r){return new Yr[t](e,r)},Xr),Xr,Yr;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){var s;this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;n<l;n+=1){var p,m;if(!((o=a[n]).e*s<i||o.s*s>i+r))p=o.s*s<=i?0:(o.s*s-i)/r,m=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([p,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segmentsLengthPool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i,s;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),e=1<this.s.v?1+a:this.s.v<0?0+a:this.s.v+a,(r=1<this.e.v?1+a:this.e.v<0?0+a:this.e.v+a)<e){var n=e;e=r,r=n}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var o,h,l,p,m,f=this.shapes.length,c=0;if(r===e)for(s=0;s<f;s+=1)this.shapes[s].localShapeCollection.releaseShapes(),this.shapes[s].shape._mdf=!0,this.shapes[s].shape.paths=this.shapes[s].localShapeCollection,this._mdf&&(this.shapes[s].pathsData.length=0);else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(s=0;s<f;s+=1)this.shapes[s].pathsData.length=0,this.shapes[s].shape._mdf=!0}else{var d,u,y=[];for(s=0;s<f;s+=1)if((d=this.shapes[s]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=d.shape.paths)._length,m=0,!d.shape._mdf&&d.pathsData.length)m=d.totalShapeLength;else{for(l=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)p=bez.getSegmentsLength(i.shapes[o]),l.push(p),m+=p.totalLength;d.totalShapeLength=m,d.pathsData=l}c+=m,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,P=r,b=0;for(s=f-1;0<=s;s-=1)if((d=this.shapes[s]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<f?(g=this.calculateShapeEdges(e,r,d.totalShapeLength,b,c),b+=d.totalShapeLength):g=[[v,P]],h=g.length,o=0;o<h;o+=1){v=g[o][0],P=g[o][1],y.length=0,P<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*P}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(P-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(P-1)}));var x=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,u),x=this.addShapes(d,y[1],S)}else this.addPaths(x,u),x=this.addShapes(d,y[1]);this.addPaths(x,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,l,p,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(p=r?(o=r._length,r._length):(r=shapePool.newElement(),o=0),u.push(r),i=0;i<c;i+=1){for(h=m[i].lengths,r.c=f[i].c,a=f[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,r.c=!1;else{if(d>e.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[s],f[i].v[s],r,o,y),y=!1):(l=bez.getNewSegment(f[i].v[s-1],f[i].v[s],f[i].o[s-1],f[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[i].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[0],f[i].v[0],r,o,y),y=!1):(l=bez.getNewSegment(f[i].v[s-1],f[i].v[0],f[i].o[s-1],f[i].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[p][0],r.v[p][1],"i",p),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;i<c-1&&(r=shapePool.newElement(),y=!0,u.push(r),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r,i=shapePool.newElement();i.c=t.c;var s,a,n,o,h,l,p,m,f,c,d,u,y=t._length,g=0;for(r=0;r<y;r+=1)s=t.v[r],n=t.o[r],a=t.i[r],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==r&&r!==y-1||t.c?(o=0===r?t.v[y-1]:t.v[r-1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=d=s[0]+(o[0]-s[0])*l,m=u=s[1]-(s[1]-o[1])*l,f=p-(p-s[0])*roundCorner,c=m-(m-s[1])*roundCorner,i.setTripleAt(p,m,f,c,d,u,g),g+=1,o=r===y-1?t.v[0]:t.v[r+1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=f=s[0]+(o[0]-s[0])*l,m=c=s[1]+(o[1]-s[1])*l,d=p-(p-s[0])*roundCorner,u=m-(m-s[1])*roundCorner,i.setTripleAt(p,m,f,c,d,u,g)):i.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):i.setTripleAt(t.v[r][0],t.v[r][1],t.o[r][0],t.o[r][1],t.i[r][0],t.i[r][1],g),g+=1;return i},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var r=e/100,i=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)i[0]+=t.v[a][0],i[1]+=t.v[a][1];i[0]/=s,i[1]/=s;var n,o,h,l,p,m,f=shapePool.newElement();for(f.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(i[0]-t.v[a][0])*r,o=t.v[a][1]+(i[1]-t.v[a][1])*r,h=t.o[a][0]+(i[0]-t.o[a][0])*-r,l=t.o[a][1]+(i[1]-t.o[a][1])*-r,p=t.i[a][0]+(i[0]-t.i[a][0])*-r,m=t.i[a][1]+(i[1]-t.i[a][1])*-r,f.setTripleAt(n,o,h,l,p,m,a);return f},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){for(this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);0<r;)r-=1,this._elements.unshift(e[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var l=this.o.v,p=l%1,m=0<l?Math.floor(l):Math.ceil(l),f=this.pMatrix.props,c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<l){for(;g<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),g+=p)}else if(l<0){for(;m<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),g-=p)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),u=0;u<y;u+=1)r[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)r[u]=this.matrix.props[u];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shapePool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,r){var i="";if(t.e)i=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),i=e+s}else i=r,i+=t.u?t.u:"",i+=t.p;return i}function e(){this._imageLoaded=t.bind(this),this.testImageLoaded=function(t){var e=0,r=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(r)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return e.prototype={loadAssets:function(t,e){var r;this.imagesLoadedCb=e;var i=t.length;for(r=0;r<i;r+=1)t[r].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[r])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,r=this.images.length;e<r;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function(t){var e=a(t,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.src=e;var i={img:r,assetData:t};return i},createImageData:function(t){var e=a(t,this.assetsPath,this.path),r=createNS("image");isSafari?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(r);var i={img:r,assetData:t};return i},imageLoaded:t,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},e}(),featureSupport=(ex={maskType:!0},(/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))&&(ex.maskType=!1),ex),ex,filtersFactory=(fx={},fx.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},fx.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},fx),fx,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}();function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,l,p,m,f,c,d,u,y,g,v,P,b,x=this._moreOptions.alignment.v,S=this._animatorsData,T=this._textData,E=this.mHelper,C=this._renderType,_=this.renderedLetters.length,A=t.l;if(this._hasMaskedPath){if(b=this._pathData.m,!this._pathData.n||this._pathData._mdf){var k,D=b.v;for(this._pathData.r&&(D=D.reverse()),n={tLength:0,segments:[]},a=D._length-1,s=g=0;s<a;s+=1)k=bez.buildBezierData(D.v[s],D.v[s+1],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[s+1][0]-D.v[s+1][0],D.i[s+1][1]-D.v[s+1][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength;s=a,b.v.c&&(k=bez.buildBezierData(D.v[s],D.v[0],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[0][0]-D.v[0][0],D.i[0][1]-D.v[0][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,m=1,p=!(l=f=0),u=n.segments,o<0&&b.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),m=(d=u[f=u.length-1].points).length-1;o<0;)o+=d[m].partialLength,(m-=1)<0&&(m=(d=u[f-=1].points).length-1);c=(d=u[f].points)[m-1],y=(h=d[m]).partialLength}a=A.length,i=r=0;var I,M,F,w,V,R=1.2*t.finalSize*.714,L=!0;F=S.length;var B,O,z,G,N,j,q,H,W,Y,X,K,$=-1,J=o,Z=f,U=m,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(A[s].n){for(rt&&(rt+=it);at<s;)A[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(M=0;M<F;M+=1)(I=S[M].a).t.propType&&(nt&&2===t.j&&(it+=I.t.v*st),(V=S[M].s.getMult(A[s].anIndexes[M],T.a[M].s.totalChars)).length?rt+=I.t.v*V[0]*st:rt+=I.t.v*V*st);nt=!1}for(rt&&(rt+=it);at<s;)A[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(E.reset(),G=1,A[s].n)r=0,i+=t.yOffset,i+=L?1:0,o=J,L=!1,this._hasMaskedPath&&(m=U,c=(d=u[f=Z].points)[m-1],y=(h=d[m]).partialLength,l=0),K=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==A[s].line){switch(t.j){case 1:o+=g-t.lineWidths[A[s].line];break;case 2:o+=(g-t.lineWidths[A[s].line])/2}Q=A[s].line}$!==A[s].ind&&(A[$]&&(o+=A[$].extra),o+=A[s].an/2,$=A[s].ind),o+=x[0]*A[s].an*.005;var ot=0;for(M=0;M<F;M+=1)(I=S[M].a).p.propType&&((V=S[M].s.getMult(A[s].anIndexes[M],T.a[M].s.totalChars)).length?ot+=I.p.v[0]*V[0]:ot+=I.p.v[0]*V),I.a.propType&&((V=S[M].s.getMult(A[s].anIndexes[M],T.a[M].s.totalChars)).length?ot+=I.a.v[0]*V[0]:ot+=I.a.v[0]*V);for(p=!0;p;)o+ot<=l+y||!d?(v=(o+ot-l)/h.partialLength,O=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,E.translate(-x[0]*A[s].an*.005,-x[1]*R*.01),p=!1):d&&(l+=h.partialLength,(m+=1)>=d.length&&(m=0,d=u[f+=1]?u[f].points:b.v.c?u[f=m=0].points:(l-=h.partialLength,null)),d&&(c=h,y=(h=d[m]).partialLength));B=A[s].an/2-A[s].add,E.translate(-B,0,0)}else B=A[s].an/2-A[s].add,E.translate(-B,0,0),E.translate(-x[0]*A[s].an*.005,-x[1]*R*.01,0);for(M=0;M<F;M+=1)(I=S[M].a).t.propType&&(V=S[M].s.getMult(A[s].anIndexes[M],T.a[M].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?V.length?o+=I.t.v*V[0]:o+=I.t.v*V:V.length?r+=I.t.v*V[0]:r+=I.t.v*V));for(t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(N=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(q=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<F;M+=1)(I=S[M].a).a.propType&&((V=S[M].s.getMult(A[s].anIndexes[M],T.a[M].s.totalChars)).length?E.translate(-I.a.v[0]*V[0],-I.a.v[1]*V[1],I.a.v[2]*V[2]):E.translate(-I.a.v[0]*V,-I.a.v[1]*V,I.a.v[2]*V));for(M=0;M<F;M+=1)(I=S[M].a).s.propType&&((V=S[M].s.getMult(A[s].anIndexes[M],T.a[M].s.totalChars)).length?E.scale(1+(I.s.v[0]-1)*V[0],1+(I.s.v[1]-1)*V[1],1):E.scale(1+(I.s.v[0]-1)*V,1+(I.s.v[1]-1)*V,1));for(M=0;M<F;M+=1){if(I=S[M].a,V=S[M].s.getMult(A[s].anIndexes[M],T.a[M].s.totalChars),I.sk.propType&&(V.length?E.skewFromAxis(-I.sk.v*V[0],I.sa.v*V[1]):E.skewFromAxis(-I.sk.v*V,I.sa.v*V)),I.r.propType&&(V.length?E.rotateZ(-I.r.v*V[2]):E.rotateZ(-I.r.v*V)),I.ry.propType&&(V.length?E.rotateY(I.ry.v*V[1]):E.rotateY(I.ry.v*V)),I.rx.propType&&(V.length?E.rotateX(I.rx.v*V[0]):E.rotateX(I.rx.v*V)),I.o.propType&&(V.length?G+=(I.o.v*V[0]-G)*V[0]:G+=(I.o.v*V-G)*V),t.strokeWidthAnim&&I.sw.propType&&(V.length?j+=I.sw.v*V[0]:j+=I.sw.v*V),t.strokeColorAnim&&I.sc.propType)for(H=0;H<3;H+=1)V.length?N[H]+=(I.sc.v[H]-N[H])*V[0]:N[H]+=(I.sc.v[H]-N[H])*V;if(t.fillColorAnim&&t.fc){if(I.fc.propType)for(H=0;H<3;H+=1)V.length?q[H]+=(I.fc.v[H]-q[H])*V[0]:q[H]+=(I.fc.v[H]-q[H])*V;I.fh.propType&&(q=V.length?addHueToRGB(q,I.fh.v*V[0]):addHueToRGB(q,I.fh.v*V)),I.fs.propType&&(q=V.length?addSaturationToRGB(q,I.fs.v*V[0]):addSaturationToRGB(q,I.fs.v*V)),I.fb.propType&&(q=V.length?addBrightnessToRGB(q,I.fb.v*V[0]):addBrightnessToRGB(q,I.fb.v*V))}}for(M=0;M<F;M+=1)(I=S[M].a).p.propType&&(V=S[M].s.getMult(A[s].anIndexes[M],T.a[M].s.totalChars),this._hasMaskedPath?V.length?E.translate(0,I.p.v[1]*V[0],-I.p.v[2]*V[1]):E.translate(0,I.p.v[1]*V,-I.p.v[2]*V):V.length?E.translate(I.p.v[0]*V[0],I.p.v[1]*V[1],-I.p.v[2]*V[2]):E.translate(I.p.v[0]*V,I.p.v[1]*V,-I.p.v[2]*V));if(t.strokeWidthAnim&&(W=j<0?0:j),t.strokeColorAnim&&(Y="rgb("+Math.round(255*N[0])+","+Math.round(255*N[1])+","+Math.round(255*N[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(E.translate(0,-t.ls),E.translate(0,x[1]*R*.01+i,0),T.p.p){P=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(P)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),E.rotate(-ht*Math.PI/180)}E.translate(O,z,0),o-=x[0]*A[s].an*.005,A[s+1]&&$!==A[s+1].ind&&(o+=A[s].an/2,o+=.001*t.tr*t.finalSize)}else{switch(E.translate(r,i,0),t.ps&&E.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:E.translate(A[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[A[s].line]),0,0);break;case 2:E.translate(A[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[A[s].line])/2,0,0)}E.translate(0,-t.ls),E.translate(B,0,0),E.translate(x[0]*A[s].an*.005,x[1]*R*.01,0),r+=A[s].l+.001*t.tr*t.finalSize}"html"===C?tt=E.toCSS():"svg"===C?tt=E.to2dCSS():et=[E.props[0],E.props[1],E.props[2],E.props[3],E.props[4],E.props[5],E.props[6],E.props[7],E.props[8],E.props[9],E.props[10],E.props[11],E.props[12],E.props[13],E.props[14],E.props[15]],K=G}this.lettersChangedFlag=_<=s?(w=new LetterProps(K,W,Y,X,tt,et),this.renderedLetters.push(w),_+=1,!0):(w=this.renderedLetters[s]).update(K,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&!(r===i-1||t[r+1].t>e);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),s+=1):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],m=0,f=l.m.g,c=0,d=0,u=0,y=[],g=0,v=0,P=h.getFontByName(t.f),b=0,x=getFontProperties(P);t.fWeight=x.weight,t.fStyle=x.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var S,T=t.tr/1e3*t.finalSize;if(t.sz)for(var E,C,_=!0,A=t.sz[0],k=t.sz[1];_;){g=E=0,r=(C=this.buildFinalText(t.t)).length,T=t.tr/1e3*t.finalSize;var D=-1;for(e=0;e<r;e+=1)S=C[e].charCodeAt(0),i=!1," "===C[e]?D=e:13!==S&&3!==S||(i=!(g=0),E+=t.finalLineHeight||1.2*t.finalSize),A<g+(b=h.chars?(o=h.getCharData(C[e],P.fStyle,P.fFamily),i?0:o.w*t.finalSize/100):h.measureText(C[e],t.f,t.finalSize))&&" "!==C[e]?(-1===D?r+=1:e=D,E+=t.finalLineHeight||1.2*t.finalSize,C.splice(e,D===e?1:0,"\r"),D=-1,g=0):(g+=b,g+=T);E+=P.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&k<E?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=C,r=t.finalText.length,_=!1)}g=-T;var I,M=b=0;for(e=0;e<r;e+=1)if(i=!1,13===(S=(I=t.finalText[e]).charCodeAt(0))||3===S?(M=0,y.push(g),v=v<g?g:v,g=-2*T,i=!(s=""),u+=1):s=I,b=h.chars?(o=h.getCharData(I,P.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===I?M+=b+T:(g+=b+T+M,M=0),p.push({l:b,an:b,add:c,n:i,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==f){if(c+=b,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=b);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=b,d+=1;m+=1,c=0}}else if(3==f){if(c+=b,""===s||e===r-1){for(""===s&&(c-=b);d<=e;)p[d].an=c,p[d].ind=m,p[d].extra=b,d+=1;c=0,m+=1}}else p[m].ind=m,p[m].extra=0,m+=1;if(t.l=p,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var F,w,V,R,L=l.a;n=L.length;var B=[];for(a=0;a<n;a+=1){for((F=L[a]).a.sc&&(t.strokeColorAnim=!0),F.a.sw&&(t.strokeWidthAnim=!0),(F.a.fc||F.a.fh||F.a.fs||F.a.fb)&&(t.fillColorAnim=!0),R=0,V=F.s.b,e=0;e<r;e+=1)(w=p[e]).anIndexes[a]=R,(1==V&&""!==w.val||2==V&&""!==w.val&&" "!==w.val||3==V&&(w.n||" "==w.val||e==r-1)||4==V&&(w.n||e==r-1))&&(1===F.s.rn&&B.push(R),R+=1);l.a[a].s.totalChars=R;var O,z=-1;if(1===F.s.rn)for(e=0;e<r;e+=1)z!=(w=p[e]).anIndexes[a]&&(z=w.anIndexes[a],O=B.splice(Math.floor(Math.random()*B.length),1)[0]),w.anIndexes[a]=O}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=P.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,l=this.data.sh;if(2===l)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===l)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===l)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===l){if(h===o)n=0;else{var p=h-o,m=-p/2+(t=d(c(0,t+.5-o),h-o)),f=p/2;n=Math.sqrt(1-m*m/(f*f))}n=a(n)}else n=6===l?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),poolFactory=function(t,e,r){var i=0,s=t,a=createSizedArray(s);return{newElement:function(){return i?a[i-=1]:e()},release:function(t){i===s&&(a=pooling.double(a),s*=2),r&&r(t),a[i]=t,i+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},pointPool=poolFactory(8,function(){return createTypedArray("float32",2)}),shapePool=(lB=poolFactory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)pointPool.release(t.v[e]),pointPool.release(t.i[e]),pointPool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),lB.clone=function(t){var e,r=lB.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},lB),lB,shapeCollectionPool=(tB={newShapeCollection:function(){var t;t=uB?wB[uB-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shapePool.release(t.shapes[e]);t._length=0,uB===vB&&(wB=pooling.double(wB),vB*=2);wB[uB]=t,uB+=1}},uB=0,vB=4,wB=createSizedArray(vB),tB),tB,uB,vB,wB,segmentsLengthPool=poolFactory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezierLengthPool.release(t.lengths[e]);t.lengths.length=0}),bezierLengthPool=poolFactory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s,a=this.globalData.defs,n=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(n),this.solidPath="";var o,h,l,p,m,f,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<n;i+=1)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!==c[i].mode&&"i"!==c[i].mode||0!==d?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),s=createNS("path"),"n"===c[i].mode)this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:s,lastPath:""},a.appendChild(s);else{var P;if(d+=1,s.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),s.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",f=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),P=createElementID(),(p=createNS("filter")).setAttribute("id",P),(m=createNS("feMorphology")).setAttribute("operator","erode"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),p.appendChild(m),a.appendChild(p),s.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):f=m=null,this.storedData[i]={elem:s,x:f,expan:m,lastPath:"",lastOperator:"",filterId:P,lastRadius:0},"i"===c[i].mode){h=u.length;var b=createNS("g");for(o=0;o<h;o+=1)b.appendChild(u[o]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",y+"_"+d),x.appendChild(s),a.appendChild(x),b.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(b)}else u.push(s);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:s,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}for(this.maskElement=createNS(g),n=u.length,i=0;i<n;i+=1)this.maskElement.appendChild(u[i]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(t,e,r,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var s,a=4;"rc"===e.ty?a=5:"el"===e.ty?a=6:"sr"===e.ty&&(a=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,a,t);var n,o=r.length;for(s=0;s<o;s+=1)r[s].closed||(n={transforms:i.addTransformSequence(r[s].transforms),trNodes:[]},this.styledShapes.push(n),r[s].elements.push(n))}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function AudioElement(t,e,r){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,r),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function CVContextData(){var t;this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;for(this.savedOp=createTypedArray("float32",15),t=0;t<15;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=15}function CVBaseElement(){}function CVImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.img=e.imageLoader.getImage(this.assetData),this.initElement(t,e,r)}function CVCompElement(t,e,r){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CVMaskElement(t,e){var r;this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var i=this.masksProperties.length,s=!1;for(r=0;r<i;r+=1)"n"!==this.masksProperties[r].mode&&(s=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);(this.hasMasks=s)&&this.element.addRenderableComponent(this)}function CVShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(t,e,r)}function CVSolidElement(t,e,r){this.initElement(t,e,r)}function CVTextElement(t,e,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,r)}function CVEffects(){}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e-=1)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id===t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextLottieElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],CanvasRenderer),CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRenderer.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var r=this.contextData.cTr.props;this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},CanvasRenderer.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},CanvasRenderer.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e,r=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var i=this.contextData.saved[this.contextData.cArrPos];for(e=0;e<16;e+=1)i[e]=r[e];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},CanvasRenderer.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,r=this.contextData.saved[this.contextData.cArrPos],i=this.contextData.cTr.props;for(e=0;e<16;e+=1)i[e]=r[e];this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),r=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=r,this.globalData.currentGlobalAlpha!==r&&(this.canvasContext.globalAlpha=r,this.globalData.currentGlobalAlpha=r)}else this.canvasContext.restore()},CanvasRenderer.prototype.configAnimation=function(t){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var e=this.animationItem.container.style;e.width="100%",e.height="100%";var r="0px 0px 0px";e.transformOrigin=r,e.mozTransformOrigin=r,e.webkitTransformOrigin=r,e["-webkit-transform"]=r,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){var t,e,r,i;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var s=this.renderConfig.preserveAspectRatio.split(" "),a=s[1]||"meet",n=s[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);r=t/e,i=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=r<i&&"meet"===a||i<r&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;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],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRenderer.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){var r;this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i=this.layers.length;for(this.completeLayers||this.checkLayers(t),r=0;r<i;r+=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(t-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var r=this.createItem(this.layers[t],this,this.globalData);(e[t]=r).initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r,i=!0,s=this.comp;i;)s.finalTransform?(s.data.hasMask&&e.splice(0,0,s.finalTransform),s=s.comp):i=!1;var a,n=e.length;for(r=0;r<n;r+=1)a=e[r].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}},CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(l),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),m=createNS("path");m.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var f=createElementID();if(p.setAttribute("id",f),p.appendChild(m),this.globalData.defs.appendChild(p),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+f+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+f+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,l,p,m,f,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((f=this.searchProcessedElement(t[o]))?e[o]=r[f-1]:t[o]._render=n,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"===t[o].ty){if(f)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"===t[o].ty?(f||(e[o]=this.createTransformElement(t[o],i)),p=e[o].transform,c.push(p)):"sh"===t[o].ty||"rc"===t[o].ty||"el"===t[o].ty||"sr"===t[o].ty?(f||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"===t[o].ty||"rd"===t[o].ty||"ms"===t[o].ty||"pb"===t[o].ty?(f?(m=e[o]).closed=!1:((m=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=m,this.shapeModifiers.push(m)),y.push(m)):"rp"===t[o].ty&&(f?(m=e[o]).closed=!0:(m=ShapeModifiers.getModifier(t[o].ty),(e[o]=m).init(this,t,o,e),this.shapeModifiers.push(m),n=!1),y.push(m));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var r=0;for(r=this._length;r<t;r+=1)this.saved[r]=createTypedArray("float32",16);this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var t=createTag("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,r,i=t.getContext("2d"),s=this.img.width,a=this.img.height,n=s/a,o=this.assetData.w/this.assetData.h,h=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;o<n&&"xMidYMid slice"===h||n<o&&"xMidYMid slice"!==h?e=(r=a)*o:r=(e=s)/o,i.drawImage(this.img,(s-e)/2,(a-r)/2,e,r,0,0,this.assetData.w,this.assetData.h),this.img=t}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([CanvasRenderer,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,r,i,s=this.element.finalTransform.mat,a=this.element.canvasContext,n=this.masksProperties.length;for(a.beginPath(),t=0;t<n;t+=1)if("n"!==this.masksProperties[t].mode){var o;this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),i=this.viewData[t].v,e=s.applyToPointArray(i.v[0][0],i.v[0][1],0),a.moveTo(e[0],e[1]);var h=i._length;for(o=1;o<h;o+=1)r=s.applyToTriplePoints(i.o[o-1],i.i[o],i.v[o]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=s.applyToTriplePoints(i.o[o-1],i.i[0],i.v[0]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var r={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"===t.ty||"st"===t.ty?(i.c=PropertyFactory.getProp(this,t.c,1,255,this),i.c.k||(r.co="rgb("+bmFloor(i.c.v[0])+","+bmFloor(i.c.v[1])+","+bmFloor(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=PropertyFactory.getProp(this,t.s,1,null,this),i.e=PropertyFactory.getProp(this,t.e,1,null,this),i.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),i.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),i.g=new GradientProperty(this,t.g,this)),i.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(r.lc=this.lcEnum[t.lc]||"round",r.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(r.ml=t.ml),i.w=PropertyFactory.getProp(this,t.w,0,null,this),i.w.k||(r.wi=i.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);i.d=s,i.d.k||(r.da=i.d.dashArray,r.do=i.d.dashoffset[0])}}else r.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(r),i.style=r,i},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(t){var e,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},CVShapeElement.prototype.closeStyles=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].closed=!0},CVShapeElement.prototype.searchShapes=function(t,e,r,i,s){var a,n,o,h,l,p,m=t.length-1,f=[],c=[],d=[].concat(s);for(a=m;0<=a;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=r[h-1]:t[a]._shouldRender=i,"fl"===t[a].ty||"st"===t[a].ty||"gf"===t[a].ty||"gs"===t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),f.push(e[a].style);else if("gr"===t[a].ty){if(h)for(o=e[a].it.length,n=0;n<o;n+=1)e[a].prevViewData[n]=e[a].it[n];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,i,d)}else"tr"===t[a].ty?(h||(p=this.createTransformElement(t[a]),e[a]=p),d.push(e[a]),this.addTransformToStyleList(e[a])):"sh"===t[a].ty||"rc"===t[a].ty||"el"===t[a].ty||"sr"===t[a].ty?h||(e[a]=this.createShapeElement(t[a])):"tm"===t[a].ty||"rd"===t[a].ty||"pb"===t[a].ty?(h?(l=e[a]).closed=!1:((l=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=l,this.shapeModifiers.push(l)),c.push(l)):"rp"===t[a].ty&&(h?(l=e[a]).closed=!0:(l=ShapeModifiers.getModifier(t[a].ty),(e[a]=l).init(this,t,a,e),this.shapeModifiers.push(l),i=!1),c.push(l));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(f),m=c.length,a=0;a<m;a+=1)c[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var t,e,r,i,s,a,n,o,h,l=this.stylesList.length,p=this.globalData.renderer,m=this.globalData.canvasContext;for(t=0;t<l;t+=1)if(("st"!==(o=(h=this.stylesList[t]).type)&&"gs"!==o||0!==h.wi)&&h.data._shouldRender&&0!==h.coOp&&0!==this.globalData.currentGlobalAlpha){for(p.save(),a=h.elements,"st"===o||"gs"===o?(m.strokeStyle="st"===o?h.co:h.grd,m.lineWidth=h.wi,m.lineCap=h.lc,m.lineJoin=h.lj,m.miterLimit=h.ml||0):m.fillStyle="fl"===o?h.co:h.grd,p.ctxOpacity(h.coOp),"st"!==o&&"gs"!==o&&m.beginPath(),p.ctxTransform(h.preTransforms.finalTransform.props),r=a.length,e=0;e<r;e+=1){for("st"!==o&&"gs"!==o||(m.beginPath(),h.da&&(m.setLineDash(h.da),m.lineDashOffset=h.do)),s=(n=a[e].trNodes).length,i=0;i<s;i+=1)"m"===n[i].t?m.moveTo(n[i].p[0],n[i].p[1]):"c"===n[i].t?m.bezierCurveTo(n[i].pts[0],n[i].pts[1],n[i].pts[2],n[i].pts[3],n[i].pts[4],n[i].pts[5]):m.closePath();"st"!==o&&"gs"!==o||(m.stroke(),h.da&&m.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&m.fill(h.r),p.restore()}},CVShapeElement.prototype.renderShape=function(t,e,r,i){var s,a;for(a=t,s=e.length-1;0<=s;s-=1)"tr"===e[s].ty?(a=r[s].transform,this.renderShapeTransform(t,a)):"sh"===e[s].ty||"el"===e[s].ty||"rc"===e[s].ty||"sr"===e[s].ty?this.renderPath(e[s],r[s]):"fl"===e[s].ty?this.renderFill(e[s],r[s],a):"st"===e[s].ty?this.renderStroke(e[s],r[s],a):"gf"===e[s].ty||"gs"===e[s].ty?this.renderGradientFill(e[s],r[s],a):"gr"===e[s].ty?this.renderShape(a,e[s].it,r[s].it):e[s].ty;i&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var r,i,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(s=0;s<o;s+=1){var l=n.shapes[s];if(l&&l.v){for(i=l._length,r=1;r<i;r+=1)1===r&&a.push({t:"m",p:h.applyToPointArray(l.v[0][0],l.v[0][1],0)}),a.push({t:"c",pts:h.applyToTriplePoints(l.o[r-1],l.i[r],l.v[r])});1===i&&a.push({t:"m",p:h.applyToPointArray(l.v[0][0],l.v[0][1],0)}),l.c&&i&&(a.push({t:"c",pts:h.applyToTriplePoints(l.o[r-1],l.i[0],l.v[0])}),a.push({t:"z"}))}}t.trNodes=a}},CVShapeElement.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var r,i=e.styledShapes.length;for(r=0;r<i;r+=1)this.renderStyledShape(e.styledShapes[r],e.sh)}},CVShapeElement.prototype.renderFill=function(t,e,r){var i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(t,e,r){var i,s=e.style;if(!s.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var a,n=this.globalData.canvasContext,o=e.s.v,h=e.e.v;if(1===t.t)i=n.createLinearGradient(o[0],o[1],h[0],h[1]);else{var l=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)),p=Math.atan2(h[1]-o[1],h[0]-o[0]),m=e.h.v;1<=m?m=.99:m<=-1&&(m=-.99);var f=l*m,c=Math.cos(p+e.a.v)*f+o[0],d=Math.sin(p+e.a.v)*f+o[1];i=n.createRadialGradient(c,d,0,o[0],o[1],l)}var u=t.g.p,y=e.g.c,g=1;for(a=0;a<u;a+=1)e.g._hasOpacity&&e.g._collapsable&&(g=e.g.o[2*a+1]),i.addColorStop(y[4*a]/100,"rgba("+y[4*a+1]+","+y[4*a+2]+","+y[4*a+3]+","+g+")");s.grd=i}s.coOp=e.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||this._isFirstFrame)&&(i.da=s.dashArray,i.do=s.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity),(e.w._mdf||this._isFirstFrame)&&(i.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var r=!1;t.sc&&(r=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var i,s,a,n,o,h,l,p,m,f,c,d,u=this.globalData.fontManager.getFontByName(t.f),y=t.l,g=this.mHelper;this.stroke=r,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,s=t.finalText.length;var v=this.data.singleShape,P=.001*t.tr*t.finalSize,b=0,x=0,S=!0,T=0;for(i=0;i<s;i+=1){for(n=(a=this.globalData.fontManager.getCharData(t.finalText[i],u.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&a.data||{},g.reset(),v&&y[i].n&&(b=-P,x+=t.yOffset,x+=S?1:0,S=!1),m=(l=n.shapes?n.shapes[0].it:[]).length,g.scale(t.finalSize/100,t.finalSize/100),v&&this.applyTextPropertiesToMatrix(t,g,y[i].line,b,x),c=createSizedArray(m),p=0;p<m;p+=1){for(h=l[p].ks.k.i.length,f=l[p].ks.k,d=[],o=1;o<h;o+=1)1===o&&d.push(g.applyToX(f.v[0][0],f.v[0][1],0),g.applyToY(f.v[0][0],f.v[0][1],0)),d.push(g.applyToX(f.o[o-1][0],f.o[o-1][1],0),g.applyToY(f.o[o-1][0],f.o[o-1][1],0),g.applyToX(f.i[o][0],f.i[o][1],0),g.applyToY(f.i[o][0],f.i[o][1],0),g.applyToX(f.v[o][0],f.v[o][1],0),g.applyToY(f.v[o][0],f.v[o][1],0));d.push(g.applyToX(f.o[o-1][0],f.o[o-1][1],0),g.applyToY(f.o[o-1][0],f.o[o-1][1],0),g.applyToX(f.i[0][0],f.i[0][1],0),g.applyToY(f.i[0][0],f.i[0][1],0),g.applyToX(f.v[0][0],f.v[0][1],0),g.applyToY(f.v[0][0],f.v[0][1],0)),c[p]=d}v&&(b+=y[i].l,b+=P),this.textSpans[T]?this.textSpans[T].elem=c:this.textSpans[T]={elem:c},T+=1}},CVTextElement.prototype.renderInnerContent=function(){var t,e,r,i,s,a,n=this.canvasContext;n.font=this.values.fValue,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,h=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;e=l.length;var p,m,f=null,c=null,d=null;for(t=0;t<e;t+=1)if(!l[t].n){if((o=h[t])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(o.p),this.globalData.renderer.ctxOpacity(o.o)),this.fill){for(o&&o.fc?f!==o.fc&&(f=o.fc,n.fillStyle=o.fc):f!==this.values.fill&&(f=this.values.fill,n.fillStyle=this.values.fill),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<i;r+=1)for(a=(m=p[r]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(o&&o.sw?d!==o.sw&&(d=o.sw,n.lineWidth=o.sw):d!==this.values.sWidth&&(d=this.values.sWidth,n.lineWidth=this.values.sWidth),o&&o.sc?c!==o.sc&&(c=o.sc,n.strokeStyle=o.sc):c!==this.values.stroke&&(c=this.values.stroke,n.strokeStyle=this.values.stroke),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<i;r+=1)for(a=(m=p[r]).length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}o&&this.globalData.renderer.restore()}},CVEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||m()),e+=1}function l(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem===t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return f(i,t),i.setData(t,e),i}function p(){n+=1,d()}function m(){n-=1}function f(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",p),t.addEventListener("_idle",m),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new AnimationItem;return f(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),l(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),l(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){e&&"object"!=typeof e&&(e=JSON.parse(e));var r={wrapper:t,animationData:e},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";"false"===s?r.loop=!1:"true"===s?r.loop=!0:""!==s&&(r.loop=parseInt(s,10));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id===a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!==r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(FO={},FO.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},FO),FO;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:-t}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]+=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t,10)),"string"===i&&(e=parseInt(e,10)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]-=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t,10)),"string"==typeof e&&(e=parseInt(e,10)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var r;e||(e=helperLengthArray);var i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n===o)r=e=0;else{var l=n-o;switch(r=.5<h?l/(2-n-o):l/(n+o),n){case i:e=(s-a)/l+(s<a?6:0);break;case s:e=(a-i)/l+2;break;case a:e=(i-s)/l+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)r=i=e=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n,o=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*o;var h=i.length,l=createTypedArray("float32",h);for(n=0;n<h;n+=1)l[n]=i[n]+(s[n]-i[n])*o;return l}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shapePool.newElement();n.setPathData(!!i,a);var o,h,l=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:l,h=r&&r[s]?r[s]:l,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),l=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)l[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r),1<e?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(s)){var o,h=s.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=(a[o]-s[o])*n+s[o];return l}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[l.length-1].t;if(h<=p)return this.pv;if(r?s=p-(i=e?Math.abs(p-this.elem.comp.globalData.frameRate*e):Math.max(0,p-this.elem.data.ip)):((!e||e>l.length-1)&&(e=l.length-1),i=p-(s=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=(f[a]-m[a])*d+c[a];return o}return(f-m)*d+c}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-p)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-p)/.001*(u-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[0].t;if(p<=h)return this.pv;if(r?s=p+(i=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>l.length-1)&&(e=l.length-1),i=(s=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/i)%2==0)return this.getValueAtTime(((p-h)%i+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(p/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(p-h)%i+p)/this.comp.globalData.frameRate,0),d=Math.floor((p-h)/i)+1;if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(f[a]-m[a])*d;return o}return c-(f-m)*d}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(p-h)/.001;return o}return u+(u-y)*(p-h)/.001}}return this.getValueAtTime((i-((p-h)%i+p))/this.comp.globalData.frameRate,0)}function l(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(t);e.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var i=this.s.getValueAtTime(t);e.scale(i[0]*this.s.mult,i[1]*this.s.mult,i[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),l=this.rx.getValueAtTime(t),p=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(l*this.rx.mult).rotateZ(-p[2]*this.or.mult).rotateY(p[1]*this.or.mult).rotateX(p[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var m=this.px.getValueAtTime(t),f=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(m*this.px.mult,f*this.py.mult,-c*this.pz.mult)}else e.translate(m*this.px.mult,f*this.py.mult,0)}else{var d=this.p.getValueAtTime(t);e.translate(d[0]*this.p.mult,d[1]*this.p.mult,-d[2]*this.p.mult)}return e}.bind(i):i.getValueAtTime=function(){return this.v.clone(new Matrix)}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var p=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=p(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=l,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r,i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var s=i._length,a=i[t],n=i.v,o=createSizedArray(s);for(r=0;r<s;r+=1)o[r]="i"===t||"o"===t?[a[r][0]-n[r][0],a[r][1]-n[r][1]]:[a[r][0],a[r][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,l=0;o<h;){if(l+a[o].addedLength>n){var p=o,m=r.c&&o===h-1?0:o+1,f=(n-l)/a[o].addedLength;i=bez.getPointInSegment(r.v[p],r.v[m],r.o[p],r.i[m],f,a[o]);break}l+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){1==t?t=this.v.c:0==t&&(t=.999);var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null};var ShapePathInterface=function(t,e,r){var i=e.sh;function s(t){return"Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t?s.path:null}var a=propertyGroupFactory(s,r);return i.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:r}}),s},propertyGroupFactory=function(e,r){return function(t){return(t=void 0===t?1:t)<=0?e:r(t-1)}},PropertyInterface=function(t,e){var r={_name:t};return function(t){return(t=void 0===t?1:t)<=0?r:e(t-1)}},ShapeExpressionInterface=function(){function n(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"===t[i].ty?s.push(o(t[i],e[i],r)):"fl"===t[i].ty?s.push(h(t[i],e[i],r)):"st"===t[i].ty?s.push(l(t[i],e[i],r)):"tm"===t[i].ty?s.push(p(t[i],e[i],r)):"tr"===t[i].ty||("el"===t[i].ty?s.push(f(t[i],e[i],r)):"sr"===t[i].ty?s.push(c(t[i],e[i],r)):"sh"===t[i].ty?s.push(ShapePathInterface(t[i],e[i],r)):"rc"===t[i].ty?s.push(d(t[i],e[i],r)):"rd"===t[i].ty?s.push(u(t[i],e[i],r)):"rp"===t[i].ty&&s.push(y(t[i],e[i],r)));return s}function o(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,e,r){var i,s=function(t){for(var e=0,r=i.length;e<r;){if(i[e]._name===t||i[e].mn===t||i[e].propertyIndex===t||i[e].ix===t||i[e].ind===t)return i[e];e+=1}return"number"==typeof t?i[t-1]:null};s.propertyGroup=propertyGroupFactory(s,r),i=n(t.it,e.it,s.propertyGroup),s.numProperties=i.length;var a=m(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,i.propertyGroup),a=m(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function h(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:null}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),i}function l(t,e,r){var i,s=propertyGroupFactory(l,r),a=propertyGroupFactory(h,s);var n,o=t.d?t.d.length:0,h={};for(i=0;i<o;i+=1)n=i,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[i].p.setGroupProperty(a);function l(t){return"Color"===t||"color"===t?l.color:"Opacity"===t||"opacity"===t?l.opacity:"Stroke Width"===t||"stroke width"===t?l.strokeWidth:null}return Object.defineProperties(l,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",s)),e.o.setGroupProperty(PropertyInterface("Opacity",s)),e.w.setGroupProperty(PropertyInterface("Stroke Width",s)),l}function p(e,t,r){function i(t){return t===e.e.ix||"End"===t||"end"===t?i.end:t===e.s.ix?i.start:t===e.o.ix?i.offset:null}var s=propertyGroupFactory(i,r);return i.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),i.propertyIndex=e.ix,i.propertyGroup=r,Object.defineProperties(i,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),i.mn=e.mn,i}function m(e,t,r){function i(t){return e.a.ix===t||"Anchor Point"===t?i.anchorPoint:e.o.ix===t||"Opacity"===t?i.opacity:e.p.ix===t||"Position"===t?i.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?i.rotation:e.s.ix===t||"Scale"===t?i.scale:e.sk&&e.sk.ix===t||"Skew"===t?i.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?i.skewAxis:null}var s=propertyGroupFactory(i,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(i,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),i.ty="tr",i.mn=e.mn,i.propertyGroup=r,i}function f(e,t,r){function i(t){return e.p.ix===t?i.position:e.s.ix===t?i.size:null}var s=propertyGroupFactory(i,r);i.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(i,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),i.mn=e.mn,i}function c(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.rotation:e.pt.ix===t?i.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?i.outerRadius:e.os.ix===t?i.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?i.innerRoundness:null:i.innerRadius}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),i.mn=e.mn,i}function d(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?i.size:null}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),i.mn=e.mn,i}function u(e,t,r){function i(t){return e.r.ix===t||"Round Corners 1"===t?i.radius:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(i,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),i.mn=e.mn,i}function y(e,t,r){function i(t){return e.c.ix===t||"Copies"===t?i.copies:e.o.ix===t||"Offset"===t?i.offset:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(i,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),i.mn=e.mn,i}return function(t,e,i){var s;function r(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,r=s.length;e<r;){if(s[e]._name===t)return s[e];e+=1}return null}return r.propertyGroup=propertyGroupFactory(r,function(){return i}),s=n(t,e,r.propertyGroup),r.numProperties=s.length,r._name="Contents",r}}(),TextExpressionInterface=function(e){var r;function i(t){switch(t){case"ADBE Text Document":return i.sourceText;default:return null}}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),i},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,t)}function n(t,e){var r=this.getMatrix(e);return this.applyPoint(r,t)}function o(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,t)}function h(t,e){var r=this.getMatrix(e);return this.invertPoint(r,t)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function m(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function f(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect;case"ADBE Text Properties":return i.textInterface;default:return null}}i.getMatrix=s,i.invertPoint=p,i.applyPoint=l,i.toWorld=n,i.toWorldVec=a,i.fromWorld=h,i.fromWorldVec=o,i.toComp=n,i.fromComp=m,i.sampleImage=f,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity;default:return null}}var r,i,s,a;return Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p?a=ExpressionPropertyInterface(t.p):(r=ExpressionPropertyInterface(t.px),i=ExpressionPropertyInterface(t.py),t.pz&&(s=ExpressionPropertyInterface(t.pz))),Object.defineProperty(e,"position",{get:function(){return t.p?a():[r(),i(),s?s():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function l(s,t,e,r){function i(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?o[r]:o[r]();r+=1}throw new Error}var a,n=propertyGroupFactory(i,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(l(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,r)):o.push(p(t.effectElements[a],s.ef[a].ty,r,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(i,"color",{get:function(){return o[0]()}}),Object.defineProperties(i,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),i.enabled=0!==s.en,i.active=i.enabled,i}function p(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",i)),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(l(s[r],t.effectsManager.effectElements[r],e,t));var n=t.data.ef||[],o=function(t){for(r=0,a=n.length;r<a;){if(t===n[r].nm||t===n[r].mn||t===n[r].ix)return i[r];r+=1}return null};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}return null}}}(),MaskManagerInterface=function(){function t(t,e){this._mask=t,this._data=e}Object.defineProperty(t.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(t.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new t(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(!i.numKeys)return 0;var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r.value="unidimensional"===a?e[0]:e,r},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)a[t]=e.v[t]*r,s[t]=a[t];return s}}(t):e}}();function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var r,i=t.ef||[];this.effectElements=[];var s,a=i.length;for(r=0;r<a;r+=1)s=new GroupEffect(i[r],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}!function(){!function(){function t(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}}();var i=TextSelectorProp.getTextSelectorProp;TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new TextExpressionSelectorPropFactory(t,e,r):i(t,e,r)}}(),extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){var r;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottie={};function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;default:case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r<e.length;r+=1){var i=e[r].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.7.6";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="",queryString;if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src.replace(/^[^\?]+\??/,""),renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
 return lottie;
 }));
\ No newline at end of file
diff --git a/build/player/lottie_canvas_worker.js b/build/player/lottie_canvas_worker.js
index bc6df83..3e781ff 100644
--- a/build/player/lottie_canvas_worker.js
+++ b/build/player/lottie_canvas_worker.js
@@ -9,362 +9,398 @@
         root.lottie = factory(root);
         root.bodymovin = root.lottie;
     }
-}((window || {}), function(window) {
-	var lottiejs = (function(window) {
-    "use strict";
-    var svgNS = "http://www.w3.org/2000/svg";
+}((self || {}), function(window) {
+	/* global defaultCurveSegments:writable, roundValues, animationManager */
+var lottie = (function () {
+  'use strict';
+
+  /* exported svgNS, locationHref, initialDefaultFrame */
+
+var svgNS = 'http://www.w3.org/2000/svg';
 
 var locationHref = '';
 
 var initialDefaultFrame = -999999;
 
+/* global createSizedArray */
+/* exported subframeEnabled, expressionsPlugin, isSafari, cachedColors, bmPow, bmSqrt, bmFloor, bmMax, bmMin, ProjectInterface,
+defaultCurveSegments, degToRads, roundCorner, bmRnd, styleDiv, BMEnterFrameEvent, BMCompleteEvent, BMCompleteLoopEvent,
+BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, BMAnimationConfigErrorEvent, createElementID,
+addSaturationToRGB, addBrightnessToRGB, addHueToRGB, rgbToHex */
+
 var subframeEnabled = true;
 var expressionsPlugin;
 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
+var bmRnd;
+var bmPow = Math.pow;
+var bmSqrt = Math.sqrt;
+var bmFloor = Math.floor;
+var bmMax = Math.max;
+var bmMin = Math.min;
 
 var BMMath = {};
-(function(){
-    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"];
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
+(function () {
+  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'];
+  var i;
+  var len = propertyNames.length;
+  for (i = 0; i < len; i += 1) {
+    BMMath[propertyNames[i]] = Math[propertyNames[i]];
+  }
 }());
 
-function ProjectInterface(){return {};}
+function ProjectInterface() { return {}; }
 
 BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = createSizedArray(val.length);
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
+BMMath.abs = function (val) {
+  var tOfVal = typeof val;
+  if (tOfVal === 'object' && val.length) {
+    var absArr = createSizedArray(val.length);
+    var i;
+    var len = val.length;
+    for (i = 0; i < len; i += 1) {
+      absArr[i] = Math.abs(val[i]);
     }
-    return Math.abs(val);
-
+    return absArr;
+  }
+  return Math.abs(val);
 };
 var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
+var degToRads = Math.PI / 180;
 var roundCorner = 0.5519;
 
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
+function roundValues(flag) {
+  if (flag) {
+    bmRnd = Math.round;
+  } else {
+    bmRnd = function (val) {
+      return val;
+    };
+  }
 }
 roundValues(false);
 
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
+function styleDiv(element) {
+  element.style.position = 'absolute';
+  element.style.top = 0;
+  element.style.left = 0;
+  element.style.display = 'block';
+  element.style.transformOrigin = '0 0';
+  element.style.webkitTransformOrigin = '0 0';
+  element.style.backfaceVisibility = 'visible';
+  element.style.webkitBackfaceVisibility = 'visible';
+  element.style.transformStyle = 'preserve-3d';
+  element.style.webkitTransformStyle = 'preserve-3d';
+  element.style.mozTransformStyle = 'preserve-3d';
 }
 
-function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
-    this.type = type;
-    this.currentTime = currentTime;
-    this.totalTime = totalTime;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
+  this.type = type;
+  this.currentTime = currentTime;
+  this.totalTime = totalTime;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteEvent(type, frameMultiplier){
-    this.type = type;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteEvent(type, frameMultiplier) {
+  this.type = type;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
-    this.type = type;
-    this.currentLoop = currentLoop;
-    this.totalLoops = totalLoops;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
+  this.type = type;
+  this.currentLoop = currentLoop;
+  this.totalLoops = totalLoops;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMSegmentStartEvent(type, firstFrame, totalFrames){
-    this.type = type;
-    this.firstFrame = firstFrame;
-    this.totalFrames = totalFrames;
+function BMSegmentStartEvent(type, firstFrame, totalFrames) {
+  this.type = type;
+  this.firstFrame = firstFrame;
+  this.totalFrames = totalFrames;
 }
 
-function BMDestroyEvent(type, target){
-    this.type = type;
-    this.target = target;
+function BMDestroyEvent(type, target) {
+  this.type = type;
+  this.target = target;
 }
 
 function BMRenderFrameErrorEvent(nativeError, currentTime) {
-    this.type = 'renderFrameError';
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = 'renderFrameError';
+  this.nativeError = nativeError;
+  this.currentTime = currentTime;
 }
 
 function BMConfigErrorEvent(nativeError) {
-    this.type = 'configError';
-    this.nativeError = nativeError;
+  this.type = 'configError';
+  this.nativeError = nativeError;
 }
 
 function BMAnimationConfigErrorEvent(type, nativeError) {
-    this.type = type;
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = type;
+  this.nativeError = nativeError;
 }
 
-var createElementID = (function(){
-    var _count = 0;
-    return function createID() {
-        return '__lottie_element_' + ++_count
-    }
-}())
+var createElementID = (function () {
+  var _count = 0;
+  return function createID() {
+    _count += 1;
+    return '__lottie_element_' + _count;
+  };
+}());
 
 function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v; g = t; b = p; break;
-        case 1: r = q; g = v; b = p; break;
-        case 2: r = p; g = v; b = t; break;
-        case 3: r = p; g = q; b = v; break;
-        case 4: r = t; g = p; b = v; break;
-        case 5: r = v; g = p; b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
+  var r;
+  var g;
+  var b;
+  var i;
+  var f;
+  var p;
+  var q;
+  var t;
+  i = Math.floor(h * 6);
+  f = h * 6 - i;
+  p = v * (1 - s);
+  q = v * (1 - f * s);
+  t = v * (1 - (1 - f) * s);
+  switch (i % 6) {
+    case 0: r = v; g = t; b = p; break;
+    case 1: r = q; g = v; b = p; break;
+    case 2: r = p; g = v; b = t; break;
+    case 3: r = p; g = q; b = v; break;
+    case 4: r = t; g = p; b = v; break;
+    case 5: r = v; g = p; b = q; break;
+    default: break;
+  }
+  return [r,
+    g,
+    b];
 }
 
 function RGBtoHSV(r, g, b) {
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
+  var max = Math.max(r, g, b);
+  var min = Math.min(r, g, b);
+  var d = max - min;
+  var h;
+  var s = (max === 0 ? 0 : d / max);
+  var v = max / 255;
 
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
+  switch (max) {
+    case min: h = 0; break;
+    case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break;
+    case g: h = (b - r) + d * 2; h /= 6 * d; break;
+    case b: h = (r - g) + d * 4; h /= 6 * d; break;
+    default: break;
+  }
 
-    return [
-         h,
-         s,
-         v
-    ];
+  return [
+    h,
+    s,
+    v,
+  ];
 }
 
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addSaturationToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[1] += offset;
+  if (hsv[1] > 1) {
+    hsv[1] = 1;
+  } else if (hsv[1] <= 0) {
+    hsv[1] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addBrightnessToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[2] += offset;
+  if (hsv[2] > 1) {
+    hsv[2] = 1;
+  } else if (hsv[2] < 0) {
+    hsv[2] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addHueToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[0] += offset / 360;
+  if (hsv[0] > 1) {
+    hsv[0] -= 1;
+  } else if (hsv[0] < 0) {
+    hsv[0] += 1;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
+var rgbToHex = (function () {
+  var colorMap = [];
+  var i;
+  var hex;
+  for (i = 0; i < 256; i += 1) {
+    hex = i.toString(16);
+    colorMap[i] = hex.length === 1 ? '0' + hex : hex;
+  }
 
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
+  return function (r, g, b) {
+    if (r < 0) {
+      r = 0;
+    }
+    if (g < 0) {
+      g = 0;
+    }
+    if (b < 0) {
+      b = 0;
+    }
+    return '#' + colorMap[r] + colorMap[g] + colorMap[b];
+  };
 }());
-function BaseEvent(){}
-BaseEvent.prototype = {
-	triggerEvent: function (eventName, args) {
-	    if (this._cbs[eventName]) {
-	        var len = this._cbs[eventName].length;
-	        for (var i = 0; i < len; i++){
-	            this._cbs[eventName][i](args);
-	        }
-	    }
-	},
-	addEventListener: function (eventName, callback) {
-	    if (!this._cbs[eventName]){
-	        this._cbs[eventName] = [];
-	    }
-	    this._cbs[eventName].push(callback);
 
-		return function() {
-			this.removeEventListener(eventName, callback);
-		}.bind(this);
-	},
-	removeEventListener: function (eventName,callback){
-	    if (!callback){
-	        this._cbs[eventName] = null;
-	    }else if(this._cbs[eventName]){
-	        var i = 0, len = this._cbs[eventName].length;
-	        while(i<len){
-	            if(this._cbs[eventName][i] === callback){
-	                this._cbs[eventName].splice(i,1);
-	                i -=1;
-	                len -= 1;
-	            }
-	            i += 1;
-	        }
-	        if(!this._cbs[eventName].length){
-	            this._cbs[eventName] = null;
-	        }
-	    }
-	}
+function BaseEvent() {}
+BaseEvent.prototype = {
+  triggerEvent: function (eventName, args) {
+    if (this._cbs[eventName]) {
+      var len = this._cbs[eventName].length;
+      for (var i = 0; i < len; i += 1) {
+        this._cbs[eventName][i](args);
+      }
+    }
+  },
+  addEventListener: function (eventName, callback) {
+    if (!this._cbs[eventName]) {
+      this._cbs[eventName] = [];
+    }
+    this._cbs[eventName].push(callback);
+
+    return function () {
+      this.removeEventListener(eventName, callback);
+    }.bind(this);
+  },
+  removeEventListener: function (eventName, callback) {
+    if (!callback) {
+      this._cbs[eventName] = null;
+    } else if (this._cbs[eventName]) {
+      var i = 0;
+      var len = this._cbs[eventName].length;
+      while (i < len) {
+        if (this._cbs[eventName][i] === callback) {
+          this._cbs[eventName].splice(i, 1);
+          i -= 1;
+          len -= 1;
+        }
+        i += 1;
+      }
+      if (!this._cbs[eventName].length) {
+        this._cbs[eventName] = null;
+      }
+    }
+  },
 };
-var createTypedArray = (function(){
-	function createRegularArray(type, len){
-		var i = 0, arr = [], value;
-		switch(type) {
-			case 'int16':
-			case 'uint8c':
-				value = 1;
-				break;
-			default:
-				value = 1.1;
-				break;
-		}
-		for(i = 0; i < len; i += 1) {
-			arr.push(value);
-		}
-		return arr;
-	}
-	function createTypedArray(type, len){
-		if(type === 'float32') {
-			return new Float32Array(len);
-		} else if(type === 'int16') {
-			return new Int16Array(len);
-		} else if(type === 'uint8c') {
-			return new Uint8ClampedArray(len);
-		}
-	}
-	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
-		return createTypedArray;
-	} else {
-		return createRegularArray;
-	}
+
+/* exported createTypedArray, createSizedArray */
+
+var createTypedArray = (function () {
+  function createRegularArray(type, len) {
+    var i = 0;
+    var arr = [];
+    var value;
+    switch (type) {
+      case 'int16':
+      case 'uint8c':
+        value = 1;
+        break;
+      default:
+        value = 1.1;
+        break;
+    }
+    for (i = 0; i < len; i += 1) {
+      arr.push(value);
+    }
+    return arr;
+  }
+  function createTypedArrayFactory(type, len) {
+    if (type === 'float32') {
+      return new Float32Array(len);
+    } if (type === 'int16') {
+      return new Int16Array(len);
+    } if (type === 'uint8c') {
+      return new Uint8ClampedArray(len);
+    }
+    return createRegularArray(type, len);
+  }
+  if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+    return createTypedArrayFactory;
+  }
+  return createRegularArray;
 }());
 
 function createSizedArray(len) {
-	return Array.apply(null,{length:len});
+  return Array.apply(null, { length: len });
 }
+
+/* exported createTag */
+
 function createTag(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElement(type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElement(type);
 }
-function DynamicPropertyContainer(){};
+
+function DynamicPropertyContainer() {}
 DynamicPropertyContainer.prototype = {
-	addDynamicProperty: function(prop) {
-		if(this.dynamicProperties.indexOf(prop) === -1) {
-	        this.dynamicProperties.push(prop);
-	        this.container.addDynamicProperty(this);
-	    	this._isAnimated = true;
-	    }
-	},
-	iterateDynamicProperties: function(){
-	    this._mdf = false;
-	    var i, len = this.dynamicProperties.length;
-	    for(i=0;i<len;i+=1){
-	        this.dynamicProperties[i].getValue();
-	        if(this.dynamicProperties[i]._mdf) {
-	            this._mdf = true;
-	        }
-	    }
-	},
-	initDynamicPropertyContainer: function(container){
-	    this.container = container;
-	    this.dynamicProperties = [];
-	    this._mdf = false;
-	    this._isAnimated = false;
-	}
-}
-var getBlendMode = (function() {
-
-	var blendModeEnums = {
-        0:'source-over',
-        1:'multiply',
-        2:'screen',
-        3:'overlay',
-        4:'darken',
-        5:'lighten',
-        6:'color-dodge',
-        7:'color-burn',
-        8:'hard-light',
-        9:'soft-light',
-        10:'difference',
-        11:'exclusion',
-        12:'hue',
-        13:'saturation',
-        14:'color',
-        15:'luminosity'
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+      this.container.addDynamicProperty(this);
+      this._isAnimated = true;
     }
+  },
+  iterateDynamicProperties: function () {
+    this._mdf = false;
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      this.dynamicProperties[i].getValue();
+      if (this.dynamicProperties[i]._mdf) {
+        this._mdf = true;
+      }
+    }
+  },
+  initDynamicPropertyContainer: function (container) {
+    this.container = container;
+    this.dynamicProperties = [];
+    this._mdf = false;
+    this._isAnimated = false;
+  },
+};
 
-	return function(mode) {
-		return blendModeEnums[mode] || '';
-	}
-}())
+/* exported getBlendMode */
+
+var getBlendMode = (function () {
+  var blendModeEnums = {
+    0: 'source-over',
+    1: 'multiply',
+    2: 'screen',
+    3: 'overlay',
+    4: 'darken',
+    5: 'lighten',
+    6: 'color-dodge',
+    7: 'color-burn',
+    8: 'hard-light',
+    9: 'soft-light',
+    10: 'difference',
+    11: 'exclusion',
+    12: 'hue',
+    13: 'saturation',
+    14: 'color',
+    15: 'luminosity',
+  };
+
+  return function (mode) {
+    return blendModeEnums[mode] || '';
+  };
+}());
+
+/* global createTypedArray */
+
 /*!
  Transformation Matrix v2.0
  (c) Epistemex 2014-2015
@@ -394,394 +430,399 @@
  * @constructor
  */
 
-var Matrix = (function(){
+var Matrix = (function () {
+  var _cos = Math.cos;
+  var _sin = Math.sin;
+  var _tan = Math.tan;
+  var _rnd = Math.round;
 
-    var _cos = Math.cos;
-    var _sin = Math.sin;
-    var _tan = Math.tan;
-    var _rnd = Math.round;
+  function reset() {
+    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;
+    return this;
+  }
 
-    function reset(){
-        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;
-        return this;
+  function rotate(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function rotateX(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateY(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateZ(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function shear(sx, sy) {
+    return this._t(1, sy, sx, 1, 0, 0);
+  }
+
+  function skew(ax, ay) {
+    return this.shear(_tan(ax), _tan(ay));
+  }
+
+  function skewFromAxis(ax, angle) {
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    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);
+  }
+
+  function scale(sx, sy, sz) {
+    if (!sz && sz !== 0) {
+      sz = 1;
+    }
+    if (sx === 1 && sy === 1 && sz === 1) {
+      return this;
+    }
+    return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
+  }
+
+  function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
+    this.props[0] = a;
+    this.props[1] = b;
+    this.props[2] = c;
+    this.props[3] = d;
+    this.props[4] = e;
+    this.props[5] = f;
+    this.props[6] = g;
+    this.props[7] = h;
+    this.props[8] = i;
+    this.props[9] = j;
+    this.props[10] = k;
+    this.props[11] = l;
+    this.props[12] = m;
+    this.props[13] = n;
+    this.props[14] = o;
+    this.props[15] = p;
+    return this;
+  }
+
+  function translate(tx, ty, tz) {
+    tz = tz || 0;
+    if (tx !== 0 || ty !== 0 || tz !== 0) {
+      return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
+    }
+    return this;
+  }
+
+  function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
+    var _p = this.props;
+
+    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) {
+      // NOTE: commenting this condition because TurboFan deoptimizes code when present
+      // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+      _p[12] = _p[12] * a2 + _p[15] * m2;
+      _p[13] = _p[13] * f2 + _p[15] * n2;
+      _p[14] = _p[14] * k2 + _p[15] * o2;
+      _p[15] *= p2;
+      // }
+      this._identityCalculated = false;
+      return this;
     }
 
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
+    var a1 = _p[0];
+    var b1 = _p[1];
+    var c1 = _p[2];
+    var d1 = _p[3];
+    var e1 = _p[4];
+    var f1 = _p[5];
+    var g1 = _p[6];
+    var h1 = _p[7];
+    var i1 = _p[8];
+    var j1 = _p[9];
+    var k1 = _p[10];
+    var l1 = _p[11];
+    var m1 = _p[12];
+    var n1 = _p[13];
+    var o1 = _p[14];
+    var p1 = _p[15];
 
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(_tan(ax), _tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        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);
-    }
-
-    function scale(sx, sy, sz) {
-        if(!sz && sz !== 0) {
-            sz = 1;
-        }
-        if(sx === 1 && sy === 1 && sz === 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        var _p = this.props;
-
-        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){
-            //NOTE: commenting this condition because TurboFan deoptimizes code when present
-            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-                _p[12] = _p[12] * a2 + _p[15] * m2;
-                _p[13] = _p[13] * f2 + _p[15] * n2;
-                _p[14] = _p[14] * k2 + _p[15] * o2;
-                _p[15] = _p[15] * p2;
-            //}
-            this._identityCalculated = false;
-            return this;
-        }
-
-        var a1 = _p[0];
-        var b1 = _p[1];
-        var c1 = _p[2];
-        var d1 = _p[3];
-        var e1 = _p[4];
-        var f1 = _p[5];
-        var g1 = _p[6];
-        var h1 = _p[7];
-        var i1 = _p[8];
-        var j1 = _p[9];
-        var k1 = _p[10];
-        var l1 = _p[11];
-        var m1 = _p[12];
-        var n1 = _p[13];
-        var o1 = _p[14];
-        var p1 = _p[15];
-
-        /* matrix order (canvas compatible):
+    /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+    _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+    _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
+    _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
+    _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
 
-        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+    _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
+    _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
+    _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
+    _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
 
-        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+    _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
+    _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
+    _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
+    _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
 
-        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+    _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
+    _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
+    _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
+    _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
 
-        this._identityCalculated = false;
-        return this;
+    this._identityCalculated = false;
+    return this;
+  }
+
+  function isIdentity() {
+    if (!this._identityCalculated) {
+      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);
+      this._identityCalculated = true;
     }
+    return this._identity;
+  }
 
-    function isIdentity() {
-        if(!this._identityCalculated){
-            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);
-            this._identityCalculated = true;
-        }
-        return this._identity;
+  function equals(matr) {
+    var i = 0;
+    while (i < 16) {
+      if (matr.props[i] !== this.props[i]) {
+        return false;
+      }
+      i += 1;
     }
+    return true;
+  }
 
-    function equals(matr){
-        var i = 0;
-        while (i < 16) {
-            if(matr.props[i] !== this.props[i]) {
-                return false;
-            }
-            i+=1;
-        }
-        return true;
+  function clone(matr) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      matr.props[i] = this.props[i];
     }
+    return matr;
+  }
 
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-        return matr;
+  function cloneFromProps(props) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      this.props[i] = props[i];
     }
+  }
 
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
+  function applyToPoint(x, y, z) {
+    return {
+      x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
+      y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
+      z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14],
+    };
+    /* return {
          x: x * me.a + y * me.c + me.e,
          y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
+         }; */
+  }
+  function applyToX(x, y, z) {
+    return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
+  }
+  function applyToY(x, y, z) {
+    return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
+  }
+  function applyToZ(x, y, z) {
+    return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
+  }
 
-    function getInverseMatrix() {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        var inverseMatrix = new Matrix();
-        inverseMatrix.props[0] = a;
-        inverseMatrix.props[1] = b;
-        inverseMatrix.props[4] = c;
-        inverseMatrix.props[5] = d;
-        inverseMatrix.props[12] = e;
-        inverseMatrix.props[13] = f;
-        return inverseMatrix;
-    }
+  function getInverseMatrix() {
+    var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
+    var a = this.props[5] / determinant;
+    var b = -this.props[1] / determinant;
+    var c = -this.props[4] / determinant;
+    var d = this.props[0] / determinant;
+    var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
+    var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
+    var inverseMatrix = new Matrix();
+    inverseMatrix.props[0] = a;
+    inverseMatrix.props[1] = b;
+    inverseMatrix.props[4] = c;
+    inverseMatrix.props[5] = d;
+    inverseMatrix.props[12] = e;
+    inverseMatrix.props[13] = f;
+    return inverseMatrix;
+  }
 
-    function inversePoint(pt) {
-        var inverseMatrix = this.getInverseMatrix();
-        return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
-    }
+  function inversePoint(pt) {
+    var inverseMatrix = this.getInverseMatrix();
+    return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
+  }
 
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
+  function inversePoints(pts) {
+    var i;
+    var len = pts.length;
+    var retPts = [];
+    for (i = 0; i < len; i += 1) {
+      retPts[i] = inversePoint(pts[i]);
     }
+    return retPts;
+  }
 
-    function applyToTriplePoints(pt1, pt2, pt3) {
-        var arr = createTypedArray('float32', 6);
-        if(this.isIdentity()) {
-            arr[0] = pt1[0];
-            arr[1] = pt1[1];
-            arr[2] = pt2[0];
-            arr[3] = pt2[1];
-            arr[4] = pt3[0];
-            arr[5] = pt3[1];
-        } else {
-            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
-            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
-            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
-            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
-            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
-            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
-            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
-        }
-        return arr;
+  function applyToTriplePoints(pt1, pt2, pt3) {
+    var arr = createTypedArray('float32', 6);
+    if (this.isIdentity()) {
+      arr[0] = pt1[0];
+      arr[1] = pt1[1];
+      arr[2] = pt2[0];
+      arr[3] = pt2[1];
+      arr[4] = pt3[0];
+      arr[5] = pt3[1];
+    } else {
+      var p0 = this.props[0];
+      var p1 = this.props[1];
+      var p4 = this.props[4];
+      var p5 = this.props[5];
+      var p12 = this.props[12];
+      var p13 = this.props[13];
+      arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+      arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+      arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+      arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+      arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+      arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
     }
+    return arr;
+  }
 
-    function applyToPointArray(x,y,z){
-        var arr;
-        if(this.isIdentity()) {
-            arr = [x,y,z];
-        } else {
-            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]
-            ];
-        }
-        return arr;
+  function applyToPointArray(x, y, z) {
+    var arr;
+    if (this.isIdentity()) {
+      arr = [x, y, z];
+    } else {
+      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],
+      ];
     }
+    return arr;
+  }
 
-    function applyToPointStringified(x, y) {
-        if(this.isIdentity()) {
-            return x + ',' + y;
-        }
-        var _p = this.props;
-        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;
+  function applyToPointStringified(x, y) {
+    if (this.isIdentity()) {
+      return x + ',' + y;
     }
+    var _p = this.props;
+    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;
+  }
 
-    function toCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function toCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var i = 0;
-        var props = this.props;
-        var cssValue = 'matrix3d(';
-        var v = 10000;
-        while(i<16){
-            cssValue += _rnd(props[i]*v)/v;
-            cssValue += i === 15 ? ')':',';
-            i += 1;
-        }
-        return cssValue;
+        } */
+    var i = 0;
+    var props = this.props;
+    var cssValue = 'matrix3d(';
+    var v = 10000;
+    while (i < 16) {
+      cssValue += _rnd(props[i] * v) / v;
+      cssValue += i === 15 ? ')' : ',';
+      i += 1;
     }
+    return cssValue;
+  }
 
-    function roundMatrixProperty(val) {
-        var v = 10000;
-        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
-            return _rnd(val * v) / v;
-        }
-        return val;
+  function roundMatrixProperty(val) {
+    var v = 10000;
+    if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+      return _rnd(val * v) / v;
     }
+    return val;
+  }
 
-    function to2dCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function to2dCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var props = this.props;
-        var _a = roundMatrixProperty(props[0]);
-        var _b = roundMatrixProperty(props[1]);
-        var _c = roundMatrixProperty(props[4]);
-        var _d = roundMatrixProperty(props[5]);
-        var _e = roundMatrixProperty(props[12]);
-        var _f = roundMatrixProperty(props[13]);
-        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
-    }
+        } */
+    var props = this.props;
+    var _a = roundMatrixProperty(props[0]);
+    var _b = roundMatrixProperty(props[1]);
+    var _c = roundMatrixProperty(props[4]);
+    var _d = roundMatrixProperty(props[5]);
+    var _e = roundMatrixProperty(props[12]);
+    var _f = roundMatrixProperty(props[13]);
+    return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
+  }
 
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToTriplePoints = applyToTriplePoints;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.equals = equals;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this.getInverseMatrix = getInverseMatrix;
-        this._t = this.transform;
-        this.isIdentity = isIdentity;
-        this._identity = true;
-        this._identityCalculated = false;
+  return function () {
+    this.reset = reset;
+    this.rotate = rotate;
+    this.rotateX = rotateX;
+    this.rotateY = rotateY;
+    this.rotateZ = rotateZ;
+    this.skew = skew;
+    this.skewFromAxis = skewFromAxis;
+    this.shear = shear;
+    this.scale = scale;
+    this.setTransform = setTransform;
+    this.translate = translate;
+    this.transform = transform;
+    this.applyToPoint = applyToPoint;
+    this.applyToX = applyToX;
+    this.applyToY = applyToY;
+    this.applyToZ = applyToZ;
+    this.applyToPointArray = applyToPointArray;
+    this.applyToTriplePoints = applyToTriplePoints;
+    this.applyToPointStringified = applyToPointStringified;
+    this.toCSS = toCSS;
+    this.to2dCSS = to2dCSS;
+    this.clone = clone;
+    this.cloneFromProps = cloneFromProps;
+    this.equals = equals;
+    this.inversePoints = inversePoints;
+    this.inversePoint = inversePoint;
+    this.getInverseMatrix = getInverseMatrix;
+    this._t = this.transform;
+    this.isIdentity = isIdentity;
+    this._identity = true;
+    this._identityCalculated = false;
 
-        this.props = createTypedArray('float32', 16);
-        this.reset();
-    };
+    this.props = createTypedArray('float32', 16);
+    this.reset();
+  };
 }());
 
+/* eslint-disable */
 /*
  Copyright 2014 David Bau.
 
@@ -1015,8 +1056,9 @@
     [],     // pool: entropy pool starts empty
     BMMath    // math: package containing random, pow, and seedrandom
 );
-var BezierFactory = (function(){
-    /**
+/* eslint-disable */
+var BezierFactory = (function () {
+  /**
      * BezierEasing - use bezier curve for transition easing function
      * by Gaëtan Renaudeau 2014 - 2015 – MIT License
      *
@@ -1027,6710 +1069,7097 @@
      *
      */
 
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
+  var ob = {};
+  ob.getBezierEasing = getBezierEasing;
+  var beziers = {};
 
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
+  function getBezierEasing(a, b, c, d, nm) {
+    var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
+    if (beziers[str]) {
+      return beziers[str];
     }
+    var bezEasing = new BezierEasing([a, b, c, d]);
+    beziers[str] = bezEasing;
+    return bezEasing;
+  }
 
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
+  // These values are established by empiricism with tests (tradeoff: performance VS precision)
+  var NEWTON_ITERATIONS = 4;
+  var NEWTON_MIN_SLOPE = 0.001;
+  var SUBDIVISION_PRECISION = 0.0000001;
+  var SUBDIVISION_MAX_ITERATIONS = 10;
 
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+  var kSplineTableSize = 11;
+  var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
 
-    var float32ArraySupported = typeof Float32Array === "function";
+  var float32ArraySupported = typeof Float32Array === 'function';
 
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
+  function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+  function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+  function C(aA1) { return 3.0 * aA1; }
 
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
+  // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+  function calcBezier(aT, aA1, aA2) {
+    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
+  }
+
+  // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+  function getSlope(aT, aA1, aA2) {
+    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
+  }
+
+  function binarySubdivide(aX, aA, aB, mX1, mX2) {
+    var currentX,
+      currentT,
+      i = 0;
+    do {
+      currentT = aA + (aB - aA) / 2.0;
+      currentX = calcBezier(currentT, mX1, mX2) - aX;
+      if (currentX > 0.0) {
+        aB = currentT;
+      } else {
+        aA = currentT;
+      }
+    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+    return currentT;
+  }
+
+  function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
+    for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+      var currentSlope = getSlope(aGuessT, mX1, mX2);
+      if (currentSlope === 0.0) return aGuessT;
+      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+      aGuessT -= currentX / currentSlope;
     }
+    return aGuessT;
+  }
 
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
+  /**
      * points is an array of [ mX1, mY1, mX2, mY2 ]
      */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
+  function BezierEasing(points) {
+    this._p = points;
+    this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+    this._precomputed = false;
 
-        this.get = this.get.bind(this);
-    }
+    this.get = this.get.bind(this);
+  }
 
-    BezierEasing.prototype = {
+  BezierEasing.prototype = {
 
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
+    get: function (x) {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      if (!this._precomputed) this._precompute();
+      if (mX1 === mY1 && mX2 === mY2) return x; // linear
+      // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+      if (x === 0) return 0;
+      if (x === 1) return 1;
+      return calcBezier(this._getTForX(x), mY1, mY2);
+    },
 
-        // Private part
+    // Private part
 
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
+    _precompute: function () {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      this._precomputed = true;
+      if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); }
+    },
 
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
+    _calcSampleValues: function () {
+      var mX1 = this._p[0],
+        mX2 = this._p[2];
+      for (var i = 0; i < kSplineTableSize; ++i) {
+        this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+      }
+    },
 
-        /**
+    /**
          * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
          */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
+    _getTForX: function (aX) {
+      var mX1 = this._p[0],
+        mX2 = this._p[2],
+        mSampleValues = this._mSampleValues;
 
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
+      var intervalStart = 0.0;
+      var currentSample = 1;
+      var lastSample = kSplineTableSize - 1;
 
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
+      for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
+        intervalStart += kSampleStepSize;
+      }
+      --currentSample;
 
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
+      // Interpolate to provide an initial guess for t
+      var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
+      var guessForT = intervalStart + dist * kSampleStepSize;
 
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
+      var initialSlope = getSlope(guessForT, mX1, mX2);
+      if (initialSlope >= NEWTON_MIN_SLOPE) {
+        return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+      } if (initialSlope === 0.0) {
+        return guessForT;
+      }
+      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+    },
+  };
 
-    return ob;
-
+  return ob;
 }());
+
 (function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
+  var lastTime = 0;
+  var vendors = ['ms', 'moz', 'webkit', 'o'];
+  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { // eslint-disable-line no-plusplus
+    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
+    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
+  }
+  if (!window.requestAnimationFrame) {
+    window.requestAnimationFrame = function (callback) {
+      var currTime = new Date().getTime();
+      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+      var id = setTimeout(function () {
+        callback(currTime + timeToCall);
+      },
+      timeToCall);
+      lastTime = currTime + timeToCall;
+      return id;
+    };
+  }
+  if (!window.cancelAnimationFrame) {
+    window.cancelAnimationFrame = function (id) {
+      clearTimeout(id);
+    };
+  }
 }());
 
-function extendPrototype(sources,destination){
-    var i, len = sources.length, sourcePrototype;
-    for (i = 0;i < len;i += 1) {
-        sourcePrototype = sources[i].prototype;
-        for (var attr in sourcePrototype) {
-            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
-        }
+/* exported extendPrototype, getDescriptor, createProxyFunction */
+
+function extendPrototype(sources, destination) {
+  var i;
+  var len = sources.length;
+  var sourcePrototype;
+  for (i = 0; i < len; i += 1) {
+    sourcePrototype = sources[i].prototype;
+    for (var attr in sourcePrototype) {
+      if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
     }
+  }
 }
 
 function getDescriptor(object, prop) {
-    return Object.getOwnPropertyDescriptor(object, prop);
+  return Object.getOwnPropertyDescriptor(object, prop);
 }
 
 function createProxyFunction(prototype) {
-	function ProxyFunction(){}
-	ProxyFunction.prototype = prototype;
-	return ProxyFunction;
+  function ProxyFunction() {}
+  ProxyFunction.prototype = prototype;
+  return ProxyFunction;
 }
-function bezFunction(){
 
-    var easingFunctions = [];
-    var math = Math;
+/* global segmentsLengthPool, defaultCurveSegments, createSizedArray, bmPow, bmSqrt, bmFloor, createTypedArray, bezierLengthPool */
+/* exported bez */
 
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.001 && det1 < 0.001;
+function bezFunction() {
+  var math = Math;
+
+  function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
+    var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1);
+    return det1 > -0.001 && det1 < 0.001;
+  }
+
+  function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
+    if (z1 === 0 && z2 === 0 && z3 === 0) {
+      return pointOnLine2D(x1, y1, x2, y2, x3, y3);
     }
+    var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
+    var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
+    var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
+    var diffDist;
+    if (dist1 > dist2) {
+      if (dist1 > dist3) {
+        diffDist = dist1 - dist2 - dist3;
+      } else {
+        diffDist = dist3 - dist2 - dist1;
+      }
+    } else if (dist3 > dist2) {
+      diffDist = dist3 - dist2 - dist1;
+    } else {
+      diffDist = dist2 - dist1 - dist3;
+    }
+    return diffDist > -0.0001 && diffDist < 0.0001;
+  }
 
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        if(z1 === 0 && z2 === 0 && z3 === 0) {
-            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+  var getBezierLength = (function () {
+    return function (pt1, pt2, pt3, pt4) {
+      var curveSegments = defaultCurveSegments;
+      var k;
+      var i;
+      var len;
+      var ptCoord;
+      var perc;
+      var addedLength = 0;
+      var ptDistance;
+      var point = [];
+      var lastPoint = [];
+      var lengthData = bezierLengthPool.newElement();
+      len = pt3.length;
+      for (k = 0; k < curveSegments; k += 1) {
+        perc = k / (curveSegments - 1);
+        ptDistance = 0;
+        for (i = 0; i < len; i += 1) {
+          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];
+          point[i] = ptCoord;
+          if (lastPoint[i] !== null) {
+            ptDistance += bmPow(point[i] - lastPoint[i], 2);
+          }
+          lastPoint[i] = point[i];
         }
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
+        if (ptDistance) {
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
         }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    var getBezierLength = (function(){
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = bezier_length_pool.newElement();
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.percents[k] = perc;
-                lengthData.lengths[k] = addedLength;
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function getSegmentsLength(shapeData) {
-        var segmentsLength = segments_length_pool.newElement();
-        var closed = shapeData.c;
-        var pathV = shapeData.v;
-        var pathO = shapeData.o;
-        var pathI = shapeData.i;
-        var i, len = shapeData._length;
-        var lengths = segmentsLength.lengths;
-        var totalLength = 0;
-        for(i=0;i<len-1;i+=1){
-            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-            totalLength += lengths[i].addedLength;
-        }
-        if(closed && len){
-            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-            totalLength += lengths[i].addedLength;
-        }
-        segmentsLength.totalLength = totalLength;
-        return segmentsLength;
-    }
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (pt1, pt2, pt3, pt4){
-            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
-            if(!storedData[bezierName]){
-                var curveSegments = defaultCurveSegments;
-                var k, i, len;
-                var ptCoord,perc,addedLength = 0;
-                var ptDistance;
-                var point,lastPoint = null;
-                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])){
-                    curveSegments = 2;
-                }
-                var bezierData = new BezierData(curveSegments);
-                len = pt3.length;
-                for (k = 0; k < curveSegments; k += 1) {
-                    point = createSizedArray(len);
-                    perc = k / (curveSegments - 1);
-                    ptDistance = 0;
-                    for (i = 0; i < len; i += 1){
-                        ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                        point[i] = ptCoord;
-                        if(lastPoint !== null){
-                            ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                        }
-                    }
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                    bezierData.points[k] = new PointData(ptDistance, point);
-                    lastPoint = point;
-                }
-                bezierData.segmentLength = addedLength;
-                storedData[bezierName] = bezierData;
-            }
-            return storedData[bezierName];
-        };
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var percents = bezierData.percents;
-        var lengths = bezierData.lengths;
-        var len = percents.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
-            return percents[initPos];
-        }else{
-            var dir = lengths[initPos] > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
-                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    //FIX for TypedArrays that don't store floating point values with enough accuracy
-                    if(initPos === len - 1) {
-                        return percents[initPos];
-                    }
-                    flag = false;
-                }
-            }
-            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
-        }
-    }
-
-    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
-        var t1 = getDistancePerc(percent,bezierData);
-        var u0 = 1;
-        var u1 = 1 - t1;
-        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;
-        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;
-        return [ptX, ptY];
-    }
-
-    function getSegmentArray() {
-
-    }
-
-    var bezier_segment_points = createTypedArray('float32', 8);
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        var u0u0u0 = u0*u0*u0;
-        var t0u0u0_3 = t0*u0*u0*3;
-        var t0t0u0_3 = t0*t0*u0*3;
-        var t0t0t0 = t0*t0*t0;
-        //
-        var u0u0u1 = u0*u0*u1;
-        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
-        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
-        var t0t0t1 = t0*t0*t1;
-        //
-        var u0u1u1 = u0*u1*u1;
-        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
-        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
-        var t0t1t1 = t0*t1*t1;
-        //
-        var u1u1u1 = u1*u1*u1;
-        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
-        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
-        var t1t1t1 = t1*t1*t1;
-        for(i=0;i<len;i+=1){
-            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
-        }
-
-        return bezier_segment_points;
-    }
-
-    return {
-        getSegmentsLength : getSegmentsLength,
-        getNewSegment : getNewSegment,
-        getPointInSegment : getPointInSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
+        lengthData.percents[k] = perc;
+        lengthData.lengths[k] = addedLength;
+      }
+      lengthData.addedLength = addedLength;
+      return lengthData;
     };
+  }());
+
+  function getSegmentsLength(shapeData) {
+    var segmentsLength = segmentsLengthPool.newElement();
+    var closed = shapeData.c;
+    var pathV = shapeData.v;
+    var pathO = shapeData.o;
+    var pathI = shapeData.i;
+    var i;
+    var len = shapeData._length;
+    var lengths = segmentsLength.lengths;
+    var totalLength = 0;
+    for (i = 0; i < len - 1; i += 1) {
+      lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
+      totalLength += lengths[i].addedLength;
+    }
+    if (closed && len) {
+      lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
+      totalLength += lengths[i].addedLength;
+    }
+    segmentsLength.totalLength = totalLength;
+    return segmentsLength;
+  }
+
+  function BezierData(length) {
+    this.segmentLength = 0;
+    this.points = new Array(length);
+  }
+
+  function PointData(partial, point) {
+    this.partialLength = partial;
+    this.point = point;
+  }
+
+  var buildBezierData = (function () {
+    var storedData = {};
+
+    return function (pt1, pt2, pt3, pt4) {
+      var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
+      if (!storedData[bezierName]) {
+        var curveSegments = defaultCurveSegments;
+        var k;
+        var i;
+        var len;
+        var ptCoord;
+        var perc;
+        var addedLength = 0;
+        var ptDistance;
+        var point;
+        var lastPoint = null;
+        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])) {
+          curveSegments = 2;
+        }
+        var bezierData = new BezierData(curveSegments);
+        len = pt3.length;
+        for (k = 0; k < curveSegments; k += 1) {
+          point = createSizedArray(len);
+          perc = k / (curveSegments - 1);
+          ptDistance = 0;
+          for (i = 0; i < len; i += 1) {
+            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];
+            point[i] = ptCoord;
+            if (lastPoint !== null) {
+              ptDistance += bmPow(point[i] - lastPoint[i], 2);
+            }
+          }
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
+          bezierData.points[k] = new PointData(ptDistance, point);
+          lastPoint = point;
+        }
+        bezierData.segmentLength = addedLength;
+        storedData[bezierName] = bezierData;
+      }
+      return storedData[bezierName];
+    };
+  }());
+
+  function getDistancePerc(perc, bezierData) {
+    var percents = bezierData.percents;
+    var lengths = bezierData.lengths;
+    var len = percents.length;
+    var initPos = bmFloor((len - 1) * perc);
+    var lengthPos = perc * bezierData.addedLength;
+    var lPerc = 0;
+    if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
+      return percents[initPos];
+    }
+    var dir = lengths[initPos] > lengthPos ? -1 : 1;
+    var flag = true;
+    while (flag) {
+      if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
+        lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
+        flag = false;
+      } else {
+        initPos += dir;
+      }
+      if (initPos < 0 || initPos >= len - 1) {
+        // FIX for TypedArrays that don't store floating point values with enough accuracy
+        if (initPos === len - 1) {
+          return percents[initPos];
+        }
+        flag = false;
+      }
+    }
+    return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
+  }
+
+  function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+    var t1 = getDistancePerc(percent, bezierData);
+    var u1 = 1 - t1;
+    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;
+    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;
+    return [ptX, ptY];
+  }
+
+  var bezierSegmentPoints = createTypedArray('float32', 8);
+
+  function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
+    if (startPerc < 0) {
+      startPerc = 0;
+    } else if (startPerc > 1) {
+      startPerc = 1;
+    }
+    var t0 = getDistancePerc(startPerc, bezierData);
+    endPerc = endPerc > 1 ? 1 : endPerc;
+    var t1 = getDistancePerc(endPerc, bezierData);
+    var i;
+    var len = pt1.length;
+    var u0 = 1 - t0;
+    var u1 = 1 - t1;
+    var u0u0u0 = u0 * u0 * u0;
+    var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0t0 = t0 * t0 * t0;
+    //
+    var u0u0u1 = u0 * u0 * u1;
+    var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0t1 = t0 * t0 * t1;
+    //
+    var u0u1u1 = u0 * u1 * u1;
+    var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1t1 = t0 * t1 * t1;
+    //
+    var u1u1u1 = u1 * u1 * u1;
+    var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1t1 = t1 * t1 * t1;
+    for (i = 0; i < len; i += 1) {
+      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
+      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
+      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
+      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
+    }
+
+    return bezierSegmentPoints;
+  }
+
+  return {
+    getSegmentsLength: getSegmentsLength,
+    getNewSegment: getNewSegment,
+    getPointInSegment: getPointInSegment,
+    buildBezierData: buildBezierData,
+    pointOnLine2D: pointOnLine2D,
+    pointOnLine3D: pointOnLine3D,
+  };
 }
 
 var bez = bezFunction();
-function dataFunctionManager(){
 
-    //var tCanvasHelper = createTag('canvas').getContext('2d');
+/* exported dataManager */
 
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
+function dataFunctionManager() {
+  // var tCanvasHelper = createTag('canvas').getContext('2d');
+
+  function completeLayers(layers, comps, fontManager) {
+    var layerData;
+    var i;
+    var len = layers.length;
+    var j;
+    var jLen;
+    var k;
+    var kLen;
+    for (i = 0; i < len; i += 1) {
+      layerData = layers[i];
+      if (('ks' in layerData) && !layerData.completed) {
+        layerData.completed = true;
+        if (layerData.tt) {
+          layers[i - 1].td = layerData.tt;
         }
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              convertPathsToAbsoluteValues(maskProps[j].pt.k);
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
+                }
+              }
+            }
+          }
+        }
+        if (layerData.ty === 0) {
+          layerData.layers = findCompLayers(layerData.refId, comps);
+          completeLayers(layerData.layers, comps, fontManager);
+        } else if (layerData.ty === 4) {
+          completeShapes(layerData.shapes);
+        } else if (layerData.ty === 5) {
+          completeText(layerData, fontManager);
+        }
+      }
+    }
+  }
+
+  function findCompLayers(id, comps) {
+    var i = 0;
+    var len = comps.length;
+    while (i < len) {
+      if (comps[i].id === id) {
+        if (!comps[i].layers.__used) {
+          comps[i].layers.__used = true;
+          return comps[i].layers;
+        }
+        return JSON.parse(JSON.stringify(comps[i].layers));
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function completeShapes(arr) {
+    var i;
+    var len = arr.length;
+    var j;
+    var jLen;
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (arr[i].ty === 'sh') {
+        if (arr[i].ks.k.i) {
+          convertPathsToAbsoluteValues(arr[i].ks.k);
+        } else {
+          jLen = arr[i].ks.k.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (arr[i].ks.k[j].s) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
+            }
+            if (arr[i].ks.k[j].e) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
+            }
+          }
+        }
+      } else if (arr[i].ty === 'gr') {
+        completeShapes(arr[i].it);
+      }
+    }
+  }
+
+  function convertPathsToAbsoluteValues(path) {
+    var i;
+    var len = path.i.length;
+    for (i = 0; i < len; i += 1) {
+      path.i[i][0] += path.v[i][0];
+      path.i[i][1] += path.v[i][1];
+      path.o[i][0] += path.v[i][0];
+      path.o[i][1] += path.v[i][1];
+    }
+  }
+
+  function checkVersion(minimum, animVersionString) {
+    var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
+    if (minimum[0] > animVersion[0]) {
+      return true;
+    } if (animVersion[0] > minimum[0]) {
+      return false;
+    }
+    if (minimum[1] > animVersion[1]) {
+      return true;
+    } if (animVersion[1] > minimum[1]) {
+      return false;
+    }
+    if (minimum[2] > animVersion[2]) {
+      return true;
+    } if (animVersion[2] > minimum[2]) {
+      return false;
+    }
+    return null;
+  }
+
+  var checkText = (function () {
+    var minimumVersion = [4, 4, 14];
+
+    function updateTextLayer(textLayer) {
+      var documentData = textLayer.t.d;
+      textLayer.t.d = {
+        k: [
+          {
+            s: documentData,
+            t: 0,
+          },
+        ],
+      };
     }
 
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                if(!comps[i].layers.__used) {
-                    comps[i].layers.__used = true;
-                    return comps[i].layers;
-                }
-                return JSON.parse(JSON.stringify(comps[i].layers));
-            }
-            i += 1;
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 5) {
+          updateTextLayer(layers[i]);
         }
+      }
     }
 
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
             }
+          }
         }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
+      }
+    };
+  }());
+
+  var checkChars = (function () {
+    var minimumVersion = [4, 7, 99];
+    return function (animationData) {
+      if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
+        var i;
+        var len = animationData.chars.length;
+        var j;
+        var jLen;
+        var pathData;
+        var paths;
+        for (i = 0; i < len; i += 1) {
+          if (animationData.chars[i].data && animationData.chars[i].data.shapes) {
+            paths = animationData.chars[i].data.shapes[0].it;
+            jLen = paths.length;
+
+            for (j = 0; j < jLen; j += 1) {
+              pathData = paths[j].ks.k;
+              if (!pathData.__converted) {
+                convertPathsToAbsoluteValues(paths[j].ks.k);
+                pathData.__converted = true;
+              }
+            }
+          }
+        }
+      }
+    };
+  }());
+
+  var checkColors = (function () {
+    var minimumVersion = [4, 1, 9];
+
+    function iterateShapes(shapes) {
+      var i;
+      var len = shapes.length;
+      var j;
+      var jLen;
+      for (i = 0; i < len; i += 1) {
+        if (shapes[i].ty === 'gr') {
+          iterateShapes(shapes[i].it);
+        } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
+          if (shapes[i].c.k && shapes[i].c.k[0].i) {
+            jLen = shapes[i].c.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (shapes[i].c.k[j].s) {
+                shapes[i].c.k[j].s[0] /= 255;
+                shapes[i].c.k[j].s[1] /= 255;
+                shapes[i].c.k[j].s[2] /= 255;
+                shapes[i].c.k[j].s[3] /= 255;
+              }
+              if (shapes[i].c.k[j].e) {
+                shapes[i].c.k[j].e[0] /= 255;
+                shapes[i].c.k[j].e[1] /= 255;
+                shapes[i].c.k[j].e[2] /= 255;
+                shapes[i].c.k[j].e[3] /= 255;
+              }
+            }
+          } else {
+            shapes[i].c.k[0] /= 255;
+            shapes[i].c.k[1] /= 255;
+            shapes[i].c.k[2] /= 255;
+            shapes[i].c.k[3] /= 255;
+          }
+        }
+      }
     }
 
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 4) {
+          iterateShapes(layers[i].shapes);
         }
+      }
     }
 
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
+      }
+    };
+  }());
+
+  var checkShapes = (function () {
+    var minimumVersion = [4, 4, 18];
+
+    function completeClosingShapes(arr) {
+      var i;
+      var len = arr.length;
+      var j;
+      var jLen;
+      for (i = len - 1; i >= 0; i -= 1) {
+        if (arr[i].ty === 'sh') {
+          if (arr[i].ks.k.i) {
+            arr[i].ks.k.c = arr[i].closed;
+          } else {
+            jLen = arr[i].ks.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (arr[i].ks.k[j].s) {
+                arr[i].ks.k[j].s[0].c = arr[i].closed;
+              }
+              if (arr[i].ks.k[j].e) {
+                arr[i].ks.k[j].e[0].c = arr[i].closed;
+              }
+            }
+          }
+        } else if (arr[i].ty === 'gr') {
+          completeClosingShapes(arr[i].it);
         }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
+      }
     }
 
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            };
+    function iterateLayers(layers) {
+      var layerData;
+      var i;
+      var len = layers.length;
+      var j;
+      var jLen;
+      var k;
+      var kLen;
+      for (i = 0; i < len; i += 1) {
+        layerData = layers[i];
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              maskProps[j].pt.k.c = maskProps[j].cl;
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
+                }
+              }
+            }
+          }
         }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
+        if (layerData.ty === 4) {
+          completeClosingShapes(layerData.shapes);
         }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkChars = (function() {
-        var minimumVersion = [4,7,99];
-        return function (animationData){
-            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
-                var i, len = animationData.chars.length, j, jLen, k, kLen;
-                var pathData, paths;
-                for(i = 0; i < len; i += 1) {
-                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
-                        paths = animationData.chars[i].data.shapes[0].it;
-                        jLen = paths.length;
-
-                        for(j = 0; j < jLen; j += 1) {
-                            pathData = paths[j].ks.k;
-                            if(!pathData.__converted) {
-                                convertPathsToAbsoluteValues(paths[j].ks.k);
-                                pathData.__converted = true;
-                            }
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkChars(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
+      }
     }
 
-    function completeText(data, fontManager){
-        if(data.t.a.length === 0 && !('m' in data.t.p)){
-            data.singleShape = true;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
+      }
+    };
+  }());
+
+  function completeData(animationData, fontManager) {
+    if (animationData.__complete) {
+      return;
     }
+    checkColors(animationData);
+    checkText(animationData);
+    checkChars(animationData);
+    checkShapes(animationData);
+    completeLayers(animationData.layers, animationData.assets, fontManager);
+    animationData.__complete = true;
+  }
 
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-    moduleOb.checkColors = checkColors;
-    moduleOb.checkChars = checkChars;
-    moduleOb.checkShapes = checkShapes;
-    moduleOb.completeLayers = completeLayers;
+  function completeText(data) {
+    if (data.t.a.length === 0 && !('m' in data.t.p)) {
+      data.singleShape = true;
+    }
+  }
 
-    return moduleOb;
+  var moduleOb = {};
+  moduleOb.completeData = completeData;
+  moduleOb.checkColors = checkColors;
+  moduleOb.checkChars = checkChars;
+  moduleOb.checkShapes = checkShapes;
+  moduleOb.completeLayers = completeLayers;
+
+  return moduleOb;
 }
 
 var dataManager = dataFunctionManager();
 
-dataManager.completeData = function(animationData, fontManager) {
-    if(animationData.__complete){
-            return;
-        }
-        this.checkColors(animationData);
-        this.checkChars(animationData);
-        this.checkShapes(animationData);
-        this.completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
+/* global dataManager */
+
+dataManager.completeData = function (animationData, fontManager) {
+  if (animationData.__complete) {
+    return;
+  }
+  this.checkColors(animationData);
+  this.checkChars(animationData);
+  this.checkShapes(animationData);
+  this.completeLayers(animationData.layers, animationData.assets, fontManager);
+  animationData.__complete = true;
+};
+
+/* exported getFontProperties */
+
+function getFontProperties(fontData) {
+  var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
+
+  var fWeight = 'normal'; var
+    fStyle = 'normal';
+  var len = styles.length;
+  var styleName;
+  for (var i = 0; i < len; i += 1) {
+    styleName = styles[i].toLowerCase();
+    switch (styleName) {
+      case 'italic':
+        fStyle = 'italic';
+        break;
+      case 'bold':
+        fWeight = '700';
+        break;
+      case 'black':
+        fWeight = '900';
+        break;
+      case 'medium':
+        fWeight = '500';
+        break;
+      case 'regular':
+      case 'normal':
+        fWeight = '400';
+        break;
+      case 'light':
+      case 'thin':
+        fWeight = '200';
+        break;
+      default:
+        break;
+    }
+  }
+
+  return {
+    style: fStyle,
+    weight: fontData.fWeight || fWeight,
+  };
 }
 
-var FontManager = (function(){
+/* global createNS, createTag, getFontProperties */
+/* exported FontManager */
 
-    var maxWaitingTime = 5000;
-    var emptyChar = {
-        w: 0,
-        size:0,
-        shapes:[]
-    };
-    var combinedCharacters = [];
-    //Hindi characters
-    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]);
+var FontManager = (function () {
+  var maxWaitingTime = 5000;
+  var emptyChar = {
+    w: 0,
+    size: 0,
+    shapes: [],
+  };
+  var combinedCharacters = [];
+  // Hindi characters
+  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]);
 
-    function trimFontOptions(font) {
-        var familyArray = font.split(',');
-        var i, len = familyArray.length;
-        var enabledFamilies = [];
-        for (i = 0; i < len; i += 1) {
-            if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
-                enabledFamilies.push(familyArray[i]);
-            }
-        }
-        return enabledFamilies.join(',');
-    }
-
-    function setUpNode(font, family){
-        var parentNode = createTag('span');
-        parentNode.style.fontFamily    = family;
-        var node = createTag('span');
-        // Characters that vary significantly among different fonts
-        node.innerText = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = trimFontOptions(font) + ', ' + family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(this.checkLoadedFontsBinded, 20);
-        }else{
-            setTimeout(this.setIsLoadedBinded, 10);
-
-        }
-    }
-
-    function createHelper(def, fontData){
-        var tHelper = createNS('text');
-        tHelper.style.fontSize = '100px';
-        //tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.setAttribute('font-family', fontData.fFamily);
-        tHelper.setAttribute('font-style', fontData.fStyle);
-        tHelper.setAttribute('font-weight', fontData.fWeight);
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.setAttribute('class', fontData.fClass);
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = createTag('canvas').getContext('2d');
-        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
-        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.isLoaded = true;
-            return;
-        }
-        if(this.chars){
-            this.isLoaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        var _pendingFonts = len;
-        for(i=0; i<len; i+= 1){
-            var shouldLoadFont = true;
-            var loadedSelector;
-            var j;
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-                _pendingFonts -= 1;
-            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
-                loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
-
-                if (loadedSelector.length > 0) {
-                    shouldLoadFont = false;
-                }
-
-                if (shouldLoadFont) {
-                    var s = createTag('style');
-                    s.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    s.setAttribute('f-origin', fontArr[i].origin);
-                    s.setAttribute('f-family', fontArr[i].fFamily);
-                    s.type = "text/css";
-                    s.innerText = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                    defs.appendChild(s);
-                }
-            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
-                loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var l = createTag('link');
-                    l.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    l.setAttribute('f-origin', fontArr[i].origin);
-                    l.type = "text/css";
-                    l.rel = "stylesheet";
-                    l.href = fontArr[i].fPath;
-                    document.body.appendChild(l);
-                }
-            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
-                loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (fontArr[i].fPath === loadedSelector[j].src) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var sc = createTag('link');
-                    sc.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    sc.setAttribute('f-origin', fontArr[i].origin);
-                    sc.setAttribute('rel','stylesheet');
-                    sc.setAttribute('href',fontArr[i].fPath);
-                    defs.appendChild(sc);
-                }
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            fontArr[i].cache = {};
-            this.fonts.push(fontArr[i]);
-        }
-        if (_pendingFonts === 0) {
-            this.isLoaded = true;
-        } else {
-            //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
-            //Adding this timeout seems to fix it
-           setTimeout(this.checkLoadedFonts.bind(this), 100);
-        }
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-        if ((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char)
-            && console
-            && console.warn
-            && !this._warned
-           ) {
-            this._warned = true
-            console.warn('Missing character from exported characters list: ', char, style, font);
-        }
-        return emptyChar;
-    }
-
-    function measureText(char, fontName, size) {
-        var fontData = this.getFontByName(fontName);
-        var index = char.charCodeAt(0);
-        if(!fontData.cache[index + 1]) {
-            var tHelper = fontData.helper;
-            //Canvas version
-            //fontData.cache[index] = tHelper.measureText(char).width / 100;
-            //SVG version
-            //console.log(tHelper.getBBox().width)
-            if (char === ' ') {
-                tHelper.textContent = '|' + char + '|';
-                var doubleSize = tHelper.getComputedTextLength();
-                tHelper.textContent = '||';
-                var singleSize = tHelper.getComputedTextLength();
-                fontData.cache[index + 1] = (doubleSize - singleSize)/100;
-            } else {
-                tHelper.textContent = char;
-                fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
-            }
-        }
-        return fontData.cache[index + 1] * size;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return this.fonts[0];
-    }
-
-    function getCombinedCharacterCodes() {
-        return combinedCharacters;
-    }
-
-    function setIsLoaded() {
-        this.isLoaded = true
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this._warned = false;
-        this.initTime = Date.now();
-        this.setIsLoadedBinded = this.setIsLoaded.bind(this)
-        this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)
-    };
-    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
-    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
-
-    var fontPrototype = {
-        addChars: addChars,
-        addFonts: addFonts,
-        getCharData: getCharData,
-        getFontByName: getFontByName,
-        measureText: measureText,
-        checkLoadedFonts: checkLoadedFonts,
-        setIsLoaded: setIsLoaded,
-    }
-
-    Font.prototype = fontPrototype;
-
-    return Font;
-
-}());
-
-FontManager = (function(){
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this.initTime = Date.now();
-    };
-    return Font;
-}());
-
-var PropertyFactory = (function(){
-
-    var initFrame = initialDefaultFrame;
-    var math_abs = Math.abs;
-
-    function interpolateValue(frameNum, caching) {
-        var offsetTime = this.offsetTime;
-        var newValue;
-        if (this.propType === 'multidimensional') {
-            newValue = createTypedArray('float32', this.pv.length);
-        }
-        var iterationIndex = caching.lastIndex;
-        var i = iterationIndex;
-        var len = this.keyframes.length - 1, flag = true;
-        var keyData, nextKeyData;
-
-        while (flag) {
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i + 1];
-            if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                iterationIndex = 0;
-                break;
-            }
-            if ((nextKeyData.t - offsetTime) > frameNum){
-                iterationIndex = i;
-                break;
-            }
-            if (i < len - 1){
-                i += 1;
-            } else {
-                iterationIndex = 0;
-                flag = false;
-            }
-        }
-
-        var k, kLen, perc, jLen, j, fnc;
-        var nextKeyTime = nextKeyData.t - offsetTime;
-        var keyTime = keyData.t - offsetTime;
-        var endValue;
-        if (keyData.to) {
-            if (!keyData.bezierData) {
-                keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyTime || frameNum < keyTime) {
-                var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for (k = 0; k < kLen; k += 1) {
-                    newValue[k] = bezierData.points[ind].point[k];
-                }
-                // caching._lastKeyframeIndex = -1;
-            } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
-                } else {
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
-                }
-                perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
-                var distanceInLine = bezierData.segmentLength*perc;
-
-                var segmentPerc;
-                var addedLength =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
-                j =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
-                flag = true;
-                jLen = bezierData.points.length;
-                while (flag) {
-                    addedLength += bezierData.points[j].partialLength;
-                    if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
-                        segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1){
-                        j += 1;
-                    } else {
-                        flag = false;
-                    }
-                }
-                caching._lastPoint = j;
-                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                caching._lastKeyframeIndex = i;
-            }
-        } else {
-            var outX, outY, inX, inY, keyValue;
-            len = keyData.s.length;
-            endValue = nextKeyData.s || keyData.e;
-            if (this.sh && keyData.h !== 1) {
-                if (frameNum >= nextKeyTime) {
-                    newValue[0] = endValue[0];
-                    newValue[1] = endValue[1];
-                    newValue[2] = endValue[2];
-                } else if (frameNum <= keyTime) {
-                    newValue[0] = keyData.s[0];
-                    newValue[1] = keyData.s[1];
-                    newValue[2] = keyData.s[2];
-                } else {
-                    var quatStart = createQuaternion(keyData.s);
-                    var quatEnd = createQuaternion(endValue);
-                    var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
-                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
-                }
-                
-            } else {
-                for(i = 0; i < len; i += 1) {
-                    if (keyData.h !== 1) {
-                        if (frameNum >= nextKeyTime) {
-                            perc = 1;
-                        } else if(frameNum < keyTime) {
-                            perc = 0;
-                        } else {
-                            if(keyData.o.x.constructor === Array) {
-                                if (!keyData.__fnct) {
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
-                                    outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
-                                    inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
-                                    inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct = fnc;
-                                } else {
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
-                        }
-                    }
-
-                    endValue = nextKeyData.s || keyData.e;
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
-
-                    if (this.propType === 'multidimensional') {
-                        newValue[i] = keyValue;
-                    } else {
-                        newValue = keyValue;
-                    }
-                }
-            }
-        }
-        caching.lastIndex = iterationIndex;
-        return newValue;
-    }
-
-    //based on @Toji's https://github.com/toji/gl-matrix/
-    function slerp(a, b, t) {
-        var out = [];
-        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
-        bx = b[0], by = b[1], bz = b[2], bw = b[3]
-
-        var omega, cosom, sinom, scale0, scale1;
-
-        cosom = ax * bx + ay * by + az * bz + aw * bw;
-        if (cosom < 0.0) {
-            cosom = -cosom;
-            bx = -bx;
-            by = -by;
-            bz = -bz;
-            bw = -bw;
-        }
-        if ((1.0 - cosom) > 0.000001) {
-            omega = Math.acos(cosom);
-            sinom = Math.sin(omega);
-            scale0 = Math.sin((1.0 - t) * omega) / sinom;
-            scale1 = Math.sin(t * omega) / sinom;
-        } else {
-            scale0 = 1.0 - t;
-            scale1 = t;
-        }
-        out[0] = scale0 * ax + scale1 * bx;
-        out[1] = scale0 * ay + scale1 * by;
-        out[2] = scale0 * az + scale1 * bz;
-        out[3] = scale0 * aw + scale1 * bw;
-
-        return out;
-    }
-
-    function quaternionToEuler(out, quat) {
-        var qx = quat[0];
-        var qy = quat[1];
-        var qz = quat[2];
-        var qw = quat[3];
-        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
-        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
-        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
-        out[0] = heading/degToRads;
-        out[1] = attitude/degToRads;
-        out[2] = bank/degToRads;
-    }
-
-    function createQuaternion(values) {
-        var heading = values[0] * degToRads;
-        var attitude = values[1] * degToRads;
-        var bank = values[2] * degToRads;
-        var c1 = Math.cos(heading / 2);
-        var c2 = Math.cos(attitude / 2);
-        var c3 = Math.cos(bank / 2);
-        var s1 = Math.sin(heading / 2);
-        var s2 = Math.sin(attitude / 2);
-        var s3 = Math.sin(bank / 2);
-        var w = c1 * c2 * c3 - s1 * s2 * s3;
-        var x = s1 * s2 * c3 + c1 * c2 * s3;
-        var y = s1 * c2 * c3 + c1 * s2 * s3;
-        var z = c1 * s2 * c3 - s1 * c2 * s3;
-
-        return [x,y,z,w];
-    }
-
-    function getValueAtCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
-        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
-            if(this._caching.lastFrame >= frameNum) {
-                this._caching._lastKeyframeIndex = -1;
-                this._caching.lastIndex = 0;
-            }
-
-            var renderResult = this.interpolateValue(frameNum, this._caching);
-            this.pv = renderResult;
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
-    }
-
-    function setVValue(val) {
-        var multipliedValue;
-        if(this.propType === 'unidimensional') {
-            multipliedValue = val * this.mult;
-            if(math_abs(this.v - multipliedValue) > 0.00001) {
-                this.v = multipliedValue;
-                this._mdf = true;
-            }
-        } else {
-            var i = 0, len = this.v.length;
-            while (i < len) {
-                multipliedValue = val[i] * this.mult;
-                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
-                    this.v[i] = multipliedValue;
-                    this._mdf = true;
-                }
-                i += 1;
-            }
-        }
-    }
-
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
-            return;
-        }
-        if(this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = this._isFirstFrame;
-        var multipliedValue;
-        var i, len = this.effectsSequence.length;
-        var finalValue = this.kf ? this.pv : this.data.k;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this._isFirstFrame = false;
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
-    }
-
-    function ValueProperty(elem, data, mult, container){
-        this.propType = 'unidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.effectsSequence = [];
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function MultiDimensionalProperty(elem, data, mult, container) {
-        this.propType = 'multidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        var i, len = data.k.length;
-        this.v = createTypedArray('float32', len);
-        this.pv = createTypedArray('float32', len);
-        var arr = createTypedArray('float32', len);
-        this.vel = createTypedArray('float32', len);
-        for (i = 0; i < len; i += 1) {
-            this.v[i] = data.k[i] * this.mult;
-            this.pv[i] = data.k[i];
-        }
-        this._isFirstFrame = true;
-        this.effectsSequence = [];
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedValueProperty(elem, data, mult, container) {
-        this.propType = 'unidimensional';
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.frameId = -1;
-        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.v = initFrame;
-        this.pv = initFrame;
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult, container){
-        this.propType = 'multidimensional';
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for (i = 0; i < len - 1; i += 1) {
-            if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
-                s = data.k[i].s;
-                e = data.k[i + 1].s;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                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]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
-                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
-                        data.k[i].to = null;
-                        data.k[i].ti = null;
-                    }
-                }
-            }
-        }
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.data = data;
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this._isFirstFrame = true;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.frameId = -1;
-        var arrLen = data.k[0].s.length;
-        this.v = createTypedArray('float32', arrLen);
-        this.pv = createTypedArray('float32', arrLen);
-        for (i = 0; i < arrLen; i += 1) {
-            this.v[i] = initFrame;
-            this.pv[i] = initFrame;
-        }
-        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
-        this.addEffect = addEffect;
-    }
-
-    function getProp(elem,data,type, mult, container) {
-        var p;
-        if(!data.k.length){
-            p = new ValueProperty(elem,data, mult, container);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult, container);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult, container);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
-                    break;
-            }
-        }
-        if(p.effectsSequence.length){
-            container.addDynamicProperty(p);
-        }
-        return p;
-    }
-
-    var ob = {
-        getProp: getProp
-    };
-    return ob;
-}());
-var TransformPropertyFactory = (function() {
-
-    var defaultVector = [0,0]
-
-    function applyToMatrix(mat) {
-        var _mdf = this._mdf;
-        this.iterateDynamicProperties();
-        this._mdf = this._mdf || _mdf;
-        if (this.a) {
-            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-        }
-        if (this.s) {
-            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-        }
-        if (this.sk) {
-            mat.skewFromAxis(-this.sk.v, this.sa.v);
-        }
-        if (this.r) {
-            mat.rotate(-this.r.v);
-        } else {
-            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]);
-        }
-        if (this.data.p.s) {
-            if (this.data.p.z) {
-                mat.translate(this.px.v, this.py.v, -this.pz.v);
-            } else {
-                mat.translate(this.px.v, this.py.v, 0);
-            }
-        } else {
-            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-        }
-    }
-    function processKeys(forceRender){
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        }
-        if(this._isDirty) {
-            this.precalculateMatrix();
-            this._isDirty = false;
-        }
-
-        this.iterateDynamicProperties();
-
-        if (this._mdf || forceRender) {
-            this.v.cloneFromProps(this.pre.props);
-            if (this.appliedTransformations < 1) {
-                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if(this.appliedTransformations < 2) {
-                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.sk && this.appliedTransformations < 3) {
-                this.v.skewFromAxis(-this.sk.v, this.sa.v);
-            }
-            if (this.r && this.appliedTransformations < 4) {
-                this.v.rotate(-this.r.v);
-            } else if (!this.r && this.appliedTransformations < 4){
-                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]);
-            }
-            if (this.autoOriented) {
-                var v1,v2, frameRate = this.elem.globalData.frameRate;
-                if(this.p && this.p.keyframes && this.p.getValueAtTime) {
-                    if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
-                    } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
-                    }
-                } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
-                    v1 = [];
-                    v2 = [];
-                    var px = this.px, py = this.py, frameRate;
-                    if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
-                        v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
-                        v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
-                    } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
-                        v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
-                        v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
-                    } else {
-                        v1 = [px.pv, py.pv];
-                        v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
-                        v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
-                    }
-                } else {
-                    v1 = v2 = defaultVector
-                }
-                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-            }
-            if(this.data.p && this.data.p.s){
-                if(this.data.p.z) {
-                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    this.v.translate(this.px.v, this.py.v, 0);
-                }
-            }else{
-                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-            }
-        }
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function precalculateMatrix() {
-        if(!this.a.k) {
-            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            this.appliedTransformations = 1;
-        } else {
-            return;
-        }
-        if(!this.s.effectsSequence.length) {
-            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            this.appliedTransformations = 2;
-        } else {
-            return;
-        }
-        if(this.sk) {
-            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
-                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
-            this.appliedTransformations = 3;
-            } else {
-                return;
-            }
-        }
-        if (this.r) {
-            if(!this.r.effectsSequence.length) {
-                this.pre.rotate(-this.r.v);
-                this.appliedTransformations = 4;
-            } else {
-                return;
-            }
-        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
-            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]);
-            this.appliedTransformations = 4;
-        }
-    }
-
-    function autoOrient(){
-        //
-        //var prevP = this.getValueAtTime();
-    }
-
-    function addDynamicProperty(prop) {
-        this._addDynamicProperty(prop);
-        this.elem.addDynamicProperty(prop);
-        this._isDirty = true;
-    }
-
-    function TransformProperty(elem,data,container){
-        this.elem = elem;
-        this.frameId = -1;
-        this.propType = 'transform';
-        this.data = data;
-        this.v = new Matrix();
-        //Precalculated matrix with non animated properties
-        this.pre = new Matrix();
-        this.appliedTransformations = 0;
-        this.initDynamicPropertyContainer(container || elem);
-        if(data.p && data.p.s){
-            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
-            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
-            if(data.p.z){
-                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
-            }
-        }else{
-            this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
-        }
-        if(data.rx) {
-            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
-            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
-            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
-            if(data.or.k[0].ti) {
-                var i, len = data.or.k.length;
-                for(i=0;i<len;i+=1) {
-                    data.or.k[i].to = data.or.k[i].ti = null;
-                }
-            }
-            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
-            //sh Indicates it needs to be capped between -180 and 180
-            this.or.sh = true;
-        } else {
-            this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
-        }
-        if(data.sk){
-            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
-            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
-        }
-        this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},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.
-        if(data.o){
-            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
-        } else {
-            this.o = {_mdf:false,v:1};
-        }
-        this._isDirty = true;
-        if(!this.dynamicProperties.length){
-            this.getValue(true);
-        }
-    }
-
-    TransformProperty.prototype = {
-        applyToMatrix: applyToMatrix,
-        getValue: processKeys,
-        precalculateMatrix: precalculateMatrix,
-        autoOrient: autoOrient
-    }
-
-    extendPrototype([DynamicPropertyContainer], TransformProperty);
-    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
-    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
-
-    function getTransformProperty(elem,data,container){
-        return new TransformProperty(elem,data,container);
-    }
-
-    return {
-        getTransformProperty: getTransformProperty
-    };
-
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = createSizedArray(this._maxLength);
-	this.o = createSizedArray(this._maxLength);
-	this.i = createSizedArray(this._maxLength);
-}
-
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	this.setLength(len);
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newElement();
-		this.o[i] = point_pool.newElement();
-		this.i[i] = point_pool.newElement();
-		i += 1;
-	}
-};
-
-ShapePath.prototype.setLength = function(len) {
-	while(this._maxLength < len) {
-		this.doubleArrayLength();
-	}
-	this._length = len;
-};
-
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(createSizedArray(this._maxLength));
-	this.i = this.i.concat(createSizedArray(this._maxLength));
-	this.o = this.o.concat(createSizedArray(this._maxLength));
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newElement();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-
-ShapePath.prototype.reverse = function() {
-	var newPath = new ShapePath();
-	newPath.setPathData(this.c, this._length);
-	var vertices = this.v, outPoints = this.o, inPoints = this.i;
-	var init = 0;
-	if (this.c) {
-		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
-        init = 1;
-    }
-    var cnt = this._length - 1;
-    var len = this._length;
-
+  function trimFontOptions(font) {
+    var familyArray = font.split(',');
     var i;
-    for (i = init; i < len; i += 1) {
-    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
-        cnt -= 1;
+    var len = familyArray.length;
+    var enabledFamilies = [];
+    for (i = 0; i < len; i += 1) {
+      if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
+        enabledFamilies.push(familyArray[i]);
+      }
     }
-    return newPath;
+    return enabledFamilies.join(',');
+  }
+
+  function setUpNode(font, family) {
+    var parentNode = createTag('span');
+    parentNode.style.fontFamily = family;
+    var node = createTag('span');
+    // Characters that vary significantly among different fonts
+    node.innerText = 'giItT1WQy@!-/#';
+    // Visible - so we can measure it - but not on the screen
+    parentNode.style.position = 'absolute';
+    parentNode.style.left = '-10000px';
+    parentNode.style.top = '-10000px';
+    // Large font size makes even subtle changes obvious
+    parentNode.style.fontSize = '300px';
+    // Reset any font properties
+    parentNode.style.fontVariant = 'normal';
+    parentNode.style.fontStyle = 'normal';
+    parentNode.style.fontWeight = 'normal';
+    parentNode.style.letterSpacing = '0';
+    parentNode.appendChild(node);
+    document.body.appendChild(parentNode);
+
+    // Remember width with no applied web font
+    var width = node.offsetWidth;
+    node.style.fontFamily = trimFontOptions(font) + ', ' + family;
+    return { node: node, w: width, parent: parentNode };
+  }
+
+  function checkLoadedFonts() {
+    var i;
+    var len = this.fonts.length;
+    var node;
+    var w;
+    var loadedCount = len;
+    for (i = 0; i < len; i += 1) {
+      if (this.fonts[i].loaded) {
+        loadedCount -= 1;
+      } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
+        this.fonts[i].loaded = true;
+      } else {
+        node = this.fonts[i].monoCase.node;
+        w = this.fonts[i].monoCase.w;
+        if (node.offsetWidth !== w) {
+          loadedCount -= 1;
+          this.fonts[i].loaded = true;
+        } else {
+          node = this.fonts[i].sansCase.node;
+          w = this.fonts[i].sansCase.w;
+          if (node.offsetWidth !== w) {
+            loadedCount -= 1;
+            this.fonts[i].loaded = true;
+          }
+        }
+        if (this.fonts[i].loaded) {
+          this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
+          this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
+        }
+      }
+    }
+
+    if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
+      setTimeout(this.checkLoadedFontsBinded, 20);
+    } else {
+      setTimeout(this.setIsLoadedBinded, 10);
+    }
+  }
+
+  function createHelper(def, fontData) {
+    var tHelper = createNS('text');
+    tHelper.style.fontSize = '100px';
+    // tHelper.style.fontFamily = fontData.fFamily;
+
+    var fontProps = getFontProperties(fontData);
+    tHelper.setAttribute('font-family', fontData.fFamily);
+    tHelper.setAttribute('font-style', fontProps.style);
+    tHelper.setAttribute('font-weight', fontProps.weight);
+    tHelper.textContent = '1';
+    if (fontData.fClass) {
+      tHelper.style.fontFamily = 'inherit';
+      tHelper.setAttribute('class', fontData.fClass);
+    } else {
+      tHelper.style.fontFamily = fontData.fFamily;
+    }
+    def.appendChild(tHelper);
+    var tCanvasHelper = createTag('canvas').getContext('2d');
+    tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px ' + fontData.fFamily;
+    // tCanvasHelper.font = ' 100px '+ fontData.fFamily;
+    return tHelper;
+  }
+
+  function addFonts(fontData, defs) {
+    if (!fontData) {
+      this.isLoaded = true;
+      return;
+    }
+    if (this.chars) {
+      this.isLoaded = true;
+      this.fonts = fontData.list;
+      return;
+    }
+
+    var fontArr = fontData.list;
+    var i;
+    var len = fontArr.length;
+    var _pendingFonts = len;
+    for (i = 0; i < len; i += 1) {
+      var shouldLoadFont = true;
+      var loadedSelector;
+      var j;
+      fontArr[i].loaded = false;
+      fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
+      fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
+      if (!fontArr[i].fPath) {
+        fontArr[i].loaded = true;
+        _pendingFonts -= 1;
+      } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
+        loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
+
+        if (loadedSelector.length > 0) {
+          shouldLoadFont = false;
+        }
+
+        if (shouldLoadFont) {
+          var s = createTag('style');
+          s.setAttribute('f-forigin', fontArr[i].fOrigin);
+          s.setAttribute('f-origin', fontArr[i].origin);
+          s.setAttribute('f-family', fontArr[i].fFamily);
+          s.type = 'text/css';
+          s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
+          defs.appendChild(s);
+        }
+      } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
+        loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var l = createTag('link');
+          l.setAttribute('f-forigin', fontArr[i].fOrigin);
+          l.setAttribute('f-origin', fontArr[i].origin);
+          l.type = 'text/css';
+          l.rel = 'stylesheet';
+          l.href = fontArr[i].fPath;
+          document.body.appendChild(l);
+        }
+      } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
+        loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (fontArr[i].fPath === loadedSelector[j].src) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var sc = createTag('link');
+          sc.setAttribute('f-forigin', fontArr[i].fOrigin);
+          sc.setAttribute('f-origin', fontArr[i].origin);
+          sc.setAttribute('rel', 'stylesheet');
+          sc.setAttribute('href', fontArr[i].fPath);
+          defs.appendChild(sc);
+        }
+      }
+      fontArr[i].helper = createHelper(defs, fontArr[i]);
+      fontArr[i].cache = {};
+      this.fonts.push(fontArr[i]);
+    }
+    if (_pendingFonts === 0) {
+      this.isLoaded = true;
+    } else {
+      // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
+      // Adding this timeout seems to fix it
+      setTimeout(this.checkLoadedFonts.bind(this), 100);
+    }
+  }
+
+  function addChars(chars) {
+    if (!chars) {
+      return;
+    }
+    if (!this.chars) {
+      this.chars = [];
+    }
+    var i;
+    var len = chars.length;
+    var j;
+    var jLen = this.chars.length;
+    var found;
+    for (i = 0; i < len; i += 1) {
+      j = 0;
+      found = false;
+      while (j < jLen) {
+        if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
+          found = true;
+        }
+        j += 1;
+      }
+      if (!found) {
+        this.chars.push(chars[i]);
+        jLen += 1;
+      }
+    }
+  }
+
+  function getCharData(char, style, font) {
+    var i = 0;
+    var len = this.chars.length;
+    while (i < len) {
+      if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) {
+        return this.chars[i];
+      }
+      i += 1;
+    }
+    if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char)
+            && console
+            && console.warn // eslint-disable-line no-console
+            && !this._warned
+    ) {
+      this._warned = true;
+      console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console
+    }
+    return emptyChar;
+  }
+
+  function measureText(char, fontName, size) {
+    var fontData = this.getFontByName(fontName);
+    var index = char.charCodeAt(0);
+    if (!fontData.cache[index + 1]) {
+      var tHelper = fontData.helper;
+      // Canvas version
+      // fontData.cache[index] = tHelper.measureText(char).width / 100;
+      // SVG version
+      // console.log(tHelper.getBBox().width)
+      if (char === ' ') {
+        tHelper.textContent = '|' + char + '|';
+        var doubleSize = tHelper.getComputedTextLength();
+        tHelper.textContent = '||';
+        var singleSize = tHelper.getComputedTextLength();
+        fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
+      } else {
+        tHelper.textContent = char;
+        fontData.cache[index + 1] = (tHelper.getComputedTextLength()) / 100;
+      }
+    }
+    return fontData.cache[index + 1] * size;
+  }
+
+  function getFontByName(name) {
+    var i = 0;
+    var len = this.fonts.length;
+    while (i < len) {
+      if (this.fonts[i].fName === name) {
+        return this.fonts[i];
+      }
+      i += 1;
+    }
+    return this.fonts[0];
+  }
+
+  function getCombinedCharacterCodes() {
+    return combinedCharacters;
+  }
+
+  function setIsLoaded() {
+    this.isLoaded = true;
+  }
+
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this._warned = false;
+    this.initTime = Date.now();
+    this.setIsLoadedBinded = this.setIsLoaded.bind(this);
+    this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
+  };
+    // TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
+  Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
+  var fontPrototype = {
+    addChars: addChars,
+    addFonts: addFonts,
+    getCharData: getCharData,
+    getFontByName: getFontByName,
+    measureText: measureText,
+    checkLoadedFonts: checkLoadedFonts,
+    setIsLoaded: setIsLoaded,
+  };
+
+  Font.prototype = fontPrototype;
+
+  return Font;
+}());
+
+/* global FontManager:writable */
+/* exported FontManager */
+
+FontManager = (function () {
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this.initTime = Date.now();
+  };
+  return Font;
+}());
+
+/* global initialDefaultFrame, BezierFactory, degToRads, bez, createTypedArray */
+/* exported PropertyFactory */
+
+var PropertyFactory = (function () {
+  var initFrame = initialDefaultFrame;
+  var mathAbs = Math.abs;
+
+  function interpolateValue(frameNum, caching) {
+    var offsetTime = this.offsetTime;
+    var newValue;
+    if (this.propType === 'multidimensional') {
+      newValue = createTypedArray('float32', this.pv.length);
+    }
+    var iterationIndex = caching.lastIndex;
+    var i = iterationIndex;
+    var len = this.keyframes.length - 1;
+    var flag = true;
+    var keyData;
+    var nextKeyData;
+
+    while (flag) {
+      keyData = this.keyframes[i];
+      nextKeyData = this.keyframes[i + 1];
+      if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
+        if (keyData.h) {
+          keyData = nextKeyData;
+        }
+        iterationIndex = 0;
+        break;
+      }
+      if ((nextKeyData.t - offsetTime) > frameNum) {
+        iterationIndex = i;
+        break;
+      }
+      if (i < len - 1) {
+        i += 1;
+      } else {
+        iterationIndex = 0;
+        flag = false;
+      }
+    }
+
+    var k;
+    var kLen;
+    var perc;
+    var jLen;
+    var j;
+    var fnc;
+    var nextKeyTime = nextKeyData.t - offsetTime;
+    var keyTime = keyData.t - offsetTime;
+    var endValue;
+    if (keyData.to) {
+      if (!keyData.bezierData) {
+        keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
+      }
+      var bezierData = keyData.bezierData;
+      if (frameNum >= nextKeyTime || frameNum < keyTime) {
+        var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
+        kLen = bezierData.points[ind].point.length;
+        for (k = 0; k < kLen; k += 1) {
+          newValue[k] = bezierData.points[ind].point[k];
+        }
+        // caching._lastKeyframeIndex = -1;
+      } else {
+        if (keyData.__fnct) {
+          fnc = keyData.__fnct;
+        } else {
+          fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
+          keyData.__fnct = fnc;
+        }
+        perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+        var distanceInLine = bezierData.segmentLength * perc;
+
+        var segmentPerc;
+        var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+        j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
+        flag = true;
+        jLen = bezierData.points.length;
+        while (flag) {
+          addedLength += bezierData.points[j].partialLength;
+          if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k];
+            }
+            break;
+          } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
+            segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
+            }
+            break;
+          }
+          if (j < jLen - 1) {
+            j += 1;
+          } else {
+            flag = false;
+          }
+        }
+        caching._lastPoint = j;
+        caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+        caching._lastKeyframeIndex = i;
+      }
+    } else {
+      var outX;
+      var outY;
+      var inX;
+      var inY;
+      var keyValue;
+      len = keyData.s.length;
+      endValue = nextKeyData.s || keyData.e;
+      if (this.sh && keyData.h !== 1) {
+        if (frameNum >= nextKeyTime) {
+          newValue[0] = endValue[0];
+          newValue[1] = endValue[1];
+          newValue[2] = endValue[2];
+        } else if (frameNum <= keyTime) {
+          newValue[0] = keyData.s[0];
+          newValue[1] = keyData.s[1];
+          newValue[2] = keyData.s[2];
+        } else {
+          var quatStart = createQuaternion(keyData.s);
+          var quatEnd = createQuaternion(endValue);
+          var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
+          quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+        }
+      } else {
+        for (i = 0; i < len; i += 1) {
+          if (keyData.h !== 1) {
+            if (frameNum >= nextKeyTime) {
+              perc = 1;
+            } else if (frameNum < keyTime) {
+              perc = 0;
+            } else {
+              if (keyData.o.x.constructor === Array) {
+                if (!keyData.__fnct) {
+                  keyData.__fnct = [];
+                }
+                if (!keyData.__fnct[i]) {
+                  outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+                  outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+                  inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+                  inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
+                  fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                  keyData.__fnct[i] = fnc;
+                } else {
+                  fnc = keyData.__fnct[i];
+                }
+              } else if (!keyData.__fnct) {
+                outX = keyData.o.x;
+                outY = keyData.o.y;
+                inX = keyData.i.x;
+                inY = keyData.i.y;
+                fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                keyData.__fnct = fnc;
+              } else {
+                fnc = keyData.__fnct;
+              }
+              perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+            }
+          }
+
+          endValue = nextKeyData.s || keyData.e;
+          keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
+
+          if (this.propType === 'multidimensional') {
+            newValue[i] = keyValue;
+          } else {
+            newValue = keyValue;
+          }
+        }
+      }
+    }
+    caching.lastIndex = iterationIndex;
+    return newValue;
+  }
+
+  // based on @Toji's https://github.com/toji/gl-matrix/
+  function slerp(a, b, t) {
+    var out = [];
+    var ax = a[0];
+    var ay = a[1];
+    var az = a[2];
+    var aw = a[3];
+    var bx = b[0];
+    var by = b[1];
+    var bz = b[2];
+    var bw = b[3];
+
+    var omega;
+    var cosom;
+    var sinom;
+    var scale0;
+    var scale1;
+
+    cosom = ax * bx + ay * by + az * bz + aw * bw;
+    if (cosom < 0.0) {
+      cosom = -cosom;
+      bx = -bx;
+      by = -by;
+      bz = -bz;
+      bw = -bw;
+    }
+    if ((1.0 - cosom) > 0.000001) {
+      omega = Math.acos(cosom);
+      sinom = Math.sin(omega);
+      scale0 = Math.sin((1.0 - t) * omega) / sinom;
+      scale1 = Math.sin(t * omega) / sinom;
+    } else {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+    out[0] = scale0 * ax + scale1 * bx;
+    out[1] = scale0 * ay + scale1 * by;
+    out[2] = scale0 * az + scale1 * bz;
+    out[3] = scale0 * aw + scale1 * bw;
+
+    return out;
+  }
+
+  function quaternionToEuler(out, quat) {
+    var qx = quat[0];
+    var qy = quat[1];
+    var qz = quat[2];
+    var qw = quat[3];
+    var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
+    var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
+    var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
+    out[0] = heading / degToRads;
+    out[1] = attitude / degToRads;
+    out[2] = bank / degToRads;
+  }
+
+  function createQuaternion(values) {
+    var heading = values[0] * degToRads;
+    var attitude = values[1] * degToRads;
+    var bank = values[2] * degToRads;
+    var c1 = Math.cos(heading / 2);
+    var c2 = Math.cos(attitude / 2);
+    var c3 = Math.cos(bank / 2);
+    var s1 = Math.sin(heading / 2);
+    var s2 = Math.sin(attitude / 2);
+    var s3 = Math.sin(bank / 2);
+    var w = c1 * c2 * c3 - s1 * s2 * s3;
+    var x = s1 * s2 * c3 + c1 * c2 * s3;
+    var y = s1 * c2 * c3 + c1 * s2 * s3;
+    var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+    return [x, y, z, w];
+  }
+
+  function getValueAtCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) {
+      if (this._caching.lastFrame >= frameNum) {
+        this._caching._lastKeyframeIndex = -1;
+        this._caching.lastIndex = 0;
+      }
+
+      var renderResult = this.interpolateValue(frameNum, this._caching);
+      this.pv = renderResult;
+    }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
+
+  function setVValue(val) {
+    var multipliedValue;
+    if (this.propType === 'unidimensional') {
+      multipliedValue = val * this.mult;
+      if (mathAbs(this.v - multipliedValue) > 0.00001) {
+        this.v = multipliedValue;
+        this._mdf = true;
+      }
+    } else {
+      var i = 0;
+      var len = this.v.length;
+      while (i < len) {
+        multipliedValue = val[i] * this.mult;
+        if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
+          this.v[i] = multipliedValue;
+          this._mdf = true;
+        }
+        i += 1;
+      }
+    }
+  }
+
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+      return;
+    }
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
+    }
+    this.lock = true;
+    this._mdf = this._isFirstFrame;
+    var i;
+    var len = this.effectsSequence.length;
+    var finalValue = this.kf ? this.pv : this.data.k;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this._isFirstFrame = false;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
+
+  function ValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this.v = mult ? data.k * mult : data.k;
+    this.pv = data.k;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.vel = 0;
+    this.effectsSequence = [];
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function MultiDimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.frameId = -1;
+    var i;
+    var len = data.k.length;
+    this.v = createTypedArray('float32', len);
+    this.pv = createTypedArray('float32', len);
+    this.vel = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      this.v[i] = data.k[i] * this.mult;
+      this.pv[i] = data.k[i];
+    }
+    this._isFirstFrame = true;
+    this.effectsSequence = [];
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.frameId = -1;
+    this._caching = {
+      lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1,
+    };
+    this.k = true;
+    this.kf = true;
+    this.data = data;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.v = initFrame;
+    this.pv = initFrame;
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedMultidimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    var i;
+    var len = data.k.length;
+    var s;
+    var e;
+    var to;
+    var ti;
+    for (i = 0; i < len - 1; i += 1) {
+      if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
+        s = data.k[i].s;
+        e = data.k[i + 1].s;
+        to = data.k[i].to;
+        ti = data.k[i].ti;
+        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]))) {
+          data.k[i].to = null;
+          data.k[i].ti = null;
+        }
+        if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+          if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+            data.k[i].to = null;
+            data.k[i].ti = null;
+          }
+        }
+      }
+    }
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.data = data;
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.k = true;
+    this.kf = true;
+    this._isFirstFrame = true;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.frameId = -1;
+    var arrLen = data.k[0].s.length;
+    this.v = createTypedArray('float32', arrLen);
+    this.pv = createTypedArray('float32', arrLen);
+    for (i = 0; i < arrLen; i += 1) {
+      this.v[i] = initFrame;
+      this.pv[i] = initFrame;
+    }
+    this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) };
+    this.addEffect = addEffect;
+  }
+
+  function getProp(elem, data, type, mult, container) {
+    var p;
+    if (!data.k.length) {
+      p = new ValueProperty(elem, data, mult, container);
+    } else if (typeof (data.k[0]) === 'number') {
+      p = new MultiDimensionalProperty(elem, data, mult, container);
+    } else {
+      switch (type) {
+        case 0:
+          p = new KeyframedValueProperty(elem, data, mult, container);
+          break;
+        case 1:
+          p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
+          break;
+        default:
+          break;
+      }
+    }
+    if (p.effectsSequence.length) {
+      container.addDynamicProperty(p);
+    }
+    return p;
+  }
+
+  var ob = {
+    getProp: getProp,
+  };
+  return ob;
+}());
+
+/* global Matrix, degToRads, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+/* exported TransformPropertyFactory */
+
+var TransformPropertyFactory = (function () {
+  var defaultVector = [0, 0];
+
+  function applyToMatrix(mat) {
+    var _mdf = this._mdf;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || _mdf;
+    if (this.a) {
+      mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+    }
+    if (this.s) {
+      mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+    }
+    if (this.sk) {
+      mat.skewFromAxis(-this.sk.v, this.sa.v);
+    }
+    if (this.r) {
+      mat.rotate(-this.r.v);
+    } else {
+      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]);
+    }
+    if (this.data.p.s) {
+      if (this.data.p.z) {
+        mat.translate(this.px.v, this.py.v, -this.pz.v);
+      } else {
+        mat.translate(this.px.v, this.py.v, 0);
+      }
+    } else {
+      mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+    }
+  }
+  function processKeys(forceRender) {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    }
+    if (this._isDirty) {
+      this.precalculateMatrix();
+      this._isDirty = false;
+    }
+
+    this.iterateDynamicProperties();
+
+    if (this._mdf || forceRender) {
+      var frameRate;
+      this.v.cloneFromProps(this.pre.props);
+      if (this.appliedTransformations < 1) {
+        this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      }
+      if (this.appliedTransformations < 2) {
+        this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      }
+      if (this.sk && this.appliedTransformations < 3) {
+        this.v.skewFromAxis(-this.sk.v, this.sa.v);
+      }
+      if (this.r && this.appliedTransformations < 4) {
+        this.v.rotate(-this.r.v);
+      } else if (!this.r && this.appliedTransformations < 4) {
+        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]);
+      }
+      if (this.autoOriented) {
+        var v1;
+        var v2;
+        frameRate = this.elem.globalData.frameRate;
+        if (this.p && this.p.keyframes && this.p.getValueAtTime) {
+          if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
+            v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
+          } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
+            v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
+          } else {
+            v1 = this.p.pv;
+            v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
+          }
+        } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
+          v1 = [];
+          v2 = [];
+          var px = this.px;
+          var py = this.py;
+          if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
+            v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
+            v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0);
+          } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0);
+            v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0);
+            v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
+          } else {
+            v1 = [px.pv, py.pv];
+            v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
+            v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
+          }
+        } else {
+          v2 = defaultVector;
+          v1 = v2;
+        }
+        this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+      }
+      if (this.data.p && this.data.p.s) {
+        if (this.data.p.z) {
+          this.v.translate(this.px.v, this.py.v, -this.pz.v);
+        } else {
+          this.v.translate(this.px.v, this.py.v, 0);
+        }
+      } else {
+        this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+      }
+    }
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function precalculateMatrix() {
+    if (!this.a.k) {
+      this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      this.appliedTransformations = 1;
+    } else {
+      return;
+    }
+    if (!this.s.effectsSequence.length) {
+      this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      this.appliedTransformations = 2;
+    } else {
+      return;
+    }
+    if (this.sk) {
+      if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+        this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+        this.appliedTransformations = 3;
+      } else {
+        return;
+      }
+    }
+    if (this.r) {
+      if (!this.r.effectsSequence.length) {
+        this.pre.rotate(-this.r.v);
+        this.appliedTransformations = 4;
+      }
+    } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+      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]);
+      this.appliedTransformations = 4;
+    }
+  }
+
+  function autoOrient() {
+    //
+    // var prevP = this.getValueAtTime();
+  }
+
+  function addDynamicProperty(prop) {
+    this._addDynamicProperty(prop);
+    this.elem.addDynamicProperty(prop);
+    this._isDirty = true;
+  }
+
+  function TransformProperty(elem, data, container) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.propType = 'transform';
+    this.data = data;
+    this.v = new Matrix();
+    // Precalculated matrix with non animated properties
+    this.pre = new Matrix();
+    this.appliedTransformations = 0;
+    this.initDynamicPropertyContainer(container || elem);
+    if (data.p && data.p.s) {
+      this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
+      this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
+      if (data.p.z) {
+        this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
+      }
+    } else {
+      this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this);
+    }
+    if (data.rx) {
+      this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+      this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+      this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+      if (data.or.k[0].ti) {
+        var i;
+        var len = data.or.k.length;
+        for (i = 0; i < len; i += 1) {
+          data.or.k[i].to = null;
+          data.or.k[i].ti = null;
+        }
+      }
+      this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+      // sh Indicates it needs to be capped between -180 and 180
+      this.or.sh = true;
+    } else {
+      this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this);
+    }
+    if (data.sk) {
+      this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+      this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+    }
+    this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 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.
+    if (data.o) {
+      this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
+    } else {
+      this.o = { _mdf: false, v: 1 };
+    }
+    this._isDirty = true;
+    if (!this.dynamicProperties.length) {
+      this.getValue(true);
+    }
+  }
+
+  TransformProperty.prototype = {
+    applyToMatrix: applyToMatrix,
+    getValue: processKeys,
+    precalculateMatrix: precalculateMatrix,
+    autoOrient: autoOrient,
+  };
+
+  extendPrototype([DynamicPropertyContainer], TransformProperty);
+  TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+  TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+  function getTransformProperty(elem, data, container) {
+    return new TransformProperty(elem, data, container);
+  }
+
+  return {
+    getTransformProperty: getTransformProperty,
+  };
+}());
+
+/* global createSizedArray, createSizedArray, pointPool */
+
+function ShapePath() {
+  this.c = false;
+  this._length = 0;
+  this._maxLength = 8;
+  this.v = createSizedArray(this._maxLength);
+  this.o = createSizedArray(this._maxLength);
+  this.i = createSizedArray(this._maxLength);
+}
+
+ShapePath.prototype.setPathData = function (closed, len) {
+  this.c = closed;
+  this.setLength(len);
+  var i = 0;
+  while (i < len) {
+    this.v[i] = pointPool.newElement();
+    this.o[i] = pointPool.newElement();
+    this.i[i] = pointPool.newElement();
+    i += 1;
+  }
 };
-var ShapePropertyFactory = (function(){
 
-    var initFrame = -999999;
+ShapePath.prototype.setLength = function (len) {
+  while (this._maxLength < len) {
+    this.doubleArrayLength();
+  }
+  this._length = len;
+};
 
-    function interpolateShape(frameNum, previousValue, caching) {
-        var iterationIndex = caching.lastIndex;
-        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
-        var kf = this.keyframes;
-        if(frameNum < kf[0].t-this.offsetTime){
-            keyPropS = kf[0].s[0];
-            isHold = true;
-            iterationIndex = 0;
-        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
-            keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
-            /*if(kf[kf.length - 1].s){
+ShapePath.prototype.doubleArrayLength = function () {
+  this.v = this.v.concat(createSizedArray(this._maxLength));
+  this.i = this.i.concat(createSizedArray(this._maxLength));
+  this.o = this.o.concat(createSizedArray(this._maxLength));
+  this._maxLength *= 2;
+};
+
+ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
+  var arr;
+  this._length = Math.max(this._length, pos + 1);
+  if (this._length >= this._maxLength) {
+    this.doubleArrayLength();
+  }
+  switch (type) {
+    case 'v':
+      arr = this.v;
+      break;
+    case 'i':
+      arr = this.i;
+      break;
+    case 'o':
+      arr = this.o;
+      break;
+    default:
+      arr = [];
+      break;
+  }
+  if (!arr[pos] || (arr[pos] && !replace)) {
+    arr[pos] = pointPool.newElement();
+  }
+  arr[pos][0] = x;
+  arr[pos][1] = y;
+};
+
+ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
+  this.setXYAt(vX, vY, 'v', pos, replace);
+  this.setXYAt(oX, oY, 'o', pos, replace);
+  this.setXYAt(iX, iY, 'i', pos, replace);
+};
+
+ShapePath.prototype.reverse = function () {
+  var newPath = new ShapePath();
+  newPath.setPathData(this.c, this._length);
+  var vertices = this.v;
+  var outPoints = this.o;
+  var inPoints = this.i;
+  var init = 0;
+  if (this.c) {
+    newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+    init = 1;
+  }
+  var cnt = this._length - 1;
+  var len = this._length;
+
+  var i;
+  for (i = init; i < len; i += 1) {
+    newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+    cnt -= 1;
+  }
+  return newPath;
+};
+
+/* global extendPrototype, roundCorner, BezierFactory, shapePool, degToRads,
+  shapeCollectionPool, PropertyFactory, bmMin, DynamicPropertyContainer */
+/* exported ShapePropertyFactory */
+
+var ShapePropertyFactory = (function () {
+  var initFrame = -999999;
+
+  function interpolateShape(frameNum, previousValue, caching) {
+    var iterationIndex = caching.lastIndex;
+    var keyPropS;
+    var keyPropE;
+    var isHold;
+    var j;
+    var k;
+    var jLen;
+    var kLen;
+    var perc;
+    var vertexValue;
+    var kf = this.keyframes;
+    if (frameNum < kf[0].t - this.offsetTime) {
+      keyPropS = kf[0].s[0];
+      isHold = true;
+      iterationIndex = 0;
+    } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
+      keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
+      /* if(kf[kf.length - 1].s){
                 keyPropS = kf[kf.length - 1].s[0];
             }else{
                 keyPropS = kf[kf.length - 2].e[0];
-            }*/
-            isHold = true;
-        }else{
-            var i = iterationIndex;
-            var len = kf.length- 1,flag = true,keyData,nextKeyData;
-            while(flag){
-                keyData = kf[i];
-                nextKeyData = kf[i+1];
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-            isHold = keyData.h === 1;
-            iterationIndex = i;
-            if(!isHold){
-                if(frameNum >= nextKeyData.t-this.offsetTime){
-                    perc = 1;
-                }else if(frameNum < keyData.t-this.offsetTime){
-                    perc = 0;
-                }else{
-                    var fnc;
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                }
-                keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
-            }
-            keyPropS = keyData.s[0];
+            } */
+      isHold = true;
+    } else {
+      var i = iterationIndex;
+      var len = kf.length - 1;
+      var flag = true;
+      var keyData;
+      var nextKeyData;
+      while (flag) {
+        keyData = kf[i];
+        nextKeyData = kf[i + 1];
+        if ((nextKeyData.t - this.offsetTime) > frameNum) {
+          break;
         }
-        jLen = previousValue._length;
-        kLen = keyPropS.i[0].length;
-        caching.lastIndex = iterationIndex;
-
-        for(j=0;j<jLen;j+=1){
-            for(k=0;k<kLen;k+=1){
-                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                previousValue.i[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                previousValue.o[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                previousValue.v[j][k] = vertexValue;
-            }
+        if (i < len - 1) {
+          i += 1;
+        } else {
+          flag = false;
         }
+      }
+      isHold = keyData.h === 1;
+      iterationIndex = i;
+      if (!isHold) {
+        if (frameNum >= nextKeyData.t - this.offsetTime) {
+          perc = 1;
+        } else if (frameNum < keyData.t - this.offsetTime) {
+          perc = 0;
+        } else {
+          var fnc;
+          if (keyData.__fnct) {
+            fnc = keyData.__fnct;
+          } else {
+            fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
+            keyData.__fnct = fnc;
+          }
+          perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime)));
+        }
+        keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
+      }
+      keyPropS = keyData.s[0];
     }
+    jLen = previousValue._length;
+    kLen = keyPropS.i[0].length;
+    caching.lastIndex = iterationIndex;
 
-    function interpolateShapeCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
-        var lastFrame = this._caching.lastFrame;
-        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
-            ////
-            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
-            this.interpolateShape(frameNum, this.pv, this._caching);
-            ////
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
+    for (j = 0; j < jLen; j += 1) {
+      for (k = 0; k < kLen; k += 1) {
+        vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
+        previousValue.i[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
+        previousValue.o[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
+        previousValue.v[j][k] = vertexValue;
+      }
     }
+  }
 
-    function resetShape(){
-        this.paths = this.localShapeCollection;
+  function interpolateShapeCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    var lastFrame = this._caching.lastFrame;
+    if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) {
+      /// /
+      this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+      this.interpolateShape(frameNum, this.pv, this._caching);
+      /// /
     }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            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] 
+  function resetShape() {
+    this.paths = this.localShapeCollection;
+  }
+
+  function shapesEqual(shape1, shape2) {
+    if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
+      return false;
+    }
+    var i;
+    var len = shape1._length;
+    for (i = 0; i < len; i += 1) {
+      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]) {
-                return false;
-            }
-        }
-        return true;
+        return false;
+      }
     }
+    return true;
+  }
 
-    function setVValue(newPath) {
-        if(!shapesEqual(this.v, newPath)) {
-            this.v = shape_pool.clone(newPath);
-            this.localShapeCollection.releaseShapes();
-            this.localShapeCollection.addShape(this.v);
-            this._mdf = true;
-            this.paths = this.localShapeCollection;
-        }
+  function setVValue(newPath) {
+    if (!shapesEqual(this.v, newPath)) {
+      this.v = shapePool.clone(newPath);
+      this.localShapeCollection.releaseShapes();
+      this.localShapeCollection.addShape(this.v);
+      this._mdf = true;
+      this.paths = this.localShapeCollection;
     }
+  }
 
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        } else if (!this.effectsSequence.length) {
-            this._mdf = false;
-            return;
-        }
-        if (this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = false;
-        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
-        var i, len = this.effectsSequence.length;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    };
-
-    function ShapeProperty(elem, data, type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.container = elem;
-        this.elem = elem;
-        this.data = data;
-        this.k = false;
-        this.kf = false;
-        this._mdf = false;
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v = shape_pool.clone(pathData);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-        this.effectsSequence = [];
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    } if (!this.effectsSequence.length) {
+      this._mdf = false;
+      return;
     }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
     }
-
-    ShapeProperty.prototype.interpolateShape = interpolateShape;
-    ShapeProperty.prototype.getValue = processEffectsSequence;
-    ShapeProperty.prototype.setVValue = setVValue;
-    ShapeProperty.prototype.addEffect = addEffect;
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.container = elem;
-        this.offsetTime = elem.data.st;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newElement();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-        this._caching = {lastFrame: initFrame, lastIndex: 0};
-        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+    this.lock = true;
+    this._mdf = false;
+    var finalValue;
+    if (this.kf) {
+      finalValue = this.pv;
+    } else if (this.data.ks) {
+      finalValue = this.data.ks.k;
+    } else {
+      finalValue = this.data.pt.k;
     }
-    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
-    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
-    KeyframedShapeProperty.prototype.setVValue = setVValue;
-    KeyframedShapeProperty.prototype.addEffect = addEffect;
+    var i;
+    var len = this.effectsSequence.length;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
 
-    var EllShapeProperty = (function(){
+  function ShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.container = elem;
+    this.elem = elem;
+    this.data = data;
+    this.k = false;
+    this.kf = false;
+    this._mdf = false;
+    var pathData = type === 3 ? data.pt.k : data.ks.k;
+    this.v = shapePool.clone(pathData);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.reset = resetShape;
+    this.effectsSequence = [];
+  }
 
-        var cPoint = roundCorner;
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
 
-        function EllShapeProperty(elem,data) {
-            /*this.v = {
+  ShapeProperty.prototype.interpolateShape = interpolateShape;
+  ShapeProperty.prototype.getValue = processEffectsSequence;
+  ShapeProperty.prototype.setVValue = setVValue;
+  ShapeProperty.prototype.addEffect = addEffect;
+
+  function KeyframedShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.elem = elem;
+    this.container = elem;
+    this.offsetTime = elem.data.st;
+    this.keyframes = type === 3 ? data.pt.k : data.ks.k;
+    this.k = true;
+    this.kf = true;
+    var len = this.keyframes[0].s[0].i.length;
+    this.v = shapePool.newElement();
+    this.v.setPathData(this.keyframes[0].s[0].c, len);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.lastFrame = initFrame;
+    this.reset = resetShape;
+    this._caching = { lastFrame: initFrame, lastIndex: 0 };
+    this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+  }
+  KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+  KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+  KeyframedShapeProperty.prototype.setVValue = setVValue;
+  KeyframedShapeProperty.prototype.addEffect = addEffect;
+
+  var EllShapeProperty = (function () {
+    var cPoint = roundCorner;
+
+    function EllShapePropertyFactory(elem, data) {
+      /* this.v = {
                 v: createSizedArray(4),
                 i: createSizedArray(4),
                 o: createSizedArray(4),
                 c: true
-            };*/
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertEllToPath();
-            }
-        };
+            }; */
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 4);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.paths = this.localShapeCollection;
+      this.localShapeCollection.addShape(this.v);
+      this.d = data.d;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertEllToPath();
+      }
+    }
 
-        EllShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function (){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-
-                if(this._mdf){
-                    this.convertEllToPath();
-                }
-            },
-            convertEllToPath: function() {
-                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-                var _cw = this.d !== 3;
-                var _v = this.v;
-                _v.v[0][0] = p0;
-                _v.v[0][1] = p1 - s1;
-                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.v[1][1] = p1;
-                _v.v[2][0] = p0;
-                _v.v[2][1] = p1 + s1;
-                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.v[3][1] = p1;
-                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.i[0][1] = p1 - s1;
-                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.i[1][1] = p1 - s1 * cPoint;
-                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.i[2][1] = p1 + s1;
-                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.i[3][1] = p1 + s1 * cPoint;
-                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.o[0][1] = p1 - s1;
-                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.o[1][1] = p1 + s1 * cPoint;
-                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.o[2][1] = p1 + s1;
-                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.o[3][1] = p1 - s1 * cPoint;
-            }
+    EllShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
         }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
 
-        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+        if (this._mdf) {
+          this.convertEllToPath();
+        }
+      },
+      convertEllToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var s0 = this.s.v[0] / 2;
+        var s1 = this.s.v[1] / 2;
+        var _cw = this.d !== 3;
+        var _v = this.v;
+        _v.v[0][0] = p0;
+        _v.v[0][1] = p1 - s1;
+        _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.v[1][1] = p1;
+        _v.v[2][0] = p0;
+        _v.v[2][1] = p1 + s1;
+        _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.v[3][1] = p1;
+        _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.i[0][1] = p1 - s1;
+        _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.i[1][1] = p1 - s1 * cPoint;
+        _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.i[2][1] = p1 + s1;
+        _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.i[3][1] = p1 + s1 * cPoint;
+        _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.o[0][1] = p1 - s1;
+        _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.o[1][1] = p1 + s1 * cPoint;
+        _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.o[2][1] = p1 + s1;
+        _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.o[3][1] = p1 - s1 * cPoint;
+      },
+    };
 
-        return EllShapeProperty;
-    }());
+    extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
 
-    var StarShapeProperty = (function() {
+    return EllShapePropertyFactory;
+  }());
 
-        function StarShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
-                this.convertToPath = this.convertStarToPath;
-            } else {
-                this.convertToPath = this.convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertToPath();
-            }
-        };
+  var StarShapeProperty = (function () {
+    function StarShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 0);
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.data = data;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      if (data.sy === 1) {
+        this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
+        this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
+        this.convertToPath = this.convertStarToPath;
+      } else {
+        this.convertToPath = this.convertPolygonToPath;
+      }
+      this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+      this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
+      this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertToPath();
+      }
+    }
 
-        StarShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function() {
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertToPath();
-                }
-            },
-            convertStarToPath: function() {
-                var numPts = Math.floor(this.pt.v)*2;
-                var angle = Math.PI*2/numPts;
-                /*this.v.v.length = numPts;
+    StarShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertToPath();
+        }
+      },
+      convertStarToPath: function () {
+        var numPts = Math.floor(this.pt.v) * 2;
+        var angle = (Math.PI * 2) / numPts;
+        /* this.v.v.length = numPts;
                 this.v.i.length = numPts;
-                this.v.o.length = numPts;*/
-                var longFlag = true;
-                var longRad = this.or.v;
-                var shortRad = this.ir.v;
-                var longRound = this.os.v;
-                var shortRound = this.is.v;
-                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-                currentAng += this.r.v;
-                var dir = this.data.d === 3 ? -1 : 1;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    rad = longFlag ? longRad : shortRad;
-                    roundness = longFlag ? longRound : shortRound;
-                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
+                this.v.o.length = numPts; */
+        var longFlag = true;
+        var longRad = this.or.v;
+        var shortRad = this.ir.v;
+        var longRound = this.os.v;
+        var shortRound = this.is.v;
+        var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2);
+        var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2);
+        var i;
+        var rad;
+        var roundness;
+        var perimSegment;
+        var currentAng = -Math.PI / 2;
+        currentAng += this.r.v;
+        var dir = this.data.d === 3 ? -1 : 1;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          rad = longFlag ? longRad : shortRad;
+          roundness = longFlag ? longRound : shortRound;
+          perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
 
-                    /*this.v.v[i] = [x,y];
+          /* this.v.v[i] = [x,y];
                     this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
                     this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                    this.v._length = numPts;*/
-                    longFlag = !longFlag;
-                    currentAng += angle*dir;
-                }
-            },
-            convertPolygonToPath: function() {
-                var numPts = Math.floor(this.pt.v);
-                var angle = Math.PI*2/numPts;
-                var rad = this.or.v;
-                var roundness = this.os.v;
-                var perimSegment = 2*Math.PI*rad/(numPts*4);
-                var i, currentAng = -Math.PI/ 2;
-                var dir = this.data.d === 3 ? -1 : 1;
-                currentAng += this.r.v;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
-                    currentAng += angle*dir;
-                }
-                this.paths.length = 0;
-                this.paths[0] = this.v;
-            }
-
+                    this.v._length = numPts; */
+          longFlag = !longFlag;
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
-
-        return StarShapeProperty;
-    }());
-
-    var RectShapeProperty = (function() {
-
-         function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertRectToPath();
-            }
-        };
-
-        RectShapeProperty.prototype = {
-            convertRectToPath: function (){
-                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-                var round = bm_min(v0,v1,this.r.v);
-                var cPoint = round*(1-roundCorner);
-                this.v._length = 0;
-
-                if(this.d === 2 || this.d === 1) {
-                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                    }
-                }else{
-                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                    }
-                }
-            },
-            getValue: function(frameNum){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertRectToPath();
-                }
-
-            },
-            reset: resetShape
+      },
+      convertPolygonToPath: function () {
+        var numPts = Math.floor(this.pt.v);
+        var angle = (Math.PI * 2) / numPts;
+        var rad = this.or.v;
+        var roundness = this.os.v;
+        var perimSegment = (2 * Math.PI * rad) / (numPts * 4);
+        var i;
+        var currentAng = -Math.PI * 0.5;
+        var dir = this.data.d === 3 ? -1 : 1;
+        currentAng += this.r.v;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+        this.paths.length = 0;
+        this.paths[0] = this.v;
+      },
 
-        return RectShapeProperty;
-    }());
+    };
+    extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
 
-    function getShapeProp(elem,data,type){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    }
+    return StarShapePropertyFactory;
+  }());
 
-    function getConstructorFunction() {
-        return ShapeProperty;
-    }
-
-    function getKeyframedConstructorFunction() {
-        return KeyframedShapeProperty;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    ob.getConstructorFunction = getConstructorFunction;
-    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data){
-        return new modifiers[nm](elem, data);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if (!this.closed) {
-        // 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.
-        data.sh.container.addDynamicProperty(data.sh);
-        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
-        this.shapes.push(shapeData);
-        this.addShapeToModifier(shapeData);
-        if (this._isAnimated) {
-            data.setAsAnimated();
-        }
-    }
-};
-ShapeModifier.prototype.init = function(elem,data){
-    this.shapes = [];
-    this.elem = elem;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,data);
-    this.frameId = initialDefaultFrame;
-    this.closed = false;
-    this.k = false;
-    if(this.dynamicProperties.length){
+  var RectShapeProperty = (function () {
+    function RectShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.c = true;
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
+      if (this.dynamicProperties.length) {
         this.k = true;
-    }else{
-        this.getValue(true);
+      } else {
+        this.k = false;
+        this.convertRectToPath();
+      }
     }
+
+    RectShapePropertyFactory.prototype = {
+      convertRectToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var v0 = this.s.v[0] / 2;
+        var v1 = this.s.v[1] / 2;
+        var round = bmMin(v0, v1, this.r.v);
+        var cPoint = round * (1 - roundCorner);
+        this.v._length = 0;
+
+        if (this.d === 2 || this.d === 1) {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
+          this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
+          }
+        } else {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
+          }
+        }
+      },
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertRectToPath();
+        }
+      },
+      reset: resetShape,
+    };
+    extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
+
+    return RectShapePropertyFactory;
+  }());
+
+  function getShapeProp(elem, data, type) {
+    var prop;
+    if (type === 3 || type === 4) {
+      var dataProp = type === 3 ? data.pt : data.ks;
+      var keys = dataProp.k;
+      if (keys.length) {
+        prop = new KeyframedShapeProperty(elem, data, type);
+      } else {
+        prop = new ShapeProperty(elem, data, type);
+      }
+    } else if (type === 5) {
+      prop = new RectShapeProperty(elem, data);
+    } else if (type === 6) {
+      prop = new EllShapeProperty(elem, data);
+    } else if (type === 7) {
+      prop = new StarShapeProperty(elem, data);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  }
+
+  function getConstructorFunction() {
+    return ShapeProperty;
+  }
+
+  function getKeyframedConstructorFunction() {
+    return KeyframedShapeProperty;
+  }
+
+  var ob = {};
+  ob.getShapeProp = getShapeProp;
+  ob.getConstructorFunction = getConstructorFunction;
+  ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
+  return ob;
+}());
+
+/* global shapeCollectionPool, initialDefaultFrame, extendPrototype, DynamicPropertyContainer */
+/* exported ShapeModifiers */
+
+var ShapeModifiers = (function () {
+  var ob = {};
+  var modifiers = {};
+  ob.registerModifier = registerModifier;
+  ob.getModifier = getModifier;
+
+  function registerModifier(nm, factory) {
+    if (!modifiers[nm]) {
+      modifiers[nm] = factory;
+    }
+  }
+
+  function getModifier(nm, elem, data) {
+    return new modifiers[nm](elem, data);
+  }
+
+  return ob;
+}());
+
+function ShapeModifier() {}
+ShapeModifier.prototype.initModifierProperties = function () {};
+ShapeModifier.prototype.addShapeToModifier = function () {};
+ShapeModifier.prototype.addShape = function (data) {
+  if (!this.closed) {
+    // 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.
+    data.sh.container.addDynamicProperty(data.sh);
+    var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() };
+    this.shapes.push(shapeData);
+    this.addShapeToModifier(shapeData);
+    if (this._isAnimated) {
+      data.setAsAnimated();
+    }
+  }
 };
-ShapeModifier.prototype.processKeys = function(){
-    if(this.elem.globalData.frameId === this.frameId){
-        return;
-    }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
+ShapeModifier.prototype.init = function (elem, data) {
+  this.shapes = [];
+  this.elem = elem;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, data);
+  this.frameId = initialDefaultFrame;
+  this.closed = false;
+  this.k = false;
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
+};
+ShapeModifier.prototype.processKeys = function () {
+  if (this.elem.globalData.frameId === this.frameId) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 extendPrototype([DynamicPropertyContainer], ShapeModifier);
-function TrimModifier(){
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, segmentsLengthPool, bez, shapePool, ShapeModifiers */
+
+function TrimModifier() {
 }
 extendPrototype([ShapeModifier], TrimModifier);
-TrimModifier.prototype.initModifierProperties = function(elem, data) {
-    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
-    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
-    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
-    this.sValue = 0;
-    this.eValue = 0;
-    this.getValue = this.processKeys;
-    this.m = data.m;
-    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
+TrimModifier.prototype.initModifierProperties = function (elem, data) {
+  this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
+  this.sValue = 0;
+  this.eValue = 0;
+  this.getValue = this.processKeys;
+  this.m = data.m;
+  this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.addShapeToModifier = function(shapeData){
-    shapeData.pathsData = [];
+TrimModifier.prototype.addShapeToModifier = function (shapeData) {
+  shapeData.pathsData = [];
 };
 
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
+TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
+  var segments = [];
+  if (e <= 1) {
+    segments.push({
+      s: s,
+      e: e,
+    });
+  } else if (s >= 1) {
+    segments.push({
+      s: s - 1,
+      e: e - 1,
+    });
+  } else {
+    segments.push({
+      s: s,
+      e: 1,
+    });
+    segments.push({
+      s: 0,
+      e: e - 1,
+    });
+  }
+  var shapeSegments = [];
+  var i;
+  var len = segments.length;
+  var segmentOb;
+  for (i = 0; i < len; i += 1) {
+    segmentOb = segments[i];
+    if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
+      var shapeS;
+      var shapeE;
+      if (segmentOb.s * totalModifierLength <= addedLength) {
+        shapeS = 0;
+      } else {
+        shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
+      }
+      if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
+        shapeE = 1;
+      } else {
+        shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
+      }
+      shapeSegments.push([shapeS, shapeE]);
+    }
+  }
+  if (!shapeSegments.length) {
+    shapeSegments.push([0, 0]);
+  }
+  return shapeSegments;
+};
+
+TrimModifier.prototype.releasePathsData = function (pathsData) {
+  var i;
+  var len = pathsData.length;
+  for (i = 0; i < len; i += 1) {
+    segmentsLengthPool.release(pathsData[i]);
+  }
+  pathsData.length = 0;
+  return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function (_isFirstFrame) {
+  var s;
+  var e;
+  if (this._mdf || _isFirstFrame) {
+    var o = (this.o.v % 360) / 360;
+    if (o < 0) {
+      o += 1;
+    }
+    if (this.s.v > 1) {
+      s = 1 + o;
+    } else if (this.s.v < 0) {
+      s = 0 + o;
+    } else {
+      s = this.s.v + o;
+    }
+    if (this.e.v > 1) {
+      e = 1 + o;
+    } else if (this.e.v < 0) {
+      e = 0 + o;
+    } else {
+      e = this.e.v + o;
+    }
+
+    if (s > e) {
+      var _s = s;
+      s = e;
+      e = _s;
+    }
+    s = Math.round(s * 10000) * 0.0001;
+    e = Math.round(e * 10000) * 0.0001;
+    this.sValue = s;
+    this.eValue = e;
+  } else {
+    s = this.sValue;
+    e = this.eValue;
+  }
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var pathsData;
+  var pathData;
+  var totalShapeLength;
+  var totalModifierLength = 0;
+
+  if (e === s) {
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].localShapeCollection.releaseShapes();
+      this.shapes[i].shape._mdf = true;
+      this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+      if (this._mdf) {
+        this.shapes[i].pathsData.length = 0;
+      }
+    }
+  } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) {
     var segments = [];
-    if (e <= 1) {
-        segments.push({
-            s: s,
-            e: e
-        });
-    } else if (s >= 1) {
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        });
-    } else {
-        segments.push({
-            s: s,
-            e: 1
-        });
-        segments.push({
-            s: 0,
-            e: e - 1
-        });
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
+    var shapeData;
+    var localShapeCollection;
     for (i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
+      shapeData = this.shapes[i];
+      // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+      if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
+        shapeData.shape.paths = shapeData.localShapeCollection;
+      } else {
+        shapePaths = shapeData.shape.paths;
+        jLen = shapePaths._length;
+        totalShapeLength = 0;
+        if (!shapeData.shape._mdf && shapeData.pathsData.length) {
+          totalShapeLength = shapeData.totalShapeLength;
         } else {
-            var shapeS, shapeE;
-            if (segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
+          pathsData = this.releasePathsData(shapeData.pathsData);
+          for (j = 0; j < jLen; j += 1) {
+            pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
+            pathsData.push(pathData);
+            totalShapeLength += pathData.totalLength;
+          }
+          shapeData.totalShapeLength = totalShapeLength;
+          shapeData.pathsData = pathsData;
         }
+
+        totalModifierLength += totalShapeLength;
+        shapeData.shape._mdf = true;
+      }
     }
-    if (!shapeSegments.length) {
-        shapeSegments.push([0, 0]);
-    }
-    return shapeSegments;
-};
-
-TrimModifier.prototype.releasePathsData = function(pathsData) {
-    var i, len = pathsData.length;
-    for (i = 0; i < len; i += 1) {
-        segments_length_pool.release(pathsData[i]);
-    }
-    pathsData.length = 0;
-    return pathsData;
-};
-
-TrimModifier.prototype.processShapes = function(_isFirstFrame) {
-    var s, e;
-    if (this._mdf || _isFirstFrame) {
-        var o = (this.o.v % 360) / 360;
-        if (o < 0) {
-            o += 1;
-        }
-        s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
-        e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
-        if (s === e) {
-
-        }
-        if (s > e) {
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        s = Math.round(s * 10000) * 0.0001;
-        e = Math.round(e * 10000) * 0.0001;
-        this.sValue = s;
-        this.eValue = e;
-    } else {
-        s = this.sValue;
-        e = this.eValue;
-    }
-    var shapePaths;
-    var i, len = this.shapes.length, j, jLen;
-    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
-
-    if (e === s) {
-        for (i = 0; i < len; i += 1) {
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape._mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-            if (this._mdf) {
-                this.shapes[i].pathsData.length = 0;
-            }
-        }
-    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for (i = 0; i < len; i += 1) {
-            shapeData = this.shapes[i];
-            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
-            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = this.releasePathsData(shapeData.pathsData);
-                    for (j = 0; j < jLen; j += 1) {
-                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape._mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0, edges;
-        for (i = len - 1; i >= 0; i -= 1) {
-            shapeData = this.shapes[i];
-            if (shapeData.shape._mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
-                if (this.m === 2 && len > 1) {
-                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]];
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if (shapeE <= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        });
-                    } else if (shapeS >= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    } else {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        });
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        if (segments.length > 1) {
-                            var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
-                            if (lastShapeInCollection.c) {
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if (this._mdf) {
-        for (i = 0; i < len; i += 1) {
-            //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
-            //Don't remove this even if it's losing cached info.
-            this.shapes[i].pathsData.length = 0;
-            this.shapes[i].shape._mdf = true;
-        }
-    }
-};
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for (i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i]);
-    }
-};
-
-TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
-    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
-    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
-    }
-    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
-    shapePath.setXYAt(points[1], points[5], 'o', pos);
-    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(points[0], points[4], 'v', pos);
-    }
-    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
+    var shapeS = s;
+    var shapeE = e;
     var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if (!shapePath) {
-        shapePath = shape_pool.newElement();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
+    var edges;
+    for (i = len - 1; i >= 0; i -= 1) {
+      shapeData = this.shapes[i];
+      if (shapeData.shape._mdf) {
+        localShapeCollection = shapeData.localShapeCollection;
+        localShapeCollection.releaseShapes();
+        // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+        if (this.m === 2 && len > 1) {
+          edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+          addedLength += shapeData.totalShapeLength;
+        } else {
+          edges = [[shapeS, shapeE]];
+        }
+        jLen = edges.length;
+        for (j = 0; j < jLen; j += 1) {
+          shapeS = edges[j][0];
+          shapeE = edges[j][1];
+          segments.length = 0;
+          if (shapeE <= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength * shapeE,
+            });
+          } else if (shapeS >= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * (shapeS - 1),
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          } else {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength,
+            });
+            segments.push({
+              s: 0,
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          }
+          var newShapesData = this.addShapes(shapeData, segments[0]);
+          if (segments[0].s !== segments[0].e) {
+            if (segments.length > 1) {
+              var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
+              if (lastShapeInCollection.c) {
+                var lastShape = newShapesData.pop();
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
+              } else {
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1]);
+              }
+            }
+            this.addPaths(newShapesData, localShapeCollection);
+          }
+        }
+        shapeData.shape.paths = localShapeCollection;
+      }
     }
-    shapes.push(shapePath);
+  } else if (this._mdf) {
     for (i = 0; i < len; i += 1) {
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for (j = 1; j < jLen; j +=1) {
-            currentLengthData = lengths[j-1];
-            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e) {
-                shapePath.c = false;
-                break;
-            } else {
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if (shapePaths[i].c && lengths.length) {
-            currentLengthData = lengths[j - 1];
-            if (addedLength <= shapeSegment.e) {
-                var segmentLength = lengths[j - 1].addedLength;
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if (shapePath._length) {
-            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
-        }
-        if (addedLength > shapeSegment.e) {
-            break;
-        }
-        if (i < len - 1) {
-            shapePath = shape_pool.newElement();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
+      // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
+      // Don't remove this even if it's losing cached info.
+      this.shapes[i].pathsData.length = 0;
+      this.shapes[i].shape._mdf = true;
     }
-    return shapes;
+  }
 };
 
+TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
+  var i;
+  var len = newPaths.length;
+  for (i = 0; i < len; i += 1) {
+    localShapeCollection.addShape(newPaths[i]);
+  }
+};
+
+TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+  shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+  shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
+  }
+  shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
+  shapePath.setXYAt(points[1], points[5], 'o', pos);
+  shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(points[0], points[4], 'v', pos);
+  }
+  shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
+  var pathsData = shapeData.pathsData;
+  var shapePaths = shapeData.shape.paths.shapes;
+  var i;
+  var len = shapeData.shape.paths._length;
+  var j;
+  var jLen;
+  var addedLength = 0;
+  var currentLengthData;
+  var segmentCount;
+  var lengths;
+  var segment;
+  var shapes = [];
+  var initPos;
+  var newShape = true;
+  if (!shapePath) {
+    shapePath = shapePool.newElement();
+    segmentCount = 0;
+    initPos = 0;
+  } else {
+    segmentCount = shapePath._length;
+    initPos = shapePath._length;
+  }
+  shapes.push(shapePath);
+  for (i = 0; i < len; i += 1) {
+    lengths = pathsData[i].lengths;
+    shapePath.c = shapePaths[i].c;
+    jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
+    for (j = 1; j < jLen; j += 1) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
+        addedLength += currentLengthData.addedLength;
+        shapePath.c = false;
+      } else if (addedLength > shapeSegment.e) {
+        shapePath.c = false;
+        break;
+      } else {
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+        addedLength += currentLengthData.addedLength;
+        segmentCount += 1;
+      }
+    }
+    if (shapePaths[i].c && lengths.length) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength <= shapeSegment.e) {
+        var segmentLength = lengths[j - 1].addedLength;
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+      } else {
+        shapePath.c = false;
+      }
+      addedLength += currentLengthData.addedLength;
+      segmentCount += 1;
+    }
+    if (shapePath._length) {
+      shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+      shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
+    }
+    if (addedLength > shapeSegment.e) {
+      break;
+    }
+    if (i < len - 1) {
+      shapePath = shapePool.newElement();
+      newShape = true;
+      shapes.push(shapePath);
+      segmentCount = 0;
+    }
+  }
+  return shapes;
+};
 
 ShapeModifiers.registerModifier('tm', TrimModifier);
-function RoundCornersModifier(){}
-extendPrototype([ShapeModifier],RoundCornersModifier);
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
-    this._isAnimated = !!this.rd.effectsSequence.length;
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, roundCorner, ShapeModifiers */
+
+function RoundCornersModifier() {}
+extendPrototype([ShapeModifier], RoundCornersModifier);
+RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
+  this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-            }
+RoundCornersModifier.prototype.processPath = function (path, round) {
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var i;
+  var len = path._length;
+  var currentV;
+  var currentI;
+  var currentO;
+  var closerV;
+  var distance;
+  var newPosPerc;
+  var index = 0;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < len; i += 1) {
+    currentV = path.v[i];
+    currentO = path.o[i];
+    currentI = path.i[i];
+    if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
+      if ((i === 0 || i === len - 1) && !path.c) {
+        clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
+        /* clonedPath.v[index] = currentV;
+                clonedPath.o[index] = currentO;
+                clonedPath.i[index] = currentI; */
+        index += 1;
+      } else {
+        if (i === 0) {
+          closerV = path.v[len - 1];
         } else {
-            cloned_path.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);
-            index += 1;
+          closerV = path.v[i - 1];
         }
-    }
-    return cloned_path;
-};
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = iX;
+        iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
+        vY = iY;
+        oX = vX - (vX - currentV[0]) * roundCorner;
+        oY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
 
-RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+        if (i === len - 1) {
+          closerV = path.v[0];
+        } else {
+          closerV = path.v[i + 1];
         }
-
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = oX;
+        oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
+        vY = oY;
+        iX = vX - (vX - currentV[0]) * roundCorner;
+        iY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
+      }
+    } else {
+      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);
+      index += 1;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  return clonedPath;
 };
 
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function PuckerAndBloatModifier(){}
-extendPrototype([ShapeModifier],PuckerAndBloatModifier);
-PuckerAndBloatModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.amount = PropertyFactory.getProp(elem,data.a,0,null,this);
-    this._isAnimated = !!this.amount.effectsSequence.length;
-};
+RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var rd = this.rd.v;
 
-PuckerAndBloatModifier.prototype.processPath = function(path, amount){
-    var percent = amount / 100;
-    var centerPoint = [0, 0];
-    var pathLength = path._length, i = 0;
-    for (i = 0; i < pathLength; i += 1) {
-        centerPoint[0] += path.v[i][0];
-        centerPoint[1] += path.v[i][1];
-    }
-    centerPoint[0] /= pathLength;
-    centerPoint[1] /= pathLength;
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var vX, vY, oX, oY, iX, iY;
-    for(i = 0; i < pathLength; i += 1) {
-        vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
-        vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
-        oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
-        oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
-        iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
-        iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
-        cloned_path.setTripleAt(vX, vY, oX, oY, iX, iY, i);
-    }
-    return cloned_path;
-};
-
-PuckerAndBloatModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var amount = this.amount.v;
-
-    if(amount !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+  if (rd !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
         }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
 };
-ShapeModifiers.registerModifier('pb',PuckerAndBloatModifier);
-function RepeaterModifier(){}
+
+ShapeModifiers.registerModifier('rd', RoundCornersModifier);
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, ShapeModifiers */
+
+function PuckerAndBloatModifier() {}
+extendPrototype([ShapeModifier], PuckerAndBloatModifier);
+PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
+  this._isAnimated = !!this.amount.effectsSequence.length;
+};
+
+PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
+  var percent = amount / 100;
+  var centerPoint = [0, 0];
+  var pathLength = path._length;
+  var i = 0;
+  for (i = 0; i < pathLength; i += 1) {
+    centerPoint[0] += path.v[i][0];
+    centerPoint[1] += path.v[i][1];
+  }
+  centerPoint[0] /= pathLength;
+  centerPoint[1] /= pathLength;
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < pathLength; i += 1) {
+    vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
+    vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
+    oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
+    oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
+    iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
+    iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
+    clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
+  }
+  return clonedPath;
+};
+
+PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var amount = this.amount.v;
+
+  if (amount !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
+        }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
+    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
+};
+ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
+
+/* global extendPrototype, ShapeModifier, TransformPropertyFactory, PropertyFactory, Matrix, ShapeModifiers */
+
+function RepeaterModifier() {}
 extendPrototype([ShapeModifier], RepeaterModifier);
 
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
-    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
-    this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
-    this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
-    this.data = data;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this._isAnimated = !!this.dynamicProperties.length;
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
+RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
+  this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
+  this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
+  this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
+  this.data = data;
+  if (!this.dynamicProperties.length) {
+    this.getValue(true);
+  }
+  this._isAnimated = !!this.dynamicProperties.length;
+  this.pMatrix = new Matrix();
+  this.rMatrix = new Matrix();
+  this.sMatrix = new Matrix();
+  this.tMatrix = new Matrix();
+  this.matrix = new Matrix();
 };
 
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
+  var dir = inv ? -1 : 1;
+  var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
+  var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
+  pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
+  rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  rMatrix.rotate(-transform.r.v * dir * perc);
+  rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+  sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
+  sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
 };
 
-RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
-    this.elem = elem;
-    this.arr = arr;
-    this.pos = pos;
-    this.elemsData = elemsData;
-    this._currentCopies = 0;
-    this._elements = [];
-    this._groups = [];
-    this.frameId = -1;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,arr[pos]);
-    var cont = 0;
-    while(pos>0){
-        pos -= 1;
-        //this._elements.unshift(arr.splice(pos,1)[0]);
-        this._elements.unshift(arr[pos]);
-        cont += 1;
-    }
-    if(this.dynamicProperties.length){
-        this.k = true;
-    }else{
-        this.getValue(true);
-    }
+RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
+  this.elem = elem;
+  this.arr = arr;
+  this.pos = pos;
+  this.elemsData = elemsData;
+  this._currentCopies = 0;
+  this._elements = [];
+  this._groups = [];
+  this.frameId = -1;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, arr[pos]);
+  while (pos > 0) {
+    pos -= 1;
+    // this._elements.unshift(arr.splice(pos,1)[0]);
+    this._elements.unshift(arr[pos]);
+  }
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
 };
 
-RepeaterModifier.prototype.resetElements = function(elements){
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._processed = false;
-        if(elements[i].ty === 'gr'){
-            this.resetElements(elements[i].it);
+RepeaterModifier.prototype.resetElements = function (elements) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._processed = false;
+    if (elements[i].ty === 'gr') {
+      this.resetElements(elements[i].it);
+    }
+  }
+};
+
+RepeaterModifier.prototype.cloneElements = function (elements) {
+  var newElements = JSON.parse(JSON.stringify(elements));
+  this.resetElements(newElements);
+  return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._render = renderFlag;
+    if (elements[i].ty === 'gr') {
+      this.changeGroupRender(elements[i].it, renderFlag);
+    }
+  }
+};
+
+RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
+  var items;
+  var itemsTransform;
+  var i;
+  var dir;
+  var cont;
+  if (this._mdf || _isFirstFrame) {
+    var copies = Math.ceil(this.c.v);
+    if (this._groups.length < copies) {
+      while (this._groups.length < copies) {
+        var group = {
+          it: this.cloneElements(this._elements),
+          ty: 'gr',
+        };
+        group.it.push({
+          a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr',
+        });
+
+        this.arr.splice(0, 0, group);
+        this._groups.splice(0, 0, group);
+        this._currentCopies += 1;
+      }
+      this.elem.reloadShapes();
+    }
+    cont = 0;
+    var renderFlag;
+    for (i = 0; i <= this._groups.length - 1; i += 1) {
+      renderFlag = cont < copies;
+      this._groups[i]._render = renderFlag;
+      this.changeGroupRender(this._groups[i].it, renderFlag);
+      cont += 1;
+    }
+
+    this._currentCopies = copies;
+    /// /
+
+    var offset = this.o.v;
+    var offsetModulo = offset % 1;
+    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+    var pProps = this.pMatrix.props;
+    var rProps = this.rMatrix.props;
+    var sProps = this.sMatrix.props;
+    this.pMatrix.reset();
+    this.rMatrix.reset();
+    this.sMatrix.reset();
+    this.tMatrix.reset();
+    this.matrix.reset();
+    var iteration = 0;
+
+    if (offset > 0) {
+      while (iteration < roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+        iteration += 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+        iteration += offsetModulo;
+      }
+    } else if (offset < 0) {
+      while (iteration > roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+        iteration -= 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
+        iteration -= offsetModulo;
+      }
+    }
+    i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+    dir = this.data.m === 1 ? 1 : -1;
+    cont = this._currentCopies;
+    var j;
+    var jLen;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      jLen = itemsTransform.length;
+      items[items.length - 1].transform.mProps._mdf = true;
+      items[items.length - 1].transform.op._mdf = true;
+      items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
+      if (iteration !== 0) {
+        if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
+          this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
         }
-    }
-};
+        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]);
+        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]);
+        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]);
 
-RepeaterModifier.prototype.cloneElements = function(elements){
-    var i, len = elements.length;
-    var newElements = JSON.parse(JSON.stringify(elements));
-    this.resetElements(newElements);
-    return newElements;
-};
-
-RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._render = renderFlag;
-        if(elements[i].ty === 'gr') {
-            this.changeGroupRender(elements[i].it, renderFlag);
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-    }
-};
-
-RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
-    var items, itemsTransform, i, dir, cont;
-    if(this._mdf || _isFirstFrame){
-        var copies = Math.ceil(this.c.v);
-        if(this._groups.length < copies){
-            while(this._groups.length < copies){
-                var group = {
-                    it:this.cloneElements(this._elements),
-                    ty:'gr'
-                };
-                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
-                
-                this.arr.splice(0,0,group);
-                this._groups.splice(0,0,group);
-                this._currentCopies += 1;
-            }
-            this.elem.reloadShapes();
-        }
-        cont = 0;
-        var renderFlag;
-        for(i = 0; i  <= this._groups.length - 1; i += 1){
-            renderFlag = cont < copies;
-            this._groups[i]._render = renderFlag;
-            this.changeGroupRender(this._groups[i].it, renderFlag);
-            cont += 1;
-        }
-        
-        this._currentCopies = copies;
-        ////
-
-        var offset = this.o.v;
-        var offsetModulo = offset%1;
-        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-        var k;
-        var tMat = this.tr.v.props;
-        var pProps = this.pMatrix.props;
-        var rProps = this.rMatrix.props;
-        var sProps = this.sMatrix.props;
-        this.pMatrix.reset();
-        this.rMatrix.reset();
-        this.sMatrix.reset();
-        this.tMatrix.reset();
         this.matrix.reset();
-        var iteration = 0;
-
-        if(offset > 0) {
-            while(iteration<roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                iteration += 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                iteration += offsetModulo;
-            }
-        } else if(offset < 0) {
-            while(iteration>roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                iteration -= 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                iteration -= offsetModulo;
-            }
+      } else {
+        this.matrix.reset();
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
-        dir = this.data.m === 1 ? 1 : -1;
-        cont = this._currentCopies;
-        var j, jLen;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            jLen = itemsTransform.length;
-            items[items.length - 1].transform.mProps._mdf = true;
-            items[items.length - 1].transform.op._mdf = true;
-            items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
-            if(iteration !== 0){
-                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                }
-                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]);
-                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]);
-                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]);
-                
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-                this.matrix.reset();
-            } else {
-                this.matrix.reset();
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-            }
-            iteration += 1;
-            cont -= 1;
-            i += dir;
-        }
-    } else {
-        cont = this._currentCopies;
-        i = 0;
-        dir = 1;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            items[items.length - 1].transform.mProps._mdf = false;
-            items[items.length - 1].transform.op._mdf = false;
-            cont -= 1;
-            i += dir;
-        }
+      }
+      iteration += 1;
+      cont -= 1;
+      i += dir;
     }
+  } else {
+    cont = this._currentCopies;
+    i = 0;
+    dir = 1;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      items[items.length - 1].transform.mProps._mdf = false;
+      items[items.length - 1].transform.op._mdf = false;
+      cont -= 1;
+      i += dir;
+    }
+  }
 };
 
-RepeaterModifier.prototype.addShape = function(){};
+RepeaterModifier.prototype.addShape = function () {};
 
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = createSizedArray(this._maxLength);
+ShapeModifiers.registerModifier('rp', RepeaterModifier);
+
+/* global createSizedArray, shapePool */
+
+function ShapeCollection() {
+  this._length = 0;
+  this._maxLength = 4;
+  this.shapes = createSizedArray(this._maxLength);
 }
 
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
+ShapeCollection.prototype.addShape = function (shapeData) {
+  if (this._length === this._maxLength) {
+    this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
+    this._maxLength *= 2;
+  }
+  this.shapes[this._length] = shapeData;
+  this._length += 1;
 };
 
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
+ShapeCollection.prototype.releaseShapes = function () {
+  var i;
+  for (i = 0; i < this._length; i += 1) {
+    shapePool.release(this.shapes[i]);
+  }
+  this._length = 0;
 };
+
+/* global createSizedArray, createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
 function DashProperty(elem, data, renderer, container) {
-    this.elem = elem;
-    this.frameId = -1;
-    this.dataProps = createSizedArray(data.length);
-    this.renderer = renderer;
-    this.k = false;
-    this.dashStr = '';
-    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
-    this.dashoffset = createTypedArray('float32',  1);
-    this.initDynamicPropertyContainer(container);
-    var i, len = data.length || 0, prop;
-    for(i = 0; i < len; i += 1) {
-        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
-        this.k = prop.k || this.k;
-        this.dataProps[i] = {n:data[i].n,p:prop};
-    }
-    if(!this.k){
-        this.getValue(true);
-    }
-    this._isAnimated = this.k;
+  this.elem = elem;
+  this.frameId = -1;
+  this.dataProps = createSizedArray(data.length);
+  this.renderer = renderer;
+  this.k = false;
+  this.dashStr = '';
+  this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
+  this.dashoffset = createTypedArray('float32', 1);
+  this.initDynamicPropertyContainer(container);
+  var i;
+  var len = data.length || 0;
+  var prop;
+  for (i = 0; i < len; i += 1) {
+    prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
+    this.k = prop.k || this.k;
+    this.dataProps[i] = { n: data[i].n, p: prop };
+  }
+  if (!this.k) {
+    this.getValue(true);
+  }
+  this._isAnimated = this.k;
 }
 
-DashProperty.prototype.getValue = function(forceRender) {
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
+DashProperty.prototype.getValue = function (forceRender) {
+  if (this.elem.globalData.frameId === this.frameId && !forceRender) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
+  this._mdf = this._mdf || forceRender;
+  if (this._mdf) {
+    var i = 0;
+    var len = this.dataProps.length;
+    if (this.renderer === 'svg') {
+      this.dashStr = '';
     }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
-    this._mdf = this._mdf || forceRender;
-    if (this._mdf) {
-        var i = 0, len = this.dataProps.length;
-        if(this.renderer === 'svg') {
-            this.dashStr = '';
+    for (i = 0; i < len; i += 1) {
+      if (this.dataProps[i].n !== 'o') {
+        if (this.renderer === 'svg') {
+          this.dashStr += ' ' + this.dataProps[i].p.v;
+        } else {
+          this.dashArray[i] = this.dataProps[i].p.v;
         }
-        for(i=0;i<len;i+=1){
-            if(this.dataProps[i].n != 'o'){
-                if(this.renderer === 'svg') {
-                    this.dashStr += ' ' + this.dataProps[i].p.v;
-                }else{
-                    this.dashArray[i] = this.dataProps[i].p.v;
-                }
-            }else{
-                this.dashoffset[0] = this.dataProps[i].p.v;
-            }
-        }
+      } else {
+        this.dashoffset[0] = this.dataProps[i].p.v;
+      }
     }
+  }
 };
 extendPrototype([DynamicPropertyContainer], DashProperty);
-function GradientProperty(elem,data,container){
-    this.data = data;
-    this.c = createTypedArray('uint8c', data.p*4);
-    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-    this.o = createTypedArray('float32', cLength);
-    this._cmdf = false;
-    this._omdf = false;
-    this._collapsable = this.checkCollapsable();
-    this._hasOpacity = cLength;
-    this.initDynamicPropertyContainer(container);
-    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
-    this.k = this.prop.k;
-    this.getValue(true);
+
+/* global createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+function GradientProperty(elem, data, container) {
+  this.data = data;
+  this.c = createTypedArray('uint8c', data.p * 4);
+  var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;
+  this.o = createTypedArray('float32', cLength);
+  this._cmdf = false;
+  this._omdf = false;
+  this._collapsable = this.checkCollapsable();
+  this._hasOpacity = cLength;
+  this.initDynamicPropertyContainer(container);
+  this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
+  this.k = this.prop.k;
+  this.getValue(true);
 }
 
-GradientProperty.prototype.comparePoints = function(values, points) {
-    var i = 0, len = this.o.length/2, diff;
-    while(i < len) {
-        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
-        if(diff > 0.01){
-            return false;
-        }
-        i += 1;
+GradientProperty.prototype.comparePoints = function (values, points) {
+  var i = 0;
+  var len = this.o.length / 2;
+  var diff;
+  while (i < len) {
+    diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
+    if (diff > 0.01) {
+      return false;
     }
-    return true;
+    i += 1;
+  }
+  return true;
 };
 
-GradientProperty.prototype.checkCollapsable = function() {
-    if (this.o.length/2 !== this.c.length/4) {
+GradientProperty.prototype.checkCollapsable = function () {
+  if (this.o.length / 2 !== this.c.length / 4) {
+    return false;
+  }
+  if (this.data.k.k[0].s) {
+    var i = 0;
+    var len = this.data.k.k.length;
+    while (i < len) {
+      if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
         return false;
+      }
+      i += 1;
     }
-    if (this.data.k.k[0].s) {
-        var i = 0, len = this.data.k.k.length;
-        while (i < len) {
-            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
-                return false;
-            }
-            i += 1;
-        }
-    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
-        return false;
-    }
-    return true;
+  } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
+    return false;
+  }
+  return true;
 };
 
-GradientProperty.prototype.getValue = function(forceRender){
-    this.prop.getValue();
-    this._mdf = false;
-    this._cmdf = false;
-    this._omdf = false;
-    if(this.prop._mdf || forceRender){
-        var i, len = this.data.p*4;
-        var mult, val;
-        for(i=0;i<len;i+=1){
-            mult = i%4 === 0 ? 100 : 255;
-            val = Math.round(this.prop.v[i]*mult);
-            if(this.c[i] !== val){
-                this.c[i] = val;
-                this._cmdf = !forceRender;
-            }
-        }
-        if(this.o.length){
-            len = this.prop.v.length;
-            for(i=this.data.p*4;i<len;i+=1){
-                mult = i%2 === 0 ? 100 : 1;
-                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                if(this.o[i-this.data.p*4] !== val){
-                    this.o[i-this.data.p*4] = val;
-                    this._omdf = !forceRender;
-                }
-            }
-        }
-        this._mdf = !forceRender;
+GradientProperty.prototype.getValue = function (forceRender) {
+  this.prop.getValue();
+  this._mdf = false;
+  this._cmdf = false;
+  this._omdf = false;
+  if (this.prop._mdf || forceRender) {
+    var i;
+    var len = this.data.p * 4;
+    var mult;
+    var val;
+    for (i = 0; i < len; i += 1) {
+      mult = i % 4 === 0 ? 100 : 255;
+      val = Math.round(this.prop.v[i] * mult);
+      if (this.c[i] !== val) {
+        this.c[i] = val;
+        this._cmdf = !forceRender;
+      }
     }
+    if (this.o.length) {
+      len = this.prop.v.length;
+      for (i = this.data.p * 4; i < len; i += 1) {
+        mult = i % 2 === 0 ? 100 : 1;
+        val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
+        if (this.o[i - this.data.p * 4] !== val) {
+          this.o[i - this.data.p * 4] = val;
+          this._omdf = !forceRender;
+        }
+      }
+    }
+    this._mdf = !forceRender;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], GradientProperty);
-var buildShapeString = function(pathNodes, length, closed, mat) {
-	if(length === 0) {
-            return '';
-        }
-        var _o = pathNodes.o;
-        var _i = pathNodes.i;
-        var _v = pathNodes.v;
-        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
-        for(i = 1; i < length; i += 1) {
-            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]);
-        }
-        if (closed && length) {
-            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]);
-            shapeString += 'z';
-        }
-        return shapeString;
-}
-var audioControllerFactory = (function() {
 
-	function AudioController(audioFactory) {
-		this.audios = [];
-		this.audioFactory = audioFactory;
-		this._volume = 1;
-		this._isMuted = false;
-	}
+/* exported buildShapeString */
 
-	AudioController.prototype = {
-		addAudio: function(audio) {
-			this.audios.push(audio);
-		},
-		pause: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].pause()
-			}
-		},
-		resume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].resume()
-			}
-		},
-		setRate: function(rateValue) {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].setRate(rateValue)
-			}
-		},
-		createAudio: function(assetPath) {
-			if (this.audioFactory) {
-				return this.audioFactory(assetPath);
-			} else if (Howl) {
-				return new Howl({
-					src: [assetPath]
-				})
-			} else {
-				return {
-					isPlaying: false,
-					play: function(){this.isPlaying = true},
-					seek: function(){this.isPlaying = false},
-					playing: function(){},
-					rate: function(){},
-					setVolume: function(){},
-				}
-			}
-		},
-		setAudioFactory: function(audioFactory) {
-			this.audioFactory = audioFactory;
-		},
-		setVolume: function(value) {
-			this._volume = value;
-			this._updateVolume();
-		},
-		mute: function() {
-			this._isMuted = true;
-			this._updateVolume();
-		},
-		unmute: function() {
-			this._isMuted = false;
-			this._updateVolume();
-		},
-		getVolume: function(value) {
-			return this._volume;
-		},
-		_updateVolume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1))
-			}
-		}
-	}
+var buildShapeString = function (pathNodes, length, closed, mat) {
+  if (length === 0) {
+    return '';
+  }
+  var _o = pathNodes.o;
+  var _i = pathNodes.i;
+  var _v = pathNodes.v;
+  var i;
+  var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+  for (i = 1; i < length; i += 1) {
+    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]);
+  }
+  if (closed && length) {
+    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]);
+    shapeString += 'z';
+  }
+  return shapeString;
+};
 
-	return function() {
-		return new AudioController()
-	}
+/* global Howl */
+/* exported audioControllerFactory */
 
-}())
-var ImagePreloader = function() {};
+var audioControllerFactory = (function () {
+  function AudioController(audioFactory) {
+    this.audios = [];
+    this.audioFactory = audioFactory;
+    this._volume = 1;
+    this._isMuted = false;
+  }
 
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	};
-	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)) {
-	   ob.maskType = false;
-	}
-	return ob;
+  AudioController.prototype = {
+    addAudio: function (audio) {
+      this.audios.push(audio);
+    },
+    pause: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].pause();
+      }
+    },
+    resume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].resume();
+      }
+    },
+    setRate: function (rateValue) {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].setRate(rateValue);
+      }
+    },
+    createAudio: function (assetPath) {
+      if (this.audioFactory) {
+        return this.audioFactory(assetPath);
+      } if (Howl) {
+        return new Howl({
+          src: [assetPath],
+        });
+      }
+      return {
+        isPlaying: false,
+        play: function () { this.isPlaying = true; },
+        seek: function () { this.isPlaying = false; },
+        playing: function () {},
+        rate: function () {},
+        setVolume: function () {},
+      };
+    },
+    setAudioFactory: function (audioFactory) {
+      this.audioFactory = audioFactory;
+    },
+    setVolume: function (value) {
+      this._volume = value;
+      this._updateVolume();
+    },
+    mute: function () {
+      this._isMuted = true;
+      this._updateVolume();
+    },
+    unmute: function () {
+      this._isMuted = false;
+      this._updateVolume();
+    },
+    getVolume: function () {
+      return this._volume;
+    },
+    _updateVolume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
+      }
+    },
+  };
+
+  return function () {
+    return new AudioController();
+  };
 }());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
 
-	function createFilter(filId){
-        	var fil = createNS('filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
+/* exported ImagePreloader */
 
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = createNS('feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
-                return feColorMatrix;
-	}
+var ImagePreloader = function () {};
 
-	return ob;
+/* exported featureSupport */
+
+var featureSupport = (function () {
+  var ob = {
+    maskType: true,
+  };
+  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)) {
+    ob.maskType = false;
+  }
+  return ob;
 }());
-var assetLoader = (function(){
 
-	function formatResponse(xhr) {
-		if(xhr.response && typeof xhr.response === 'object') {
-			return xhr.response;
-		} else if(xhr.response && typeof xhr.response === 'string') {
-			return JSON.parse(xhr.response);
-		} else if(xhr.responseText) {
-			return JSON.parse(xhr.responseText);
-		}
-	}
+/* global createNS */
+/* exported filtersFactory */
 
-	function loadAsset(path, callback, errorCallback) {
-		var response;
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', path, true);
-		// set responseType after calling open or IE will break.
-		try {
-		    // This crashes on Android WebView prior to KitKat
-		    xhr.responseType = "json";
-		} catch (err) {}
-	    xhr.send();
-	    xhr.onreadystatechange = function () {
-	        if (xhr.readyState == 4) {
-	            if(xhr.status == 200){
-	            	response = formatResponse(xhr);
-	            	callback(response);
-	            }else{
-	                try{
-	            		response = formatResponse(xhr);
-	            		callback(response);
-	                }catch(err){
-	                	if(errorCallback) {
-	                		errorCallback(err);
-	                	}
-	                }
-	            }
-	        }
-	    };
-	}
-	return {
-		load: loadAsset
-	}
-}())
+var filtersFactory = (function () {
+  var ob = {};
+  ob.createFilter = createFilter;
+  ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
+
+  function createFilter(filId) {
+    var fil = createNS('filter');
+    fil.setAttribute('id', filId);
+    fil.setAttribute('filterUnits', 'objectBoundingBox');
+    fil.setAttribute('x', '0%');
+    fil.setAttribute('y', '0%');
+    fil.setAttribute('width', '100%');
+    fil.setAttribute('height', '100%');
+    return fil;
+  }
+
+  function createAlphaToLuminanceFilter() {
+    var feColorMatrix = createNS('feColorMatrix');
+    feColorMatrix.setAttribute('type', 'matrix');
+    feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+    feColorMatrix.setAttribute('values', '0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
+    return feColorMatrix;
+  }
+
+  return ob;
+}());
+
+/* exported assetLoader */
+
+var assetLoader = (function () {
+  function formatResponse(xhr) {
+    if (xhr.response && typeof xhr.response === 'object') {
+      return xhr.response;
+    } if (xhr.response && typeof xhr.response === 'string') {
+      return JSON.parse(xhr.response);
+    } if (xhr.responseText) {
+      return JSON.parse(xhr.responseText);
+    }
+    return null;
+  }
+
+  function loadAsset(path, callback, errorCallback) {
+    var response;
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', path, true);
+    // set responseType after calling open or IE will break.
+    try {
+      // This crashes on Android WebView prior to KitKat
+      xhr.responseType = 'json';
+    } catch (err) {} // eslint-disable-line no-empty
+    xhr.send();
+    xhr.onreadystatechange = function () {
+      if (xhr.readyState === 4) {
+        if (xhr.status === 200) {
+          response = formatResponse(xhr);
+          callback(response);
+        } else {
+          try {
+            response = formatResponse(xhr);
+            callback(response);
+          } catch (err) {
+            if (errorCallback) {
+              errorCallback(err);
+            }
+          }
+        }
+      }
+    };
+  }
+  return {
+    load: loadAsset,
+  };
+}());
+
+/* exported assetLoader */
 
 var assetLoader = null;
 
-function TextAnimatorProperty(textData, renderType, elem){
-    this._isFirstFrame = true;
-	this._hasMaskedPath = false;
-	this._frameId = -1;
-	this._textData = textData;
-	this._renderType = renderType;
-    this._elem = elem;
-	this._animatorsData = createSizedArray(this._textData.a.length);
-	this._pathData = {};
-	this._moreOptions = {
-		alignment: {}
-	};
-	this.renderedLetters = [];
-    this.lettersChangedFlag = false;
-    this.initDynamicPropertyContainer(elem);
+/* global createSizedArray, PropertyFactory, TextAnimatorDataProperty, bez, addHueToRGB,
+  addSaturationToRGB, addBrightnessToRGB, LetterProps, Matrix, extendPrototype, DynamicPropertyContainer */
 
+function TextAnimatorProperty(textData, renderType, elem) {
+  this._isFirstFrame = true;
+  this._hasMaskedPath = false;
+  this._frameId = -1;
+  this._textData = textData;
+  this._renderType = renderType;
+  this._elem = elem;
+  this._animatorsData = createSizedArray(this._textData.a.length);
+  this._pathData = {};
+  this._moreOptions = {
+    alignment: {},
+  };
+  this.renderedLetters = [];
+  this.lettersChangedFlag = false;
+  this.initDynamicPropertyContainer(elem);
 }
 
-TextAnimatorProperty.prototype.searchProperties = function(){
-    var i, len = this._textData.a.length, animatorProps;
-    var getProp = PropertyFactory.getProp;
-    for(i=0;i<len;i+=1){
-        animatorProps = this._textData.a[i];
-        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
-    }
-    if(this._textData.p && 'm' in this._textData.p){
-        this._pathData = {
-            f: getProp(this._elem,this._textData.p.f,0,0,this),
-            l: getProp(this._elem,this._textData.p.l,0,0,this),
-            r: this._textData.p.r,
-            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
-        };
-        this._hasMaskedPath = true;
-    } else {
-        this._hasMaskedPath = false;
-    }
-    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+TextAnimatorProperty.prototype.searchProperties = function () {
+  var i;
+  var len = this._textData.a.length;
+  var animatorProps;
+  var getProp = PropertyFactory.getProp;
+  for (i = 0; i < len; i += 1) {
+    animatorProps = this._textData.a[i];
+    this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+  }
+  if (this._textData.p && 'm' in this._textData.p) {
+    this._pathData = {
+      f: getProp(this._elem, this._textData.p.f, 0, 0, this),
+      l: getProp(this._elem, this._textData.p.l, 0, 0, this),
+      r: this._textData.p.r,
+      m: this._elem.maskManager.getMaskProperty(this._textData.p.m),
+    };
+    this._hasMaskedPath = true;
+  } else {
+    this._hasMaskedPath = false;
+  }
+  this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
 };
 
-TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
-    this.lettersChangedFlag = lettersChangedFlag;
-    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
-        return;
+TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
+  this.lettersChangedFlag = lettersChangedFlag;
+  if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+    return;
+  }
+  this._isFirstFrame = false;
+  var alignment = this._moreOptions.alignment.v;
+  var animators = this._animatorsData;
+  var textData = this._textData;
+  var matrixHelper = this.mHelper;
+  var renderType = this._renderType;
+  var renderedLettersCount = this.renderedLetters.length;
+  var xPos;
+  var yPos;
+  var i;
+  var len;
+  var letters = documentData.l;
+  var pathInfo;
+  var currentLength;
+  var currentPoint;
+  var segmentLength;
+  var flag;
+  var pointInd;
+  var segmentInd;
+  var prevPoint;
+  var points;
+  var segments;
+  var partialLength;
+  var totalLength;
+  var perc;
+  var tanAngle;
+  var mask;
+  if (this._hasMaskedPath) {
+    mask = this._pathData.m;
+    if (!this._pathData.n || this._pathData._mdf) {
+      var paths = mask.v;
+      if (this._pathData.r) {
+        paths = paths.reverse();
+      }
+      // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+      pathInfo = {
+        tLength: 0,
+        segments: [],
+      };
+      len = paths._length - 1;
+      var bezierData;
+      totalLength = 0;
+      for (i = 0; i < len; i += 1) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      i = len;
+      if (mask.v.c) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      this._pathData.pi = pathInfo;
     }
-    this._isFirstFrame = false;
-    var alignment = this._moreOptions.alignment.v;
-    var animators = this._animatorsData;
-    var textData = this._textData;
-    var matrixHelper = this.mHelper;
-    var renderType = this._renderType;
-    var renderedLettersCount = this.renderedLetters.length;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
-    if(this._hasMaskedPath) {
-        mask = this._pathData.m;
-        if(!this._pathData.n || this._pathData._mdf){
-            var paths = mask.v;
-            if(this._pathData.r){
-                paths = paths.reverse();
-            }
-            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
-            pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths._length - 1;
-            var bezierData;
-            totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            this._pathData.pi = pathInfo;
-        }
-        pathInfo = this._pathData.pi;
+    pathInfo = this._pathData.pi;
 
-        currentLength = this._pathData.f.v;
-        segmentInd = 0;
-        pointInd = 1;
-        segmentLength = 0;
-        flag = true;
-        segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].points;
-                    pointInd = points.length - 1;
-                }
-            }
-
+    currentLength = this._pathData.f.v;
+    segmentInd = 0;
+    pointInd = 1;
+    segmentLength = 0;
+    flag = true;
+    segments = pathInfo.segments;
+    if (currentLength < 0 && mask.v.c) {
+      if (pathInfo.tLength < Math.abs(currentLength)) {
+        currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+      }
+      segmentInd = segments.length - 1;
+      points = segments[segmentInd].points;
+      pointInd = points.length - 1;
+      while (currentLength < 0) {
+        currentLength += points[pointInd].partialLength;
+        pointInd -= 1;
+        if (pointInd < 0) {
+          segmentInd -= 1;
+          points = segments[segmentInd].points;
+          pointInd = points.length - 1;
         }
+      }
+    }
+    points = segments[segmentInd].points;
+    prevPoint = points[pointInd - 1];
+    currentPoint = points[pointInd];
+    partialLength = currentPoint.partialLength;
+  }
+
+  len = letters.length;
+  xPos = 0;
+  yPos = 0;
+  var yOff = documentData.finalSize * 1.2 * 0.714;
+  var firstLine = true;
+  var animatorProps;
+  var animatorSelector;
+  var j;
+  var jLen;
+  var letterValue;
+
+  jLen = animators.length;
+
+  var mult;
+  var ind = -1;
+  var offf;
+  var xPathPos;
+  var yPathPos;
+  var initPathPos = currentLength;
+  var initSegmentInd = segmentInd;
+  var initPointInd = pointInd;
+  var currentLine = -1;
+  var elemOpacity;
+  var sc;
+  var sw;
+  var fc;
+  var k;
+  var letterSw;
+  var letterSc;
+  var letterFc;
+  var letterM = '';
+  var letterP = this.defaultPropsArray;
+  var letterO;
+
+  //
+  if (documentData.j === 2 || documentData.j === 1) {
+    var animatorJustifyOffset = 0;
+    var animatorFirstCharOffset = 0;
+    var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+    var lastIndex = 0;
+    var isNewLine = true;
+
+    for (i = 0; i < len; i += 1) {
+      if (letters[i].n) {
+        if (animatorJustifyOffset) {
+          animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while (lastIndex < i) {
+          letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+          lastIndex += 1;
+        }
+        animatorJustifyOffset = 0;
+        isNewLine = true;
+      } else {
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.t.propType) {
+            if (isNewLine && documentData.j === 2) {
+              animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+            }
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
+            } else {
+              animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
+            }
+          }
+        }
+        isNewLine = false;
+      }
+    }
+    if (animatorJustifyOffset) {
+      animatorJustifyOffset += animatorFirstCharOffset;
+    }
+    while (lastIndex < i) {
+      letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+      lastIndex += 1;
+    }
+  }
+  //
+
+  for (i = 0; i < len; i += 1) {
+    matrixHelper.reset();
+    elemOpacity = 1;
+    if (letters[i].n) {
+      xPos = 0;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      currentLength = initPathPos;
+      firstLine = false;
+      if (this._hasMaskedPath) {
+        segmentInd = initSegmentInd;
+        pointInd = initPointInd;
         points = segments[segmentInd].points;
         prevPoint = points[pointInd - 1];
         currentPoint = points[pointInd];
         partialLength = currentPoint.partialLength;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.finalSize * 1.2 * 0.714;
-    var firstLine = true;
-    var animatorProps, animatorSelector;
-    var j, jLen;
-    var letterValue;
-
-    jLen = animators.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
-
-    //
-    if(documentData.j === 2 || documentData.j === 1) {
-        var animatorJustifyOffset = 0;
-        var animatorFirstCharOffset = 0;
-        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
-        var lastIndex = 0;
-        var isNewLine = true;
-
-        for (i = 0; i < len; i += 1) {
-            if (letters[i].n) {
-                if(animatorJustifyOffset) {
-                    animatorJustifyOffset += animatorFirstCharOffset;
-                }
-                while (lastIndex < i) {
-                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-                    lastIndex += 1;
-                }
-                animatorJustifyOffset = 0;
-                isNewLine = true;
+        segmentLength = 0;
+      }
+      letterM = '';
+      letterFc = '';
+      letterSw = '';
+      letterO = '';
+      letterP = this.defaultPropsArray;
+    } else {
+      if (this._hasMaskedPath) {
+        if (currentLine !== letters[i].line) {
+          switch (documentData.j) {
+            case 1:
+              currentLength += totalLength - documentData.lineWidths[letters[i].line];
+              break;
+            case 2:
+              currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
+              break;
+            default:
+              break;
+          }
+          currentLine = letters[i].line;
+        }
+        if (ind !== letters[i].ind) {
+          if (letters[ind]) {
+            currentLength += letters[ind].extra;
+          }
+          currentLength += letters[i].an / 2;
+          ind = letters[i].ind;
+        }
+        currentLength += (alignment[0] * letters[i].an) * 0.005;
+        var animatorOffset = 0;
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.p.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.p.v[0] * mult[0];
             } else {
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.t.propType) {
-                        if (isNewLine && documentData.j === 2) {
-                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
-                        }
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
-                        if (mult.length) {
-                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
-                        } else {
-                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
-                        }
-                    }
-                }
-                isNewLine = false;
+              animatorOffset += animatorProps.p.v[0] * mult;
             }
+          }
+          if (animatorProps.a.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.a.v[0] * mult[0];
+            } else {
+              animatorOffset += animatorProps.a.v[0] * mult;
+            }
+          }
         }
-        if(animatorJustifyOffset) {
-            animatorJustifyOffset += animatorFirstCharOffset;
-        }
-        while(lastIndex < i) {
-            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-            lastIndex += 1;
-        }
-    }
-    //
-
-    for( i = 0; i < len; i += 1) {
-
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this._hasMaskedPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
+        flag = true;
+        while (flag) {
+          if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+            matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01);
+            flag = false;
+          } else if (points) {
+            segmentLength += currentPoint.partialLength;
+            pointInd += 1;
+            if (pointInd >= points.length) {
+              pointInd = 0;
+              segmentInd += 1;
+              if (!segments[segmentInd]) {
+                if (mask.v.c) {
+                  pointInd = 0;
+                  segmentInd = 0;
+                  points = segments[segmentInd].points;
+                } else {
+                  segmentLength -= currentPoint.partialLength;
+                  points = null;
+                }
+              } else {
                 points = segments[segmentInd].points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
+              }
             }
-            letterO = letterSw = letterFc = letterM = '';
-            letterP = this.defaultPropsArray;
-        }else{
-            if(this._hasMaskedPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += alignment[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.p.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
+            if (points) {
+              prevPoint = currentPoint;
+              currentPoint = points[pointInd];
+              partialLength = currentPoint.partialLength;
+            }
+          }
+        }
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
+      } else {
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
 
-                    }
-                    if (animatorProps.a.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
+        // Grouping alignment
+        matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0);
+      }
 
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.t.propType) {
+          animatorSelector = animators[j].s;
+          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"
+          if (xPos !== 0 || documentData.j !== 0) {
+            if (this._hasMaskedPath) {
+              if (mult.length) {
+                currentLength += animatorProps.t.v * mult[0];
+              } else {
+                currentLength += animatorProps.t.v * mult;
+              }
+            } else if (mult.length) {
+              xPos += animatorProps.t.v * mult[0];
             } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+              xPos += animatorProps.t.v * mult;
             }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.t.propType) {
-                    animatorSelector = animators[j].s;
-                    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"
-                    if(xPos !== 0 || documentData.j !== 0) {
-                        if(this._hasMaskedPath) {
-                            if(mult.length) {
-                                currentLength += animatorProps.t.v*mult[0];
-                            } else {
-                                currentLength += animatorProps.t.v*mult;
-                            }
-                        }else{
-                            if(mult.length) {
-                                xPos += animatorProps.t.v*mult[0];
-                            } else {
-                                xPos += animatorProps.t.v*mult;
-                            }
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim && documentData.fc) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.a.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.s.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = animators[j].a;
-                animatorSelector = animators[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                if (animatorProps.sk.propType) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if (animatorProps.r.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if (animatorProps.ry.propType) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if (animatorProps.rx.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if (animatorProps.o.propType) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
-                        } else {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim && documentData.fc) {
-                    if(animatorProps.fc.propType){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                            }
-                        }
-                    }
-                    if(animatorProps.fh.propType){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if(animatorProps.fs.propType){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if(animatorProps.fb.propType){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-
-                if (animatorProps.p.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(this._hasMaskedPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim && documentData.fc){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this._hasMaskedPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
-                if (textData.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= alignment[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.finalSize;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                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]];
-            }
-            letterO = elemOpacity;
+          }
         }
-
-        if(renderedLettersCount <= i) {
-            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            this.renderedLetters.push(letterValue);
-            renderedLettersCount += 1;
-            this.lettersChangedFlag = true;
+      }
+      if (documentData.strokeWidthAnim) {
+        sw = documentData.sw || 0;
+      }
+      if (documentData.strokeColorAnim) {
+        if (documentData.sc) {
+          sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
         } else {
-            letterValue = this.renderedLetters[i];
-            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+          sc = [0, 0, 0];
         }
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.a.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+
+          if (mult.length) {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.s.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (mult.length) {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1);
+          } else {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        animatorSelector = animators[j].s;
+        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+        if (animatorProps.sk.propType) {
+          if (mult.length) {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+          } else {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+          }
+        }
+        if (animatorProps.r.propType) {
+          if (mult.length) {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+          } else {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult);
+          }
+        }
+        if (animatorProps.ry.propType) {
+          if (mult.length) {
+            matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
+          } else {
+            matrixHelper.rotateY(animatorProps.ry.v * mult);
+          }
+        }
+        if (animatorProps.rx.propType) {
+          if (mult.length) {
+            matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
+          } else {
+            matrixHelper.rotateX(animatorProps.rx.v * mult);
+          }
+        }
+        if (animatorProps.o.propType) {
+          if (mult.length) {
+            elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0];
+          } else {
+            elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult;
+          }
+        }
+        if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+          if (mult.length) {
+            sw += animatorProps.sw.v * mult[0];
+          } else {
+            sw += animatorProps.sw.v * mult;
+          }
+        }
+        if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+          for (k = 0; k < 3; k += 1) {
+            if (mult.length) {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
+            } else {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
+            }
+          }
+        }
+        if (documentData.fillColorAnim && documentData.fc) {
+          if (animatorProps.fc.propType) {
+            for (k = 0; k < 3; k += 1) {
+              if (mult.length) {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
+              } else {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
+              }
+            }
+          }
+          if (animatorProps.fh.propType) {
+            if (mult.length) {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
+            } else {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult);
+            }
+          }
+          if (animatorProps.fs.propType) {
+            if (mult.length) {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
+            } else {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
+            }
+          }
+          if (animatorProps.fb.propType) {
+            if (mult.length) {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
+            } else {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
+            }
+          }
+        }
+      }
+
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+
+        if (animatorProps.p.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (this._hasMaskedPath) {
+            if (mult.length) {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+            } else {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+            }
+          } else if (mult.length) {
+            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+          }
+        }
+      }
+      if (documentData.strokeWidthAnim) {
+        letterSw = sw < 0 ? 0 : sw;
+      }
+      if (documentData.strokeColorAnim) {
+        letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
+      }
+
+      if (this._hasMaskedPath) {
+        matrixHelper.translate(0, -documentData.ls);
+
+        matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0);
+        if (textData.p.p) {
+          tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+          var rot = (Math.atan(tanAngle) * 180) / Math.PI;
+          if (currentPoint.point[0] < prevPoint.point[0]) {
+            rot += 180;
+          }
+          matrixHelper.rotate((-rot * Math.PI) / 180);
+        }
+        matrixHelper.translate(xPathPos, yPathPos, 0);
+        currentLength -= (alignment[0] * letters[i].an) * 0.005;
+        if (letters[i + 1] && ind !== letters[i + 1].ind) {
+          currentLength += letters[i].an / 2;
+          currentLength += (documentData.tr * 0.001) * documentData.finalSize;
+        }
+      } else {
+        matrixHelper.translate(xPos, yPos, 0);
+
+        if (documentData.ps) {
+          // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+          matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+        }
+        switch (documentData.j) {
+          case 1:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
+            break;
+          case 2:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
+            break;
+          default:
+            break;
+        }
+        matrixHelper.translate(0, -documentData.ls);
+        matrixHelper.translate(offf, 0, 0);
+        matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0);
+        xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize;
+      }
+      if (renderType === 'html') {
+        letterM = matrixHelper.toCSS();
+      } else if (renderType === 'svg') {
+        letterM = matrixHelper.to2dCSS();
+      } else {
+        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]];
+      }
+      letterO = elemOpacity;
     }
+
+    if (renderedLettersCount <= i) {
+      letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
+      this.renderedLetters.push(letterValue);
+      renderedLettersCount += 1;
+      this.lettersChangedFlag = true;
+    } else {
+      letterValue = this.renderedLetters[i];
+      this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+    }
+  }
 };
 
-TextAnimatorProperty.prototype.getValue = function(){
-	if(this._elem.globalData.frameId === this._frameId){
-        return;
-    }
-    this._frameId = this._elem.globalData.frameId;
-    this.iterateDynamicProperties();
+TextAnimatorProperty.prototype.getValue = function () {
+  if (this._elem.globalData.frameId === this._frameId) {
+    return;
+  }
+  this._frameId = this._elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 TextAnimatorProperty.prototype.mHelper = new Matrix();
 TextAnimatorProperty.prototype.defaultPropsArray = [];
 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
+
+/* global PropertyFactory, degToRads, TextSelectorProp */
+/* exported TextAnimatorDataProperty */
+
 function TextAnimatorDataProperty(elem, animatorProps, container) {
-	var defaultData = {propType:false};
-	var getProp = PropertyFactory.getProp;
-	var textAnimator_animatables = animatorProps.a;
-	this.a = {
-		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
-		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
-		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
-		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
-		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
-		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
-		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
-		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
-		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
-		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
-		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
-		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
-		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
-		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
-		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
-		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
-	};
+  var defaultData = { propType: false };
+  var getProp = PropertyFactory.getProp;
+  var textAnimatorAnimatables = animatorProps.a;
+  this.a = {
+    r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
+    rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
+    ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
+    sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
+    sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
+    s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
+    a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
+    o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
+    p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
+    sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
+    sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
+    fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
+    fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
+    fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
+    fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
+    t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData,
+  };
 
-	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
-    this.s.t = animatorProps.s.t;
+  this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
+  this.s.t = animatorProps.s.t;
 }
-function LetterProps(o, sw, sc, fc, m, p){
+
+function LetterProps(o, sw, sc, fc, m, p) {
+  this.o = o;
+  this.sw = sw;
+  this.sc = sc;
+  this.fc = fc;
+  this.m = m;
+  this.p = p;
+  this._mdf = {
+    o: true,
+    sw: !!sw,
+    sc: !!sc,
+    fc: !!fc,
+    m: true,
+    p: true,
+  };
+}
+
+LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
+  this._mdf.o = false;
+  this._mdf.sw = false;
+  this._mdf.sc = false;
+  this._mdf.fc = false;
+  this._mdf.m = false;
+  this._mdf.p = false;
+  var updated = false;
+
+  if (this.o !== o) {
     this.o = o;
+    this._mdf.o = true;
+    updated = true;
+  }
+  if (this.sw !== sw) {
     this.sw = sw;
+    this._mdf.sw = true;
+    updated = true;
+  }
+  if (this.sc !== sc) {
     this.sc = sc;
+    this._mdf.sc = true;
+    updated = true;
+  }
+  if (this.fc !== fc) {
     this.fc = fc;
+    this._mdf.fc = true;
+    updated = true;
+  }
+  if (this.m !== m) {
     this.m = m;
+    this._mdf.m = true;
+    updated = true;
+  }
+  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])) {
     this.p = p;
-    this._mdf = {
-    	o: true,
-    	sw: !!sw,
-    	sc: !!sc,
-    	fc: !!fc,
-    	m: true,
-    	p: true
-    };
-}
-
-LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
-	this._mdf.o = false;
-	this._mdf.sw = false;
-	this._mdf.sc = false;
-	this._mdf.fc = false;
-	this._mdf.m = false;
-	this._mdf.p = false;
-	var updated = false;
-
-	if(this.o !== o) {
-		this.o = o;
-		this._mdf.o = true;
-		updated = true;
-	}
-	if(this.sw !== sw) {
-		this.sw = sw;
-		this._mdf.sw = true;
-		updated = true;
-	}
-	if(this.sc !== sc) {
-		this.sc = sc;
-		this._mdf.sc = true;
-		updated = true;
-	}
-	if(this.fc !== fc) {
-		this.fc = fc;
-		this._mdf.fc = true;
-		updated = true;
-	}
-	if(this.m !== m) {
-		this.m = m;
-		this._mdf.m = true;
-		updated = true;
-	}
-	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])) {
-		this.p = p;
-		this._mdf.p = true;
-		updated = true;
-	}
-	return updated;
-};
-function TextProperty(elem, data){
-	this._frameId = initialDefaultFrame;
-	this.pv = '';
-	this.v = '';
-	this.kf = false;
-	this._isFirstFrame = true;
-	this._mdf = false;
-    this.data = data;
-	this.elem = elem;
-    this.comp = this.elem.comp;
-	this.keysIndex = 0;
-    this.canResize = false;
-    this.minimumFontSize = 1;
-    this.effectsSequence = [];
-	this.currentData = {
-		ascent: 0,
-        boxWidth: this.defaultBoxWidth,
-        f: '',
-        fStyle: '',
-        fWeight: '',
-        fc: '',
-        j: '',
-        justifyOffset: '',
-        l: [],
-        lh: 0,
-        lineWidths: [],
-        ls: '',
-        of: '',
-        s: '',
-        sc: '',
-        sw: 0,
-        t: 0,
-        tr: 0,
-        sz:0,
-        ps:null,
-        fillColorAnim: false,
-        strokeColorAnim: false,
-        strokeWidthAnim: false,
-        yOffset: 0,
-        finalSize:0,
-        finalText:[],
-        finalLineHeight: 0,
-        __complete: false
-
-	};
-    this.copyData(this.currentData, this.data.d.k[0].s);
-
-    if(!this.searchProperty()) {
-        this.completeTextData(this.currentData);
-    }
-}
-
-TextProperty.prototype.defaultBoxWidth = [0,0];
-
-TextProperty.prototype.copyData = function(obj, data) {
-    for(var s in data) {
-        if(data.hasOwnProperty(s)) {
-            obj[s] = data[s];
-        }
-    }
-    return obj;
-}
-
-TextProperty.prototype.setCurrentData = function(data){
-    if(!data.__complete) {
-        this.completeTextData(data);
-    }
-    this.currentData = data;
-    this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
-    this._mdf = true;
+    this._mdf.p = true;
+    updated = true;
+  }
+  return updated;
 };
 
-TextProperty.prototype.searchProperty = function() {
-    return this.searchKeyframes();
-};
+/* global FontManager, initialDefaultFrame, getFontProperties */
+/* exported TextProperty */
 
-TextProperty.prototype.searchKeyframes = function() {
-    this.kf = this.data.d.k.length > 1;
-    if(this.kf) {
-        this.addEffect(this.getKeyframeValue.bind(this));
-    }
-    return this.kf;
+function TextProperty(elem, data) {
+  this._frameId = initialDefaultFrame;
+  this.pv = '';
+  this.v = '';
+  this.kf = false;
+  this._isFirstFrame = true;
+  this._mdf = false;
+  this.data = data;
+  this.elem = elem;
+  this.comp = this.elem.comp;
+  this.keysIndex = 0;
+  this.canResize = false;
+  this.minimumFontSize = 1;
+  this.effectsSequence = [];
+  this.currentData = {
+    ascent: 0,
+    boxWidth: this.defaultBoxWidth,
+    f: '',
+    fStyle: '',
+    fWeight: '',
+    fc: '',
+    j: '',
+    justifyOffset: '',
+    l: [],
+    lh: 0,
+    lineWidths: [],
+    ls: '',
+    of: '',
+    s: '',
+    sc: '',
+    sw: 0,
+    t: 0,
+    tr: 0,
+    sz: 0,
+    ps: null,
+    fillColorAnim: false,
+    strokeColorAnim: false,
+    strokeWidthAnim: false,
+    yOffset: 0,
+    finalSize: 0,
+    finalText: [],
+    finalLineHeight: 0,
+    __complete: false,
+
+  };
+  this.copyData(this.currentData, this.data.d.k[0].s);
+
+  if (!this.searchProperty()) {
+    this.completeTextData(this.currentData);
+  }
 }
 
-TextProperty.prototype.addEffect = function(effectFunction) {
-	this.effectsSequence.push(effectFunction);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.defaultBoxWidth = [0, 0];
+
+TextProperty.prototype.copyData = function (obj, data) {
+  for (var s in data) {
+    if (Object.prototype.hasOwnProperty.call(data, s)) {
+      obj[s] = data[s];
+    }
+  }
+  return obj;
 };
 
-TextProperty.prototype.getValue = function(_finalValue) {
-    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
-        return;
-    }
-    this.currentData.t = this.data.d.k[this.keysIndex].s.t;
-    var currentValue = this.currentData;
-    var currentIndex = this.keysIndex;
-    if(this.lock) {
-        this.setCurrentData(this.currentData);
-        return;
-    }
-    this.lock = true;
-    this._mdf = false;
-    var multipliedValue;
-    var i, len = this.effectsSequence.length;
-    var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
-    for(i = 0; i < len; i += 1) {
-        //Checking if index changed to prevent creating a new object every time the expression updates.
-        if(currentIndex !== this.keysIndex) {
-            finalValue = this.effectsSequence[i](finalValue, finalValue.t);
-        } else {
-            finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
-        }
-    }
-    if(currentValue !== finalValue) {
-        this.setCurrentData(finalValue);
-    }
-    this.pv = this.v = this.currentData;
-    this.lock = false;
-    this.frameId = this.elem.globalData.frameId;
-}
+TextProperty.prototype.setCurrentData = function (data) {
+  if (!data.__complete) {
+    this.completeTextData(data);
+  }
+  this.currentData = data;
+  this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+  this._mdf = true;
+};
 
-TextProperty.prototype.getKeyframeValue = function() {
-    var textKeys = this.data.d.k, textDocumentData;
-    var frameNum = this.elem.comp.renderedFrame;
-    var i = 0, len = textKeys.length;
-    while(i <= len - 1) {
-        textDocumentData = textKeys[i].s;
-        if(i === len - 1 || textKeys[i+1].t > frameNum){
-            break;
-        }
+TextProperty.prototype.searchProperty = function () {
+  return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function () {
+  this.kf = this.data.d.k.length > 1;
+  if (this.kf) {
+    this.addEffect(this.getKeyframeValue.bind(this));
+  }
+  return this.kf;
+};
+
+TextProperty.prototype.addEffect = function (effectFunction) {
+  this.effectsSequence.push(effectFunction);
+  this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function (_finalValue) {
+  if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+    return;
+  }
+  this.currentData.t = this.data.d.k[this.keysIndex].s.t;
+  var currentValue = this.currentData;
+  var currentIndex = this.keysIndex;
+  if (this.lock) {
+    this.setCurrentData(this.currentData);
+    return;
+  }
+  this.lock = true;
+  this._mdf = false;
+  var i; var
+    len = this.effectsSequence.length;
+  var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
+  for (i = 0; i < len; i += 1) {
+    // Checking if index changed to prevent creating a new object every time the expression updates.
+    if (currentIndex !== this.keysIndex) {
+      finalValue = this.effectsSequence[i](finalValue, finalValue.t);
+    } else {
+      finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
+    }
+  }
+  if (currentValue !== finalValue) {
+    this.setCurrentData(finalValue);
+  }
+  this.v = this.currentData;
+  this.pv = this.v;
+  this.lock = false;
+  this.frameId = this.elem.globalData.frameId;
+};
+
+TextProperty.prototype.getKeyframeValue = function () {
+  var textKeys = this.data.d.k;
+  var frameNum = this.elem.comp.renderedFrame;
+  var i = 0; var
+    len = textKeys.length;
+  while (i <= len - 1) {
+    if (i === len - 1 || textKeys[i + 1].t > frameNum) {
+      break;
+    }
+    i += 1;
+  }
+  if (this.keysIndex !== i) {
+    this.keysIndex = i;
+  }
+  return this.data.d.k[this.keysIndex].s;
+};
+
+TextProperty.prototype.buildFinalText = function (text) {
+  var combinedCharacters = FontManager.getCombinedCharacterCodes();
+  var charactersArray = [];
+  var i = 0; var
+    len = text.length;
+  var charCode;
+  while (i < len) {
+    charCode = text.charCodeAt(i);
+    if (combinedCharacters.indexOf(charCode) !== -1) {
+      charactersArray[charactersArray.length - 1] += text.charAt(i);
+    } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      charCode = text.charCodeAt(i + 1);
+      if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
+        charactersArray.push(text.substr(i, 2));
         i += 1;
+      } else {
+        charactersArray.push(text.charAt(i));
+      }
+    } else {
+      charactersArray.push(text.charAt(i));
     }
-    if(this.keysIndex !== i) {
-        this.keysIndex = i;
-    }
-    return this.data.d.k[this.keysIndex].s;
+    i += 1;
+  }
+  return charactersArray;
 };
 
-TextProperty.prototype.buildFinalText = function(text) {
-    var combinedCharacters = FontManager.getCombinedCharacterCodes();
-    var charactersArray = [];
-    var i = 0, len = text.length;
-    var charCode;
-    while (i < len) {
-        charCode = text.charCodeAt(i);
-        if (combinedCharacters.indexOf(charCode) !== -1) {
-            charactersArray[charactersArray.length - 1] += text.charAt(i);
-        } else {
-            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
-                charCode = text.charCodeAt(i + 1);
-                if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
-                    charactersArray.push(text.substr(i, 2));
-                    ++i;
-                } else {
-                    charactersArray.push(text.charAt(i));
-                }
-            } else {
-                charactersArray.push(text.charAt(i));
-            }
-        }
-        i += 1;
-    }
-    return charactersArray;
-}
-
-TextProperty.prototype.completeTextData = function(documentData) {
-    documentData.__complete = true;
-    var fontManager = this.elem.globalData.fontManager;
-    var data = this.data;
-    var letters = [];
-    var i, len;
-    var newLineFlag, index = 0, val;
-    var anchorGrouping = data.m.g;
-    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-    var lineWidth = 0;
-    var maxLineWidth = 0;
-    var j, jLen;
-    var fontData = fontManager.getFontByName(documentData.f);
-    var charData, cLength = 0;
-    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
-
-    var fWeight = 'normal', fStyle = 'normal';
-    len = styles.length;
-    var styleName;
-    for(i=0;i<len;i+=1){
-        styleName = styles[i].toLowerCase();
-        switch(styleName) {
-            case 'italic':
-            fStyle = 'italic';
-            break;
-            case 'bold':
-            fWeight = '700';
-            break;
-            case 'black':
-            fWeight = '900';
-            break;
-            case 'medium':
-            fWeight = '500';
-            break;
-            case 'regular':
-            case 'normal':
-            fWeight = '400';
-            break;
-            case 'light':
-            case 'thin':
-            fWeight = '200';
-            break;
-        }
-    }
-    documentData.fWeight = fontData.fWeight || fWeight;
-    documentData.fStyle = fStyle;
-    documentData.finalSize = documentData.s;
-    documentData.finalText = this.buildFinalText(documentData.t);
-    len = documentData.finalText.length;
-    documentData.finalLineHeight = documentData.lh;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var charCode;
-    if(documentData.sz){
-        var flag = true;
-        var boxWidth = documentData.sz[0];
-        var boxHeight = documentData.sz[1];
-        var currentHeight, finalText;
-        while(flag) {
-            finalText = this.buildFinalText(documentData.t);
-            currentHeight = 0;
-            lineWidth = 0;
-            len = finalText.length;
-            trackingOffset = documentData.tr/1000*documentData.finalSize;
-            var lastSpaceIndex = -1;
-            for(i=0;i<len;i+=1){
-                charCode = finalText[i].charCodeAt(0);
-                newLineFlag = false;
-                if(finalText[i] === ' '){
-                    lastSpaceIndex = i;
-                }else if(charCode === 13 || charCode === 3){
-                    lineWidth = 0;
-                    newLineFlag = true;
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-                }else{
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
-                }
-                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
-                    if(lastSpaceIndex === -1){
-                        len += 1;
-                    } else {
-                        i = lastSpaceIndex;
-                    }
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
-                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
-                    lastSpaceIndex = -1;
-                    lineWidth = 0;
-                }else {
-                    lineWidth += cLength;
-                    lineWidth += trackingOffset;
-                }
-            }
-            currentHeight += fontData.ascent*documentData.finalSize/100;
-            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
-                documentData.finalSize -= 1;
-                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
-            } else {
-                documentData.finalText = finalText;
-                len = documentData.finalText.length;
-                flag = false;
-            }
-        }
-
-    }
-    lineWidth = - trackingOffset;
+TextProperty.prototype.completeTextData = function (documentData) {
+  documentData.__complete = true;
+  var fontManager = this.elem.globalData.fontManager;
+  var data = this.data;
+  var letters = [];
+  var i; var
+    len;
+  var newLineFlag; var index = 0; var
+    val;
+  var anchorGrouping = data.m.g;
+  var currentSize = 0; var currentPos = 0; var currentLine = 0; var
+    lineWidths = [];
+  var lineWidth = 0;
+  var maxLineWidth = 0;
+  var j; var
+    jLen;
+  var fontData = fontManager.getFontByName(documentData.f);
+  var charData; var
     cLength = 0;
-    var uncollapsedSpaces = 0;
-    var currentChar;
-    for (i = 0;i < len ;i += 1) {
+
+  var fontProps = getFontProperties(fontData);
+  documentData.fWeight = fontProps.weight;
+  documentData.fStyle = fontProps.style;
+  documentData.finalSize = documentData.s;
+  documentData.finalText = this.buildFinalText(documentData.t);
+  len = documentData.finalText.length;
+  documentData.finalLineHeight = documentData.lh;
+  var trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+  var charCode;
+  if (documentData.sz) {
+    var flag = true;
+    var boxWidth = documentData.sz[0];
+    var boxHeight = documentData.sz[1];
+    var currentHeight; var
+      finalText;
+    while (flag) {
+      finalText = this.buildFinalText(documentData.t);
+      currentHeight = 0;
+      lineWidth = 0;
+      len = finalText.length;
+      trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+      var lastSpaceIndex = -1;
+      for (i = 0; i < len; i += 1) {
+        charCode = finalText[i].charCodeAt(0);
         newLineFlag = false;
-        currentChar = documentData.finalText[i];
-        charCode = currentChar.charCodeAt(0);
-        if (charCode === 13 || charCode === 3) {
-            uncollapsedSpaces = 0;
-            lineWidths.push(lineWidth);
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidth = - 2 * trackingOffset;
-            val = '';
-            newLineFlag = true;
-            currentLine += 1;
-        }else{
-            val = currentChar;
+        if (finalText[i] === ' ') {
+          lastSpaceIndex = i;
+        } else if (charCode === 13 || charCode === 3) {
+          lineWidth = 0;
+          newLineFlag = true;
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
         }
-        if(fontManager.chars){
-            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-        }else{
-            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
-            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
-        }
-
-        //
-        if(currentChar === ' '){
-            uncollapsedSpaces += cLength + trackingOffset;
+        if (fontManager.chars) {
+          charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+          cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
         } else {
-            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
-            uncollapsedSpaces = 0;
+          // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+          cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
         }
-        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
-        if(anchorGrouping == 2){
-            currentSize += cLength;
-            if(val === '' || val === ' ' || i === len - 1){
-                if(val === '' || val === ' '){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                index += 1;
-                currentSize = 0;
-            }
-        }else if(anchorGrouping == 3){
-            currentSize += cLength;
-            if(val === '' || i === len - 1){
-                if(val === ''){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                currentSize = 0;
-                index += 1;
-            }
-        }else{
-            letters[index].ind = index;
-            letters[index].extra = 0;
-            index += 1;
+        if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
+          if (lastSpaceIndex === -1) {
+            len += 1;
+          } else {
+            i = lastSpaceIndex;
+          }
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
+          finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r');
+          // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+          lastSpaceIndex = -1;
+          lineWidth = 0;
+        } else {
+          lineWidth += cLength;
+          lineWidth += trackingOffset;
         }
+      }
+      currentHeight += (fontData.ascent * documentData.finalSize) / 100;
+      if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+        documentData.finalSize -= 1;
+        documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s;
+      } else {
+        documentData.finalText = finalText;
+        len = documentData.finalText.length;
+        flag = false;
+      }
     }
-    documentData.l = letters;
-    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-    lineWidths.push(lineWidth);
-    if(documentData.sz){
-        documentData.boxWidth = documentData.sz[0];
+  }
+  lineWidth = -trackingOffset;
+  cLength = 0;
+  var uncollapsedSpaces = 0;
+  var currentChar;
+  for (i = 0; i < len; i += 1) {
+    newLineFlag = false;
+    currentChar = documentData.finalText[i];
+    charCode = currentChar.charCodeAt(0);
+    if (charCode === 13 || charCode === 3) {
+      uncollapsedSpaces = 0;
+      lineWidths.push(lineWidth);
+      maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+      lineWidth = -2 * trackingOffset;
+      val = '';
+      newLineFlag = true;
+      currentLine += 1;
+    } else {
+      val = currentChar;
+    }
+    if (fontManager.chars) {
+      charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+      cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
+    } else {
+      // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+      // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+      cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+    }
+
+    //
+    if (currentChar === ' ') {
+      uncollapsedSpaces += cLength + trackingOffset;
+    } else {
+      lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+      uncollapsedSpaces = 0;
+    }
+    letters.push({
+      l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0,
+    });
+    if (anchorGrouping == 2) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || val === ' ' || i === len - 1) {
+        if (val === '' || val === ' ') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        index += 1;
+        currentSize = 0;
+      }
+    } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || i === len - 1) {
+        if (val === '') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        currentSize = 0;
+        index += 1;
+      }
+    } else {
+      letters[index].ind = index;
+      letters[index].extra = 0;
+      index += 1;
+    }
+  }
+  documentData.l = letters;
+  maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+  lineWidths.push(lineWidth);
+  if (documentData.sz) {
+    documentData.boxWidth = documentData.sz[0];
+    documentData.justifyOffset = 0;
+  } else {
+    documentData.boxWidth = maxLineWidth;
+    switch (documentData.j) {
+      case 1:
+        documentData.justifyOffset = -documentData.boxWidth;
+        break;
+      case 2:
+        documentData.justifyOffset = -documentData.boxWidth / 2;
+        break;
+      default:
         documentData.justifyOffset = 0;
-    }else{
-        documentData.boxWidth = maxLineWidth;
-        switch(documentData.j){
-            case 1:
-                documentData.justifyOffset = - documentData.boxWidth;
-                break;
-            case 2:
-                documentData.justifyOffset = - documentData.boxWidth/2;
-                break;
-            default:
-                documentData.justifyOffset = 0;
-        }
     }
-    documentData.lineWidths = lineWidths;
+  }
+  documentData.lineWidths = lineWidths;
 
-    var animators = data.a, animatorData, letterData;
-    jLen = animators.length;
-    var based, ind, indexes = [];
-    for(j=0;j<jLen;j+=1){
-        animatorData = animators[j];
-        if(animatorData.a.sc){
-            documentData.strokeColorAnim = true;
-        }
-        if(animatorData.a.sw){
-            documentData.strokeWidthAnim = true;
-        }
-        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
-            documentData.fillColorAnim = true;
-        }
-        ind = 0;
-        based = animatorData.s.b;
-        for(i=0;i<len;i+=1){
-            letterData = letters[i];
-            letterData.anIndexes[j] = ind;
-            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))){
-                if(animatorData.s.rn === 1){
-                    indexes.push(ind);
-                }
-                ind += 1;
-            }
-        }
-        data.a[j].s.totalChars = ind;
-        var currentInd = -1, newInd;
-        if(animatorData.s.rn === 1){
-            for(i = 0; i < len; i += 1){
-                letterData = letters[i];
-                if(currentInd != letterData.anIndexes[j]){
-                    currentInd = letterData.anIndexes[j];
-                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                }
-                letterData.anIndexes[j] = newInd;
-            }
-        }
+  var animators = data.a; var animatorData; var
+    letterData;
+  jLen = animators.length;
+  var based; var ind; var
+    indexes = [];
+  for (j = 0; j < jLen; j += 1) {
+    animatorData = animators[j];
+    if (animatorData.a.sc) {
+      documentData.strokeColorAnim = true;
     }
-    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
-    documentData.ls = documentData.ls || 0;
-    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+    if (animatorData.a.sw) {
+      documentData.strokeWidthAnim = true;
+    }
+    if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
+      documentData.fillColorAnim = true;
+    }
+    ind = 0;
+    based = animatorData.s.b;
+    for (i = 0; i < len; i += 1) {
+      letterData = letters[i];
+      letterData.anIndexes[j] = ind;
+      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))) { // eslint-disable-line eqeqeq
+        if (animatorData.s.rn === 1) {
+          indexes.push(ind);
+        }
+        ind += 1;
+      }
+    }
+    data.a[j].s.totalChars = ind;
+    var currentInd = -1; var
+      newInd;
+    if (animatorData.s.rn === 1) {
+      for (i = 0; i < len; i += 1) {
+        letterData = letters[i];
+        if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq
+          currentInd = letterData.anIndexes[j];
+          newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
+        }
+        letterData.anIndexes[j] = newInd;
+      }
+    }
+  }
+  documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
+  documentData.ls = documentData.ls || 0;
+  documentData.ascent = (fontData.ascent * documentData.finalSize) / 100;
 };
 
-TextProperty.prototype.updateDocumentData = function(newData, index) {
-	index = index === undefined ? this.keysIndex : index;
-    var dData = this.copyData({}, this.data.d.k[index].s);
-    dData = this.copyData(dData, newData);
-    this.data.d.k[index].s = dData;
-    this.recalculate(index);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.updateDocumentData = function (newData, index) {
+  index = index === undefined ? this.keysIndex : index;
+  var dData = this.copyData({}, this.data.d.k[index].s);
+  dData = this.copyData(dData, newData);
+  this.data.d.k[index].s = dData;
+  this.recalculate(index);
+  this.elem.addDynamicProperty(this);
 };
 
-TextProperty.prototype.recalculate = function(index) {
-    var dData = this.data.d.k[index].s;
-    dData.__complete = false;
-    this.keysIndex = 0;
-    this._isFirstFrame = true;
-    this.getValue(dData);
-}
-
-TextProperty.prototype.canResizeFont = function(_canResize) {
-    this.canResize = _canResize;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.recalculate = function (index) {
+  var dData = this.data.d.k[index].s;
+  dData.__complete = false;
+  this.keysIndex = 0;
+  this._isFirstFrame = true;
+  this.getValue(dData);
 };
 
-TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
-    this.minimumFontSize = Math.floor(_fontValue) || 1;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.canResizeFont = function (_canResize) {
+  this.canResize = _canResize;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
 };
 
-var TextSelectorProp = (function(){
-    var max = Math.max;
-    var min = Math.min;
-    var floor = Math.floor;
+TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
+  this.minimumFontSize = Math.floor(_fontValue) || 1;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
+};
 
-    function TextSelectorProp(elem,data){
-        this._currentTextLength = -1;
-        this.k = false;
-        this.data = data;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.finalS = 0;
-        this.finalE = 0;
-        this.initDynamicPropertyContainer(elem);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
-        if('e' in data){
-            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
-        }else{
-            this.e = {v:100};
+/* global extendPrototype, BezierFactory, PropertyFactory, DynamicPropertyContainer */
+/* exported TextSelectorProp */
+
+var TextSelectorProp = (function () {
+  var max = Math.max;
+  var min = Math.min;
+  var floor = Math.floor;
+
+  function TextSelectorPropFactory(elem, data) {
+    this._currentTextLength = -1;
+    this.k = false;
+    this.data = data;
+    this.elem = elem;
+    this.comp = elem.comp;
+    this.finalS = 0;
+    this.finalE = 0;
+    this.initDynamicPropertyContainer(elem);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this);
+    if ('e' in data) {
+      this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
+    } else {
+      this.e = { v: 100 };
+    }
+    this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this);
+    this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this);
+    this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this);
+    this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
+    if (!this.dynamicProperties.length) {
+      this.getValue();
+    }
+  }
+
+  TextSelectorPropFactory.prototype = {
+    getMult: function (ind) {
+      if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+        this.getValue();
+      }
+      // var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+      var x1 = 0;
+      var y1 = 0;
+      var x2 = 1;
+      var y2 = 1;
+      if (this.ne.v > 0) {
+        x1 = this.ne.v / 100.0;
+      } else {
+        y1 = -this.ne.v / 100.0;
+      }
+      if (this.xe.v > 0) {
+        x2 = 1.0 - this.xe.v / 100.0;
+      } else {
+        y2 = 1.0 + this.xe.v / 100.0;
+      }
+      var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
+
+      var mult = 0;
+      var s = this.finalS;
+      var e = this.finalE;
+      var type = this.data.sh;
+      if (type === 2) {
+        if (e === s) {
+          mult = ind >= e ? 1 : 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
-        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
-        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
-        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
-        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
-        if(!this.dynamicProperties.length){
-            this.getValue();
+        mult = easer(mult);
+      } else if (type === 3) {
+        if (e === s) {
+          mult = ind >= e ? 0 : 1;
+        } else {
+          mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
+
+        mult = easer(mult);
+      } else if (type === 4) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
+          if (mult < 0.5) {
+            mult *= 2;
+          } else {
+            mult = 1 - 2 * (mult - 0.5);
+          }
+        }
+        mult = easer(mult);
+      } else if (type === 5) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          var tot = e - s;
+          /* ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          var x = -tot / 2 + ind;
+          var a = tot / 2;
+          mult = Math.sqrt(1 - (x * x) / (a * a));
+        }
+        mult = easer(mult);
+      } else if (type === 6) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line
+        }
+        mult = easer(mult);
+      } else {
+        if (ind >= floor(s)) {
+          if (ind - s < 0) {
+            mult = max(0, min(min(e, 1) - (s - ind), 1));
+          } else {
+            mult = max(0, min(e - ind, 1));
+          }
+        }
+        mult = easer(mult);
+      }
+      return mult * this.a.v;
+    },
+    getValue: function (newCharsFlag) {
+      this.iterateDynamicProperties();
+      this._mdf = newCharsFlag || this._mdf;
+      this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+      if (newCharsFlag && this.data.r === 2) {
+        this.e.v = this._currentTextLength;
+      }
+      var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
+      var o = this.o.v / divisor;
+      var s = this.s.v / divisor + o;
+      var e = (this.e.v / divisor) + o;
+      if (s > e) {
+        var _s = s;
+        s = e;
+        e = _s;
+      }
+      this.finalS = s;
+      this.finalE = e;
+    },
+  };
+  extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
+
+  function getTextSelectorProp(elem, data, arr) {
+    return new TextSelectorPropFactory(elem, data, arr);
+  }
+
+  return {
+    getTextSelectorProp: getTextSelectorProp,
+  };
+}());
+
+/* global createSizedArray, pooling */
+/* exported poolFactory */
+
+var poolFactory = (function () {
+  return function (initialLength, _create, _release) {
+    var _length = 0;
+    var _maxLength = initialLength;
+    var pool = createSizedArray(_maxLength);
+
+    var ob = {
+      newElement: newElement,
+      release: release,
+    };
+
+    function newElement() {
+      var element;
+      if (_length) {
+        _length -= 1;
+        element = pool[_length];
+      } else {
+        element = _create();
+      }
+      return element;
     }
 
-    TextSelectorProp.prototype = {
-        getMult: function(ind) {
-            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
-                this.getValue();
-            }
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var x1 = 0;
-            var y1 = 0;
-            var x2 = 1;
-            var y2 = 1;
-            if(this.ne.v > 0) {
-                x1 = this.ne.v / 100.0;
-            }
-            else {
-                y1 = -this.ne.v / 100.0;
-            }
-            if(this.xe.v > 0) {
-                x2 = 1.0 - this.xe.v / 100.0;
-            }
-            else {
-                y2 = 1.0 + this.xe.v / 100.0;
-            }
-            var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
-
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if (type === 2){
-                if (e === s) {
-                    mult = ind >= e ? 1 : 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                }
-                mult = easer(mult);
-            } else if(type === 3) {
-                if (e === s) {
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
-                }
-
-                mult = easer(mult);
-            } else if (type === 4) {
-                if (e === s) {
-                    mult = 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                    if (mult < 0.5) {
-                        mult *= 2;
-                    } else {
-                        mult = 1 - 2 * (mult - 0.5);
-                    }
-                }
-                mult = easer(mult);
-            } else if (type === 5) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x * x) / (a * a));
-                }
-                mult = easer(mult);
-            } else if (type === 6) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
-                }
-                mult = easer(mult);
-            } else {
-                if (ind >= floor(s)) {
-                    if (ind - s < 0) {
-                        mult = max(0, min(min(e, 1) - (s - ind), 1));
-                    } else {
-                        mult = max(0, min(e - ind, 1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        },
-        getValue: function(newCharsFlag) {
-            this.iterateDynamicProperties();
-            this._mdf = newCharsFlag || this._mdf;
-            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
-            if(newCharsFlag && this.data.r === 2) {
-                this.e.v = this._currentTextLength;
-            }
-            var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-    }
-    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
+    function release(element) {
+      if (_length === _maxLength) {
+        pool = pooling.double(pool);
+        _maxLength *= 2;
+      }
+      if (_release) {
+        _release(element);
+      }
+      pool[_length] = element;
+      _length += 1;
     }
 
+    return ob;
+  };
+}());
+
+/* global createSizedArray */
+/* exported pooling */
+
+var pooling = (function () {
+  function double(arr) {
+    return arr.concat(createSizedArray(arr.length));
+  }
+
+  return {
+    double: double,
+  };
+}());
+
+/* global createTypedArray, poolFactory */
+/* exported pointPool */
+
+var pointPool = (function () {
+  function create() {
+    return createTypedArray('float32', 2);
+  }
+  return poolFactory(8, create);
+}());
+
+/* global ShapePath, pointPool, poolFactory */
+/* exported shapePool */
+
+var shapePool = (function () {
+  function create() {
+    return new ShapePath();
+  }
+
+  function release(shapePath) {
+    var len = shapePath._length;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      pointPool.release(shapePath.v[i]);
+      pointPool.release(shapePath.i[i]);
+      pointPool.release(shapePath.o[i]);
+      shapePath.v[i] = null;
+      shapePath.i[i] = null;
+      shapePath.o[i] = null;
+    }
+    shapePath._length = 0;
+    shapePath.c = false;
+  }
+
+  function clone(shape) {
+    var cloned = factory.newElement();
+    var i;
+    var len = shape._length === undefined ? shape.v.length : shape._length;
+    cloned.setLength(len);
+    cloned.c = shape.c;
+
+    for (i = 0; i < len; i += 1) {
+      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);
+    }
+    return cloned;
+  }
+
+  var factory = poolFactory(4, create, release);
+  factory.clone = clone;
+
+  return factory;
+}());
+
+/* global createSizedArray, ShapeCollection, shapePool, pooling */
+/* exported shapeCollectionPool */
+
+var shapeCollectionPool = (function () {
+  var ob = {
+    newShapeCollection: newShapeCollection,
+    release: release,
+  };
+
+  var _length = 0;
+  var _maxLength = 4;
+  var pool = createSizedArray(_maxLength);
+
+  function newShapeCollection() {
+    var shapeCollection;
+    if (_length) {
+      _length -= 1;
+      shapeCollection = pool[_length];
+    } else {
+      shapeCollection = new ShapeCollection();
+    }
+    return shapeCollection;
+  }
+
+  function release(shapeCollection) {
+    var i;
+    var len = shapeCollection._length;
+    for (i = 0; i < len; i += 1) {
+      shapePool.release(shapeCollection.shapes[i]);
+    }
+    shapeCollection._length = 0;
+
+    if (_length === _maxLength) {
+      pool = pooling.double(pool);
+      _maxLength *= 2;
+    }
+    pool[_length] = shapeCollection;
+    _length += 1;
+  }
+
+  return ob;
+}());
+
+/* global poolFactory, bezierLengthPool */
+/* exported segmentsLengthPool */
+
+var segmentsLengthPool = (function () {
+  function create() {
     return {
-        getTextSelectorProp: getTextSelectorProp
+      lengths: [],
+      totalLength: 0,
     };
-}());
+  }
 
-    
-var pool_factory = (function() {
-	return function(initialLength, _create, _release, _clone) {
-
-		var _length = 0;
-		var _maxLength = initialLength;
-		var pool = createSizedArray(_maxLength);
-
-		var ob = {
-			newElement: newElement,
-			release: release
-		};
-
-		function newElement(){
-			var element;
-			if(_length){
-				_length -= 1;
-				element = pool[_length];
-			} else {
-				element = _create();
-			}
-			return element;
-		}
-
-		function release(element) {
-			if(_length === _maxLength) {
-				pool = pooling.double(pool);
-				_maxLength = _maxLength*2;
-			}
-			if (_release) {
-				_release(element);
-			}
-			pool[_length] = element;
-			_length += 1;
-		}
-
-		function clone() {
-			var clonedElement = newElement();
-			return _clone(clonedElement);
-		}
-
-		return ob;
-	};
-}());
-
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(createSizedArray(arr.length));
-	}
-
-	return {
-		double: double
-	};
-}());
-var point_pool = (function(){
-
-	function create() {
-		return createTypedArray('float32', 2);
-	}
-	return pool_factory(8, create);
-}());
-var shape_pool = (function(){
-
-	function create() {
-		return new ShapePath();
-	}
-
-	function release(shapePath) {
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-	}
-
-	function clone(shape) {
-		var cloned = factory.newElement();
-		var i, len = shape._length === undefined ? shape.v.length : shape._length;
-		cloned.setLength(len);
-		cloned.c = shape.c;
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			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);
-		}
-		return cloned;
-	}
-
-	var factory = pool_factory(4, create, release);
-	factory.clone = clone;
-
-	return factory;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release
-	};
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = createSizedArray(_maxLength);
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	return ob;
-}());
-var segments_length_pool = (function(){
-
-	function create() {
-		return {
-			lengths: [],
-			totalLength: 0
-		};
-	}
-
-	function release(element) {
-		var i, len = element.lengths.length;
-		for(i=0;i<len;i+=1) {
-			bezier_length_pool.release(element.lengths[i]);
-		}
-		element.lengths.length = 0;
-	}
-
-	return pool_factory(8, create, release);
-}());
-var bezier_length_pool = (function(){
-
-	function create() {
-		return {
-            addedLength: 0,
-            percents: createTypedArray('float32', defaultCurveSegments),
-            lengths: createTypedArray('float32', defaultCurveSegments),
-        };
-	}
-	return pool_factory(8, create);
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
+  function release(element) {
+    var i;
+    var len = element.lengths.length;
+    for (i = 0; i < len; i += 1) {
+      bezierLengthPool.release(element.lengths[i]);
     }
-    this.checkPendingElements();
-};
+    element.lengths.length = 0;
+  }
 
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 3:
-            return this.createNull(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 6:
-            return this.createAudio(layer);
-        case 13:
-            return this.createCamera(layer);
-    }
-    return this.createNull(layer);
-};
+  return poolFactory(8, create, release);
+}());
 
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-};
+/* global createTypedArray, defaultCurveSegments, poolFactory */
+/* exported bezierLengthPool */
 
-BaseRenderer.prototype.createAudio = function(data){
-    return new AudioElement(data, this.globalData, this);
-};
+var bezierLengthPool = (function () {
+  function create() {
+    return {
+      addedLength: 0,
+      percents: createTypedArray('float32', defaultCurveSegments),
+      lengths: createTypedArray('float32', defaultCurveSegments),
+    };
+  }
+  return poolFactory(8, create);
+}());
 
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
+/* global AudioElement, FontManager */
+
+function BaseRenderer() {}
+BaseRenderer.prototype.checkLayers = function (num) {
+  var i;
+  var len = this.layers.length;
+  var data;
+  this.completeLayers = true;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (!this.elements[i]) {
+      data = this.layers[i];
+      if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) {
         this.buildItem(i);
+      }
     }
-    this.checkPendingElements();
+    this.completeLayers = this.elements[i] ? this.completeLayers : false;
+  }
+  this.checkPendingElements();
 };
 
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
+BaseRenderer.prototype.createItem = function (layer) {
+  switch (layer.ty) {
+    case 2:
+      return this.createImage(layer);
+    case 0:
+      return this.createComp(layer);
+    case 1:
+      return this.createSolid(layer);
+    case 3:
+      return this.createNull(layer);
+    case 4:
+      return this.createShape(layer);
+    case 5:
+      return this.createText(layer);
+    case 6:
+      return this.createAudio(layer);
+    case 13:
+      return this.createCamera(layer);
+    default:
+      return this.createNull(layer);
+  }
+};
+
+BaseRenderer.prototype.createCamera = function () {
+  throw new Error('You\'re using a 3d camera. Try the html renderer.');
+};
+
+BaseRenderer.prototype.createAudio = function (data) {
+  return new AudioElement(data, this.globalData, this);
+};
+
+BaseRenderer.prototype.buildAllItems = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    this.buildItem(i);
+  }
+  this.checkPendingElements();
+};
+
+BaseRenderer.prototype.includeLayers = function (newLayers) {
+  this.completeLayers = false;
+  var i;
+  var len = newLayers.length;
+  var j;
+  var jLen = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    j = 0;
+    while (j < jLen) {
+      if (this.layers[j].id === newLayers[i].id) {
+        this.layers[j] = newLayers[i];
+        break;
+      }
+      j += 1;
+    }
+  }
+};
+
+BaseRenderer.prototype.setProjectInterface = function (pInterface) {
+  this.globalData.projectInterface = pInterface;
+};
+
+BaseRenderer.prototype.initItems = function () {
+  if (!this.globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+};
+BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
+  var elements = this.elements;
+  var layers = this.layers;
+  var i = 0;
+  var len = layers.length;
+  while (i < len) {
+    if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq
+      if (!elements[i] || elements[i] === true) {
+        this.buildItem(i);
+        this.addPendingElement(element);
+      } else {
+        hierarchy.push(elements[i]);
+        elements[i].setAsParent();
+        if (layers[i].parent !== undefined) {
+          this.buildElementParenting(element, layers[i].parent, hierarchy);
+        } else {
+          element.setHierarchy(hierarchy);
         }
+      }
     }
+    i += 1;
+  }
 };
 
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
+BaseRenderer.prototype.addPendingElement = function (element) {
+  this.pendingElements.push(element);
 };
 
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
+BaseRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i]);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
     }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while (i < len) {
-        if (layers[i].ind == parentName) {
-            if (!elements[i] || elements[i] === true) {
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i].setAsParent();
-                if(layers[i].parent !== undefined) {
-                    this.buildElementParenting(element, layers[i].parent, hierarchy);
-                } else {
-                    element.setHierarchy(hierarchy);
-                }
-            }
-        }
-        i += 1;
-    }
+  }
 };
 
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
+BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
+  this.globalData.fontManager = new FontManager();
+  this.globalData.fontManager.addChars(animData.chars);
+  this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
+  this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+  this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
+  this.globalData.imageLoader = this.animationItem.imagePreloader;
+  this.globalData.audioController = this.animationItem.audioController;
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
 };
 
-BaseRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i]);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
+/* global createElementID, extendPrototype, BaseRenderer, NullElement, SVGShapeElement, SVGTextLottieElement,
+IImageElement, SVGCompElement, ISolidElement, createNS, locationHref, createSizedArray, expressionsPlugin */
 
-BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.imageLoader = this.animationItem.imagePreloader;
-    this.globalData.audioController = this.animationItem.audioController;
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-}
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.svgElement = createNS('svg');
-    var ariaLabel = '';
-    if (config && config.title) {
-        var titleElement = createNS('title');
-        var titleId = createElementID();
-        titleElement.setAttribute('id', titleId);
-        titleElement.textContent = config.title;
-        this.svgElement.appendChild(titleElement);
-        ariaLabel += titleId;
-    }
-    if (config && config.description) {
-        var descElement = createNS('desc');
-        var descId = createElementID();
-        descElement.setAttribute('id', descId);
-        descElement.textContent = config.description;
-        this.svgElement.appendChild(descElement);
-        ariaLabel += ' ' + descId;
-    }
-    if (ariaLabel) {
-        this.svgElement.setAttribute('aria-labelledby', ariaLabel)
-    }
-    var defs = createNS( 'defs');
-    this.svgElement.appendChild(defs);
-    var maskElement = createNS('g');
-    this.svgElement.appendChild(maskElement);
-    this.layerElement = maskElement;
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        viewBoxOnly: (config && config.viewBoxOnly) || false,
-        viewBoxSize: (config && config.viewBoxSize) || false,
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-        focusable: config && config.focusable,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '100%',
-            height: config && config.filterSize && config.filterSize.height || '100%',
-            x: config && config.filterSize && config.filterSize.x || '0%',
-            y: config && config.filterSize && config.filterSize.y || '0%',
-        }
-    };
+function SVGRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.svgElement = createNS('svg');
+  var ariaLabel = '';
+  if (config && config.title) {
+    var titleElement = createNS('title');
+    var titleId = createElementID();
+    titleElement.setAttribute('id', titleId);
+    titleElement.textContent = config.title;
+    this.svgElement.appendChild(titleElement);
+    ariaLabel += titleId;
+  }
+  if (config && config.description) {
+    var descElement = createNS('desc');
+    var descId = createElementID();
+    descElement.setAttribute('id', descId);
+    descElement.textContent = config.description;
+    this.svgElement.appendChild(descElement);
+    ariaLabel += ' ' + descId;
+  }
+  if (ariaLabel) {
+    this.svgElement.setAttribute('aria-labelledby', ariaLabel);
+  }
+  var defs = createNS('defs');
+  this.svgElement.appendChild(defs);
+  var maskElement = createNS('g');
+  this.svgElement.appendChild(maskElement);
+  this.layerElement = maskElement;
+  this.renderConfig = {
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    hideOnTransparent: !((config && config.hideOnTransparent === false)),
+    viewBoxOnly: (config && config.viewBoxOnly) || false,
+    viewBoxSize: (config && config.viewBoxSize) || false,
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+    focusable: config && config.focusable,
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '100%',
+      height: (config && config.filterSize && config.filterSize.height) || '100%',
+      x: (config && config.filterSize && config.filterSize.x) || '0%',
+      y: (config && config.filterSize && config.filterSize.y) || '0%',
+    },
+  };
 
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        defs: defs,
-        renderConfig: this.renderConfig
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-    this.rendererType = 'svg';
-
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    defs: defs,
+    renderConfig: this.renderConfig,
+  };
+  this.elements = [];
+  this.pendingElements = [];
+  this.destroyed = false;
+  this.rendererType = 'svg';
 }
 
-extendPrototype([BaseRenderer],SVGRenderer);
+extendPrototype([BaseRenderer], SVGRenderer);
 
 SVGRenderer.prototype.createNull = function (data) {
-    return new NullElement(data,this.globalData,this);
+  return new NullElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new SVGShapeElement(data,this.globalData,this);
+  return new SVGShapeElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data,this.globalData,this);
-
+  return new SVGTextLottieElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data,this.globalData,this);
+  return new IImageElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new SVGCompElement(data,this.globalData,this);
-
+  return new SVGCompElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data,this.globalData,this);
+  return new ISolidElement(data, this.globalData, this);
 };
 
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    if(this.renderConfig.viewBoxSize) {
-        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
-    } else {
-        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    }
+SVGRenderer.prototype.configAnimation = function (animData) {
+  this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+  if (this.renderConfig.viewBoxSize) {
+    this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
+  } else {
+    this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
+  }
 
-    if(!this.renderConfig.viewBoxOnly) {
-        this.svgElement.setAttribute('width',animData.w);
-        this.svgElement.setAttribute('height',animData.h);
-        this.svgElement.style.width = '100%';
-        this.svgElement.style.height = '100%';
-        this.svgElement.style.transform = 'translate3d(0,0,0)';
-    }
-    if (this.renderConfig.className) {
-        this.svgElement.setAttribute('class', this.renderConfig.className);
-    }
-    if (this.renderConfig.id) {
-        this.svgElement.setAttribute('id', this.renderConfig.id);
-    }
-    if (this.renderConfig.focusable !== undefined) {
-        this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
-    }
-    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.svgElement);
-    //Mask animation
-    var defs = this.globalData.defs;
+  if (!this.renderConfig.viewBoxOnly) {
+    this.svgElement.setAttribute('width', animData.w);
+    this.svgElement.setAttribute('height', animData.h);
+    this.svgElement.style.width = '100%';
+    this.svgElement.style.height = '100%';
+    this.svgElement.style.transform = 'translate3d(0,0,0)';
+  }
+  if (this.renderConfig.className) {
+    this.svgElement.setAttribute('class', this.renderConfig.className);
+  }
+  if (this.renderConfig.id) {
+    this.svgElement.setAttribute('id', this.renderConfig.id);
+  }
+  if (this.renderConfig.focusable !== undefined) {
+    this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
+  }
+  this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio);
+  // this.layerElement.style.transform = 'translate3d(0,0,0)';
+  // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
+  this.animationItem.wrapper.appendChild(this.svgElement);
+  // Mask animation
+  var defs = this.globalData.defs;
 
-    this.setupGlobalData(animData, defs);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.data = animData;
+  this.setupGlobalData(animData, defs);
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.data = animData;
 
-    var maskElement = createNS( 'clipPath');
-    var rect = createNS('rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = createElementID();
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+  var maskElement = createNS('clipPath');
+  var rect = createNS('rect');
+  rect.setAttribute('width', animData.w);
+  rect.setAttribute('height', animData.h);
+  rect.setAttribute('x', 0);
+  rect.setAttribute('y', 0);
+  var maskId = createElementID();
+  maskElement.setAttribute('id', maskId);
+  maskElement.appendChild(rect);
+  this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + maskId + ')');
 
-    defs.appendChild(maskElement);
-    this.layers = animData.layers;
-    this.elements = createSizedArray(animData.layers.length);
+  defs.appendChild(maskElement);
+  this.layers = animData.layers;
+  this.elements = createSizedArray(animData.layers.length);
 };
 
-
 SVGRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.layerElement = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 SVGRenderer.prototype.updateContainerSize = function () {
 };
 
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
+SVGRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  elements[pos] = true;
+  var element = this.createItem(this.layers[pos]);
 
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
+  elements[pos] = element;
+  if (expressionsPlugin) {
+    if (this.layers[pos].ty === 0) {
+      this.globalData.projectInterface.registerComposition(element);
     }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
+    element.initExpressions();
+  }
+  this.appendElementInPos(element, pos);
+  if (this.layers[pos].tt) {
+    if (!this.elements[pos - 1] || this.elements[pos - 1] === true) {
+      this.buildItem(pos - 1);
+      this.addPendingElement(element);
+    } else {
+      element.setMatte(elements[pos - 1].layerId);
     }
+  }
 };
 
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame === num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    // console.log('-------');
-    // console.log('FRAME ',num);
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    this.globalData._mdf = false;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    if(this.globalData._mdf) {
-        for (i = 0; i < len; i += 1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
+SVGRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+    if (element.data.tt) {
+      var i = 0;
+      var len = this.elements.length;
+      while (i < len) {
+        if (this.elements[i] === element) {
+          element.setMatte(this.elements[i - 1].layerId);
+          break;
         }
         i += 1;
+      }
     }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
-    } else {
-        this.layerElement.appendChild(newElement);
-    }
+  }
 };
 
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
-};
-
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
-};
-
-function CanvasRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.renderConfig = {
-        clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
-        context: (config && config.context) || null,
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-    };
-    this.renderConfig.dpr = (config && config.dpr) || 1;
-    if (this.animationItem.wrapper) {
-        this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
+SVGRenderer.prototype.renderFrame = function (num) {
+  if (this.renderedFrame === num || this.destroyed) {
+    return;
+  }
+  if (num === null) {
+    num = this.renderedFrame;
+  } else {
+    this.renderedFrame = num;
+  }
+  // console.log('-------');
+  // console.log('FRAME ',num);
+  this.globalData.frameNum = num;
+  this.globalData.frameId += 1;
+  this.globalData.projectInterface.currentFrame = num;
+  this.globalData._mdf = false;
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
-    this.renderedFrame = -1;
-    this.globalData = {
-        frameNum: -1,
-        _mdf: false,
-        renderConfig: this.renderConfig,
-        currentGlobalAlpha: -1
-    };
-    this.contextData = new CVContextData();
-    this.elements = [];
-    this.pendingElements = [];
-    this.transformMat = new Matrix();
-    this.completeLayers = false;
-    this.rendererType = 'canvas';
+  }
+  if (this.globalData._mdf) {
+    for (i = 0; i < len; i += 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+  }
+};
+
+SVGRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newElement = element.getBaseElement();
+  if (!newElement) {
+    return;
+  }
+  var i = 0;
+  var nextElement;
+  while (i < pos) {
+    if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
+      nextElement = this.elements[i].getBaseElement();
+    }
+    i += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(newElement, nextElement);
+  } else {
+    this.layerElement.appendChild(newElement);
+  }
+};
+
+SVGRenderer.prototype.hide = function () {
+  this.layerElement.style.display = 'none';
+};
+
+SVGRenderer.prototype.show = function () {
+  this.layerElement.style.display = 'block';
+};
+
+/* global CVContextData, Matrix, extendPrototype, BaseRenderer, CVShapeElement, CVTextElement,
+CVImageElement, CVCompElement, CVSolidElement, SVGRenderer, createTag, createSizedArray */
+
+function CanvasRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.renderConfig = {
+    clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
+    context: (config && config.context) || null,
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+  };
+  this.renderConfig.dpr = (config && config.dpr) || 1;
+  if (this.animationItem.wrapper) {
+    this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
+  }
+  this.renderedFrame = -1;
+  this.globalData = {
+    frameNum: -1,
+    _mdf: false,
+    renderConfig: this.renderConfig,
+    currentGlobalAlpha: -1,
+  };
+  this.contextData = new CVContextData();
+  this.elements = [];
+  this.pendingElements = [];
+  this.transformMat = new Matrix();
+  this.completeLayers = false;
+  this.rendererType = 'canvas';
 }
-extendPrototype([BaseRenderer],CanvasRenderer);
+extendPrototype([BaseRenderer], CanvasRenderer);
 
 CanvasRenderer.prototype.createShape = function (data) {
-    return new CVShapeElement(data, this.globalData, this);
+  return new CVShapeElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createText = function (data) {
-    return new CVTextElement(data, this.globalData, this);
+  return new CVTextElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createImage = function (data) {
-    return new CVImageElement(data, this.globalData, this);
+  return new CVImageElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createComp = function (data) {
-    return new CVCompElement(data, this.globalData, this);
+  return new CVCompElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createSolid = function (data) {
-    return new CVSolidElement(data, this.globalData, this);
+  return new CVSolidElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
 
-CanvasRenderer.prototype.ctxTransform = function(props){
-    if(props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0){
-        return;
-    }
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.transform(props[0],props[1],props[4],props[5],props[12],props[13]);
-        return;
-    }
-    this.transformMat.cloneFromProps(props);
-    var cProps = this.contextData.cTr.props;
-    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]);
-    //this.contextData.cTr.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]);
-    this.contextData.cTr.cloneFromProps(this.transformMat.props);
-    var trProps = this.contextData.cTr.props;
-    this.canvasContext.setTransform(trProps[0],trProps[1],trProps[4],trProps[5],trProps[12],trProps[13]);
+CanvasRenderer.prototype.ctxTransform = function (props) {
+  if (props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0) {
+    return;
+  }
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.transform(props[0], props[1], props[4], props[5], props[12], props[13]);
+    return;
+  }
+  this.transformMat.cloneFromProps(props);
+  var cProps = this.contextData.cTr.props;
+  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]);
+  // this.contextData.cTr.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]);
+  this.contextData.cTr.cloneFromProps(this.transformMat.props);
+  var trProps = this.contextData.cTr.props;
+  this.canvasContext.setTransform(trProps[0], trProps[1], trProps[4], trProps[5], trProps[12], trProps[13]);
 };
 
-CanvasRenderer.prototype.ctxOpacity = function(op){
-    /*if(op === 1){
+CanvasRenderer.prototype.ctxOpacity = function (op) {
+  /* if(op === 1){
         return;
-    }*/
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
-        this.globalData.currentGlobalAlpha = this.contextData.cO;
-        return;
-    }
-    this.contextData.cO *= op < 0 ? 0 : op;
-    if(this.globalData.currentGlobalAlpha !== this.contextData.cO) {
-        this.canvasContext.globalAlpha = this.contextData.cO;
-        this.globalData.currentGlobalAlpha = this.contextData.cO;
-    }
+    } */
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
+    this.globalData.currentGlobalAlpha = this.contextData.cO;
+    return;
+  }
+  this.contextData.cO *= op < 0 ? 0 : op;
+  if (this.globalData.currentGlobalAlpha !== this.contextData.cO) {
+    this.canvasContext.globalAlpha = this.contextData.cO;
+    this.globalData.currentGlobalAlpha = this.contextData.cO;
+  }
 };
 
-CanvasRenderer.prototype.reset = function(){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.restore();
-        return;
-    }
-    this.contextData.reset();
+CanvasRenderer.prototype.reset = function () {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.restore();
+    return;
+  }
+  this.contextData.reset();
 };
 
-CanvasRenderer.prototype.save = function(actionFlag){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.save();
-        return;
-    }
-    if(actionFlag){
-        this.canvasContext.save();
-    }
-    var props = this.contextData.cTr.props;
-    if(this.contextData._length <= this.contextData.cArrPos) {
-        this.contextData.duplicate();
-    }
-    var i, arr = this.contextData.saved[this.contextData.cArrPos];
-    for (i = 0; i < 16; i += 1) {
-        arr[i] = props[i];
-    }
-    this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
-    this.contextData.cArrPos += 1;
+CanvasRenderer.prototype.save = function (actionFlag) {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.save();
+    return;
+  }
+  if (actionFlag) {
+    this.canvasContext.save();
+  }
+  var props = this.contextData.cTr.props;
+  if (this.contextData._length <= this.contextData.cArrPos) {
+    this.contextData.duplicate();
+  }
+  var i;
+  var arr = this.contextData.saved[this.contextData.cArrPos];
+  for (i = 0; i < 16; i += 1) {
+    arr[i] = props[i];
+  }
+  this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
+  this.contextData.cArrPos += 1;
 };
 
-CanvasRenderer.prototype.restore = function(actionFlag){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.restore();
-        return;
-    }
-    if(actionFlag){
-        this.canvasContext.restore();
-        this.globalData.blendMode = 'source-over';
-    }
-    this.contextData.cArrPos -= 1;
-    var popped = this.contextData.saved[this.contextData.cArrPos];
-    var i,arr = this.contextData.cTr.props;
-    for(i=0;i<16;i+=1){
-        arr[i] = popped[i];
-    }
-    this.canvasContext.setTransform(popped[0],popped[1],popped[4],popped[5],popped[12],popped[13]);
-    popped = this.contextData.savedOp[this.contextData.cArrPos];
-    this.contextData.cO = popped;
-    if(this.globalData.currentGlobalAlpha !== popped) {
-        this.canvasContext.globalAlpha = popped;
-        this.globalData.currentGlobalAlpha = popped;
-    }
+CanvasRenderer.prototype.restore = function (actionFlag) {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.restore();
+    return;
+  }
+  if (actionFlag) {
+    this.canvasContext.restore();
+    this.globalData.blendMode = 'source-over';
+  }
+  this.contextData.cArrPos -= 1;
+  var popped = this.contextData.saved[this.contextData.cArrPos];
+  var i;
+  var arr = this.contextData.cTr.props;
+  for (i = 0; i < 16; i += 1) {
+    arr[i] = popped[i];
+  }
+  this.canvasContext.setTransform(popped[0], popped[1], popped[4], popped[5], popped[12], popped[13]);
+  popped = this.contextData.savedOp[this.contextData.cArrPos];
+  this.contextData.cO = popped;
+  if (this.globalData.currentGlobalAlpha !== popped) {
+    this.canvasContext.globalAlpha = popped;
+    this.globalData.currentGlobalAlpha = popped;
+  }
 };
 
-CanvasRenderer.prototype.configAnimation = function(animData){
-    if(this.animationItem.wrapper){
-        this.animationItem.container = createTag('canvas');
-        this.animationItem.container.style.width = '100%';
-        this.animationItem.container.style.height = '100%';
-        //this.animationItem.container.style.transform = 'translate3d(0,0,0)';
-        //this.animationItem.container.style.webkitTransform = 'translate3d(0,0,0)';
-        this.animationItem.container.style.transformOrigin = this.animationItem.container.style.mozTransformOrigin = this.animationItem.container.style.webkitTransformOrigin = this.animationItem.container.style['-webkit-transform'] = "0px 0px 0px";
-        this.animationItem.wrapper.appendChild(this.animationItem.container);
-        this.canvasContext = this.animationItem.container.getContext('2d');
-        if(this.renderConfig.className) {
-            this.animationItem.container.setAttribute('class', this.renderConfig.className);
-        }
-        if(this.renderConfig.id) {
-            this.animationItem.container.setAttribute('id', this.renderConfig.id);
-        }
-    }else{
-        this.canvasContext = this.renderConfig.context;
+CanvasRenderer.prototype.configAnimation = function (animData) {
+  if (this.animationItem.wrapper) {
+    this.animationItem.container = createTag('canvas');
+    var containerStyle = this.animationItem.container.style;
+    containerStyle.width = '100%';
+    containerStyle.height = '100%';
+    var origin = '0px 0px 0px';
+    containerStyle.transformOrigin = origin;
+    containerStyle.mozTransformOrigin = origin;
+    containerStyle.webkitTransformOrigin = origin;
+    containerStyle['-webkit-transform'] = origin;
+    this.animationItem.wrapper.appendChild(this.animationItem.container);
+    this.canvasContext = this.animationItem.container.getContext('2d');
+    if (this.renderConfig.className) {
+      this.animationItem.container.setAttribute('class', this.renderConfig.className);
     }
-    this.data = animData;
-    this.layers = animData.layers;
-    this.transformCanvas = {
-        w: animData.w,
-        h:animData.h,
-        sx:0,
-        sy:0,
-        tx:0,
-        ty:0
-    };
-    this.setupGlobalData(animData, document.body);
-    this.globalData.canvasContext = this.canvasContext;
-    this.globalData.renderer = this;
-    this.globalData.isDashed = false;
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.globalData.transformCanvas = this.transformCanvas;
-    this.elements = createSizedArray(animData.layers.length);
+    if (this.renderConfig.id) {
+      this.animationItem.container.setAttribute('id', this.renderConfig.id);
+    }
+  } else {
+    this.canvasContext = this.renderConfig.context;
+  }
+  this.data = animData;
+  this.layers = animData.layers;
+  this.transformCanvas = {
+    w: animData.w,
+    h: animData.h,
+    sx: 0,
+    sy: 0,
+    tx: 0,
+    ty: 0,
+  };
+  this.setupGlobalData(animData, document.body);
+  this.globalData.canvasContext = this.canvasContext;
+  this.globalData.renderer = this;
+  this.globalData.isDashed = false;
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.globalData.transformCanvas = this.transformCanvas;
+  this.elements = createSizedArray(animData.layers.length);
 
-    this.updateContainerSize();
+  this.updateContainerSize();
 };
 
 CanvasRenderer.prototype.updateContainerSize = function () {
-    this.reset();
-    var elementWidth,elementHeight;
-    if(this.animationItem.wrapper && this.animationItem.container){
-        elementWidth = this.animationItem.wrapper.offsetWidth;
-        elementHeight = this.animationItem.wrapper.offsetHeight;
-        this.animationItem.container.setAttribute('width',elementWidth * this.renderConfig.dpr );
-        this.animationItem.container.setAttribute('height',elementHeight * this.renderConfig.dpr);
-    }else{
-        elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
-        elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
+  this.reset();
+  var elementWidth;
+  var elementHeight;
+  if (this.animationItem.wrapper && this.animationItem.container) {
+    elementWidth = this.animationItem.wrapper.offsetWidth;
+    elementHeight = this.animationItem.wrapper.offsetHeight;
+    this.animationItem.container.setAttribute('width', elementWidth * this.renderConfig.dpr);
+    this.animationItem.container.setAttribute('height', elementHeight * this.renderConfig.dpr);
+  } else {
+    elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
+    elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
+  }
+  var elementRel;
+  var animationRel;
+  if (this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1) {
+    var par = this.renderConfig.preserveAspectRatio.split(' ');
+    var fillType = par[1] || 'meet';
+    var pos = par[0] || 'xMidYMid';
+    var xPos = pos.substr(0, 4);
+    var yPos = pos.substr(4);
+    elementRel = elementWidth / elementHeight;
+    animationRel = this.transformCanvas.w / this.transformCanvas.h;
+    if ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice')) {
+      this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+      this.transformCanvas.sy = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+    } else {
+      this.transformCanvas.sx = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
+      this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
     }
-    var elementRel,animationRel;
-    if(this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1){
-        var par = this.renderConfig.preserveAspectRatio.split(' ');
-        var fillType = par[1] || 'meet';
-        var pos = par[0] || 'xMidYMid';
-        var xPos = pos.substr(0,4);
-        var yPos = pos.substr(4);
-        elementRel = elementWidth/elementHeight;
-        animationRel = this.transformCanvas.w/this.transformCanvas.h;
-        if(animationRel>elementRel && fillType === 'meet' || animationRel<elementRel && fillType === 'slice'){
-            this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-            this.transformCanvas.sy = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-        }else{
-            this.transformCanvas.sx = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
-            this.transformCanvas.sy = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
-        }
 
-        if(xPos === 'xMid' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
-            this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))/2*this.renderConfig.dpr;
-        } else if(xPos === 'xMax' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
-            this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))*this.renderConfig.dpr;
-        } else {
-            this.transformCanvas.tx = 0;
-        }
-        if(yPos === 'YMid' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
-            this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w))/2)*this.renderConfig.dpr;
-        } else if(yPos === 'YMax' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
-            this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w)))*this.renderConfig.dpr;
-        } else {
-            this.transformCanvas.ty = 0;
-        }
-
-    }else if(this.renderConfig.preserveAspectRatio == 'none'){
-        this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-        this.transformCanvas.sy = elementHeight/(this.transformCanvas.h/this.renderConfig.dpr);
-        this.transformCanvas.tx = 0;
-        this.transformCanvas.ty = 0;
-    }else{
-        this.transformCanvas.sx = this.renderConfig.dpr;
-        this.transformCanvas.sy = this.renderConfig.dpr;
-        this.transformCanvas.tx = 0;
-        this.transformCanvas.ty = 0;
+    if (xPos === 'xMid' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) {
+      this.transformCanvas.tx = ((elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) / 2) * this.renderConfig.dpr;
+    } else if (xPos === 'xMax' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) {
+      this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) * this.renderConfig.dpr;
+    } else {
+      this.transformCanvas.tx = 0;
     }
-    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];
-    /*var i, len = this.elements.length;
+    if (yPos === 'YMid' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) {
+      this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) / 2) * this.renderConfig.dpr;
+    } else if (yPos === 'YMax' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) {
+      this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w))) * this.renderConfig.dpr;
+    } else {
+      this.transformCanvas.ty = 0;
+    }
+  } else if (this.renderConfig.preserveAspectRatio === 'none') {
+    this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+    this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
+    this.transformCanvas.tx = 0;
+    this.transformCanvas.ty = 0;
+  } else {
+    this.transformCanvas.sx = this.renderConfig.dpr;
+    this.transformCanvas.sy = this.renderConfig.dpr;
+    this.transformCanvas.tx = 0;
+    this.transformCanvas.ty = 0;
+  }
+  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];
+  /* var i, len = this.elements.length;
     for(i=0;i<len;i+=1){
         if(this.elements[i] && this.elements[i].data.ty === 0){
             this.elements[i].resize(this.globalData.transformCanvas);
         }
-    }*/
-    this.ctxTransform(this.transformCanvas.props);
-    this.canvasContext.beginPath();
-    this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
-    this.canvasContext.closePath();
-    this.canvasContext.clip();
+    } */
+  this.ctxTransform(this.transformCanvas.props);
+  this.canvasContext.beginPath();
+  this.canvasContext.rect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+  this.canvasContext.closePath();
+  this.canvasContext.clip();
 
-    this.renderFrame(this.renderedFrame, true);
+  this.renderFrame(this.renderedFrame, true);
 };
 
 CanvasRenderer.prototype.destroy = function () {
-    if(this.renderConfig.clearCanvas && this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.renderConfig.clearCanvas && this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = len - 1; i >= 0; i-=1) {
-        if(this.elements[i]) {
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.globalData.canvasContext = null;
-    this.animationItem.container = null;
-    this.destroyed = true;
+  }
+  this.elements.length = 0;
+  this.globalData.canvasContext = null;
+  this.animationItem.container = null;
+  this.destroyed = true;
 };
 
-CanvasRenderer.prototype.renderFrame = function(num, forceRender){
-    if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){
-        return;
-    }
-    this.renderedFrame = num;
-    this.globalData.frameNum = num - this.animationItem._isFirstFrame;
-    this.globalData.frameId += 1;
-    this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
-    this.globalData.projectInterface.currentFrame = num;
+CanvasRenderer.prototype.renderFrame = function (num, forceRender) {
+  if ((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1) {
+    return;
+  }
+  this.renderedFrame = num;
+  this.globalData.frameNum = num - this.animationItem._isFirstFrame;
+  this.globalData.frameId += 1;
+  this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
+  this.globalData.projectInterface.currentFrame = num;
 
-     // console.log('--------');
-     // console.log('NEW: ',num);
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
+  // console.log('--------');
+  // console.log('NEW: ',num);
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
 
-    for (i = 0; i < len; i++) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
-    if(this.globalData._mdf) {
-        if(this.renderConfig.clearCanvas === true){
-            this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
-        }else{
-            this.save();
-        }
-        for (i = len - 1; i >= 0; i-=1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-        if(this.renderConfig.clearCanvas !== true){
-            this.restore();
-        }
+  }
+  if (this.globalData._mdf) {
+    if (this.renderConfig.clearCanvas === true) {
+      this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+    } else {
+      this.save();
     }
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+    if (this.renderConfig.clearCanvas !== true) {
+      this.restore();
+    }
+  }
 };
 
-CanvasRenderer.prototype.buildItem = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    var element = this.createItem(this.layers[pos], this,this.globalData);
-    elements[pos] = element;
-    element.initExpressions();
-    /*if(this.layers[pos].ty === 0){
+CanvasRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  var element = this.createItem(this.layers[pos], this, this.globalData);
+  elements[pos] = element;
+  element.initExpressions();
+  /* if(this.layers[pos].ty === 0){
         element.resize(this.globalData.transformCanvas);
-    }*/
+    } */
 };
 
-CanvasRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-    }
+CanvasRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+  }
 };
 
-CanvasRenderer.prototype.hide = function(){
-    this.animationItem.container.style.display = 'none';
+CanvasRenderer.prototype.hide = function () {
+  this.animationItem.container.style.display = 'none';
 };
 
-CanvasRenderer.prototype.show = function(){
-    this.animationItem.container.style.display = 'block';
+CanvasRenderer.prototype.show = function () {
+  this.animationItem.container.style.display = 'block';
 };
 
-CanvasRenderer.prototype.configAnimation = function(animData){
-    if(this.animationItem.wrapper){
-        this.animationItem.container = createTag('canvas');
-        this.animationItem.container.style.width = '100%';
-        this.animationItem.container.style.height = '100%';
-        //this.animationItem.container.style.transform = 'translate3d(0,0,0)';
-        //this.animationItem.container.style.webkitTransform = 'translate3d(0,0,0)';
-        this.animationItem.container.style.transformOrigin = this.animationItem.container.style.mozTransformOrigin = this.animationItem.container.style.webkitTransformOrigin = this.animationItem.container.style['-webkit-transform'] = "0px 0px 0px";
-        this.animationItem.wrapper.appendChild(this.animationItem.container);
-        this.canvasContext = this.animationItem.container.getContext('2d');
-        if(this.renderConfig.className) {
-            this.animationItem.container.setAttribute('class', this.renderConfig.className);
-        }
-    }else{
-        this.canvasContext = this.renderConfig.context;
-    }
-    this.data = animData;
-    this.layers = animData.layers;
-    this.transformCanvas = {
-        w: animData.w,
-        h:animData.h,
-        sx:0,
-        sy:0,
-        tx:0,
-        ty:0
-    };
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-    this.globalData.canvasContext = this.canvasContext;
-    this.globalData.renderer = this;
-    this.globalData.isDashed = false;
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.globalData.transformCanvas = this.transformCanvas;
-    this.elements = createSizedArray(animData.layers.length);
+/* global CanvasRenderer, createTag, createSizedArray */
 
-    this.updateContainerSize();
+CanvasRenderer.prototype.configAnimation = function (animData) {
+  if (this.animationItem.wrapper) {
+    this.animationItem.container = createTag('canvas');
+    var containerStyle = this.animationItem.container.style;
+    containerStyle.width = '100%';
+    containerStyle.height = '100%';
+    var origin = '0px 0px 0px';
+    containerStyle.transformOrigin = origin;
+    containerStyle.mozTransformOrigin = origin;
+    containerStyle.webkitTransformOrigin = origin;
+    containerStyle['-webkit-transform'] = origin;
+    this.animationItem.wrapper.appendChild(this.animationItem.container);
+    this.canvasContext = this.animationItem.container.getContext('2d');
+    if (this.renderConfig.className) {
+      this.animationItem.container.setAttribute('class', this.renderConfig.className);
+    }
+  } else {
+    this.canvasContext = this.renderConfig.context;
+  }
+  this.data = animData;
+  this.layers = animData.layers;
+  this.transformCanvas = {
+    w: animData.w,
+    h: animData.h,
+    sx: 0,
+    sy: 0,
+    tx: 0,
+    ty: 0,
+  };
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
+  this.globalData.canvasContext = this.canvasContext;
+  this.globalData.renderer = this;
+  this.globalData.isDashed = false;
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.globalData.transformCanvas = this.transformCanvas;
+  this.elements = createSizedArray(animData.layers.length);
+
+  this.updateContainerSize();
 };
 
-function MaskElement(data,element,globalData) {
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties || [];
-    this.maskElement = null;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties ? this.masksProperties.length : 0;
-    this.viewData = createSizedArray(len);
-    this.solidPath = '';
+/* global createSizedArray, createElementID, PropertyFactory, ShapePropertyFactory, createNS, locationHref */
 
+function MaskElement(data, element, globalData) {
+  this.data = data;
+  this.element = element;
+  this.globalData = globalData;
+  this.storedData = [];
+  this.masksProperties = this.data.masksProperties || [];
+  this.maskElement = null;
+  var defs = this.globalData.defs;
+  var i;
+  var len = this.masksProperties ? this.masksProperties.length : 0;
+  this.viewData = createSizedArray(len);
+  this.solidPath = '';
 
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = createElementID();
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
-            rect = createNS( 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w || 0);
-            rect.setAttribute('height', this.element.comp.data.h || 0);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = createNS( 'path');
-        if(properties[i].mode == 'n') {
-            // TODO move this to a factory or to a constructor
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-                elem: path,
-                lastPath: ''
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
-        path.setAttribute('clip-rule','nonzero');
-        var filterID;
-
-        if (properties[i].x.k !== 0) {
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
-            filterID = createElementID();
-            expansor = createNS('filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = createNS('feMorphology');
-            feMorph.setAttribute('operator','erode');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
-        } else {
-            feMorph = null;
-            x = null;
-        }
-
-        // TODO move this to a factory or to a constructor
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = createNS('g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = createNS('mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        // TODO move this to a factory or to a constructor
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-            invRect: rect
-        };
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
+  var path;
+  var properties = this.masksProperties;
+  var count = 0;
+  var currentMasks = [];
+  var j;
+  var jLen;
+  var layerId = createElementID();
+  var rect;
+  var expansor;
+  var feMorph;
+  var x;
+  var maskType = 'clipPath';
+  var maskRef = 'clip-path';
+  for (i = 0; i < len; i += 1) {
+    if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
+      maskType = 'mask';
+      maskRef = 'mask';
     }
 
-    this.maskElement = createNS( maskType);
-
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
+    if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
+      rect = createNS('rect');
+      rect.setAttribute('fill', '#ffffff');
+      rect.setAttribute('width', this.element.comp.data.w || 0);
+      rect.setAttribute('height', this.element.comp.data.h || 0);
+      currentMasks.push(rect);
+    } else {
+      rect = null;
     }
 
-    if(count > 0){
-        this.maskElement.setAttribute('id', layerId);
-        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
-        defs.appendChild(this.maskElement);
-    }
-    if (this.viewData.length) {
-        this.element.addRenderableComponent(this);
-    }
+    path = createNS('path');
+    if (properties[i].mode === 'n') {
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        elem: path,
+        lastPath: '',
+      };
+      defs.appendChild(path);
+    } else {
+      count += 1;
 
+      path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      path.setAttribute('clip-rule', 'nonzero');
+      var filterID;
+
+      if (properties[i].x.k !== 0) {
+        maskType = 'mask';
+        maskRef = 'mask';
+        x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
+        filterID = createElementID();
+        expansor = createNS('filter');
+        expansor.setAttribute('id', filterID);
+        feMorph = createNS('feMorphology');
+        feMorph.setAttribute('operator', 'erode');
+        feMorph.setAttribute('in', 'SourceGraphic');
+        feMorph.setAttribute('radius', '0');
+        expansor.appendChild(feMorph);
+        defs.appendChild(expansor);
+        path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      } else {
+        feMorph = null;
+        x = null;
+      }
+
+      // TODO move this to a factory or to a constructor
+      this.storedData[i] = {
+        elem: path,
+        x: x,
+        expan: feMorph,
+        lastPath: '',
+        lastOperator: '',
+        filterId: filterID,
+        lastRadius: 0,
+      };
+      if (properties[i].mode === 'i') {
+        jLen = currentMasks.length;
+        var g = createNS('g');
+        for (j = 0; j < jLen; j += 1) {
+          g.appendChild(currentMasks[j]);
+        }
+        var mask = createNS('mask');
+        mask.setAttribute('mask-type', 'alpha');
+        mask.setAttribute('id', layerId + '_' + count);
+        mask.appendChild(path);
+        defs.appendChild(mask);
+        g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
+
+        currentMasks.length = 0;
+        currentMasks.push(g);
+      } else {
+        currentMasks.push(path);
+      }
+      if (properties[i].inv && !this.solidPath) {
+        this.solidPath = this.createLayerSolidPath();
+      }
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        elem: path,
+        lastPath: '',
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        invRect: rect,
+      };
+      if (!this.viewData[i].prop.k) {
+        this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
+      }
+    }
+  }
+
+  this.maskElement = createNS(maskType);
+
+  len = currentMasks.length;
+  for (i = 0; i < len; i += 1) {
+    this.maskElement.appendChild(currentMasks[i]);
+  }
+
+  if (count > 0) {
+    this.maskElement.setAttribute('id', layerId);
+    this.element.maskedElement.setAttribute(maskRef, 'url(' + locationHref + '#' + layerId + ')');
+    defs.appendChild(this.maskElement);
+  }
+  if (this.viewData.length) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
+MaskElement.prototype.getMaskProperty = function (pos) {
+  return this.viewData[pos].prop;
 };
 
 MaskElement.prototype.renderFrame = function (isFirstFrame) {
-    var finalMat = this.element.finalTransform.mat;
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop._mdf || isFirstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op._mdf || isFirstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
-                this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
-            }
-            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
+  var finalMat = this.element.finalTransform.mat;
+  var i;
+  var len = this.masksProperties.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.viewData[i].prop._mdf || isFirstFrame) {
+      this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
     }
+    if (this.viewData[i].op._mdf || isFirstFrame) {
+      this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
+    }
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
+        this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
+      }
+      if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
+        var feMorph = this.storedData[i].expan;
+        if (this.storedData[i].x.v < 0) {
+          if (this.storedData[i].lastOperator !== 'erode') {
+            this.storedData[i].lastOperator = 'erode';
+            this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
+          }
+          feMorph.setAttribute('radius', -this.storedData[i].x.v);
+        } else {
+          if (this.storedData[i].lastOperator !== 'dilate') {
+            this.storedData[i].lastOperator = 'dilate';
+            this.storedData[i].elem.setAttribute('filter', null);
+          }
+          this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
+        }
+      }
+    }
+  }
 };
 
 MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
+  return this.maskElement;
 };
 
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
+MaskElement.prototype.createLayerSolidPath = function () {
+  var path = 'M0,0 ';
+  path += ' h' + this.globalData.compSize.w;
+  path += ' v' + this.globalData.compSize.h;
+  path += ' h-' + this.globalData.compSize.w;
+  path += ' v-' + this.globalData.compSize.h + ' ';
+  return path;
 };
 
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //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];
-        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];
-    }
-        //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];
-    if(pathNodes.c && len > 1){
-        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];
-    }
-    //pathNodes.__renderedString = pathString;
+MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
+  var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
+  var i;
+  var len;
+  len = pathNodes._length;
+  for (i = 1; i < len; i += 1) {
+    // 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];
+    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];
+  }
+  // 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];
+  if (pathNodes.c && len > 1) {
+    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];
+  }
+  // pathNodes.__renderedString = pathString;
 
-    if(viewData.lastPath !== pathString){
-        var pathShapeValue = '';
-        if(viewData.elem){
-            if(pathNodes.c){
-                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
-            }
-            viewData.elem.setAttribute('d',pathShapeValue);
-        }
-        viewData.lastPath = pathString;
+  if (viewData.lastPath !== pathString) {
+    var pathShapeValue = '';
+    if (viewData.elem) {
+      if (pathNodes.c) {
+        pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
+      }
+      viewData.elem.setAttribute('d', pathShapeValue);
     }
+    viewData.lastPath = pathString;
+  }
 };
 
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.masksProperties = null;
+MaskElement.prototype.destroy = function () {
+  this.element = null;
+  this.globalData = null;
+  this.maskElement = null;
+  this.data = null;
+  this.masksProperties = null;
 };
 
 /**
- * @file 
+ * @file
  * Handles AE's layer parenting property.
  *
  */
 
-function HierarchyElement(){}
+function HierarchyElement() {}
 
 HierarchyElement.prototype = {
-	/**
-     * @function 
+  /**
+     * @function
      * Initializes hierarchy properties
      *
      */
-	initHierarchy: function() {
-		//element's parent list
-	    this.hierarchy = [];
-	    //if element is parent of another layer _isParent will be true
-	    this._isParent = false;
-	    this.checkParenting();
-	},
-	/**
-     * @function 
+  initHierarchy: function () {
+    // element's parent list
+    this.hierarchy = [];
+    // if element is parent of another layer _isParent will be true
+    this._isParent = false;
+    this.checkParenting();
+  },
+  /**
+     * @function
      * Sets layer's hierarchy.
      * @param {array} hierarch
      * layer's parent list
      *
-     */ 
-	setHierarchy: function(hierarchy){
-	    this.hierarchy = hierarchy;
-	},
-	/**
-     * @function 
+     */
+  setHierarchy: function (hierarchy) {
+    this.hierarchy = hierarchy;
+  },
+  /**
+     * @function
      * Sets layer as parent.
      *
-     */ 
-	setAsParent: function() {
-	    this._isParent = true;
-	},
-	/**
-     * @function 
+     */
+  setAsParent: function () {
+    this._isParent = true;
+  },
+  /**
+     * @function
      * Searches layer's parenting chain
      *
-     */ 
-	checkParenting: function(){
-	    if (this.data.parent !== undefined){
-	        this.comp.buildElementParenting(this, this.data.parent, []);
-	    }
-	}
+     */
+  checkParenting: function () {
+    if (this.data.parent !== undefined) {
+      this.comp.buildElementParenting(this, this.data.parent, []);
+    }
+  },
 };
+
 /**
- * @file 
+ * @file
  * Handles element's layer frame update.
  * Checks layer in point and out point
  *
  */
 
-function FrameElement(){}
+function FrameElement() {}
 
 FrameElement.prototype = {
-    /**
-     * @function 
+  /**
+     * @function
      * Initializes frame related properties.
      *
      */
-    initFrame: function(){
-        //set to true when inpoint is rendered
-        this._isFirstFrame = false;
-        //list of animated properties
-        this.dynamicProperties = [];
-        // If layer has been modified in current tick this will be true
-        this._mdf = false;
-    },
-    /**
-     * @function 
+  initFrame: function () {
+    // set to true when inpoint is rendered
+    this._isFirstFrame = false;
+    // list of animated properties
+    this.dynamicProperties = [];
+    // If layer has been modified in current tick this will be true
+    this._mdf = false;
+  },
+  /**
+     * @function
      * Calculates all dynamic values
      *
      * @param {number} num
      * current frame number in Layer's time
      * @param {boolean} isVisible
      * if layers is currently in range
-     * 
+     *
      */
-    prepareProperties: function(num, isVisible) {
-        var i, len = this.dynamicProperties.length;
-        for (i = 0;i < len; i += 1) {
-            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i]._mdf) {
-                    this.globalData._mdf = true;
-                    this._mdf = true;
-                }
-            }
+  prepareProperties: function (num, isVisible) {
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+        this.dynamicProperties[i].getValue();
+        if (this.dynamicProperties[i]._mdf) {
+          this.globalData._mdf = true;
+          this._mdf = true;
         }
-    },
-    addDynamicProperty: function(prop) {
-        if(this.dynamicProperties.indexOf(prop) === -1) {
-            this.dynamicProperties.push(prop);
-        }
+      }
     }
+  },
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+    }
+  },
 };
-function TransformElement(){}
+
+/* global TransformPropertyFactory, Matrix */
+
+function TransformElement() {}
 
 TransformElement.prototype = {
-    initTransform: function() {
-        this.finalTransform = {
-            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
-            _matMdf: false,
-            _opMdf: false,
-            mat: new Matrix()
-        };
-        if (this.data.ao) {
-            this.finalTransform.mProp.autoOriented = true;
-        }
+  initTransform: function () {
+    this.finalTransform = {
+      mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 },
+      _matMdf: false,
+      _opMdf: false,
+      mat: new Matrix(),
+    };
+    if (this.data.ao) {
+      this.finalTransform.mProp.autoOriented = true;
+    }
 
-        //TODO: check TYPE 11: Guided elements
-        if (this.data.ty !== 11) {
-            //this.createElements();
-        }
-    },
-    renderTransform: function() {
+    // TODO: check TYPE 11: Guided elements
+    if (this.data.ty !== 11) {
+      // this.createElements();
+    }
+  },
+  renderTransform: function () {
+    this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+    this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
 
-        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
-        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+    if (this.hierarchy) {
+      var mat;
+      var finalMat = this.finalTransform.mat;
+      var i = 0;
+      var len = this.hierarchy.length;
+      // Checking if any of the transformation matrices in the hierarchy chain has changed.
+      if (!this.finalTransform._matMdf) {
+        while (i < len) {
+          if (this.hierarchy[i].finalTransform.mProp._mdf) {
+            this.finalTransform._matMdf = true;
+            break;
+          }
+          i += 1;
+        }
+      }
 
-        if (this.hierarchy) {
-            var mat;
-            var finalMat = this.finalTransform.mat;
-            var i = 0, len = this.hierarchy.length;
-            //Checking if any of the transformation matrices in the hierarchy chain has changed.
-            if (!this.finalTransform._matMdf) {
-                while (i < len) {
-                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
-                        this.finalTransform._matMdf = true;
-                        break;
-                    }
-                    i += 1;
-                }
-            }
-            
-            if (this.finalTransform._matMdf) {
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-                for (i = 0; i < len; i += 1) {
-                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                    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]);
-                }
-            }
-        }
-    },
-    globalToLocal: function(pt) {
-        var transforms = [];
-        transforms.push(this.finalTransform);
-        var flag = true;
-        var comp = this.comp;
-        while (flag) {
-            if (comp.finalTransform) {
-                if (comp.data.hasMask) {
-                    transforms.splice(0, 0, comp.finalTransform);
-                }
-                comp = comp.comp;
-            } else {
-                flag = false;
-            }
-        }
-        var i, len = transforms.length,ptNew;
+      if (this.finalTransform._matMdf) {
+        mat = this.finalTransform.mProp.v.props;
+        finalMat.cloneFromProps(mat);
         for (i = 0; i < len; i += 1) {
-            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
-            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+          mat = this.hierarchy[i].finalTransform.mProp.v.props;
+          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]);
         }
-        return pt;
-    },
-    mHelper: new Matrix()
+      }
+    }
+  },
+  globalToLocal: function (pt) {
+    var transforms = [];
+    transforms.push(this.finalTransform);
+    var flag = true;
+    var comp = this.comp;
+    while (flag) {
+      if (comp.finalTransform) {
+        if (comp.data.hasMask) {
+          transforms.splice(0, 0, comp.finalTransform);
+        }
+        comp = comp.comp;
+      } else {
+        flag = false;
+      }
+    }
+    var i;
+    var len = transforms.length;
+    var ptNew;
+    for (i = 0; i < len; i += 1) {
+      ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+      // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+      pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+    }
+    return pt;
+  },
+  mHelper: new Matrix(),
 };
-function RenderableElement(){
+
+function RenderableElement() {
 
 }
 
 RenderableElement.prototype = {
-    initRenderable: function() {
-        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
-        this.isInRange = false;
-        //layer's display state
-        this.hidden = false;
-        // If layer's transparency equals 0, it can be hidden
-        this.isTransparent = false;
-        //list of animated components
-        this.renderableComponents = [];
-    },
-    addRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) === -1) {
-            this.renderableComponents.push(component);
-        }
-    },
-    removeRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) !== -1) {
-            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
-        }
-    },
-    prepareRenderableFrame: function(num) {
-        this.checkLayerLimits(num);
-    },
-    checkTransparency: function(){
-        if(this.finalTransform.mProp.o.v <= 0) {
-            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
-                this.isTransparent = true;
-                this.hide();
-            }
-        } else if(this.isTransparent) {
-            this.isTransparent = false;
-            this.show();
-        }
-    },
-    /**
-     * @function 
+  initRenderable: function () {
+    // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+    this.isInRange = false;
+    // layer's display state
+    this.hidden = false;
+    // If layer's transparency equals 0, it can be hidden
+    this.isTransparent = false;
+    // list of animated components
+    this.renderableComponents = [];
+  },
+  addRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) === -1) {
+      this.renderableComponents.push(component);
+    }
+  },
+  removeRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) !== -1) {
+      this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+    }
+  },
+  prepareRenderableFrame: function (num) {
+    this.checkLayerLimits(num);
+  },
+  checkTransparency: function () {
+    if (this.finalTransform.mProp.o.v <= 0) {
+      if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
+        this.isTransparent = true;
+        this.hide();
+      }
+    } else if (this.isTransparent) {
+      this.isTransparent = false;
+      this.show();
+    }
+  },
+  /**
+     * @function
      * Initializes frame related properties.
      *
      * @param {number} num
      * current frame number in Layer's time
-     * 
+     *
      */
-    checkLayerLimits: function(num) {
-        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-        {
-            if(this.isInRange !== true){
-                this.globalData._mdf = true;
-                this._mdf = true;
-                this.isInRange = true;
-                this.show();
-            }
-        } else {
-            if(this.isInRange !== false){
-                this.globalData._mdf = true;
-                this.isInRange = false;
-                this.hide();
-            }
-        }
-    },
-    renderRenderable: function() {
-        var i, len = this.renderableComponents.length;
-        for(i = 0; i < len; i += 1) {
-            this.renderableComponents[i].renderFrame(this._isFirstFrame);
-        }
-        /*this.maskManager.renderFrame(this.finalTransform.mat);
-        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
-    },
-    sourceRectAtTime: function(){
-        return {
-            top:0,
-            left:0,
-            width:100,
-            height:100
-        };
-    },
-    getLayerSize: function(){
-        if(this.data.ty === 5){
-            return {w:this.data.textData.width,h:this.data.textData.height};
-        }else{
-            return {w:this.data.width,h:this.data.height};
-        }
+  checkLayerLimits: function (num) {
+    if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
+      if (this.isInRange !== true) {
+        this.globalData._mdf = true;
+        this._mdf = true;
+        this.isInRange = true;
+        this.show();
+      }
+    } else if (this.isInRange !== false) {
+      this.globalData._mdf = true;
+      this.isInRange = false;
+      this.hide();
     }
+  },
+  renderRenderable: function () {
+    var i;
+    var len = this.renderableComponents.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderableComponents[i].renderFrame(this._isFirstFrame);
+    }
+    /* this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
+  },
+  sourceRectAtTime: function () {
+    return {
+      top: 0,
+      left: 0,
+      width: 100,
+      height: 100,
+    };
+  },
+  getLayerSize: function () {
+    if (this.data.ty === 5) {
+      return { w: this.data.textData.width, h: this.data.textData.height };
+    }
+    return { w: this.data.width, h: this.data.height };
+  },
 };
+
+/* global extendPrototype, RenderableElement, createProxyFunction */
+
 function RenderableDOMElement() {}
 
-(function(){
-    var _prototype = {
-        initElement: function(data,globalData,comp) {
-            this.initFrame();
-            this.initBaseData(data, globalData, comp);
-            this.initTransform(data, globalData, comp);
-            this.initHierarchy();
-            this.initRenderable();
-            this.initRendererElement();
-            this.createContainerElements();
-            this.createRenderableComponents();
-            this.createContent();
-            this.hide();
-        },
-        hide: function(){
-            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-                var elem = this.baseElement || this.layerElement;
-                elem.style.display = 'none';
-                this.hidden = true;
-            }
-        },
-        show: function(){
-            if (this.isInRange && !this.isTransparent){
-                if (!this.data.hd) {
-                    var elem = this.baseElement || this.layerElement;
-                    elem.style.display = 'block';
-                }
-                this.hidden = false;
-                this._isFirstFrame = true;
-            }
-        },
-        renderFrame: function() {
-            //If it is exported as hidden (data.hd === true) no need to render
-            //If it is not visible no need to render
-            if (this.data.hd || this.hidden) {
-                return;
-            }
-            this.renderTransform();
-            this.renderRenderable();
-            this.renderElement();
-            this.renderInnerContent();
-            if (this._isFirstFrame) {
-                this._isFirstFrame = false;
-            }
-        },
-        renderInnerContent: function() {},
-        prepareFrame: function(num) {
-            this._mdf = false;
-            this.prepareRenderableFrame(num);
-            this.prepareProperties(num, this.isInRange);
-            this.checkTransparency();
-        },
-        destroy: function(){
-            this.innerElem =  null;
-            this.destroyBaseElement();
+(function () {
+  var _prototype = {
+    initElement: function (data, globalData, comp) {
+      this.initFrame();
+      this.initBaseData(data, globalData, comp);
+      this.initTransform(data, globalData, comp);
+      this.initHierarchy();
+      this.initRenderable();
+      this.initRendererElement();
+      this.createContainerElements();
+      this.createRenderableComponents();
+      this.createContent();
+      this.hide();
+    },
+    hide: function () {
+      if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+        var elem = this.baseElement || this.layerElement;
+        elem.style.display = 'none';
+        this.hidden = true;
+      }
+    },
+    show: function () {
+      if (this.isInRange && !this.isTransparent) {
+        if (!this.data.hd) {
+          var elem = this.baseElement || this.layerElement;
+          elem.style.display = 'block';
         }
-    };
-    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+        this.hidden = false;
+        this._isFirstFrame = true;
+      }
+    },
+    renderFrame: function () {
+      // If it is exported as hidden (data.hd === true) no need to render
+      // If it is not visible no need to render
+      if (this.data.hd || this.hidden) {
+        return;
+      }
+      this.renderTransform();
+      this.renderRenderable();
+      this.renderElement();
+      this.renderInnerContent();
+      if (this._isFirstFrame) {
+        this._isFirstFrame = false;
+      }
+    },
+    renderInnerContent: function () {},
+    prepareFrame: function (num) {
+      this._mdf = false;
+      this.prepareRenderableFrame(num);
+      this.prepareProperties(num, this.isInRange);
+      this.checkTransparency();
+    },
+    destroy: function () {
+      this.innerElem = null;
+      this.destroyBaseElement();
+    },
+  };
+  extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
 }());
+
+/* exported ProcessedElement */
+
 function ProcessedElement(element, position) {
-	this.elem = element;
-	this.pos = position;
-}
-function SVGShapeData(transformers, level, shape) {
-    this.caches = [];
-    this.styles = [];
-    this.transformers = transformers;
-    this.lStr = '';
-    this.sh = shape;
-    this.lvl = level;
-    //TODO find if there are some cases where _isAnimated can be false. 
-    // For now, since shapes add up with other shapes. They have to be calculated every time.
-    // One way of finding out is checking if all styles associated to this shape depend only of this shape
-    this._isAnimated = !!shape.k;
-    // TODO: commenting this for now since all shapes are animated
-    var i = 0, len = transformers.length;
-    while(i < len) {
-    	if(transformers[i].mProps.dynamicProperties.length) {
-    		this._isAnimated = true;
-    		break;
-    	}
-    	i += 1;
-    }
+  this.elem = element;
+  this.pos = position;
 }
 
-SVGShapeData.prototype.setAsAnimated = function() {
-    this._isAnimated = true;
+function SVGShapeData(transformers, level, shape) {
+  this.caches = [];
+  this.styles = [];
+  this.transformers = transformers;
+  this.lStr = '';
+  this.sh = shape;
+  this.lvl = level;
+  // TODO find if there are some cases where _isAnimated can be false.
+  // For now, since shapes add up with other shapes. They have to be calculated every time.
+  // One way of finding out is checking if all styles associated to this shape depend only of this shape
+  this._isAnimated = !!shape.k;
+  // TODO: commenting this for now since all shapes are animated
+  var i = 0;
+  var len = transformers.length;
+  while (i < len) {
+    if (transformers[i].mProps.dynamicProperties.length) {
+      this._isAnimated = true;
+      break;
+    }
+    i += 1;
+  }
 }
+
+SVGShapeData.prototype.setAsAnimated = function () {
+  this._isAnimated = true;
+};
+
+/* global createNS */
+/* exported ShapeGroupData */
+
 function ShapeGroupData() {
-	this.it = [];
-    this.prevViewData = [];
-    this.gr = createNS('g');
+  this.it = [];
+  this.prevViewData = [];
+  this.gr = createNS('g');
 }
+
+/* global Matrix */
+
 function ShapeTransformManager() {
-	this.sequences = {};
-	this.sequenceList = [];
-    this.transform_key_count = 0;
+  this.sequences = {};
+  this.sequenceList = [];
+  this.transform_key_count = 0;
 }
 
 ShapeTransformManager.prototype = {
-	addTransformSequence: function(transforms) {
-		var i, len = transforms.length;
-		var key = '_';
-		for(i = 0; i < len; i += 1) {
-			key += transforms[i].transform.key + '_';
-		}
-		var sequence = this.sequences[key];
-		if(!sequence) {
-			sequence = {
-				transforms: [].concat(transforms),
-				finalTransform: new Matrix(),
-				_mdf: false
-			};
-			this.sequences[key] = sequence;
-			this.sequenceList.push(sequence);
-		}
-		return sequence;
-	},
-	processSequence: function(sequence, isFirstFrame) {
-		var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
-		while (i < len && !isFirstFrame) {
-			if (sequence.transforms[i].transform.mProps._mdf) {
-				_mdf = true;
-				break;
-			}
-			i += 1
-		}
-		if (_mdf) {
-			var props;
-			sequence.finalTransform.reset();
-			for (i = len - 1; i >= 0; i -= 1) {
-		        props = sequence.transforms[i].transform.mProps.v.props;
-		        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]);
-			}
-		}
-		sequence._mdf = _mdf;
-		
-	},
-	processSequences: function(isFirstFrame) {
-		var i, len = this.sequenceList.length;
-		for (i = 0; i < len; i += 1) {
-			this.processSequence(this.sequenceList[i], isFirstFrame);
-		}
-
-	},
-	getNewKey: function() {
-		return '_' + this.transform_key_count++;
-	}
-}
-function CVShapeData(element, data, styles, transformsManager) {
-    this.styledShapes = [];
-    this.tr = [0,0,0,0,0,0];
-    var ty = 4;
-    if(data.ty == 'rc'){
-        ty = 5;
-    }else if(data.ty == 'el'){
-        ty = 6;
-    }else if(data.ty == 'sr'){
-        ty = 7;
-    }
-    this.sh = ShapePropertyFactory.getShapeProp(element,data,ty,element);
-    var i , len = styles.length,styledShape;
+  addTransformSequence: function (transforms) {
+    var i;
+    var len = transforms.length;
+    var key = '_';
     for (i = 0; i < len; i += 1) {
-        if (!styles[i].closed) {
-            styledShape = {
-                transforms: transformsManager.addTransformSequence(styles[i].transforms),
-                trNodes: []
-            }
-            this.styledShapes.push(styledShape);
-            styles[i].elements.push(styledShape);
-        }
+      key += transforms[i].transform.key + '_';
     }
+    var sequence = this.sequences[key];
+    if (!sequence) {
+      sequence = {
+        transforms: [].concat(transforms),
+        finalTransform: new Matrix(),
+        _mdf: false,
+      };
+      this.sequences[key] = sequence;
+      this.sequenceList.push(sequence);
+    }
+    return sequence;
+  },
+  processSequence: function (sequence, isFirstFrame) {
+    var i = 0;
+    var len = sequence.transforms.length;
+    var _mdf = isFirstFrame;
+    while (i < len && !isFirstFrame) {
+      if (sequence.transforms[i].transform.mProps._mdf) {
+        _mdf = true;
+        break;
+      }
+      i += 1;
+    }
+    if (_mdf) {
+      var props;
+      sequence.finalTransform.reset();
+      for (i = len - 1; i >= 0; i -= 1) {
+        props = sequence.transforms[i].transform.mProps.v.props;
+        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]);
+      }
+    }
+    sequence._mdf = _mdf;
+  },
+  processSequences: function (isFirstFrame) {
+    var i;
+    var len = this.sequenceList.length;
+    for (i = 0; i < len; i += 1) {
+      this.processSequence(this.sequenceList[i], isFirstFrame);
+    }
+  },
+  getNewKey: function () {
+    this.transform_key_count += 1;
+    return '_' + this.transform_key_count;
+  },
+};
+
+/* global ShapePropertyFactory, SVGShapeData */
+
+function CVShapeData(element, data, styles, transformsManager) {
+  this.styledShapes = [];
+  this.tr = [0, 0, 0, 0, 0, 0];
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  this.sh = ShapePropertyFactory.getShapeProp(element, data, ty, element);
+  var i;
+  var len = styles.length;
+  var styledShape;
+  for (i = 0; i < len; i += 1) {
+    if (!styles[i].closed) {
+      styledShape = {
+        transforms: transformsManager.addTransformSequence(styles[i].transforms),
+        trNodes: [],
+      };
+      this.styledShapes.push(styledShape);
+      styles[i].elements.push(styledShape);
+    }
+  }
 }
 
 CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;
-function BaseElement(){
+
+/* global LayerExpressionInterface, EffectsExpressionInterface, CompExpressionInterface, ShapeExpressionInterface,
+TextExpressionInterface, getBlendMode,createElementID, EffectsManager */
+
+function BaseElement() {
 }
 
 BaseElement.prototype = {
-    checkMasks: function(){
-        if(!this.data.hasMask){
-            return false;
-        }
-        var i = 0, len = this.data.masksProperties.length;
-        while(i<len) {
-            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-                return true;
-            }
-            i += 1;
-        }
-        return false;
-    },
-    initExpressions: function(){
-        this.layerInterface = LayerExpressionInterface(this);
-        if(this.data.hasMask && this.maskManager) {
-            this.layerInterface.registerMaskInterface(this.maskManager);
-        }
-        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-        this.layerInterface.registerEffectsInterface(effectsInterface);
-
-        if(this.data.ty === 0 || this.data.xt){
-            this.compInterface = CompExpressionInterface(this);
-        } else if(this.data.ty === 4){
-            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
-            this.layerInterface.content = this.layerInterface.shapeInterface;
-        } else if(this.data.ty === 5){
-            this.layerInterface.textInterface = TextExpressionInterface(this);
-            this.layerInterface.text = this.layerInterface.textInterface;
-        }
-    },
-    setBlendMode: function(){
-        var blendModeValue = getBlendMode(this.data.bm);
-        var elem = this.baseElement || this.layerElement;
-
-        elem.style['mix-blend-mode'] = blendModeValue;
-    },
-    initBaseData: function(data, globalData, comp){
-        this.globalData = globalData;
-        this.comp = comp;
-        this.data = data;
-        this.layerId = createElementID();
-        
-        //Stretch factor for old animations missing this property.
-        if(!this.data.sr){
-            this.data.sr = 1;
-        }
-        // effects manager
-        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-        
-    },
-    getType: function(){
-        return this.type;
+  checkMasks: function () {
+    if (!this.data.hasMask) {
+      return false;
     }
-    ,sourceRectAtTime: function(){}
-}
-function NullElement(data,globalData,comp){
-    this.initFrame();
-	this.initBaseData(data, globalData, comp);
-    this.initFrame();
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
+    var i = 0;
+    var len = this.data.masksProperties.length;
+    while (i < len) {
+      if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+        return true;
+      }
+      i += 1;
+    }
+    return false;
+  },
+  initExpressions: function () {
+    this.layerInterface = LayerExpressionInterface(this);
+    if (this.data.hasMask && this.maskManager) {
+      this.layerInterface.registerMaskInterface(this.maskManager);
+    }
+    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
+    this.layerInterface.registerEffectsInterface(effectsInterface);
+
+    if (this.data.ty === 0 || this.data.xt) {
+      this.compInterface = CompExpressionInterface(this);
+    } else if (this.data.ty === 4) {
+      this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
+      this.layerInterface.content = this.layerInterface.shapeInterface;
+    } else if (this.data.ty === 5) {
+      this.layerInterface.textInterface = TextExpressionInterface(this);
+      this.layerInterface.text = this.layerInterface.textInterface;
+    }
+  },
+  setBlendMode: function () {
+    var blendModeValue = getBlendMode(this.data.bm);
+    var elem = this.baseElement || this.layerElement;
+
+    elem.style['mix-blend-mode'] = blendModeValue;
+  },
+  initBaseData: function (data, globalData, comp) {
+    this.globalData = globalData;
+    this.comp = comp;
+    this.data = data;
+    this.layerId = createElementID();
+
+    // Stretch factor for old animations missing this property.
+    if (!this.data.sr) {
+      this.data.sr = 1;
+    }
+    // effects manager
+    this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
+  },
+  getType: function () {
+    return this.type;
+  },
+  sourceRectAtTime: function () {},
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement */
+
+function NullElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initFrame();
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
 }
 
-NullElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
+NullElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-NullElement.prototype.renderFrame = function() {
+NullElement.prototype.renderFrame = function () {
 };
 
-NullElement.prototype.getBaseElement = function() {
-	return null;
+NullElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-NullElement.prototype.destroy = function() {
+NullElement.prototype.destroy = function () {
 };
 
-NullElement.prototype.sourceRectAtTime = function() {
+NullElement.prototype.sourceRectAtTime = function () {
 };
 
-NullElement.prototype.hide = function() {
+NullElement.prototype.hide = function () {
 };
 
-extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
 
-function SVGBaseElement(){
+/* global filtersFactory, featureSupport, filtersFactory, createElementID, createNS, MaskElement, SVGEffects, locationHref */
+
+function SVGBaseElement() {
 }
 
 SVGBaseElement.prototype = {
-    initRendererElement: function() {
-        this.layerElement = createNS('g');
-    },
-    createContainerElements: function(){
-        this.matteElement = createNS('g');
-        this.transformedElement = this.layerElement;
-        this.maskedElement = this.layerElement;
-        this._sizeChanged = false;
-        var layerElementParent = null;
-        //If this layer acts as a mask for the following layer
-        var filId, fil, gg;
-        if (this.data.td) {
-            if (this.data.td == 3 || this.data.td == 1) {
-                var masker = createNS('mask');
-                masker.setAttribute('id', this.layerId);
-                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
-                masker.appendChild(this.layerElement);
-                layerElementParent = masker;
-                this.globalData.defs.appendChild(masker);
-                // This is only for IE and Edge when mask if of type alpha
-                if (!featureSupport.maskType && this.data.td == 1) {
-                    masker.setAttribute('mask-type', 'luminance');
-                    filId = createElementID();
-                    fil = filtersFactory.createFilter(filId);
-                    this.globalData.defs.appendChild(fil);
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    masker.appendChild(gg);
-                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
-                }
-            } else if(this.data.td == 2) {
-                var maskGroup = createNS('mask');
-                maskGroup.setAttribute('id', this.layerId);
-                maskGroup.setAttribute('mask-type','alpha');
-                var maskGrouper = createNS('g');
-                maskGroup.appendChild(maskGrouper);
-                filId = createElementID();
-                fil = filtersFactory.createFilter(filId);
-                ////
+  initRendererElement: function () {
+    this.layerElement = createNS('g');
+  },
+  createContainerElements: function () {
+    this.matteElement = createNS('g');
+    this.transformedElement = this.layerElement;
+    this.maskedElement = this.layerElement;
+    this._sizeChanged = false;
+    var layerElementParent = null;
+    // If this layer acts as a mask for the following layer
+    var filId;
+    var fil;
+    var gg;
+    if (this.data.td) {
+      if (this.data.td == 3 || this.data.td == 1) { // eslint-disable-line eqeqeq
+        var masker = createNS('mask');
+        masker.setAttribute('id', this.layerId);
+        masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha'); // eslint-disable-line eqeqeq
+        masker.appendChild(this.layerElement);
+        layerElementParent = masker;
+        this.globalData.defs.appendChild(masker);
+        // This is only for IE and Edge when mask if of type alpha
+        if (!featureSupport.maskType && this.data.td == 1) { // eslint-disable-line eqeqeq
+          masker.setAttribute('mask-type', 'luminance');
+          filId = createElementID();
+          fil = filtersFactory.createFilter(filId);
+          this.globalData.defs.appendChild(fil);
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          masker.appendChild(gg);
+          gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        }
+      } else if (this.data.td == 2) { // eslint-disable-line eqeqeq
+        var maskGroup = createNS('mask');
+        maskGroup.setAttribute('id', this.layerId);
+        maskGroup.setAttribute('mask-type', 'alpha');
+        var maskGrouper = createNS('g');
+        maskGroup.appendChild(maskGrouper);
+        filId = createElementID();
+        fil = filtersFactory.createFilter(filId);
+        /// /
 
-                // This solution doesn't work on Android when meta tag with viewport attribute is set
-                /*var feColorMatrix = createNS('feColorMatrix');
+        // This solution doesn't work on Android when meta tag with viewport attribute is set
+        /* var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type', 'matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
                 feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-                fil.appendChild(feColorMatrix);*/
-                ////
-                var feCTr = createNS('feComponentTransfer');
-                feCTr.setAttribute('in','SourceGraphic');
-                fil.appendChild(feCTr);
-                var feFunc = createNS('feFuncA');
-                feFunc.setAttribute('type','table');
-                feFunc.setAttribute('tableValues','1.0 0.0');
-                feCTr.appendChild(feFunc);
-                ////
-                this.globalData.defs.appendChild(fil);
-                var alphaRect = createNS('rect');
-                alphaRect.setAttribute('width',  this.comp.data.w);
-                alphaRect.setAttribute('height', this.comp.data.h);
-                alphaRect.setAttribute('x','0');
-                alphaRect.setAttribute('y','0');
-                alphaRect.setAttribute('fill','#ffffff');
-                alphaRect.setAttribute('opacity','0');
-                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
-                maskGrouper.appendChild(alphaRect);
-                maskGrouper.appendChild(this.layerElement);
-                layerElementParent = maskGrouper;
-                if (!featureSupport.maskType) {
-                    maskGroup.setAttribute('mask-type', 'luminance');
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    maskGrouper.appendChild(alphaRect);
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    maskGrouper.appendChild(gg);
-                }
-                this.globalData.defs.appendChild(maskGroup);
-            }
-        } else if (this.data.tt) {
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        } else {
-            this.baseElement = this.layerElement;
+                fil.appendChild(feColorMatrix); */
+        /// /
+        var feCTr = createNS('feComponentTransfer');
+        feCTr.setAttribute('in', 'SourceGraphic');
+        fil.appendChild(feCTr);
+        var feFunc = createNS('feFuncA');
+        feFunc.setAttribute('type', 'table');
+        feFunc.setAttribute('tableValues', '1.0 0.0');
+        feCTr.appendChild(feFunc);
+        /// /
+        this.globalData.defs.appendChild(fil);
+        var alphaRect = createNS('rect');
+        alphaRect.setAttribute('width', this.comp.data.w);
+        alphaRect.setAttribute('height', this.comp.data.h);
+        alphaRect.setAttribute('x', '0');
+        alphaRect.setAttribute('y', '0');
+        alphaRect.setAttribute('fill', '#ffffff');
+        alphaRect.setAttribute('opacity', '0');
+        maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        maskGrouper.appendChild(alphaRect);
+        maskGrouper.appendChild(this.layerElement);
+        layerElementParent = maskGrouper;
+        if (!featureSupport.maskType) {
+          maskGroup.setAttribute('mask-type', 'luminance');
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          maskGrouper.appendChild(alphaRect);
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          maskGrouper.appendChild(gg);
         }
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id', this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
-        if (this.data.ty === 0 && !this.data.hd) {
-            var cp = createNS( 'clipPath');
-            var pt = createNS('path');
-            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
-            var clipId = createElementID();
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-
-            if (this.checkMasks()) {
-                var cpGroup = createNS('g');
-                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
-                cpGroup.appendChild(this.layerElement);
-                this.transformedElement = cpGroup;
-                if (layerElementParent) {
-                    layerElementParent.appendChild(this.transformedElement);
-                } else {
-                    this.baseElement = this.transformedElement;
-                }
-            } else {
-                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
-            }
-            
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-
-    },
-    renderElement: function() {
-        if (this.finalTransform._matMdf) {
-            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
-        }
-        if (this.finalTransform._opMdf) {
-            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
-        }
-    },
-    destroyBaseElement: function() {
-        this.layerElement = null;
-        this.matteElement = null;
-        this.maskManager.destroy();
-    },
-    getBaseElement: function() {
-        if (this.data.hd) {
-            return null;
-        }
-        return this.baseElement;
-    },
-    createRenderableComponents: function() {
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-        this.renderableEffectsManager = new SVGEffects(this);
-    },
-    setMatte: function(id) {
-        if (!this.matteElement) {
-            return;
-        }
-        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
+        this.globalData.defs.appendChild(maskGroup);
+      }
+    } else if (this.data.tt) {
+      this.matteElement.appendChild(this.layerElement);
+      layerElementParent = this.matteElement;
+      this.baseElement = this.matteElement;
+    } else {
+      this.baseElement = this.layerElement;
     }
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+    if (this.data.ty === 0 && !this.data.hd) {
+      var cp = createNS('clipPath');
+      var pt = createNS('path');
+      pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+      var clipId = createElementID();
+      cp.setAttribute('id', clipId);
+      cp.appendChild(pt);
+      this.globalData.defs.appendChild(cp);
+
+      if (this.checkMasks()) {
+        var cpGroup = createNS('g');
+        cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+        cpGroup.appendChild(this.layerElement);
+        this.transformedElement = cpGroup;
+        if (layerElementParent) {
+          layerElementParent.appendChild(this.transformedElement);
+        } else {
+          this.baseElement = this.transformedElement;
+        }
+      } else {
+        this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+      }
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    if (this.finalTransform._matMdf) {
+      this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+    }
+    if (this.finalTransform._opMdf) {
+      this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+    }
+  },
+  destroyBaseElement: function () {
+    this.layerElement = null;
+    this.matteElement = null;
+    this.maskManager.destroy();
+  },
+  getBaseElement: function () {
+    if (this.data.hd) {
+      return null;
+    }
+    return this.baseElement;
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+    this.renderableEffectsManager = new SVGEffects(this);
+  },
+  setMatte: function (id) {
+    if (!this.matteElement) {
+      return;
+    }
+    this.matteElement.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+  },
 };
-function IShapeElement(){
+
+/* global ProcessedElement */
+
+function IShapeElement() {
 }
 
 IShapeElement.prototype = {
-    addShapeToModifiers: function(data) {
-        var i, len = this.shapeModifiers.length;
-        for(i=0;i<len;i+=1){
-            this.shapeModifiers[i].addShape(data);
-        }
-    },
-    isShapeInAnimatedModifiers: function(data) {
-        var i = 0, len = this.shapeModifiers.length;
-        while(i < len) {
-            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
-                return true;
-            }
-        }
-        return false;
-    },
-    renderModifiers: function() {
-        if(!this.shapeModifiers.length){
-            return;
-        }
-        var i, len = this.shapes.length;
-        for(i=0;i<len;i+=1){
-            this.shapes[i].sh.reset();
-        }
-
-        len = this.shapeModifiers.length;
-        for(i=len-1;i>=0;i-=1){
-            this.shapeModifiers[i].processShapes(this._isFirstFrame);
-        }
-    },
-    lcEnum: {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'square'
-    },
-    ljEnum: {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    },
-    searchProcessedElement: function(elem){
-        var elements = this.processedElements;
-        var i = 0, len = elements.length;
-        while (i < len) {
-            if (elements[i].elem === elem) {
-                return elements[i].pos;
-            }
-            i += 1;
-        }
-        return 0;
-    },
-    addProcessedElement: function(elem, pos){
-        var elements = this.processedElements;
-        var i = elements.length;
-        while(i) {
-            i -= 1;
-            if (elements[i].elem === elem) {
-                elements[i].pos = pos;
-                return;
-            }
-        }
-        elements.push(new ProcessedElement(elem, pos));
-    },
-    prepareFrame: function(num) {
-        this.prepareRenderableFrame(num);
-        this.prepareProperties(num, this.isInRange);
+  addShapeToModifiers: function (data) {
+    var i;
+    var len = this.shapeModifiers.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapeModifiers[i].addShape(data);
     }
-};
-function ITextElement(){
-}
+  },
+  isShapeInAnimatedModifiers: function (data) {
+    var i = 0;
+    var len = this.shapeModifiers.length;
+    while (i < len) {
+      if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  renderModifiers: function () {
+    if (!this.shapeModifiers.length) {
+      return;
+    }
+    var i;
+    var len = this.shapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].sh.reset();
+    }
 
-ITextElement.prototype.initElement = function(data,globalData,comp){
-    this.lettersChangedFlag = true;
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
-    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
-    this.initRenderable();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    this.createContent();
-    this.hide();
-    this.textAnimator.searchProperties(this.dynamicProperties);
-};
-
-ITextElement.prototype.prepareFrame = function(num) {
-    this._mdf = false;
+    len = this.shapeModifiers.length;
+    for (i = len - 1; i >= 0; i -= 1) {
+      this.shapeModifiers[i].processShapes(this._isFirstFrame);
+    }
+  },
+  lcEnum: {
+    1: 'butt',
+    2: 'round',
+    3: 'square',
+  },
+  ljEnum: {
+    1: 'miter',
+    2: 'round',
+    3: 'bevel',
+  },
+  searchProcessedElement: function (elem) {
+    var elements = this.processedElements;
+    var i = 0;
+    var len = elements.length;
+    while (i < len) {
+      if (elements[i].elem === elem) {
+        return elements[i].pos;
+      }
+      i += 1;
+    }
+    return 0;
+  },
+  addProcessedElement: function (elem, pos) {
+    var elements = this.processedElements;
+    var i = elements.length;
+    while (i) {
+      i -= 1;
+      if (elements[i].elem === elem) {
+        elements[i].pos = pos;
+        return;
+      }
+    }
+    elements.push(new ProcessedElement(elem, pos));
+  },
+  prepareFrame: function (num) {
     this.prepareRenderableFrame(num);
     this.prepareProperties(num, this.isInRange);
-    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
-        this.buildNewText();
-        this.textProperty._isFirstFrame = false;
-        this.textProperty._mdf = false;
-    }
+  },
 };
 
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        pathNodes = shapes[j].ks.k;
-        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
-    }
-    return shapeStr;
+/* global TextProperty, TextAnimatorProperty, buildShapeString, LetterProps */
+
+function ITextElement() {
+}
+
+ITextElement.prototype.initElement = function (data, globalData, comp) {
+  this.lettersChangedFlag = true;
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+  this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
+  this.initRenderable();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  this.createContent();
+  this.hide();
+  this.textAnimator.searchProperties(this.dynamicProperties);
 };
 
-ITextElement.prototype.updateDocumentData = function(newData, index) {
-    this.textProperty.updateDocumentData(newData, index);
+ITextElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
+    this.buildNewText();
+    this.textProperty._isFirstFrame = false;
+    this.textProperty._mdf = false;
+  }
 };
 
-ITextElement.prototype.canResizeFont = function(_canResize) {
-    this.textProperty.canResizeFont(_canResize);
+ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
+  var j;
+  var jLen = shapes.length;
+  var pathNodes;
+  var shapeStr = '';
+  for (j = 0; j < jLen; j += 1) {
+    pathNodes = shapes[j].ks.k;
+    shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
+  }
+  return shapeStr;
 };
 
-ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
-    this.textProperty.setMinimumFontSize(_fontSize);
+ITextElement.prototype.updateDocumentData = function (newData, index) {
+  this.textProperty.updateDocumentData(newData, index);
 };
 
-ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
-    if(documentData.ps){
-        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-    }
-    matrixHelper.translate(0,-documentData.ls,0);
-    switch(documentData.j){
-        case 1:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
-            break;
-        case 2:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
-            break;
-    }
-    matrixHelper.translate(xPos, yPos, 0);
+ITextElement.prototype.canResizeFont = function (_canResize) {
+  this.textProperty.canResizeFont(_canResize);
 };
 
+ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
+  this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-ITextElement.prototype.buildColor = function(colorData) {
-    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
+ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
+  if (documentData.ps) {
+    matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+  }
+  matrixHelper.translate(0, -documentData.ls, 0);
+  switch (documentData.j) {
+    case 1:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
+      break;
+    case 2:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
+      break;
+    default:
+      break;
+  }
+  matrixHelper.translate(xPos, yPos, 0);
+};
+
+ITextElement.prototype.buildColor = function (colorData) {
+  return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
 
-ITextElement.prototype.destroy = function(){
-    
+ITextElement.prototype.destroy = function () {
+
 };
-function ICompElement(){}
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement */
+
+function ICompElement() {}
 
 extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
 
-ICompElement.prototype.initElement = function(data,globalData,comp) {
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.initTransform(data, globalData, comp);
-    this.initRenderable();
-    this.initHierarchy();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-    this.hide();
+ICompElement.prototype.initElement = function (data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initTransform(data, globalData, comp);
+  this.initRenderable();
+  this.initHierarchy();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  if (this.data.xt || !globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+  this.hide();
 };
 
-/*ICompElement.prototype.hide = function(){
+/* ICompElement.prototype.hide = function(){
     if(!this.hidden){
         this.hideElement();
         var i,len = this.elements.length;
@@ -7740,2343 +8169,2507 @@
             }
         }
     }
-};*/
+}; */
 
-ICompElement.prototype.prepareFrame = function(num){
-    this._mdf = false;
-    this.prepareRenderableFrame(num);
-    this.prepareProperties(num, this.isInRange);
-    if(!this.isInRange && !this.data.xt){
-        return;
-    }
+ICompElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (!this.isInRange && !this.data.xt) {
+    return;
+  }
 
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    if (timeRemapped === this.data.op) {
+      timeRemapped = this.data.op - 1;
     }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
+    this.renderedFrame = timeRemapped;
+  } else {
+    this.renderedFrame = num / this.data.sr;
+  }
+  var i;
+  var len = this.elements.length;
+  if (!this.completeLayers) {
+    this.checkLayers(this.renderedFrame);
+  }
+  // This iteration needs to be backwards because of how expressions connect between each other
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+      if (this.elements[i]._mdf) {
+        this._mdf = true;
+      }
     }
-    //This iteration needs to be backwards because of how expressions connect between each other
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-            if(this.elements[i]._mdf) {
-                this._mdf = true;
-            }
-        }
-    }
+  }
 };
 
-ICompElement.prototype.renderInnerContent = function() {
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i += 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+ICompElement.prototype.renderInnerContent = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
+ICompElement.prototype.setElements = function (elems) {
+  this.elements = elems;
 };
 
-ICompElement.prototype.getElements = function(){
-    return this.elements;
+ICompElement.prototype.getElements = function () {
+  return this.elements;
 };
 
-ICompElement.prototype.destroyElements = function(){
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
+ICompElement.prototype.destroyElements = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
+  }
 };
 
-ICompElement.prototype.destroy = function(){
-    this.destroyElements();
-    this.destroyBaseElement();
+ICompElement.prototype.destroy = function () {
+  this.destroyElements();
+  this.destroyBaseElement();
 };
 
-function IImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
-    this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, createNS */
+
+function IImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
+  this.sourceRect = {
+    top: 0, left: 0, width: this.assetData.w, height: this.assetData.h,
+  };
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
 
-IImageElement.prototype.createContent = function(){
+IImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.innerElem = createNS('image');
+  this.innerElem.setAttribute('width', this.assetData.w + 'px');
+  this.innerElem.setAttribute('height', this.assetData.h + 'px');
+  this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
+  this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
 
-    this.innerElem = createNS('image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    
-    this.layerElement.appendChild(this.innerElem);
+  this.layerElement.appendChild(this.innerElem);
 };
 
-IImageElement.prototype.sourceRectAtTime = function() {
-	return this.sourceRect;
-}
-function ISolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
+IImageElement.prototype.sourceRectAtTime = function () {
+  return this.sourceRect;
+};
+
+/* global extendPrototype, IImageElement, createNS */
+
+function ISolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createContent = function(){
-
-    var rect = createNS('rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
+ISolidElement.prototype.createContent = function () {
+  var rect = createNS('rect');
+  /// /rect.style.width = this.data.sw;
+  /// /rect.style.height = this.data.sh;
+  /// /rect.style.fill = this.data.sc;
+  rect.setAttribute('width', this.data.sw);
+  rect.setAttribute('height', this.data.sh);
+  rect.setAttribute('fill', this.data.sc);
+  this.layerElement.appendChild(rect);
 };
-function AudioElement(data,globalData,comp){
-    this.initFrame();
-    this.initRenderable();
-    this.assetData = globalData.getAssetData(data.refId);
-	this.initBaseData(data, globalData, comp);
-	this._isPlaying = false;
-	this._canPlay = false;
-	var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.audio = this.globalData.audioController.createAudio(assetPath);
-    this._currentTime = 0;
-    this.globalData.audioController.addAudio(this);
-    this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate,this) : {_placeholder:true};
+
+/* global PropertyFactory, extendPrototype, RenderableElement, BaseElement, FrameElement */
+
+function AudioElement(data, globalData, comp) {
+  this.initFrame();
+  this.initRenderable();
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initBaseData(data, globalData, comp);
+  this._isPlaying = false;
+  this._canPlay = false;
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.audio = this.globalData.audioController.createAudio(assetPath);
+  this._currentTime = 0;
+  this.globalData.audioController.addAudio(this);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
-AudioElement.prototype.prepareFrame = function(num) {
-    this.prepareRenderableFrame(num, true);
-    this.prepareProperties(num, true);
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        this._currentTime = timeRemapped;
-    } else {
-        this._currentTime = num / this.data.sr;
+AudioElement.prototype.prepareFrame = function (num) {
+  this.prepareRenderableFrame(num, true);
+  this.prepareProperties(num, true);
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    this._currentTime = timeRemapped;
+  } else {
+    this._currentTime = num / this.data.sr;
+  }
+};
+
+extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
+
+AudioElement.prototype.renderFrame = function () {
+  if (this.isInRange && this._canPlay) {
+    if (!this._isPlaying) {
+      this.audio.play();
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
+      this._isPlaying = true;
+    } else if (!this.audio.playing()
+      || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
+    ) {
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
     }
+  }
 };
 
-extendPrototype([RenderableElement,BaseElement,FrameElement], AudioElement);
-
-AudioElement.prototype.renderFrame = function() {
-	if (this.isInRange && this._canPlay) {
-		if (!this._isPlaying) {
-			this.audio.play();
-			this.audio.seek(this._currentTime / this.globalData.frameRate);
-			this._isPlaying = true;
-		} else if (!this.audio.playing()
-			|| Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
-		) {
-			this.audio.seek(this._currentTime / this.globalData.frameRate)
-		}
-	}
+AudioElement.prototype.show = function () {
+  // this.audio.play()
 };
 
-AudioElement.prototype.show = function() {
-	// this.audio.play()
+AudioElement.prototype.hide = function () {
+  this.audio.pause();
+  this._isPlaying = false;
 };
 
-AudioElement.prototype.hide = function() {
-	this.audio.pause();
-	this._isPlaying = false;
+AudioElement.prototype.pause = function () {
+  this.audio.pause();
+  this._isPlaying = false;
+  this._canPlay = false;
 };
 
-AudioElement.prototype.pause = function() {
-	this.audio.pause();
-	this._isPlaying = false;
-	this._canPlay = false;
+AudioElement.prototype.resume = function () {
+  this._canPlay = true;
 };
 
-AudioElement.prototype.resume = function() {
-	this._canPlay = true;
+AudioElement.prototype.setRate = function (rateValue) {
+  this.audio.rate(rateValue);
 };
 
-AudioElement.prototype.setRate = function(rateValue) {
-	this.audio.rate(rateValue);
+AudioElement.prototype.volume = function (volumeValue) {
+  this.audio.volume(volumeValue);
 };
 
-AudioElement.prototype.volume = function(volumeValue) {
-	this.audio.volume(volumeValue);
+AudioElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-AudioElement.prototype.getBaseElement = function() {
-	return null;
+AudioElement.prototype.destroy = function () {
 };
 
-AudioElement.prototype.destroy = function() {
+AudioElement.prototype.sourceRectAtTime = function () {
 };
 
-AudioElement.prototype.sourceRectAtTime = function() {
+AudioElement.prototype.initExpressions = function () {
 };
 
-AudioElement.prototype.initExpressions = function() {
-};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement,
+FrameElement, RenderableDOMElement, Matrix, SVGStyleData, SVGStrokeStyleData, SVGFillStyleData,
+SVGGradientFillStyleData, SVGGradientStrokeStyleData, locationHref, getBlendMode, ShapeGroupData,
+TransformPropertyFactory, SVGTransformData, ShapePropertyFactory, SVGShapeData, SVGElementsRenderer, ShapeModifiers */
 
-
-function SVGShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
+function SVGShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
 
-SVGShapeElement.prototype.initSecondaryElement = function() {
+SVGShapeElement.prototype.initSecondaryElement = function () {
 };
 
 SVGShapeElement.prototype.identityMatrix = new Matrix();
 
-SVGShapeElement.prototype.buildExpressionInterface = function(){};
+SVGShapeElement.prototype.buildExpressionInterface = function () {};
 
-SVGShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
+SVGShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
 };
 
 /*
 This method searches for multiple shapes that affect a single element and one of them is animated
 */
-SVGShapeElement.prototype.filterUniqueShapes = function(){
-    var i, len = this.shapes.length, shape;
-    var j, jLen = this.stylesList.length;
-    var style, count = 0;
-    var tempShapes = [];
-    var areAnimated = false;
-    for(j = 0; j < jLen; j += 1) {
-        style = this.stylesList[j];
-        areAnimated = false;
-        tempShapes.length = 0;
-        for(i = 0; i < len; i += 1) {
-            shape = this.shapes[i];
-            if(shape.styles.indexOf(style) !== -1) {
-                tempShapes.push(shape);
-                areAnimated = shape._isAnimated || areAnimated;
-            }
-        }
-        if(tempShapes.length > 1 && areAnimated) {
-            this.setShapesAsAnimated(tempShapes);
-        }
-    }
-}
-
-SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
-    var i, len = shapes.length;
-    for(i = 0; i < len; i += 1) {
-        shapes[i].setAsAnimated();
-    }
-}
-
-SVGShapeElement.prototype.createStyleElement = function(data, level){
-    //TODO: prevent drawing of hidden styles
-    var elementData;
-    var styleOb = new SVGStyleData(data, level);
-
-    var pathElement = styleOb.pElem;
-    if(data.ty === 'st') {
-        elementData = new SVGStrokeStyleData(this, data, styleOb);
-    } else if(data.ty === 'fl') {
-        elementData = new SVGFillStyleData(this, data, styleOb);
-    } else if(data.ty === 'gf' || data.ty === 'gs') {
-        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
-        elementData = new gradientConstructor(this, data, styleOb);
-        this.globalData.defs.appendChild(elementData.gf);
-        if (elementData.maskId) {
-            this.globalData.defs.appendChild(elementData.ms);
-            this.globalData.defs.appendChild(elementData.of);
-            pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
-        }
-    }
-    
-    if(data.ty === 'st' || data.ty === 'gs') {
-        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
-        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
-        pathElement.setAttribute('fill-opacity','0');
-        if(data.lj === 1) {
-            pathElement.setAttribute('stroke-miterlimit',data.ml);
-        }
-    }
-
-    if(data.r === 2) {
-        pathElement.setAttribute('fill-rule', 'evenodd');
-    }
-
-    if(data.ln){
-        pathElement.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        pathElement.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    this.stylesList.push(styleOb);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = new ShapeGroupData();
-    if(data.ln){
-        elementData.gr.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        elementData.gr.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    return elementData;
-};
-
-SVGShapeElement.prototype.createTransformElement = function(data, container) {
-    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
-    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
-    var ty = 4;
-    if(data.ty === 'rc'){
-        ty = 5;
-    }else if(data.ty === 'el'){
-        ty = 6;
-    }else if(data.ty === 'sr'){
-        ty = 7;
-    }
-    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
-    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
-    var i = 0, len = this.animatedContents.length;
-    while(i < len) {
-        if(this.animatedContents[i].element === element) {
-            return;
-        }
-        i += 1;
-    }
-    this.animatedContents.push({
-        fn: SVGElementsRenderer.createRenderFunction(data),
-        element: element,
-        data: data
-    });
-};
-
-SVGShapeElement.prototype.setElementStyles = function(elementData){
-    var arr = elementData.styles;
-    var j, jLen = this.stylesList.length;
-    for (j = 0; j < jLen; j += 1) {
-        if (!this.stylesList[j].closed) {
-            arr.push(this.stylesList[j]);
-        }
-    }
-};
-
-SVGShapeElement.prototype.reloadShapes = function(){
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for( i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
-    len = this.dynamicProperties.length;
-    for(i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-};
-
-SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._render = render;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], level);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].style.pElem);
-            }
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].gr);
-            }
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                itemsData[i] = this.createTransformElement(arr[i], container);
-            }
-            currentTransform = itemsData[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
-            }
-            this.setElementStyles(itemsData[i]);
-
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        }else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                render = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    len = ownStyles.length;
-    for(i=0;i<len;i+=1){
-        ownStyles[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-SVGShapeElement.prototype.renderInnerContent = function() {
-    this.renderModifiers();
-    var i, len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        this.stylesList[i].reset();
-    }
-    this.renderShape();
-
+SVGShapeElement.prototype.filterUniqueShapes = function () {
+  var i;
+  var len = this.shapes.length;
+  var shape;
+  var j;
+  var jLen = this.stylesList.length;
+  var style;
+  var tempShapes = [];
+  var areAnimated = false;
+  for (j = 0; j < jLen; j += 1) {
+    style = this.stylesList[j];
+    areAnimated = false;
+    tempShapes.length = 0;
     for (i = 0; i < len; i += 1) {
-        if (this.stylesList[i]._mdf || this._isFirstFrame) {
-            if(this.stylesList[i].msElem){
-                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                //Adding M0 0 fixes same mask bug on all browsers
-                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
-            }
-            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
-        }
+      shape = this.shapes[i];
+      if (shape.styles.indexOf(style) !== -1) {
+        tempShapes.push(shape);
+        areAnimated = shape._isAnimated || areAnimated;
+      }
     }
+    if (tempShapes.length > 1 && areAnimated) {
+      this.setShapesAsAnimated(tempShapes);
+    }
+  }
 };
 
-SVGShapeElement.prototype.renderShape = function() {
-    var i, len = this.animatedContents.length;
-    var animatedContent;
-    for(i = 0; i < len; i += 1) {
-        animatedContent = this.animatedContents[i];
-        if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
-            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
-        }
-    }
-}
-
-SVGShapeElement.prototype.destroy = function(){
-    this.destroyBaseElement();
-    this.shapesData = null;
-    this.itemsData = null;
+SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
+  var i;
+  var len = shapes.length;
+  for (i = 0; i < len; i += 1) {
+    shapes[i].setAsAnimated();
+  }
 };
 
+SVGShapeElement.prototype.createStyleElement = function (data, level) {
+  // TODO: prevent drawing of hidden styles
+  var elementData;
+  var styleOb = new SVGStyleData(data, level);
+
+  var pathElement = styleOb.pElem;
+  if (data.ty === 'st') {
+    elementData = new SVGStrokeStyleData(this, data, styleOb);
+  } else if (data.ty === 'fl') {
+    elementData = new SVGFillStyleData(this, data, styleOb);
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+    elementData = new GradientConstructor(this, data, styleOb);
+    this.globalData.defs.appendChild(elementData.gf);
+    if (elementData.maskId) {
+      this.globalData.defs.appendChild(elementData.ms);
+      this.globalData.defs.appendChild(elementData.of);
+      pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
+    }
+  }
+
+  if (data.ty === 'st' || data.ty === 'gs') {
+    pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+    pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
+    pathElement.setAttribute('fill-opacity', '0');
+    if (data.lj === 1) {
+      pathElement.setAttribute('stroke-miterlimit', data.ml);
+    }
+  }
+
+  if (data.r === 2) {
+    pathElement.setAttribute('fill-rule', 'evenodd');
+  }
+
+  if (data.ln) {
+    pathElement.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    pathElement.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  this.stylesList.push(styleOb);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.createGroupElement = function (data) {
+  var elementData = new ShapeGroupData();
+  if (data.ln) {
+    elementData.gr.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    elementData.gr.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  return elementData;
+};
+
+SVGShapeElement.prototype.createTransformElement = function (data, container) {
+  var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
+  var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
+  var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
+  var i = 0;
+  var len = this.animatedContents.length;
+  while (i < len) {
+    if (this.animatedContents[i].element === element) {
+      return;
+    }
+    i += 1;
+  }
+  this.animatedContents.push({
+    fn: SVGElementsRenderer.createRenderFunction(data),
+    element: element,
+    data: data,
+  });
+};
+
+SVGShapeElement.prototype.setElementStyles = function (elementData) {
+  var arr = elementData.styles;
+  var j;
+  var jLen = this.stylesList.length;
+  for (j = 0; j < jLen; j += 1) {
+    if (!this.stylesList[j].closed) {
+      arr.push(this.stylesList[j]);
+    }
+  }
+};
+
+SVGShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
+  var ownTransformers = [].concat(transformers);
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var currentTransform;
+  var modifier;
+  var processedPos;
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._render = render;
+    } else {
+      itemsData[i] = prevViewData[processedPos - 1];
+    }
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], level);
+      } else {
+        itemsData[i].style.closed = false;
+      }
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].style.pElem);
+      }
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
+        for (j = 0; j < jLen; j += 1) {
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
+        }
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].gr);
+      }
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        itemsData[i] = this.createTransformElement(arr[i], container);
+      }
+      currentTransform = itemsData[i].transform;
+      ownTransformers.push(currentTransform);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+      }
+      this.setElementStyles(itemsData[i]);
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        render = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
+    }
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  len = ownStyles.length;
+  for (i = 0; i < len; i += 1) {
+    ownStyles[i].closed = true;
+  }
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
+};
+
+SVGShapeElement.prototype.renderInnerContent = function () {
+  this.renderModifiers();
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    this.stylesList[i].reset();
+  }
+  this.renderShape();
+
+  for (i = 0; i < len; i += 1) {
+    if (this.stylesList[i]._mdf || this._isFirstFrame) {
+      if (this.stylesList[i].msElem) {
+        this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+        // Adding M0 0 fixes same mask bug on all browsers
+        this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+      }
+      this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
+    }
+  }
+};
+
+SVGShapeElement.prototype.renderShape = function () {
+  var i;
+  var len = this.animatedContents.length;
+  var animatedContent;
+  for (i = 0; i < len; i += 1) {
+    animatedContent = this.animatedContents[i];
+    if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
+      animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
+    }
+  }
+};
+
+SVGShapeElement.prototype.destroy = function () {
+  this.destroyBaseElement();
+  this.shapesData = null;
+  this.itemsData = null;
+};
+
+/* global Matrix, createTypedArray */
+
 function CVContextData() {
-	this.saved = [];
-    this.cArrPos = 0;
-    this.cTr = new Matrix();
-    this.cO = 1;
-    var i, len = 15;
-    this.savedOp = createTypedArray('float32', len);
-    for(i=0;i<len;i+=1){
-        this.saved[i] = createTypedArray('float32', 16);
-    }
-    this._length = len;
+  this.saved = [];
+  this.cArrPos = 0;
+  this.cTr = new Matrix();
+  this.cO = 1;
+  var i;
+  var len = 15;
+  this.savedOp = createTypedArray('float32', len);
+  for (i = 0; i < len; i += 1) {
+    this.saved[i] = createTypedArray('float32', 16);
+  }
+  this._length = len;
 }
 
-CVContextData.prototype.duplicate = function() {
-	var newLength = this._length * 2;
-	var currentSavedOp = this.savedOp;
-    this.savedOp = createTypedArray('float32', newLength);
-    this.savedOp.set(currentSavedOp);
-    var i = 0;
-    for(i = this._length; i < newLength; i += 1) {
-        this.saved[i] = createTypedArray('float32', 16);
-    }
-    this._length = newLength;
+CVContextData.prototype.duplicate = function () {
+  var newLength = this._length * 2;
+  var currentSavedOp = this.savedOp;
+  this.savedOp = createTypedArray('float32', newLength);
+  this.savedOp.set(currentSavedOp);
+  var i = 0;
+  for (i = this._length; i < newLength; i += 1) {
+    this.saved[i] = createTypedArray('float32', 16);
+  }
+  this._length = newLength;
 };
 
-CVContextData.prototype.reset = function() {
-	this.cArrPos = 0;
-	this.cTr.reset();
-    this.cO = 1;
+CVContextData.prototype.reset = function () {
+  this.cArrPos = 0;
+  this.cTr.reset();
+  this.cO = 1;
 };
-function CVBaseElement(){
+
+/* global CVEffects, getBlendMode, CVMaskElement, Matrix */
+
+function CVBaseElement() {
 }
 
 CVBaseElement.prototype = {
-    createElements: function(){},
-    initRendererElement: function(){},
-    createContainerElements: function(){
-        this.canvasContext = this.globalData.canvasContext;
-        this.renderableEffectsManager = new CVEffects(this);
-    },
-    createContent: function(){},
-    setBlendMode: function(){
-        var globalData = this.globalData;
-        if(globalData.blendMode !== this.data.bm) {
-            globalData.blendMode = this.data.bm;
-            var blendModeValue = getBlendMode(this.data.bm);
-            globalData.canvasContext.globalCompositeOperation = blendModeValue;
-        }
-    },
-    createRenderableComponents: function(){
-        this.maskManager = new CVMaskElement(this.data, this);
-    },
-    hideElement: function(){
-        if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-            this.hidden = true;
-        }
-    },
-    showElement: function(){
-        if (this.isInRange && !this.isTransparent){
-            this.hidden = false;
-            this._isFirstFrame = true;
-            this.maskManager._isFirstFrame = true;
-        }
-    },
-    renderFrame: function() {
-        if (this.hidden || this.data.hd) {
-            return;
-        }
-        this.renderTransform();
-        this.renderRenderable();
-        this.setBlendMode();
-        var forceRealStack = this.data.ty === 0;
-        this.globalData.renderer.save(forceRealStack);
-        this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
-        this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
-        this.renderInnerContent();
-        this.globalData.renderer.restore(forceRealStack);
-        if(this.maskManager.hasMasks) {
-            this.globalData.renderer.restore(true);
-        }
-        if (this._isFirstFrame) {
-            this._isFirstFrame = false;
-        }
-    },
-    destroy: function(){
-        this.canvasContext = null;
-        this.data = null;
-        this.globalData = null;
-        this.maskManager.destroy();
-    },
-    mHelper: new Matrix()
+  createElements: function () {},
+  initRendererElement: function () {},
+  createContainerElements: function () {
+    this.canvasContext = this.globalData.canvasContext;
+    this.renderableEffectsManager = new CVEffects(this);
+  },
+  createContent: function () {},
+  setBlendMode: function () {
+    var globalData = this.globalData;
+    if (globalData.blendMode !== this.data.bm) {
+      globalData.blendMode = this.data.bm;
+      var blendModeValue = getBlendMode(this.data.bm);
+      globalData.canvasContext.globalCompositeOperation = blendModeValue;
+    }
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new CVMaskElement(this.data, this);
+  },
+  hideElement: function () {
+    if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+      this.hidden = true;
+    }
+  },
+  showElement: function () {
+    if (this.isInRange && !this.isTransparent) {
+      this.hidden = false;
+      this._isFirstFrame = true;
+      this.maskManager._isFirstFrame = true;
+    }
+  },
+  renderFrame: function () {
+    if (this.hidden || this.data.hd) {
+      return;
+    }
+    this.renderTransform();
+    this.renderRenderable();
+    this.setBlendMode();
+    var forceRealStack = this.data.ty === 0;
+    this.globalData.renderer.save(forceRealStack);
+    this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
+    this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
+    this.renderInnerContent();
+    this.globalData.renderer.restore(forceRealStack);
+    if (this.maskManager.hasMasks) {
+      this.globalData.renderer.restore(true);
+    }
+    if (this._isFirstFrame) {
+      this._isFirstFrame = false;
+    }
+  },
+  destroy: function () {
+    this.canvasContext = null;
+    this.data = null;
+    this.globalData = null;
+    this.maskManager.destroy();
+  },
+  mHelper: new Matrix(),
 };
 CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;
 CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;
 
+/* global createSizedArray, PropertyFactory, extendPrototype, CanvasRenderer, ICompElement, CVBaseElement */
+
 function CVCompElement(data, globalData, comp) {
-    this.completeLayers = false;
-    this.layers = data.layers;
-    this.pendingElements = [];
-    this.elements = createSizedArray(this.layers.length);
-    this.initElement(data, globalData, comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate, this) : {_placeholder:true};
+  this.completeLayers = false;
+  this.layers = data.layers;
+  this.pendingElements = [];
+  this.elements = createSizedArray(this.layers.length);
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([CanvasRenderer, ICompElement, CVBaseElement], CVCompElement);
 
-CVCompElement.prototype.renderInnerContent = function() {
-    var ctx = this.canvasContext;
-    ctx.beginPath();
-    ctx.moveTo(0, 0);
-    ctx.lineTo(this.data.w, 0);
-    ctx.lineTo(this.data.w, this.data.h);
-    ctx.lineTo(0, this.data.h);
-    ctx.lineTo(0, 0);
-    ctx.clip();
-    var i,len = this.layers.length;
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+CVCompElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.beginPath();
+  ctx.moveTo(0, 0);
+  ctx.lineTo(this.data.w, 0);
+  ctx.lineTo(this.data.w, this.data.h);
+  ctx.lineTo(0, this.data.h);
+  ctx.lineTo(0, 0);
+  ctx.clip();
+  var i;
+  var len = this.layers.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-CVCompElement.prototype.destroy = function(){
-    var i,len = this.layers.length;
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.elements[i]) {
-            this.elements[i].destroy();
-        }
+CVCompElement.prototype.destroy = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layers = null;
-    this.elements = null;
+  }
+  this.layers = null;
+  this.elements = null;
 };
 
-function CVMaskElement(data,element){
-    this.data = data;
-    this.element = element;
-    this.masksProperties = this.data.masksProperties || [];
-    this.viewData = createSizedArray(this.masksProperties.length);
-    var i, len = this.masksProperties.length, hasMasks = false;
-    for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode !== 'n'){
-            hasMasks = true;
-        }
-        this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);
+/* global createSizedArray, ShapePropertyFactory, MaskElement */
+
+function CVMaskElement(data, element) {
+  this.data = data;
+  this.element = element;
+  this.masksProperties = this.data.masksProperties || [];
+  this.viewData = createSizedArray(this.masksProperties.length);
+  var i;
+  var len = this.masksProperties.length;
+  var hasMasks = false;
+  for (i = 0; i < len; i += 1) {
+    if (this.masksProperties[i].mode !== 'n') {
+      hasMasks = true;
     }
-    this.hasMasks = hasMasks;
-    if(hasMasks) {
-        this.element.addRenderableComponent(this);
-    }
+    this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[i], 3);
+  }
+  this.hasMasks = hasMasks;
+  if (hasMasks) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
 CVMaskElement.prototype.renderFrame = function () {
-    if(!this.hasMasks){
-        return;
+  if (!this.hasMasks) {
+    return;
+  }
+  var transform = this.element.finalTransform.mat;
+  var ctx = this.element.canvasContext;
+  var i;
+  var len = this.masksProperties.length;
+  var pt;
+  var pts;
+  var data;
+  ctx.beginPath();
+  for (i = 0; i < len; i += 1) {
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.masksProperties[i].inv) {
+        ctx.moveTo(0, 0);
+        ctx.lineTo(this.element.globalData.compSize.w, 0);
+        ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
+        ctx.lineTo(0, this.element.globalData.compSize.h);
+        ctx.lineTo(0, 0);
+      }
+      data = this.viewData[i].v;
+      pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0);
+      ctx.moveTo(pt[0], pt[1]);
+      var j;
+      var jLen = data._length;
+      for (j = 1; j < jLen; j += 1) {
+        pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
+        ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
+      }
+      pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
+      ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
     }
-    var transform = this.element.finalTransform.mat;
-    var ctx = this.element.canvasContext;
-    var i, len = this.masksProperties.length;
-    var pt,pts,data;
-    ctx.beginPath();
-    for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode !== 'n'){
-            if (this.masksProperties[i].inv) {
-                ctx.moveTo(0, 0);
-                ctx.lineTo(this.element.globalData.compSize.w, 0);
-                ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
-                ctx.lineTo(0, this.element.globalData.compSize.h);
-                ctx.lineTo(0, 0);
-            }
-            data = this.viewData[i].v;
-            pt = transform.applyToPointArray(data.v[0][0],data.v[0][1],0);
-            ctx.moveTo(pt[0], pt[1]);
-            var j, jLen = data._length;
-            for (j = 1; j < jLen; j++) {
-                pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
-                ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
-            }
-            pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
-            ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
-        }
-    }
-    this.element.globalData.renderer.save(true);
-    ctx.clip();
+  }
+  this.element.globalData.renderer.save(true);
+  ctx.clip();
 };
 
 CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;
 
-CVMaskElement.prototype.destroy = function(){
-    this.element = null;
+CVMaskElement.prototype.destroy = function () {
+  this.element = null;
 };
+
+/* global ShapeTransformManager, extendPrototype, BaseElement, TransformElement, CVBaseElement, IShapeElement,
+HierarchyElement, FrameElement, RenderableElement, RenderableDOMElement, PropertyFactory, degToRads, GradientProperty,
+DashProperty, TransformPropertyFactory, CVShapeData, ShapeModifiers, bmFloor */
+
 function CVShapeElement(data, globalData, comp) {
-    this.shapes = [];
-    this.shapesData = data.shapes;
-    this.stylesList = [];
-    this.itemsData = [];
-    this.prevViewData = [];
-    this.shapeModifiers = [];
-    this.processedElements = [];
-    this.transformsManager = new ShapeTransformManager();
-    this.initElement(data, globalData, comp);
+  this.shapes = [];
+  this.shapesData = data.shapes;
+  this.stylesList = [];
+  this.itemsData = [];
+  this.prevViewData = [];
+  this.shapeModifiers = [];
+  this.processedElements = [];
+  this.transformsManager = new ShapeTransformManager();
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement], CVShapeElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement);
 
 CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;
 
-CVShapeElement.prototype.transformHelper = {opacity:1,_opMdf:false};
+CVShapeElement.prototype.transformHelper = { opacity: 1, _opMdf: false };
 
 CVShapeElement.prototype.dashResetter = [];
 
-CVShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
+CVShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
 };
 
-CVShapeElement.prototype.createStyleElement = function(data, transforms) {
-    var styleElem = {
-        data: data,
-        type: data.ty,
-        preTransforms: this.transformsManager.addTransformSequence(transforms),
-        transforms: [],
-        elements: [],
-        closed: data.hd === true
-    };
-    var elementData = {};
-    if(data.ty == 'fl' || data.ty == 'st'){
-        elementData.c = PropertyFactory.getProp(this,data.c,1,255,this);
-        if(!elementData.c.k){
-            styleElem.co = 'rgb('+bm_floor(elementData.c.v[0])+','+bm_floor(elementData.c.v[1])+','+bm_floor(elementData.c.v[2])+')';
-        }
-    } else if (data.ty === 'gf' || data.ty === 'gs') {
-        elementData.s = PropertyFactory.getProp(this,data.s,1,null,this);
-        elementData.e = PropertyFactory.getProp(this,data.e,1,null,this);
-        elementData.h = PropertyFactory.getProp(this,data.h||{k:0},0,0.01,this);
-        elementData.a = PropertyFactory.getProp(this,data.a||{k:0},0,degToRads,this);
-        elementData.g = new GradientProperty(this,data.g,this);
+CVShapeElement.prototype.createStyleElement = function (data, transforms) {
+  var styleElem = {
+    data: data,
+    type: data.ty,
+    preTransforms: this.transformsManager.addTransformSequence(transforms),
+    transforms: [],
+    elements: [],
+    closed: data.hd === true,
+  };
+  var elementData = {};
+  if (data.ty === 'fl' || data.ty === 'st') {
+    elementData.c = PropertyFactory.getProp(this, data.c, 1, 255, this);
+    if (!elementData.c.k) {
+      styleElem.co = 'rgb(' + bmFloor(elementData.c.v[0]) + ',' + bmFloor(elementData.c.v[1]) + ',' + bmFloor(elementData.c.v[2]) + ')';
     }
-    elementData.o = PropertyFactory.getProp(this,data.o,0,0.01,this);
-    if(data.ty == 'st' || data.ty == 'gs') {
-        styleElem.lc = this.lcEnum[data.lc] || 'round';
-        styleElem.lj = this.ljEnum[data.lj] || 'round';
-        if(data.lj == 1) {
-            styleElem.ml = data.ml;
-        }
-        elementData.w = PropertyFactory.getProp(this,data.w,0,null,this);
-        if(!elementData.w.k){
-            styleElem.wi = elementData.w.v;
-        }
-        if(data.d){
-            var d = new DashProperty(this,data.d,'canvas', this);
-            elementData.d = d;
-            if(!elementData.d.k){
-                styleElem.da = elementData.d.dashArray;
-                styleElem.do = elementData.d.dashoffset[0];
-            }
-        }
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    elementData.s = PropertyFactory.getProp(this, data.s, 1, null, this);
+    elementData.e = PropertyFactory.getProp(this, data.e, 1, null, this);
+    elementData.h = PropertyFactory.getProp(this, data.h || { k: 0 }, 0, 0.01, this);
+    elementData.a = PropertyFactory.getProp(this, data.a || { k: 0 }, 0, degToRads, this);
+    elementData.g = new GradientProperty(this, data.g, this);
+  }
+  elementData.o = PropertyFactory.getProp(this, data.o, 0, 0.01, this);
+  if (data.ty === 'st' || data.ty === 'gs') {
+    styleElem.lc = this.lcEnum[data.lc] || 'round';
+    styleElem.lj = this.ljEnum[data.lj] || 'round';
+    if (data.lj == 1) { // eslint-disable-line eqeqeq
+      styleElem.ml = data.ml;
+    }
+    elementData.w = PropertyFactory.getProp(this, data.w, 0, null, this);
+    if (!elementData.w.k) {
+      styleElem.wi = elementData.w.v;
+    }
+    if (data.d) {
+      var d = new DashProperty(this, data.d, 'canvas', this);
+      elementData.d = d;
+      if (!elementData.d.k) {
+        styleElem.da = elementData.d.dashArray;
+        styleElem.do = elementData.d.dashoffset[0];
+      }
+    }
+  } else {
+    styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+  }
+  this.stylesList.push(styleElem);
+  elementData.style = styleElem;
+  return elementData;
+};
+
+CVShapeElement.prototype.createGroupElement = function () {
+  var elementData = {
+    it: [],
+    prevViewData: [],
+  };
+  return elementData;
+};
+
+CVShapeElement.prototype.createTransformElement = function (data) {
+  var elementData = {
+    transform: {
+      opacity: 1,
+      _opMdf: false,
+      key: this.transformsManager.getNewKey(),
+      op: PropertyFactory.getProp(this, data.o, 0, 0.01, this),
+      mProps: TransformPropertyFactory.getTransformProperty(this, data, this),
+    },
+  };
+  return elementData;
+};
+
+CVShapeElement.prototype.createShapeElement = function (data) {
+  var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
+
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  return elementData;
+};
+
+CVShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+  this.transformsManager.processSequences(this._isFirstFrame);
+};
+
+CVShapeElement.prototype.addTransformToStyleList = function (transform) {
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    if (!this.stylesList[i].closed) {
+      this.stylesList[i].transforms.push(transform);
+    }
+  }
+};
+
+CVShapeElement.prototype.removeTransformFromStyleList = function () {
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    if (!this.stylesList[i].closed) {
+      this.stylesList[i].transforms.pop();
+    }
+  }
+};
+
+CVShapeElement.prototype.closeStyles = function (styles) {
+  var i;
+  var len = styles.length;
+  for (i = 0; i < len; i += 1) {
+    styles[i].closed = true;
+  }
+};
+
+CVShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, shouldRender, transforms) {
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var processedPos;
+  var modifier;
+  var currentTransform;
+  var ownTransforms = [].concat(transforms);
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._shouldRender = shouldRender;
     } else {
-        styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    this.stylesList.push(styleElem);
-    elementData.style = styleElem;
-    return elementData;
-};
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
+      } else {
+        itemsData[i].style.closed = false;
+      }
 
-CVShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = {
-        it: [],
-        prevViewData: []
-    };
-    return elementData;
-};
-
-CVShapeElement.prototype.createTransformElement = function(data) {
-    var elementData = {
-        transform : {
-            opacity: 1,
-            _opMdf:false,
-            key: this.transformsManager.getNewKey(),
-            op: PropertyFactory.getProp(this,data.o,0,0.01,this),
-            mProps: TransformPropertyFactory.getTransformProperty(this,data,this)
-        }
-    };
-    return elementData;
-};
-
-CVShapeElement.prototype.createShapeElement = function(data) {
-    var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
-    
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    return elementData;
-};
-
-CVShapeElement.prototype.reloadShapes = function() {
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for (i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
-    len = this.dynamicProperties.length;
-    for (i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-    this.transformsManager.processSequences(this._isFirstFrame);
-};
-
-CVShapeElement.prototype.addTransformToStyleList = function(transform) {
-    var i, len = this.stylesList.length;
-    for (i = 0; i < len; i += 1) {
-        if(!this.stylesList[i].closed) {
-            this.stylesList[i].transforms.push(transform);
-        }
-    }
-}
-
-CVShapeElement.prototype.removeTransformFromStyleList = function() {
-    var i, len = this.stylesList.length;
-    for (i = 0; i < len; i += 1) {
-        if(!this.stylesList[i].closed) {
-            this.stylesList[i].transforms.pop();
-        }
-    }
-}
-
-CVShapeElement.prototype.closeStyles = function(styles) {
-    var i, len = styles.length, j, jLen;
-    for (i = 0; i < len; i += 1) {
-        styles[i].closed = true;
-    }
-}
-
-CVShapeElement.prototype.searchShapes = function(arr,itemsData, prevViewData, shouldRender, transforms){
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], processedPos, modifier, currentTransform;
-    var ownTransforms = [].concat(transforms);
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._shouldRender = shouldRender;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st'|| arr[i].ty == 'gf'|| arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData, shouldRender, ownTransforms);
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                currentTransform = this.createTransformElement(arr[i]);
-                itemsData[i] = currentTransform;
-            }
-            ownTransforms.push(itemsData[i]);
-            this.addTransformToStyleList(itemsData[i]);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i]);
-            }
-            
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        } else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                shouldRender = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    this.removeTransformFromStyleList();
-    this.closeStyles(ownStyles);
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-CVShapeElement.prototype.renderInnerContent = function() {
-    this.transformHelper.opacity = 1;
-    this.transformHelper._opMdf = false;
-    this.renderModifiers();
-    this.transformsManager.processSequences(this._isFirstFrame);
-    this.renderShape(this.transformHelper,this.shapesData,this.itemsData,true);
-};
-
-CVShapeElement.prototype.renderShapeTransform = function(parentTransform, groupTransform) {
-    var props, groupMatrix;
-    if(parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
-        groupTransform.opacity = parentTransform.opacity;
-        groupTransform.opacity *= groupTransform.op.v;
-        groupTransform._opMdf = true;
-    }
-};
-
-CVShapeElement.prototype.drawLayer = function() {
-    var i, len = this.stylesList.length;
-    var j, jLen, k, kLen,elems,nodes, renderer = this.globalData.renderer, ctx = this.globalData.canvasContext, type, currentStyle;
-    for(i=0;i<len;i+=1){
-        currentStyle = this.stylesList[i];
-        type = currentStyle.type;
-
-        //Skipping style when
-        //Stroke width equals 0
-        //style should not be rendered (extra unused repeaters)
-        //current opacity equals 0
-        //global opacity equals 0
-        if(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0){
-            continue;
-        }
-        renderer.save();
-        elems = currentStyle.elements;
-        if(type === 'st' || type === 'gs'){
-            ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
-            ctx.lineWidth = currentStyle.wi;
-            ctx.lineCap = currentStyle.lc;
-            ctx.lineJoin = currentStyle.lj;
-            ctx.miterLimit = currentStyle.ml || 0;
-        } else {
-            ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
-        }
-        renderer.ctxOpacity(currentStyle.coOp);
-        if(type !== 'st' && type !== 'gs'){
-            ctx.beginPath();
-        }
-        renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
-        jLen = elems.length;
-        for(j=0;j<jLen;j+=1){
-            if(type === 'st' || type === 'gs'){
-                ctx.beginPath();
-                if(currentStyle.da){
-                    ctx.setLineDash(currentStyle.da);
-                    ctx.lineDashOffset = currentStyle.do;
-                }
-            }
-            nodes = elems[j].trNodes;
-            kLen = nodes.length;
-
-            for(k=0;k<kLen;k+=1){
-                if(nodes[k].t == 'm'){
-                    ctx.moveTo(nodes[k].p[0],nodes[k].p[1]);
-                }else if(nodes[k].t == 'c'){
-                    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]);
-                }else{
-                    ctx.closePath();
-                }
-            }
-            if(type === 'st' || type === 'gs'){
-                ctx.stroke();
-                if(currentStyle.da){
-                    ctx.setLineDash(this.dashResetter);
-                }
-            }
-        }
-        if(type !== 'st' && type !== 'gs'){
-            ctx.fill(currentStyle.r);
-        }
-        renderer.restore();
-    }
-};
-
-CVShapeElement.prototype.renderShape = function(parentTransform,items,data,isMain){
-    var i, len = items.length - 1;
-    var groupTransform;
-    groupTransform = parentTransform;
-    for(i=len;i>=0;i-=1){
-        if(items[i].ty == 'tr'){
-            groupTransform = data[i].transform;
-            this.renderShapeTransform(parentTransform, groupTransform);
-        }else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc' || items[i].ty == 'sr'){
-            this.renderPath(items[i],data[i]);
-        }else if(items[i].ty == 'fl'){
-            this.renderFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'st'){
-            this.renderStroke(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gf' || items[i].ty == 'gs'){
-            this.renderGradientFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gr'){
-            this.renderShape(groupTransform,items[i].it,data[i].it);
-        }else if(items[i].ty == 'tm'){
-            //
-        }
-    }
-    if(isMain){
-        this.drawLayer();
-    }
-    
-};
-
-CVShapeElement.prototype.renderStyledShape = function(styledShape, shape){
-    if(this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
-        var shapeNodes = styledShape.trNodes;
-        var paths = shape.paths;
-        var i, len, j, jLen = paths._length;
-        shapeNodes.length = 0;
-        var groupTransformMat = styledShape.transforms.finalTransform;
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
         for (j = 0; j < jLen; j += 1) {
-            var pathNodes = paths.shapes[j];
-            if(pathNodes && pathNodes.v){
-                len = pathNodes._length;
-                for (i = 1; i < len; i += 1) {
-                    if (i === 1) {
-                        shapeNodes.push({
-                            t: 'm',
-                            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
-                        });
-                    }
-                    shapeNodes.push({
-                        t: 'c',
-                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])
-                    });
-                }
-                if (len === 1) {
-                    shapeNodes.push({
-                        t: 'm',
-                        p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
-                    });
-                }
-                if (pathNodes.c && len) {
-                    shapeNodes.push({
-                        t: 'c',
-                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])
-                    });
-                    shapeNodes.push({
-                        t: 'z'
-                    });
-                }
-            }
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        styledShape.trNodes = shapeNodes;
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, shouldRender, ownTransforms);
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        currentTransform = this.createTransformElement(arr[i]);
+        itemsData[i] = currentTransform;
+      }
+      ownTransforms.push(itemsData[i]);
+      this.addTransformToStyleList(itemsData[i]);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i]);
+      }
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        shouldRender = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-}
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  this.removeTransformFromStyleList();
+  this.closeStyles(ownStyles);
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
+};
 
-CVShapeElement.prototype.renderPath = function(pathData,itemData){
-    if(pathData.hd !== true && pathData._shouldRender) {
-        var i, len = itemData.styledShapes.length;
-        for (i = 0; i < len; i += 1) {
-            this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
+CVShapeElement.prototype.renderInnerContent = function () {
+  this.transformHelper.opacity = 1;
+  this.transformHelper._opMdf = false;
+  this.renderModifiers();
+  this.transformsManager.processSequences(this._isFirstFrame);
+  this.renderShape(this.transformHelper, this.shapesData, this.itemsData, true);
+};
+
+CVShapeElement.prototype.renderShapeTransform = function (parentTransform, groupTransform) {
+  if (parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
+    groupTransform.opacity = parentTransform.opacity;
+    groupTransform.opacity *= groupTransform.op.v;
+    groupTransform._opMdf = true;
+  }
+};
+
+CVShapeElement.prototype.drawLayer = function () {
+  var i;
+  var len = this.stylesList.length;
+  var j;
+  var jLen;
+  var k;
+  var kLen;
+  var elems;
+  var nodes;
+  var renderer = this.globalData.renderer;
+  var ctx = this.globalData.canvasContext;
+  var type;
+  var currentStyle;
+  for (i = 0; i < len; i += 1) {
+    currentStyle = this.stylesList[i];
+    type = currentStyle.type;
+
+    // Skipping style when
+    // Stroke width equals 0
+    // style should not be rendered (extra unused repeaters)
+    // current opacity equals 0
+    // global opacity equals 0
+    if (!(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0)) {
+      renderer.save();
+      elems = currentStyle.elements;
+      if (type === 'st' || type === 'gs') {
+        ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
+        ctx.lineWidth = currentStyle.wi;
+        ctx.lineCap = currentStyle.lc;
+        ctx.lineJoin = currentStyle.lj;
+        ctx.miterLimit = currentStyle.ml || 0;
+      } else {
+        ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
+      }
+      renderer.ctxOpacity(currentStyle.coOp);
+      if (type !== 'st' && type !== 'gs') {
+        ctx.beginPath();
+      }
+      renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
+      jLen = elems.length;
+      for (j = 0; j < jLen; j += 1) {
+        if (type === 'st' || type === 'gs') {
+          ctx.beginPath();
+          if (currentStyle.da) {
+            ctx.setLineDash(currentStyle.da);
+            ctx.lineDashOffset = currentStyle.do;
+          }
         }
-    }
-};
+        nodes = elems[j].trNodes;
+        kLen = nodes.length;
 
-CVShapeElement.prototype.renderFill = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-
-    if (itemData.c._mdf || this._isFirstFrame) {
-        styleElem.co = 'rgb(' 
-        + bm_floor(itemData.c.v[0]) + ',' 
-        + bm_floor(itemData.c.v[1]) + ',' 
-        + bm_floor(itemData.c.v[2]) + ')';
-    }
-    if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
-        styleElem.coOp = itemData.o.v * groupTransform.opacity;
-    }
-};
-
-CVShapeElement.prototype.renderGradientFill = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-    if(!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
-        var ctx = this.globalData.canvasContext;
-        var grd;
-        var pt1 = itemData.s.v, pt2 = itemData.e.v;
-        if (styleData.t === 1) {
-            grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
-        } else {
-            var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
-
-            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-            var dist = rad * percent;
-            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-            var grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
+        for (k = 0; k < kLen; k += 1) {
+          if (nodes[k].t === 'm') {
+            ctx.moveTo(nodes[k].p[0], nodes[k].p[1]);
+          } else if (nodes[k].t === 'c') {
+            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]);
+          } else {
+            ctx.closePath();
+          }
         }
-
-        var i, len = styleData.g.p;
-        var cValues = itemData.g.c;
-        var opacity = 1;
-
-        for (i = 0; i < len; i += 1){
-            if(itemData.g._hasOpacity && itemData.g._collapsable) {
-                opacity = itemData.g.o[i*2 + 1];
-            }
-            grd.addColorStop(cValues[i * 4] / 100,'rgba('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ',' + opacity + ')');
+        if (type === 'st' || type === 'gs') {
+          ctx.stroke();
+          if (currentStyle.da) {
+            ctx.setLineDash(this.dashResetter);
+          }
         }
-        styleElem.grd = grd;
+      }
+      if (type !== 'st' && type !== 'gs') {
+        ctx.fill(currentStyle.r);
+      }
+      renderer.restore();
     }
-    styleElem.coOp = itemData.o.v*groupTransform.opacity;
-    
+  }
 };
 
-CVShapeElement.prototype.renderStroke = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-    var d = itemData.d;
-    if(d && (d._mdf  || this._isFirstFrame)){
-        styleElem.da = d.dashArray;
-        styleElem.do = d.dashoffset[0];
+CVShapeElement.prototype.renderShape = function (parentTransform, items, data, isMain) {
+  var i;
+  var len = items.length - 1;
+  var groupTransform;
+  groupTransform = parentTransform;
+  for (i = len; i >= 0; i -= 1) {
+    if (items[i].ty === 'tr') {
+      groupTransform = data[i].transform;
+      this.renderShapeTransform(parentTransform, groupTransform);
+    } else if (items[i].ty === 'sh' || items[i].ty === 'el' || items[i].ty === 'rc' || items[i].ty === 'sr') {
+      this.renderPath(items[i], data[i]);
+    } else if (items[i].ty === 'fl') {
+      this.renderFill(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'st') {
+      this.renderStroke(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'gf' || items[i].ty === 'gs') {
+      this.renderGradientFill(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'gr') {
+      this.renderShape(groupTransform, items[i].it, data[i].it);
+    } else if (items[i].ty === 'tm') {
+      //
     }
-    if(itemData.c._mdf || this._isFirstFrame){
-        styleElem.co = 'rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')';
-    }
-    if(itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame){
-        styleElem.coOp = itemData.o.v*groupTransform.opacity;
-    }
-    if(itemData.w._mdf || this._isFirstFrame){
-        styleElem.wi = itemData.w.v;
-    }
+  }
+  if (isMain) {
+    this.drawLayer();
+  }
 };
 
-
-CVShapeElement.prototype.destroy = function(){
-    this.shapesData = null;
-    this.globalData = null;
-    this.canvasContext = null;
-    this.stylesList.length = 0;
-    this.itemsData.length = 0;
+CVShapeElement.prototype.renderStyledShape = function (styledShape, shape) {
+  if (this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
+    var shapeNodes = styledShape.trNodes;
+    var paths = shape.paths;
+    var i;
+    var len;
+    var j;
+    var jLen = paths._length;
+    shapeNodes.length = 0;
+    var groupTransformMat = styledShape.transforms.finalTransform;
+    for (j = 0; j < jLen; j += 1) {
+      var pathNodes = paths.shapes[j];
+      if (pathNodes && pathNodes.v) {
+        len = pathNodes._length;
+        for (i = 1; i < len; i += 1) {
+          if (i === 1) {
+            shapeNodes.push({
+              t: 'm',
+              p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0),
+            });
+          }
+          shapeNodes.push({
+            t: 'c',
+            pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i]),
+          });
+        }
+        if (len === 1) {
+          shapeNodes.push({
+            t: 'm',
+            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0),
+          });
+        }
+        if (pathNodes.c && len) {
+          shapeNodes.push({
+            t: 'c',
+            pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0]),
+          });
+          shapeNodes.push({
+            t: 'z',
+          });
+        }
+      }
+    }
+    styledShape.trNodes = shapeNodes;
+  }
 };
 
+CVShapeElement.prototype.renderPath = function (pathData, itemData) {
+  if (pathData.hd !== true && pathData._shouldRender) {
+    var i;
+    var len = itemData.styledShapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
+    }
+  }
+};
+
+CVShapeElement.prototype.renderFill = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+
+  if (itemData.c._mdf || this._isFirstFrame) {
+    styleElem.co = 'rgb('
+        + bmFloor(itemData.c.v[0]) + ','
+        + bmFloor(itemData.c.v[1]) + ','
+        + bmFloor(itemData.c.v[2]) + ')';
+  }
+  if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
+    styleElem.coOp = itemData.o.v * groupTransform.opacity;
+  }
+};
+
+CVShapeElement.prototype.renderGradientFill = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+  var grd;
+  if (!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
+    var ctx = this.globalData.canvasContext;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
+    if (styleData.t === 1) {
+      grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
+    } else {
+      var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+      var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+
+      var percent = itemData.h.v;
+      if (percent >= 1) {
+        percent = 0.99;
+      } else if (percent <= -1) {
+        percent = -0.99;
+      }
+      var dist = rad * percent;
+      var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+      var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+      grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
+    }
+
+    var i;
+    var len = styleData.g.p;
+    var cValues = itemData.g.c;
+    var opacity = 1;
+
+    for (i = 0; i < len; i += 1) {
+      if (itemData.g._hasOpacity && itemData.g._collapsable) {
+        opacity = itemData.g.o[i * 2 + 1];
+      }
+      grd.addColorStop(cValues[i * 4] / 100, 'rgba(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ',' + opacity + ')');
+    }
+    styleElem.grd = grd;
+  }
+  styleElem.coOp = itemData.o.v * groupTransform.opacity;
+};
+
+CVShapeElement.prototype.renderStroke = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+  var d = itemData.d;
+  if (d && (d._mdf || this._isFirstFrame)) {
+    styleElem.da = d.dashArray;
+    styleElem.do = d.dashoffset[0];
+  }
+  if (itemData.c._mdf || this._isFirstFrame) {
+    styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')';
+  }
+  if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
+    styleElem.coOp = itemData.o.v * groupTransform.opacity;
+  }
+  if (itemData.w._mdf || this._isFirstFrame) {
+    styleElem.wi = itemData.w.v;
+  }
+};
+
+CVShapeElement.prototype.destroy = function () {
+  this.shapesData = null;
+  this.globalData = null;
+  this.canvasContext = null;
+  this.stylesList.length = 0;
+  this.itemsData.length = 0;
+};
+
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement,
+SVGShapeElement, IImageElement */
 
 function CVSolidElement(data, globalData, comp) {
-    this.initElement(data,globalData,comp);
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);
 
 CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;
 CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
 
-CVSolidElement.prototype.renderInnerContent = function() {
-    var ctx = this.canvasContext;
-    ctx.fillStyle = this.data.sc;
-    ctx.fillRect(0, 0, this.data.sw, this.data.sh);
-    //
+CVSolidElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.fillStyle = this.data.sc;
+  ctx.fillRect(0, 0, this.data.sw, this.data.sh);
+  //
 };
+
 function CVEffects() {
 
 }
-CVEffects.prototype.renderFrame = function(){};
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
+CVEffects.prototype.renderFrame = function () {};
 
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+/* global createTag, AnimationItem */
+/* exported animationManager */
+
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
+    while (i < len) {
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      window.requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            window.requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    window.requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        window.requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations(animationData, standalone, renderer) {
+    var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+      [].slice.call(document.getElementsByClassName('bodymovin')));
+    var i;
+    var lenAnims = animElements.length;
+    for (i = 0; i < lenAnims; i += 1) {
+      if (renderer) {
+        animElements[i].setAttribute('data-bm-type', renderer);
+      }
+      registerAnimation(animElements[i], animationData);
     }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
-                  [].slice.call(document.getElementsByClassName('bodymovin')));
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerText = '';
-            var div = createTag('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
+    if (standalone && lenAnims === 0) {
+      if (!renderer) {
+        renderer = 'svg';
+      }
+      var body = document.getElementsByTagName('body')[0];
+      body.innerText = '';
+      var div = createTag('div');
+      div.style.width = '100%';
+      div.style.height = '100%';
+      div.setAttribute('data-bm-type', renderer);
+      body.appendChild(div);
+      registerAnimation(div, animationData);
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                window.requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        window.requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function freeze() {
-        _isFrozen = true;
+  function freeze() {
+    _isFrozen = true;
+  }
+
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
+
+  function setVolume(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setVolume(val, animation);
     }
+  }
 
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
+  function mute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.mute(animation);
     }
+  }
 
-    function setVolume(val,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setVolume(val, animation);
-        }
+  function unmute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.unmute(animation);
     }
+  }
 
-    function mute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.mute(animation);
-        }
-    }
-
-    function unmute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.unmute(animation);
-        }
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.setVolume = setVolume;
-    moduleOb.mute = mute;
-    moduleOb.unmute = unmute;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.setVolume = setVolume;
+  moduleOb.mute = mute;
+  moduleOb.unmute = unmute;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
-animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
+/* global AnimationItem */
+/* exported animationManager */
 
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
+    while (i < len) {
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations() {
+    throw new Error('Cannot access DOM from worker thread');
+  }
+
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function searchAnimations(animationData, standalone, renderer){
-        throw new Error('Cannot access DOM from worker thread');
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
-    }
+  function freeze() {
+    _isFrozen = true;
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
-    }
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
 
-    function freeze() {
-        _isFrozen = true;
-    }
-
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
+/* global createElementID, subframeEnabled, ProjectInterface, ImagePreloader, audioControllerFactory, extendPrototype, BaseEvent,
+CanvasRenderer, SVGRenderer, HybridRenderer, assetLoader, dataManager, expressionsPlugin, BMEnterFrameEvent, BMCompleteLoopEvent,
+BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent,
+BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent */
+
 var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.firstFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.playCount = 0;
-    this.animationData = {};
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = createElementID();
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.isSubframeEnabled = subframeEnabled;
-    this.segments = [];
-    this._idle = true;
-    this._completedLoop = false;
-    this.projectInterface = ProjectInterface();
-    this.imagePreloader = new ImagePreloader();
-    this.audioController = audioControllerFactory();
+  this._cbs = [];
+  this.name = '';
+  this.path = '';
+  this.isLoaded = false;
+  this.currentFrame = 0;
+  this.currentRawFrame = 0;
+  this.firstFrame = 0;
+  this.totalFrames = 0;
+  this.frameRate = 0;
+  this.frameMult = 0;
+  this.playSpeed = 1;
+  this.playDirection = 1;
+  this.playCount = 0;
+  this.animationData = {};
+  this.assets = [];
+  this.isPaused = true;
+  this.autoplay = false;
+  this.loop = true;
+  this.renderer = null;
+  this.animationID = createElementID();
+  this.assetsPath = '';
+  this.timeCompleted = 0;
+  this.segmentPos = 0;
+  this.isSubframeEnabled = subframeEnabled;
+  this.segments = [];
+  this._idle = true;
+  this._completedLoop = false;
+  this.projectInterface = ProjectInterface();
+  this.imagePreloader = new ImagePreloader();
+  this.audioController = audioControllerFactory();
 };
 
 extendPrototype([BaseEvent], AnimationItem);
 
-AnimationItem.prototype.setParams = function(params) {
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-    if (params.loop === ''
+AnimationItem.prototype.setParams = function (params) {
+  if (params.wrapper || params.container) {
+    this.wrapper = params.wrapper || params.container;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    case 'svg':
+      this.renderer = new SVGRenderer(this, params.rendererSettings);
+      break;
+    default:
+      this.renderer = new HybridRenderer(this, params.rendererSettings);
+      break;
+  }
+  this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+  if (params.loop === ''
         || params.loop === null
         || params.loop === undefined
-        || params.loop === true)
-    {
-        this.loop = true;
-    } else if (params.loop === false) {
-        this.loop = false;
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = params.assetsPath;
+  this.initialSegment = params.initialSegment;
+  if (params.audioFactory) {
+    this.audioController.setAudioFactory(params.audioFactory);
+  }
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    if (params.path.lastIndexOf('\\') !== -1) {
+      this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
     } else {
-        this.loop = parseInt(params.loop);
+      this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
     }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = params.assetsPath;
-    this.initialSegment = params.initialSegment;
-    if (params.audioFactory) {
-        this.audioController.setAudioFactory(params.audioFactory);
-    }
-    if (params.animationData) {
-        this.configAnimation(params.animationData);
-    } else if(params.path){
+    this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
+    this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
 
-        if( params.path.lastIndexOf('\\') !== -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        } else {
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-
-        assetLoader.load(params.path, this.configAnimation.bind(this), function() {
-            this.trigger('data_failed');
-        }.bind(this));
-    }
-
+    assetLoader.load(params.path, this.configAnimation.bind(this), function () {
+      this.trigger('data_failed');
+    }.bind(this));
+  }
 };
 
 AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
+  if (animationData) {
+    if (typeof animationData !== 'object') {
+      animationData = JSON.parse(animationData);
     }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
+  }
+  var params = {
+    wrapper: wrapper,
+    animationData: animationData,
+  };
+  var wrapperAttributes = wrapper.attributes;
 
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
+  params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-animation-path').value
+    : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-path').value
+      : wrapperAttributes.getNamedItem('bm-path')
+        ? wrapperAttributes.getNamedItem('bm-path').value
+        : '';
+  params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-type').value
+    : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-type').value
+      : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
+        ? wrapperAttributes.getNamedItem('bm-type').value
+        : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
+          ? wrapperAttributes.getNamedItem('data-bm-renderer').value
+          : wrapperAttributes.getNamedItem('bm-renderer')
+            ? wrapperAttributes.getNamedItem('bm-renderer').value
+            : 'canvas';
 
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
+  var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-loop').value
+    : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-loop').value
+      : wrapperAttributes.getNamedItem('bm-loop')
+        ? wrapperAttributes.getNamedItem('bm-loop').value
+        : '';
+  if (loop === 'false') {
+    params.loop = false;
+  } else if (loop === 'true') {
+    params.loop = true;
+  } else if (loop !== '') {
+    params.loop = parseInt(loop, 10);
+  }
+  var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-autoplay').value
+    : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-autoplay').value
+      : wrapperAttributes.getNamedItem('bm-autoplay')
+        ? wrapperAttributes.getNamedItem('bm-autoplay').value
+        : true;
+  params.autoplay = autoplay !== 'false';
+
+  params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-name').value
+    : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-name').value
+      : wrapperAttributes.getNamedItem('bm-name')
+        ? wrapperAttributes.getNamedItem('bm-name').value
+        : '';
+  var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-prerender').value
+    : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-prerender').value
+      : wrapperAttributes.getNamedItem('bm-prerender')
+        ? wrapperAttributes.getNamedItem('bm-prerender').value
+        : '';
+
+  if (prerender === 'false') {
+    params.prerender = false;
+  }
+  this.setParams(params);
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
+  }
+  if (data.chars || data.fonts) {
+    this.renderer.globalData.fontManager.addChars(data.chars);
+    this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
+  }
+  if (data.assets) {
+    len = data.assets.length;
+    for (i = 0; i < len; i += 1) {
+      this.animationData.assets.push(data.assets[i]);
     }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
-        this.trigger('data_failed');
-    }.bind(this));
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.trigger('data_ready');
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  var segment = segments.shift();
+  this.timeCompleted = segment.time * this.frameRate;
+  var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
+  this.segmentPos += 1;
+  assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
+    this.trigger('data_failed');
+  }.bind(this));
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
-    }
-    this.loadNextSegment();
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.imagesLoaded = function() {
-    this.trigger('loaded_images');
-    this.checkLoaded()
-}
+AnimationItem.prototype.imagesLoaded = function () {
+  this.trigger('loaded_images');
+  this.checkLoaded();
+};
 
-AnimationItem.prototype.preloadImages = function() {
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
-}
+AnimationItem.prototype.preloadImages = function () {
+  this.imagePreloader.setAssetsPath(this.assetsPath);
+  this.imagePreloader.setPath(this.path);
+  this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
+};
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    try {
-        this.animationData = animData;
+  if (!this.renderer) {
+    return;
+  }
+  try {
+    this.animationData = animData;
 
-        if (this.initialSegment) {
-            this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
-            this.firstFrame = Math.round(this.initialSegment[0]);
-        } else {
-            this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-            this.firstFrame = Math.round(this.animationData.ip);
-        }
-        this.renderer.configAnimation(animData);
-        if(!animData.assets){
-            animData.assets = [];
-        }
-
-        this.assets = this.animationData.assets;
-        this.frameRate = this.animationData.fr;
-        this.frameMult = this.animationData.fr / 1000;
-        this.renderer.searchExtraCompositions(animData.assets);
-        this.trigger('config_ready');
-        this.preloadImages();
-        this.loadSegments();
-        this.updaFrameModifier();
-        this.waitForFontsLoaded();
-        if (this.isPaused) {
-            this.audioController.pause();
-        }
-    } catch(error) {
-        this.triggerConfigError(error);
+    if (this.initialSegment) {
+      this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+      this.firstFrame = Math.round(this.initialSegment[0]);
+    } else {
+      this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+      this.firstFrame = Math.round(this.animationData.ip);
     }
+    this.renderer.configAnimation(animData);
+    if (!animData.assets) {
+      animData.assets = [];
+    }
+
+    this.assets = this.animationData.assets;
+    this.frameRate = this.animationData.fr;
+    this.frameMult = this.animationData.fr / 1000;
+    this.renderer.searchExtraCompositions(animData.assets);
+    this.trigger('config_ready');
+    this.preloadImages();
+    this.loadSegments();
+    this.updaFrameModifier();
+    this.waitForFontsLoaded();
+    if (this.isPaused) {
+      this.audioController.pause();
+    }
+  } catch (error) {
+    this.triggerConfigError(error);
+  }
 };
 
-AnimationItem.prototype.waitForFontsLoaded = function(){
-    if(!this.renderer) {
-        return;
-    }
-    if(this.renderer.globalData.fontManager.isLoaded){
-        this.checkLoaded();
-    }else{
-        setTimeout(this.waitForFontsLoaded.bind(this),20);
-    }
-}
+AnimationItem.prototype.waitForFontsLoaded = function () {
+  if (!this.renderer) {
+    return;
+  }
+  if (this.renderer.globalData.fontManager.isLoaded) {
+    this.checkLoaded();
+  } else {
+    setTimeout(this.waitForFontsLoaded.bind(this), 20);
+  }
+};
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded 
+  if (!this.isLoaded
         && this.renderer.globalData.fontManager.isLoaded
         && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')
-    ) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function() {
-            this.trigger('DOMLoaded');
-        }.bind(this), 0);
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
+  ) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    setTimeout(function () {
+      this.trigger('DOMLoaded');
+    }.bind(this), 0);
+    this.gotoFrame();
+    if (this.autoplay) {
+      this.play();
+    }
+  }
 };
 
 AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
+  this.renderer.updateContainerSize();
 };
 
-AnimationItem.prototype.setSubframe = function(flag){
-    this.isSubframeEnabled = !!flag;
+AnimationItem.prototype.setSubframe = function (flag) {
+  this.isSubframeEnabled = !!flag;
 };
 
 AnimationItem.prototype.gotoFrame = function () {
-    this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
+  this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
 
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
+  if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
+    this.currentFrame = this.timeCompleted;
+  }
+  this.trigger('enterFrame');
+  this.renderFrame();
 };
 
 AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    try {
-        this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-    } catch(error) {
-        this.triggerRenderFrameError(error);
-    }
+  if (this.isLoaded === false) {
+    return;
+  }
+  try {
+    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
+  } catch (error) {
+    this.triggerRenderFrameError(error);
+  }
 };
 
 AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.isPaused = false;
+    this.audioController.resume();
+    if (this._idle) {
+      this._idle = false;
+      this.trigger('_active');
     }
-    if (this.isPaused === true) {
-        this.isPaused = false;
-        this.audioController.resume();
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
+  }
 };
 
 AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        this._idle = true;
-        this.trigger('_idle');
-        this.audioController.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === false) {
+    this.isPaused = true;
+    this._idle = true;
+    this.trigger('_idle');
+    this.audioController.pause();
+  }
 };
 
 AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.play();
+  } else {
+    this.pause();
+  }
 };
 
 AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.playCount = 0;
-    this._completedLoop = false;
-    this.setCurrentRawFrameValue(0);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.pause();
+  this.playCount = 0;
+  this._completedLoop = false;
+  this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
+  if (name && this.name !== name) {
+    return;
+  }
+  if (isFrame) {
+    this.setCurrentRawFrameValue(value);
+  } else {
+    this.setCurrentRawFrameValue(value * this.frameModifier);
+  }
+  this.pause();
 };
 
 AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
+  this.goToAndStop(value, isFrame, name);
+  this.play();
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    var nextValue = this.currentRawFrame + value * this.frameModifier;
-    var _isComplete = false;
-    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
-    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
-    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
-        if (!this.loop || this.playCount === this.loop) {
-            if (!this.checkSegments(nextValue >  this.totalFrames ? nextValue % this.totalFrames : 0)) {
-                _isComplete = true;
-                nextValue = this.totalFrames - 1;
-            }
-        } else if (nextValue >= this.totalFrames) {
-            this.playCount += 1;
-            if (!this.checkSegments(nextValue % this.totalFrames)) {
-                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
-                this._completedLoop = true;
-                this.trigger('loopComplete');
-            }
-        } else {
-            this.setCurrentRawFrameValue(nextValue);
-        }
-    } else if(nextValue < 0) {
-        if (!this.checkSegments(nextValue % this.totalFrames)) {
-            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
-                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
-                if(!this._completedLoop) {
-                    this._completedLoop = true;
-                } else {
-                    this.trigger('loopComplete');
-                }
-            } else {
-                _isComplete = true;
-                nextValue = 0;
-            }
-        }
+  if (this.isPaused === true || this.isLoaded === false) {
+    return;
+  }
+  var nextValue = this.currentRawFrame + value * this.frameModifier;
+  var _isComplete = false;
+  // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+  // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+  if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+    if (!this.loop || this.playCount === this.loop) {
+      if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
+        _isComplete = true;
+        nextValue = this.totalFrames - 1;
+      }
+    } else if (nextValue >= this.totalFrames) {
+      this.playCount += 1;
+      if (!this.checkSegments(nextValue % this.totalFrames)) {
+        this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+        this._completedLoop = true;
+        this.trigger('loopComplete');
+      }
     } else {
-        this.setCurrentRawFrameValue(nextValue);
+      this.setCurrentRawFrameValue(nextValue);
     }
-    if (_isComplete) {
-        this.setCurrentRawFrameValue(nextValue);
-        this.pause();
-        this.trigger('complete');
+  } else if (nextValue < 0) {
+    if (!this.checkSegments(nextValue % this.totalFrames)) {
+      if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) { // eslint-disable-line no-plusplus
+        this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+        if (!this._completedLoop) {
+          this._completedLoop = true;
+        } else {
+          this.trigger('loopComplete');
+        }
+      } else {
+        _isComplete = true;
+        nextValue = 0;
+      }
     }
+  } else {
+    this.setCurrentRawFrameValue(nextValue);
+  }
+  if (_isComplete) {
+    this.setCurrentRawFrameValue(nextValue);
+    this.pause();
+    this.trigger('complete');
+  }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr, offset){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0.001 + offset);
+AnimationItem.prototype.adjustSegment = function (arr, offset) {
+  this.playCount = 0;
+  if (arr[1] < arr[0]) {
+    if (this.frameModifier > 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(-1);
+      }
     }
-    this.trigger('segmentStart');
+    this.totalFrames = arr[0] - arr[1];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[1];
+    this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
+  } else if (arr[1] > arr[0]) {
+    if (this.frameModifier < 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(1);
+      }
+    }
+    this.totalFrames = arr[1] - arr[0];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[0];
+    this.setCurrentRawFrameValue(0.001 + offset);
+  }
+  this.trigger('segmentStart');
 };
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init;
-        }
+AnimationItem.prototype.setSegment = function (init, end) {
+  var pendingFrame = -1;
+  if (this.isPaused) {
+    if (this.currentRawFrame + this.firstFrame < init) {
+      pendingFrame = init;
+    } else if (this.currentRawFrame + this.firstFrame > end) {
+      pendingFrame = end - init;
     }
+  }
 
-    this.firstFrame = init;
-    this.timeCompleted = this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
+  this.firstFrame = init;
+  this.totalFrames = end - init;
+  this.timeCompleted = this.totalFrames;
+  if (pendingFrame !== -1) {
+    this.goToAndStop(pendingFrame, true);
+  }
 };
 
 AnimationItem.prototype.playSegments = function (arr, forceFlag) {
-    if (forceFlag) {
-        this.segments.length = 0;
+  if (forceFlag) {
+    this.segments.length = 0;
+  }
+  if (typeof arr[0] === 'object') {
+    var i;
+    var len = arr.length;
+    for (i = 0; i < len; i += 1) {
+      this.segments.push(arr[i]);
     }
-    if (typeof arr[0] === 'object') {
-        var i, len = arr.length;
-        for (i = 0; i < len; i += 1) {
-            this.segments.push(arr[i]);
-        }
-    } else {
-        this.segments.push(arr);
-    }
-    if (this.segments.length && forceFlag) {
-        this.adjustSegment(this.segments.shift(), 0);
-    }
-    if (this.isPaused) {
-        this.play();
-    }
+  } else {
+    this.segments.push(arr);
+  }
+  if (this.segments.length && forceFlag) {
+    this.adjustSegment(this.segments.shift(), 0);
+  }
+  if (this.isPaused) {
+    this.play();
+  }
 };
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip,this.animationData.op]);
-    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if (forceFlag) {
-        this.checkSegments(0);
-    }
+  this.segments.length = 0;
+  this.segments.push([this.animationData.ip, this.animationData.op]);
+  // this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+  if (forceFlag) {
+    this.checkSegments(0);
+  }
 };
-AnimationItem.prototype.checkSegments = function(offset) {
-    if (this.segments.length) {
-        this.adjustSegment(this.segments.shift(), offset);
-        return true;
-    }
-    return false;
+AnimationItem.prototype.checkSegments = function (offset) {
+  if (this.segments.length) {
+    this.adjustSegment(this.segments.shift(), offset);
+    return true;
+  }
+  return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this.imagePreloader.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this.imagePreloader.destroy();
+  this.trigger('destroy');
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
+  this.renderer = null;
+  this.imagePreloader = null;
+  this.projectInterface = null;
 };
 
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    this.gotoFrame();
+AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
+  this.currentRawFrame = value;
+  this.gotoFrame();
 };
 
 AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
+  this.playSpeed = val;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
+  this.playDirection = val < 0 ? -1 : 1;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setVolume = function (val, name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.setVolume(val);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.setVolume(val);
 };
 
 AnimationItem.prototype.getVolume = function () {
-    return this.audioController.getVolume();
+  return this.audioController.getVolume();
 };
 
 AnimationItem.prototype.mute = function (name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.mute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.mute();
 };
 
 AnimationItem.prototype.unmute = function (name) {
-    if(name && this.name !== name){
-        return;
-    }
-    this.audioController.unmute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.unmute();
 };
 
 AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-    this.audioController.setRate(this.playSpeed * this.playDirection)
+  this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
+  this.audioController.setRate(this.playSpeed * this.playDirection);
 };
 
 AnimationItem.prototype.getPath = function () {
-    return this.path;
+  return this.path;
 };
 
 AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(assetData.e) {
-        path = assetData.p;
-    } else if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
+  var path = '';
+  if (assetData.e) {
+    path = assetData.p;
+  } else if (this.assetsPath) {
+    var imagePath = assetData.p;
+    if (imagePath.indexOf('images/') !== -1) {
+      imagePath = imagePath.split('/')[1];
     }
-    return path;
+    path = this.assetsPath + imagePath;
+  } else {
+    path = this.path;
+    path += assetData.u ? assetData.u : '';
+    path += assetData.p;
+  }
+  return path;
 };
 
 AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
+  var i = 0;
+  var len = this.assets.length;
+  while (i < len) {
+    if (id === this.assets[i].id) {
+      return this.assets[i];
     }
+    i += 1;
+  }
+  return null;
 };
 
 AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
+  this.renderer.hide();
 };
 
 AnimationItem.prototype.show = function () {
-    this.renderer.show();
+  this.renderer.show();
 };
 
 AnimationItem.prototype.getDuration = function (isFrame) {
-    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+  return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
 };
 
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
+AnimationItem.prototype.trigger = function (name) {
+  if (this._cbs && this._cbs[name]) {
+    switch (name) {
+      case 'enterFrame':
+        this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
+        break;
+      case 'loopComplete':
+        this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+        break;
+      case 'complete':
+        this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
+        break;
+      case 'segmentStart':
+        this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+        break;
+      case 'destroy':
+        this.triggerEvent(name, new BMDestroyEvent(name, this));
+        break;
+      default:
+        this.triggerEvent(name);
     }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
+  }
+  if (name === 'enterFrame' && this.onEnterFrame) {
+    this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
+  }
+  if (name === 'loopComplete' && this.onLoopComplete) {
+    this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+  }
+  if (name === 'complete' && this.onComplete) {
+    this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
+  }
+  if (name === 'segmentStart' && this.onSegmentStart) {
+    this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+  }
+  if (name === 'destroy' && this.onDestroy) {
+    this.onDestroy.call(this, new BMDestroyEvent(name, this));
+  }
 };
 
-AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
+AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
+  var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-    var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
-    }
-}
-
-AnimationItem.prototype.triggerConfigError = function(nativeError) {
-
-    var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
-    }
-}
-AnimationItem.prototype.setParams = function(params) {
-    if(params.context){
-        this.context = params.context;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        default:
-            throw new Error('Only canvas renderer is supported when using worker.');
-            break;
-    }
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-
-    if(params.loop === '' || params.loop === null){
-    }else if(params.loop === false){
-        this.loop = false;
-    }else if(params.loop === true){
-        this.loop = true;
-    }else{
-        this.loop = parseInt(params.loop);
-    }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = null;
-    if(params.animationData){
-        this.configAnimation(params.animationData);
-    }else if(params.path){
-        throw new Error('Canvas worker renderer cannot load animation from url');
-    }
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
 };
 
-AnimationItem.prototype.setData = function (wrapper, animationData) {
-    throw new Error('Cannot set data on wrapper for canvas worker renderer');
+AnimationItem.prototype.triggerConfigError = function (nativeError) {
+  var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
+
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
-    }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+/* global CanvasRenderer, dataManager, expressionsPlugin, AnimationItem */
+
+AnimationItem.prototype.setParams = function (params) {
+  if (params.context) {
+    this.context = params.context;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    default:
+      throw new Error('Only canvas renderer is supported when using worker.');
+  }
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+
+  if (params.loop === ''
+        || params.loop === null
+        || params.loop === undefined
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = null;
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    throw new Error('Canvas worker renderer cannot load animation from url');
+  }
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    throw new Error('Cannot load multiple segments in worker.');
+AnimationItem.prototype.setData = function () {
+  throw new Error('Cannot set data on wrapper for canvas worker renderer');
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
+};
+
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  throw new Error('Cannot load multiple segments in worker.');
+};
+
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
 AnimationItem.prototype.imagesLoaded = null;
@@ -10084,2692 +10677,2818 @@
 AnimationItem.prototype.preloadImages = null;
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    this.animationData = animData;
-    this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-    this.renderer.configAnimation(animData);
-    if(!animData.assets){
-        animData.assets = [];
-    }
-    this.renderer.searchExtraCompositions(animData.assets);
+  if (!this.renderer) {
+    return;
+  }
+  this.animationData = animData;
+  this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+  this.renderer.configAnimation(animData);
+  if (!animData.assets) {
+    animData.assets = [];
+  }
+  this.renderer.searchExtraCompositions(animData.assets);
 
-    this.assets = this.animationData.assets;
-    this.frameRate = this.animationData.fr;
-    this.firstFrame = Math.round(this.animationData.ip);
-    this.frameMult = this.animationData.fr / 1000;
-    this.loadSegments();
-    this.updaFrameModifier();
-    this.checkLoaded();
+  this.assets = this.animationData.assets;
+  this.frameRate = this.animationData.fr;
+  this.firstFrame = Math.round(this.animationData.ip);
+  this.frameMult = this.animationData.fr / 1000;
+  this.loadSegments();
+  this.updaFrameModifier();
+  this.checkLoaded();
 };
 
 AnimationItem.prototype.waitForFontsLoaded = null;
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, null);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        this.gotoFrame();
+  if (!this.isLoaded) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, null);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    this.gotoFrame();
+  }
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
 };
 
 AnimationItem.prototype.getPath = null;
 
-var Expressions = (function(){
-    var ob = {};
-    ob.initExpressions = initExpressions;
+/* global CompExpressionInterface, expressionsPlugin: writable */
+/* exported expressionsPlugin */
 
+var Expressions = (function () {
+  var ob = {};
+  ob.initExpressions = initExpressions;
 
-    function initExpressions(animation){
+  function initExpressions(animation) {
+    var stackCount = 0;
+    var registers = [];
 
-    	var stackCount = 0;
-    	var registers = [];
-
-    	function pushExpression() {
-			stackCount += 1;
-    	}
-
-    	function popExpression() {
-			stackCount -= 1;
-			if (stackCount === 0) {
-				releaseInstances();
-			}
-    	}
-
-    	function registerExpressionProperty(expression) {
-    		if (registers.indexOf(expression) === -1) {
-				registers.push(expression)
-    		}
-    	}
-
-    	function releaseInstances() {
-    		var i, len = registers.length;
-    		for (i = 0; i < len; i += 1) {
-				registers[i].release();
-    		}
-    		registers.length = 0;
-    	}
-
-        animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
-        animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
-        animation.renderer.globalData.pushExpression = pushExpression;
-        animation.renderer.globalData.popExpression = popExpression;
-        animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+    function pushExpression() {
+      stackCount += 1;
     }
-   return ob;
+
+    function popExpression() {
+      stackCount -= 1;
+      if (stackCount === 0) {
+        releaseInstances();
+      }
+    }
+
+    function registerExpressionProperty(expression) {
+      if (registers.indexOf(expression) === -1) {
+        registers.push(expression);
+      }
+    }
+
+    function releaseInstances() {
+      var i;
+      var len = registers.length;
+      for (i = 0; i < len; i += 1) {
+        registers[i].release();
+      }
+      registers.length = 0;
+    }
+
+    animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
+    animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
+    animation.renderer.globalData.pushExpression = pushExpression;
+    animation.renderer.globalData.popExpression = popExpression;
+    animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+  }
+  return ob;
 }());
 
 expressionsPlugin = Expressions;
 
-var ExpressionManager = (function(){
-    'use strict';
-    var ob = {};
-    var Math = BMMath;
-    var window = null;
-    var document = null;
+/* eslint-disable camelcase, no-unused-vars */
+/* global BMMath, BezierFactory, createTypedArray, degToRads, shapePool */
 
-    function $bm_isInstanceOfArray(arr) {
-        return arr.constructor === Array || arr.constructor === Float32Array;
+var ExpressionManager = (function () {
+  'use strict';
+
+  var ob = {};
+  var Math = BMMath;
+  var window = null;
+  var document = null;
+
+  function $bm_isInstanceOfArray(arr) {
+    return arr.constructor === Array || arr.constructor === Float32Array;
+  }
+
+  function isNumerable(tOfV, v) {
+    return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+  }
+
+  function $bm_neg(a) {
+    var tOfA = typeof a;
+    if (tOfA === 'number' || tOfA === 'boolean' || a instanceof Number) {
+      return -a;
+    }
+    if ($bm_isInstanceOfArray(a)) {
+      var i;
+      var lenA = a.length;
+      var retArr = [];
+      for (i = 0; i < lenA; i += 1) {
+        retArr[i] = -a[i];
+      }
+      return retArr;
+    }
+    if (a.propType) {
+      return a.v;
+    }
+    return -a;
+  }
+
+  var easeInBez = BezierFactory.getBezierEasing(0.333, 0, 0.833, 0.833, 'easeIn').get;
+  var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, 0.667, 1, 'easeOut').get;
+  var easeInOutBez = BezierFactory.getBezierEasing(0.33, 0, 0.667, 1, 'easeInOut').get;
+
+  function sum(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (tOfA === 'string' || tOfB === 'string') {
+      return a + b;
+    }
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a + b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] += b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a + b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] + b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+  var add = sum;
+
+  function sub(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      if (tOfA === 'string') {
+        a = parseInt(a, 10);
+      }
+      if (tOfB === 'string') {
+        b = parseInt(b, 10);
+      }
+      return a - b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] -= b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a - b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] - b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+
+  function mul(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a * b;
     }
 
-    function isNumerable(tOfV, v) {
-        return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] * b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a * b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+
+  function div(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a / b;
+    }
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] / b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a / b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+  function mod(a, b) {
+    if (typeof a === 'string') {
+      a = parseInt(a, 10);
+    }
+    if (typeof b === 'string') {
+      b = parseInt(b, 10);
+    }
+    return a % b;
+  }
+  var $bm_sum = sum;
+  var $bm_sub = sub;
+  var $bm_mul = mul;
+  var $bm_div = div;
+  var $bm_mod = mod;
+
+  function clamp(num, min, max) {
+    if (min > max) {
+      var mm = max;
+      max = min;
+      min = mm;
+    }
+    return Math.min(Math.max(num, min), max);
+  }
+
+  function radiansToDegrees(val) {
+    return val / degToRads;
+  }
+  var radians_to_degrees = radiansToDegrees;
+
+  function degreesToRadians(val) {
+    return val * degToRads;
+  }
+  var degrees_to_radians = radiansToDegrees;
+
+  var helperLengthArray = [0, 0, 0, 0, 0, 0];
+
+  function length(arr1, arr2) {
+    if (typeof arr1 === 'number' || arr1 instanceof Number) {
+      arr2 = arr2 || 0;
+      return Math.abs(arr1 - arr2);
+    }
+    if (!arr2) {
+      arr2 = helperLengthArray;
+    }
+    var i;
+    var len = Math.min(arr1.length, arr2.length);
+    var addedLength = 0;
+    for (i = 0; i < len; i += 1) {
+      addedLength += Math.pow(arr2[i] - arr1[i], 2);
+    }
+    return Math.sqrt(addedLength);
+  }
+
+  function normalize(vec) {
+    return div(vec, length(vec));
+  }
+
+  function rgbToHsl(val) {
+    var r = val[0]; var g = val[1]; var b = val[2];
+    var max = Math.max(r, g, b);
+    var min = Math.min(r, g, b);
+    var h;
+    var s;
+    var l = (max + min) / 2;
+
+    if (max === min) {
+      h = 0; // achromatic
+      s = 0; // achromatic
+    } else {
+      var d = max - min;
+      s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+      switch (max) {
+        case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+        case g: h = (b - r) / d + 2; break;
+        case b: h = (r - g) / d + 4; break;
+        default: break;
+      }
+      h /= 6;
     }
 
-    function $bm_neg(a){
-        var tOfA = typeof a;
-        if(tOfA === 'number' || tOfA === 'boolean'  || a instanceof Number ){
-            return -a;
-        }
-        if($bm_isInstanceOfArray(a)){
-            var i, lenA = a.length;
-            var retArr = [];
-            for(i=0;i<lenA;i+=1){
-                retArr[i] = -a[i];
-            }
-            return retArr;
-        }
-        if (a.propType) {
-            return a.v;
-        }
+    return [h, s, l, val[3]];
+  }
+
+  function hue2rgb(p, q, t) {
+    if (t < 0) t += 1;
+    if (t > 1) t -= 1;
+    if (t < 1 / 6) return p + (q - p) * 6 * t;
+    if (t < 1 / 2) return q;
+    if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
+    return p;
+  }
+
+  function hslToRgb(val) {
+    var h = val[0];
+    var s = val[1];
+    var l = val[2];
+
+    var r;
+    var g;
+    var b;
+
+    if (s === 0) {
+      r = l; // achromatic
+      b = l; // achromatic
+      g = l; // achromatic
+    } else {
+      var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+      var p = 2 * l - q;
+      r = hue2rgb(p, q, h + 1 / 3);
+      g = hue2rgb(p, q, h);
+      b = hue2rgb(p, q, h - 1 / 3);
     }
 
-    var easeInBez = BezierFactory.getBezierEasing(0.333,0,.833,.833, 'easeIn').get;
-    var easeOutBez = BezierFactory.getBezierEasing(0.167,0.167,.667,1, 'easeOut').get;
-    var easeInOutBez = BezierFactory.getBezierEasing(.33,0,.667,1, 'easeInOut').get;
+    return [r, g, b, val[3]];
+  }
 
-    function sum(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(tOfA === 'string' || tOfB === 'string'){
-            return a + b;
-        }
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a + b;
-        }
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] + b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a + b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] + b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+  function linear(t, tMin, tMax, value1, value2) {
+    if (value1 === undefined || value2 === undefined) {
+      value1 = tMin;
+      value2 = tMax;
+      tMin = 0;
+      tMax = 1;
     }
-    var add = sum;
-
-    function sub(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            if(tOfA === 'string') {
-                a = parseInt(a);
-            }
-            if(tOfB === 'string') {
-                b = parseInt(b);
-            }
-            return a - b;
-        }
-        if( $bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] - b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) &&  $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a - b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] - b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+    if (tMax < tMin) {
+      var _tMin = tMax;
+      tMax = tMin;
+      tMin = _tMin;
     }
-
-    function mul(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a * b;
-        }
-
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] * b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a * b[i];
-            }
-            return arr;
-        }
-        return 0;
+    if (t <= tMin) {
+      return value1;
+    } if (t >= tMax) {
+      return value2;
     }
-
-    function div(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a / b;
-        }
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] / b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a / b[i];
-            }
-            return arr;
-        }
-        return 0;
+    var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin);
+    if (!value1.length) {
+      return value1 + (value2 - value1) * perc;
     }
-    function mod(a,b) {
-        if(typeof a === 'string') {
-            a = parseInt(a);
-        }
-        if(typeof b === 'string') {
-            b = parseInt(b);
-        }
-        return a % b;
+    var i;
+    var len = value1.length;
+    var arr = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      arr[i] = value1[i] + (value2[i] - value1[i]) * perc;
     }
-    var $bm_sum = sum;
-    var $bm_sub = sub;
-    var $bm_mul = mul;
-    var $bm_div = div;
-    var $bm_mod = mod;
-
-    function clamp(num, min, max) {
-        if(min > max){
-            var mm = max;
-            max = min;
-            min = mm;
-        }
-        return Math.min(Math.max(num, min), max);
+    return arr;
+  }
+  function random(min, max) {
+    if (max === undefined) {
+      if (min === undefined) {
+        min = 0;
+        max = 1;
+      } else {
+        max = min;
+        min = undefined;
+      }
     }
-
-    function radiansToDegrees(val) {
-        return val/degToRads;
+    if (max.length) {
+      var i;
+      var len = max.length;
+      if (!min) {
+        min = createTypedArray('float32', len);
+      }
+      var arr = createTypedArray('float32', len);
+      var rnd = BMMath.random();
+      for (i = 0; i < len; i += 1) {
+        arr[i] = min[i] + rnd * (max[i] - min[i]);
+      }
+      return arr;
     }
-    var radians_to_degrees = radiansToDegrees;
-
-    function degreesToRadians(val) {
-        return val*degToRads;
+    if (min === undefined) {
+      min = 0;
     }
-    var degrees_to_radians = radiansToDegrees;
+    var rndm = BMMath.random();
+    return min + rndm * (max - min);
+  }
 
-    var helperLengthArray = [0,0,0,0,0,0];
-
-    function length(arr1, arr2) {
-        if (typeof arr1 === 'number' || arr1 instanceof Number) {
-            arr2 = arr2 || 0;
-            return Math.abs(arr1 - arr2);
-        }
-        if(!arr2) {
-            arr2 = helperLengthArray;
-        }
-        var i, len = Math.min(arr1.length, arr2.length);
-        var addedLength = 0;
-        for (i = 0; i < len; i += 1) {
-            addedLength += Math.pow(arr2[i] - arr1[i], 2);
-        }
-        return Math.sqrt(addedLength);
+  function createPath(points, inTangents, outTangents, closed) {
+    var i;
+    var len = points.length;
+    var path = shapePool.newElement();
+    path.setPathData(!!closed, len);
+    var arrPlaceholder = [0, 0];
+    var inVertexPoint;
+    var outVertexPoint;
+    for (i = 0; i < len; i += 1) {
+      inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
+      outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
+      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);
     }
+    return path;
+  }
 
-    function normalize(vec) {
-        return div(vec, length(vec));
-    }
+  function initiateExpression(elem, data, property) {
+    var val = data.x;
+    var needsVelocity = /velocity(?![\w\d])/.test(val);
+    var _needsRandom = val.indexOf('random') !== -1;
+    var elemType = elem.data.ty;
+    var transform;
+    var $bm_transform;
+    var content;
+    var effect;
+    var thisProperty = property;
+    thisProperty.valueAtTime = thisProperty.getValueAtTime;
+    Object.defineProperty(thisProperty, 'value', {
+      get: function () {
+        return thisProperty.v;
+      },
+    });
+    elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate;
+    elem.comp.displayStartTime = 0;
+    var inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    var outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    var width = elem.data.sw ? elem.data.sw : 0;
+    var height = elem.data.sh ? elem.data.sh : 0;
+    var name = elem.data.nm;
+    var loopIn;
+    var loop_in;
+    var loopOut;
+    var loop_out;
+    var smooth;
+    var toWorld;
+    var fromWorld;
+    var fromComp;
+    var toComp;
+    var fromCompToSurface;
+    var position;
+    var rotation;
+    var anchorPoint;
+    var scale;
+    var thisLayer;
+    var thisComp;
+    var mask;
+    var valueAtTime;
+    var velocityAtTime;
 
-    function rgbToHsl(val) {
-        var r = val[0]; var g = val[1]; var b = val[2];
-        var max = Math.max(r, g, b), min = Math.min(r, g, b);
-        var h, s, l = (max + min) / 2;
+    var scoped_bm_rt;
+    var expression_function = eval('[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]')[0]; // eslint-disable-line no-eval
+    var numKeys = property.kf ? data.k.length : 0;
 
-        if(max == min){
-            h = s = 0; // achromatic
-        }else{
-            var d = max - min;
-            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
-            switch(max){
-                case r: h = (g - b) / d + (g < b ? 6 : 0); break;
-                case g: h = (b - r) / d + 2; break;
-                case b: h = (r - g) / d + 4; break;
-            }
-            h /= 6;
+    var active = !this.data || this.data.hd !== true;
+
+    var wiggle = function wiggle(freq, amp) {
+      var iWiggle;
+      var j;
+      var lenWiggle = this.pv.length ? this.pv.length : 1;
+      var addedAmps = createTypedArray('float32', lenWiggle);
+      freq = 5;
+      var iterations = Math.floor(time * freq);
+      iWiggle = 0;
+      j = 0;
+      while (iWiggle < iterations) {
+        // var rnd = BMMath.random();
+        for (j = 0; j < lenWiggle; j += 1) {
+          addedAmps[j] += -amp + amp * 2 * BMMath.random();
+          // addedAmps[j] += -amp + amp*2*rnd;
         }
-
-        return [h, s, l,val[3]];
-    }
-
-    function hue2rgb(p, q, t){
-        if(t < 0) t += 1;
-        if(t > 1) t -= 1;
-        if(t < 1/6) return p + (q - p) * 6 * t;
-        if(t < 1/2) return q;
-        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
-        return p;
-    }
-
-    function hslToRgb(val){
-        var h = val[0];
-        var s = val[1];
-        var l = val[2];
-
-        var r, g, b;
-
-        if(s === 0){
-            r = g = b = l; // achromatic
-        }else{
-
-            var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-            var p = 2 * l - q;
-            r = hue2rgb(p, q, h + 1/3);
-            g = hue2rgb(p, q, h);
-            b = hue2rgb(p, q, h - 1/3);
-        }
-
-        return [r, g , b, val[3]];
-    }
-
-    function linear(t, tMin, tMax, value1, value2){
-        if(value1 === undefined || value2 === undefined){
-            value1 = tMin;
-            value2 = tMax;
-            tMin = 0;
-            tMax = 1;
-        }
-        if(tMax < tMin) {
-            var _tMin = tMax;
-            tMax = tMin;
-            tMin = _tMin;
-        }
-        if(t <= tMin) {
-            return value1;
-        }else if(t >= tMax){
-            return value2;
-        }
-        var perc = tMax === tMin ? 0 : (t-tMin)/(tMax-tMin);
-        if(!value1.length){
-            return value1 + (value2-value1)*perc;
-        }
-        var i, len = value1.length;
-        var arr = createTypedArray('float32', len);
-        for(i=0;i<len;i+=1){
-            arr[i] = value1[i] + (value2[i]-value1[i])*perc;
+        iWiggle += 1;
+      }
+      // var rnd2 = BMMath.random();
+      var periods = time * freq;
+      var perc = periods - Math.floor(periods);
+      var arr = createTypedArray('float32', lenWiggle);
+      if (lenWiggle > 1) {
+        for (j = 0; j < lenWiggle; j += 1) {
+          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;
+          // arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
         }
         return arr;
-    }
-    function random(min,max){
-        if(max === undefined){
-            if(min === undefined){
-                min = 0;
-                max = 1;
-            } else {
-                max = min;
-                min = undefined;
-            }
-        }
-        if(max.length){
-            var i, len = max.length;
-            if(!min){
-                min = createTypedArray('float32', len);
-            }
-            var arr = createTypedArray('float32', len);
-            var rnd = BMMath.random();
-            for(i=0;i<len;i+=1){
-                arr[i] = min[i] + rnd*(max[i]-min[i]);
-            }
-            return arr;
-        }
-        if(min === undefined){
-            min = 0;
-        }
-        var rndm = BMMath.random();
-        return min + rndm*(max-min);
+      }
+      return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc;
+    }.bind(this);
+
+    if (thisProperty.loopIn) {
+      loopIn = thisProperty.loopIn.bind(thisProperty);
+      loop_in = loopIn;
     }
 
-    function createPath(points, inTangents, outTangents, closed) {
-        var i, len = points.length;
-        var path = shape_pool.newElement();
-        path.setPathData(!!closed, len);
-        var arrPlaceholder = [0,0], inVertexPoint, outVertexPoint;
-        for(i = 0; i < len; i += 1) {
-            inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
-            outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
-            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);
-        }
-        return path;
+    if (thisProperty.loopOut) {
+      loopOut = thisProperty.loopOut.bind(thisProperty);
+      loop_out = loopOut;
     }
 
-    function initiateExpression(elem,data,property){
-        var val = data.x;
-        var needsVelocity = /velocity(?![\w\d])/.test(val);
-        var _needsRandom = val.indexOf('random') !== -1;
-        var elemType = elem.data.ty;
-        var transform,$bm_transform,content,effect;
-        var thisProperty = property;
-        thisProperty.valueAtTime = thisProperty.getValueAtTime;
-        Object.defineProperty(thisProperty, 'value', {
-            get: function() {
-                return thisProperty.v
-            }
-        })
-        elem.comp.frameDuration = 1/elem.comp.globalData.frameRate;
-        elem.comp.displayStartTime = 0;
-        var inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        var outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        var width = elem.data.sw ? elem.data.sw : 0;
-        var height = elem.data.sh ? elem.data.sh : 0;
-        var name = elem.data.nm;
-        var loopIn, loop_in, loopOut, loop_out, smooth;
-        var toWorld,fromWorld,fromComp,toComp,fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp,mask,valueAtTime,velocityAtTime;
-        var __expression_functions = [];
-        if(data.xf) {
-            var i, len = data.xf.length;
-            for(i = 0; i < len; i += 1) {
-                __expression_functions[i] = eval('(function(){ return ' + data.xf[i] + '}())');
-            }
-        }
-
-        var scoped_bm_rt;
-        var expression_function = eval('[function _expression_function(){' + val+';scoped_bm_rt=$bm_rt}' + ']')[0];
-        var numKeys = property.kf ? data.k.length : 0;
-
-        var active = !this.data || this.data.hd !== true;
-
-        var wiggle = function wiggle(freq,amp){
-            var i,j, len = this.pv.length ? this.pv.length : 1;
-            var addedAmps = createTypedArray('float32', len);
-            freq = 5;
-            var iterations = Math.floor(time*freq);
-            i = 0;
-            j = 0;
-            while(i<iterations){
-                //var rnd = BMMath.random();
-                for(j=0;j<len;j+=1){
-                    addedAmps[j] += -amp + amp*2*BMMath.random();
-                    //addedAmps[j] += -amp + amp*2*rnd;
-                }
-                i += 1;
-            }
-            //var rnd2 = BMMath.random();
-            var periods = time*freq;
-            var perc = periods - Math.floor(periods);
-            var arr = createTypedArray('float32', len);
-            if(len>1){
-                for(j=0;j<len;j+=1){
-                    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;
-                    //arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
-                }
-                return arr;
-            } else {
-                return this.pv + addedAmps[0] + (-amp + amp*2*BMMath.random())*perc;
-            }
-        }.bind(this);
-
-        if(thisProperty.loopIn) {
-            loopIn = thisProperty.loopIn.bind(thisProperty);
-            loop_in = loopIn;
-        }
-
-        if(thisProperty.loopOut) {
-            loopOut = thisProperty.loopOut.bind(thisProperty);
-            loop_out = loopOut;
-        }
-
-        if(thisProperty.smooth) {
-            smooth = thisProperty.smooth.bind(thisProperty);
-        }
-
-        function loopInDuration(type,duration){
-            return loopIn(type,duration,true);
-        }
-
-        function loopOutDuration(type,duration){
-            return loopOut(type,duration,true);
-        }
-
-        if(this.getValueAtTime) {
-            valueAtTime = this.getValueAtTime.bind(this);
-        }
-
-        if(this.getVelocityAtTime) {
-            velocityAtTime = this.getVelocityAtTime.bind(this);
-        }
-
-        var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
-
-        function lookAt(elem1,elem2){
-            var fVec = [elem2[0]-elem1[0],elem2[1]-elem1[1],elem2[2]-elem1[2]];
-            var pitch = Math.atan2(fVec[0],Math.sqrt(fVec[1]*fVec[1]+fVec[2]*fVec[2]))/degToRads;
-            var yaw = -Math.atan2(fVec[1],fVec[2])/degToRads;
-            return [yaw,pitch,0];
-        }
-
-        function easeOut(t, tMin, tMax, val1, val2){
-            return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function easeIn(t, tMin, tMax, val1, val2){
-            return applyEase(easeInBez, t, tMin, tMax, val1, val2);
-        }
-
-        function ease(t, tMin, tMax, val1, val2){
-            return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function applyEase(fn, t, tMin, tMax, val1, val2) {
-            if(val1 === undefined){
-                val1 = tMin;
-                val2 = tMax;
-            } else {
-                t = (t - tMin) / (tMax - tMin);
-            }
-            t = t > 1 ? 1 : t < 0 ? 0 : t;
-            var mult = fn(t);
-            if($bm_isInstanceOfArray(val1)) {
-                var i, len = val1.length;
-                var arr = createTypedArray('float32', len);
-                for (i = 0; i < len; i += 1) {
-                    arr[i] = (val2[i] - val1[i]) * mult + val1[i];
-                }
-                return arr;
-            } else {
-                return (val2 - val1) * mult + val1;
-            }
-        }
-
-        function nearestKey(time){
-            var i, len = data.k.length,index,keyTime;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                index = 0;
-                keyTime = 0;
-            } else {
-                index = -1;
-                time *= elem.comp.globalData.frameRate;
-                if (time < data.k[0].t) {
-                    index = 1;
-                    keyTime = data.k[0].t;
-                } else {
-                    for(i=0;i<len-1;i+=1){
-                        if(time === data.k[i].t){
-                            index = i + 1;
-                            keyTime = data.k[i].t;
-                            break;
-                        }else if(time>data.k[i].t && time<data.k[i+1].t){
-                            if(time-data.k[i].t > data.k[i+1].t - time){
-                                index = i + 2;
-                                keyTime = data.k[i+1].t;
-                            } else {
-                                index = i + 1;
-                                keyTime = data.k[i].t;
-                            }
-                            break;
-                        }
-                    }
-                    if(index === -1){
-                        index = i + 1;
-                        keyTime = data.k[i].t;
-                    }
-                }
-                
-            }
-            var ob = {};
-            ob.index = index;
-            ob.time = keyTime/elem.comp.globalData.frameRate;
-            return ob;
-        }
-
-        function key(ind){
-            var ob, i, len;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                throw new Error('The property has no keyframe at index ' + ind);
-            }
-            ind -= 1;
-            ob = {
-                time: data.k[ind].t/elem.comp.globalData.frameRate,
-                value: []
-            };
-            var arr = data.k[ind].hasOwnProperty('s') ? data.k[ind].s : data.k[ind - 1].e;
-
-            len = arr.length;
-            for(i=0;i<len;i+=1){
-                ob[i] = arr[i];
-                ob.value[i] = arr[i]
-            }
-            return ob;
-        }
-
-        function framesToTime(frames, fps) { 
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return frames / fps;
-        }
-
-        function timeToFrames(t, fps) {
-            if (!t && t !== 0) {
-                t = time;
-            }
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return t * fps;
-        }
-
-        function seedRandom(seed){
-            BMMath.seedrandom(randSeed + seed);
-        }
-
-        function sourceRectAtTime() {
-            return elem.sourceRectAtTime();
-        }
-
-        function substring(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substring(init)
-                }
-                return value.substring(init, end)
-            }
-            return '';
-        }
-
-        function substr(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substr(init)
-                }
-                return value.substr(init, end)
-            }
-            return '';
-        }
-
-        function posterizeTime(framesPerSecond) {
-            time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond
-            value = valueAtTime(time)
-        }
-
-        var time, velocity, value, text, textIndex, textTotal, selectorValue;
-        var index = elem.data.ind;
-        var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-        var parent;
-        var randSeed = Math.floor(Math.random()*1000000);
-        var globalData = elem.globalData;
-        function executeExpression(_value) {
-            // globalData.pushExpression();
-            value = _value;
-            if (_needsRandom) {
-                seedRandom(randSeed);
-            }
-            if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
-                return value;
-            }
-            if(this.propType === 'textSelector'){
-                textIndex = this.textIndex;
-                textTotal = this.textTotal;
-                selectorValue = this.selectorValue;
-            }
-            if (!thisLayer) {
-                text = elem.layerInterface.text;
-                thisLayer = elem.layerInterface;
-                thisComp = elem.comp.compInterface;
-                toWorld = thisLayer.toWorld.bind(thisLayer);
-                fromWorld = thisLayer.fromWorld.bind(thisLayer);
-                fromComp = thisLayer.fromComp.bind(thisLayer);
-                toComp = thisLayer.toComp.bind(thisLayer);
-                mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
-                fromCompToSurface = fromComp;
-            }
-            if (!transform) {
-                transform = elem.layerInterface("ADBE Transform Group");
-                $bm_transform = transform;
-                if(transform) {
-                    anchorPoint = transform.anchorPoint;
-                    /*position = transform.position;
-                    rotation = transform.rotation;
-                    scale = transform.scale;*/
-                }
-            }
-            
-            if (elemType === 4 && !content) {
-                content = thisLayer("ADBE Root Vectors Group");
-            }
-            if (!effect) {
-                effect = thisLayer(4);
-            }
-            hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-            if (hasParent && !parent) {
-                parent = elem.hierarchy[0].layerInterface;
-            }
-            time = this.comp.renderedFrame/this.comp.globalData.frameRate;
-            if (needsVelocity) {
-                velocity = velocityAtTime(time);
-            }
-            expression_function();
-            this.frameExpressionId = elem.globalData.frameId;
-
-            //TODO: Check if it's possible to return on ShapeInterface the .v value
-            if (scoped_bm_rt.propType === "shape") {
-                scoped_bm_rt = scoped_bm_rt.v;
-            }
-            // globalData.popExpression();
-            return scoped_bm_rt;
-        }
-        return executeExpression;
+    if (thisProperty.smooth) {
+      smooth = thisProperty.smooth.bind(thisProperty);
     }
 
-    ob.initiateExpression = initiateExpression;
-    return ob;
-}());
-var expressionHelpers = (function(){
-
-    function searchExpressions(elem,data,prop){
-        if(data.x){
-            prop.k = true;
-            prop.x = true;
-            prop.initiateExpression = ExpressionManager.initiateExpression;
-            prop.effectsSequence.push(prop.initiateExpression(elem,data,prop).bind(prop));
-        }
+    function loopInDuration(type, duration) {
+      return loopIn(type, duration, true);
     }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
+    function loopOutDuration(type, duration) {
+      return loopOut(type, duration, true);
     }
 
-    function getSpeedAtTime(frameNum) {
-        var delta = -0.01;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var speed = 0;
-        if(v1.length){
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                speed += Math.pow(v2[i] - v1[i], 2);
-            }
-            speed = Math.sqrt(speed) * 100;
+    if (this.getValueAtTime) {
+      valueAtTime = this.getValueAtTime.bind(this);
+    }
+
+    if (this.getVelocityAtTime) {
+      velocityAtTime = this.getVelocityAtTime.bind(this);
+    }
+
+    var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
+
+    function lookAt(elem1, elem2) {
+      var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]];
+      var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads;
+      var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads;
+      return [yaw, pitch, 0];
+    }
+
+    function easeOut(t, tMin, tMax, val1, val2) {
+      return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function easeIn(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInBez, t, tMin, tMax, val1, val2);
+    }
+
+    function ease(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function applyEase(fn, t, tMin, tMax, val1, val2) {
+      if (val1 === undefined) {
+        val1 = tMin;
+        val2 = tMax;
+      } else {
+        t = (t - tMin) / (tMax - tMin);
+      }
+      if (t > 1) {
+        t = 1;
+      } else if (t < 0) {
+        t = 0;
+      }
+      var mult = fn(t);
+      if ($bm_isInstanceOfArray(val1)) {
+        var iKey;
+        var lenKey = val1.length;
+        var arr = createTypedArray('float32', lenKey);
+        for (iKey = 0; iKey < lenKey; iKey += 1) {
+          arr[iKey] = (val2[iKey] - val1[iKey]) * mult + val1[iKey];
+        }
+        return arr;
+      }
+      return (val2 - val1) * mult + val1;
+    }
+
+    function nearestKey(time) {
+      var iKey;
+      var lenKey = data.k.length;
+      var index;
+      var keyTime;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        index = 0;
+        keyTime = 0;
+      } else {
+        index = -1;
+        time *= elem.comp.globalData.frameRate;
+        if (time < data.k[0].t) {
+          index = 1;
+          keyTime = data.k[0].t;
         } else {
-            speed = 0;
+          for (iKey = 0; iKey < lenKey - 1; iKey += 1) {
+            if (time === data.k[iKey].t) {
+              index = iKey + 1;
+              keyTime = data.k[iKey].t;
+              break;
+            } else if (time > data.k[iKey].t && time < data.k[iKey + 1].t) {
+              if (time - data.k[iKey].t > data.k[iKey + 1].t - time) {
+                index = iKey + 2;
+                keyTime = data.k[iKey + 1].t;
+              } else {
+                index = iKey + 1;
+                keyTime = data.k[iKey].t;
+              }
+              break;
+            }
+          }
+          if (index === -1) {
+            index = iKey + 1;
+            keyTime = data.k[iKey].t;
+          }
         }
-        return speed;
+      }
+      var obKey = {};
+      obKey.index = index;
+      obKey.time = keyTime / elem.comp.globalData.frameRate;
+      return obKey;
     }
 
-    function getVelocityAtTime(frameNum) {
-        if(this.vel !== undefined){
-            return this.vel;
-        }
-        var delta = -0.001;
-        //frameNum += this.elem.data.st;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var velocity;
-        if(v1.length){
-            velocity = createTypedArray('float32', v1.length);
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                //removing frameRate
-                //if needed, don't add it here
-                //velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
-                velocity[i] = (v2[i] - v1[i])/delta;
-            }
-        } else {
-            velocity = (v2 - v1)/delta;
-        }
-        return velocity;
+    function key(ind) {
+      var obKey;
+      var iKey;
+      var lenKey;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        throw new Error('The property has no keyframe at index ' + ind);
+      }
+      ind -= 1;
+      obKey = {
+        time: data.k[ind].t / elem.comp.globalData.frameRate,
+        value: [],
+      };
+      var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;
+
+      lenKey = arr.length;
+      for (iKey = 0; iKey < lenKey; iKey += 1) {
+        obKey[iKey] = arr[iKey];
+        obKey.value[iKey] = arr[iKey];
+      }
+      return obKey;
     }
 
-    function getStaticValueAtTime() {
-        return this.pv;
+    function framesToTime(frames, fps) {
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return frames / fps;
     }
 
-    function setGroupProperty(propertyGroup){
-        this.propertyGroup = propertyGroup;
+    function timeToFrames(t, fps) {
+      if (!t && t !== 0) {
+        t = time;
+      }
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return t * fps;
     }
 
-	return {
-		searchExpressions: searchExpressions,
-		getSpeedAtTime: getSpeedAtTime,
-		getVelocityAtTime: getVelocityAtTime,
-		getValueAtTime: getValueAtTime,
-		getStaticValueAtTime: getStaticValueAtTime,
-		setGroupProperty: setGroupProperty,
-	}
-}());
-(function addPropertyDecorator() {
-
-    function loopOut(type,duration,durationFlag){
-        if(!this.k || !this.keyframes){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var lastKeyFrame = keyframes[keyframes.length - 1].t;
-        if(currentFrame<=lastKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, firstKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,lastKeyFrame - this.elem.data.ip);
-                } else {
-                    cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate*duration);
-                }
-                firstKeyFrame = lastKeyFrame - cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(iterations % 2 !== 0){
-                    return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = (endV[i]-initV[i])*repeats + current[i];
-                    }
-                    return ret;
-                }
-                return (endV-initV)*repeats + current;
-            } else if(type === 'continue'){
-                var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(lastValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = lastValue[i] + (lastValue[i]-nextLastValue[i])*((currentFrame - lastKeyFrame)/ this.comp.globalData.frameRate)/0.0005;
-                    }
-                    return ret;
-                }
-                return lastValue + (lastValue-nextLastValue)*(((currentFrame - lastKeyFrame))/0.001);
-            }
-            return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function seedRandom(seed) {
+      BMMath.seedrandom(randSeed + seed);
     }
 
-    function loopIn(type,duration, durationFlag) {
-        if(!this.k){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var firstKeyFrame = keyframes[0].t;
-        if(currentFrame>=firstKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, lastKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                lastKeyFrame = keyframes[duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,this.elem.data.op - firstKeyFrame);
-                } else {
-                    cycleDuration = Math.abs(elem.comp.globalData.frameRate*duration);
-                }
-                lastKeyFrame = firstKeyFrame + cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((firstKeyFrame - currentFrame)/cycleDuration);
-                if(iterations % 2 === 0){
-                    return this.getValueAtTime((((firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((firstKeyFrame - currentFrame)/cycleDuration)+1;
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = current[i]-(endV[i]-initV[i])*repeats;
-                    }
-                    return ret;
-                }
-                return current-(endV-initV)*repeats;
-            } else if(type === 'continue'){
-                var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(firstValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = firstValue[i] + (firstValue[i]-nextFirstValue[i])*(firstKeyFrame - currentFrame)/0.001;
-                    }
-                    return ret;
-                }
-                return firstValue + (firstValue-nextFirstValue)*(firstKeyFrame - currentFrame)/0.001;
-            }
-            return this.getValueAtTime(((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function sourceRectAtTime() {
+      return elem.sourceRectAtTime();
     }
 
-    function smooth(width, samples) {
-        if (!this.k){
-            return this.pv;
+    function substring(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substring(init);
         }
-        width = (width || 0.4) * 0.5;
-        samples = Math.floor(samples || 5);
-        if (samples <= 1) {
-            return this.pv;
+        return value.substring(init, end);
+      }
+      return '';
+    }
+
+    function substr(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substr(init);
         }
-        var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
-        var initFrame = currentTime - width;
-        var endFrame = currentTime + width;
-        var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
-        var i = 0, j = 0;
-        var value;
-        if (this.pv.length) {
-            value = createTypedArray('float32', this.pv.length);
-        } else {
-            value = 0;
-        }
-        var sampleValue;
-        while (i < samples) {
-            sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
-            if(this.pv.length) {
-                for (j = 0; j < this.pv.length; j += 1) {
-                    value[j] += sampleValue[j];
-                }
-            } else {
-                value += sampleValue;
-            }
-            i += 1;
-        }
-        if(this.pv.length) {
-            for (j = 0; j < this.pv.length; j += 1) {
-                value[j] /= samples;
-            }
-        } else {
-            value /= samples;
-        }
+        return value.substr(init, end);
+      }
+      return '';
+    }
+
+    function posterizeTime(framesPerSecond) {
+      time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond;
+      value = valueAtTime(time);
+    }
+
+    var time;
+    var velocity;
+    var value;
+    var text;
+    var textIndex;
+    var textTotal;
+    var selectorValue;
+    var index = elem.data.ind;
+    var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+    var parent;
+    var randSeed = Math.floor(Math.random() * 1000000);
+    var globalData = elem.globalData;
+    function executeExpression(_value) {
+      // globalData.pushExpression();
+      value = _value;
+      if (_needsRandom) {
+        seedRandom(randSeed);
+      }
+      if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
         return value;
+      }
+      if (this.propType === 'textSelector') {
+        textIndex = this.textIndex;
+        textTotal = this.textTotal;
+        selectorValue = this.selectorValue;
+      }
+      if (!thisLayer) {
+        text = elem.layerInterface.text;
+        thisLayer = elem.layerInterface;
+        thisComp = elem.comp.compInterface;
+        toWorld = thisLayer.toWorld.bind(thisLayer);
+        fromWorld = thisLayer.fromWorld.bind(thisLayer);
+        fromComp = thisLayer.fromComp.bind(thisLayer);
+        toComp = thisLayer.toComp.bind(thisLayer);
+        mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
+        fromCompToSurface = fromComp;
+      }
+      if (!transform) {
+        transform = elem.layerInterface('ADBE Transform Group');
+        $bm_transform = transform;
+        if (transform) {
+          anchorPoint = transform.anchorPoint;
+          /* position = transform.position;
+                    rotation = transform.rotation;
+                    scale = transform.scale; */
+        }
+      }
+
+      if (elemType === 4 && !content) {
+        content = thisLayer('ADBE Root Vectors Group');
+      }
+      if (!effect) {
+        effect = thisLayer(4);
+      }
+      hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+      if (hasParent && !parent) {
+        parent = elem.hierarchy[0].layerInterface;
+      }
+      time = this.comp.renderedFrame / this.comp.globalData.frameRate;
+      if (needsVelocity) {
+        velocity = velocityAtTime(time);
+      }
+      expression_function();
+      this.frameExpressionId = elem.globalData.frameId;
+
+      // TODO: Check if it's possible to return on ShapeInterface the .v value
+      if (scoped_bm_rt.propType === 'shape') {
+        scoped_bm_rt = scoped_bm_rt.v;
+      }
+      // globalData.popExpression();
+      return scoped_bm_rt;
     }
+    return executeExpression;
+  }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
-    }
-
-    function getTransformValueAtTime(time) {
-        if (!this._transformCachingAtTime) {
-            this._transformCachingAtTime = {
-                v: new Matrix(),
-            };
-        }
-        ////
-        var matrix = this._transformCachingAtTime.v;
-        matrix.cloneFromProps(this.pre.props);
-        if (this.appliedTransformations < 1) {
-            var anchor = this.a.getValueAtTime(time);
-            matrix.translate(
-                -anchor[0] * this.a.mult,
-                -anchor[1] * this.a.mult,
-                anchor[2] * this.a.mult
-            );
-        }
-        if (this.appliedTransformations < 2) {
-            var scale = this.s.getValueAtTime(time);
-            matrix.scale(
-                scale[0] * this.s.mult,
-                scale[1] * this.s.mult,
-                scale[2] * this.s.mult
-            );
-        }
-        if (this.sk && this.appliedTransformations < 3) {
-            var skew = this.sk.getValueAtTime(time);
-            var skewAxis = this.sa.getValueAtTime(time);
-            matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
-        }
-        if (this.r && this.appliedTransformations < 4) {
-            var rotation = this.r.getValueAtTime(time);
-            matrix.rotate(-rotation * this.r.mult);
-        } else if (!this.r && this.appliedTransformations < 4){
-            var rotationZ = this.rz.getValueAtTime(time);
-            var rotationY = this.ry.getValueAtTime(time);
-            var rotationX = this.rx.getValueAtTime(time);
-            var orientation = this.or.getValueAtTime(time);
-            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);
-        }
-        if (this.data.p && this.data.p.s) {
-            var positionX = this.px.getValueAtTime(time);
-            var positionY = this.py.getValueAtTime(time);
-            if (this.data.p.z) {
-                var positionZ = this.pz.getValueAtTime(time);
-                matrix.translate(
-                    positionX * this.px.mult,
-                    positionY * this.py.mult,
-                    -positionZ * this.pz.mult
-                );
-            } else {
-                matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
-            }
-        } else {
-            var position = this.p.getValueAtTime(time);
-            matrix.translate(
-                position[0] * this.p.mult,
-                position[1] * this.p.mult,
-                -position[2] * this.p.mult
-            );
-        }
-        return matrix;
-        ////
-    }
-
-    function getTransformStaticValueAtTime(time) {
-        return this.v.clone(new Matrix());
-    }
-
-    var getTransformProperty = TransformPropertyFactory.getTransformProperty;
-    TransformPropertyFactory.getTransformProperty = function(elem, data, container) {
-        var prop = getTransformProperty(elem, data, container);
-        if(prop.dynamicProperties.length) {
-            prop.getValueAtTime = getTransformValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        return prop;
-    };
-
-    var propertyGetProp = PropertyFactory.getProp;
-    PropertyFactory.getProp = function(elem,data,type, mult, container){
-        var prop = propertyGetProp(elem,data,type, mult, container);
-        //prop.getVelocityAtTime = getVelocityAtTime;
-        //prop.loopOut = loopOut;
-        //prop.loopIn = loopIn;
-        if(prop.kf){
-            prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        prop.loopOut = loopOut;
-        prop.loopIn = loopIn;
-        prop.smooth = smooth;
-        prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
-        prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
-        prop.numKeys = data.a === 1 ? data.k.length : 0;
-        prop.propertyIndex = data.ix;
-        var value = 0;
-        if(type !== 0) {
-            value = createTypedArray('float32', data.a === 1 ?  data.k[0].s.length : data.k.length);
-        }
-        prop._cachingAtTime = {
-            lastFrame: initialDefaultFrame,
-            lastIndex: 0,
-            value: value
-        };
-        expressionHelpers.searchExpressions(elem,data,prop);
-        if(prop.k){
-            container.addDynamicProperty(prop);
-        }
-
-        return prop;
-    };
-
-    function getShapeValueAtTime(frameNum) {
-        //For now this caching object is created only when needed instead of creating it when the shape is initialized.
-        if (!this._cachingAtTime) {
-            this._cachingAtTime = {
-                shapeValue: shape_pool.clone(this.pv),
-                lastIndex: 0,
-                lastTime: initialDefaultFrame
-            };
-        }
-        
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastTime) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
-            this._cachingAtTime.lastTime = frameNum;
-            this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
-        }
-        return this._cachingAtTime.shapeValue;
-    }
-
-    var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
-    var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
-
-    function ShapeExpressions(){}
-    ShapeExpressions.prototype = {
-        vertices: function(prop, time){
-            if (this.k) {
-                this.getValue();
-            }
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            var i, len = shapePath._length;
-            var vertices = shapePath[prop];
-            var points = shapePath.v;
-            var arr = createSizedArray(len);
-            for(i = 0; i < len; i += 1) {
-                if(prop === 'i' || prop === 'o') {
-                    arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
-                } else {
-                    arr[i] = [vertices[i][0], vertices[i][1]];
-                }
-                
-            }
-            return arr;
-        },
-        points: function(time){
-            return this.vertices('v', time);
-        },
-        inTangents: function(time){
-            return this.vertices('i', time);
-        },
-        outTangents: function(time){
-            return this.vertices('o', time);
-        },
-        isClosed: function(){
-            return this.v.c;
-        },
-        pointOnPath: function(perc, time){
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            if(!this._segmentsLength) {
-                this._segmentsLength = bez.getSegmentsLength(shapePath);
-            }
-
-            var segmentsLength = this._segmentsLength;
-            var lengths = segmentsLength.lengths;
-            var lengthPos = segmentsLength.totalLength * perc;
-            var i = 0, len = lengths.length;
-            var j = 0, jLen;
-            var accumulatedLength = 0, pt;
-            while(i < len) {
-                if(accumulatedLength + lengths[i].addedLength > lengthPos) {
-                    var initIndex = i;
-                    var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
-                    var segmentPerc = (lengthPos - accumulatedLength)/lengths[i].addedLength;
-                    pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
-                    break;
-                } else {
-                    accumulatedLength += lengths[i].addedLength;
-                }
-                i += 1;
-            }
-            if(!pt){
-                pt = shapePath.c ? [shapePath.v[0][0],shapePath.v[0][1]]:[shapePath.v[shapePath._length-1][0],shapePath.v[shapePath._length-1][1]];
-            }
-            return pt;
-        },
-        vectorOnPath: function(perc, time, vectorType){
-            //perc doesn't use triple equality because it can be a Number object as well as a primitive.
-            perc = perc == 1 ? this.v.c ? 0 : 0.999 : perc;
-            var pt1 = this.pointOnPath(perc, time);
-            var pt2 = this.pointOnPath(perc + 0.001, time);
-            var xLength = pt2[0] - pt1[0];
-            var yLength = pt2[1] - pt1[1];
-            var magnitude = Math.sqrt(Math.pow(xLength,2) + Math.pow(yLength,2));
-            if (magnitude === 0) {
-                return [0,0];
-            }
-            var unitVector = vectorType === 'tangent' ? [xLength/magnitude, yLength/magnitude] : [-yLength/magnitude, xLength/magnitude];
-            return unitVector;
-        },
-        tangentOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'tangent');
-        },
-        normalOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'normal');
-        },
-        setGroupProperty: expressionHelpers.setGroupProperty,
-        getValueAtTime: expressionHelpers.getStaticValueAtTime
-    };
-    extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
-    extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
-    KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
-    KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
-
-    var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
-    ShapePropertyFactory.getShapeProp = function(elem,data,type, arr, trims){
-        var prop = propertyGetShapeProp(elem,data,type, arr, trims);
-        prop.propertyIndex = data.ix;
-        prop.lock = false;
-        if(type === 3){
-            expressionHelpers.searchExpressions(elem,data.pt,prop);
-        } else if(type === 4){
-            expressionHelpers.searchExpressions(elem,data.ks,prop);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    };
+  ob.initiateExpression = initiateExpression;
+  return ob;
 }());
+
+/* global ExpressionManager, createTypedArray */
+/* exported expressionHelpers */
+
+var expressionHelpers = (function () {
+  function searchExpressions(elem, data, prop) {
+    if (data.x) {
+      prop.k = true;
+      prop.x = true;
+      prop.initiateExpression = ExpressionManager.initiateExpression;
+      prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop));
+    }
+  }
+
+  function getValueAtTime(frameNum) {
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastFrame) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
+      this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
+      this._cachingAtTime.lastFrame = frameNum;
+    }
+    return this._cachingAtTime.value;
+  }
+
+  function getSpeedAtTime(frameNum) {
+    var delta = -0.01;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var speed = 0;
+    if (v1.length) {
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        speed += Math.pow(v2[i] - v1[i], 2);
+      }
+      speed = Math.sqrt(speed) * 100;
+    } else {
+      speed = 0;
+    }
+    return speed;
+  }
+
+  function getVelocityAtTime(frameNum) {
+    if (this.vel !== undefined) {
+      return this.vel;
+    }
+    var delta = -0.001;
+    // frameNum += this.elem.data.st;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var velocity;
+    if (v1.length) {
+      velocity = createTypedArray('float32', v1.length);
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        // removing frameRate
+        // if needed, don't add it here
+        // velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
+        velocity[i] = (v2[i] - v1[i]) / delta;
+      }
+    } else {
+      velocity = (v2 - v1) / delta;
+    }
+    return velocity;
+  }
+
+  function getStaticValueAtTime() {
+    return this.pv;
+  }
+
+  function setGroupProperty(propertyGroup) {
+    this.propertyGroup = propertyGroup;
+  }
+
+  return {
+    searchExpressions: searchExpressions,
+    getSpeedAtTime: getSpeedAtTime,
+    getVelocityAtTime: getVelocityAtTime,
+    getValueAtTime: getValueAtTime,
+    getStaticValueAtTime: getStaticValueAtTime,
+    setGroupProperty: setGroupProperty,
+  };
+}());
+
+/* global createTypedArray, Matrix, TransformPropertyFactory, expressionHelpers, PropertyFactory, expressionHelpers,
+initialDefaultFrame, shapePool, ShapePropertyFactory, bez, extendPrototype, ExpressionManager, createSizedArray */
+
+(function addPropertyDecorator() {
+  function loopOut(type, duration, durationFlag) {
+    if (!this.k || !this.keyframes) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var lastKeyFrame = keyframes[keyframes.length - 1].t;
+    if (currentFrame <= lastKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var firstKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip);
+      } else {
+        cycleDuration = Math.abs(lastKeyFrame - this.elem.comp.globalData.frameRate * duration);
+      }
+      firstKeyFrame = lastKeyFrame - cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (iterations % 2 !== 0) {
+          return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+        var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = (endV[i] - initV[i]) * repeats + current[i];
+        }
+        return ret;
+      }
+      return (endV - initV) * repeats + current;
+    } else if (type === 'continue') {
+      var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(lastValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+            ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005; // eslint-disable-line
+        }
+        return ret;
+      }
+      return lastValue + (lastValue - nextLastValue) * (((currentFrame - lastKeyFrame)) / 0.001);
+    }
+      return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function loopIn(type, duration, durationFlag) {
+    if (!this.k) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var firstKeyFrame = keyframes[0].t;
+    if (currentFrame >= firstKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var lastKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      lastKeyFrame = keyframes[duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame);
+      } else {
+        cycleDuration = Math.abs(this.elem.comp.globalData.frameRate * duration);
+      }
+      lastKeyFrame = firstKeyFrame + cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration);
+      if (iterations % 2 === 0) {
+          return this.getValueAtTime((((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var current = this.getValueAtTime((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration) + firstKeyFrame) / this.comp.globalData.frameRate, 0);
+      var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1;
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = current[i] - (endV[i] - initV[i]) * repeats;
+        }
+        return ret;
+      }
+      return current - (endV - initV) * repeats;
+    } else if (type === 'continue') {
+      var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(firstValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = firstValue[i] + ((firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame)) / 0.001;
+        }
+        return ret;
+      }
+      return firstValue + ((firstValue - nextFirstValue) * (firstKeyFrame - currentFrame)) / 0.001;
+    }
+      return this.getValueAtTime(((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame))) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function smooth(width, samples) {
+    if (!this.k) {
+      return this.pv;
+    }
+    width = (width || 0.4) * 0.5;
+    samples = Math.floor(samples || 5);
+    if (samples <= 1) {
+      return this.pv;
+    }
+    var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
+    var initFrame = currentTime - width;
+    var endFrame = currentTime + width;
+    var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
+    var i = 0;
+    var j = 0;
+    var value;
+    if (this.pv.length) {
+      value = createTypedArray('float32', this.pv.length);
+    } else {
+      value = 0;
+    }
+    var sampleValue;
+    while (i < samples) {
+      sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
+      if (this.pv.length) {
+        for (j = 0; j < this.pv.length; j += 1) {
+          value[j] += sampleValue[j];
+        }
+      } else {
+        value += sampleValue;
+      }
+      i += 1;
+    }
+    if (this.pv.length) {
+      for (j = 0; j < this.pv.length; j += 1) {
+        value[j] /= samples;
+      }
+    } else {
+      value /= samples;
+    }
+    return value;
+  }
+
+  function getTransformValueAtTime(time) {
+    if (!this._transformCachingAtTime) {
+      this._transformCachingAtTime = {
+        v: new Matrix(),
+      };
+    }
+    /// /
+    var matrix = this._transformCachingAtTime.v;
+    matrix.cloneFromProps(this.pre.props);
+    if (this.appliedTransformations < 1) {
+      var anchor = this.a.getValueAtTime(time);
+      matrix.translate(
+        -anchor[0] * this.a.mult,
+        -anchor[1] * this.a.mult,
+        anchor[2] * this.a.mult
+      );
+    }
+    if (this.appliedTransformations < 2) {
+      var scale = this.s.getValueAtTime(time);
+      matrix.scale(
+        scale[0] * this.s.mult,
+        scale[1] * this.s.mult,
+        scale[2] * this.s.mult
+      );
+    }
+    if (this.sk && this.appliedTransformations < 3) {
+      var skew = this.sk.getValueAtTime(time);
+      var skewAxis = this.sa.getValueAtTime(time);
+      matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
+    }
+    if (this.r && this.appliedTransformations < 4) {
+      var rotation = this.r.getValueAtTime(time);
+      matrix.rotate(-rotation * this.r.mult);
+    } else if (!this.r && this.appliedTransformations < 4) {
+      var rotationZ = this.rz.getValueAtTime(time);
+      var rotationY = this.ry.getValueAtTime(time);
+      var rotationX = this.rx.getValueAtTime(time);
+      var orientation = this.or.getValueAtTime(time);
+      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);
+    }
+    if (this.data.p && this.data.p.s) {
+      var positionX = this.px.getValueAtTime(time);
+      var positionY = this.py.getValueAtTime(time);
+      if (this.data.p.z) {
+        var positionZ = this.pz.getValueAtTime(time);
+        matrix.translate(
+          positionX * this.px.mult,
+          positionY * this.py.mult,
+          -positionZ * this.pz.mult
+        );
+      } else {
+        matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
+      }
+    } else {
+      var position = this.p.getValueAtTime(time);
+      matrix.translate(
+        position[0] * this.p.mult,
+        position[1] * this.p.mult,
+        -position[2] * this.p.mult
+      );
+    }
+    return matrix;
+    /// /
+  }
+
+  function getTransformStaticValueAtTime() {
+    return this.v.clone(new Matrix());
+  }
+
+  var getTransformProperty = TransformPropertyFactory.getTransformProperty;
+  TransformPropertyFactory.getTransformProperty = function (elem, data, container) {
+    var prop = getTransformProperty(elem, data, container);
+    if (prop.dynamicProperties.length) {
+      prop.getValueAtTime = getTransformValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    return prop;
+  };
+
+  var propertyGetProp = PropertyFactory.getProp;
+  PropertyFactory.getProp = function (elem, data, type, mult, container) {
+    var prop = propertyGetProp(elem, data, type, mult, container);
+    // prop.getVelocityAtTime = getVelocityAtTime;
+    // prop.loopOut = loopOut;
+    // prop.loopIn = loopIn;
+    if (prop.kf) {
+      prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    prop.loopOut = loopOut;
+    prop.loopIn = loopIn;
+    prop.smooth = smooth;
+    prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
+    prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
+    prop.numKeys = data.a === 1 ? data.k.length : 0;
+    prop.propertyIndex = data.ix;
+    var value = 0;
+    if (type !== 0) {
+      value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);
+    }
+    prop._cachingAtTime = {
+      lastFrame: initialDefaultFrame,
+      lastIndex: 0,
+      value: value,
+    };
+    expressionHelpers.searchExpressions(elem, data, prop);
+    if (prop.k) {
+      container.addDynamicProperty(prop);
+    }
+
+    return prop;
+  };
+
+  function getShapeValueAtTime(frameNum) {
+    // For now this caching object is created only when needed instead of creating it when the shape is initialized.
+    if (!this._cachingAtTime) {
+      this._cachingAtTime = {
+        shapeValue: shapePool.clone(this.pv),
+        lastIndex: 0,
+        lastTime: initialDefaultFrame,
+      };
+    }
+
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastTime) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
+      this._cachingAtTime.lastTime = frameNum;
+      this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
+    }
+    return this._cachingAtTime.shapeValue;
+  }
+
+  var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
+  var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
+
+  function ShapeExpressions() {}
+  ShapeExpressions.prototype = {
+    vertices: function (prop, time) {
+      if (this.k) {
+        this.getValue();
+      }
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      var i;
+      var len = shapePath._length;
+      var vertices = shapePath[prop];
+      var points = shapePath.v;
+      var arr = createSizedArray(len);
+      for (i = 0; i < len; i += 1) {
+        if (prop === 'i' || prop === 'o') {
+          arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
+        } else {
+          arr[i] = [vertices[i][0], vertices[i][1]];
+        }
+      }
+      return arr;
+    },
+    points: function (time) {
+      return this.vertices('v', time);
+    },
+    inTangents: function (time) {
+      return this.vertices('i', time);
+    },
+    outTangents: function (time) {
+      return this.vertices('o', time);
+    },
+    isClosed: function () {
+      return this.v.c;
+    },
+    pointOnPath: function (perc, time) {
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      if (!this._segmentsLength) {
+        this._segmentsLength = bez.getSegmentsLength(shapePath);
+      }
+
+      var segmentsLength = this._segmentsLength;
+      var lengths = segmentsLength.lengths;
+      var lengthPos = segmentsLength.totalLength * perc;
+      var i = 0;
+      var len = lengths.length;
+      var accumulatedLength = 0;
+      var pt;
+      while (i < len) {
+        if (accumulatedLength + lengths[i].addedLength > lengthPos) {
+          var initIndex = i;
+          var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
+          var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength;
+          pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
+          break;
+        } else {
+          accumulatedLength += lengths[i].addedLength;
+        }
+        i += 1;
+      }
+      if (!pt) {
+        pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]];
+      }
+      return pt;
+    },
+    vectorOnPath: function (perc, time, vectorType) {
+      // perc doesn't use triple equality because it can be a Number object as well as a primitive.
+      if (perc == 1) { // eslint-disable-line eqeqeq
+        perc = this.v.c;
+      } else if (perc == 0) { // eslint-disable-line eqeqeq
+        perc = 0.999;
+      }
+      var pt1 = this.pointOnPath(perc, time);
+      var pt2 = this.pointOnPath(perc + 0.001, time);
+      var xLength = pt2[0] - pt1[0];
+      var yLength = pt2[1] - pt1[1];
+      var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2));
+      if (magnitude === 0) {
+        return [0, 0];
+      }
+      var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude];
+      return unitVector;
+    },
+    tangentOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'tangent');
+    },
+    normalOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'normal');
+    },
+    setGroupProperty: expressionHelpers.setGroupProperty,
+    getValueAtTime: expressionHelpers.getStaticValueAtTime,
+  };
+  extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
+  extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
+  KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
+  KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
+
+  var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
+  ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) {
+    var prop = propertyGetShapeProp(elem, data, type, arr, trims);
+    prop.propertyIndex = data.ix;
+    prop.lock = false;
+    if (type === 3) {
+      expressionHelpers.searchExpressions(elem, data.pt, prop);
+    } else if (type === 4) {
+      expressionHelpers.searchExpressions(elem, data.ks, prop);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  };
+}());
+
+/* global ExpressionManager, TextProperty */
+
 (function addDecorator() {
-
-    function searchExpressions(){
-        if(this.data.d.x){
-            this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this);
-            this.addEffect(this.getExpressionValue.bind(this));
-            return true;
-        }
+  function searchExpressions() {
+    if (this.data.d.x) {
+      this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this);
+      this.addEffect(this.getExpressionValue.bind(this));
+      return true;
     }
+    return null;
+  }
 
-    TextProperty.prototype.getExpressionValue = function(currentValue, text) {
-        var newValue = this.calculateExpression(text);
-        if(currentValue.t !== newValue) {
-            var newData = {};
-            this.copyData(newData, currentValue);
-            newData.t = newValue.toString();
-            newData.__complete = false;
-            return newData;
-        }
-        return currentValue;
+  TextProperty.prototype.getExpressionValue = function (currentValue, text) {
+    var newValue = this.calculateExpression(text);
+    if (currentValue.t !== newValue) {
+      var newData = {};
+      this.copyData(newData, currentValue);
+      newData.t = newValue.toString();
+      newData.__complete = false;
+      return newData;
     }
+    return currentValue;
+  };
 
-    TextProperty.prototype.searchProperty = function(){
+  TextProperty.prototype.searchProperty = function () {
+    var isKeyframed = this.searchKeyframes();
+    var hasExpressions = this.searchExpressions();
+    this.kf = isKeyframed || hasExpressions;
+    return this.kf;
+  };
 
-        var isKeyframed = this.searchKeyframes();
-        var hasExpressions = this.searchExpressions();
-        this.kf = isKeyframed || hasExpressions;
-        return this.kf;
-    };
-
-    TextProperty.prototype.searchExpressions = searchExpressions;
-    
+  TextProperty.prototype.searchExpressions = searchExpressions;
 }());
+
+/* global propertyGroupFactory, PropertyInterface */
+/* exported ShapePathInterface */
+
 var ShapePathInterface = (
 
-	function() {
+  function () {
+    return function pathInterfaceFactory(shape, view, propertyGroup) {
+      var prop = view.sh;
 
-		return function pathInterfaceFactory(shape,view,propertyGroup){
-		    var prop = view.sh;
-
-		    function interfaceFunction(val){
-		        if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2){
-		            return interfaceFunction.path;
-		        }
-		    }
-
-		    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-		    prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
-		    Object.defineProperties(interfaceFunction, {
-		        'path': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        'shape': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        '_name': { value: shape.nm },
-		        'ix': { value: shape.ix },
-		        'propertyIndex': { value: shape.ix },
-		        'mn': { value: shape.mn },
-		        'propertyGroup': {value: propertyGroup},
-		    });
-		    return interfaceFunction;
-		}
-	}()
-)
-var propertyGroupFactory = (function() {
-	return function(interfaceFunction, parentPropertyGroup) {
-		return function(val) {
-			val = val === undefined ? 1 : val
-			if(val <= 0){
-			    return interfaceFunction;
-			} else{
-			    return parentPropertyGroup(val-1);
-			}
-		}
-	}
-}())
-var PropertyInterface = (function() {
-	return function(propertyName, propertyGroup) {
-
-		var interfaceFunction = {
-			_name: propertyName
-		}
-
-		function _propertyGroup(val){
-		    val = val === undefined ? 1 : val
-		    if(val <= 0){
-		        return interfaceFunction;
-		    } else {
-		        return propertyGroup(--val);
-		    }
-		}
-
-		return _propertyGroup;
-	}
-}())
-var ShapeExpressionInterface = (function(){
-
-    function iterateElements(shapes,view, propertyGroup){
-        var arr = [];
-        var i, len = shapes ? shapes.length : 0;
-        for(i=0;i<len;i+=1){
-            if(shapes[i].ty == 'gr'){
-                arr.push(groupInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'fl'){
-                arr.push(fillInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'st'){
-                arr.push(strokeInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tm'){
-                arr.push(trimInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tr'){
-                //arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'el'){
-                arr.push(ellipseInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'sr'){
-                arr.push(starInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'sh'){
-                arr.push(ShapePathInterface(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rc'){
-                arr.push(rectInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rd'){
-                arr.push(roundedInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rp'){
-                arr.push(repeaterInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }
+      function interfaceFunction(val) {
+        if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {
+          return interfaceFunction.path;
         }
-        return arr;
-    }
+        return null;
+      }
 
-    function contentsInterfaceFactory(shape,view, propertyGroup){
-       var interfaces;
-       var interfaceFunction = function _interfaceFunction(value){
-           var i = 0, len = interfaces.length;
-            while(i<len){
-                if(interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value){
-                   return interfaces[i];
-                }
-                i+=1;
+      var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+      prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
+      Object.defineProperties(interfaceFunction, {
+        path: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-            if(typeof value === 'number'){
-               return interfaces[value-1];
+            return prop;
+          },
+        },
+        shape: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-       };
-
-       interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-       interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
-       interfaceFunction.numProperties = interfaces.length;
-       var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-       interfaceFunction.transform = transformInterface;
-       interfaceFunction.propertyIndex = shape.cix;
-       interfaceFunction._name = shape.nm;
-
-       return interfaceFunction;
-   }
-
-    function groupInterfaceFactory(shape,view, propertyGroup){
-        var interfaceFunction = function _interfaceFunction(value){
-            switch(value){
-                case 'ADBE Vectors Group':
-                case 'Contents':
-                case 2:
-                    return interfaceFunction.content;
-                //Not necessary for now. Keeping them here in case a new case appears
-                //case 'ADBE Vector Transform Group':
-                //case 3:
-                default:
-                    return interfaceFunction.transform;
-            }
-        };
-        interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var content = contentsInterfaceFactory(shape,view,interfaceFunction.propertyGroup);
-        var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-        interfaceFunction.content = content;
-        interfaceFunction.transform = transformInterface;
-        Object.defineProperty(interfaceFunction, '_name', {
-            get: function(){
-                return shape.nm;
-            }
-        });
-        //interfaceFunction.content = interfaceFunction;
-        interfaceFunction.numProperties = shape.np;
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.nm = shape.nm;
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function fillInterfaceFactory(shape,view,propertyGroup){
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
-        return interfaceFunction;
-    }
-
-    function strokeInterfaceFactory(shape,view,propertyGroup){
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
-        function addPropertyToDashOb(i) {
-            Object.defineProperty(dashOb, shape.d[i].nm, {
-                get: ExpressionPropertyInterface(view.d.dataProps[i].p)
-            });
-        }
-        var i, len = shape.d ? shape.d.length : 0;
-        var dashOb = {};
-        for (i = 0; i < len; i += 1) {
-            addPropertyToDashOb(i);
-            view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
-        }
-
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            } else if(val === 'Stroke Width' || val === 'stroke width'){
-                return interfaceFunction.strokeWidth;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            'strokeWidth': {
-                get: ExpressionPropertyInterface(view.w)
-            },
-            'dash': {
-                get: function() {
-                    return dashOb;
-                }
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
-        return interfaceFunction;
-    }
-
-    function trimInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(val){
-            if(val === shape.e.ix || val === 'End' || val === 'end'){
-                return interfaceFunction.end;
-            }
-            if(val === shape.s.ix){
-                return interfaceFunction.start;
-            }
-            if(val === shape.o.ix){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-
-        view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
-        view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.propertyGroup = propertyGroup;
-
-        Object.defineProperties(interfaceFunction, {
-            'start': {
-                get: ExpressionPropertyInterface(view.s)
-            },
-            'end': {
-                get: ExpressionPropertyInterface(view.e)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function transformInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.a.ix === value || value === 'Anchor Point'){
-                return interfaceFunction.anchorPoint;
-            }
-            if(shape.o.ix === value || value === 'Opacity'){
-                return interfaceFunction.opacity;
-            }
-            if(shape.p.ix === value || value === 'Position'){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation'){
-                return interfaceFunction.rotation;
-            }
-            if(shape.s.ix === value || value === 'Scale'){
-                return interfaceFunction.scale;
-            }
-            if(shape.sk && shape.sk.ix === value || value === 'Skew'){
-                return interfaceFunction.skew;
-            }
-            if(shape.sa && shape.sa.ix === value || value === 'Skew Axis'){
-                return interfaceFunction.skewAxis;
-            }
-        }
-        
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
-        view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
-        view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(view.transform.mProps.sk){
-            view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
-            view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
-        }
-        view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'opacity': {
-                get: ExpressionPropertyInterface(view.transform.mProps.o)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(view.transform.mProps.p)
-            },
-            'anchorPoint': {
-                get: ExpressionPropertyInterface(view.transform.mProps.a)
-            },
-            'scale': {
-                get: ExpressionPropertyInterface(view.transform.mProps.s)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(view.transform.mProps.r)
-            },
-            'skew': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sk)
-            },
-            'skewAxis': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sa)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.ty = 'tr';
-        interfaceFunction.mn = shape.mn;
-        interfaceFunction.propertyGroup = propertyGroup;
-        return interfaceFunction;
-    }
-
-    function ellipseInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.s.ix === value){
-                return interfaceFunction.size;
-            }
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function starInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.rotation;
-            }
-            if(shape.pt.ix === value){
-                return interfaceFunction.points;
-            }
-            if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
-                return interfaceFunction.outerRadius;
-            }
-            if(shape.os.ix === value){
-                return interfaceFunction.outerRoundness;
-            }
-            if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
-                return interfaceFunction.innerRadius;
-            }
-            if(shape.is && shape.is.ix === value){
-                return interfaceFunction.innerRoundness;
-            }
-
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
-        prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
-        prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(shape.ir){
-            prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
-            prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
-        }
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'points': {
-                get: ExpressionPropertyInterface(prop.pt)
-            },
-            'outerRadius': {
-                get: ExpressionPropertyInterface(prop.or)
-            },
-            'outerRoundness': {
-                get: ExpressionPropertyInterface(prop.os)
-            },
-            'innerRadius': {
-                get: ExpressionPropertyInterface(prop.ir)
-            },
-            'innerRoundness': {
-                get: ExpressionPropertyInterface(prop.is)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function rectInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.roundness;
-            }
-            if(shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size'){
-                return interfaceFunction.size;
-            }
-
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'roundness': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function roundedInterfaceFactory(shape,view,propertyGroup){
-       
-        function interfaceFunction(value){
-            if(shape.r.ix === value || 'Round Corners 1' === value){
-                return interfaceFunction.radius;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'radius': {
-                get: ExpressionPropertyInterface(prop.rd)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function repeaterInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.c.ix === value || 'Copies' === value){
-                return interfaceFunction.copies;
-            } else if(shape.o.ix === value || 'Offset' === value){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
-        prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'copies': {
-                get: ExpressionPropertyInterface(prop.c)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(prop.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    return function(shapes,view,propertyGroup) {
-        var interfaces;
-        function _interfaceFunction(value){
-            if(typeof value === 'number'){
-                value = value === undefined ? 1 : value
-                if (value === 0) {
-                    return propertyGroup
-                } else {
-                    return interfaces[value-1];
-                }
-            } else {
-                var i = 0, len = interfaces.length;
-                while(i<len){
-                    if(interfaces[i]._name === value){
-                        return interfaces[i];
-                    }
-                    i+=1;
-                }
-            }
-        }
-        function parentGroupWrapper() {
-            return propertyGroup
-        }
-        _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
-        interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
-        _interfaceFunction.numProperties = interfaces.length;
-        _interfaceFunction._name = 'Contents';
-        return _interfaceFunction;
+            return prop;
+          },
+        },
+        _name: { value: shape.nm },
+        ix: { value: shape.ix },
+        propertyIndex: { value: shape.ix },
+        mn: { value: shape.mn },
+        propertyGroup: { value: propertyGroup },
+      });
+      return interfaceFunction;
     };
+  }()
+);
+
+/* exported propertyGroupFactory */
+
+var propertyGroupFactory = (function () {
+  return function (interfaceFunction, parentPropertyGroup) {
+    return function (val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return parentPropertyGroup(val - 1);
+    };
+  };
 }());
 
-var TextExpressionInterface = (function(){
-	return function(elem){
-        var _prevValue, _sourceText;
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Text Document":
-                    return _thisLayerFunction.sourceText;
-            }
-        }
-        Object.defineProperty(_thisLayerFunction, "sourceText", {
-            get: function(){
-                elem.textProperty.getValue()
-                var stringValue = elem.textProperty.currentData.t;
-                if(stringValue !== _prevValue) {
-                    elem.textProperty.currentData.t = _prevValue;
-                    _sourceText = new String(stringValue);
-                    //If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
-                    _sourceText.value = stringValue ? stringValue : new String(stringValue);
-                }
-                return _sourceText;
-            }
-        });
-        return _thisLayerFunction;
+/* exported PropertyInterface */
+
+var PropertyInterface = (function () {
+  return function (propertyName, propertyGroup) {
+    var interfaceFunction = {
+      _name: propertyName,
     };
+
+    function _propertyGroup(val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return propertyGroup(val - 1);
+    }
+
+    return _propertyGroup;
+  };
 }());
-var LayerExpressionInterface = (function (){
 
-    function getMatrix(time) {
-        var toWorldMat = new Matrix();
-        if (time !== undefined) {
-            var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
-            propMatrix.clone(toWorldMat);
-        } else {
-            var transformMat = this._elem.finalTransform.mProp;
-            transformMat.applyToMatrix(toWorldMat);
+/* global ExpressionPropertyInterface, PropertyInterface, propertyGroupFactory, ShapePathInterface */
+/* exported ShapeExpressionInterface */
+
+var ShapeExpressionInterface = (function () {
+  function iterateElements(shapes, view, propertyGroup) {
+    var arr = [];
+    var i;
+    var len = shapes ? shapes.length : 0;
+    for (i = 0; i < len; i += 1) {
+      if (shapes[i].ty === 'gr') {
+        arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'fl') {
+        arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'st') {
+        arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tm') {
+        arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tr') {
+        // arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
+      } else if (shapes[i].ty === 'el') {
+        arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sr') {
+        arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sh') {
+        arr.push(ShapePathInterface(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rc') {
+        arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rd') {
+        arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rp') {
+        arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup));
+      }
+    }
+    return arr;
+  }
+
+  function contentsInterfaceFactory(shape, view, propertyGroup) {
+    var interfaces;
+    var interfaceFunction = function _interfaceFunction(value) {
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) {
+          return interfaces[i];
         }
-        return toWorldMat;
-    }
-
-    function toWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function toWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function fromWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function fromWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function applyPoint(matrix, arr) {
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.applyToPointArray(arr[0],arr[1],arr[2]||0);
-    }
-
-    function invertPoint(matrix, arr) {
-        if (this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.inversePoint(arr);
-    }
-
-    function fromComp(arr){
-        var toWorldMat = new Matrix();
-        toWorldMat.reset();
-        this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
-            }
-            return toWorldMat.inversePoint(arr);
-        }
-        return toWorldMat.inversePoint(arr);
-    }
-
-    function sampleImage() {
-        return [1,1,1,1];
-    }
-
-
-    return function(elem){
-
-        var transformInterface;
-
-        function _registerMaskInterface(maskManager){
-            _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
-        }
-        function _registerEffectsInterface(effects){
-            _thisLayerFunction.effect = effects;
-        }
-
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Root Vectors Group":
-                case "Contents":
-                case 2:
-                    return _thisLayerFunction.shapeInterface;
-                case 1:
-                case 6:
-                case "Transform":
-                case "transform":
-                case "ADBE Transform Group":
-                    return transformInterface;
-                case 4:
-                case "ADBE Effect Parade":
-                case "effects":
-                case "Effects":
-                    return _thisLayerFunction.effect;
-                case "ADBE Text Properties":
-                    return _thisLayerFunction.textInterface;
-            }
-        }
-        _thisLayerFunction.getMatrix = getMatrix;
-        _thisLayerFunction.invertPoint = invertPoint;
-        _thisLayerFunction.applyPoint = applyPoint;
-        _thisLayerFunction.toWorld = toWorld;
-        _thisLayerFunction.toWorldVec = toWorldVec;
-        _thisLayerFunction.fromWorld = fromWorld;
-        _thisLayerFunction.fromWorldVec = fromWorldVec;
-        _thisLayerFunction.toComp = toWorld;
-        _thisLayerFunction.fromComp = fromComp;
-        _thisLayerFunction.sampleImage = sampleImage;
-        _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
-        _thisLayerFunction._elem = elem;
-        transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
-        var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
-        Object.defineProperties(_thisLayerFunction,{
-            hasParent: {
-                get: function(){
-                    return elem.hierarchy.length;
-                }
-            },
-            parent: {
-                get: function(){
-                    return elem.hierarchy[0].layerInterface;
-                }
-            },
-            rotation: getDescriptor(transformInterface, 'rotation'),
-            scale: getDescriptor(transformInterface, 'scale'),
-            position: getDescriptor(transformInterface, 'position'),
-            opacity: getDescriptor(transformInterface, 'opacity'),
-            anchorPoint: anchorPointDescriptor,
-            anchor_point: anchorPointDescriptor,
-            transform: {
-                get: function () {
-                    return transformInterface;
-                }
-            },
-            active: {
-                get: function(){
-                    return elem.isInRange;
-                }
-            }
-        });
-
-        _thisLayerFunction.startTime = elem.data.st;
-        _thisLayerFunction.index = elem.data.ind;
-        _thisLayerFunction.source = elem.data.refId;
-        _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
-        _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
-        _thisLayerFunction.inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        _thisLayerFunction.outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        _thisLayerFunction._name = elem.data.nm;
-
-        _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
-        _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
-        return _thisLayerFunction;
+        i += 1;
+      }
+      if (typeof value === 'number') {
+        return interfaces[value - 1];
+      }
+      return null;
     };
+
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
+    interfaceFunction.numProperties = interfaces.length;
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.transform = transformInterface;
+    interfaceFunction.propertyIndex = shape.cix;
+    interfaceFunction._name = shape.nm;
+
+    return interfaceFunction;
+  }
+
+  function groupInterfaceFactory(shape, view, propertyGroup) {
+    var interfaceFunction = function _interfaceFunction(value) {
+      switch (value) {
+        case 'ADBE Vectors Group':
+        case 'Contents':
+        case 2:
+          return interfaceFunction.content;
+          // Not necessary for now. Keeping them here in case a new case appears
+          // case 'ADBE Vector Transform Group':
+          // case 3:
+        default:
+          return interfaceFunction.transform;
+      }
+    };
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup);
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.content = content;
+    interfaceFunction.transform = transformInterface;
+    Object.defineProperty(interfaceFunction, '_name', {
+      get: function () {
+        return shape.nm;
+      },
+    });
+    // interfaceFunction.content = interfaceFunction;
+    interfaceFunction.numProperties = shape.np;
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.nm = shape.nm;
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function fillInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
+    return interfaceFunction;
+  }
+
+  function strokeInterfaceFactory(shape, view, propertyGroup) {
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
+    function addPropertyToDashOb(i) {
+      Object.defineProperty(dashOb, shape.d[i].nm, {
+        get: ExpressionPropertyInterface(view.d.dataProps[i].p),
+      });
+    }
+    var i;
+    var len = shape.d ? shape.d.length : 0;
+    var dashOb = {};
+    for (i = 0; i < len; i += 1) {
+      addPropertyToDashOb(i);
+      view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
+    }
+
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      } if (val === 'Stroke Width' || val === 'stroke width') {
+        return interfaceFunction.strokeWidth;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      strokeWidth: {
+        get: ExpressionPropertyInterface(view.w),
+      },
+      dash: {
+        get: function () {
+          return dashOb;
+        },
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
+    return interfaceFunction;
+  }
+
+  function trimInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === shape.e.ix || val === 'End' || val === 'end') {
+        return interfaceFunction.end;
+      }
+      if (val === shape.s.ix) {
+        return interfaceFunction.start;
+      }
+      if (val === shape.o.ix) {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+
+    view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
+    view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.propertyGroup = propertyGroup;
+
+    Object.defineProperties(interfaceFunction, {
+      start: {
+        get: ExpressionPropertyInterface(view.s),
+      },
+      end: {
+        get: ExpressionPropertyInterface(view.e),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function transformInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.a.ix === value || value === 'Anchor Point') {
+        return interfaceFunction.anchorPoint;
+      }
+      if (shape.o.ix === value || value === 'Opacity') {
+        return interfaceFunction.opacity;
+      }
+      if (shape.p.ix === value || value === 'Position') {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') {
+        return interfaceFunction.rotation;
+      }
+      if (shape.s.ix === value || value === 'Scale') {
+        return interfaceFunction.scale;
+      }
+      if ((shape.sk && shape.sk.ix === value) || value === 'Skew') {
+        return interfaceFunction.skew;
+      }
+      if ((shape.sa && shape.sa.ix === value) || value === 'Skew Axis') {
+        return interfaceFunction.skewAxis;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
+    view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
+    view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (view.transform.mProps.sk) {
+      view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
+      view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
+    }
+    view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      opacity: {
+        get: ExpressionPropertyInterface(view.transform.mProps.o),
+      },
+      position: {
+        get: ExpressionPropertyInterface(view.transform.mProps.p),
+      },
+      anchorPoint: {
+        get: ExpressionPropertyInterface(view.transform.mProps.a),
+      },
+      scale: {
+        get: ExpressionPropertyInterface(view.transform.mProps.s),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(view.transform.mProps.r),
+      },
+      skew: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sk),
+      },
+      skewAxis: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sa),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.ty = 'tr';
+    interfaceFunction.mn = shape.mn;
+    interfaceFunction.propertyGroup = propertyGroup;
+    return interfaceFunction;
+  }
+
+  function ellipseInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.s.ix === value) {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function starInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.rotation;
+      }
+      if (shape.pt.ix === value) {
+        return interfaceFunction.points;
+      }
+      if (shape.or.ix === value || value === 'ADBE Vector Star Outer Radius') {
+        return interfaceFunction.outerRadius;
+      }
+      if (shape.os.ix === value) {
+        return interfaceFunction.outerRoundness;
+      }
+      if (shape.ir && (shape.ir.ix === value || value === 'ADBE Vector Star Inner Radius')) {
+        return interfaceFunction.innerRadius;
+      }
+      if (shape.is && shape.is.ix === value) {
+        return interfaceFunction.innerRoundness;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
+    prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
+    prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (shape.ir) {
+      prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
+      prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
+    }
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      points: {
+        get: ExpressionPropertyInterface(prop.pt),
+      },
+      outerRadius: {
+        get: ExpressionPropertyInterface(prop.or),
+      },
+      outerRoundness: {
+        get: ExpressionPropertyInterface(prop.os),
+      },
+      innerRadius: {
+        get: ExpressionPropertyInterface(prop.ir),
+      },
+      innerRoundness: {
+        get: ExpressionPropertyInterface(prop.is),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function rectInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.roundness;
+      }
+      if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      roundness: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function roundedInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.r.ix === value || value === 'Round Corners 1') {
+        return interfaceFunction.radius;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      radius: {
+        get: ExpressionPropertyInterface(prop.rd),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function repeaterInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.c.ix === value || value === 'Copies') {
+        return interfaceFunction.copies;
+      } if (shape.o.ix === value || value === 'Offset') {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
+    prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      copies: {
+        get: ExpressionPropertyInterface(prop.c),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(prop.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  return function (shapes, view, propertyGroup) {
+    var interfaces;
+    function _interfaceFunction(value) {
+      if (typeof value === 'number') {
+        value = value === undefined ? 1 : value;
+        if (value === 0) {
+          return propertyGroup;
+        }
+        return interfaces[value - 1];
+      }
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value) {
+          return interfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    }
+    function parentGroupWrapper() {
+      return propertyGroup;
+    }
+    _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
+    interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
+    _interfaceFunction.numProperties = interfaces.length;
+    _interfaceFunction._name = 'Contents';
+    return _interfaceFunction;
+  };
 }());
 
+/* exported TextExpressionInterface */
+
+var TextExpressionInterface = (function () {
+  return function (elem) {
+    var _prevValue;
+    var _sourceText;
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Text Document':
+          return _thisLayerFunction.sourceText;
+        default:
+          return null;
+      }
+    }
+    Object.defineProperty(_thisLayerFunction, 'sourceText', {
+      get: function () {
+        elem.textProperty.getValue();
+        var stringValue = elem.textProperty.currentData.t;
+        if (stringValue !== _prevValue) {
+          elem.textProperty.currentData.t = _prevValue;
+          _sourceText = new String(stringValue); // eslint-disable-line no-new-wrappers
+          // If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
+          _sourceText.value = stringValue || new String(stringValue); // eslint-disable-line no-new-wrappers
+        }
+        return _sourceText;
+      },
+    });
+    return _thisLayerFunction;
+  };
+}());
+
+/* global Matrix, MaskManagerInterface, TransformExpressionInterface, getDescriptor */
+/* exported LayerExpressionInterface */
+
+var LayerExpressionInterface = (function () {
+  function getMatrix(time) {
+    var toWorldMat = new Matrix();
+    if (time !== undefined) {
+      var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
+      propMatrix.clone(toWorldMat);
+    } else {
+      var transformMat = this._elem.finalTransform.mProp;
+      transformMat.applyToMatrix(toWorldMat);
+    }
+    return toWorldMat;
+  }
+
+  function toWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function toWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function fromWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function fromWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function applyPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.applyToPointArray(arr[0], arr[1], arr[2] || 0);
+  }
+
+  function invertPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.inversePoint(arr);
+  }
+
+  function fromComp(arr) {
+    var toWorldMat = new Matrix();
+    toWorldMat.reset();
+    this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
+      }
+      return toWorldMat.inversePoint(arr);
+    }
+    return toWorldMat.inversePoint(arr);
+  }
+
+  function sampleImage() {
+    return [1, 1, 1, 1];
+  }
+
+  return function (elem) {
+    var transformInterface;
+
+    function _registerMaskInterface(maskManager) {
+      _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
+    }
+    function _registerEffectsInterface(effects) {
+      _thisLayerFunction.effect = effects;
+    }
+
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Root Vectors Group':
+        case 'Contents':
+        case 2:
+          return _thisLayerFunction.shapeInterface;
+        case 1:
+        case 6:
+        case 'Transform':
+        case 'transform':
+        case 'ADBE Transform Group':
+          return transformInterface;
+        case 4:
+        case 'ADBE Effect Parade':
+        case 'effects':
+        case 'Effects':
+          return _thisLayerFunction.effect;
+        case 'ADBE Text Properties':
+          return _thisLayerFunction.textInterface;
+        default:
+          return null;
+      }
+    }
+    _thisLayerFunction.getMatrix = getMatrix;
+    _thisLayerFunction.invertPoint = invertPoint;
+    _thisLayerFunction.applyPoint = applyPoint;
+    _thisLayerFunction.toWorld = toWorld;
+    _thisLayerFunction.toWorldVec = toWorldVec;
+    _thisLayerFunction.fromWorld = fromWorld;
+    _thisLayerFunction.fromWorldVec = fromWorldVec;
+    _thisLayerFunction.toComp = toWorld;
+    _thisLayerFunction.fromComp = fromComp;
+    _thisLayerFunction.sampleImage = sampleImage;
+    _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
+    _thisLayerFunction._elem = elem;
+    transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
+    var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
+    Object.defineProperties(_thisLayerFunction, {
+      hasParent: {
+        get: function () {
+          return elem.hierarchy.length;
+        },
+      },
+      parent: {
+        get: function () {
+          return elem.hierarchy[0].layerInterface;
+        },
+      },
+      rotation: getDescriptor(transformInterface, 'rotation'),
+      scale: getDescriptor(transformInterface, 'scale'),
+      position: getDescriptor(transformInterface, 'position'),
+      opacity: getDescriptor(transformInterface, 'opacity'),
+      anchorPoint: anchorPointDescriptor,
+      anchor_point: anchorPointDescriptor,
+      transform: {
+        get: function () {
+          return transformInterface;
+        },
+      },
+      active: {
+        get: function () {
+          return elem.isInRange;
+        },
+      },
+    });
+
+    _thisLayerFunction.startTime = elem.data.st;
+    _thisLayerFunction.index = elem.data.ind;
+    _thisLayerFunction.source = elem.data.refId;
+    _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
+    _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
+    _thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    _thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    _thisLayerFunction._name = elem.data.nm;
+
+    _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
+    _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
+    return _thisLayerFunction;
+  };
+}());
+
+/* exported CompExpressionInterface */
+
 var CompExpressionInterface = (function () {
-    return function(comp) {
-        function _thisLayerFunction(name) {
-            var i = 0, len = comp.layers.length;
-            while ( i < len) {
-                if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
-                    return comp.elements[i].layerInterface;
-                }
-                i += 1;
-            }
-            return null;
-            //return {active:false};
+  return function (comp) {
+    function _thisLayerFunction(name) {
+      var i = 0;
+      var len = comp.layers.length;
+      while (i < len) {
+        if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
+          return comp.elements[i].layerInterface;
         }
-        Object.defineProperty(_thisLayerFunction, "_name", { value: comp.data.nm });
-        _thisLayerFunction.layer = _thisLayerFunction;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
-        _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
-        _thisLayerFunction.displayStartTime = 0;
-        _thisLayerFunction.numLayers = comp.layers.length;
-        return _thisLayerFunction;
-    };
-}());
-var TransformExpressionInterface = (function (){
-    return function(transform){
-        function _thisFunction(name){
-            switch(name){
-                case "scale":
-                case "Scale":
-                case "ADBE Scale":
-                case 6:
-                    return _thisFunction.scale;
-                case "rotation":
-                case "Rotation":
-                case "ADBE Rotation":
-                case "ADBE Rotate Z":
-                case 10:
-                    return _thisFunction.rotation;
-                case "ADBE Rotate X":
-                    return _thisFunction.xRotation;
-                case "ADBE Rotate Y":
-                    return _thisFunction.yRotation;
-                case "position":
-                case "Position":
-                case "ADBE Position":
-                case 2:
-                    return _thisFunction.position;
-                case 'ADBE Position_0':
-                    return _thisFunction.xPosition;
-                case 'ADBE Position_1':
-                    return _thisFunction.yPosition;
-                case 'ADBE Position_2':
-                    return _thisFunction.zPosition;
-                case "anchorPoint":
-                case "AnchorPoint":
-                case "Anchor Point":
-                case "ADBE AnchorPoint":
-                case 1:
-                    return _thisFunction.anchorPoint;
-                case "opacity":
-                case "Opacity":
-                case 11:
-                    return _thisFunction.opacity;
-            }
-        }
-        Object.defineProperty(_thisFunction, "rotation", {
-            get: ExpressionPropertyInterface(transform.r || transform.rz)
-        });
-
-        Object.defineProperty(_thisFunction, "zRotation", {
-            get: ExpressionPropertyInterface(transform.rz || transform.r)
-        });
-
-        Object.defineProperty(_thisFunction, "xRotation", {
-            get: ExpressionPropertyInterface(transform.rx)
-        });
-
-        Object.defineProperty(_thisFunction, "yRotation", {
-            get: ExpressionPropertyInterface(transform.ry)
-        });
-        Object.defineProperty(_thisFunction, "scale", {
-            get: ExpressionPropertyInterface(transform.s)
-        });
-
-        if(transform.p) {
-            var _transformFactory = ExpressionPropertyInterface(transform.p);
-        } else {
-            var _px = ExpressionPropertyInterface(transform.px);
-            var _py = ExpressionPropertyInterface(transform.py);
-            var _pz;
-            if (transform.pz) {
-                _pz = ExpressionPropertyInterface(transform.pz);
-            }
-        }
-        Object.defineProperty(_thisFunction, "position", {
-            get: function () {
-                if(transform.p) {
-                    return _transformFactory();
-                } else {
-                    return [
-                        _px(),
-                        _py(),
-                        _pz ? _pz() : 0];
-                }
-            }
-        });
-
-        Object.defineProperty(_thisFunction, "xPosition", {
-            get: ExpressionPropertyInterface(transform.px)
-        });
-
-        Object.defineProperty(_thisFunction, "yPosition", {
-            get: ExpressionPropertyInterface(transform.py)
-        });
-
-        Object.defineProperty(_thisFunction, "zPosition", {
-            get: ExpressionPropertyInterface(transform.pz)
-        });
-
-        Object.defineProperty(_thisFunction, "anchorPoint", {
-            get: ExpressionPropertyInterface(transform.a)
-        });
-
-        Object.defineProperty(_thisFunction, "opacity", {
-            get: ExpressionPropertyInterface(transform.o)
-        });
-
-        Object.defineProperty(_thisFunction, "skew", {
-            get: ExpressionPropertyInterface(transform.sk)
-        });
-
-        Object.defineProperty(_thisFunction, "skewAxis", {
-            get: ExpressionPropertyInterface(transform.sa)
-        });
-
-        Object.defineProperty(_thisFunction, "orientation", {
-            get: ExpressionPropertyInterface(transform.or)
-        });
-
-        return _thisFunction;
-    };
-}());
-var ProjectInterface = (function (){
-
-    function registerComposition(comp){
-        this.compositions.push(comp);
+        i += 1;
+      }
+      return null;
+      // return {active:false};
     }
-
-    return function(){
-        function _thisProjectFunction(name){
-            var i = 0, len = this.compositions.length;
-            while(i<len){
-                if(this.compositions[i].data && this.compositions[i].data.nm === name){
-                    if(this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
-                        this.compositions[i].prepareFrame(this.currentFrame);
-                    }
-                    return this.compositions[i].compInterface;
-                }
-                i+=1;
-            }
-        }
-
-        _thisProjectFunction.compositions = [];
-        _thisProjectFunction.currentFrame = 0;
-
-        _thisProjectFunction.registerComposition = registerComposition;
-
-
-
-        return _thisProjectFunction;
-    };
+    Object.defineProperty(_thisLayerFunction, '_name', { value: comp.data.nm });
+    _thisLayerFunction.layer = _thisLayerFunction;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
+    _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
+    _thisLayerFunction.displayStartTime = 0;
+    _thisLayerFunction.numLayers = comp.layers.length;
+    return _thisLayerFunction;
+  };
 }());
-var EffectsExpressionInterface = (function (){
-    var ob = {
-        createEffectsInterface: createEffectsInterface
-    };
 
-    function createEffectsInterface(elem, propertyGroup){
-        if(elem.effectsManager){
+/* global ExpressionPropertyInterface */
+/* exported TransformExpressionInterface */
 
-            var effectElements = [];
-            var effectsData = elem.data.ef;
-            var i, len = elem.effectsManager.effectElements.length;
-            for(i=0;i<len;i+=1){
-                effectElements.push(createGroupInterface(effectsData[i],elem.effectsManager.effectElements[i],propertyGroup,elem));
-            }
-
-            var effects = elem.data.ef || [];
-            var groupInterface = function(name){
-                i = 0, len = effects.length;
-                while(i<len) {
-                    if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                        return effectElements[i];
-                    }
-                    i += 1;
-                }
-            };
-            Object.defineProperty(groupInterface, 'numProperties', {
-                get: function(){
-                    return effects.length;
-                }
-            });
-            return groupInterface
-        }
+var TransformExpressionInterface = (function () {
+  return function (transform) {
+    function _thisFunction(name) {
+      switch (name) {
+        case 'scale':
+        case 'Scale':
+        case 'ADBE Scale':
+        case 6:
+          return _thisFunction.scale;
+        case 'rotation':
+        case 'Rotation':
+        case 'ADBE Rotation':
+        case 'ADBE Rotate Z':
+        case 10:
+          return _thisFunction.rotation;
+        case 'ADBE Rotate X':
+          return _thisFunction.xRotation;
+        case 'ADBE Rotate Y':
+          return _thisFunction.yRotation;
+        case 'position':
+        case 'Position':
+        case 'ADBE Position':
+        case 2:
+          return _thisFunction.position;
+        case 'ADBE Position_0':
+          return _thisFunction.xPosition;
+        case 'ADBE Position_1':
+          return _thisFunction.yPosition;
+        case 'ADBE Position_2':
+          return _thisFunction.zPosition;
+        case 'anchorPoint':
+        case 'AnchorPoint':
+        case 'Anchor Point':
+        case 'ADBE AnchorPoint':
+        case 1:
+          return _thisFunction.anchorPoint;
+        case 'opacity':
+        case 'Opacity':
+        case 11:
+          return _thisFunction.opacity;
+        default:
+          return null;
+      }
     }
-
-    function createGroupInterface(data,elements, propertyGroup, elem){
-
-        function groupInterface(name){
-            var effects = data.ef, i = 0, len = effects.length;
-            while(i<len) {
-                if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                    if(effects[i].ty === 5){
-                        return effectElements[i];
-                    } else {
-                        return effectElements[i]();
-                    }
-                }
-                i += 1;
-            }
-            throw new Error();
-        };
-        var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
-
-        var effectElements = [];
-        var i, len = data.ef.length;
-        for(i=0;i<len;i+=1){
-            if(data.ef[i].ty === 5){
-                effectElements.push(createGroupInterface(data.ef[i],elements.effectElements[i],elements.effectElements[i].propertyGroup, elem));
-            } else {
-                effectElements.push(createValueInterface(elements.effectElements[i],data.ef[i].ty, elem, _propertyGroup));
-            }
-        }
-
-        if(data.mn === 'ADBE Color Control'){
-            Object.defineProperty(groupInterface, 'color', {
-                get: function(){
-                    return effectElements[0]();
-                }
-            });
-        }
-        Object.defineProperties(groupInterface, {
-            numProperties: {
-                get: function(){
-                    return data.np;
-                }
-            },
-            _name: { value: data.nm },
-            propertyGroup: {value: _propertyGroup},
-        });
-        groupInterface.active = groupInterface.enabled = data.en !== 0;
-        return groupInterface;
-    }
-
-    function createValueInterface(element, type, elem, propertyGroup){
-        var expressionProperty = ExpressionPropertyInterface(element.p);
-        function interfaceFunction(){
-            if(type === 10){
-                return elem.comp.compInterface(element.p.v);
-            }
-            return expressionProperty();
-        }
-
-        if(element.p.setGroupProperty) {
-            element.p.setGroupProperty(PropertyInterface('', propertyGroup));
-        }
-
-        return interfaceFunction;
-    }
-
-    return ob;
-
-}());
-var MaskManagerInterface = (function(){
-
-	function MaskInterface(mask, data){
-		this._mask = mask;
-		this._data = data;
-	}
-	Object.defineProperty(MaskInterface.prototype, 'maskPath', {
-        get: function(){
-            if(this._mask.prop.k){
-                this._mask.prop.getValue();
-            }
-            return this._mask.prop;
-        }
-    });
-	Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
-        get: function(){
-            if(this._mask.op.k){
-                this._mask.op.getValue();
-            }
-            return this._mask.op.v * 100;
-        }
+    Object.defineProperty(_thisFunction, 'rotation', {
+      get: ExpressionPropertyInterface(transform.r || transform.rz),
     });
 
-	var MaskManager = function(maskManager, elem){
-		var _maskManager = maskManager;
-		var _elem = elem;
-		var _masksInterfaces = createSizedArray(maskManager.viewData.length);
-		var i, len = maskManager.viewData.length;
-		for(i = 0; i < len; i += 1) {
-			_masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
-		}
+    Object.defineProperty(_thisFunction, 'zRotation', {
+      get: ExpressionPropertyInterface(transform.rz || transform.r),
+    });
 
-		var maskFunction = function(name){
-			i = 0;
-		    while(i<len){
-		        if(maskManager.masksProperties[i].nm === name){
-		            return _masksInterfaces[i];
-		        }
-		        i += 1;
-		    }
-		};
-		return maskFunction;
-	};
-	return MaskManager;
+    Object.defineProperty(_thisFunction, 'xRotation', {
+      get: ExpressionPropertyInterface(transform.rx),
+    });
+
+    Object.defineProperty(_thisFunction, 'yRotation', {
+      get: ExpressionPropertyInterface(transform.ry),
+    });
+    Object.defineProperty(_thisFunction, 'scale', {
+      get: ExpressionPropertyInterface(transform.s),
+    });
+    var _px;
+    var _py;
+    var _pz;
+    var _transformFactory;
+    if (transform.p) {
+      _transformFactory = ExpressionPropertyInterface(transform.p);
+    } else {
+      _px = ExpressionPropertyInterface(transform.px);
+      _py = ExpressionPropertyInterface(transform.py);
+      if (transform.pz) {
+        _pz = ExpressionPropertyInterface(transform.pz);
+      }
+    }
+    Object.defineProperty(_thisFunction, 'position', {
+      get: function () {
+        if (transform.p) {
+          return _transformFactory();
+        }
+        return [
+          _px(),
+          _py(),
+          _pz ? _pz() : 0];
+      },
+    });
+
+    Object.defineProperty(_thisFunction, 'xPosition', {
+      get: ExpressionPropertyInterface(transform.px),
+    });
+
+    Object.defineProperty(_thisFunction, 'yPosition', {
+      get: ExpressionPropertyInterface(transform.py),
+    });
+
+    Object.defineProperty(_thisFunction, 'zPosition', {
+      get: ExpressionPropertyInterface(transform.pz),
+    });
+
+    Object.defineProperty(_thisFunction, 'anchorPoint', {
+      get: ExpressionPropertyInterface(transform.a),
+    });
+
+    Object.defineProperty(_thisFunction, 'opacity', {
+      get: ExpressionPropertyInterface(transform.o),
+    });
+
+    Object.defineProperty(_thisFunction, 'skew', {
+      get: ExpressionPropertyInterface(transform.sk),
+    });
+
+    Object.defineProperty(_thisFunction, 'skewAxis', {
+      get: ExpressionPropertyInterface(transform.sa),
+    });
+
+    Object.defineProperty(_thisFunction, 'orientation', {
+      get: ExpressionPropertyInterface(transform.or),
+    });
+
+    return _thisFunction;
+  };
 }());
 
-var ExpressionPropertyInterface = (function() {
+/* exported ProjectInterface */
 
-    var defaultUnidimensionalValue = {pv:0, v:0, mult: 1}
-    var defaultMultidimensionalValue = {pv:[0,0,0], v:[0,0,0], mult: 1}
+var ProjectInterface = (function () {
+  function registerComposition(comp) {
+    this.compositions.push(comp);
+  }
 
-    function completeProperty(expressionValue, property, type) {
-        Object.defineProperty(expressionValue, 'velocity', {
-            get: function(){
-                return property.getVelocityAtTime(property.comp.currentFrame);
-            }
-        });
-        expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
-        expressionValue.key = function(pos) {
-            if (!expressionValue.numKeys) {
-                return 0;
-            } else {
-                var value = '';
-                if ('s' in property.keyframes[pos-1]) {
-                    value = property.keyframes[pos-1].s;
-                } else if ('e' in property.keyframes[pos-2]) {
-                    value = property.keyframes[pos-2].e;
-                } else {
-                    value = property.keyframes[pos-2].s;
-                }
-                var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value);
-                valueProp.time = property.keyframes[pos-1].t / property.elem.comp.globalData.frameRate;
-                valueProp.value = type === 'unidimensional' ? value[0] : value;
-                return valueProp;
-            }
-        };
-        expressionValue.valueAtTime = property.getValueAtTime;
-        expressionValue.speedAtTime = property.getSpeedAtTime;
-        expressionValue.velocityAtTime = property.getVelocityAtTime;
-        expressionValue.propertyGroup = property.propertyGroup;
+  return function () {
+    function _thisProjectFunction(name) {
+      var i = 0;
+      var len = this.compositions.length;
+      while (i < len) {
+        if (this.compositions[i].data && this.compositions[i].data.nm === name) {
+          if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
+            this.compositions[i].prepareFrame(this.currentFrame);
+          }
+          return this.compositions[i].compInterface;
+        }
+        i += 1;
+      }
+      return null;
     }
 
-    function UnidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultUnidimensionalValue;
+    _thisProjectFunction.compositions = [];
+    _thisProjectFunction.currentFrame = 0;
+
+    _thisProjectFunction.registerComposition = registerComposition;
+
+    return _thisProjectFunction;
+  };
+}());
+
+/* global propertyGroupFactory, ExpressionPropertyInterface, PropertyInterface */
+/* exported EffectsExpressionInterface */
+
+var EffectsExpressionInterface = (function () {
+  var ob = {
+    createEffectsInterface: createEffectsInterface,
+  };
+
+  function createEffectsInterface(elem, propertyGroup) {
+    if (elem.effectsManager) {
+      var effectElements = [];
+      var effectsData = elem.data.ef;
+      var i;
+      var len = elem.effectsManager.effectElements.length;
+      for (i = 0; i < len; i += 1) {
+        effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem));
+      }
+
+      var effects = elem.data.ef || [];
+      var groupInterface = function (name) {
+        i = 0;
+        len = effects.length;
+        while (i < len) {
+          if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+            return effectElements[i];
+          }
+          i += 1;
         }
-        var mult = 1 / property.mult;
-        var val = property.pv * mult;
-        var expressionValue = new Number(val);
+        return null;
+      };
+      Object.defineProperty(groupInterface, 'numProperties', {
+        get: function () {
+          return effects.length;
+        },
+      });
+      return groupInterface;
+    }
+    return null;
+  }
+
+  function createGroupInterface(data, elements, propertyGroup, elem) {
+    function groupInterface(name) {
+      var effects = data.ef;
+      var i = 0;
+      var len = effects.length;
+      while (i < len) {
+        if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+          if (effects[i].ty === 5) {
+            return effectElements[i];
+          }
+          return effectElements[i]();
+        }
+        i += 1;
+      }
+      throw new Error();
+    }
+    var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
+
+    var effectElements = [];
+    var i;
+    var len = data.ef.length;
+    for (i = 0; i < len; i += 1) {
+      if (data.ef[i].ty === 5) {
+        effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem));
+      } else {
+        effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup));
+      }
+    }
+
+    if (data.mn === 'ADBE Color Control') {
+      Object.defineProperty(groupInterface, 'color', {
+        get: function () {
+          return effectElements[0]();
+        },
+      });
+    }
+    Object.defineProperties(groupInterface, {
+      numProperties: {
+        get: function () {
+          return data.np;
+        },
+      },
+      _name: { value: data.nm },
+      propertyGroup: { value: _propertyGroup },
+    });
+    groupInterface.enabled = data.en !== 0;
+    groupInterface.active = groupInterface.enabled;
+    return groupInterface;
+  }
+
+  function createValueInterface(element, type, elem, propertyGroup) {
+    var expressionProperty = ExpressionPropertyInterface(element.p);
+    function interfaceFunction() {
+      if (type === 10) {
+        return elem.comp.compInterface(element.p.v);
+      }
+      return expressionProperty();
+    }
+
+    if (element.p.setGroupProperty) {
+      element.p.setGroupProperty(PropertyInterface('', propertyGroup));
+    }
+
+    return interfaceFunction;
+  }
+
+  return ob;
+}());
+
+/* global createSizedArray */
+/* exported MaskManagerInterface */
+
+var MaskManagerInterface = (function () {
+  function MaskInterface(mask, data) {
+    this._mask = mask;
+    this._data = data;
+  }
+  Object.defineProperty(MaskInterface.prototype, 'maskPath', {
+    get: function () {
+      if (this._mask.prop.k) {
+        this._mask.prop.getValue();
+      }
+      return this._mask.prop;
+    },
+  });
+  Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
+    get: function () {
+      if (this._mask.op.k) {
+        this._mask.op.getValue();
+      }
+      return this._mask.op.v * 100;
+    },
+  });
+
+  var MaskManager = function (maskManager) {
+    var _masksInterfaces = createSizedArray(maskManager.viewData.length);
+    var i;
+    var len = maskManager.viewData.length;
+    for (i = 0; i < len; i += 1) {
+      _masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
+    }
+
+    var maskFunction = function (name) {
+      i = 0;
+      while (i < len) {
+        if (maskManager.masksProperties[i].nm === name) {
+          return _masksInterfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    };
+    return maskFunction;
+  };
+  return MaskManager;
+}());
+
+/* global createTypedArray */
+/* exported ExpressionPropertyInterface */
+
+var ExpressionPropertyInterface = (function () {
+  var defaultUnidimensionalValue = { pv: 0, v: 0, mult: 1 };
+  var defaultMultidimensionalValue = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 };
+
+  function completeProperty(expressionValue, property, type) {
+    Object.defineProperty(expressionValue, 'velocity', {
+      get: function () {
+        return property.getVelocityAtTime(property.comp.currentFrame);
+      },
+    });
+    expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
+    expressionValue.key = function (pos) {
+      if (!expressionValue.numKeys) {
+        return 0;
+      }
+      var value = '';
+      if ('s' in property.keyframes[pos - 1]) {
+        value = property.keyframes[pos - 1].s;
+      } else if ('e' in property.keyframes[pos - 2]) {
+        value = property.keyframes[pos - 2].e;
+      } else {
+        value = property.keyframes[pos - 2].s;
+      }
+      var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value); // eslint-disable-line no-new-wrappers
+      valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate;
+      valueProp.value = type === 'unidimensional' ? value[0] : value;
+      return valueProp;
+    };
+    expressionValue.valueAtTime = property.getValueAtTime;
+    expressionValue.speedAtTime = property.getSpeedAtTime;
+    expressionValue.velocityAtTime = property.getVelocityAtTime;
+    expressionValue.propertyGroup = property.propertyGroup;
+  }
+
+  function UnidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultUnidimensionalValue;
+    }
+    var mult = 1 / property.mult;
+    var val = property.pv * mult;
+    var expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
+    expressionValue.value = val;
+    completeProperty(expressionValue, property, 'unidimensional');
+
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      val = property.v * mult;
+      if (expressionValue.value !== val) {
+        expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
         expressionValue.value = val;
         completeProperty(expressionValue, property, 'unidimensional');
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            val = property.v * mult;
-            if(expressionValue.value !== val) {
-                expressionValue = new Number(val);
-                expressionValue.value = val;
-                completeProperty(expressionValue, property, 'unidimensional');
-            }
-            return expressionValue;
-        }
+  function MultidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultMultidimensionalValue;
     }
+    var mult = 1 / property.mult;
+    var len = (property.data && property.data.l) || property.pv.length;
+    var expressionValue = createTypedArray('float32', len);
+    var arrValue = createTypedArray('float32', len);
+    expressionValue.value = arrValue;
+    completeProperty(expressionValue, property, 'multidimensional');
 
-    function MultidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultMultidimensionalValue;
-        }
-        var mult = 1 / property.mult;
-        var len = (property.data && property.data.l) || property.pv.length;
-        var expressionValue = createTypedArray('float32', len);
-        var arrValue = createTypedArray('float32', len);
-        expressionValue.value = arrValue;
-        completeProperty(expressionValue, property, 'multidimensional');
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      for (var i = 0; i < len; i += 1) {
+        arrValue[i] = property.v[i] * mult;
+        expressionValue[i] = arrValue[i];
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            for (var i = 0; i < len; i += 1) {
-                expressionValue[i] = arrValue[i] = property.v[i] * mult;
-            }
-            return expressionValue;
-        }
-    }
+  // TODO: try to avoid using this getter
+  function defaultGetter() {
+    return defaultUnidimensionalValue;
+  }
 
-    //TODO: try to avoid using this getter
-    function defaultGetter() {
-        return defaultUnidimensionalValue;
+  return function (property) {
+    if (!property) {
+      return defaultGetter;
+    } if (property.propType === 'unidimensional') {
+      return UnidimensionalPropertyInterface(property);
     }
-    
-    return function(property) {
-        if(!property) {
-            return defaultGetter;
-        } else if (property.propType === 'unidimensional') {
-            return UnidimensionalPropertyInterface(property);
-        } else {
-            return MultidimensionalPropertyInterface(property);
-        }
-    }
+    return MultidimensionalPropertyInterface(property);
+  };
 }());
 
-(function(){
+/* global expressionHelpers, TextSelectorProp, ExpressionManager */
+/* exported TextExpressionSelectorProp */
 
-    var TextExpressionSelectorProp = (function(){
-
-        function getValueProxy(index,total){
-            this.textIndex = index+1;
-            this.textTotal = total;
-            this.v = this.getValue() * this.mult;
-            return this.v;
-        }
-
-        return function TextExpressionSelectorProp(elem,data){
-            this.pv = 1;
-            this.comp = elem.comp;
-            this.elem = elem;
-            this.mult = 0.01;
-            this.propType = 'textSelector';
-            this.textTotal = data.totalChars;
-            this.selectorValue = 100;
-            this.lastValue = [1,1,1];
-            this.k = true;
-            this.x = true;
-            this.getValue = ExpressionManager.initiateExpression.bind(this)(elem,data,this);
-            this.getMult = getValueProxy;
-            this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
-            if(this.kf){
-                this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
-            } else {
-                this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
-            }
-            this.setGroupProperty = expressionHelpers.setGroupProperty;
-        };
-    }());
-
-	var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
-	TextSelectorProp.getTextSelectorProp = function(elem, data,arr){
-	    if(data.t === 1){
-	        return new TextExpressionSelectorProp(elem, data,arr);
-	    } else {
-	        return propertyGetTextProp(elem,data,arr);
-	    }
-	};
-}());
-function SliderEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function AngleEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function ColorEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function PointEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function LayerIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function MaskIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function CheckboxEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function NoValueEffect(){
-    this.p = {};
-}
-function EffectsManager(data,element){
-    var effects = data.ef || [];
-    this.effectElements = [];
-    var i,len = effects.length;
-    var effectItem;
-    for(i=0;i<len;i++) {
-        effectItem = new GroupEffect(effects[i],element);
-        this.effectElements.push(effectItem);
+(function () {
+  var TextExpressionSelectorProp = (function () { // eslint-disable-line no-unused-vars
+    function getValueProxy(index, total) {
+      this.textIndex = index + 1;
+      this.textTotal = total;
+      this.v = this.getValue() * this.mult;
+      return this.v;
     }
+
+    return function TextExpressionSelectorPropFactory(elem, data) {
+      this.pv = 1;
+      this.comp = elem.comp;
+      this.elem = elem;
+      this.mult = 0.01;
+      this.propType = 'textSelector';
+      this.textTotal = data.totalChars;
+      this.selectorValue = 100;
+      this.lastValue = [1, 1, 1];
+      this.k = true;
+      this.x = true;
+      this.getValue = ExpressionManager.initiateExpression.bind(this)(elem, data, this);
+      this.getMult = getValueProxy;
+      this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
+      if (this.kf) {
+        this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
+      } else {
+        this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
+      }
+      this.setGroupProperty = expressionHelpers.setGroupProperty;
+    };
+  }());
+
+  var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
+  TextSelectorProp.getTextSelectorProp = function (elem, data, arr) {
+    if (data.t === 1) {
+      return new TextExpressionSelectorPropFactory(elem, data, arr); // eslint-disable-line no-undef
+    }
+    return propertyGetTextProp(elem, data, arr);
+  };
+}());
+
+/* global PropertyFactory */
+/* exported SliderEffect, AngleEffect, ColorEffect, PointEffect, LayerIndexEffect, MaskIndexEffect, CheckboxEffect, NoValueEffect */
+
+function SliderEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function AngleEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function ColorEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function PointEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function LayerIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function MaskIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function CheckboxEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function NoValueEffect() {
+  this.p = {};
 }
 
-function GroupEffect(data,element){
-    this.init(data,element);
+/* global extendPrototype, SliderEffect, AngleEffect, ColorEffect, PointEffect, CheckboxEffect, LayerIndexEffect,
+MaskIndexEffect, NoValueEffect, DynamicPropertyContainer */
+
+function EffectsManager(data, element) {
+  var effects = data.ef || [];
+  this.effectElements = [];
+  var i;
+  var len = effects.length;
+  var effectItem;
+  for (i = 0; i < len; i += 1) {
+    effectItem = new GroupEffect(effects[i], element);
+    this.effectElements.push(effectItem);
+  }
+}
+
+function GroupEffect(data, element) {
+  this.init(data, element);
 }
 
 extendPrototype([DynamicPropertyContainer], GroupEffect);
 
 GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
 
-GroupEffect.prototype.init = function(data,element){
-    this.data = data;
-    this.effectElements = [];
-    this.initDynamicPropertyContainer(element);
-    var i, len = this.data.ef.length;
-    var eff, effects = this.data.ef;
-    for(i=0;i<len;i+=1){
-        eff = null;
-        switch(effects[i].ty){
-            case 0:
-                eff = new SliderEffect(effects[i],element,this);
-                break;
-            case 1:
-                eff = new AngleEffect(effects[i],element,this);
-                break;
-            case 2:
-                eff = new ColorEffect(effects[i],element,this);
-                break;
-            case 3:
-                eff = new PointEffect(effects[i],element,this);
-                break;
-            case 4:
-            case 7:
-                eff = new CheckboxEffect(effects[i],element,this);
-                break;
-            case 10:
-                eff = new LayerIndexEffect(effects[i],element,this);
-                break;
-            case 11:
-                eff = new MaskIndexEffect(effects[i],element,this);
-                break;
-            case 5:
-                eff = new EffectsManager(effects[i],element,this);
-                break;
-            //case 6:
-            default:
-                eff = new NoValueEffect(effects[i],element,this);
-                break;
-        }
-        if(eff) {
-            this.effectElements.push(eff);
-        }
+GroupEffect.prototype.init = function (data, element) {
+  this.data = data;
+  this.effectElements = [];
+  this.initDynamicPropertyContainer(element);
+  var i;
+  var len = this.data.ef.length;
+  var eff;
+  var effects = this.data.ef;
+  for (i = 0; i < len; i += 1) {
+    eff = null;
+    switch (effects[i].ty) {
+      case 0:
+        eff = new SliderEffect(effects[i], element, this);
+        break;
+      case 1:
+        eff = new AngleEffect(effects[i], element, this);
+        break;
+      case 2:
+        eff = new ColorEffect(effects[i], element, this);
+        break;
+      case 3:
+        eff = new PointEffect(effects[i], element, this);
+        break;
+      case 4:
+      case 7:
+        eff = new CheckboxEffect(effects[i], element, this);
+        break;
+      case 10:
+        eff = new LayerIndexEffect(effects[i], element, this);
+        break;
+      case 11:
+        eff = new MaskIndexEffect(effects[i], element, this);
+        break;
+      case 5:
+        eff = new EffectsManager(effects[i], element, this);
+        break;
+        // case 6:
+      default:
+        eff = new NoValueEffect(effects[i], element, this);
+        break;
     }
+    if (eff) {
+      this.effectElements.push(eff);
+    }
+  }
 };
 
-    var lottiejs = {};
 
-    var _isFrozen = false;
+  var lottiejs = {};
 
-    function loadAnimation(params) {
-        return animationManager.loadAnimation(params);
+  function loadAnimation(params) {
+    return animationManager.loadAnimation(params);
+  }
+
+  function setQuality(value) {
+    if (typeof value === 'string') {
+      switch (value) {
+        case 'high':
+          defaultCurveSegments = 200;
+          break;
+        case 'medium':
+          defaultCurveSegments = 50;
+          break;
+        case 'low':
+        default:
+          defaultCurveSegments = 10;
+          break;
+      }
+    } else if (!isNaN(value) && value > 1) {
+      defaultCurveSegments = value;
     }
-
-    function setQuality(value) {
-        if (typeof value === 'string') {
-            switch (value) {
-                case 'high':
-                    defaultCurveSegments = 200;
-                    break;
-                case 'medium':
-                    defaultCurveSegments = 50;
-                    break;
-                case 'low':
-                    defaultCurveSegments = 10;
-                    break;
-            }
-        } else if (!isNaN(value) && value > 1) {
-            defaultCurveSegments = value;
-        }
-        if (defaultCurveSegments >= 50) {
-            roundValues(false);
-        } else {
-            roundValues(true);
-        }
+    if (defaultCurveSegments >= 50) {
+      roundValues(false);
+    } else {
+      roundValues(true);
     }
+  }
 
-    lottiejs.play = animationManager.play;
-    lottiejs.pause = animationManager.pause;
-    lottiejs.togglePause = animationManager.togglePause;
-    lottiejs.setSpeed = animationManager.setSpeed;
-    lottiejs.setDirection = animationManager.setDirection;
-    lottiejs.stop = animationManager.stop;
-    lottiejs.registerAnimation = animationManager.registerAnimation;
-    lottiejs.loadAnimation = loadAnimation;
-    lottiejs.resize = animationManager.resize;
-    lottiejs.goToAndStop = animationManager.goToAndStop;
-    lottiejs.destroy = animationManager.destroy;
-    lottiejs.setQuality = setQuality;
-    lottiejs.freeze = animationManager.freeze;
-    lottiejs.unfreeze = animationManager.unfreeze;
-    lottie.setVolume = animationManager.setVolume;
-    lottie.mute = animationManager.mute;
-    lottie.unmute = animationManager.unmute;
-    lottiejs.getRegisteredAnimations = animationManager.getRegisteredAnimations;
-    lottiejs.version = '5.7.5';
+  lottiejs.play = animationManager.play;
+  lottiejs.pause = animationManager.pause;
+  lottiejs.togglePause = animationManager.togglePause;
+  lottiejs.setSpeed = animationManager.setSpeed;
+  lottiejs.setDirection = animationManager.setDirection;
+  lottiejs.stop = animationManager.stop;
+  lottiejs.registerAnimation = animationManager.registerAnimation;
+  lottiejs.loadAnimation = loadAnimation;
+  lottiejs.resize = animationManager.resize;
+  lottiejs.goToAndStop = animationManager.goToAndStop;
+  lottiejs.destroy = animationManager.destroy;
+  lottiejs.setQuality = setQuality;
+  lottiejs.freeze = animationManager.freeze;
+  lottiejs.unfreeze = animationManager.unfreeze;
+  lottiejs.setVolume = animationManager.setVolume;
+  lottiejs.mute = animationManager.mute;
+  lottiejs.unmute = animationManager.unmute;
+  lottiejs.getRegisteredAnimations = animationManager.getRegisteredAnimations;
+  lottiejs.version = '5.7.6';
 
-    var renderer = '';
-    return lottiejs;
-})({});
+  return lottiejs;
+}({}));
 
 var animations = [];
 
-var onmessage = function(evt) {
-    var canvas = evt.data.canvas;
-    var params = evt.data.params;
-    var ctx = canvas.getContext("2d");
-    var animation = lottiejs.loadAnimation({
-        renderer: 'canvas',
-        loop: evt.data.loop,
-        autoplay: true,
-        animationData: evt.data.animationData,
-        rendererSettings: {
-            context: ctx,
-            scaleMode: 'noScale',
-            clearCanvas: true
-        }
-    });
-    animations.push(animation);
-    animation.play();
+onmessage = function (evt) {
+  var canvas = evt.data.canvas;
+  var ctx = canvas.getContext('2d');
+  var animation = lottie.loadAnimation({
+    renderer: 'canvas',
+    loop: evt.data.loop,
+    autoplay: true,
+    animationData: evt.data.animationData,
+    rendererSettings: {
+      context: ctx,
+      scaleMode: 'noScale',
+      clearCanvas: true,
+    },
+  });
+  animations.push(animation);
+  animation.play();
 };
 
-
 return lottie;
 }));
\ No newline at end of file
diff --git a/build/player/lottie_canvas_worker.min.js b/build/player/lottie_canvas_worker.min.js
index 39a72d7..e08e82f 100644
--- a/build/player/lottie_canvas_worker.min.js
+++ b/build/player/lottie_canvas_worker.min.js
@@ -9,7 +9,7 @@
         root.lottie = factory(root);
         root.bodymovin = root.lottie;
     }
-}((window || {}), function(window) {
-	var lottiejs=function(window){"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e,this.currentTime=currentTime}roundValues(!1);var createElementID=(G=0,function(){return"__lottie_element_"+ ++G}),G;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,p,l;switch(h=r*(1-e),p=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),l=r*(1-(1-o)*e),n%6){case 0:i=r,s=l,a=h;break;case 1:i=p,s=r,a=h;break;case 2:i=h,s=r,a=l;break;case 3:i=h,s=p,a=r;break;case 4:i=l,s=h,a=r;break;case 5:i=r,s=h,a=p}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1==e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i++)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s};function createSizedArray(t){return Array.apply(null,{length:t})}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Oa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Oa[t]||""}),Oa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function p(t,e){return this._t(1,e,t,1,0,0)}function l(t,e){return this.shear(n(t),n(e))}function m(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function f(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,p,l,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=p,this.props[10]=l,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function u(t,e,r,i,s,a,n,o,h,p,l,m,f,c,d,u){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===p&&1===l&&0===m)return y[12]=y[12]*t+y[15]*f,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*l+y[15]*d,y[15]=y[15]*u,this._identityCalculated=!1,this;var g=y[0],v=y[1],P=y[2],b=y[3],x=y[4],_=y[5],S=y[6],T=y[7],A=y[8],E=y[9],C=y[10],k=y[11],D=y[12],I=y[13],M=y[14],w=y[15];return y[0]=g*t+v*s+P*h+b*f,y[1]=g*e+v*a+P*p+b*c,y[2]=g*r+v*n+P*l+b*d,y[3]=g*i+v*o+P*m+b*u,y[4]=x*t+_*s+S*h+T*f,y[5]=x*e+_*a+S*p+T*c,y[6]=x*r+_*n+S*l+T*d,y[7]=x*i+_*o+S*m+T*u,y[8]=A*t+E*s+C*h+k*f,y[9]=A*e+E*a+C*p+k*c,y[10]=A*r+E*n+C*l+k*d,y[11]=A*i+E*o+C*m+k*u,y[12]=D*t+I*s+M*h+w*f,y[13]=D*e+I*a+M*p+w*c,y[14]=D*r+I*n+M*l+w*d,y[15]=D*i+I*o+M*m+w*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function P(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function b(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function x(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function _(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function S(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function T(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function A(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function E(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=A(t[e]);return i}function C(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],p=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+p,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+p,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+p}return i}function k(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function D(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function I(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function M(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function w(){var t=this.props;return"matrix("+M(t[0])+","+M(t[1])+","+M(t[4])+","+M(t[5])+","+M(t[12])+","+M(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=l,this.skewFromAxis=m,this.shear=p,this.scale=f,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=b,this.applyToX=x,this.applyToY=_,this.applyToZ=S,this.applyToPointArray=k,this.applyToTriplePoints=C,this.applyToPointStringified=D,this.toCSS=I,this.to2dCSS=w,this.clone=v,this.cloneFromProps=P,this.equals=g,this.inversePoints=E,this.inversePoint=A,this.getInverseMatrix=T,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var p,l=this,m=256,f=6,c="random",d=h.pow(m,f),u=h.pow(2,52),y=2*u,g=m-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<m;)a[i]=i++;for(i=0;i<m;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*m+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function P(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function b(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=b(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,x(o)]:null===t?function(){try{if(p)return x(p.randomBytes(m));var t=new Uint8Array(m);return(l.crypto||l.msCrypto).getRandomValues(t),x(t)}catch(t){var e=l.navigator,r=e&&e.plugins;return[+new Date,l,r,l.screen,x(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(f),e=d,r=0;t<u;)t=(t+r)*m,e*=m,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,b(x(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&P(i,a),t.state=function(){return P(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},b(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var p=11,l=1/(p-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function m(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function f(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(p):new Array(p),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:m(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<p;++r)this._mSampleValues[r]=m(r*l,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=p-1;a!==n&&i[a]<=t;++a)s+=l;var o=s+(t-i[--a])/(i[a+1]-i[a])*l,h=f(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=f(e,r,i);if(0===a)return e;e-=(m(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=m(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+l,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)i.hasOwnProperty(a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var l=function(t,e,r,i){var s,a,n,o,h,p,l=defaultCurveSegments,m=0,f=[],c=[],d=bezier_length_pool.newElement();for(n=r.length,s=0;s<l;s+=1){for(h=s/(l-1),a=p=0;a<n;a+=1)o=bm_pow(1-h,3)*t[a]+3*bm_pow(1-h,2)*h*r[a]+3*(1-h)*bm_pow(h,2)*i[a]+bm_pow(h,3)*e[a],f[a]=o,null!==c[a]&&(p+=bm_pow(f[a]-c[a],2)),c[a]=f[a];p&&(m+=p=bm_sqrt(p)),d.percents[s]=h,d.lengths[s]=m}return d.addedLength=m,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var P,t=(P={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!P[s]){var a,n,o,h,p,l,m,f=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(f=2);var u=new g(f);for(o=r.length,a=0;a<f;a+=1){for(m=createSizedArray(o),p=a/(f-1),n=l=0;n<o;n+=1)h=bm_pow(1-p,3)*t[n]+3*bm_pow(1-p,2)*p*(t[n]+r[n])+3*(1-p)*bm_pow(p,2)*(e[n]+i[n])+bm_pow(p,3)*e[n],m[n]=h,null!==d&&(l+=bm_pow(m[n]-d[n],2));c+=l=bm_sqrt(l),u.points[a]=new v(l,m),d=m}u.segmentLength=c,P[s]=u}return P[s]});function D(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bm_floor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,p=!0;p;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),p=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];p=!1}return r[a]+(r[a+1]-r[a])*o}var I=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segments_length_pool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,p=0;for(e=0;e<o-1;e+=1)h[e]=l(s[e],s[e+1],a[e],n[e+1]),p+=h[e].addedLength;return i&&o&&(h[e]=l(s[e],s[0],a[e],n[0]),p+=h[e].addedLength),r.totalLength=p,r},getNewSegment:function(t,e,r,i,s,a,n){var o,h=D(s=s<0?0:1<s?1:s,n),p=D(a=1<a?1:a,n),l=t.length,m=1-h,f=1-p,c=m*m*m,d=h*m*m*3,u=h*h*m*3,y=h*h*h,g=m*m*f,v=h*m*f+m*h*f+m*m*p,P=h*h*f+m*h*p+h*m*p,b=h*h*p,x=m*f*f,_=h*f*f+m*p*f+m*f*p,S=h*p*f+m*p*p+h*f*p,T=h*p*p,A=f*f*f,E=p*f*f+f*p*f+f*f*p,C=p*p*f+f*p*p+p*f*p,k=p*p*p;for(o=0;o<l;o+=1)I[4*o]=Math.round(1e3*(c*t[o]+d*r[o]+u*i[o]+y*e[o]))/1e3,I[4*o+1]=Math.round(1e3*(g*t[o]+v*r[o]+P*i[o]+b*e[o]))/1e3,I[4*o+2]=Math.round(1e3*(x*t[o]+_*r[o]+S*i[o]+T*e[o]))/1e3,I[4*o+3]=Math.round(1e3*(A*t[o]+E*r[o]+C*i[o]+k*e[o]))/1e3;return I},getPointInSegment:function(t,e,r,i,s,a){var n=D(s,a),o=1-n;return[Math.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var p,l=Math.sqrt(Math.pow(i-t,2)+Math.pow(s-e,2)+Math.pow(a-r,2)),m=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-r,2)),f=Math.sqrt(Math.pow(n-i,2)+Math.pow(o-s,2)+Math.pow(h-a,2));return-1e-4<(p=m<l?f<l?l-m-f:f-m-l:m<f?f-m-l:m-l-f)&&p<1e-4}}}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var r=(new Date).getTime(),i=Math.max(0,16-(r-a)),s=setTimeout(function(){t(r+i)},i);return a=r+i,s}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function m(t,e,r){var i,s,a,n,o,h,p=t.length;for(s=0;s<p;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),[],-1,i.hasMask){var l=i.masksProperties;for(n=l.length,a=0;a<n;a+=1)if(l[a].pt.k.i)d(l[a].pt.k);else for(h=l[a].pt.k.length,o=0;o<h;o+=1)l[a].pt.k[o].s&&d(l[a].pt.k[o].s[0]),l[a].pt.k[o].e&&d(l[a].pt.k[o].e[0])}0===i.ty?(i.layers=f(i.refId,e),m(i.layers,e,r)):4===i.ty?c(i.shapes):5==i.ty&&u(i,r)}}function f(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)d(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&d(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&d(t[e].ks.k[r].e[0]);!0}else"gr"==t[e].ty&&c(t[e].it)}function d(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&void 0))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(d(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function p(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);!0}else"gr"==t[e].ty&&p(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&p(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t,e){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=m,t}var dataManager=dataFunctionManager();dataManager.completeData=function(t,e){t.__complete||(this.checkColors(t),this.checkChars(t),this.checkShapes(t),this.completeLayers(t.layers,t.assets,e),t.__complete=!0)};var FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function u(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=function(t){var e,r=t.split(","),i=r.length,s=[];for(e=0;e<i;e+=1)"sans-serif"!==r[e]&&"monospace"!==r[e]&&s.push(r[e]);return s.join(",")}(t)+", "+e,{node:i,w:s,parent:r}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){this.chars||(this.chars=[]);var e,r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i,s,a,n=t.list,o=n.length,h=o;for(r=0;r<o;r+=1){var p,l,m=!0;if(n[r].loaded=!1,n[r].monoCase=u(n[r].fFamily,"monospace"),n[r].sansCase=u(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){if(0<(p=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[r].fFamily+'"], style[f-origin="3"][f-family="'+n[r].fFamily+'"]')).length&&(m=!1),m){var f=createTag("style");f.setAttribute("f-forigin",n[r].fOrigin),f.setAttribute("f-origin",n[r].origin),f.setAttribute("f-family",n[r].fFamily),f.type="text/css",f.innerText="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",e.appendChild(f)}}else if("g"===n[r].fOrigin||1===n[r].origin){for(p=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),l=0;l<p.length;l++)-1!==p[l].href.indexOf(n[r].fPath)&&(m=!1);if(m){var c=createTag("link");c.setAttribute("f-forigin",n[r].fOrigin),c.setAttribute("f-origin",n[r].origin),c.type="text/css",c.rel="stylesheet",c.href=n[r].fPath,document.body.appendChild(c)}}else if("t"===n[r].fOrigin||2===n[r].origin){for(p=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),l=0;l<p.length;l++)n[r].fPath===p[l].src&&(m=!1);if(m){var d=createTag("link");d.setAttribute("f-forigin",n[r].fOrigin),d.setAttribute("f-origin",n[r].origin),d.setAttribute("rel","stylesheet"),d.setAttribute("href",n[r].fPath),e.appendChild(d)}}}else n[r].loaded=!0,h-=1;n[r].helper=(i=e,s=n[r],a=void 0,(a=createNS("text")).style.fontSize="100px",a.setAttribute("font-family",s.fFamily),a.setAttribute("font-style",s.fStyle),a.setAttribute("font-weight",s.fWeight),a.textContent="1",s.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",s.fClass)):a.style.fontFamily=s.fFamily,i.appendChild(a),createTag("canvas").getContext("2d").font=s.fWeight+" "+s.fStyle+" 100px "+s.fFamily,a),n[r].cache={},this.fonts.push(n[r])}0===h?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,r)),a},getFontByName:function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},checkLoadedFonts:function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}();FontManager=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this.initTime=Date.now()};var PropertyFactory=function(){var m=initialDefaultFrame,s=Math.abs;function f(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,p,l,m,f=e.lastIndex,c=f,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>t){f=c;break}c<d-1?c+=1:(f=0,u=!1)}var y,g,v,P,b,x,_,S,T,A,E=a.t-i,C=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var k=s.bezierData;if(E<=t||t<C){var D=E<=t?k.points.length-1:0;for(o=k.points[D].point.length,n=0;n<o;n+=1)r[n]=k.points[D].point[n]}else{s.__fnct?m=s.__fnct:(m=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=m),h=m((t-C)/(E-C));var I,M=k.segmentLength*h,w=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(l=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,p=k.points.length;u;){if(w+=k.points[l].partialLength,0===M||0===h||l===k.points.length-1){for(o=k.points[l].point.length,n=0;n<o;n+=1)r[n]=k.points[l].point[n];break}if(w<=M&&M<w+k.points[l+1].partialLength){for(I=(M-w)/k.points[l+1].partialLength,o=k.points[l].point.length,n=0;n<o;n+=1)r[n]=k.points[l].point[n]+(k.points[l+1].point[n]-k.points[l].point[n])*I;break}l<p-1?l+=1:u=!1}e._lastPoint=l,e._lastAddedLength=w-k.points[l].partialLength,e._lastKeyframeIndex=c}}else{var F,V,R,L,B;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(E<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=C)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var O=G(s.s),z=G(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],p=t[0],l=t[1],m=t[2],f=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=p*c+l*d+m*u+f*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*p+o*c,h[1]=n*l+o*d,h[2]=n*m+o*u,h[3]=n*f+o*y,h}(O,z,(t-C)/(E-C)),P=v[0],b=v[1],x=v[2],_=v[3],S=Math.atan2(2*b*_-2*P*x,1-2*b*b-2*x*x),T=Math.asin(2*P*b+2*x*_),A=Math.atan2(2*P*_-2*b*x,1-2*P*P-2*x*x),g[0]=S/degToRads,g[1]=T/degToRads,g[2]=A/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=E<=t?1:t<C?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?m=s.__fnct[c]:(F=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],V=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],R=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],L=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],m=BezierFactory.getBezierEasing(F,V,R,L).get,s.__fnct[c]=m)):s.__fnct?m=s.__fnct:(F=s.o.x,V=s.o.y,R=s.i.x,L=s.i.y,m=BezierFactory.getBezierEasing(F,V,R,L).get,s.__fnct=m),m((t-C)/(E-C)))),y=a.s||s.e,B=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=B:r=B}return e.lastIndex=f,r}function G(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),p=Math.sin(i/2);return[o*h*n+s*a*p,o*a*n+s*h*p,s*h*n-o*a*p,s*a*n-o*h*p]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==m&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,r,i){this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,a=e.k.length;this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a);createTypedArray("float32",a);for(this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:m,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=m,this.pv=m,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.effectsSequence=[c.bind(this)],this.addEffect=y}function p(t,e,r,i){this.propType="multidimensional";var s,a,n,o,h,p=e.k.length;for(s=0;s<p-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.frameId=-1;var l=e.k[0].s.length;for(this.v=createTypedArray("float32",l),this.pv=createTypedArray("float32",l),s=0;s<l;s+=1)this.v[s]=m,this.pv[s]=m;this._caching={lastFrame:m,lastIndex:0,value:createTypedArray("float32",l)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new p(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,r,i=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)r=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],r=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(e[0]=s.getValueAtTime((s.keyframes[0].t+.01)/i,0),e[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=s.getValueAtTime(s.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(e[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/i,0),e[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(e=[s.pv,a.pv],r[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/i,s.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else e=r=n;this.v.rotate(-Math.atan2(e[1]-r[1],e[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=point_pool.newElement(),this.o[r]=point_pool.newElement(),this.i[r]=point_pool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}(!a[i]||a[i]&&!s)&&(a[i]=point_pool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,p,l,m,f=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,f=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(f=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)l=1;else if(t<d.t-this.offsetTime)l=0;else{var P;d.__fnct?P=d.__fnct:(P=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=P),l=P((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}i=d.s[0]}for(h=e._length,p=i.i[0].length,r.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<p;o+=1)m=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*l,e.i[n][o]=m,m=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*l,e.o[n][o]=m,m=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*l,e.v[n][o]=m}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shape_pool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,r=this.effectsSequence.length;for(t=0;t<r;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shape_pool.clone(i),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=shape_pool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,p=this.os.v,l=this.is.v,m=2*Math.PI*o/(2*s),f=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?p:l,i=n?m:f;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*i*r*d,y-v*i*r*d,u+g*i*r*d,y+v*i*r*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),p=i*Math.sin(n),l=0===h&&0===p?0:p/Math.sqrt(h*h+p*p),m=0===h&&0===p?0:-h/Math.sqrt(h*h+p*p);h+=+this.p.v[0],p+=+this.p.v[1],this.v.setTripleAt(h,p,h-l*a*s*o,p-m*a*s*o,h+l*a*s*o,p+m*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bm_min(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var m={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new l(t,e):6===r?i=new h(t,e):7===r&&(i=new p(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return m}(),ShapeModifiers=(hs={},is={},hs.registerModifier=function(t,e){is[t]||(is[t]=e)},hs.getModifier=function(t,e,r){return new is[t](e,r)},hs),hs,is;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var s,a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollection_pool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],p=a.length;for(n=0;n<p;n+=1){var l,m;if((o=a[n]).e*s<i||o.s*s>i+r);else l=o.s*s<=i?0:(o.s*s-i)/r,m=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([l,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segments_length_pool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i;if(this._mdf||t){var s=this.o.v%360/360;if(s<0&&(s+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+s,(r=(1<this.e.v?1:this.e.v<0?0:this.e.v)+s)<e){var a=e;e=r,r=a}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var n,o,h,p,l,m,f=this.shapes.length,c=0;if(r===e)for(n=0;n<f;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(n=0;n<f;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var d,u,y=[];for(n=0;n<f;n+=1)if((d=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=d.shape.paths)._length,m=0,!d.shape._mdf&&d.pathsData.length)m=d.totalShapeLength;else{for(p=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)l=bez.getSegmentsLength(i.shapes[o]),p.push(l),m+=l.totalLength;d.totalShapeLength=m,d.pathsData=p}c+=m,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,P=r,b=0;for(n=f-1;0<=n;n-=1)if((d=this.shapes[n]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<f?(g=this.calculateShapeEdges(e,r,d.totalShapeLength,b,c),b+=d.totalShapeLength):g=[[v,P]],h=g.length,o=0;o<h;o+=1){v=g[o][0],P=g[o][1],y.length=0,P<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*P}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(P-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(P-1)}));var x=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var _=x.pop();this.addPaths(x,u),x=this.addShapes(d,y[1],_)}else this.addPaths(x,u),x=this.addShapes(d,y[1]);this.addPaths(x,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,p,l,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(l=r?(o=r._length,r._length):(r=shape_pool.newElement(),o=0),u.push(r),i=0;i<c;i+=1){for(h=m[i].lengths,r.c=f[i].c,a=f[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,r.c=!1;else{if(d>e.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[s],f[i].v[s],r,o,y),y=!1):(p=bez.getNewSegment(f[i].v[s-1],f[i].v[s],f[i].o[s-1],f[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[i].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[0],f[i].v[0],r,o,y),y=!1):(p=bez.getNewSegment(f[i].v[s-1],f[i].v[0],f[i].o[s-1],f[i].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[l][0],r.v[l][1],"i",l),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;i<c-1&&(r=shape_pool.newElement(),y=!0,u.push(r),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r=shape_pool.newElement();r.c=t.c;var i,s,a,n,o,h,p,l,m,f,c,d,u,y=t._length,g=0;for(i=0;i<y;i+=1)s=t.v[i],n=t.o[i],a=t.i[i],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==i&&i!==y-1||t.c?(o=0===i?t.v[y-1]:t.v[i-1],p=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,l=d=s[0]+(o[0]-s[0])*p,m=u=s[1]-(s[1]-o[1])*p,f=l-(l-s[0])*roundCorner,c=m-(m-s[1])*roundCorner,r.setTripleAt(l,m,f,c,d,u,g),g+=1,o=i===y-1?t.v[0]:t.v[i+1],p=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,l=f=s[0]+(o[0]-s[0])*p,m=c=s[1]+(o[1]-s[1])*p,d=l-(l-s[0])*roundCorner,u=m-(m-s[1])*roundCorner,r.setTripleAt(l,m,f,c,d,u,g)):r.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):r.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],g),g+=1;return r},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if((a=this.shapes[r]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var r=e/100,i=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)i[0]+=t.v[a][0],i[1]+=t.v[a][1];i[0]/=s,i[1]/=s;var n,o,h,p,l,m,f=shape_pool.newElement();for(f.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(i[0]-t.v[a][0])*r,o=t.v[a][1]+(i[1]-t.v[a][1])*r,h=t.o[a][0]+(i[0]-t.o[a][0])*-r,p=t.o[a][1]+(i[1]-t.o[a][1])*-r,l=t.i[a][0]+(i[0]-t.i[a][0])*-r,m=t.i[a][1]+(i[1]-t.i[a][1])*-r,f.setTripleAt(n,o,h,p,l,m,a);return f},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(r=0;r<o;r+=1){if((a=this.shapes[r]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);for(;0<r;)r-=1,this._elements.unshift(e[r]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var p=this.o.v,l=p%1,m=0<p?Math.floor(p):Math.ceil(p),f=(this.tr.v.props,this.pMatrix.props),c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<p){for(;g<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,l,!1),g+=l)}else if(p<0){for(;m<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-l,!0),g-=l)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),u=0;u<y;u+=1)r[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)r[u]=this.matrix.props[u];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shape_pool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(t){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){},featureSupport=(Lw={maskType:!0},(/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))&&(Lw.maskType=!1),Lw),Lw,filtersFactory=(Mw={},Mw.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},Mw.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},Mw),Mw,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}(),assetLoader=null;function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,p,l,m,f,c,d,u,y,g,v,P,b,x=this._moreOptions.alignment.v,_=this._animatorsData,S=this._textData,T=this.mHelper,A=this._renderType,E=this.renderedLetters.length,C=(this.data,t.l);if(this._hasMaskedPath){if(b=this._pathData.m,!this._pathData.n||this._pathData._mdf){var k,D=b.v;for(this._pathData.r&&(D=D.reverse()),n={tLength:0,segments:[]},a=D._length-1,s=g=0;s<a;s+=1)k=bez.buildBezierData(D.v[s],D.v[s+1],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[s+1][0]-D.v[s+1][0],D.i[s+1][1]-D.v[s+1][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength;s=a,b.v.c&&(k=bez.buildBezierData(D.v[s],D.v[0],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[0][0]-D.v[0][0],D.i[0][1]-D.v[0][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,m=1,l=!(p=f=0),u=n.segments,o<0&&b.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),m=(d=u[f=u.length-1].points).length-1;o<0;)o+=d[m].partialLength,(m-=1)<0&&(m=(d=u[f-=1].points).length-1);c=(d=u[f].points)[m-1],y=(h=d[m]).partialLength}a=C.length,i=r=0;var I,M,w,F,V=1.2*t.finalSize*.714,R=!0;w=_.length;var L,B,O,z,G,N,j,q,H,W,Y,X,$,K=-1,J=o,Z=f,U=m,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(C[s].n){for(rt&&(rt+=it);at<s;)C[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(M=0;M<w;M+=1)(I=_[M].a).t.propType&&(nt&&2===t.j&&(it+=I.t.v*st),(L=_[M].s.getMult(C[s].anIndexes[M],S.a[M].s.totalChars)).length?rt+=I.t.v*L[0]*st:rt+=I.t.v*L*st);nt=!1}for(rt&&(rt+=it);at<s;)C[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(T.reset(),G=1,C[s].n)r=0,i+=t.yOffset,i+=R?1:0,o=J,R=!1,0,this._hasMaskedPath&&(m=U,c=(d=u[f=Z].points)[m-1],y=(h=d[m]).partialLength,p=0),$=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==C[s].line){switch(t.j){case 1:o+=g-t.lineWidths[C[s].line];break;case 2:o+=(g-t.lineWidths[C[s].line])/2}Q=C[s].line}K!==C[s].ind&&(C[K]&&(o+=C[K].extra),o+=C[s].an/2,K=C[s].ind),o+=x[0]*C[s].an/200;var ot=0;for(M=0;M<w;M+=1)(I=_[M].a).p.propType&&((L=_[M].s.getMult(C[s].anIndexes[M],S.a[M].s.totalChars)).length?ot+=I.p.v[0]*L[0]:ot+=I.p.v[0]*L),I.a.propType&&((L=_[M].s.getMult(C[s].anIndexes[M],S.a[M].s.totalChars)).length?ot+=I.a.v[0]*L[0]:ot+=I.a.v[0]*L);for(l=!0;l;)o+ot<=p+y||!d?(v=(o+ot-p)/h.partialLength,O=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,T.translate(-x[0]*C[s].an/200,-x[1]*V/100),l=!1):d&&(p+=h.partialLength,(m+=1)>=d.length&&(m=0,d=u[f+=1]?u[f].points:b.v.c?u[f=m=0].points:(p-=h.partialLength,null)),d&&(c=h,y=(h=d[m]).partialLength));B=C[s].an/2-C[s].add,T.translate(-B,0,0)}else B=C[s].an/2-C[s].add,T.translate(-B,0,0),T.translate(-x[0]*C[s].an/200,-x[1]*V/100,0);for(C[s].l/2,M=0;M<w;M+=1)(I=_[M].a).t.propType&&(L=_[M].s.getMult(C[s].anIndexes[M],S.a[M].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?L.length?o+=I.t.v*L[0]:o+=I.t.v*L:L.length?r+=I.t.v*L[0]:r+=I.t.v*L));for(C[s].l/2,t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(N=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(q=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<w;M+=1)(I=_[M].a).a.propType&&((L=_[M].s.getMult(C[s].anIndexes[M],S.a[M].s.totalChars)).length?T.translate(-I.a.v[0]*L[0],-I.a.v[1]*L[1],I.a.v[2]*L[2]):T.translate(-I.a.v[0]*L,-I.a.v[1]*L,I.a.v[2]*L));for(M=0;M<w;M+=1)(I=_[M].a).s.propType&&((L=_[M].s.getMult(C[s].anIndexes[M],S.a[M].s.totalChars)).length?T.scale(1+(I.s.v[0]-1)*L[0],1+(I.s.v[1]-1)*L[1],1):T.scale(1+(I.s.v[0]-1)*L,1+(I.s.v[1]-1)*L,1));for(M=0;M<w;M+=1){if(I=_[M].a,L=_[M].s.getMult(C[s].anIndexes[M],S.a[M].s.totalChars),I.sk.propType&&(L.length?T.skewFromAxis(-I.sk.v*L[0],I.sa.v*L[1]):T.skewFromAxis(-I.sk.v*L,I.sa.v*L)),I.r.propType&&(L.length?T.rotateZ(-I.r.v*L[2]):T.rotateZ(-I.r.v*L)),I.ry.propType&&(L.length?T.rotateY(I.ry.v*L[1]):T.rotateY(I.ry.v*L)),I.rx.propType&&(L.length?T.rotateX(I.rx.v*L[0]):T.rotateX(I.rx.v*L)),I.o.propType&&(L.length?G+=(I.o.v*L[0]-G)*L[0]:G+=(I.o.v*L-G)*L),t.strokeWidthAnim&&I.sw.propType&&(L.length?j+=I.sw.v*L[0]:j+=I.sw.v*L),t.strokeColorAnim&&I.sc.propType)for(H=0;H<3;H+=1)L.length?N[H]=N[H]+(I.sc.v[H]-N[H])*L[0]:N[H]=N[H]+(I.sc.v[H]-N[H])*L;if(t.fillColorAnim&&t.fc){if(I.fc.propType)for(H=0;H<3;H+=1)L.length?q[H]=q[H]+(I.fc.v[H]-q[H])*L[0]:q[H]=q[H]+(I.fc.v[H]-q[H])*L;I.fh.propType&&(q=L.length?addHueToRGB(q,I.fh.v*L[0]):addHueToRGB(q,I.fh.v*L)),I.fs.propType&&(q=L.length?addSaturationToRGB(q,I.fs.v*L[0]):addSaturationToRGB(q,I.fs.v*L)),I.fb.propType&&(q=L.length?addBrightnessToRGB(q,I.fb.v*L[0]):addBrightnessToRGB(q,I.fb.v*L))}}for(M=0;M<w;M+=1)(I=_[M].a).p.propType&&(L=_[M].s.getMult(C[s].anIndexes[M],S.a[M].s.totalChars),this._hasMaskedPath?L.length?T.translate(0,I.p.v[1]*L[0],-I.p.v[2]*L[1]):T.translate(0,I.p.v[1]*L,-I.p.v[2]*L):L.length?T.translate(I.p.v[0]*L[0],I.p.v[1]*L[1],-I.p.v[2]*L[2]):T.translate(I.p.v[0]*L,I.p.v[1]*L,-I.p.v[2]*L));if(t.strokeWidthAnim&&(W=j<0?0:j),t.strokeColorAnim&&(Y="rgb("+Math.round(255*N[0])+","+Math.round(255*N[1])+","+Math.round(255*N[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(T.translate(0,-t.ls),T.translate(0,x[1]*V/100+i,0),S.p.p){P=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(P)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),T.rotate(-ht*Math.PI/180)}T.translate(O,z,0),o-=x[0]*C[s].an/200,C[s+1]&&K!==C[s+1].ind&&(o+=C[s].an/2,o+=t.tr/1e3*t.finalSize)}else{switch(T.translate(r,i,0),t.ps&&T.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:T.translate(C[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[C[s].line]),0,0);break;case 2:T.translate(C[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[C[s].line])/2,0,0)}T.translate(0,-t.ls),T.translate(B,0,0),T.translate(x[0]*C[s].an/200,x[1]*V/100,0),r+=C[s].l+t.tr/1e3*t.finalSize}"html"===A?tt=T.toCSS():"svg"===A?tt=T.to2dCSS():et=[T.props[0],T.props[1],T.props[2],T.props[3],T.props[4],T.props[5],T.props[6],T.props[7],T.props[8],T.props[9],T.props[10],T.props[11],T.props[12],T.props[13],T.props[14],T.props[15]],$=G}this.lettersChangedFlag=E<=s?(F=new LetterProps($,W,Y,X,tt,et),this.renderedLetters.push(F),E+=1,!0):(F=this.renderedLetters[s]).update($,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var i,s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&(t[r].s,!(r===i-1||t[r+1].t>e));)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),++s):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,p=this.data,l=[],m=0,f=p.m.g,c=0,d=0,u=0,y=[],g=0,v=0,P=h.getFontByName(t.f),b=0,x=P.fStyle?P.fStyle.split(" "):[],_="normal",S="normal";for(r=x.length,e=0;e<r;e+=1)switch(x[e].toLowerCase()){case"italic":S="italic";break;case"bold":_="700";break;case"black":_="900";break;case"medium":_="500";break;case"regular":case"normal":_="400";break;case"light":case"thin":_="200"}t.fWeight=P.fWeight||_,t.fStyle=S,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var T,A=t.tr/1e3*t.finalSize;if(t.sz)for(var E,C,k=!0,D=t.sz[0],I=t.sz[1];k;){g=E=0,r=(C=this.buildFinalText(t.t)).length,A=t.tr/1e3*t.finalSize;var M=-1;for(e=0;e<r;e+=1)T=C[e].charCodeAt(0),i=!1," "===C[e]?M=e:13!==T&&3!==T||(i=!(g=0),E+=t.finalLineHeight||1.2*t.finalSize),D<g+(b=h.chars?(o=h.getCharData(C[e],P.fStyle,P.fFamily),i?0:o.w*t.finalSize/100):h.measureText(C[e],t.f,t.finalSize))&&" "!==C[e]?(-1===M?r+=1:e=M,E+=t.finalLineHeight||1.2*t.finalSize,C.splice(e,M===e?1:0,"\r"),M=-1,g=0):(g+=b,g+=A);E+=P.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&I<E?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=C,r=t.finalText.length,k=!1)}g=-A;var w,F=b=0;for(e=0;e<r;e+=1)if(i=!1,13===(T=(w=t.finalText[e]).charCodeAt(0))||3===T?(F=0,y.push(g),v=v<g?g:v,g=-2*A,i=!(s=""),u+=1):s=w,b=h.chars?(o=h.getCharData(w,P.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===w?F+=b+A:(g+=b+A+F,F=0),l.push({l:b,an:b,add:c,n:i,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==f){if(c+=b,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=b);d<=e;)l[d].an=c,l[d].ind=m,l[d].extra=b,d+=1;m+=1,c=0}}else if(3==f){if(c+=b,""===s||e===r-1){for(""===s&&(c-=b);d<=e;)l[d].an=c,l[d].ind=m,l[d].extra=b,d+=1;c=0,m+=1}}else l[m].ind=m,l[m].extra=0,m+=1;if(t.l=l,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var V,R,L=p.a;n=L.length;var B,O,z=[];for(a=0;a<n;a+=1){for((V=L[a]).a.sc&&(t.strokeColorAnim=!0),V.a.sw&&(t.strokeWidthAnim=!0),(V.a.fc||V.a.fh||V.a.fs||V.a.fb)&&(t.fillColorAnim=!0),O=0,B=V.s.b,e=0;e<r;e+=1)(R=l[e]).anIndexes[a]=O,(1==B&&""!==R.val||2==B&&""!==R.val&&" "!==R.val||3==B&&(R.n||" "==R.val||e==r-1)||4==B&&(R.n||e==r-1))&&(1===V.s.rn&&z.push(O),O+=1);p.a[a].s.totalChars=O;var G,N=-1;if(1===V.s.rn)for(e=0;e<r;e+=1)N!=(R=l[e]).anIndexes[a]&&(N=R.anIndexes[a],G=z.splice(Math.floor(Math.random()*z.length),1)[0]),R.anIndexes[a]=G}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=P.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,p=this.data.sh;if(2===p)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===p)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===p)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===p){if(h===o)n=0;else{var l=h-o,m=-l/2+(t=d(c(0,t+.5-o),h-o)),f=l/2;n=Math.sqrt(1-m*m/(f*f))}n=a(n)}else n=6===p?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),pool_factory=function(t,e,r,i){var s=0,a=t,n=createSizedArray(a);function o(){return s?n[s-=1]:e()}return{newElement:o,release:function(t){s===a&&(n=pooling.double(n),a*=2),r&&r(t),n[s]=t,s+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},point_pool=pool_factory(8,function(){return createTypedArray("float32",2)}),shape_pool=(bB=pool_factory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)point_pool.release(t.v[e]),point_pool.release(t.i[e]),point_pool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),bB.clone=function(t){var e,r=bB.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},bB),bB,shapeCollection_pool=(kB={newShapeCollection:function(){var t;t=lB?nB[lB-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shape_pool.release(t.shapes[e]);t._length=0,lB===mB&&(nB=pooling.double(nB),mB*=2);nB[lB]=t,lB+=1}},lB=0,mB=4,nB=createSizedArray(mB),kB),kB,lB,mB,nB,segments_length_pool=pool_factory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezier_length_pool.release(t.lengths[e]);t.lengths.length=0}),bezier_length_pool=pool_factory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var n,o,h,p,l,m,f,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<a;i++)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!=c[i].mode&&"i"!=c[i].mode||0!==d?p=null:((p=createNS("rect")).setAttribute("fill","#ffffff"),p.setAttribute("width",this.element.comp.data.w||0),p.setAttribute("height",this.element.comp.data.h||0),u.push(p)),n=createNS("path"),"n"!=c[i].mode){var P;if(d+=1,n.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",f=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),P=createElementID(),(l=createNS("filter")).setAttribute("id",P),(m=createNS("feMorphology")).setAttribute("operator","erode"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),l.appendChild(m),s.appendChild(l),n.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):f=m=null,this.storedData[i]={elem:n,x:f,expan:m,lastPath:"",lastOperator:"",filterId:P,lastRadius:0},"i"==c[i].mode){h=u.length;var b=createNS("g");for(o=0;o<h;o+=1)b.appendChild(u[o]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",y+"_"+d),x.appendChild(n),s.appendChild(x),b.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(b)}else u.push(n);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:n,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:p},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:n,lastPath:""},s.appendChild(n);for(this.maskElement=createNS(g),a=u.length,i=0;i<a;i+=1)this.maskElement.appendChild(u[i]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(t,e,r,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var s=4;"rc"==e.ty?s=5:"el"==e.ty?s=6:"sr"==e.ty&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,s,t);var a,n,o=r.length;for(a=0;a<o;a+=1)r[a].closed||(n={transforms:i.addTransformSequence(r[a].transforms),trNodes:[]},this.styledShapes.push(n),r[a].elements.push(n))}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function AudioElement(t,e,r){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,r),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function CVContextData(){this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;var t;for(this.savedOp=createTypedArray("float32",15),t=0;t<15;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=15}function CVBaseElement(){}function CVCompElement(t,e,r){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CVMaskElement(t,e){this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var r,i=this.masksProperties.length,s=!1;for(r=0;r<i;r++)"n"!==this.masksProperties[r].mode&&(s=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);(this.hasMasks=s)&&this.element.addRenderableComponent(this)}function CVShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(t,e,r)}function CVSolidElement(t,e,r){this.initElement(t,e,r)}function CVEffects(){}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e--)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t)}return this.createNull(t)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){this.completeLayers=!1;var e,r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id==t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],CanvasRenderer),CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRenderer.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var r=this.contextData.cTr.props;this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},CanvasRenderer.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},CanvasRenderer.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var r,i=this.contextData.saved[this.contextData.cArrPos];for(r=0;r<16;r+=1)i[r]=e[r];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},CanvasRenderer.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,r=this.contextData.saved[this.contextData.cArrPos],i=this.contextData.cTr.props;for(e=0;e<16;e+=1)i[e]=r[e];this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),r=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=r,this.globalData.currentGlobalAlpha!==r&&(this.canvasContext.globalAlpha=r,this.globalData.currentGlobalAlpha=r)}else this.canvasContext.restore()},CanvasRenderer.prototype.configAnimation=function(t){this.animationItem.wrapper?(this.animationItem.container=createTag("canvas"),this.animationItem.container.style.width="100%",this.animationItem.container.style.height="100%",this.animationItem.container.style.transformOrigin=this.animationItem.container.style.mozTransformOrigin=this.animationItem.container.style.webkitTransformOrigin=this.animationItem.container.style["-webkit-transform"]="0px 0px 0px",this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)):this.canvasContext=this.renderConfig.context,this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){var t,e,r,i;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var s=this.renderConfig.preserveAspectRatio.split(" "),a=s[1]||"meet",n=s[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);r=t/e,i=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=r<i&&"meet"===a||i<r&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"==this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;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],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRenderer.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var r,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),r=0;r<i;r++)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(t-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){var r=this.createItem(this.layers[t],this,this.globalData);(e[t]=r).initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},CanvasRenderer.prototype.configAnimation=function(t){this.animationItem.wrapper?(this.animationItem.container=createTag("canvas"),this.animationItem.container.style.width="100%",this.animationItem.container.style.height="100%",this.animationItem.container.style.transformOrigin=this.animationItem.container.style.mozTransformOrigin=this.animationItem.container.style.webkitTransformOrigin=this.animationItem.container.style["-webkit-transform"]="0px 0px 0px",this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className)):this.canvasContext=this.renderConfig.context,this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h},this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r=!0,i=this.comp;r;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):r=!1;var s,a,n=e.length;for(s=0;s<n;s+=1)a=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return"_"+this.transform_key_count++}},CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var p=createNS("rect");p.setAttribute("width",this.comp.data.w),p.setAttribute("height",this.comp.data.h),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("fill","#ffffff"),p.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(p),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(p),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var l=createNS("clipPath"),m=createNS("path");m.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var f=createElementID();if(l.setAttribute("id",f),l.appendChild(m),this.globalData.defs.appendChild(l),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+f+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+f+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,p,l,m,f,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((f=this.searchProcessedElement(t[o]))?e[o]=r[f-1]:t[o]._render=n,"fl"==t[o].ty||"st"==t[o].ty||"gf"==t[o].ty||"gs"==t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"==t[o].ty){if(f)for(p=e[o].it.length,h=0;h<p;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"==t[o].ty?(f||(e[o]=this.createTransformElement(t[o],i)),l=e[o].transform,c.push(l)):"sh"==t[o].ty||"rc"==t[o].ty||"el"==t[o].ty||"sr"==t[o].ty?(f||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"==t[o].ty||"rd"==t[o].ty||"ms"==t[o].ty||"pb"==t[o].ty?(f?(m=e[o]).closed=!1:((m=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=m,this.shapeModifiers.push(m)),y.push(m)):"rp"==t[o].ty&&(f?(m=e[o]).closed=!0:(m=ShapeModifiers.getModifier(t[o].ty),(e[o]=m).init(this,t,o,e),this.shapeModifiers.push(m),n=!1),y.push(m));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var r=0;for(r=this._length;r<t;r+=1)this.saved[r]=createTypedArray("float32",16);this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,extendPrototype([CanvasRenderer,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,r,i,s=this.element.finalTransform.mat,a=this.element.canvasContext,n=this.masksProperties.length;for(a.beginPath(),t=0;t<n;t++)if("n"!==this.masksProperties[t].mode){this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),i=this.viewData[t].v,e=s.applyToPointArray(i.v[0][0],i.v[0][1],0),a.moveTo(e[0],e[1]);var o,h=i._length;for(o=1;o<h;o++)r=s.applyToTriplePoints(i.o[o-1],i.i[o],i.v[o]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=s.applyToTriplePoints(i.o[o-1],i.i[0],i.v[0]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var r={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"==t.ty||"st"==t.ty?(i.c=PropertyFactory.getProp(this,t.c,1,255,this),i.c.k||(r.co="rgb("+bm_floor(i.c.v[0])+","+bm_floor(i.c.v[1])+","+bm_floor(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=PropertyFactory.getProp(this,t.s,1,null,this),i.e=PropertyFactory.getProp(this,t.e,1,null,this),i.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),i.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),i.g=new GradientProperty(this,t.g,this)),i.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"==t.ty||"gs"==t.ty){if(r.lc=this.lcEnum[t.lc]||"round",r.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(r.ml=t.ml),i.w=PropertyFactory.getProp(this,t.w,0,null,this),i.w.k||(r.wi=i.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);i.d=s,i.d.k||(r.da=i.d.dashArray,r.do=i.d.dashoffset[0])}}else r.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(r),i.style=r,i},CVShapeElement.prototype.createGroupElement=function(t){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(t){var e,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},CVShapeElement.prototype.closeStyles=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].closed=!0},CVShapeElement.prototype.searchShapes=function(t,e,r,i,s){var a,n,o,h,p,l,m=t.length-1,f=[],c=[],d=[].concat(s);for(a=m;0<=a;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=r[h-1]:t[a]._shouldRender=i,"fl"==t[a].ty||"st"==t[a].ty||"gf"==t[a].ty||"gs"==t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),f.push(e[a].style);else if("gr"==t[a].ty){if(h)for(o=e[a].it.length,n=0;n<o;n+=1)e[a].prevViewData[n]=e[a].it[n];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,i,d)}else"tr"==t[a].ty?(h||(l=this.createTransformElement(t[a]),e[a]=l),d.push(e[a]),this.addTransformToStyleList(e[a])):"sh"==t[a].ty||"rc"==t[a].ty||"el"==t[a].ty||"sr"==t[a].ty?h||(e[a]=this.createShapeElement(t[a])):"tm"==t[a].ty||"rd"==t[a].ty||"pb"==t[a].ty?(h?(p=e[a]).closed=!1:((p=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=p,this.shapeModifiers.push(p)),c.push(p)):"rp"==t[a].ty&&(h?(p=e[a]).closed=!0:(p=ShapeModifiers.getModifier(t[a].ty),(e[a]=p).init(this,t,a,e),this.shapeModifiers.push(p),i=!1),c.push(p));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(f),m=c.length,a=0;a<m;a+=1)c[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var t,e,r,i,s,a,n,o,h,p=this.stylesList.length,l=this.globalData.renderer,m=this.globalData.canvasContext;for(t=0;t<p;t+=1)if(("st"!==(o=(h=this.stylesList[t]).type)&&"gs"!==o||0!==h.wi)&&h.data._shouldRender&&0!==h.coOp&&0!==this.globalData.currentGlobalAlpha){for(l.save(),a=h.elements,"st"===o||"gs"===o?(m.strokeStyle="st"===o?h.co:h.grd,m.lineWidth=h.wi,m.lineCap=h.lc,m.lineJoin=h.lj,m.miterLimit=h.ml||0):m.fillStyle="fl"===o?h.co:h.grd,l.ctxOpacity(h.coOp),"st"!==o&&"gs"!==o&&m.beginPath(),l.ctxTransform(h.preTransforms.finalTransform.props),r=a.length,e=0;e<r;e+=1){for("st"!==o&&"gs"!==o||(m.beginPath(),h.da&&(m.setLineDash(h.da),m.lineDashOffset=h.do)),s=(n=a[e].trNodes).length,i=0;i<s;i+=1)"m"==n[i].t?m.moveTo(n[i].p[0],n[i].p[1]):"c"==n[i].t?m.bezierCurveTo(n[i].pts[0],n[i].pts[1],n[i].pts[2],n[i].pts[3],n[i].pts[4],n[i].pts[5]):m.closePath();"st"!==o&&"gs"!==o||(m.stroke(),h.da&&m.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&m.fill(h.r),l.restore()}},CVShapeElement.prototype.renderShape=function(t,e,r,i){var s,a;for(a=t,s=e.length-1;0<=s;s-=1)"tr"==e[s].ty?(a=r[s].transform,this.renderShapeTransform(t,a)):"sh"==e[s].ty||"el"==e[s].ty||"rc"==e[s].ty||"sr"==e[s].ty?this.renderPath(e[s],r[s]):"fl"==e[s].ty?this.renderFill(e[s],r[s],a):"st"==e[s].ty?this.renderStroke(e[s],r[s],a):"gf"==e[s].ty||"gs"==e[s].ty?this.renderGradientFill(e[s],r[s],a):"gr"==e[s].ty?this.renderShape(a,e[s].it,r[s].it):e[s].ty;i&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var r,i,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(s=0;s<o;s+=1){var p=n.shapes[s];if(p&&p.v){for(i=p._length,r=1;r<i;r+=1)1===r&&a.push({t:"m",p:h.applyToPointArray(p.v[0][0],p.v[0][1],0)}),a.push({t:"c",pts:h.applyToTriplePoints(p.o[r-1],p.i[r],p.v[r])});1===i&&a.push({t:"m",p:h.applyToPointArray(p.v[0][0],p.v[0][1],0)}),p.c&&i&&(a.push({t:"c",pts:h.applyToTriplePoints(p.o[r-1],p.i[0],p.v[0])}),a.push({t:"z"}))}}t.trNodes=a}},CVShapeElement.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var r,i=e.styledShapes.length;for(r=0;r<i;r+=1)this.renderStyledShape(e.styledShapes[r],e.sh)}},CVShapeElement.prototype.renderFill=function(t,e,r){var i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(t,e,r){var i=e.style;if(!i.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var s=this.globalData.canvasContext,a=e.s.v,n=e.e.v;if(1===t.t)f=s.createLinearGradient(a[0],a[1],n[0],n[1]);else var o=Math.sqrt(Math.pow(a[0]-n[0],2)+Math.pow(a[1]-n[1],2)),h=Math.atan2(n[1]-a[1],n[0]-a[0]),p=o*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),l=Math.cos(h+e.a.v)*p+a[0],m=Math.sin(h+e.a.v)*p+a[1],f=s.createRadialGradient(l,m,0,a[0],a[1],o);var c,d=t.g.p,u=e.g.c,y=1;for(c=0;c<d;c+=1)e.g._hasOpacity&&e.g._collapsable&&(y=e.g.o[2*c+1]),f.addColorStop(u[4*c]/100,"rgba("+u[4*c+1]+","+u[4*c+2]+","+u[4*c+3]+","+y+")");i.grd=f}i.coOp=e.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||this._isFirstFrame)&&(i.da=s.dashArray,i.do=s.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity),(e.w._mdf||this._isFirstFrame)&&(i.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},CVEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||m()),e+=1}function p(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem==t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return f(i,t),i.setData(t,e),i}function l(){n+=1,d()}function m(){n-=1}function f(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",l),t.addEventListener("_idle",m),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=p,t.loadAnimation=function(t){var e=new AnimationItem;return f(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),p(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),p(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}();animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||l()),e+=1}function p(){n+=1,c()}function l(){n-=1}function m(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",p),t.addEventListener("_idle",l),s.push({elem:e,animation:t}),a+=1}function f(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?requestAnimationFrame(f):o=!0}function e(t){i=t,requestAnimationFrame(f)}function c(){!h&&n&&o&&(requestAnimationFrame(e),o=!1)}return t.registerAnimation=function(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem==t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return m(i,t),i.setData(t,e),i},t.loadAnimation=function(t){var e=new AnimationItem;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){throw new Error("Cannot access DOM from worker thread")},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,c()},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}();var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){var r={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===s||(r.loop="false"!==s&&("true"===s||parseInt(s)));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id==a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!=r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t==this.assets[e].id)return this.assets[e];e+=1}},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.setParams=function(t){t.context&&(this.context=t.context);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;default:throw new Error("Only canvas renderer is supported when using worker.")}if(this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||(!1===t.loop?this.loop=!1:!0===t.loop?this.loop=!0:this.loop=parseInt(t.loop)),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=null,t.animationData)this.configAnimation(t.animationData);else if(t.path)throw new Error("Canvas worker renderer cannot load animation from url")},AnimationItem.prototype.setData=function(t,e){throw new Error("Cannot set data on wrapper for canvas worker renderer")},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id==a[r].id){i[e]=a[r];break}e+=1}this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(t&&0!==t.length&&this.autoloadSegments)throw new Error("Cannot load multiple segments in worker.");this.timeCompleted=this.totalFrames},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=null,AnimationItem.prototype.preloadImages=null,AnimationItem.prototype.configAnimation=function(t){this.renderer&&(this.animationData=t,this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.renderer.searchExtraCompositions(t.assets),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.firstFrame=Math.round(this.animationData.ip),this.frameMult=this.animationData.fr/1e3,this.loadSegments(),this.updaFrameModifier(),this.checkLoaded())},AnimationItem.prototype.waitForFontsLoaded=null,AnimationItem.prototype.checkLoaded=function(){this.isLoaded||(this.isLoaded=!0,dataManager.completeData(this.animationData,null),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),this.gotoFrame())},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.getPath=null;var Expressions=(iP={},iP.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},iP),iP;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:void 0}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]=t[0]+e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t)),"string"===i&&(e=parseInt(e)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]=t[0]-e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t)),"string"==typeof e&&(e=parseInt(e)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var r,i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n==o)e=r=0;else{var p=n-o;switch(r=.5<h?p/(2-n-o):p/(n+o),n){case i:e=(s-a)/p+(s<a?6:0);break;case s:e=(a-i)/p+2;break;case a:e=(i-s)/p+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)e=r=i=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*n;var o,h=i.length,p=createTypedArray("float32",h);for(o=0;o<h;o+=1)p[o]=i[o]+(s[o]-i[o])*n;return p}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shape_pool.newElement();n.setPathData(!!i,a);var o,h,p=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:p,h=r&&r[s]?r[s]:p,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,__expression_functions=[],scoped_bm_rt;if(data.xf){var i,len=data.xf.length;for(i=0;i<len;i+=1)__expression_functions[i]=eval("(function(){ return "+data.xf[i]+"}())")}var expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),p=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)p[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return p}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r);var n=t(e=1<e?1:e<0?0:e);if($bm_isInstanceOfArray(s)){var o,h=s.length,p=createTypedArray("float32",h);for(o=0;o<h;o+=1)p[o]=(a[o]-s[o])*n+s[o];return p}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=data.k[t].hasOwnProperty("s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,p=this.keyframes,l=p[p.length-1].t;if(h<=l)return this.pv;if(r?s=l-(i=e?Math.abs(l-elem.comp.globalData.frameRate*e):Math.max(0,l-this.elem.data.ip)):((!e||e>p.length-1)&&(e=p.length-1),i=l-(s=p[p.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(l/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=(f[a]-m[a])*d+c[a];return o}return(f-m)*d+c}if("continue"===t){var u=this.getValueAtTime(l/this.comp.globalData.frameRate,0),y=this.getValueAtTime((l-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-l)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-l)/.001*(u-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,p=this.keyframes,l=p[0].t;if(l<=h)return this.pv;if(r?s=l+(i=e?Math.abs(elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-l)):((!e||e>p.length-1)&&(e=p.length-1),i=(s=p[e].t)-l),"pingpong"===t){if(Math.floor((l-h)/i)%2==0)return this.getValueAtTime(((l-h)%i+l)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(l/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(l-h)%i+l)/this.comp.globalData.frameRate,0),d=Math.floor((l-h)/i)+1;if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(f[a]-m[a])*d;return o}return c-(f-m)*d}if("continue"===t){var u=this.getValueAtTime(l/this.comp.globalData.frameRate,0),y=this.getValueAtTime((l+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(l-h)/.001;return o}return u+(u-y)*(l-h)/.001}}return this.getValueAtTime((i-(l-h)%i+l)/this.comp.globalData.frameRate,0)}function p(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(t);e.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var i=this.s.getValueAtTime(t);e.scale(i[0]*this.s.mult,i[1]*this.s.mult,i[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),p=this.rx.getValueAtTime(t),l=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(p*this.rx.mult).rotateZ(-l[2]*this.or.mult).rotateY(l[1]*this.or.mult).rotateX(l[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var m=this.px.getValueAtTime(t),f=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(m*this.px.mult,f*this.py.mult,-c*this.pz.mult)}else e.translate(m*this.px.mult,f*this.py.mult,0)}else{var d=this.p.getValueAtTime(t);e.translate(d[0]*this.p.mult,d[1]*this.p.mult,-d[2]*this.p.mult)}return e}.bind(i):i.getValueAtTime=function(t){return this.v.clone(new Matrix)}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var l=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=l(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=p,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0));var i,s=r._length,a=r[t],n=r.v,o=createSizedArray(s);for(i=0;i<s;i+=1)o[i]="i"===t||"o"===t?[a[i][0]-n[i][0],a[i][1]-n[i][1]]:[a[i][0],a[i][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,p=0;o<h;){if(p+a[o].addedLength>n){var l=o,m=r.c&&o===h-1?0:o+1,f=(n-p)/a[o].addedLength;i=bez.getPointInSegment(r.v[l],r.v[m],r.o[l],r.i[m],f,a[o]);break}p+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){t=1==t?this.v.c?0:.999:t;var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){if(this.data.d.x)return this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0};var ShapePathInterface=function(t,e,r){var i=e.sh;function s(t){if("Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t)return s.path}var a=propertyGroupFactory(s,r);return i.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:r}}),s},propertyGroupFactory=function(e,r){return function(t){return(t=void 0===t?1:t)<=0?e:r(t-1)}},PropertyInterface=function(t,e){var r={_name:t};return function(t){return(t=void 0===t?1:t)<=0?r:e(--t)}},ShapeExpressionInterface=function(){function n(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"==t[i].ty?s.push(o(t[i],e[i],r)):"fl"==t[i].ty?s.push(h(t[i],e[i],r)):"st"==t[i].ty?s.push(p(t[i],e[i],r)):"tm"==t[i].ty?s.push(l(t[i],e[i],r)):"tr"==t[i].ty||("el"==t[i].ty?s.push(f(t[i],e[i],r)):"sr"==t[i].ty?s.push(c(t[i],e[i],r)):"sh"==t[i].ty?s.push(ShapePathInterface(t[i],e[i],r)):"rc"==t[i].ty?s.push(d(t[i],e[i],r)):"rd"==t[i].ty?s.push(u(t[i],e[i],r)):"rp"==t[i].ty&&s.push(y(t[i],e[i],r)));return s}function o(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,e,r){var i,s=function(t){for(var e=0,r=i.length;e<r;){if(i[e]._name===t||i[e].mn===t||i[e].propertyIndex===t||i[e].ix===t||i[e].ind===t)return i[e];e+=1}if("number"==typeof t)return i[t-1]};s.propertyGroup=propertyGroupFactory(s,r),i=n(t.it,e.it,s.propertyGroup),s.numProperties=i.length;var a=m(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,i.propertyGroup),a=m(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function h(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:void 0}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),i}function p(t,e,r){var i=propertyGroupFactory(p,r),s=propertyGroupFactory(h,i);var a,n,o=t.d?t.d.length:0,h={};for(a=0;a<o;a+=1)n=a,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[a].p.setGroupProperty(s);function p(t){return"Color"===t||"color"===t?p.color:"Opacity"===t||"opacity"===t?p.opacity:"Stroke Width"===t||"stroke width"===t?p.strokeWidth:void 0}return Object.defineProperties(p,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",i)),e.o.setGroupProperty(PropertyInterface("Opacity",i)),e.w.setGroupProperty(PropertyInterface("Stroke Width",i)),p}function l(e,t,r){function i(t){return t===e.e.ix||"End"===t||"end"===t?i.end:t===e.s.ix?i.start:t===e.o.ix?i.offset:void 0}var s=propertyGroupFactory(i,r);return i.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),i.propertyIndex=e.ix,i.propertyGroup=r,Object.defineProperties(i,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),i.mn=e.mn,i}function m(e,t,r){function i(t){return e.a.ix===t||"Anchor Point"===t?i.anchorPoint:e.o.ix===t||"Opacity"===t?i.opacity:e.p.ix===t||"Position"===t?i.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?i.rotation:e.s.ix===t||"Scale"===t?i.scale:e.sk&&e.sk.ix===t||"Skew"===t?i.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?i.skewAxis:void 0}var s=propertyGroupFactory(i,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(i,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),i.ty="tr",i.mn=e.mn,i.propertyGroup=r,i}function f(e,t,r){function i(t){return e.p.ix===t?i.position:e.s.ix===t?i.size:void 0}var s=propertyGroupFactory(i,r);i.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(i,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),i.mn=e.mn,i}function c(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.rotation:e.pt.ix===t?i.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?i.outerRadius:e.os.ix===t?i.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?i.innerRoundness:void 0:i.innerRadius}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),i.mn=e.mn,i}function d(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?i.size:void 0}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),i.mn=e.mn,i}function u(e,t,r){function i(t){if(e.r.ix===t||"Round Corners 1"===t)return i.radius}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(i,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),i.mn=e.mn,i}function y(e,t,r){function i(t){return e.c.ix===t||"Copies"===t?i.copies:e.o.ix===t||"Offset"===t?i.offset:void 0}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(i,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),i.mn=e.mn,i}return function(t,e,i){var s;function r(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,r=s.length;e<r;){if(s[e]._name===t)return s[e];e+=1}}return r.propertyGroup=propertyGroupFactory(r,function(){return i}),s=n(t,e,r.propertyGroup),r.numProperties=s.length,r._name="Contents",r}}(),TextExpressionInterface=function(e){var r;function i(t){switch(t){case"ADBE Text Document":return i.sourceText}}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),i},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var r=this.getMatrix(e);return r.props[12]=r.props[13]=r.props[14]=0,this.applyPoint(r,t)}function n(t,e){var r=this.getMatrix(e);return this.applyPoint(r,t)}function o(t,e){var r=this.getMatrix(e);return r.props[12]=r.props[13]=r.props[14]=0,this.invertPoint(r,t)}function h(t,e){var r=this.getMatrix(e);return this.invertPoint(r,t)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function m(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function f(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect;case"ADBE Text Properties":return i.textInterface}}i.getMatrix=s,i.invertPoint=l,i.applyPoint=p,i.toWorld=n,i.toWorldVec=a,i.fromWorld=h,i.fromWorldVec=o,i.toComp=n,i.fromComp=m,i.sampleImage=f,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity}}if(Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p)var r=ExpressionPropertyInterface(t.p);else{var i,s=ExpressionPropertyInterface(t.px),a=ExpressionPropertyInterface(t.py);t.pz&&(i=ExpressionPropertyInterface(t.pz))}return Object.defineProperty(e,"position",{get:function(){return t.p?r():[s(),a(),i?i():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function p(s,t,e,r){function i(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?o[r]:o[r]();r+=1}throw new Error}var a,n=propertyGroupFactory(i,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(p(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,r)):o.push(l(t.effectElements[a],s.ef[a].ty,r,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(i,"color",{get:function(){return o[0]()}}),Object.defineProperties(i,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),i.active=i.enabled=0!==s.en,i}function l(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",i)),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(p(s[r],t.effectsManager.effectElements[r],e,t));var n=t.data.ef||[],o=function(t){for(r=0,a=n.length;r<a;){if(t===n[r].nm||t===n[r].mn||t===n[r].ix)return i[r];r+=1}};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}}}}(),MaskManagerInterface=function(){function a(t,e){this._mask=t,this._data=e}Object.defineProperty(a.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(a.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e,t){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new a(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(i.numKeys){var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r.value="unidimensional"===a?e[0]:e,r}return 0},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)s[t]=a[t]=e.v[t]*r;return s}}(t):e}}(),w$,x$;function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var r=t.ef||[];this.effectElements=[];var i,s,a=r.length;for(i=0;i<a;i++)s=new GroupEffect(r[i],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}w$=function(){function r(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}return function(t,e){this.pv=1,this.comp=t.comp,this.elem=t,this.mult=.01,this.propType="textSelector",this.textTotal=e.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],this.k=!0,this.x=!0,this.getValue=ExpressionManager.initiateExpression.bind(this)(t,e,this),this.getMult=r,this.getVelocityAtTime=expressionHelpers.getVelocityAtTime,this.kf?this.getValueAtTime=expressionHelpers.getValueAtTime.bind(this):this.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(this),this.setGroupProperty=expressionHelpers.setGroupProperty}}(),x$=TextSelectorProp.getTextSelectorProp,TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new w$(t,e,r):x$(t,e,r)},extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var r,i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottiejs={},_isFrozen=!1;function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}lottiejs.play=animationManager.play,lottiejs.pause=animationManager.pause,lottiejs.togglePause=animationManager.togglePause,lottiejs.setSpeed=animationManager.setSpeed,lottiejs.setDirection=animationManager.setDirection,lottiejs.stop=animationManager.stop,lottiejs.registerAnimation=animationManager.registerAnimation,lottiejs.loadAnimation=loadAnimation,lottiejs.resize=animationManager.resize,lottiejs.goToAndStop=animationManager.goToAndStop,lottiejs.destroy=animationManager.destroy,lottiejs.setQuality=setQuality,lottiejs.freeze=animationManager.freeze,lottiejs.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottiejs.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottiejs.version="5.7.5";var renderer="";return lottiejs}({}),animations=[],onmessage=function(t){var e=t.data.canvas,r=(t.data.params,e.getContext("2d")),i=lottiejs.loadAnimation({renderer:"canvas",loop:t.data.loop,autoplay:!0,animationData:t.data.animationData,rendererSettings:{context:r,scaleMode:"noScale",clearCanvas:!0}});animations.push(i),i.play()};
+}((self || {}), function(window) {
+	var lottie=function(){"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bmRnd,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bmRnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e}roundValues(!1);var createElementID=(F=0,function(){return"__lottie_element_"+(F+=1)}),F;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,p,l;switch(h=r*(1-e),p=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),l=r*(1-(1-o)*e),n%6){case 0:i=r,s=l,a=h;break;case 1:i=p,s=r,a=h;break;case 2:i=h,s=r,a=l;break;case 3:i=h,s=p,a=r;break;case 4:i=l,s=h,a=r;break;case 5:i=r,s=h,a=p}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i+=1)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray=function(){function r(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):r(t,e)}:r}();function createSizedArray(t){return Array.apply(null,{length:t})}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Na={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Na[t]||""}),Na,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function p(t,e){return this._t(1,e,t,1,0,0)}function l(t,e){return this.shear(n(t),n(e))}function m(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function f(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,p,l,m,f,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=p,this.props[10]=l,this.props[11]=m,this.props[12]=f,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function u(t,e,r,i,s,a,n,o,h,p,l,m,f,c,d,u){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===p&&1===l&&0===m)return y[12]=y[12]*t+y[15]*f,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*l+y[15]*d,y[15]*=u,this._identityCalculated=!1,this;var g=y[0],v=y[1],P=y[2],b=y[3],x=y[4],S=y[5],A=y[6],T=y[7],E=y[8],_=y[9],C=y[10],k=y[11],D=y[12],I=y[13],M=y[14],F=y[15];return y[0]=g*t+v*s+P*h+b*f,y[1]=g*e+v*a+P*p+b*c,y[2]=g*r+v*n+P*l+b*d,y[3]=g*i+v*o+P*m+b*u,y[4]=x*t+S*s+A*h+T*f,y[5]=x*e+S*a+A*p+T*c,y[6]=x*r+S*n+A*l+T*d,y[7]=x*i+S*o+A*m+T*u,y[8]=E*t+_*s+C*h+k*f,y[9]=E*e+_*a+C*p+k*c,y[10]=E*r+_*n+C*l+k*d,y[11]=E*i+_*o+C*m+k*u,y[12]=D*t+I*s+M*h+F*f,y[13]=D*e+I*a+M*p+F*c,y[14]=D*r+I*n+M*l+F*d,y[15]=D*i+I*o+M*m+F*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function P(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function b(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function x(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function S(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function A(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function T(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function E(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function _(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=E(t[e]);return i}function C(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],p=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+p,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+p,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+p}return i}function k(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function D(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function I(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function M(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function F(){var t=this.props;return"matrix("+M(t[0])+","+M(t[1])+","+M(t[4])+","+M(t[5])+","+M(t[12])+","+M(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=l,this.skewFromAxis=m,this.shear=p,this.scale=f,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=b,this.applyToX=x,this.applyToY=S,this.applyToZ=A,this.applyToPointArray=k,this.applyToTriplePoints=C,this.applyToPointStringified=D,this.toCSS=I,this.to2dCSS=F,this.clone=v,this.cloneFromProps=P,this.equals=g,this.inversePoints=_,this.inversePoint=E,this.getInverseMatrix=T,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var p,l=this,m=256,f=6,c="random",d=h.pow(m,f),u=h.pow(2,52),y=2*u,g=m-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<m;)a[i]=i++;for(i=0;i<m;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*m+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function P(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function b(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=b(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,x(o)]:null===t?function(){try{if(p)return x(p.randomBytes(m));var t=new Uint8Array(m);return(l.crypto||l.msCrypto).getRandomValues(t),x(t)}catch(t){var e=l.navigator,r=e&&e.plugins;return[+new Date,l,r,l.screen,x(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(f),e=d,r=0;t<u;)t=(t+r)*m,e*=m,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,b(x(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&P(i,a),t.state=function(){return P(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},b(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var p=11,l=1/(p-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function m(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function f(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(p):new Array(p),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:m(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<p;++r)this._mSampleValues[r]=m(r*l,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=p-1;a!==n&&i[a]<=t;++a)s+=l;var o=s+(t-i[--a])/(i[a+1]-i[a])*l,h=f(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=f(e,r,i);if(0===a)return e;e-=(m(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=m(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+l,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)Object.prototype.hasOwnProperty.call(i,a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){var D=Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var l=function(t,e,r,i){var s,a,n,o,h,p,l=defaultCurveSegments,m=0,f=[],c=[],d=bezierLengthPool.newElement();for(n=r.length,s=0;s<l;s+=1){for(h=s/(l-1),a=p=0;a<n;a+=1)o=bmPow(1-h,3)*t[a]+3*bmPow(1-h,2)*h*r[a]+3*(1-h)*bmPow(h,2)*i[a]+bmPow(h,3)*e[a],f[a]=o,null!==c[a]&&(p+=bmPow(f[a]-c[a],2)),c[a]=f[a];p&&(m+=p=bmSqrt(p)),d.percents[s]=h,d.lengths[s]=m}return d.addedLength=m,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var P,t=(P={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!P[s]){var a,n,o,h,p,l,m,f=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(f=2);var u=new g(f);for(o=r.length,a=0;a<f;a+=1){for(m=createSizedArray(o),p=a/(f-1),n=l=0;n<o;n+=1)h=bmPow(1-p,3)*t[n]+3*bmPow(1-p,2)*p*(t[n]+r[n])+3*(1-p)*bmPow(p,2)*(e[n]+i[n])+bmPow(p,3)*e[n],m[n]=h,null!==d&&(l+=bmPow(m[n]-d[n],2));c+=l=bmSqrt(l),u.points[a]=new v(l,m),d=m}u.segmentLength=c,P[s]=u}return P[s]});function I(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bmFloor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,p=!0;p;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),p=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];p=!1}return r[a]+(r[a+1]-r[a])*o}var M=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segmentsLengthPool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,p=0;for(e=0;e<o-1;e+=1)h[e]=l(s[e],s[e+1],a[e],n[e+1]),p+=h[e].addedLength;return i&&o&&(h[e]=l(s[e],s[0],a[e],n[0]),p+=h[e].addedLength),r.totalLength=p,r},getNewSegment:function(t,e,r,i,s,a,n){s<0?s=0:1<s&&(s=1);var o,h=I(s,n),p=I(a=1<a?1:a,n),l=t.length,m=1-h,f=1-p,c=m*m*m,d=h*m*m*3,u=h*h*m*3,y=h*h*h,g=m*m*f,v=h*m*f+m*h*f+m*m*p,P=h*h*f+m*h*p+h*m*p,b=h*h*p,x=m*f*f,S=h*f*f+m*p*f+m*f*p,A=h*p*f+m*p*p+h*f*p,T=h*p*p,E=f*f*f,_=p*f*f+f*p*f+f*f*p,C=p*p*f+f*p*p+p*f*p,k=p*p*p;for(o=0;o<l;o+=1)M[4*o]=D.round(1e3*(c*t[o]+d*r[o]+u*i[o]+y*e[o]))/1e3,M[4*o+1]=D.round(1e3*(g*t[o]+v*r[o]+P*i[o]+b*e[o]))/1e3,M[4*o+2]=D.round(1e3*(x*t[o]+S*r[o]+A*i[o]+T*e[o]))/1e3,M[4*o+3]=D.round(1e3*(E*t[o]+_*r[o]+C*i[o]+k*e[o]))/1e3;return M},getPointInSegment:function(t,e,r,i,s,a){var n=I(s,a),o=1-n;return[D.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,D.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var p,l=D.sqrt(D.pow(i-t,2)+D.pow(s-e,2)+D.pow(a-r,2)),m=D.sqrt(D.pow(n-t,2)+D.pow(o-e,2)+D.pow(h-r,2)),f=D.sqrt(D.pow(n-i,2)+D.pow(o-s,2)+D.pow(h-a,2));return-1e-4<(p=m<l?f<l?l-m-f:f-m-l:m<f?f-m-l:m-l-f)&&p<1e-4}}}!function(){for(var s=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),r=Math.max(0,16-(e-s)),i=setTimeout(function(){t(e+r)},r);return s=e+r,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function m(t,e,r){var i,s,a,n,o,h,p=t.length;for(s=0;s<p;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),i.hasMask){var l=i.masksProperties;for(n=l.length,a=0;a<n;a+=1)if(l[a].pt.k.i)d(l[a].pt.k);else for(h=l[a].pt.k.length,o=0;o<h;o+=1)l[a].pt.k[o].s&&d(l[a].pt.k[o].s[0]),l[a].pt.k[o].e&&d(l[a].pt.k[o].e[0])}0===i.ty?(i.layers=f(i.refId,e),m(i.layers,e,r)):4===i.ty?c(i.shapes):5===i.ty&&u(i)}}function f(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}return null}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)d(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&d(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&d(t[e].ks.k[r].e[0]);else"gr"===t[e].ty&&c(t[e].it)}function d(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&null))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(d(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function p(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);else"gr"===t[e].ty&&p(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&p(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=m,t}var dataManager=dataFunctionManager();function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],r="normal",i="normal",s=e.length,a=0;a<s;a+=1)switch(e[a].toLowerCase()){case"italic":i="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:i,weight:t.fWeight||r}}dataManager.completeData=function(t,e){t.__complete||(this.checkColors(t),this.checkChars(t),this.checkShapes(t),this.completeLayers(t.layers,t.assets,e),t.__complete=!0)};var FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function f(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=function(t){var e,r=t.split(","),i=r.length,s=[];for(e=0;e<i;e+=1)"sans-serif"!==r[e]&&"monospace"!==r[e]&&s.push(r[e]);return s.join(",")}(t)+", "+e,{node:i,w:s,parent:r}}function c(t,e){var r=createNS("text");r.style.fontSize="100px";var i=getFontProperties(e);return r.setAttribute("font-family",e.fFamily),r.setAttribute("font-style",i.style),r.setAttribute("font-weight",i.weight),r.textContent="1",e.fClass?(r.style.fontFamily="inherit",r.setAttribute("class",e.fClass)):r.style.fontFamily=e.fFamily,t.appendChild(r),createTag("canvas").getContext("2d").font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,r}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i=t.list,s=i.length,a=s;for(r=0;r<s;r+=1){var n,o,h=!0;if(i[r].loaded=!1,i[r].monoCase=f(i[r].fFamily,"monospace"),i[r].sansCase=f(i[r].fFamily,"sans-serif"),i[r].fPath){if("p"===i[r].fOrigin||3===i[r].origin){if(0<(n=document.querySelectorAll('style[f-forigin="p"][f-family="'+i[r].fFamily+'"], style[f-origin="3"][f-family="'+i[r].fFamily+'"]')).length&&(h=!1),h){var p=createTag("style");p.setAttribute("f-forigin",i[r].fOrigin),p.setAttribute("f-origin",i[r].origin),p.setAttribute("f-family",i[r].fFamily),p.type="text/css",p.innerText="@font-face {font-family: "+i[r].fFamily+"; font-style: normal; src: url('"+i[r].fPath+"');}",e.appendChild(p)}}else if("g"===i[r].fOrigin||1===i[r].origin){for(n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),o=0;o<n.length;o+=1)-1!==n[o].href.indexOf(i[r].fPath)&&(h=!1);if(h){var l=createTag("link");l.setAttribute("f-forigin",i[r].fOrigin),l.setAttribute("f-origin",i[r].origin),l.type="text/css",l.rel="stylesheet",l.href=i[r].fPath,document.body.appendChild(l)}}else if("t"===i[r].fOrigin||2===i[r].origin){for(n=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),o=0;o<n.length;o+=1)i[r].fPath===n[o].src&&(h=!1);if(h){var m=createTag("link");m.setAttribute("f-forigin",i[r].fOrigin),m.setAttribute("f-origin",i[r].origin),m.setAttribute("rel","stylesheet"),m.setAttribute("href",i[r].fPath),e.appendChild(m)}}}else i[r].loaded=!0,a-=1;i[r].helper=c(e,i[r]),i[r].cache={},this.fonts.push(i[r])}0===a?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,r)),a},getFontByName:function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},checkLoadedFonts:function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}();FontManager=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this.initTime=Date.now()};var PropertyFactory=function(){var m=initialDefaultFrame,s=Math.abs;function f(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,p,l,m,f=e.lastIndex,c=f,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>t){f=c;break}c<d-1?c+=1:(f=0,u=!1)}var y,g,v,P,b,x,S,A,T,E,_=a.t-i,C=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var k=s.bezierData;if(_<=t||t<C){var D=_<=t?k.points.length-1:0;for(o=k.points[D].point.length,n=0;n<o;n+=1)r[n]=k.points[D].point[n]}else{s.__fnct?m=s.__fnct:(m=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=m),h=m((t-C)/(_-C));var I,M=k.segmentLength*h,F=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(l=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,p=k.points.length;u;){if(F+=k.points[l].partialLength,0===M||0===h||l===k.points.length-1){for(o=k.points[l].point.length,n=0;n<o;n+=1)r[n]=k.points[l].point[n];break}if(F<=M&&M<F+k.points[l+1].partialLength){for(I=(M-F)/k.points[l+1].partialLength,o=k.points[l].point.length,n=0;n<o;n+=1)r[n]=k.points[l].point[n]+(k.points[l+1].point[n]-k.points[l].point[n])*I;break}l<p-1?l+=1:u=!1}e._lastPoint=l,e._lastAddedLength=F-k.points[l].partialLength,e._lastKeyframeIndex=c}}else{var w,R,V,L,O;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(_<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=C)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var z=G(s.s),B=G(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],p=t[0],l=t[1],m=t[2],f=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=p*c+l*d+m*u+f*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*p+o*c,h[1]=n*l+o*d,h[2]=n*m+o*u,h[3]=n*f+o*y,h}(z,B,(t-C)/(_-C)),P=v[0],b=v[1],x=v[2],S=v[3],A=Math.atan2(2*b*S-2*P*x,1-2*b*b-2*x*x),T=Math.asin(2*P*b+2*x*S),E=Math.atan2(2*P*S-2*b*x,1-2*P*P-2*x*x),g[0]=A/degToRads,g[1]=T/degToRads,g[2]=E/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=_<=t?1:t<C?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?m=s.__fnct[c]:(w=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],R=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],V=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],L=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],m=BezierFactory.getBezierEasing(w,R,V,L).get,s.__fnct[c]=m)):s.__fnct?m=s.__fnct:(w=s.o.x,R=s.o.y,V=s.i.x,L=s.i.y,m=BezierFactory.getBezierEasing(w,R,V,L).get,s.__fnct=m),m((t-C)/(_-C)))),y=a.s||s.e,O=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=O:r=O}return e.lastIndex=f,r}function G(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),p=Math.sin(i/2);return[o*h*n+s*a*p,o*a*n+s*h*p,s*h*n-o*a*p,s*a*n-o*h*p]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==m&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,r,i){var s;this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:m,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=m,this.pv=m,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.effectsSequence=[c.bind(this)],this.addEffect=y}function p(t,e,r,i){var s;this.propType="multidimensional";var a,n,o,h,p=e.k.length;for(s=0;s<p-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=f,this.frameId=-1;var l=e.k[0].s.length;for(this.v=createTypedArray("float32",l),this.pv=createTypedArray("float32",l),s=0;s<l;s+=1)this.v[s]=m,this.pv[s]=m;this._caching={lastFrame:m,lastIndex:0,value:createTypedArray("float32",l)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new p(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=null,e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var e;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var r,i;if(e=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(r=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(r=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(r[0]=s.getValueAtTime((s.keyframes[0].t+.01)/e,0),r[1]=a.getValueAtTime((a.keyframes[0].t+.01)/e,0),i[0]=s.getValueAtTime(s.keyframes[0].t/e,0),i[1]=a.getValueAtTime(a.keyframes[0].t/e,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(r[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/e,0),r[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/e,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/e,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/e,0)):(r=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/e,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/e,a.offsetTime))}else r=i=n;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[i]||a[i]&&!s)&&(a[i]=pointPool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,p,l,m,f=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,f=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(f=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)l=1;else if(t<d.t-this.offsetTime)l=0;else{var P;d.__fnct?P=d.__fnct:(P=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=P),l=P((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}i=d.s[0]}for(h=e._length,p=i.i[0].length,r.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<p;o+=1)m=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*l,e.i[n][o]=m,m=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*l,e.o[n][o]=m,m=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*l,e.v[n][o]=m}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shapePool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(e=0;e<r;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,p=this.os.v,l=this.is.v,m=2*Math.PI*o/(2*s),f=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?p:l,i=n?m:f;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*i*r*d,y-v*i*r*d,u+g*i*r*d,y+v*i*r*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=.5*-Math.PI,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),p=i*Math.sin(n),l=0===h&&0===p?0:p/Math.sqrt(h*h+p*p),m=0===h&&0===p?0:-h/Math.sqrt(h*h+p*p);h+=+this.p.v[0],p+=+this.p.v[1],this.v.setTripleAt(h,p,h-l*a*s*o,p-m*a*s*o,h+l*a*s*o,p+m*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bmMin(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var m={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new l(t,e):6===r?i=new h(t,e):7===r&&(i=new p(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return m}(),ShapeModifiers=($r={},_r={},$r.registerModifier=function(t,e){_r[t]||(_r[t]=e)},$r.getModifier=function(t,e,r){return new _r[t](e,r)},$r),$r,_r;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){var s;this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],p=a.length;for(n=0;n<p;n+=1){var l,m;if(!((o=a[n]).e*s<i||o.s*s>i+r))l=o.s*s<=i?0:(o.s*s-i)/r,m=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([l,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segmentsLengthPool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i,s;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),e=1<this.s.v?1+a:this.s.v<0?0+a:this.s.v+a,(r=1<this.e.v?1+a:this.e.v<0?0+a:this.e.v+a)<e){var n=e;e=r,r=n}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var o,h,p,l,m,f=this.shapes.length,c=0;if(r===e)for(s=0;s<f;s+=1)this.shapes[s].localShapeCollection.releaseShapes(),this.shapes[s].shape._mdf=!0,this.shapes[s].shape.paths=this.shapes[s].localShapeCollection,this._mdf&&(this.shapes[s].pathsData.length=0);else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(s=0;s<f;s+=1)this.shapes[s].pathsData.length=0,this.shapes[s].shape._mdf=!0}else{var d,u,y=[];for(s=0;s<f;s+=1)if((d=this.shapes[s]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=d.shape.paths)._length,m=0,!d.shape._mdf&&d.pathsData.length)m=d.totalShapeLength;else{for(p=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)l=bez.getSegmentsLength(i.shapes[o]),p.push(l),m+=l.totalLength;d.totalShapeLength=m,d.pathsData=p}c+=m,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,P=r,b=0;for(s=f-1;0<=s;s-=1)if((d=this.shapes[s]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<f?(g=this.calculateShapeEdges(e,r,d.totalShapeLength,b,c),b+=d.totalShapeLength):g=[[v,P]],h=g.length,o=0;o<h;o+=1){v=g[o][0],P=g[o][1],y.length=0,P<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*P}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(P-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(P-1)}));var x=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,u),x=this.addShapes(d,y[1],S)}else this.addPaths(x,u),x=this.addShapes(d,y[1]);this.addPaths(x,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,p,l,m=t.pathsData,f=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(l=r?(o=r._length,r._length):(r=shapePool.newElement(),o=0),u.push(r),i=0;i<c;i+=1){for(h=m[i].lengths,r.c=f[i].c,a=f[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,r.c=!1;else{if(d>e.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[s],f[i].v[s],r,o,y),y=!1):(p=bez.getNewSegment(f[i].v[s-1],f[i].v[s],f[i].o[s-1],f[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[i].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[0],f[i].v[0],r,o,y),y=!1):(p=bez.getNewSegment(f[i].v[s-1],f[i].v[0],f[i].o[s-1],f[i].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[l][0],r.v[l][1],"i",l),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;i<c-1&&(r=shapePool.newElement(),y=!0,u.push(r),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r,i=shapePool.newElement();i.c=t.c;var s,a,n,o,h,p,l,m,f,c,d,u,y=t._length,g=0;for(r=0;r<y;r+=1)s=t.v[r],n=t.o[r],a=t.i[r],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==r&&r!==y-1||t.c?(o=0===r?t.v[y-1]:t.v[r-1],p=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,l=d=s[0]+(o[0]-s[0])*p,m=u=s[1]-(s[1]-o[1])*p,f=l-(l-s[0])*roundCorner,c=m-(m-s[1])*roundCorner,i.setTripleAt(l,m,f,c,d,u,g),g+=1,o=r===y-1?t.v[0]:t.v[r+1],p=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,l=f=s[0]+(o[0]-s[0])*p,m=c=s[1]+(o[1]-s[1])*p,d=l-(l-s[0])*roundCorner,u=m-(m-s[1])*roundCorner,i.setTripleAt(l,m,f,c,d,u,g)):i.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):i.setTripleAt(t.v[r][0],t.v[r][1],t.o[r][0],t.o[r][1],t.i[r][0],t.i[r][1],g),g+=1;return i},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var r=e/100,i=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)i[0]+=t.v[a][0],i[1]+=t.v[a][1];i[0]/=s,i[1]/=s;var n,o,h,p,l,m,f=shapePool.newElement();for(f.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(i[0]-t.v[a][0])*r,o=t.v[a][1]+(i[1]-t.v[a][1])*r,h=t.o[a][0]+(i[0]-t.o[a][0])*-r,p=t.o[a][1]+(i[1]-t.o[a][1])*-r,l=t.i[a][0]+(i[0]-t.i[a][0])*-r,m=t.i[a][1]+(i[1]-t.i[a][1])*-r,f.setTripleAt(n,o,h,p,l,m,a);return f},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){for(this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);0<r;)r-=1,this._elements.unshift(e[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var p=this.o.v,l=p%1,m=0<p?Math.floor(p):Math.ceil(p),f=this.pMatrix.props,c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<p){for(;g<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,l,!1),g+=l)}else if(p<0){for(;m<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-l,!0),g-=l)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),u=0;u<y;u+=1)r[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)r[u]=this.matrix.props[u];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shapePool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){},featureSupport=(rw={maskType:!0},(/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))&&(rw.maskType=!1),rw),rw,filtersFactory=(sw={},sw.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},sw.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},sw),sw,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}(),assetLoader=null;function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,p,l,m,f,c,d,u,y,g,v,P,b,x=this._moreOptions.alignment.v,S=this._animatorsData,A=this._textData,T=this.mHelper,E=this._renderType,_=this.renderedLetters.length,C=t.l;if(this._hasMaskedPath){if(b=this._pathData.m,!this._pathData.n||this._pathData._mdf){var k,D=b.v;for(this._pathData.r&&(D=D.reverse()),n={tLength:0,segments:[]},a=D._length-1,s=g=0;s<a;s+=1)k=bez.buildBezierData(D.v[s],D.v[s+1],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[s+1][0]-D.v[s+1][0],D.i[s+1][1]-D.v[s+1][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength;s=a,b.v.c&&(k=bez.buildBezierData(D.v[s],D.v[0],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[0][0]-D.v[0][0],D.i[0][1]-D.v[0][1]]),n.tLength+=k.segmentLength,n.segments.push(k),g+=k.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,m=1,l=!(p=f=0),u=n.segments,o<0&&b.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),m=(d=u[f=u.length-1].points).length-1;o<0;)o+=d[m].partialLength,(m-=1)<0&&(m=(d=u[f-=1].points).length-1);c=(d=u[f].points)[m-1],y=(h=d[m]).partialLength}a=C.length,i=r=0;var I,M,F,w,R,V=1.2*t.finalSize*.714,L=!0;F=S.length;var O,z,B,G,N,j,q,H,W,Y,X,$,K=-1,J=o,Z=f,U=m,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(C[s].n){for(rt&&(rt+=it);at<s;)C[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(M=0;M<F;M+=1)(I=S[M].a).t.propType&&(nt&&2===t.j&&(it+=I.t.v*st),(R=S[M].s.getMult(C[s].anIndexes[M],A.a[M].s.totalChars)).length?rt+=I.t.v*R[0]*st:rt+=I.t.v*R*st);nt=!1}for(rt&&(rt+=it);at<s;)C[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(T.reset(),G=1,C[s].n)r=0,i+=t.yOffset,i+=L?1:0,o=J,L=!1,this._hasMaskedPath&&(m=U,c=(d=u[f=Z].points)[m-1],y=(h=d[m]).partialLength,p=0),$=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==C[s].line){switch(t.j){case 1:o+=g-t.lineWidths[C[s].line];break;case 2:o+=(g-t.lineWidths[C[s].line])/2}Q=C[s].line}K!==C[s].ind&&(C[K]&&(o+=C[K].extra),o+=C[s].an/2,K=C[s].ind),o+=x[0]*C[s].an*.005;var ot=0;for(M=0;M<F;M+=1)(I=S[M].a).p.propType&&((R=S[M].s.getMult(C[s].anIndexes[M],A.a[M].s.totalChars)).length?ot+=I.p.v[0]*R[0]:ot+=I.p.v[0]*R),I.a.propType&&((R=S[M].s.getMult(C[s].anIndexes[M],A.a[M].s.totalChars)).length?ot+=I.a.v[0]*R[0]:ot+=I.a.v[0]*R);for(l=!0;l;)o+ot<=p+y||!d?(v=(o+ot-p)/h.partialLength,z=c.point[0]+(h.point[0]-c.point[0])*v,B=c.point[1]+(h.point[1]-c.point[1])*v,T.translate(-x[0]*C[s].an*.005,-x[1]*V*.01),l=!1):d&&(p+=h.partialLength,(m+=1)>=d.length&&(m=0,d=u[f+=1]?u[f].points:b.v.c?u[f=m=0].points:(p-=h.partialLength,null)),d&&(c=h,y=(h=d[m]).partialLength));O=C[s].an/2-C[s].add,T.translate(-O,0,0)}else O=C[s].an/2-C[s].add,T.translate(-O,0,0),T.translate(-x[0]*C[s].an*.005,-x[1]*V*.01,0);for(M=0;M<F;M+=1)(I=S[M].a).t.propType&&(R=S[M].s.getMult(C[s].anIndexes[M],A.a[M].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?R.length?o+=I.t.v*R[0]:o+=I.t.v*R:R.length?r+=I.t.v*R[0]:r+=I.t.v*R));for(t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(N=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(q=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<F;M+=1)(I=S[M].a).a.propType&&((R=S[M].s.getMult(C[s].anIndexes[M],A.a[M].s.totalChars)).length?T.translate(-I.a.v[0]*R[0],-I.a.v[1]*R[1],I.a.v[2]*R[2]):T.translate(-I.a.v[0]*R,-I.a.v[1]*R,I.a.v[2]*R));for(M=0;M<F;M+=1)(I=S[M].a).s.propType&&((R=S[M].s.getMult(C[s].anIndexes[M],A.a[M].s.totalChars)).length?T.scale(1+(I.s.v[0]-1)*R[0],1+(I.s.v[1]-1)*R[1],1):T.scale(1+(I.s.v[0]-1)*R,1+(I.s.v[1]-1)*R,1));for(M=0;M<F;M+=1){if(I=S[M].a,R=S[M].s.getMult(C[s].anIndexes[M],A.a[M].s.totalChars),I.sk.propType&&(R.length?T.skewFromAxis(-I.sk.v*R[0],I.sa.v*R[1]):T.skewFromAxis(-I.sk.v*R,I.sa.v*R)),I.r.propType&&(R.length?T.rotateZ(-I.r.v*R[2]):T.rotateZ(-I.r.v*R)),I.ry.propType&&(R.length?T.rotateY(I.ry.v*R[1]):T.rotateY(I.ry.v*R)),I.rx.propType&&(R.length?T.rotateX(I.rx.v*R[0]):T.rotateX(I.rx.v*R)),I.o.propType&&(R.length?G+=(I.o.v*R[0]-G)*R[0]:G+=(I.o.v*R-G)*R),t.strokeWidthAnim&&I.sw.propType&&(R.length?j+=I.sw.v*R[0]:j+=I.sw.v*R),t.strokeColorAnim&&I.sc.propType)for(H=0;H<3;H+=1)R.length?N[H]+=(I.sc.v[H]-N[H])*R[0]:N[H]+=(I.sc.v[H]-N[H])*R;if(t.fillColorAnim&&t.fc){if(I.fc.propType)for(H=0;H<3;H+=1)R.length?q[H]+=(I.fc.v[H]-q[H])*R[0]:q[H]+=(I.fc.v[H]-q[H])*R;I.fh.propType&&(q=R.length?addHueToRGB(q,I.fh.v*R[0]):addHueToRGB(q,I.fh.v*R)),I.fs.propType&&(q=R.length?addSaturationToRGB(q,I.fs.v*R[0]):addSaturationToRGB(q,I.fs.v*R)),I.fb.propType&&(q=R.length?addBrightnessToRGB(q,I.fb.v*R[0]):addBrightnessToRGB(q,I.fb.v*R))}}for(M=0;M<F;M+=1)(I=S[M].a).p.propType&&(R=S[M].s.getMult(C[s].anIndexes[M],A.a[M].s.totalChars),this._hasMaskedPath?R.length?T.translate(0,I.p.v[1]*R[0],-I.p.v[2]*R[1]):T.translate(0,I.p.v[1]*R,-I.p.v[2]*R):R.length?T.translate(I.p.v[0]*R[0],I.p.v[1]*R[1],-I.p.v[2]*R[2]):T.translate(I.p.v[0]*R,I.p.v[1]*R,-I.p.v[2]*R));if(t.strokeWidthAnim&&(W=j<0?0:j),t.strokeColorAnim&&(Y="rgb("+Math.round(255*N[0])+","+Math.round(255*N[1])+","+Math.round(255*N[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(T.translate(0,-t.ls),T.translate(0,x[1]*V*.01+i,0),A.p.p){P=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(P)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),T.rotate(-ht*Math.PI/180)}T.translate(z,B,0),o-=x[0]*C[s].an*.005,C[s+1]&&K!==C[s+1].ind&&(o+=C[s].an/2,o+=.001*t.tr*t.finalSize)}else{switch(T.translate(r,i,0),t.ps&&T.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:T.translate(C[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[C[s].line]),0,0);break;case 2:T.translate(C[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[C[s].line])/2,0,0)}T.translate(0,-t.ls),T.translate(O,0,0),T.translate(x[0]*C[s].an*.005,x[1]*V*.01,0),r+=C[s].l+.001*t.tr*t.finalSize}"html"===E?tt=T.toCSS():"svg"===E?tt=T.to2dCSS():et=[T.props[0],T.props[1],T.props[2],T.props[3],T.props[4],T.props[5],T.props[6],T.props[7],T.props[8],T.props[9],T.props[10],T.props[11],T.props[12],T.props[13],T.props[14],T.props[15]],$=G}this.lettersChangedFlag=_<=s?(w=new LetterProps($,W,Y,X,tt,et),this.renderedLetters.push(w),_+=1,!0):(w=this.renderedLetters[s]).update($,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&!(r===i-1||t[r+1].t>e);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),s+=1):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,p=this.data,l=[],m=0,f=p.m.g,c=0,d=0,u=0,y=[],g=0,v=0,P=h.getFontByName(t.f),b=0,x=getFontProperties(P);t.fWeight=x.weight,t.fStyle=x.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var S,A=t.tr/1e3*t.finalSize;if(t.sz)for(var T,E,_=!0,C=t.sz[0],k=t.sz[1];_;){g=T=0,r=(E=this.buildFinalText(t.t)).length,A=t.tr/1e3*t.finalSize;var D=-1;for(e=0;e<r;e+=1)S=E[e].charCodeAt(0),i=!1," "===E[e]?D=e:13!==S&&3!==S||(i=!(g=0),T+=t.finalLineHeight||1.2*t.finalSize),C<g+(b=h.chars?(o=h.getCharData(E[e],P.fStyle,P.fFamily),i?0:o.w*t.finalSize/100):h.measureText(E[e],t.f,t.finalSize))&&" "!==E[e]?(-1===D?r+=1:e=D,T+=t.finalLineHeight||1.2*t.finalSize,E.splice(e,D===e?1:0,"\r"),D=-1,g=0):(g+=b,g+=A);T+=P.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&k<T?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=E,r=t.finalText.length,_=!1)}g=-A;var I,M=b=0;for(e=0;e<r;e+=1)if(i=!1,13===(S=(I=t.finalText[e]).charCodeAt(0))||3===S?(M=0,y.push(g),v=v<g?g:v,g=-2*A,i=!(s=""),u+=1):s=I,b=h.chars?(o=h.getCharData(I,P.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===I?M+=b+A:(g+=b+A+M,M=0),l.push({l:b,an:b,add:c,n:i,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==f){if(c+=b,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=b);d<=e;)l[d].an=c,l[d].ind=m,l[d].extra=b,d+=1;m+=1,c=0}}else if(3==f){if(c+=b,""===s||e===r-1){for(""===s&&(c-=b);d<=e;)l[d].an=c,l[d].ind=m,l[d].extra=b,d+=1;c=0,m+=1}}else l[m].ind=m,l[m].extra=0,m+=1;if(t.l=l,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var F,w,R,V,L=p.a;n=L.length;var O=[];for(a=0;a<n;a+=1){for((F=L[a]).a.sc&&(t.strokeColorAnim=!0),F.a.sw&&(t.strokeWidthAnim=!0),(F.a.fc||F.a.fh||F.a.fs||F.a.fb)&&(t.fillColorAnim=!0),V=0,R=F.s.b,e=0;e<r;e+=1)(w=l[e]).anIndexes[a]=V,(1==R&&""!==w.val||2==R&&""!==w.val&&" "!==w.val||3==R&&(w.n||" "==w.val||e==r-1)||4==R&&(w.n||e==r-1))&&(1===F.s.rn&&O.push(V),V+=1);p.a[a].s.totalChars=V;var z,B=-1;if(1===F.s.rn)for(e=0;e<r;e+=1)B!=(w=l[e]).anIndexes[a]&&(B=w.anIndexes[a],z=O.splice(Math.floor(Math.random()*O.length),1)[0]),w.anIndexes[a]=z}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=P.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,p=this.data.sh;if(2===p)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===p)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===p)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===p){if(h===o)n=0;else{var l=h-o,m=-l/2+(t=d(c(0,t+.5-o),h-o)),f=l/2;n=Math.sqrt(1-m*m/(f*f))}n=a(n)}else n=6===p?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),poolFactory=function(t,e,r){var i=0,s=t,a=createSizedArray(s);return{newElement:function(){return i?a[i-=1]:e()},release:function(t){i===s&&(a=pooling.double(a),s*=2),r&&r(t),a[i]=t,i+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},pointPool=poolFactory(8,function(){return createTypedArray("float32",2)}),shapePool=(yA=poolFactory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)pointPool.release(t.v[e]),pointPool.release(t.i[e]),pointPool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),yA.clone=function(t){var e,r=yA.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},yA),yA,shapeCollectionPool=(GA={newShapeCollection:function(){var t;t=HA?JA[HA-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shapePool.release(t.shapes[e]);t._length=0,HA===IA&&(JA=pooling.double(JA),IA*=2);JA[HA]=t,HA+=1}},HA=0,IA=4,JA=createSizedArray(IA),GA),GA,HA,IA,JA,segmentsLengthPool=poolFactory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezierLengthPool.release(t.lengths[e]);t.lengths.length=0}),bezierLengthPool=poolFactory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s,a=this.globalData.defs,n=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(n),this.solidPath="";var o,h,p,l,m,f,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<n;i+=1)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!==c[i].mode&&"i"!==c[i].mode||0!==d?p=null:((p=createNS("rect")).setAttribute("fill","#ffffff"),p.setAttribute("width",this.element.comp.data.w||0),p.setAttribute("height",this.element.comp.data.h||0),u.push(p)),s=createNS("path"),"n"===c[i].mode)this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:s,lastPath:""},a.appendChild(s);else{var P;if(d+=1,s.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),s.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",f=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),P=createElementID(),(l=createNS("filter")).setAttribute("id",P),(m=createNS("feMorphology")).setAttribute("operator","erode"),m.setAttribute("in","SourceGraphic"),m.setAttribute("radius","0"),l.appendChild(m),a.appendChild(l),s.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):f=m=null,this.storedData[i]={elem:s,x:f,expan:m,lastPath:"",lastOperator:"",filterId:P,lastRadius:0},"i"===c[i].mode){h=u.length;var b=createNS("g");for(o=0;o<h;o+=1)b.appendChild(u[o]);var x=createNS("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",y+"_"+d),x.appendChild(s),a.appendChild(x),b.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(b)}else u.push(s);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:s,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:p},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}for(this.maskElement=createNS(g),n=u.length,i=0;i<n;i+=1)this.maskElement.appendChild(u[i]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(t,e,r,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var s,a=4;"rc"===e.ty?a=5:"el"===e.ty?a=6:"sr"===e.ty&&(a=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,a,t);var n,o=r.length;for(s=0;s<o;s+=1)r[s].closed||(n={transforms:i.addTransformSequence(r[s].transforms),trNodes:[]},this.styledShapes.push(n),r[s].elements.push(n))}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function AudioElement(t,e,r){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,r),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function CVContextData(){var t;this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1;for(this.savedOp=createTypedArray("float32",15),t=0;t<15;t+=1)this.saved[t]=createTypedArray("float32",16);this._length=15}function CVBaseElement(){}function CVCompElement(t,e,r){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function CVMaskElement(t,e){var r;this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var i=this.masksProperties.length,s=!1;for(r=0;r<i;r+=1)"n"!==this.masksProperties[r].mode&&(s=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);(this.hasMasks=s)&&this.element.addRenderableComponent(this)}function CVShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(t,e,r)}function CVSolidElement(t,e,r){this.initElement(t,e,r)}function CVEffects(){}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e-=1)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id===t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextLottieElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],CanvasRenderer),CanvasRenderer.prototype.createShape=function(t){return new CVShapeElement(t,this.globalData,this)},CanvasRenderer.prototype.createText=function(t){return new CVTextElement(t,this.globalData,this)},CanvasRenderer.prototype.createImage=function(t){return new CVImageElement(t,this.globalData,this)},CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},CanvasRenderer.prototype.createSolid=function(t){return new CVSolidElement(t,this.globalData,this)},CanvasRenderer.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRenderer.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var r=this.contextData.cTr.props;this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},CanvasRenderer.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},CanvasRenderer.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRenderer.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e,r=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var i=this.contextData.saved[this.contextData.cArrPos];for(e=0;e<16;e+=1)i[e]=r[e];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},CanvasRenderer.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,r=this.contextData.saved[this.contextData.cArrPos],i=this.contextData.cTr.props;for(e=0;e<16;e+=1)i[e]=r[e];this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),r=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=r,this.globalData.currentGlobalAlpha!==r&&(this.canvasContext.globalAlpha=r,this.globalData.currentGlobalAlpha=r)}else this.canvasContext.restore()},CanvasRenderer.prototype.configAnimation=function(t){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var e=this.animationItem.container.style;e.width="100%",e.height="100%";var r="0px 0px 0px";e.transformOrigin=r,e.mozTransformOrigin=r,e.webkitTransformOrigin=r,e["-webkit-transform"]=r,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},CanvasRenderer.prototype.updateContainerSize=function(){var t,e,r,i;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var s=this.renderConfig.preserveAspectRatio.split(" "),a=s[1]||"meet",n=s[0]||"xMidYMid",o=n.substr(0,4),h=n.substr(4);r=t/e,i=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=r<i&&"meet"===a||i<r&&"slice"===a?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(i<r&&"meet"===a||r<i&&"slice"===a)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(r<i&&"meet"===a||i<r&&"slice"===a)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;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],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRenderer.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){var r;this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i=this.layers.length;for(this.completeLayers||this.checkLayers(t),r=0;r<i;r+=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(t-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var r=this.createItem(this.layers[t],this,this.globalData);(e[t]=r).initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},CanvasRenderer.prototype.configAnimation=function(t){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var e=this.animationItem.container.style;e.width="100%",e.height="100%";var r="0px 0px 0px";e.transformOrigin=r,e.mozTransformOrigin=r,e.webkitTransformOrigin=r,e["-webkit-transform"]=r,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className)}else this.canvasContext=this.renderConfig.context;this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h},this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(t.layers.length),this.updateContainerSize()},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r,i=!0,s=this.comp;i;)s.finalTransform?(s.data.hasMask&&e.splice(0,0,s.finalTransform),s=s.comp):i=!1;var a,n=e.length;for(r=0;r<n;r+=1)a=e[r].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}},CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var p=createNS("rect");p.setAttribute("width",this.comp.data.w),p.setAttribute("height",this.comp.data.h),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("fill","#ffffff"),p.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(p),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(p),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var l=createNS("clipPath"),m=createNS("path");m.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var f=createElementID();if(l.setAttribute("id",f),l.appendChild(m),this.globalData.defs.appendChild(l),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+f+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+f+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,p,l,m,f,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((f=this.searchProcessedElement(t[o]))?e[o]=r[f-1]:t[o]._render=n,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"===t[o].ty){if(f)for(p=e[o].it.length,h=0;h<p;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"===t[o].ty?(f||(e[o]=this.createTransformElement(t[o],i)),l=e[o].transform,c.push(l)):"sh"===t[o].ty||"rc"===t[o].ty||"el"===t[o].ty||"sr"===t[o].ty?(f||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"===t[o].ty||"rd"===t[o].ty||"ms"===t[o].ty||"pb"===t[o].ty?(f?(m=e[o]).closed=!1:((m=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=m,this.shapeModifiers.push(m)),y.push(m)):"rp"===t[o].ty&&(f?(m=e[o]).closed=!0:(m=ShapeModifiers.getModifier(t[o].ty),(e[o]=m).init(this,t,o,e),this.shapeModifiers.push(m),n=!1),y.push(m));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=createTypedArray("float32",t),this.savedOp.set(e);var r=0;for(r=this._length;r<t;r+=1)this.saved[r]=createTypedArray("float32",16);this._length=t},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new CVEffects(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,extendPrototype([CanvasRenderer,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,r,i,s=this.element.finalTransform.mat,a=this.element.canvasContext,n=this.masksProperties.length;for(a.beginPath(),t=0;t<n;t+=1)if("n"!==this.masksProperties[t].mode){var o;this.masksProperties[t].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),i=this.viewData[t].v,e=s.applyToPointArray(i.v[0][0],i.v[0][1],0),a.moveTo(e[0],e[1]);var h=i._length;for(o=1;o<h;o+=1)r=s.applyToTriplePoints(i.o[o-1],i.i[o],i.v[o]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=s.applyToTriplePoints(i.o[o-1],i.i[0],i.v[0]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var r={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"===t.ty||"st"===t.ty?(i.c=PropertyFactory.getProp(this,t.c,1,255,this),i.c.k||(r.co="rgb("+bmFloor(i.c.v[0])+","+bmFloor(i.c.v[1])+","+bmFloor(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=PropertyFactory.getProp(this,t.s,1,null,this),i.e=PropertyFactory.getProp(this,t.e,1,null,this),i.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),i.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),i.g=new GradientProperty(this,t.g,this)),i.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(r.lc=this.lcEnum[t.lc]||"round",r.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(r.ml=t.ml),i.w=PropertyFactory.getProp(this,t.w,0,null,this),i.w.k||(r.wi=i.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);i.d=s,i.d.k||(r.da=i.d.dashArray,r.do=i.d.dashoffset[0])}}else r.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(r),i.style=r,i},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(t){var e,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},CVShapeElement.prototype.closeStyles=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].closed=!0},CVShapeElement.prototype.searchShapes=function(t,e,r,i,s){var a,n,o,h,p,l,m=t.length-1,f=[],c=[],d=[].concat(s);for(a=m;0<=a;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=r[h-1]:t[a]._shouldRender=i,"fl"===t[a].ty||"st"===t[a].ty||"gf"===t[a].ty||"gs"===t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),f.push(e[a].style);else if("gr"===t[a].ty){if(h)for(o=e[a].it.length,n=0;n<o;n+=1)e[a].prevViewData[n]=e[a].it[n];else e[a]=this.createGroupElement(t[a]);this.searchShapes(t[a].it,e[a].it,e[a].prevViewData,i,d)}else"tr"===t[a].ty?(h||(l=this.createTransformElement(t[a]),e[a]=l),d.push(e[a]),this.addTransformToStyleList(e[a])):"sh"===t[a].ty||"rc"===t[a].ty||"el"===t[a].ty||"sr"===t[a].ty?h||(e[a]=this.createShapeElement(t[a])):"tm"===t[a].ty||"rd"===t[a].ty||"pb"===t[a].ty?(h?(p=e[a]).closed=!1:((p=ShapeModifiers.getModifier(t[a].ty)).init(this,t[a]),e[a]=p,this.shapeModifiers.push(p)),c.push(p)):"rp"===t[a].ty&&(h?(p=e[a]).closed=!0:(p=ShapeModifiers.getModifier(t[a].ty),(e[a]=p).init(this,t,a,e),this.shapeModifiers.push(p),i=!1),c.push(p));this.addProcessedElement(t[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(f),m=c.length,a=0;a<m;a+=1)c[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var t,e,r,i,s,a,n,o,h,p=this.stylesList.length,l=this.globalData.renderer,m=this.globalData.canvasContext;for(t=0;t<p;t+=1)if(("st"!==(o=(h=this.stylesList[t]).type)&&"gs"!==o||0!==h.wi)&&h.data._shouldRender&&0!==h.coOp&&0!==this.globalData.currentGlobalAlpha){for(l.save(),a=h.elements,"st"===o||"gs"===o?(m.strokeStyle="st"===o?h.co:h.grd,m.lineWidth=h.wi,m.lineCap=h.lc,m.lineJoin=h.lj,m.miterLimit=h.ml||0):m.fillStyle="fl"===o?h.co:h.grd,l.ctxOpacity(h.coOp),"st"!==o&&"gs"!==o&&m.beginPath(),l.ctxTransform(h.preTransforms.finalTransform.props),r=a.length,e=0;e<r;e+=1){for("st"!==o&&"gs"!==o||(m.beginPath(),h.da&&(m.setLineDash(h.da),m.lineDashOffset=h.do)),s=(n=a[e].trNodes).length,i=0;i<s;i+=1)"m"===n[i].t?m.moveTo(n[i].p[0],n[i].p[1]):"c"===n[i].t?m.bezierCurveTo(n[i].pts[0],n[i].pts[1],n[i].pts[2],n[i].pts[3],n[i].pts[4],n[i].pts[5]):m.closePath();"st"!==o&&"gs"!==o||(m.stroke(),h.da&&m.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&m.fill(h.r),l.restore()}},CVShapeElement.prototype.renderShape=function(t,e,r,i){var s,a;for(a=t,s=e.length-1;0<=s;s-=1)"tr"===e[s].ty?(a=r[s].transform,this.renderShapeTransform(t,a)):"sh"===e[s].ty||"el"===e[s].ty||"rc"===e[s].ty||"sr"===e[s].ty?this.renderPath(e[s],r[s]):"fl"===e[s].ty?this.renderFill(e[s],r[s],a):"st"===e[s].ty?this.renderStroke(e[s],r[s],a):"gf"===e[s].ty||"gs"===e[s].ty?this.renderGradientFill(e[s],r[s],a):"gr"===e[s].ty?this.renderShape(a,e[s].it,r[s].it):e[s].ty;i&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var r,i,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(s=0;s<o;s+=1){var p=n.shapes[s];if(p&&p.v){for(i=p._length,r=1;r<i;r+=1)1===r&&a.push({t:"m",p:h.applyToPointArray(p.v[0][0],p.v[0][1],0)}),a.push({t:"c",pts:h.applyToTriplePoints(p.o[r-1],p.i[r],p.v[r])});1===i&&a.push({t:"m",p:h.applyToPointArray(p.v[0][0],p.v[0][1],0)}),p.c&&i&&(a.push({t:"c",pts:h.applyToTriplePoints(p.o[r-1],p.i[0],p.v[0])}),a.push({t:"z"}))}}t.trNodes=a}},CVShapeElement.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var r,i=e.styledShapes.length;for(r=0;r<i;r+=1)this.renderStyledShape(e.styledShapes[r],e.sh)}},CVShapeElement.prototype.renderFill=function(t,e,r){var i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(t,e,r){var i,s=e.style;if(!s.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var a,n=this.globalData.canvasContext,o=e.s.v,h=e.e.v;if(1===t.t)i=n.createLinearGradient(o[0],o[1],h[0],h[1]);else{var p=Math.sqrt(Math.pow(o[0]-h[0],2)+Math.pow(o[1]-h[1],2)),l=Math.atan2(h[1]-o[1],h[0]-o[0]),m=e.h.v;1<=m?m=.99:m<=-1&&(m=-.99);var f=p*m,c=Math.cos(l+e.a.v)*f+o[0],d=Math.sin(l+e.a.v)*f+o[1];i=n.createRadialGradient(c,d,0,o[0],o[1],p)}var u=t.g.p,y=e.g.c,g=1;for(a=0;a<u;a+=1)e.g._hasOpacity&&e.g._collapsable&&(g=e.g.o[2*a+1]),i.addColorStop(y[4*a]/100,"rgba("+y[4*a+1]+","+y[4*a+2]+","+y[4*a+3]+","+g+")");s.grd=i}s.coOp=e.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||this._isFirstFrame)&&(i.da=s.dashArray,i.do=s.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*r.opacity),(e.w._mdf||this._isFirstFrame)&&(i.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},CVEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||m()),e+=1}function p(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem===t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return f(i,t),i.setData(t,e),i}function l(){n+=1,d()}function m(){n-=1}function f(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",l),t.addEventListener("_idle",m),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=p,t.loadAnimation=function(t){var e=new AnimationItem;return f(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),p(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),p(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||l()),e+=1}function p(){n+=1,c()}function l(){n-=1}function m(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",p),t.addEventListener("_idle",l),s.push({elem:e,animation:t}),a+=1}function f(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?requestAnimationFrame(f):o=!0}function e(t){i=t,requestAnimationFrame(f)}function c(){!h&&n&&o&&(requestAnimationFrame(e),o=!1)}return t.registerAnimation=function(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem===t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return m(i,t),i.setData(t,e),i},t.loadAnimation=function(t){var e=new AnimationItem;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(){throw new Error("Cannot access DOM from worker thread")},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,c()},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){e&&"object"!=typeof e&&(e=JSON.parse(e));var r={wrapper:t,animationData:e},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";"false"===s?r.loop=!1:"true"===s?r.loop=!0:""!==s&&(r.loop=parseInt(s,10));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id===a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!==r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.setParams=function(t){t.context&&(this.context=t.context);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;default:throw new Error("Only canvas renderer is supported when using worker.")}if(this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=null,t.animationData)this.configAnimation(t.animationData);else if(t.path)throw new Error("Canvas worker renderer cannot load animation from url")},AnimationItem.prototype.setData=function(){throw new Error("Cannot set data on wrapper for canvas worker renderer")},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id===a[r].id){i[e]=a[r];break}e+=1}this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(t&&0!==t.length&&this.autoloadSegments)throw new Error("Cannot load multiple segments in worker.");this.timeCompleted=this.totalFrames},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=null,AnimationItem.prototype.preloadImages=null,AnimationItem.prototype.configAnimation=function(t){this.renderer&&(this.animationData=t,this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.renderer.searchExtraCompositions(t.assets),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.firstFrame=Math.round(this.animationData.ip),this.frameMult=this.animationData.fr/1e3,this.loadSegments(),this.updaFrameModifier(),this.checkLoaded())},AnimationItem.prototype.waitForFontsLoaded=null,AnimationItem.prototype.checkLoaded=function(){this.isLoaded||(this.isLoaded=!0,dataManager.completeData(this.animationData,null),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),this.gotoFrame())},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.getPath=null;var Expressions=(uO={},uO.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},uO),uO;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:-t}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]+=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t,10)),"string"===i&&(e=parseInt(e,10)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]-=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t,10)),"string"==typeof e&&(e=parseInt(e,10)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var r;e||(e=helperLengthArray);var i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n===o)r=e=0;else{var p=n-o;switch(r=.5<h?p/(2-n-o):p/(n+o),n){case i:e=(s-a)/p+(s<a?6:0);break;case s:e=(a-i)/p+2;break;case a:e=(i-s)/p+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)r=i=e=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n,o=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*o;var h=i.length,p=createTypedArray("float32",h);for(n=0;n<h;n+=1)p[n]=i[n]+(s[n]-i[n])*o;return p}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shapePool.newElement();n.setPathData(!!i,a);var o,h,p=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:p,h=r&&r[s]?r[s]:p,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),p=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)p[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return p}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r),1<e?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(s)){var o,h=s.length,p=createTypedArray("float32",h);for(o=0;o<h;o+=1)p[o]=(a[o]-s[o])*n+s[o];return p}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,p=this.keyframes,l=p[p.length-1].t;if(h<=l)return this.pv;if(r?s=l-(i=e?Math.abs(l-this.elem.comp.globalData.frameRate*e):Math.max(0,l-this.elem.data.ip)):((!e||e>p.length-1)&&(e=p.length-1),i=l-(s=p[p.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(l/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=(f[a]-m[a])*d+c[a];return o}return(f-m)*d+c}if("continue"===t){var u=this.getValueAtTime(l/this.comp.globalData.frameRate,0),y=this.getValueAtTime((l-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-l)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-l)/.001*(u-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,p=this.keyframes,l=p[0].t;if(l<=h)return this.pv;if(r?s=l+(i=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-l)):((!e||e>p.length-1)&&(e=p.length-1),i=(s=p[e].t)-l),"pingpong"===t){if(Math.floor((l-h)/i)%2==0)return this.getValueAtTime(((l-h)%i+l)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var m=this.getValueAtTime(l/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(l-h)%i+l)/this.comp.globalData.frameRate,0),d=Math.floor((l-h)/i)+1;if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(f[a]-m[a])*d;return o}return c-(f-m)*d}if("continue"===t){var u=this.getValueAtTime(l/this.comp.globalData.frameRate,0),y=this.getValueAtTime((l+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(l-h)/.001;return o}return u+(u-y)*(l-h)/.001}}return this.getValueAtTime((i-((l-h)%i+l))/this.comp.globalData.frameRate,0)}function p(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(t);e.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var i=this.s.getValueAtTime(t);e.scale(i[0]*this.s.mult,i[1]*this.s.mult,i[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),p=this.rx.getValueAtTime(t),l=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(p*this.rx.mult).rotateZ(-l[2]*this.or.mult).rotateY(l[1]*this.or.mult).rotateX(l[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var m=this.px.getValueAtTime(t),f=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(m*this.px.mult,f*this.py.mult,-c*this.pz.mult)}else e.translate(m*this.px.mult,f*this.py.mult,0)}else{var d=this.p.getValueAtTime(t);e.translate(d[0]*this.p.mult,d[1]*this.p.mult,-d[2]*this.p.mult)}return e}.bind(i):i.getValueAtTime=function(){return this.v.clone(new Matrix)}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var l=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=l(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=p,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r,i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var s=i._length,a=i[t],n=i.v,o=createSizedArray(s);for(r=0;r<s;r+=1)o[r]="i"===t||"o"===t?[a[r][0]-n[r][0],a[r][1]-n[r][1]]:[a[r][0],a[r][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,p=0;o<h;){if(p+a[o].addedLength>n){var l=o,m=r.c&&o===h-1?0:o+1,f=(n-p)/a[o].addedLength;i=bez.getPointInSegment(r.v[l],r.v[m],r.o[l],r.i[m],f,a[o]);break}p+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){1==t?t=this.v.c:0==t&&(t=.999);var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null};var ShapePathInterface=function(t,e,r){var i=e.sh;function s(t){return"Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t?s.path:null}var a=propertyGroupFactory(s,r);return i.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:r}}),s},propertyGroupFactory=function(e,r){return function(t){return(t=void 0===t?1:t)<=0?e:r(t-1)}},PropertyInterface=function(t,e){var r={_name:t};return function(t){return(t=void 0===t?1:t)<=0?r:e(t-1)}},ShapeExpressionInterface=function(){function n(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"===t[i].ty?s.push(o(t[i],e[i],r)):"fl"===t[i].ty?s.push(h(t[i],e[i],r)):"st"===t[i].ty?s.push(p(t[i],e[i],r)):"tm"===t[i].ty?s.push(l(t[i],e[i],r)):"tr"===t[i].ty||("el"===t[i].ty?s.push(f(t[i],e[i],r)):"sr"===t[i].ty?s.push(c(t[i],e[i],r)):"sh"===t[i].ty?s.push(ShapePathInterface(t[i],e[i],r)):"rc"===t[i].ty?s.push(d(t[i],e[i],r)):"rd"===t[i].ty?s.push(u(t[i],e[i],r)):"rp"===t[i].ty&&s.push(y(t[i],e[i],r)));return s}function o(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,e,r){var i,s=function(t){for(var e=0,r=i.length;e<r;){if(i[e]._name===t||i[e].mn===t||i[e].propertyIndex===t||i[e].ix===t||i[e].ind===t)return i[e];e+=1}return"number"==typeof t?i[t-1]:null};s.propertyGroup=propertyGroupFactory(s,r),i=n(t.it,e.it,s.propertyGroup),s.numProperties=i.length;var a=m(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,i.propertyGroup),a=m(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function h(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:null}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),i}function p(t,e,r){var i,s=propertyGroupFactory(p,r),a=propertyGroupFactory(h,s);var n,o=t.d?t.d.length:0,h={};for(i=0;i<o;i+=1)n=i,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[i].p.setGroupProperty(a);function p(t){return"Color"===t||"color"===t?p.color:"Opacity"===t||"opacity"===t?p.opacity:"Stroke Width"===t||"stroke width"===t?p.strokeWidth:null}return Object.defineProperties(p,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",s)),e.o.setGroupProperty(PropertyInterface("Opacity",s)),e.w.setGroupProperty(PropertyInterface("Stroke Width",s)),p}function l(e,t,r){function i(t){return t===e.e.ix||"End"===t||"end"===t?i.end:t===e.s.ix?i.start:t===e.o.ix?i.offset:null}var s=propertyGroupFactory(i,r);return i.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),i.propertyIndex=e.ix,i.propertyGroup=r,Object.defineProperties(i,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),i.mn=e.mn,i}function m(e,t,r){function i(t){return e.a.ix===t||"Anchor Point"===t?i.anchorPoint:e.o.ix===t||"Opacity"===t?i.opacity:e.p.ix===t||"Position"===t?i.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?i.rotation:e.s.ix===t||"Scale"===t?i.scale:e.sk&&e.sk.ix===t||"Skew"===t?i.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?i.skewAxis:null}var s=propertyGroupFactory(i,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(i,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),i.ty="tr",i.mn=e.mn,i.propertyGroup=r,i}function f(e,t,r){function i(t){return e.p.ix===t?i.position:e.s.ix===t?i.size:null}var s=propertyGroupFactory(i,r);i.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(i,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),i.mn=e.mn,i}function c(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.rotation:e.pt.ix===t?i.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?i.outerRadius:e.os.ix===t?i.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?i.innerRoundness:null:i.innerRadius}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),i.mn=e.mn,i}function d(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?i.size:null}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),i.mn=e.mn,i}function u(e,t,r){function i(t){return e.r.ix===t||"Round Corners 1"===t?i.radius:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(i,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),i.mn=e.mn,i}function y(e,t,r){function i(t){return e.c.ix===t||"Copies"===t?i.copies:e.o.ix===t||"Offset"===t?i.offset:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(i,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),i.mn=e.mn,i}return function(t,e,i){var s;function r(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,r=s.length;e<r;){if(s[e]._name===t)return s[e];e+=1}return null}return r.propertyGroup=propertyGroupFactory(r,function(){return i}),s=n(t,e,r.propertyGroup),r.numProperties=s.length,r._name="Contents",r}}(),TextExpressionInterface=function(e){var r;function i(t){switch(t){case"ADBE Text Document":return i.sourceText;default:return null}}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),i},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,t)}function n(t,e){var r=this.getMatrix(e);return this.applyPoint(r,t)}function o(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,t)}function h(t,e){var r=this.getMatrix(e);return this.invertPoint(r,t)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function m(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function f(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect;case"ADBE Text Properties":return i.textInterface;default:return null}}i.getMatrix=s,i.invertPoint=l,i.applyPoint=p,i.toWorld=n,i.toWorldVec=a,i.fromWorld=h,i.fromWorldVec=o,i.toComp=n,i.fromComp=m,i.sampleImage=f,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity;default:return null}}var r,i,s,a;return Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p?a=ExpressionPropertyInterface(t.p):(r=ExpressionPropertyInterface(t.px),i=ExpressionPropertyInterface(t.py),t.pz&&(s=ExpressionPropertyInterface(t.pz))),Object.defineProperty(e,"position",{get:function(){return t.p?a():[r(),i(),s?s():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function p(s,t,e,r){function i(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?o[r]:o[r]();r+=1}throw new Error}var a,n=propertyGroupFactory(i,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(p(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,r)):o.push(l(t.effectElements[a],s.ef[a].ty,r,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(i,"color",{get:function(){return o[0]()}}),Object.defineProperties(i,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),i.enabled=0!==s.en,i.active=i.enabled,i}function l(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",i)),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(p(s[r],t.effectsManager.effectElements[r],e,t));var n=t.data.ef||[],o=function(t){for(r=0,a=n.length;r<a;){if(t===n[r].nm||t===n[r].mn||t===n[r].ix)return i[r];r+=1}return null};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}return null}}}(),MaskManagerInterface=function(){function t(t,e){this._mask=t,this._data=e}Object.defineProperty(t.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(t.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new t(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(!i.numKeys)return 0;var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r.value="unidimensional"===a?e[0]:e,r},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)a[t]=e.v[t]*r,s[t]=a[t];return s}}(t):e}}();function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var r,i=t.ef||[];this.effectElements=[];var s,a=i.length;for(r=0;r<a;r+=1)s=new GroupEffect(i[r],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}!function(){!function(){function t(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}}();var i=TextSelectorProp.getTextSelectorProp;TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new TextExpressionSelectorPropFactory(t,e,r):i(t,e,r)}}(),extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){var r;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottiejs={};function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":default:defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}return lottiejs.play=animationManager.play,lottiejs.pause=animationManager.pause,lottiejs.togglePause=animationManager.togglePause,lottiejs.setSpeed=animationManager.setSpeed,lottiejs.setDirection=animationManager.setDirection,lottiejs.stop=animationManager.stop,lottiejs.registerAnimation=animationManager.registerAnimation,lottiejs.loadAnimation=loadAnimation,lottiejs.resize=animationManager.resize,lottiejs.goToAndStop=animationManager.goToAndStop,lottiejs.destroy=animationManager.destroy,lottiejs.setQuality=setQuality,lottiejs.freeze=animationManager.freeze,lottiejs.unfreeze=animationManager.unfreeze,lottiejs.setVolume=animationManager.setVolume,lottiejs.mute=animationManager.mute,lottiejs.unmute=animationManager.unmute,lottiejs.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottiejs.version="5.7.6",lottiejs}({}),animations=[];onmessage=function(t){var e=t.data.canvas.getContext("2d"),r=lottie.loadAnimation({renderer:"canvas",loop:t.data.loop,autoplay:!0,animationData:t.data.animationData,rendererSettings:{context:e,scaleMode:"noScale",clearCanvas:!0}});animations.push(r),r.play()};
 return lottie;
 }));
\ No newline at end of file
diff --git a/build/player/lottie_html.js b/build/player/lottie_html.js
index 45dde4b..c8495ee 100644
--- a/build/player/lottie_html.js
+++ b/build/player/lottie_html.js
@@ -10,364 +10,407 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";
-var svgNS = "http://www.w3.org/2000/svg";
+	/* global locationHref:writable, animationManager, subframeEnabled:writable, defaultCurveSegments:writable, roundValues,
+expressionsPlugin:writable, PropertyFactory, ShapePropertyFactory, Matrix */
+/* exported locationHref, subframeEnabled, expressionsPlugin */
+
+'use strict';
+
+/* exported svgNS, locationHref, initialDefaultFrame */
+
+var svgNS = 'http://www.w3.org/2000/svg';
 
 var locationHref = '';
 
 var initialDefaultFrame = -999999;
 
+/* global createSizedArray */
+/* exported subframeEnabled, expressionsPlugin, isSafari, cachedColors, bmPow, bmSqrt, bmFloor, bmMax, bmMin, ProjectInterface,
+defaultCurveSegments, degToRads, roundCorner, bmRnd, styleDiv, BMEnterFrameEvent, BMCompleteEvent, BMCompleteLoopEvent,
+BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, BMAnimationConfigErrorEvent, createElementID,
+addSaturationToRGB, addBrightnessToRGB, addHueToRGB, rgbToHex */
+
 var subframeEnabled = true;
 var expressionsPlugin;
 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
+var bmRnd;
+var bmPow = Math.pow;
+var bmSqrt = Math.sqrt;
+var bmFloor = Math.floor;
+var bmMax = Math.max;
+var bmMin = Math.min;
 
 var BMMath = {};
-(function(){
-    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"];
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
+(function () {
+  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'];
+  var i;
+  var len = propertyNames.length;
+  for (i = 0; i < len; i += 1) {
+    BMMath[propertyNames[i]] = Math[propertyNames[i]];
+  }
 }());
 
-function ProjectInterface(){return {};}
+function ProjectInterface() { return {}; }
 
 BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = createSizedArray(val.length);
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
+BMMath.abs = function (val) {
+  var tOfVal = typeof val;
+  if (tOfVal === 'object' && val.length) {
+    var absArr = createSizedArray(val.length);
+    var i;
+    var len = val.length;
+    for (i = 0; i < len; i += 1) {
+      absArr[i] = Math.abs(val[i]);
     }
-    return Math.abs(val);
-
+    return absArr;
+  }
+  return Math.abs(val);
 };
 var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
+var degToRads = Math.PI / 180;
 var roundCorner = 0.5519;
 
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
+function roundValues(flag) {
+  if (flag) {
+    bmRnd = Math.round;
+  } else {
+    bmRnd = function (val) {
+      return val;
+    };
+  }
 }
 roundValues(false);
 
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
+function styleDiv(element) {
+  element.style.position = 'absolute';
+  element.style.top = 0;
+  element.style.left = 0;
+  element.style.display = 'block';
+  element.style.transformOrigin = '0 0';
+  element.style.webkitTransformOrigin = '0 0';
+  element.style.backfaceVisibility = 'visible';
+  element.style.webkitBackfaceVisibility = 'visible';
+  element.style.transformStyle = 'preserve-3d';
+  element.style.webkitTransformStyle = 'preserve-3d';
+  element.style.mozTransformStyle = 'preserve-3d';
 }
 
-function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
-    this.type = type;
-    this.currentTime = currentTime;
-    this.totalTime = totalTime;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
+  this.type = type;
+  this.currentTime = currentTime;
+  this.totalTime = totalTime;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteEvent(type, frameMultiplier){
-    this.type = type;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteEvent(type, frameMultiplier) {
+  this.type = type;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
-    this.type = type;
-    this.currentLoop = currentLoop;
-    this.totalLoops = totalLoops;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
+  this.type = type;
+  this.currentLoop = currentLoop;
+  this.totalLoops = totalLoops;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMSegmentStartEvent(type, firstFrame, totalFrames){
-    this.type = type;
-    this.firstFrame = firstFrame;
-    this.totalFrames = totalFrames;
+function BMSegmentStartEvent(type, firstFrame, totalFrames) {
+  this.type = type;
+  this.firstFrame = firstFrame;
+  this.totalFrames = totalFrames;
 }
 
-function BMDestroyEvent(type, target){
-    this.type = type;
-    this.target = target;
+function BMDestroyEvent(type, target) {
+  this.type = type;
+  this.target = target;
 }
 
 function BMRenderFrameErrorEvent(nativeError, currentTime) {
-    this.type = 'renderFrameError';
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = 'renderFrameError';
+  this.nativeError = nativeError;
+  this.currentTime = currentTime;
 }
 
 function BMConfigErrorEvent(nativeError) {
-    this.type = 'configError';
-    this.nativeError = nativeError;
+  this.type = 'configError';
+  this.nativeError = nativeError;
 }
 
 function BMAnimationConfigErrorEvent(type, nativeError) {
-    this.type = type;
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = type;
+  this.nativeError = nativeError;
 }
 
-var createElementID = (function(){
-    var _count = 0;
-    return function createID() {
-        return '__lottie_element_' + ++_count
-    }
-}())
+var createElementID = (function () {
+  var _count = 0;
+  return function createID() {
+    _count += 1;
+    return '__lottie_element_' + _count;
+  };
+}());
 
 function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v; g = t; b = p; break;
-        case 1: r = q; g = v; b = p; break;
-        case 2: r = p; g = v; b = t; break;
-        case 3: r = p; g = q; b = v; break;
-        case 4: r = t; g = p; b = v; break;
-        case 5: r = v; g = p; b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
+  var r;
+  var g;
+  var b;
+  var i;
+  var f;
+  var p;
+  var q;
+  var t;
+  i = Math.floor(h * 6);
+  f = h * 6 - i;
+  p = v * (1 - s);
+  q = v * (1 - f * s);
+  t = v * (1 - (1 - f) * s);
+  switch (i % 6) {
+    case 0: r = v; g = t; b = p; break;
+    case 1: r = q; g = v; b = p; break;
+    case 2: r = p; g = v; b = t; break;
+    case 3: r = p; g = q; b = v; break;
+    case 4: r = t; g = p; b = v; break;
+    case 5: r = v; g = p; b = q; break;
+    default: break;
+  }
+  return [r,
+    g,
+    b];
 }
 
 function RGBtoHSV(r, g, b) {
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
+  var max = Math.max(r, g, b);
+  var min = Math.min(r, g, b);
+  var d = max - min;
+  var h;
+  var s = (max === 0 ? 0 : d / max);
+  var v = max / 255;
 
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
+  switch (max) {
+    case min: h = 0; break;
+    case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break;
+    case g: h = (b - r) + d * 2; h /= 6 * d; break;
+    case b: h = (r - g) + d * 4; h /= 6 * d; break;
+    default: break;
+  }
 
-    return [
-         h,
-         s,
-         v
-    ];
+  return [
+    h,
+    s,
+    v,
+  ];
 }
 
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addSaturationToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[1] += offset;
+  if (hsv[1] > 1) {
+    hsv[1] = 1;
+  } else if (hsv[1] <= 0) {
+    hsv[1] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addBrightnessToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[2] += offset;
+  if (hsv[2] > 1) {
+    hsv[2] = 1;
+  } else if (hsv[2] < 0) {
+    hsv[2] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addHueToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[0] += offset / 360;
+  if (hsv[0] > 1) {
+    hsv[0] -= 1;
+  } else if (hsv[0] < 0) {
+    hsv[0] += 1;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
+var rgbToHex = (function () {
+  var colorMap = [];
+  var i;
+  var hex;
+  for (i = 0; i < 256; i += 1) {
+    hex = i.toString(16);
+    colorMap[i] = hex.length === 1 ? '0' + hex : hex;
+  }
 
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
+  return function (r, g, b) {
+    if (r < 0) {
+      r = 0;
+    }
+    if (g < 0) {
+      g = 0;
+    }
+    if (b < 0) {
+      b = 0;
+    }
+    return '#' + colorMap[r] + colorMap[g] + colorMap[b];
+  };
 }());
-function BaseEvent(){}
-BaseEvent.prototype = {
-	triggerEvent: function (eventName, args) {
-	    if (this._cbs[eventName]) {
-	        var len = this._cbs[eventName].length;
-	        for (var i = 0; i < len; i++){
-	            this._cbs[eventName][i](args);
-	        }
-	    }
-	},
-	addEventListener: function (eventName, callback) {
-	    if (!this._cbs[eventName]){
-	        this._cbs[eventName] = [];
-	    }
-	    this._cbs[eventName].push(callback);
 
-		return function() {
-			this.removeEventListener(eventName, callback);
-		}.bind(this);
-	},
-	removeEventListener: function (eventName,callback){
-	    if (!callback){
-	        this._cbs[eventName] = null;
-	    }else if(this._cbs[eventName]){
-	        var i = 0, len = this._cbs[eventName].length;
-	        while(i<len){
-	            if(this._cbs[eventName][i] === callback){
-	                this._cbs[eventName].splice(i,1);
-	                i -=1;
-	                len -= 1;
-	            }
-	            i += 1;
-	        }
-	        if(!this._cbs[eventName].length){
-	            this._cbs[eventName] = null;
-	        }
-	    }
-	}
+function BaseEvent() {}
+BaseEvent.prototype = {
+  triggerEvent: function (eventName, args) {
+    if (this._cbs[eventName]) {
+      var len = this._cbs[eventName].length;
+      for (var i = 0; i < len; i += 1) {
+        this._cbs[eventName][i](args);
+      }
+    }
+  },
+  addEventListener: function (eventName, callback) {
+    if (!this._cbs[eventName]) {
+      this._cbs[eventName] = [];
+    }
+    this._cbs[eventName].push(callback);
+
+    return function () {
+      this.removeEventListener(eventName, callback);
+    }.bind(this);
+  },
+  removeEventListener: function (eventName, callback) {
+    if (!callback) {
+      this._cbs[eventName] = null;
+    } else if (this._cbs[eventName]) {
+      var i = 0;
+      var len = this._cbs[eventName].length;
+      while (i < len) {
+        if (this._cbs[eventName][i] === callback) {
+          this._cbs[eventName].splice(i, 1);
+          i -= 1;
+          len -= 1;
+        }
+        i += 1;
+      }
+      if (!this._cbs[eventName].length) {
+        this._cbs[eventName] = null;
+      }
+    }
+  },
 };
-var createTypedArray = (function(){
-	function createRegularArray(type, len){
-		var i = 0, arr = [], value;
-		switch(type) {
-			case 'int16':
-			case 'uint8c':
-				value = 1;
-				break;
-			default:
-				value = 1.1;
-				break;
-		}
-		for(i = 0; i < len; i += 1) {
-			arr.push(value);
-		}
-		return arr;
-	}
-	function createTypedArray(type, len){
-		if(type === 'float32') {
-			return new Float32Array(len);
-		} else if(type === 'int16') {
-			return new Int16Array(len);
-		} else if(type === 'uint8c') {
-			return new Uint8ClampedArray(len);
-		}
-	}
-	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
-		return createTypedArray;
-	} else {
-		return createRegularArray;
-	}
+
+/* exported createTypedArray, createSizedArray */
+
+var createTypedArray = (function () {
+  function createRegularArray(type, len) {
+    var i = 0;
+    var arr = [];
+    var value;
+    switch (type) {
+      case 'int16':
+      case 'uint8c':
+        value = 1;
+        break;
+      default:
+        value = 1.1;
+        break;
+    }
+    for (i = 0; i < len; i += 1) {
+      arr.push(value);
+    }
+    return arr;
+  }
+  function createTypedArrayFactory(type, len) {
+    if (type === 'float32') {
+      return new Float32Array(len);
+    } if (type === 'int16') {
+      return new Int16Array(len);
+    } if (type === 'uint8c') {
+      return new Uint8ClampedArray(len);
+    }
+    return createRegularArray(type, len);
+  }
+  if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+    return createTypedArrayFactory;
+  }
+  return createRegularArray;
 }());
 
 function createSizedArray(len) {
-	return Array.apply(null,{length:len});
+  return Array.apply(null, { length: len });
 }
+
+/* global svgNS */
+/* exported createNS */
+
 function createNS(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElementNS(svgNS, type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElementNS(svgNS, type);
 }
+
+/* exported createTag */
+
 function createTag(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElement(type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElement(type);
 }
-function DynamicPropertyContainer(){};
+
+function DynamicPropertyContainer() {}
 DynamicPropertyContainer.prototype = {
-	addDynamicProperty: function(prop) {
-		if(this.dynamicProperties.indexOf(prop) === -1) {
-	        this.dynamicProperties.push(prop);
-	        this.container.addDynamicProperty(this);
-	    	this._isAnimated = true;
-	    }
-	},
-	iterateDynamicProperties: function(){
-	    this._mdf = false;
-	    var i, len = this.dynamicProperties.length;
-	    for(i=0;i<len;i+=1){
-	        this.dynamicProperties[i].getValue();
-	        if(this.dynamicProperties[i]._mdf) {
-	            this._mdf = true;
-	        }
-	    }
-	},
-	initDynamicPropertyContainer: function(container){
-	    this.container = container;
-	    this.dynamicProperties = [];
-	    this._mdf = false;
-	    this._isAnimated = false;
-	}
-}
-var getBlendMode = (function() {
-
-	var blendModeEnums = {
-        0:'source-over',
-        1:'multiply',
-        2:'screen',
-        3:'overlay',
-        4:'darken',
-        5:'lighten',
-        6:'color-dodge',
-        7:'color-burn',
-        8:'hard-light',
-        9:'soft-light',
-        10:'difference',
-        11:'exclusion',
-        12:'hue',
-        13:'saturation',
-        14:'color',
-        15:'luminosity'
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+      this.container.addDynamicProperty(this);
+      this._isAnimated = true;
     }
+  },
+  iterateDynamicProperties: function () {
+    this._mdf = false;
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      this.dynamicProperties[i].getValue();
+      if (this.dynamicProperties[i]._mdf) {
+        this._mdf = true;
+      }
+    }
+  },
+  initDynamicPropertyContainer: function (container) {
+    this.container = container;
+    this.dynamicProperties = [];
+    this._mdf = false;
+    this._isAnimated = false;
+  },
+};
 
-	return function(mode) {
-		return blendModeEnums[mode] || '';
-	}
-}())
+/* exported getBlendMode */
+
+var getBlendMode = (function () {
+  var blendModeEnums = {
+    0: 'source-over',
+    1: 'multiply',
+    2: 'screen',
+    3: 'overlay',
+    4: 'darken',
+    5: 'lighten',
+    6: 'color-dodge',
+    7: 'color-burn',
+    8: 'hard-light',
+    9: 'soft-light',
+    10: 'difference',
+    11: 'exclusion',
+    12: 'hue',
+    13: 'saturation',
+    14: 'color',
+    15: 'luminosity',
+  };
+
+  return function (mode) {
+    return blendModeEnums[mode] || '';
+  };
+}());
+
+/* global createTypedArray */
+
 /*!
  Transformation Matrix v2.0
  (c) Epistemex 2014-2015
@@ -397,394 +440,399 @@
  * @constructor
  */
 
-var Matrix = (function(){
+var Matrix = (function () {
+  var _cos = Math.cos;
+  var _sin = Math.sin;
+  var _tan = Math.tan;
+  var _rnd = Math.round;
 
-    var _cos = Math.cos;
-    var _sin = Math.sin;
-    var _tan = Math.tan;
-    var _rnd = Math.round;
+  function reset() {
+    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;
+    return this;
+  }
 
-    function reset(){
-        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;
-        return this;
+  function rotate(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function rotateX(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateY(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateZ(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function shear(sx, sy) {
+    return this._t(1, sy, sx, 1, 0, 0);
+  }
+
+  function skew(ax, ay) {
+    return this.shear(_tan(ax), _tan(ay));
+  }
+
+  function skewFromAxis(ax, angle) {
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    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);
+  }
+
+  function scale(sx, sy, sz) {
+    if (!sz && sz !== 0) {
+      sz = 1;
+    }
+    if (sx === 1 && sy === 1 && sz === 1) {
+      return this;
+    }
+    return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
+  }
+
+  function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
+    this.props[0] = a;
+    this.props[1] = b;
+    this.props[2] = c;
+    this.props[3] = d;
+    this.props[4] = e;
+    this.props[5] = f;
+    this.props[6] = g;
+    this.props[7] = h;
+    this.props[8] = i;
+    this.props[9] = j;
+    this.props[10] = k;
+    this.props[11] = l;
+    this.props[12] = m;
+    this.props[13] = n;
+    this.props[14] = o;
+    this.props[15] = p;
+    return this;
+  }
+
+  function translate(tx, ty, tz) {
+    tz = tz || 0;
+    if (tx !== 0 || ty !== 0 || tz !== 0) {
+      return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
+    }
+    return this;
+  }
+
+  function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
+    var _p = this.props;
+
+    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) {
+      // NOTE: commenting this condition because TurboFan deoptimizes code when present
+      // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+      _p[12] = _p[12] * a2 + _p[15] * m2;
+      _p[13] = _p[13] * f2 + _p[15] * n2;
+      _p[14] = _p[14] * k2 + _p[15] * o2;
+      _p[15] *= p2;
+      // }
+      this._identityCalculated = false;
+      return this;
     }
 
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
+    var a1 = _p[0];
+    var b1 = _p[1];
+    var c1 = _p[2];
+    var d1 = _p[3];
+    var e1 = _p[4];
+    var f1 = _p[5];
+    var g1 = _p[6];
+    var h1 = _p[7];
+    var i1 = _p[8];
+    var j1 = _p[9];
+    var k1 = _p[10];
+    var l1 = _p[11];
+    var m1 = _p[12];
+    var n1 = _p[13];
+    var o1 = _p[14];
+    var p1 = _p[15];
 
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(_tan(ax), _tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        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);
-    }
-
-    function scale(sx, sy, sz) {
-        if(!sz && sz !== 0) {
-            sz = 1;
-        }
-        if(sx === 1 && sy === 1 && sz === 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        var _p = this.props;
-
-        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){
-            //NOTE: commenting this condition because TurboFan deoptimizes code when present
-            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-                _p[12] = _p[12] * a2 + _p[15] * m2;
-                _p[13] = _p[13] * f2 + _p[15] * n2;
-                _p[14] = _p[14] * k2 + _p[15] * o2;
-                _p[15] = _p[15] * p2;
-            //}
-            this._identityCalculated = false;
-            return this;
-        }
-
-        var a1 = _p[0];
-        var b1 = _p[1];
-        var c1 = _p[2];
-        var d1 = _p[3];
-        var e1 = _p[4];
-        var f1 = _p[5];
-        var g1 = _p[6];
-        var h1 = _p[7];
-        var i1 = _p[8];
-        var j1 = _p[9];
-        var k1 = _p[10];
-        var l1 = _p[11];
-        var m1 = _p[12];
-        var n1 = _p[13];
-        var o1 = _p[14];
-        var p1 = _p[15];
-
-        /* matrix order (canvas compatible):
+    /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+    _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+    _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
+    _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
+    _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
 
-        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+    _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
+    _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
+    _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
+    _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
 
-        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+    _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
+    _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
+    _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
+    _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
 
-        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+    _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
+    _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
+    _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
+    _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
 
-        this._identityCalculated = false;
-        return this;
+    this._identityCalculated = false;
+    return this;
+  }
+
+  function isIdentity() {
+    if (!this._identityCalculated) {
+      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);
+      this._identityCalculated = true;
     }
+    return this._identity;
+  }
 
-    function isIdentity() {
-        if(!this._identityCalculated){
-            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);
-            this._identityCalculated = true;
-        }
-        return this._identity;
+  function equals(matr) {
+    var i = 0;
+    while (i < 16) {
+      if (matr.props[i] !== this.props[i]) {
+        return false;
+      }
+      i += 1;
     }
+    return true;
+  }
 
-    function equals(matr){
-        var i = 0;
-        while (i < 16) {
-            if(matr.props[i] !== this.props[i]) {
-                return false;
-            }
-            i+=1;
-        }
-        return true;
+  function clone(matr) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      matr.props[i] = this.props[i];
     }
+    return matr;
+  }
 
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-        return matr;
+  function cloneFromProps(props) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      this.props[i] = props[i];
     }
+  }
 
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
+  function applyToPoint(x, y, z) {
+    return {
+      x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
+      y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
+      z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14],
+    };
+    /* return {
          x: x * me.a + y * me.c + me.e,
          y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
+         }; */
+  }
+  function applyToX(x, y, z) {
+    return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
+  }
+  function applyToY(x, y, z) {
+    return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
+  }
+  function applyToZ(x, y, z) {
+    return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
+  }
 
-    function getInverseMatrix() {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        var inverseMatrix = new Matrix();
-        inverseMatrix.props[0] = a;
-        inverseMatrix.props[1] = b;
-        inverseMatrix.props[4] = c;
-        inverseMatrix.props[5] = d;
-        inverseMatrix.props[12] = e;
-        inverseMatrix.props[13] = f;
-        return inverseMatrix;
-    }
+  function getInverseMatrix() {
+    var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
+    var a = this.props[5] / determinant;
+    var b = -this.props[1] / determinant;
+    var c = -this.props[4] / determinant;
+    var d = this.props[0] / determinant;
+    var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
+    var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
+    var inverseMatrix = new Matrix();
+    inverseMatrix.props[0] = a;
+    inverseMatrix.props[1] = b;
+    inverseMatrix.props[4] = c;
+    inverseMatrix.props[5] = d;
+    inverseMatrix.props[12] = e;
+    inverseMatrix.props[13] = f;
+    return inverseMatrix;
+  }
 
-    function inversePoint(pt) {
-        var inverseMatrix = this.getInverseMatrix();
-        return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
-    }
+  function inversePoint(pt) {
+    var inverseMatrix = this.getInverseMatrix();
+    return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
+  }
 
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
+  function inversePoints(pts) {
+    var i;
+    var len = pts.length;
+    var retPts = [];
+    for (i = 0; i < len; i += 1) {
+      retPts[i] = inversePoint(pts[i]);
     }
+    return retPts;
+  }
 
-    function applyToTriplePoints(pt1, pt2, pt3) {
-        var arr = createTypedArray('float32', 6);
-        if(this.isIdentity()) {
-            arr[0] = pt1[0];
-            arr[1] = pt1[1];
-            arr[2] = pt2[0];
-            arr[3] = pt2[1];
-            arr[4] = pt3[0];
-            arr[5] = pt3[1];
-        } else {
-            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
-            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
-            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
-            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
-            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
-            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
-            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
-        }
-        return arr;
+  function applyToTriplePoints(pt1, pt2, pt3) {
+    var arr = createTypedArray('float32', 6);
+    if (this.isIdentity()) {
+      arr[0] = pt1[0];
+      arr[1] = pt1[1];
+      arr[2] = pt2[0];
+      arr[3] = pt2[1];
+      arr[4] = pt3[0];
+      arr[5] = pt3[1];
+    } else {
+      var p0 = this.props[0];
+      var p1 = this.props[1];
+      var p4 = this.props[4];
+      var p5 = this.props[5];
+      var p12 = this.props[12];
+      var p13 = this.props[13];
+      arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+      arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+      arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+      arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+      arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+      arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
     }
+    return arr;
+  }
 
-    function applyToPointArray(x,y,z){
-        var arr;
-        if(this.isIdentity()) {
-            arr = [x,y,z];
-        } else {
-            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]
-            ];
-        }
-        return arr;
+  function applyToPointArray(x, y, z) {
+    var arr;
+    if (this.isIdentity()) {
+      arr = [x, y, z];
+    } else {
+      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],
+      ];
     }
+    return arr;
+  }
 
-    function applyToPointStringified(x, y) {
-        if(this.isIdentity()) {
-            return x + ',' + y;
-        }
-        var _p = this.props;
-        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;
+  function applyToPointStringified(x, y) {
+    if (this.isIdentity()) {
+      return x + ',' + y;
     }
+    var _p = this.props;
+    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;
+  }
 
-    function toCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function toCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var i = 0;
-        var props = this.props;
-        var cssValue = 'matrix3d(';
-        var v = 10000;
-        while(i<16){
-            cssValue += _rnd(props[i]*v)/v;
-            cssValue += i === 15 ? ')':',';
-            i += 1;
-        }
-        return cssValue;
+        } */
+    var i = 0;
+    var props = this.props;
+    var cssValue = 'matrix3d(';
+    var v = 10000;
+    while (i < 16) {
+      cssValue += _rnd(props[i] * v) / v;
+      cssValue += i === 15 ? ')' : ',';
+      i += 1;
     }
+    return cssValue;
+  }
 
-    function roundMatrixProperty(val) {
-        var v = 10000;
-        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
-            return _rnd(val * v) / v;
-        }
-        return val;
+  function roundMatrixProperty(val) {
+    var v = 10000;
+    if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+      return _rnd(val * v) / v;
     }
+    return val;
+  }
 
-    function to2dCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function to2dCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var props = this.props;
-        var _a = roundMatrixProperty(props[0]);
-        var _b = roundMatrixProperty(props[1]);
-        var _c = roundMatrixProperty(props[4]);
-        var _d = roundMatrixProperty(props[5]);
-        var _e = roundMatrixProperty(props[12]);
-        var _f = roundMatrixProperty(props[13]);
-        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
-    }
+        } */
+    var props = this.props;
+    var _a = roundMatrixProperty(props[0]);
+    var _b = roundMatrixProperty(props[1]);
+    var _c = roundMatrixProperty(props[4]);
+    var _d = roundMatrixProperty(props[5]);
+    var _e = roundMatrixProperty(props[12]);
+    var _f = roundMatrixProperty(props[13]);
+    return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
+  }
 
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToTriplePoints = applyToTriplePoints;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.equals = equals;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this.getInverseMatrix = getInverseMatrix;
-        this._t = this.transform;
-        this.isIdentity = isIdentity;
-        this._identity = true;
-        this._identityCalculated = false;
+  return function () {
+    this.reset = reset;
+    this.rotate = rotate;
+    this.rotateX = rotateX;
+    this.rotateY = rotateY;
+    this.rotateZ = rotateZ;
+    this.skew = skew;
+    this.skewFromAxis = skewFromAxis;
+    this.shear = shear;
+    this.scale = scale;
+    this.setTransform = setTransform;
+    this.translate = translate;
+    this.transform = transform;
+    this.applyToPoint = applyToPoint;
+    this.applyToX = applyToX;
+    this.applyToY = applyToY;
+    this.applyToZ = applyToZ;
+    this.applyToPointArray = applyToPointArray;
+    this.applyToTriplePoints = applyToTriplePoints;
+    this.applyToPointStringified = applyToPointStringified;
+    this.toCSS = toCSS;
+    this.to2dCSS = to2dCSS;
+    this.clone = clone;
+    this.cloneFromProps = cloneFromProps;
+    this.equals = equals;
+    this.inversePoints = inversePoints;
+    this.inversePoint = inversePoint;
+    this.getInverseMatrix = getInverseMatrix;
+    this._t = this.transform;
+    this.isIdentity = isIdentity;
+    this._identity = true;
+    this._identityCalculated = false;
 
-        this.props = createTypedArray('float32', 16);
-        this.reset();
-    };
+    this.props = createTypedArray('float32', 16);
+    this.reset();
+  };
 }());
 
+/* eslint-disable */
 /*
  Copyright 2014 David Bau.
 
@@ -1018,8 +1066,9 @@
     [],     // pool: entropy pool starts empty
     BMMath    // math: package containing random, pow, and seedrandom
 );
-var BezierFactory = (function(){
-    /**
+/* eslint-disable */
+var BezierFactory = (function () {
+  /**
      * BezierEasing - use bezier curve for transition easing function
      * by Gaëtan Renaudeau 2014 - 2015 – MIT License
      *
@@ -1030,7087 +1079,7522 @@
      *
      */
 
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
+  var ob = {};
+  ob.getBezierEasing = getBezierEasing;
+  var beziers = {};
 
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
+  function getBezierEasing(a, b, c, d, nm) {
+    var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
+    if (beziers[str]) {
+      return beziers[str];
     }
+    var bezEasing = new BezierEasing([a, b, c, d]);
+    beziers[str] = bezEasing;
+    return bezEasing;
+  }
 
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
+  // These values are established by empiricism with tests (tradeoff: performance VS precision)
+  var NEWTON_ITERATIONS = 4;
+  var NEWTON_MIN_SLOPE = 0.001;
+  var SUBDIVISION_PRECISION = 0.0000001;
+  var SUBDIVISION_MAX_ITERATIONS = 10;
 
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+  var kSplineTableSize = 11;
+  var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
 
-    var float32ArraySupported = typeof Float32Array === "function";
+  var float32ArraySupported = typeof Float32Array === 'function';
 
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
+  function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+  function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+  function C(aA1) { return 3.0 * aA1; }
 
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
+  // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+  function calcBezier(aT, aA1, aA2) {
+    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
+  }
+
+  // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+  function getSlope(aT, aA1, aA2) {
+    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
+  }
+
+  function binarySubdivide(aX, aA, aB, mX1, mX2) {
+    var currentX,
+      currentT,
+      i = 0;
+    do {
+      currentT = aA + (aB - aA) / 2.0;
+      currentX = calcBezier(currentT, mX1, mX2) - aX;
+      if (currentX > 0.0) {
+        aB = currentT;
+      } else {
+        aA = currentT;
+      }
+    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+    return currentT;
+  }
+
+  function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
+    for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+      var currentSlope = getSlope(aGuessT, mX1, mX2);
+      if (currentSlope === 0.0) return aGuessT;
+      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+      aGuessT -= currentX / currentSlope;
     }
+    return aGuessT;
+  }
 
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
+  /**
      * points is an array of [ mX1, mY1, mX2, mY2 ]
      */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
+  function BezierEasing(points) {
+    this._p = points;
+    this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+    this._precomputed = false;
 
-        this.get = this.get.bind(this);
-    }
+    this.get = this.get.bind(this);
+  }
 
-    BezierEasing.prototype = {
+  BezierEasing.prototype = {
 
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
+    get: function (x) {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      if (!this._precomputed) this._precompute();
+      if (mX1 === mY1 && mX2 === mY2) return x; // linear
+      // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+      if (x === 0) return 0;
+      if (x === 1) return 1;
+      return calcBezier(this._getTForX(x), mY1, mY2);
+    },
 
-        // Private part
+    // Private part
 
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
+    _precompute: function () {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      this._precomputed = true;
+      if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); }
+    },
 
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
+    _calcSampleValues: function () {
+      var mX1 = this._p[0],
+        mX2 = this._p[2];
+      for (var i = 0; i < kSplineTableSize; ++i) {
+        this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+      }
+    },
 
-        /**
+    /**
          * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
          */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
+    _getTForX: function (aX) {
+      var mX1 = this._p[0],
+        mX2 = this._p[2],
+        mSampleValues = this._mSampleValues;
 
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
+      var intervalStart = 0.0;
+      var currentSample = 1;
+      var lastSample = kSplineTableSize - 1;
 
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
+      for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
+        intervalStart += kSampleStepSize;
+      }
+      --currentSample;
 
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
+      // Interpolate to provide an initial guess for t
+      var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
+      var guessForT = intervalStart + dist * kSampleStepSize;
 
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
+      var initialSlope = getSlope(guessForT, mX1, mX2);
+      if (initialSlope >= NEWTON_MIN_SLOPE) {
+        return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+      } if (initialSlope === 0.0) {
+        return guessForT;
+      }
+      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+    },
+  };
 
-    return ob;
-
+  return ob;
 }());
+
 (function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
+  var lastTime = 0;
+  var vendors = ['ms', 'moz', 'webkit', 'o'];
+  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { // eslint-disable-line no-plusplus
+    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
+    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
+  }
+  if (!window.requestAnimationFrame) {
+    window.requestAnimationFrame = function (callback) {
+      var currTime = new Date().getTime();
+      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+      var id = setTimeout(function () {
+        callback(currTime + timeToCall);
+      },
+      timeToCall);
+      lastTime = currTime + timeToCall;
+      return id;
+    };
+  }
+  if (!window.cancelAnimationFrame) {
+    window.cancelAnimationFrame = function (id) {
+      clearTimeout(id);
+    };
+  }
 }());
 
-function extendPrototype(sources,destination){
-    var i, len = sources.length, sourcePrototype;
-    for (i = 0;i < len;i += 1) {
-        sourcePrototype = sources[i].prototype;
-        for (var attr in sourcePrototype) {
-            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
-        }
+/* exported extendPrototype, getDescriptor, createProxyFunction */
+
+function extendPrototype(sources, destination) {
+  var i;
+  var len = sources.length;
+  var sourcePrototype;
+  for (i = 0; i < len; i += 1) {
+    sourcePrototype = sources[i].prototype;
+    for (var attr in sourcePrototype) {
+      if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
     }
+  }
 }
 
 function getDescriptor(object, prop) {
-    return Object.getOwnPropertyDescriptor(object, prop);
+  return Object.getOwnPropertyDescriptor(object, prop);
 }
 
 function createProxyFunction(prototype) {
-	function ProxyFunction(){}
-	ProxyFunction.prototype = prototype;
-	return ProxyFunction;
+  function ProxyFunction() {}
+  ProxyFunction.prototype = prototype;
+  return ProxyFunction;
 }
-function bezFunction(){
 
-    var easingFunctions = [];
-    var math = Math;
+/* global segmentsLengthPool, defaultCurveSegments, createSizedArray, bmPow, bmSqrt, bmFloor, createTypedArray, bezierLengthPool */
+/* exported bez */
 
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.001 && det1 < 0.001;
+function bezFunction() {
+  var math = Math;
+
+  function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
+    var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1);
+    return det1 > -0.001 && det1 < 0.001;
+  }
+
+  function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
+    if (z1 === 0 && z2 === 0 && z3 === 0) {
+      return pointOnLine2D(x1, y1, x2, y2, x3, y3);
     }
+    var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
+    var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
+    var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
+    var diffDist;
+    if (dist1 > dist2) {
+      if (dist1 > dist3) {
+        diffDist = dist1 - dist2 - dist3;
+      } else {
+        diffDist = dist3 - dist2 - dist1;
+      }
+    } else if (dist3 > dist2) {
+      diffDist = dist3 - dist2 - dist1;
+    } else {
+      diffDist = dist2 - dist1 - dist3;
+    }
+    return diffDist > -0.0001 && diffDist < 0.0001;
+  }
 
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        if(z1 === 0 && z2 === 0 && z3 === 0) {
-            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+  var getBezierLength = (function () {
+    return function (pt1, pt2, pt3, pt4) {
+      var curveSegments = defaultCurveSegments;
+      var k;
+      var i;
+      var len;
+      var ptCoord;
+      var perc;
+      var addedLength = 0;
+      var ptDistance;
+      var point = [];
+      var lastPoint = [];
+      var lengthData = bezierLengthPool.newElement();
+      len = pt3.length;
+      for (k = 0; k < curveSegments; k += 1) {
+        perc = k / (curveSegments - 1);
+        ptDistance = 0;
+        for (i = 0; i < len; i += 1) {
+          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];
+          point[i] = ptCoord;
+          if (lastPoint[i] !== null) {
+            ptDistance += bmPow(point[i] - lastPoint[i], 2);
+          }
+          lastPoint[i] = point[i];
         }
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
+        if (ptDistance) {
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
         }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    var getBezierLength = (function(){
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = bezier_length_pool.newElement();
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.percents[k] = perc;
-                lengthData.lengths[k] = addedLength;
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function getSegmentsLength(shapeData) {
-        var segmentsLength = segments_length_pool.newElement();
-        var closed = shapeData.c;
-        var pathV = shapeData.v;
-        var pathO = shapeData.o;
-        var pathI = shapeData.i;
-        var i, len = shapeData._length;
-        var lengths = segmentsLength.lengths;
-        var totalLength = 0;
-        for(i=0;i<len-1;i+=1){
-            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-            totalLength += lengths[i].addedLength;
-        }
-        if(closed && len){
-            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-            totalLength += lengths[i].addedLength;
-        }
-        segmentsLength.totalLength = totalLength;
-        return segmentsLength;
-    }
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (pt1, pt2, pt3, pt4){
-            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
-            if(!storedData[bezierName]){
-                var curveSegments = defaultCurveSegments;
-                var k, i, len;
-                var ptCoord,perc,addedLength = 0;
-                var ptDistance;
-                var point,lastPoint = null;
-                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])){
-                    curveSegments = 2;
-                }
-                var bezierData = new BezierData(curveSegments);
-                len = pt3.length;
-                for (k = 0; k < curveSegments; k += 1) {
-                    point = createSizedArray(len);
-                    perc = k / (curveSegments - 1);
-                    ptDistance = 0;
-                    for (i = 0; i < len; i += 1){
-                        ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                        point[i] = ptCoord;
-                        if(lastPoint !== null){
-                            ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                        }
-                    }
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                    bezierData.points[k] = new PointData(ptDistance, point);
-                    lastPoint = point;
-                }
-                bezierData.segmentLength = addedLength;
-                storedData[bezierName] = bezierData;
-            }
-            return storedData[bezierName];
-        };
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var percents = bezierData.percents;
-        var lengths = bezierData.lengths;
-        var len = percents.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
-            return percents[initPos];
-        }else{
-            var dir = lengths[initPos] > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
-                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    //FIX for TypedArrays that don't store floating point values with enough accuracy
-                    if(initPos === len - 1) {
-                        return percents[initPos];
-                    }
-                    flag = false;
-                }
-            }
-            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
-        }
-    }
-
-    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
-        var t1 = getDistancePerc(percent,bezierData);
-        var u0 = 1;
-        var u1 = 1 - t1;
-        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;
-        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;
-        return [ptX, ptY];
-    }
-
-    function getSegmentArray() {
-
-    }
-
-    var bezier_segment_points = createTypedArray('float32', 8);
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        var u0u0u0 = u0*u0*u0;
-        var t0u0u0_3 = t0*u0*u0*3;
-        var t0t0u0_3 = t0*t0*u0*3;
-        var t0t0t0 = t0*t0*t0;
-        //
-        var u0u0u1 = u0*u0*u1;
-        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
-        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
-        var t0t0t1 = t0*t0*t1;
-        //
-        var u0u1u1 = u0*u1*u1;
-        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
-        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
-        var t0t1t1 = t0*t1*t1;
-        //
-        var u1u1u1 = u1*u1*u1;
-        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
-        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
-        var t1t1t1 = t1*t1*t1;
-        for(i=0;i<len;i+=1){
-            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
-        }
-
-        return bezier_segment_points;
-    }
-
-    return {
-        getSegmentsLength : getSegmentsLength,
-        getNewSegment : getNewSegment,
-        getPointInSegment : getPointInSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
+        lengthData.percents[k] = perc;
+        lengthData.lengths[k] = addedLength;
+      }
+      lengthData.addedLength = addedLength;
+      return lengthData;
     };
+  }());
+
+  function getSegmentsLength(shapeData) {
+    var segmentsLength = segmentsLengthPool.newElement();
+    var closed = shapeData.c;
+    var pathV = shapeData.v;
+    var pathO = shapeData.o;
+    var pathI = shapeData.i;
+    var i;
+    var len = shapeData._length;
+    var lengths = segmentsLength.lengths;
+    var totalLength = 0;
+    for (i = 0; i < len - 1; i += 1) {
+      lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
+      totalLength += lengths[i].addedLength;
+    }
+    if (closed && len) {
+      lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
+      totalLength += lengths[i].addedLength;
+    }
+    segmentsLength.totalLength = totalLength;
+    return segmentsLength;
+  }
+
+  function BezierData(length) {
+    this.segmentLength = 0;
+    this.points = new Array(length);
+  }
+
+  function PointData(partial, point) {
+    this.partialLength = partial;
+    this.point = point;
+  }
+
+  var buildBezierData = (function () {
+    var storedData = {};
+
+    return function (pt1, pt2, pt3, pt4) {
+      var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
+      if (!storedData[bezierName]) {
+        var curveSegments = defaultCurveSegments;
+        var k;
+        var i;
+        var len;
+        var ptCoord;
+        var perc;
+        var addedLength = 0;
+        var ptDistance;
+        var point;
+        var lastPoint = null;
+        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])) {
+          curveSegments = 2;
+        }
+        var bezierData = new BezierData(curveSegments);
+        len = pt3.length;
+        for (k = 0; k < curveSegments; k += 1) {
+          point = createSizedArray(len);
+          perc = k / (curveSegments - 1);
+          ptDistance = 0;
+          for (i = 0; i < len; i += 1) {
+            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];
+            point[i] = ptCoord;
+            if (lastPoint !== null) {
+              ptDistance += bmPow(point[i] - lastPoint[i], 2);
+            }
+          }
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
+          bezierData.points[k] = new PointData(ptDistance, point);
+          lastPoint = point;
+        }
+        bezierData.segmentLength = addedLength;
+        storedData[bezierName] = bezierData;
+      }
+      return storedData[bezierName];
+    };
+  }());
+
+  function getDistancePerc(perc, bezierData) {
+    var percents = bezierData.percents;
+    var lengths = bezierData.lengths;
+    var len = percents.length;
+    var initPos = bmFloor((len - 1) * perc);
+    var lengthPos = perc * bezierData.addedLength;
+    var lPerc = 0;
+    if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
+      return percents[initPos];
+    }
+    var dir = lengths[initPos] > lengthPos ? -1 : 1;
+    var flag = true;
+    while (flag) {
+      if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
+        lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
+        flag = false;
+      } else {
+        initPos += dir;
+      }
+      if (initPos < 0 || initPos >= len - 1) {
+        // FIX for TypedArrays that don't store floating point values with enough accuracy
+        if (initPos === len - 1) {
+          return percents[initPos];
+        }
+        flag = false;
+      }
+    }
+    return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
+  }
+
+  function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+    var t1 = getDistancePerc(percent, bezierData);
+    var u1 = 1 - t1;
+    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;
+    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;
+    return [ptX, ptY];
+  }
+
+  var bezierSegmentPoints = createTypedArray('float32', 8);
+
+  function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
+    if (startPerc < 0) {
+      startPerc = 0;
+    } else if (startPerc > 1) {
+      startPerc = 1;
+    }
+    var t0 = getDistancePerc(startPerc, bezierData);
+    endPerc = endPerc > 1 ? 1 : endPerc;
+    var t1 = getDistancePerc(endPerc, bezierData);
+    var i;
+    var len = pt1.length;
+    var u0 = 1 - t0;
+    var u1 = 1 - t1;
+    var u0u0u0 = u0 * u0 * u0;
+    var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0t0 = t0 * t0 * t0;
+    //
+    var u0u0u1 = u0 * u0 * u1;
+    var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0t1 = t0 * t0 * t1;
+    //
+    var u0u1u1 = u0 * u1 * u1;
+    var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1t1 = t0 * t1 * t1;
+    //
+    var u1u1u1 = u1 * u1 * u1;
+    var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1t1 = t1 * t1 * t1;
+    for (i = 0; i < len; i += 1) {
+      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
+      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
+      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
+      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
+    }
+
+    return bezierSegmentPoints;
+  }
+
+  return {
+    getSegmentsLength: getSegmentsLength,
+    getNewSegment: getNewSegment,
+    getPointInSegment: getPointInSegment,
+    buildBezierData: buildBezierData,
+    pointOnLine2D: pointOnLine2D,
+    pointOnLine3D: pointOnLine3D,
+  };
 }
 
 var bez = bezFunction();
-function dataFunctionManager(){
 
-    //var tCanvasHelper = createTag('canvas').getContext('2d');
+/* exported dataManager */
 
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
+function dataFunctionManager() {
+  // var tCanvasHelper = createTag('canvas').getContext('2d');
+
+  function completeLayers(layers, comps, fontManager) {
+    var layerData;
+    var i;
+    var len = layers.length;
+    var j;
+    var jLen;
+    var k;
+    var kLen;
+    for (i = 0; i < len; i += 1) {
+      layerData = layers[i];
+      if (('ks' in layerData) && !layerData.completed) {
+        layerData.completed = true;
+        if (layerData.tt) {
+          layers[i - 1].td = layerData.tt;
         }
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              convertPathsToAbsoluteValues(maskProps[j].pt.k);
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
+                }
+              }
+            }
+          }
+        }
+        if (layerData.ty === 0) {
+          layerData.layers = findCompLayers(layerData.refId, comps);
+          completeLayers(layerData.layers, comps, fontManager);
+        } else if (layerData.ty === 4) {
+          completeShapes(layerData.shapes);
+        } else if (layerData.ty === 5) {
+          completeText(layerData, fontManager);
+        }
+      }
+    }
+  }
+
+  function findCompLayers(id, comps) {
+    var i = 0;
+    var len = comps.length;
+    while (i < len) {
+      if (comps[i].id === id) {
+        if (!comps[i].layers.__used) {
+          comps[i].layers.__used = true;
+          return comps[i].layers;
+        }
+        return JSON.parse(JSON.stringify(comps[i].layers));
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function completeShapes(arr) {
+    var i;
+    var len = arr.length;
+    var j;
+    var jLen;
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (arr[i].ty === 'sh') {
+        if (arr[i].ks.k.i) {
+          convertPathsToAbsoluteValues(arr[i].ks.k);
+        } else {
+          jLen = arr[i].ks.k.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (arr[i].ks.k[j].s) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
+            }
+            if (arr[i].ks.k[j].e) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
+            }
+          }
+        }
+      } else if (arr[i].ty === 'gr') {
+        completeShapes(arr[i].it);
+      }
+    }
+  }
+
+  function convertPathsToAbsoluteValues(path) {
+    var i;
+    var len = path.i.length;
+    for (i = 0; i < len; i += 1) {
+      path.i[i][0] += path.v[i][0];
+      path.i[i][1] += path.v[i][1];
+      path.o[i][0] += path.v[i][0];
+      path.o[i][1] += path.v[i][1];
+    }
+  }
+
+  function checkVersion(minimum, animVersionString) {
+    var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
+    if (minimum[0] > animVersion[0]) {
+      return true;
+    } if (animVersion[0] > minimum[0]) {
+      return false;
+    }
+    if (minimum[1] > animVersion[1]) {
+      return true;
+    } if (animVersion[1] > minimum[1]) {
+      return false;
+    }
+    if (minimum[2] > animVersion[2]) {
+      return true;
+    } if (animVersion[2] > minimum[2]) {
+      return false;
+    }
+    return null;
+  }
+
+  var checkText = (function () {
+    var minimumVersion = [4, 4, 14];
+
+    function updateTextLayer(textLayer) {
+      var documentData = textLayer.t.d;
+      textLayer.t.d = {
+        k: [
+          {
+            s: documentData,
+            t: 0,
+          },
+        ],
+      };
     }
 
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                if(!comps[i].layers.__used) {
-                    comps[i].layers.__used = true;
-                    return comps[i].layers;
-                }
-                return JSON.parse(JSON.stringify(comps[i].layers));
-            }
-            i += 1;
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 5) {
+          updateTextLayer(layers[i]);
         }
+      }
     }
 
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
             }
+          }
         }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
+      }
+    };
+  }());
+
+  var checkChars = (function () {
+    var minimumVersion = [4, 7, 99];
+    return function (animationData) {
+      if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
+        var i;
+        var len = animationData.chars.length;
+        var j;
+        var jLen;
+        var pathData;
+        var paths;
+        for (i = 0; i < len; i += 1) {
+          if (animationData.chars[i].data && animationData.chars[i].data.shapes) {
+            paths = animationData.chars[i].data.shapes[0].it;
+            jLen = paths.length;
+
+            for (j = 0; j < jLen; j += 1) {
+              pathData = paths[j].ks.k;
+              if (!pathData.__converted) {
+                convertPathsToAbsoluteValues(paths[j].ks.k);
+                pathData.__converted = true;
+              }
+            }
+          }
+        }
+      }
+    };
+  }());
+
+  var checkColors = (function () {
+    var minimumVersion = [4, 1, 9];
+
+    function iterateShapes(shapes) {
+      var i;
+      var len = shapes.length;
+      var j;
+      var jLen;
+      for (i = 0; i < len; i += 1) {
+        if (shapes[i].ty === 'gr') {
+          iterateShapes(shapes[i].it);
+        } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
+          if (shapes[i].c.k && shapes[i].c.k[0].i) {
+            jLen = shapes[i].c.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (shapes[i].c.k[j].s) {
+                shapes[i].c.k[j].s[0] /= 255;
+                shapes[i].c.k[j].s[1] /= 255;
+                shapes[i].c.k[j].s[2] /= 255;
+                shapes[i].c.k[j].s[3] /= 255;
+              }
+              if (shapes[i].c.k[j].e) {
+                shapes[i].c.k[j].e[0] /= 255;
+                shapes[i].c.k[j].e[1] /= 255;
+                shapes[i].c.k[j].e[2] /= 255;
+                shapes[i].c.k[j].e[3] /= 255;
+              }
+            }
+          } else {
+            shapes[i].c.k[0] /= 255;
+            shapes[i].c.k[1] /= 255;
+            shapes[i].c.k[2] /= 255;
+            shapes[i].c.k[3] /= 255;
+          }
+        }
+      }
     }
 
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 4) {
+          iterateShapes(layers[i].shapes);
         }
+      }
     }
 
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
+      }
+    };
+  }());
+
+  var checkShapes = (function () {
+    var minimumVersion = [4, 4, 18];
+
+    function completeClosingShapes(arr) {
+      var i;
+      var len = arr.length;
+      var j;
+      var jLen;
+      for (i = len - 1; i >= 0; i -= 1) {
+        if (arr[i].ty === 'sh') {
+          if (arr[i].ks.k.i) {
+            arr[i].ks.k.c = arr[i].closed;
+          } else {
+            jLen = arr[i].ks.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (arr[i].ks.k[j].s) {
+                arr[i].ks.k[j].s[0].c = arr[i].closed;
+              }
+              if (arr[i].ks.k[j].e) {
+                arr[i].ks.k[j].e[0].c = arr[i].closed;
+              }
+            }
+          }
+        } else if (arr[i].ty === 'gr') {
+          completeClosingShapes(arr[i].it);
         }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
+      }
     }
 
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            };
+    function iterateLayers(layers) {
+      var layerData;
+      var i;
+      var len = layers.length;
+      var j;
+      var jLen;
+      var k;
+      var kLen;
+      for (i = 0; i < len; i += 1) {
+        layerData = layers[i];
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              maskProps[j].pt.k.c = maskProps[j].cl;
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
+                }
+              }
+            }
+          }
         }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
+        if (layerData.ty === 4) {
+          completeClosingShapes(layerData.shapes);
         }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkChars = (function() {
-        var minimumVersion = [4,7,99];
-        return function (animationData){
-            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
-                var i, len = animationData.chars.length, j, jLen, k, kLen;
-                var pathData, paths;
-                for(i = 0; i < len; i += 1) {
-                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
-                        paths = animationData.chars[i].data.shapes[0].it;
-                        jLen = paths.length;
-
-                        for(j = 0; j < jLen; j += 1) {
-                            pathData = paths[j].ks.k;
-                            if(!pathData.__converted) {
-                                convertPathsToAbsoluteValues(paths[j].ks.k);
-                                pathData.__converted = true;
-                            }
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkChars(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
+      }
     }
 
-    function completeText(data, fontManager){
-        if(data.t.a.length === 0 && !('m' in data.t.p)){
-            data.singleShape = true;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
+      }
+    };
+  }());
+
+  function completeData(animationData, fontManager) {
+    if (animationData.__complete) {
+      return;
     }
+    checkColors(animationData);
+    checkText(animationData);
+    checkChars(animationData);
+    checkShapes(animationData);
+    completeLayers(animationData.layers, animationData.assets, fontManager);
+    animationData.__complete = true;
+  }
 
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-    moduleOb.checkColors = checkColors;
-    moduleOb.checkChars = checkChars;
-    moduleOb.checkShapes = checkShapes;
-    moduleOb.completeLayers = completeLayers;
+  function completeText(data) {
+    if (data.t.a.length === 0 && !('m' in data.t.p)) {
+      data.singleShape = true;
+    }
+  }
 
-    return moduleOb;
+  var moduleOb = {};
+  moduleOb.completeData = completeData;
+  moduleOb.checkColors = checkColors;
+  moduleOb.checkChars = checkChars;
+  moduleOb.checkShapes = checkShapes;
+  moduleOb.completeLayers = completeLayers;
+
+  return moduleOb;
 }
 
 var dataManager = dataFunctionManager();
 
-var FontManager = (function(){
+/* exported getFontProperties */
 
-    var maxWaitingTime = 5000;
-    var emptyChar = {
-        w: 0,
-        size:0,
-        shapes:[]
-    };
-    var combinedCharacters = [];
-    //Hindi characters
-    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]);
+function getFontProperties(fontData) {
+  var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
 
-    function trimFontOptions(font) {
-        var familyArray = font.split(',');
-        var i, len = familyArray.length;
-        var enabledFamilies = [];
-        for (i = 0; i < len; i += 1) {
-            if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
-                enabledFamilies.push(familyArray[i]);
-            }
-        }
-        return enabledFamilies.join(',');
+  var fWeight = 'normal'; var
+    fStyle = 'normal';
+  var len = styles.length;
+  var styleName;
+  for (var i = 0; i < len; i += 1) {
+    styleName = styles[i].toLowerCase();
+    switch (styleName) {
+      case 'italic':
+        fStyle = 'italic';
+        break;
+      case 'bold':
+        fWeight = '700';
+        break;
+      case 'black':
+        fWeight = '900';
+        break;
+      case 'medium':
+        fWeight = '500';
+        break;
+      case 'regular':
+      case 'normal':
+        fWeight = '400';
+        break;
+      case 'light':
+      case 'thin':
+        fWeight = '200';
+        break;
+      default:
+        break;
     }
+  }
 
-    function setUpNode(font, family){
-        var parentNode = createTag('span');
-        parentNode.style.fontFamily    = family;
-        var node = createTag('span');
-        // Characters that vary significantly among different fonts
-        node.innerText = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = trimFontOptions(font) + ', ' + family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(this.checkLoadedFontsBinded, 20);
-        }else{
-            setTimeout(this.setIsLoadedBinded, 10);
-
-        }
-    }
-
-    function createHelper(def, fontData){
-        var tHelper = createNS('text');
-        tHelper.style.fontSize = '100px';
-        //tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.setAttribute('font-family', fontData.fFamily);
-        tHelper.setAttribute('font-style', fontData.fStyle);
-        tHelper.setAttribute('font-weight', fontData.fWeight);
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.setAttribute('class', fontData.fClass);
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = createTag('canvas').getContext('2d');
-        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
-        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.isLoaded = true;
-            return;
-        }
-        if(this.chars){
-            this.isLoaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        var _pendingFonts = len;
-        for(i=0; i<len; i+= 1){
-            var shouldLoadFont = true;
-            var loadedSelector;
-            var j;
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-                _pendingFonts -= 1;
-            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
-                loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
-
-                if (loadedSelector.length > 0) {
-                    shouldLoadFont = false;
-                }
-
-                if (shouldLoadFont) {
-                    var s = createTag('style');
-                    s.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    s.setAttribute('f-origin', fontArr[i].origin);
-                    s.setAttribute('f-family', fontArr[i].fFamily);
-                    s.type = "text/css";
-                    s.innerText = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                    defs.appendChild(s);
-                }
-            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
-                loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var l = createTag('link');
-                    l.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    l.setAttribute('f-origin', fontArr[i].origin);
-                    l.type = "text/css";
-                    l.rel = "stylesheet";
-                    l.href = fontArr[i].fPath;
-                    document.body.appendChild(l);
-                }
-            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
-                loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (fontArr[i].fPath === loadedSelector[j].src) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var sc = createTag('link');
-                    sc.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    sc.setAttribute('f-origin', fontArr[i].origin);
-                    sc.setAttribute('rel','stylesheet');
-                    sc.setAttribute('href',fontArr[i].fPath);
-                    defs.appendChild(sc);
-                }
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            fontArr[i].cache = {};
-            this.fonts.push(fontArr[i]);
-        }
-        if (_pendingFonts === 0) {
-            this.isLoaded = true;
-        } else {
-            //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
-            //Adding this timeout seems to fix it
-           setTimeout(this.checkLoadedFonts.bind(this), 100);
-        }
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-        if ((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char)
-            && console
-            && console.warn
-            && !this._warned
-           ) {
-            this._warned = true
-            console.warn('Missing character from exported characters list: ', char, style, font);
-        }
-        return emptyChar;
-    }
-
-    function measureText(char, fontName, size) {
-        var fontData = this.getFontByName(fontName);
-        var index = char.charCodeAt(0);
-        if(!fontData.cache[index + 1]) {
-            var tHelper = fontData.helper;
-            //Canvas version
-            //fontData.cache[index] = tHelper.measureText(char).width / 100;
-            //SVG version
-            //console.log(tHelper.getBBox().width)
-            if (char === ' ') {
-                tHelper.textContent = '|' + char + '|';
-                var doubleSize = tHelper.getComputedTextLength();
-                tHelper.textContent = '||';
-                var singleSize = tHelper.getComputedTextLength();
-                fontData.cache[index + 1] = (doubleSize - singleSize)/100;
-            } else {
-                tHelper.textContent = char;
-                fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
-            }
-        }
-        return fontData.cache[index + 1] * size;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return this.fonts[0];
-    }
-
-    function getCombinedCharacterCodes() {
-        return combinedCharacters;
-    }
-
-    function setIsLoaded() {
-        this.isLoaded = true
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this._warned = false;
-        this.initTime = Date.now();
-        this.setIsLoadedBinded = this.setIsLoaded.bind(this)
-        this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)
-    };
-    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
-    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
-
-    var fontPrototype = {
-        addChars: addChars,
-        addFonts: addFonts,
-        getCharData: getCharData,
-        getFontByName: getFontByName,
-        measureText: measureText,
-        checkLoadedFonts: checkLoadedFonts,
-        setIsLoaded: setIsLoaded,
-    }
-
-    Font.prototype = fontPrototype;
-
-    return Font;
-
-}());
-
-var PropertyFactory = (function(){
-
-    var initFrame = initialDefaultFrame;
-    var math_abs = Math.abs;
-
-    function interpolateValue(frameNum, caching) {
-        var offsetTime = this.offsetTime;
-        var newValue;
-        if (this.propType === 'multidimensional') {
-            newValue = createTypedArray('float32', this.pv.length);
-        }
-        var iterationIndex = caching.lastIndex;
-        var i = iterationIndex;
-        var len = this.keyframes.length - 1, flag = true;
-        var keyData, nextKeyData;
-
-        while (flag) {
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i + 1];
-            if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                iterationIndex = 0;
-                break;
-            }
-            if ((nextKeyData.t - offsetTime) > frameNum){
-                iterationIndex = i;
-                break;
-            }
-            if (i < len - 1){
-                i += 1;
-            } else {
-                iterationIndex = 0;
-                flag = false;
-            }
-        }
-
-        var k, kLen, perc, jLen, j, fnc;
-        var nextKeyTime = nextKeyData.t - offsetTime;
-        var keyTime = keyData.t - offsetTime;
-        var endValue;
-        if (keyData.to) {
-            if (!keyData.bezierData) {
-                keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyTime || frameNum < keyTime) {
-                var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for (k = 0; k < kLen; k += 1) {
-                    newValue[k] = bezierData.points[ind].point[k];
-                }
-                // caching._lastKeyframeIndex = -1;
-            } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
-                } else {
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
-                }
-                perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
-                var distanceInLine = bezierData.segmentLength*perc;
-
-                var segmentPerc;
-                var addedLength =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
-                j =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
-                flag = true;
-                jLen = bezierData.points.length;
-                while (flag) {
-                    addedLength += bezierData.points[j].partialLength;
-                    if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
-                        segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1){
-                        j += 1;
-                    } else {
-                        flag = false;
-                    }
-                }
-                caching._lastPoint = j;
-                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                caching._lastKeyframeIndex = i;
-            }
-        } else {
-            var outX, outY, inX, inY, keyValue;
-            len = keyData.s.length;
-            endValue = nextKeyData.s || keyData.e;
-            if (this.sh && keyData.h !== 1) {
-                if (frameNum >= nextKeyTime) {
-                    newValue[0] = endValue[0];
-                    newValue[1] = endValue[1];
-                    newValue[2] = endValue[2];
-                } else if (frameNum <= keyTime) {
-                    newValue[0] = keyData.s[0];
-                    newValue[1] = keyData.s[1];
-                    newValue[2] = keyData.s[2];
-                } else {
-                    var quatStart = createQuaternion(keyData.s);
-                    var quatEnd = createQuaternion(endValue);
-                    var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
-                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
-                }
-                
-            } else {
-                for(i = 0; i < len; i += 1) {
-                    if (keyData.h !== 1) {
-                        if (frameNum >= nextKeyTime) {
-                            perc = 1;
-                        } else if(frameNum < keyTime) {
-                            perc = 0;
-                        } else {
-                            if(keyData.o.x.constructor === Array) {
-                                if (!keyData.__fnct) {
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
-                                    outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
-                                    inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
-                                    inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct = fnc;
-                                } else {
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
-                        }
-                    }
-
-                    endValue = nextKeyData.s || keyData.e;
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
-
-                    if (this.propType === 'multidimensional') {
-                        newValue[i] = keyValue;
-                    } else {
-                        newValue = keyValue;
-                    }
-                }
-            }
-        }
-        caching.lastIndex = iterationIndex;
-        return newValue;
-    }
-
-    //based on @Toji's https://github.com/toji/gl-matrix/
-    function slerp(a, b, t) {
-        var out = [];
-        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
-        bx = b[0], by = b[1], bz = b[2], bw = b[3]
-
-        var omega, cosom, sinom, scale0, scale1;
-
-        cosom = ax * bx + ay * by + az * bz + aw * bw;
-        if (cosom < 0.0) {
-            cosom = -cosom;
-            bx = -bx;
-            by = -by;
-            bz = -bz;
-            bw = -bw;
-        }
-        if ((1.0 - cosom) > 0.000001) {
-            omega = Math.acos(cosom);
-            sinom = Math.sin(omega);
-            scale0 = Math.sin((1.0 - t) * omega) / sinom;
-            scale1 = Math.sin(t * omega) / sinom;
-        } else {
-            scale0 = 1.0 - t;
-            scale1 = t;
-        }
-        out[0] = scale0 * ax + scale1 * bx;
-        out[1] = scale0 * ay + scale1 * by;
-        out[2] = scale0 * az + scale1 * bz;
-        out[3] = scale0 * aw + scale1 * bw;
-
-        return out;
-    }
-
-    function quaternionToEuler(out, quat) {
-        var qx = quat[0];
-        var qy = quat[1];
-        var qz = quat[2];
-        var qw = quat[3];
-        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
-        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
-        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
-        out[0] = heading/degToRads;
-        out[1] = attitude/degToRads;
-        out[2] = bank/degToRads;
-    }
-
-    function createQuaternion(values) {
-        var heading = values[0] * degToRads;
-        var attitude = values[1] * degToRads;
-        var bank = values[2] * degToRads;
-        var c1 = Math.cos(heading / 2);
-        var c2 = Math.cos(attitude / 2);
-        var c3 = Math.cos(bank / 2);
-        var s1 = Math.sin(heading / 2);
-        var s2 = Math.sin(attitude / 2);
-        var s3 = Math.sin(bank / 2);
-        var w = c1 * c2 * c3 - s1 * s2 * s3;
-        var x = s1 * s2 * c3 + c1 * c2 * s3;
-        var y = s1 * c2 * c3 + c1 * s2 * s3;
-        var z = c1 * s2 * c3 - s1 * c2 * s3;
-
-        return [x,y,z,w];
-    }
-
-    function getValueAtCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
-        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
-            if(this._caching.lastFrame >= frameNum) {
-                this._caching._lastKeyframeIndex = -1;
-                this._caching.lastIndex = 0;
-            }
-
-            var renderResult = this.interpolateValue(frameNum, this._caching);
-            this.pv = renderResult;
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
-    }
-
-    function setVValue(val) {
-        var multipliedValue;
-        if(this.propType === 'unidimensional') {
-            multipliedValue = val * this.mult;
-            if(math_abs(this.v - multipliedValue) > 0.00001) {
-                this.v = multipliedValue;
-                this._mdf = true;
-            }
-        } else {
-            var i = 0, len = this.v.length;
-            while (i < len) {
-                multipliedValue = val[i] * this.mult;
-                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
-                    this.v[i] = multipliedValue;
-                    this._mdf = true;
-                }
-                i += 1;
-            }
-        }
-    }
-
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
-            return;
-        }
-        if(this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = this._isFirstFrame;
-        var multipliedValue;
-        var i, len = this.effectsSequence.length;
-        var finalValue = this.kf ? this.pv : this.data.k;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this._isFirstFrame = false;
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
-    }
-
-    function ValueProperty(elem, data, mult, container){
-        this.propType = 'unidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.effectsSequence = [];
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function MultiDimensionalProperty(elem, data, mult, container) {
-        this.propType = 'multidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        var i, len = data.k.length;
-        this.v = createTypedArray('float32', len);
-        this.pv = createTypedArray('float32', len);
-        var arr = createTypedArray('float32', len);
-        this.vel = createTypedArray('float32', len);
-        for (i = 0; i < len; i += 1) {
-            this.v[i] = data.k[i] * this.mult;
-            this.pv[i] = data.k[i];
-        }
-        this._isFirstFrame = true;
-        this.effectsSequence = [];
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedValueProperty(elem, data, mult, container) {
-        this.propType = 'unidimensional';
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.frameId = -1;
-        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.v = initFrame;
-        this.pv = initFrame;
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult, container){
-        this.propType = 'multidimensional';
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for (i = 0; i < len - 1; i += 1) {
-            if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
-                s = data.k[i].s;
-                e = data.k[i + 1].s;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                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]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
-                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
-                        data.k[i].to = null;
-                        data.k[i].ti = null;
-                    }
-                }
-            }
-        }
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.data = data;
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this._isFirstFrame = true;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.frameId = -1;
-        var arrLen = data.k[0].s.length;
-        this.v = createTypedArray('float32', arrLen);
-        this.pv = createTypedArray('float32', arrLen);
-        for (i = 0; i < arrLen; i += 1) {
-            this.v[i] = initFrame;
-            this.pv[i] = initFrame;
-        }
-        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
-        this.addEffect = addEffect;
-    }
-
-    function getProp(elem,data,type, mult, container) {
-        var p;
-        if(!data.k.length){
-            p = new ValueProperty(elem,data, mult, container);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult, container);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult, container);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
-                    break;
-            }
-        }
-        if(p.effectsSequence.length){
-            container.addDynamicProperty(p);
-        }
-        return p;
-    }
-
-    var ob = {
-        getProp: getProp
-    };
-    return ob;
-}());
-var TransformPropertyFactory = (function() {
-
-    var defaultVector = [0,0]
-
-    function applyToMatrix(mat) {
-        var _mdf = this._mdf;
-        this.iterateDynamicProperties();
-        this._mdf = this._mdf || _mdf;
-        if (this.a) {
-            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-        }
-        if (this.s) {
-            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-        }
-        if (this.sk) {
-            mat.skewFromAxis(-this.sk.v, this.sa.v);
-        }
-        if (this.r) {
-            mat.rotate(-this.r.v);
-        } else {
-            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]);
-        }
-        if (this.data.p.s) {
-            if (this.data.p.z) {
-                mat.translate(this.px.v, this.py.v, -this.pz.v);
-            } else {
-                mat.translate(this.px.v, this.py.v, 0);
-            }
-        } else {
-            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-        }
-    }
-    function processKeys(forceRender){
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        }
-        if(this._isDirty) {
-            this.precalculateMatrix();
-            this._isDirty = false;
-        }
-
-        this.iterateDynamicProperties();
-
-        if (this._mdf || forceRender) {
-            this.v.cloneFromProps(this.pre.props);
-            if (this.appliedTransformations < 1) {
-                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if(this.appliedTransformations < 2) {
-                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.sk && this.appliedTransformations < 3) {
-                this.v.skewFromAxis(-this.sk.v, this.sa.v);
-            }
-            if (this.r && this.appliedTransformations < 4) {
-                this.v.rotate(-this.r.v);
-            } else if (!this.r && this.appliedTransformations < 4){
-                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]);
-            }
-            if (this.autoOriented) {
-                var v1,v2, frameRate = this.elem.globalData.frameRate;
-                if(this.p && this.p.keyframes && this.p.getValueAtTime) {
-                    if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
-                    } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
-                    }
-                } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
-                    v1 = [];
-                    v2 = [];
-                    var px = this.px, py = this.py, frameRate;
-                    if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
-                        v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
-                        v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
-                    } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
-                        v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
-                        v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
-                    } else {
-                        v1 = [px.pv, py.pv];
-                        v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
-                        v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
-                    }
-                } else {
-                    v1 = v2 = defaultVector
-                }
-                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-            }
-            if(this.data.p && this.data.p.s){
-                if(this.data.p.z) {
-                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    this.v.translate(this.px.v, this.py.v, 0);
-                }
-            }else{
-                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-            }
-        }
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function precalculateMatrix() {
-        if(!this.a.k) {
-            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            this.appliedTransformations = 1;
-        } else {
-            return;
-        }
-        if(!this.s.effectsSequence.length) {
-            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            this.appliedTransformations = 2;
-        } else {
-            return;
-        }
-        if(this.sk) {
-            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
-                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
-            this.appliedTransformations = 3;
-            } else {
-                return;
-            }
-        }
-        if (this.r) {
-            if(!this.r.effectsSequence.length) {
-                this.pre.rotate(-this.r.v);
-                this.appliedTransformations = 4;
-            } else {
-                return;
-            }
-        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
-            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]);
-            this.appliedTransformations = 4;
-        }
-    }
-
-    function autoOrient(){
-        //
-        //var prevP = this.getValueAtTime();
-    }
-
-    function addDynamicProperty(prop) {
-        this._addDynamicProperty(prop);
-        this.elem.addDynamicProperty(prop);
-        this._isDirty = true;
-    }
-
-    function TransformProperty(elem,data,container){
-        this.elem = elem;
-        this.frameId = -1;
-        this.propType = 'transform';
-        this.data = data;
-        this.v = new Matrix();
-        //Precalculated matrix with non animated properties
-        this.pre = new Matrix();
-        this.appliedTransformations = 0;
-        this.initDynamicPropertyContainer(container || elem);
-        if(data.p && data.p.s){
-            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
-            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
-            if(data.p.z){
-                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
-            }
-        }else{
-            this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
-        }
-        if(data.rx) {
-            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
-            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
-            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
-            if(data.or.k[0].ti) {
-                var i, len = data.or.k.length;
-                for(i=0;i<len;i+=1) {
-                    data.or.k[i].to = data.or.k[i].ti = null;
-                }
-            }
-            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
-            //sh Indicates it needs to be capped between -180 and 180
-            this.or.sh = true;
-        } else {
-            this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
-        }
-        if(data.sk){
-            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
-            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
-        }
-        this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},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.
-        if(data.o){
-            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
-        } else {
-            this.o = {_mdf:false,v:1};
-        }
-        this._isDirty = true;
-        if(!this.dynamicProperties.length){
-            this.getValue(true);
-        }
-    }
-
-    TransformProperty.prototype = {
-        applyToMatrix: applyToMatrix,
-        getValue: processKeys,
-        precalculateMatrix: precalculateMatrix,
-        autoOrient: autoOrient
-    }
-
-    extendPrototype([DynamicPropertyContainer], TransformProperty);
-    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
-    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
-
-    function getTransformProperty(elem,data,container){
-        return new TransformProperty(elem,data,container);
-    }
-
-    return {
-        getTransformProperty: getTransformProperty
-    };
-
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = createSizedArray(this._maxLength);
-	this.o = createSizedArray(this._maxLength);
-	this.i = createSizedArray(this._maxLength);
+  return {
+    style: fStyle,
+    weight: fontData.fWeight || fWeight,
+  };
 }
 
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	this.setLength(len);
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newElement();
-		this.o[i] = point_pool.newElement();
-		this.i[i] = point_pool.newElement();
-		i += 1;
-	}
-};
+/* global createNS, createTag, getFontProperties */
+/* exported FontManager */
 
-ShapePath.prototype.setLength = function(len) {
-	while(this._maxLength < len) {
-		this.doubleArrayLength();
-	}
-	this._length = len;
-};
+var FontManager = (function () {
+  var maxWaitingTime = 5000;
+  var emptyChar = {
+    w: 0,
+    size: 0,
+    shapes: [],
+  };
+  var combinedCharacters = [];
+  // Hindi characters
+  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]);
 
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(createSizedArray(this._maxLength));
-	this.i = this.i.concat(createSizedArray(this._maxLength));
-	this.o = this.o.concat(createSizedArray(this._maxLength));
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newElement();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-
-ShapePath.prototype.reverse = function() {
-	var newPath = new ShapePath();
-	newPath.setPathData(this.c, this._length);
-	var vertices = this.v, outPoints = this.o, inPoints = this.i;
-	var init = 0;
-	if (this.c) {
-		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
-        init = 1;
-    }
-    var cnt = this._length - 1;
-    var len = this._length;
-
+  function trimFontOptions(font) {
+    var familyArray = font.split(',');
     var i;
-    for (i = init; i < len; i += 1) {
-    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
-        cnt -= 1;
+    var len = familyArray.length;
+    var enabledFamilies = [];
+    for (i = 0; i < len; i += 1) {
+      if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
+        enabledFamilies.push(familyArray[i]);
+      }
     }
-    return newPath;
+    return enabledFamilies.join(',');
+  }
+
+  function setUpNode(font, family) {
+    var parentNode = createTag('span');
+    parentNode.style.fontFamily = family;
+    var node = createTag('span');
+    // Characters that vary significantly among different fonts
+    node.innerText = 'giItT1WQy@!-/#';
+    // Visible - so we can measure it - but not on the screen
+    parentNode.style.position = 'absolute';
+    parentNode.style.left = '-10000px';
+    parentNode.style.top = '-10000px';
+    // Large font size makes even subtle changes obvious
+    parentNode.style.fontSize = '300px';
+    // Reset any font properties
+    parentNode.style.fontVariant = 'normal';
+    parentNode.style.fontStyle = 'normal';
+    parentNode.style.fontWeight = 'normal';
+    parentNode.style.letterSpacing = '0';
+    parentNode.appendChild(node);
+    document.body.appendChild(parentNode);
+
+    // Remember width with no applied web font
+    var width = node.offsetWidth;
+    node.style.fontFamily = trimFontOptions(font) + ', ' + family;
+    return { node: node, w: width, parent: parentNode };
+  }
+
+  function checkLoadedFonts() {
+    var i;
+    var len = this.fonts.length;
+    var node;
+    var w;
+    var loadedCount = len;
+    for (i = 0; i < len; i += 1) {
+      if (this.fonts[i].loaded) {
+        loadedCount -= 1;
+      } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
+        this.fonts[i].loaded = true;
+      } else {
+        node = this.fonts[i].monoCase.node;
+        w = this.fonts[i].monoCase.w;
+        if (node.offsetWidth !== w) {
+          loadedCount -= 1;
+          this.fonts[i].loaded = true;
+        } else {
+          node = this.fonts[i].sansCase.node;
+          w = this.fonts[i].sansCase.w;
+          if (node.offsetWidth !== w) {
+            loadedCount -= 1;
+            this.fonts[i].loaded = true;
+          }
+        }
+        if (this.fonts[i].loaded) {
+          this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
+          this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
+        }
+      }
+    }
+
+    if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
+      setTimeout(this.checkLoadedFontsBinded, 20);
+    } else {
+      setTimeout(this.setIsLoadedBinded, 10);
+    }
+  }
+
+  function createHelper(def, fontData) {
+    var tHelper = createNS('text');
+    tHelper.style.fontSize = '100px';
+    // tHelper.style.fontFamily = fontData.fFamily;
+
+    var fontProps = getFontProperties(fontData);
+    tHelper.setAttribute('font-family', fontData.fFamily);
+    tHelper.setAttribute('font-style', fontProps.style);
+    tHelper.setAttribute('font-weight', fontProps.weight);
+    tHelper.textContent = '1';
+    if (fontData.fClass) {
+      tHelper.style.fontFamily = 'inherit';
+      tHelper.setAttribute('class', fontData.fClass);
+    } else {
+      tHelper.style.fontFamily = fontData.fFamily;
+    }
+    def.appendChild(tHelper);
+    var tCanvasHelper = createTag('canvas').getContext('2d');
+    tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px ' + fontData.fFamily;
+    // tCanvasHelper.font = ' 100px '+ fontData.fFamily;
+    return tHelper;
+  }
+
+  function addFonts(fontData, defs) {
+    if (!fontData) {
+      this.isLoaded = true;
+      return;
+    }
+    if (this.chars) {
+      this.isLoaded = true;
+      this.fonts = fontData.list;
+      return;
+    }
+
+    var fontArr = fontData.list;
+    var i;
+    var len = fontArr.length;
+    var _pendingFonts = len;
+    for (i = 0; i < len; i += 1) {
+      var shouldLoadFont = true;
+      var loadedSelector;
+      var j;
+      fontArr[i].loaded = false;
+      fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
+      fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
+      if (!fontArr[i].fPath) {
+        fontArr[i].loaded = true;
+        _pendingFonts -= 1;
+      } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
+        loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
+
+        if (loadedSelector.length > 0) {
+          shouldLoadFont = false;
+        }
+
+        if (shouldLoadFont) {
+          var s = createTag('style');
+          s.setAttribute('f-forigin', fontArr[i].fOrigin);
+          s.setAttribute('f-origin', fontArr[i].origin);
+          s.setAttribute('f-family', fontArr[i].fFamily);
+          s.type = 'text/css';
+          s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
+          defs.appendChild(s);
+        }
+      } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
+        loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var l = createTag('link');
+          l.setAttribute('f-forigin', fontArr[i].fOrigin);
+          l.setAttribute('f-origin', fontArr[i].origin);
+          l.type = 'text/css';
+          l.rel = 'stylesheet';
+          l.href = fontArr[i].fPath;
+          document.body.appendChild(l);
+        }
+      } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
+        loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (fontArr[i].fPath === loadedSelector[j].src) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var sc = createTag('link');
+          sc.setAttribute('f-forigin', fontArr[i].fOrigin);
+          sc.setAttribute('f-origin', fontArr[i].origin);
+          sc.setAttribute('rel', 'stylesheet');
+          sc.setAttribute('href', fontArr[i].fPath);
+          defs.appendChild(sc);
+        }
+      }
+      fontArr[i].helper = createHelper(defs, fontArr[i]);
+      fontArr[i].cache = {};
+      this.fonts.push(fontArr[i]);
+    }
+    if (_pendingFonts === 0) {
+      this.isLoaded = true;
+    } else {
+      // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
+      // Adding this timeout seems to fix it
+      setTimeout(this.checkLoadedFonts.bind(this), 100);
+    }
+  }
+
+  function addChars(chars) {
+    if (!chars) {
+      return;
+    }
+    if (!this.chars) {
+      this.chars = [];
+    }
+    var i;
+    var len = chars.length;
+    var j;
+    var jLen = this.chars.length;
+    var found;
+    for (i = 0; i < len; i += 1) {
+      j = 0;
+      found = false;
+      while (j < jLen) {
+        if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
+          found = true;
+        }
+        j += 1;
+      }
+      if (!found) {
+        this.chars.push(chars[i]);
+        jLen += 1;
+      }
+    }
+  }
+
+  function getCharData(char, style, font) {
+    var i = 0;
+    var len = this.chars.length;
+    while (i < len) {
+      if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) {
+        return this.chars[i];
+      }
+      i += 1;
+    }
+    if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char)
+            && console
+            && console.warn // eslint-disable-line no-console
+            && !this._warned
+    ) {
+      this._warned = true;
+      console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console
+    }
+    return emptyChar;
+  }
+
+  function measureText(char, fontName, size) {
+    var fontData = this.getFontByName(fontName);
+    var index = char.charCodeAt(0);
+    if (!fontData.cache[index + 1]) {
+      var tHelper = fontData.helper;
+      // Canvas version
+      // fontData.cache[index] = tHelper.measureText(char).width / 100;
+      // SVG version
+      // console.log(tHelper.getBBox().width)
+      if (char === ' ') {
+        tHelper.textContent = '|' + char + '|';
+        var doubleSize = tHelper.getComputedTextLength();
+        tHelper.textContent = '||';
+        var singleSize = tHelper.getComputedTextLength();
+        fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
+      } else {
+        tHelper.textContent = char;
+        fontData.cache[index + 1] = (tHelper.getComputedTextLength()) / 100;
+      }
+    }
+    return fontData.cache[index + 1] * size;
+  }
+
+  function getFontByName(name) {
+    var i = 0;
+    var len = this.fonts.length;
+    while (i < len) {
+      if (this.fonts[i].fName === name) {
+        return this.fonts[i];
+      }
+      i += 1;
+    }
+    return this.fonts[0];
+  }
+
+  function getCombinedCharacterCodes() {
+    return combinedCharacters;
+  }
+
+  function setIsLoaded() {
+    this.isLoaded = true;
+  }
+
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this._warned = false;
+    this.initTime = Date.now();
+    this.setIsLoadedBinded = this.setIsLoaded.bind(this);
+    this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
+  };
+    // TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
+  Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
+  var fontPrototype = {
+    addChars: addChars,
+    addFonts: addFonts,
+    getCharData: getCharData,
+    getFontByName: getFontByName,
+    measureText: measureText,
+    checkLoadedFonts: checkLoadedFonts,
+    setIsLoaded: setIsLoaded,
+  };
+
+  Font.prototype = fontPrototype;
+
+  return Font;
+}());
+
+/* global initialDefaultFrame, BezierFactory, degToRads, bez, createTypedArray */
+/* exported PropertyFactory */
+
+var PropertyFactory = (function () {
+  var initFrame = initialDefaultFrame;
+  var mathAbs = Math.abs;
+
+  function interpolateValue(frameNum, caching) {
+    var offsetTime = this.offsetTime;
+    var newValue;
+    if (this.propType === 'multidimensional') {
+      newValue = createTypedArray('float32', this.pv.length);
+    }
+    var iterationIndex = caching.lastIndex;
+    var i = iterationIndex;
+    var len = this.keyframes.length - 1;
+    var flag = true;
+    var keyData;
+    var nextKeyData;
+
+    while (flag) {
+      keyData = this.keyframes[i];
+      nextKeyData = this.keyframes[i + 1];
+      if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
+        if (keyData.h) {
+          keyData = nextKeyData;
+        }
+        iterationIndex = 0;
+        break;
+      }
+      if ((nextKeyData.t - offsetTime) > frameNum) {
+        iterationIndex = i;
+        break;
+      }
+      if (i < len - 1) {
+        i += 1;
+      } else {
+        iterationIndex = 0;
+        flag = false;
+      }
+    }
+
+    var k;
+    var kLen;
+    var perc;
+    var jLen;
+    var j;
+    var fnc;
+    var nextKeyTime = nextKeyData.t - offsetTime;
+    var keyTime = keyData.t - offsetTime;
+    var endValue;
+    if (keyData.to) {
+      if (!keyData.bezierData) {
+        keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
+      }
+      var bezierData = keyData.bezierData;
+      if (frameNum >= nextKeyTime || frameNum < keyTime) {
+        var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
+        kLen = bezierData.points[ind].point.length;
+        for (k = 0; k < kLen; k += 1) {
+          newValue[k] = bezierData.points[ind].point[k];
+        }
+        // caching._lastKeyframeIndex = -1;
+      } else {
+        if (keyData.__fnct) {
+          fnc = keyData.__fnct;
+        } else {
+          fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
+          keyData.__fnct = fnc;
+        }
+        perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+        var distanceInLine = bezierData.segmentLength * perc;
+
+        var segmentPerc;
+        var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+        j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
+        flag = true;
+        jLen = bezierData.points.length;
+        while (flag) {
+          addedLength += bezierData.points[j].partialLength;
+          if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k];
+            }
+            break;
+          } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
+            segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
+            }
+            break;
+          }
+          if (j < jLen - 1) {
+            j += 1;
+          } else {
+            flag = false;
+          }
+        }
+        caching._lastPoint = j;
+        caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+        caching._lastKeyframeIndex = i;
+      }
+    } else {
+      var outX;
+      var outY;
+      var inX;
+      var inY;
+      var keyValue;
+      len = keyData.s.length;
+      endValue = nextKeyData.s || keyData.e;
+      if (this.sh && keyData.h !== 1) {
+        if (frameNum >= nextKeyTime) {
+          newValue[0] = endValue[0];
+          newValue[1] = endValue[1];
+          newValue[2] = endValue[2];
+        } else if (frameNum <= keyTime) {
+          newValue[0] = keyData.s[0];
+          newValue[1] = keyData.s[1];
+          newValue[2] = keyData.s[2];
+        } else {
+          var quatStart = createQuaternion(keyData.s);
+          var quatEnd = createQuaternion(endValue);
+          var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
+          quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+        }
+      } else {
+        for (i = 0; i < len; i += 1) {
+          if (keyData.h !== 1) {
+            if (frameNum >= nextKeyTime) {
+              perc = 1;
+            } else if (frameNum < keyTime) {
+              perc = 0;
+            } else {
+              if (keyData.o.x.constructor === Array) {
+                if (!keyData.__fnct) {
+                  keyData.__fnct = [];
+                }
+                if (!keyData.__fnct[i]) {
+                  outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+                  outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+                  inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+                  inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
+                  fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                  keyData.__fnct[i] = fnc;
+                } else {
+                  fnc = keyData.__fnct[i];
+                }
+              } else if (!keyData.__fnct) {
+                outX = keyData.o.x;
+                outY = keyData.o.y;
+                inX = keyData.i.x;
+                inY = keyData.i.y;
+                fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                keyData.__fnct = fnc;
+              } else {
+                fnc = keyData.__fnct;
+              }
+              perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+            }
+          }
+
+          endValue = nextKeyData.s || keyData.e;
+          keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
+
+          if (this.propType === 'multidimensional') {
+            newValue[i] = keyValue;
+          } else {
+            newValue = keyValue;
+          }
+        }
+      }
+    }
+    caching.lastIndex = iterationIndex;
+    return newValue;
+  }
+
+  // based on @Toji's https://github.com/toji/gl-matrix/
+  function slerp(a, b, t) {
+    var out = [];
+    var ax = a[0];
+    var ay = a[1];
+    var az = a[2];
+    var aw = a[3];
+    var bx = b[0];
+    var by = b[1];
+    var bz = b[2];
+    var bw = b[3];
+
+    var omega;
+    var cosom;
+    var sinom;
+    var scale0;
+    var scale1;
+
+    cosom = ax * bx + ay * by + az * bz + aw * bw;
+    if (cosom < 0.0) {
+      cosom = -cosom;
+      bx = -bx;
+      by = -by;
+      bz = -bz;
+      bw = -bw;
+    }
+    if ((1.0 - cosom) > 0.000001) {
+      omega = Math.acos(cosom);
+      sinom = Math.sin(omega);
+      scale0 = Math.sin((1.0 - t) * omega) / sinom;
+      scale1 = Math.sin(t * omega) / sinom;
+    } else {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+    out[0] = scale0 * ax + scale1 * bx;
+    out[1] = scale0 * ay + scale1 * by;
+    out[2] = scale0 * az + scale1 * bz;
+    out[3] = scale0 * aw + scale1 * bw;
+
+    return out;
+  }
+
+  function quaternionToEuler(out, quat) {
+    var qx = quat[0];
+    var qy = quat[1];
+    var qz = quat[2];
+    var qw = quat[3];
+    var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
+    var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
+    var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
+    out[0] = heading / degToRads;
+    out[1] = attitude / degToRads;
+    out[2] = bank / degToRads;
+  }
+
+  function createQuaternion(values) {
+    var heading = values[0] * degToRads;
+    var attitude = values[1] * degToRads;
+    var bank = values[2] * degToRads;
+    var c1 = Math.cos(heading / 2);
+    var c2 = Math.cos(attitude / 2);
+    var c3 = Math.cos(bank / 2);
+    var s1 = Math.sin(heading / 2);
+    var s2 = Math.sin(attitude / 2);
+    var s3 = Math.sin(bank / 2);
+    var w = c1 * c2 * c3 - s1 * s2 * s3;
+    var x = s1 * s2 * c3 + c1 * c2 * s3;
+    var y = s1 * c2 * c3 + c1 * s2 * s3;
+    var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+    return [x, y, z, w];
+  }
+
+  function getValueAtCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) {
+      if (this._caching.lastFrame >= frameNum) {
+        this._caching._lastKeyframeIndex = -1;
+        this._caching.lastIndex = 0;
+      }
+
+      var renderResult = this.interpolateValue(frameNum, this._caching);
+      this.pv = renderResult;
+    }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
+
+  function setVValue(val) {
+    var multipliedValue;
+    if (this.propType === 'unidimensional') {
+      multipliedValue = val * this.mult;
+      if (mathAbs(this.v - multipliedValue) > 0.00001) {
+        this.v = multipliedValue;
+        this._mdf = true;
+      }
+    } else {
+      var i = 0;
+      var len = this.v.length;
+      while (i < len) {
+        multipliedValue = val[i] * this.mult;
+        if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
+          this.v[i] = multipliedValue;
+          this._mdf = true;
+        }
+        i += 1;
+      }
+    }
+  }
+
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+      return;
+    }
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
+    }
+    this.lock = true;
+    this._mdf = this._isFirstFrame;
+    var i;
+    var len = this.effectsSequence.length;
+    var finalValue = this.kf ? this.pv : this.data.k;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this._isFirstFrame = false;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
+
+  function ValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this.v = mult ? data.k * mult : data.k;
+    this.pv = data.k;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.vel = 0;
+    this.effectsSequence = [];
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function MultiDimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.frameId = -1;
+    var i;
+    var len = data.k.length;
+    this.v = createTypedArray('float32', len);
+    this.pv = createTypedArray('float32', len);
+    this.vel = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      this.v[i] = data.k[i] * this.mult;
+      this.pv[i] = data.k[i];
+    }
+    this._isFirstFrame = true;
+    this.effectsSequence = [];
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.frameId = -1;
+    this._caching = {
+      lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1,
+    };
+    this.k = true;
+    this.kf = true;
+    this.data = data;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.v = initFrame;
+    this.pv = initFrame;
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedMultidimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    var i;
+    var len = data.k.length;
+    var s;
+    var e;
+    var to;
+    var ti;
+    for (i = 0; i < len - 1; i += 1) {
+      if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
+        s = data.k[i].s;
+        e = data.k[i + 1].s;
+        to = data.k[i].to;
+        ti = data.k[i].ti;
+        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]))) {
+          data.k[i].to = null;
+          data.k[i].ti = null;
+        }
+        if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+          if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+            data.k[i].to = null;
+            data.k[i].ti = null;
+          }
+        }
+      }
+    }
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.data = data;
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.k = true;
+    this.kf = true;
+    this._isFirstFrame = true;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.frameId = -1;
+    var arrLen = data.k[0].s.length;
+    this.v = createTypedArray('float32', arrLen);
+    this.pv = createTypedArray('float32', arrLen);
+    for (i = 0; i < arrLen; i += 1) {
+      this.v[i] = initFrame;
+      this.pv[i] = initFrame;
+    }
+    this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) };
+    this.addEffect = addEffect;
+  }
+
+  function getProp(elem, data, type, mult, container) {
+    var p;
+    if (!data.k.length) {
+      p = new ValueProperty(elem, data, mult, container);
+    } else if (typeof (data.k[0]) === 'number') {
+      p = new MultiDimensionalProperty(elem, data, mult, container);
+    } else {
+      switch (type) {
+        case 0:
+          p = new KeyframedValueProperty(elem, data, mult, container);
+          break;
+        case 1:
+          p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
+          break;
+        default:
+          break;
+      }
+    }
+    if (p.effectsSequence.length) {
+      container.addDynamicProperty(p);
+    }
+    return p;
+  }
+
+  var ob = {
+    getProp: getProp,
+  };
+  return ob;
+}());
+
+/* global Matrix, degToRads, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+/* exported TransformPropertyFactory */
+
+var TransformPropertyFactory = (function () {
+  var defaultVector = [0, 0];
+
+  function applyToMatrix(mat) {
+    var _mdf = this._mdf;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || _mdf;
+    if (this.a) {
+      mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+    }
+    if (this.s) {
+      mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+    }
+    if (this.sk) {
+      mat.skewFromAxis(-this.sk.v, this.sa.v);
+    }
+    if (this.r) {
+      mat.rotate(-this.r.v);
+    } else {
+      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]);
+    }
+    if (this.data.p.s) {
+      if (this.data.p.z) {
+        mat.translate(this.px.v, this.py.v, -this.pz.v);
+      } else {
+        mat.translate(this.px.v, this.py.v, 0);
+      }
+    } else {
+      mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+    }
+  }
+  function processKeys(forceRender) {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    }
+    if (this._isDirty) {
+      this.precalculateMatrix();
+      this._isDirty = false;
+    }
+
+    this.iterateDynamicProperties();
+
+    if (this._mdf || forceRender) {
+      var frameRate;
+      this.v.cloneFromProps(this.pre.props);
+      if (this.appliedTransformations < 1) {
+        this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      }
+      if (this.appliedTransformations < 2) {
+        this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      }
+      if (this.sk && this.appliedTransformations < 3) {
+        this.v.skewFromAxis(-this.sk.v, this.sa.v);
+      }
+      if (this.r && this.appliedTransformations < 4) {
+        this.v.rotate(-this.r.v);
+      } else if (!this.r && this.appliedTransformations < 4) {
+        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]);
+      }
+      if (this.autoOriented) {
+        var v1;
+        var v2;
+        frameRate = this.elem.globalData.frameRate;
+        if (this.p && this.p.keyframes && this.p.getValueAtTime) {
+          if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
+            v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
+          } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
+            v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
+          } else {
+            v1 = this.p.pv;
+            v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
+          }
+        } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
+          v1 = [];
+          v2 = [];
+          var px = this.px;
+          var py = this.py;
+          if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
+            v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
+            v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0);
+          } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0);
+            v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0);
+            v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
+          } else {
+            v1 = [px.pv, py.pv];
+            v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
+            v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
+          }
+        } else {
+          v2 = defaultVector;
+          v1 = v2;
+        }
+        this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+      }
+      if (this.data.p && this.data.p.s) {
+        if (this.data.p.z) {
+          this.v.translate(this.px.v, this.py.v, -this.pz.v);
+        } else {
+          this.v.translate(this.px.v, this.py.v, 0);
+        }
+      } else {
+        this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+      }
+    }
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function precalculateMatrix() {
+    if (!this.a.k) {
+      this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      this.appliedTransformations = 1;
+    } else {
+      return;
+    }
+    if (!this.s.effectsSequence.length) {
+      this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      this.appliedTransformations = 2;
+    } else {
+      return;
+    }
+    if (this.sk) {
+      if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+        this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+        this.appliedTransformations = 3;
+      } else {
+        return;
+      }
+    }
+    if (this.r) {
+      if (!this.r.effectsSequence.length) {
+        this.pre.rotate(-this.r.v);
+        this.appliedTransformations = 4;
+      }
+    } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+      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]);
+      this.appliedTransformations = 4;
+    }
+  }
+
+  function autoOrient() {
+    //
+    // var prevP = this.getValueAtTime();
+  }
+
+  function addDynamicProperty(prop) {
+    this._addDynamicProperty(prop);
+    this.elem.addDynamicProperty(prop);
+    this._isDirty = true;
+  }
+
+  function TransformProperty(elem, data, container) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.propType = 'transform';
+    this.data = data;
+    this.v = new Matrix();
+    // Precalculated matrix with non animated properties
+    this.pre = new Matrix();
+    this.appliedTransformations = 0;
+    this.initDynamicPropertyContainer(container || elem);
+    if (data.p && data.p.s) {
+      this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
+      this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
+      if (data.p.z) {
+        this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
+      }
+    } else {
+      this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this);
+    }
+    if (data.rx) {
+      this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+      this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+      this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+      if (data.or.k[0].ti) {
+        var i;
+        var len = data.or.k.length;
+        for (i = 0; i < len; i += 1) {
+          data.or.k[i].to = null;
+          data.or.k[i].ti = null;
+        }
+      }
+      this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+      // sh Indicates it needs to be capped between -180 and 180
+      this.or.sh = true;
+    } else {
+      this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this);
+    }
+    if (data.sk) {
+      this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+      this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+    }
+    this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 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.
+    if (data.o) {
+      this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
+    } else {
+      this.o = { _mdf: false, v: 1 };
+    }
+    this._isDirty = true;
+    if (!this.dynamicProperties.length) {
+      this.getValue(true);
+    }
+  }
+
+  TransformProperty.prototype = {
+    applyToMatrix: applyToMatrix,
+    getValue: processKeys,
+    precalculateMatrix: precalculateMatrix,
+    autoOrient: autoOrient,
+  };
+
+  extendPrototype([DynamicPropertyContainer], TransformProperty);
+  TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+  TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+  function getTransformProperty(elem, data, container) {
+    return new TransformProperty(elem, data, container);
+  }
+
+  return {
+    getTransformProperty: getTransformProperty,
+  };
+}());
+
+/* global createSizedArray, createSizedArray, pointPool */
+
+function ShapePath() {
+  this.c = false;
+  this._length = 0;
+  this._maxLength = 8;
+  this.v = createSizedArray(this._maxLength);
+  this.o = createSizedArray(this._maxLength);
+  this.i = createSizedArray(this._maxLength);
+}
+
+ShapePath.prototype.setPathData = function (closed, len) {
+  this.c = closed;
+  this.setLength(len);
+  var i = 0;
+  while (i < len) {
+    this.v[i] = pointPool.newElement();
+    this.o[i] = pointPool.newElement();
+    this.i[i] = pointPool.newElement();
+    i += 1;
+  }
 };
-var ShapePropertyFactory = (function(){
 
-    var initFrame = -999999;
+ShapePath.prototype.setLength = function (len) {
+  while (this._maxLength < len) {
+    this.doubleArrayLength();
+  }
+  this._length = len;
+};
 
-    function interpolateShape(frameNum, previousValue, caching) {
-        var iterationIndex = caching.lastIndex;
-        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
-        var kf = this.keyframes;
-        if(frameNum < kf[0].t-this.offsetTime){
-            keyPropS = kf[0].s[0];
-            isHold = true;
-            iterationIndex = 0;
-        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
-            keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
-            /*if(kf[kf.length - 1].s){
+ShapePath.prototype.doubleArrayLength = function () {
+  this.v = this.v.concat(createSizedArray(this._maxLength));
+  this.i = this.i.concat(createSizedArray(this._maxLength));
+  this.o = this.o.concat(createSizedArray(this._maxLength));
+  this._maxLength *= 2;
+};
+
+ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
+  var arr;
+  this._length = Math.max(this._length, pos + 1);
+  if (this._length >= this._maxLength) {
+    this.doubleArrayLength();
+  }
+  switch (type) {
+    case 'v':
+      arr = this.v;
+      break;
+    case 'i':
+      arr = this.i;
+      break;
+    case 'o':
+      arr = this.o;
+      break;
+    default:
+      arr = [];
+      break;
+  }
+  if (!arr[pos] || (arr[pos] && !replace)) {
+    arr[pos] = pointPool.newElement();
+  }
+  arr[pos][0] = x;
+  arr[pos][1] = y;
+};
+
+ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
+  this.setXYAt(vX, vY, 'v', pos, replace);
+  this.setXYAt(oX, oY, 'o', pos, replace);
+  this.setXYAt(iX, iY, 'i', pos, replace);
+};
+
+ShapePath.prototype.reverse = function () {
+  var newPath = new ShapePath();
+  newPath.setPathData(this.c, this._length);
+  var vertices = this.v;
+  var outPoints = this.o;
+  var inPoints = this.i;
+  var init = 0;
+  if (this.c) {
+    newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+    init = 1;
+  }
+  var cnt = this._length - 1;
+  var len = this._length;
+
+  var i;
+  for (i = init; i < len; i += 1) {
+    newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+    cnt -= 1;
+  }
+  return newPath;
+};
+
+/* global extendPrototype, roundCorner, BezierFactory, shapePool, degToRads,
+  shapeCollectionPool, PropertyFactory, bmMin, DynamicPropertyContainer */
+/* exported ShapePropertyFactory */
+
+var ShapePropertyFactory = (function () {
+  var initFrame = -999999;
+
+  function interpolateShape(frameNum, previousValue, caching) {
+    var iterationIndex = caching.lastIndex;
+    var keyPropS;
+    var keyPropE;
+    var isHold;
+    var j;
+    var k;
+    var jLen;
+    var kLen;
+    var perc;
+    var vertexValue;
+    var kf = this.keyframes;
+    if (frameNum < kf[0].t - this.offsetTime) {
+      keyPropS = kf[0].s[0];
+      isHold = true;
+      iterationIndex = 0;
+    } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
+      keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
+      /* if(kf[kf.length - 1].s){
                 keyPropS = kf[kf.length - 1].s[0];
             }else{
                 keyPropS = kf[kf.length - 2].e[0];
-            }*/
-            isHold = true;
-        }else{
-            var i = iterationIndex;
-            var len = kf.length- 1,flag = true,keyData,nextKeyData;
-            while(flag){
-                keyData = kf[i];
-                nextKeyData = kf[i+1];
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-            isHold = keyData.h === 1;
-            iterationIndex = i;
-            if(!isHold){
-                if(frameNum >= nextKeyData.t-this.offsetTime){
-                    perc = 1;
-                }else if(frameNum < keyData.t-this.offsetTime){
-                    perc = 0;
-                }else{
-                    var fnc;
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                }
-                keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
-            }
-            keyPropS = keyData.s[0];
+            } */
+      isHold = true;
+    } else {
+      var i = iterationIndex;
+      var len = kf.length - 1;
+      var flag = true;
+      var keyData;
+      var nextKeyData;
+      while (flag) {
+        keyData = kf[i];
+        nextKeyData = kf[i + 1];
+        if ((nextKeyData.t - this.offsetTime) > frameNum) {
+          break;
         }
-        jLen = previousValue._length;
-        kLen = keyPropS.i[0].length;
-        caching.lastIndex = iterationIndex;
-
-        for(j=0;j<jLen;j+=1){
-            for(k=0;k<kLen;k+=1){
-                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                previousValue.i[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                previousValue.o[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                previousValue.v[j][k] = vertexValue;
-            }
+        if (i < len - 1) {
+          i += 1;
+        } else {
+          flag = false;
         }
+      }
+      isHold = keyData.h === 1;
+      iterationIndex = i;
+      if (!isHold) {
+        if (frameNum >= nextKeyData.t - this.offsetTime) {
+          perc = 1;
+        } else if (frameNum < keyData.t - this.offsetTime) {
+          perc = 0;
+        } else {
+          var fnc;
+          if (keyData.__fnct) {
+            fnc = keyData.__fnct;
+          } else {
+            fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
+            keyData.__fnct = fnc;
+          }
+          perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime)));
+        }
+        keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
+      }
+      keyPropS = keyData.s[0];
     }
+    jLen = previousValue._length;
+    kLen = keyPropS.i[0].length;
+    caching.lastIndex = iterationIndex;
 
-    function interpolateShapeCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
-        var lastFrame = this._caching.lastFrame;
-        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
-            ////
-            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
-            this.interpolateShape(frameNum, this.pv, this._caching);
-            ////
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
+    for (j = 0; j < jLen; j += 1) {
+      for (k = 0; k < kLen; k += 1) {
+        vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
+        previousValue.i[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
+        previousValue.o[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
+        previousValue.v[j][k] = vertexValue;
+      }
     }
+  }
 
-    function resetShape(){
-        this.paths = this.localShapeCollection;
+  function interpolateShapeCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    var lastFrame = this._caching.lastFrame;
+    if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) {
+      /// /
+      this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+      this.interpolateShape(frameNum, this.pv, this._caching);
+      /// /
     }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            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] 
+  function resetShape() {
+    this.paths = this.localShapeCollection;
+  }
+
+  function shapesEqual(shape1, shape2) {
+    if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
+      return false;
+    }
+    var i;
+    var len = shape1._length;
+    for (i = 0; i < len; i += 1) {
+      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]) {
-                return false;
-            }
-        }
-        return true;
+        return false;
+      }
     }
+    return true;
+  }
 
-    function setVValue(newPath) {
-        if(!shapesEqual(this.v, newPath)) {
-            this.v = shape_pool.clone(newPath);
-            this.localShapeCollection.releaseShapes();
-            this.localShapeCollection.addShape(this.v);
-            this._mdf = true;
-            this.paths = this.localShapeCollection;
-        }
+  function setVValue(newPath) {
+    if (!shapesEqual(this.v, newPath)) {
+      this.v = shapePool.clone(newPath);
+      this.localShapeCollection.releaseShapes();
+      this.localShapeCollection.addShape(this.v);
+      this._mdf = true;
+      this.paths = this.localShapeCollection;
     }
+  }
 
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        } else if (!this.effectsSequence.length) {
-            this._mdf = false;
-            return;
-        }
-        if (this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = false;
-        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
-        var i, len = this.effectsSequence.length;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    };
-
-    function ShapeProperty(elem, data, type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.container = elem;
-        this.elem = elem;
-        this.data = data;
-        this.k = false;
-        this.kf = false;
-        this._mdf = false;
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v = shape_pool.clone(pathData);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-        this.effectsSequence = [];
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    } if (!this.effectsSequence.length) {
+      this._mdf = false;
+      return;
     }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
     }
-
-    ShapeProperty.prototype.interpolateShape = interpolateShape;
-    ShapeProperty.prototype.getValue = processEffectsSequence;
-    ShapeProperty.prototype.setVValue = setVValue;
-    ShapeProperty.prototype.addEffect = addEffect;
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.container = elem;
-        this.offsetTime = elem.data.st;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newElement();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-        this._caching = {lastFrame: initFrame, lastIndex: 0};
-        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+    this.lock = true;
+    this._mdf = false;
+    var finalValue;
+    if (this.kf) {
+      finalValue = this.pv;
+    } else if (this.data.ks) {
+      finalValue = this.data.ks.k;
+    } else {
+      finalValue = this.data.pt.k;
     }
-    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
-    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
-    KeyframedShapeProperty.prototype.setVValue = setVValue;
-    KeyframedShapeProperty.prototype.addEffect = addEffect;
+    var i;
+    var len = this.effectsSequence.length;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
 
-    var EllShapeProperty = (function(){
+  function ShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.container = elem;
+    this.elem = elem;
+    this.data = data;
+    this.k = false;
+    this.kf = false;
+    this._mdf = false;
+    var pathData = type === 3 ? data.pt.k : data.ks.k;
+    this.v = shapePool.clone(pathData);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.reset = resetShape;
+    this.effectsSequence = [];
+  }
 
-        var cPoint = roundCorner;
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
 
-        function EllShapeProperty(elem,data) {
-            /*this.v = {
+  ShapeProperty.prototype.interpolateShape = interpolateShape;
+  ShapeProperty.prototype.getValue = processEffectsSequence;
+  ShapeProperty.prototype.setVValue = setVValue;
+  ShapeProperty.prototype.addEffect = addEffect;
+
+  function KeyframedShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.elem = elem;
+    this.container = elem;
+    this.offsetTime = elem.data.st;
+    this.keyframes = type === 3 ? data.pt.k : data.ks.k;
+    this.k = true;
+    this.kf = true;
+    var len = this.keyframes[0].s[0].i.length;
+    this.v = shapePool.newElement();
+    this.v.setPathData(this.keyframes[0].s[0].c, len);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.lastFrame = initFrame;
+    this.reset = resetShape;
+    this._caching = { lastFrame: initFrame, lastIndex: 0 };
+    this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+  }
+  KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+  KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+  KeyframedShapeProperty.prototype.setVValue = setVValue;
+  KeyframedShapeProperty.prototype.addEffect = addEffect;
+
+  var EllShapeProperty = (function () {
+    var cPoint = roundCorner;
+
+    function EllShapePropertyFactory(elem, data) {
+      /* this.v = {
                 v: createSizedArray(4),
                 i: createSizedArray(4),
                 o: createSizedArray(4),
                 c: true
-            };*/
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertEllToPath();
-            }
-        };
+            }; */
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 4);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.paths = this.localShapeCollection;
+      this.localShapeCollection.addShape(this.v);
+      this.d = data.d;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertEllToPath();
+      }
+    }
 
-        EllShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function (){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-
-                if(this._mdf){
-                    this.convertEllToPath();
-                }
-            },
-            convertEllToPath: function() {
-                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-                var _cw = this.d !== 3;
-                var _v = this.v;
-                _v.v[0][0] = p0;
-                _v.v[0][1] = p1 - s1;
-                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.v[1][1] = p1;
-                _v.v[2][0] = p0;
-                _v.v[2][1] = p1 + s1;
-                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.v[3][1] = p1;
-                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.i[0][1] = p1 - s1;
-                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.i[1][1] = p1 - s1 * cPoint;
-                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.i[2][1] = p1 + s1;
-                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.i[3][1] = p1 + s1 * cPoint;
-                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.o[0][1] = p1 - s1;
-                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.o[1][1] = p1 + s1 * cPoint;
-                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.o[2][1] = p1 + s1;
-                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.o[3][1] = p1 - s1 * cPoint;
-            }
+    EllShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
         }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
 
-        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+        if (this._mdf) {
+          this.convertEllToPath();
+        }
+      },
+      convertEllToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var s0 = this.s.v[0] / 2;
+        var s1 = this.s.v[1] / 2;
+        var _cw = this.d !== 3;
+        var _v = this.v;
+        _v.v[0][0] = p0;
+        _v.v[0][1] = p1 - s1;
+        _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.v[1][1] = p1;
+        _v.v[2][0] = p0;
+        _v.v[2][1] = p1 + s1;
+        _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.v[3][1] = p1;
+        _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.i[0][1] = p1 - s1;
+        _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.i[1][1] = p1 - s1 * cPoint;
+        _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.i[2][1] = p1 + s1;
+        _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.i[3][1] = p1 + s1 * cPoint;
+        _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.o[0][1] = p1 - s1;
+        _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.o[1][1] = p1 + s1 * cPoint;
+        _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.o[2][1] = p1 + s1;
+        _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.o[3][1] = p1 - s1 * cPoint;
+      },
+    };
 
-        return EllShapeProperty;
-    }());
+    extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
 
-    var StarShapeProperty = (function() {
+    return EllShapePropertyFactory;
+  }());
 
-        function StarShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
-                this.convertToPath = this.convertStarToPath;
-            } else {
-                this.convertToPath = this.convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertToPath();
-            }
-        };
+  var StarShapeProperty = (function () {
+    function StarShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 0);
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.data = data;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      if (data.sy === 1) {
+        this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
+        this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
+        this.convertToPath = this.convertStarToPath;
+      } else {
+        this.convertToPath = this.convertPolygonToPath;
+      }
+      this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+      this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
+      this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertToPath();
+      }
+    }
 
-        StarShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function() {
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertToPath();
-                }
-            },
-            convertStarToPath: function() {
-                var numPts = Math.floor(this.pt.v)*2;
-                var angle = Math.PI*2/numPts;
-                /*this.v.v.length = numPts;
+    StarShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertToPath();
+        }
+      },
+      convertStarToPath: function () {
+        var numPts = Math.floor(this.pt.v) * 2;
+        var angle = (Math.PI * 2) / numPts;
+        /* this.v.v.length = numPts;
                 this.v.i.length = numPts;
-                this.v.o.length = numPts;*/
-                var longFlag = true;
-                var longRad = this.or.v;
-                var shortRad = this.ir.v;
-                var longRound = this.os.v;
-                var shortRound = this.is.v;
-                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-                currentAng += this.r.v;
-                var dir = this.data.d === 3 ? -1 : 1;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    rad = longFlag ? longRad : shortRad;
-                    roundness = longFlag ? longRound : shortRound;
-                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
+                this.v.o.length = numPts; */
+        var longFlag = true;
+        var longRad = this.or.v;
+        var shortRad = this.ir.v;
+        var longRound = this.os.v;
+        var shortRound = this.is.v;
+        var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2);
+        var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2);
+        var i;
+        var rad;
+        var roundness;
+        var perimSegment;
+        var currentAng = -Math.PI / 2;
+        currentAng += this.r.v;
+        var dir = this.data.d === 3 ? -1 : 1;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          rad = longFlag ? longRad : shortRad;
+          roundness = longFlag ? longRound : shortRound;
+          perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
 
-                    /*this.v.v[i] = [x,y];
+          /* this.v.v[i] = [x,y];
                     this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
                     this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                    this.v._length = numPts;*/
-                    longFlag = !longFlag;
-                    currentAng += angle*dir;
-                }
-            },
-            convertPolygonToPath: function() {
-                var numPts = Math.floor(this.pt.v);
-                var angle = Math.PI*2/numPts;
-                var rad = this.or.v;
-                var roundness = this.os.v;
-                var perimSegment = 2*Math.PI*rad/(numPts*4);
-                var i, currentAng = -Math.PI/ 2;
-                var dir = this.data.d === 3 ? -1 : 1;
-                currentAng += this.r.v;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
-                    currentAng += angle*dir;
-                }
-                this.paths.length = 0;
-                this.paths[0] = this.v;
-            }
-
+                    this.v._length = numPts; */
+          longFlag = !longFlag;
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
-
-        return StarShapeProperty;
-    }());
-
-    var RectShapeProperty = (function() {
-
-         function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertRectToPath();
-            }
-        };
-
-        RectShapeProperty.prototype = {
-            convertRectToPath: function (){
-                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-                var round = bm_min(v0,v1,this.r.v);
-                var cPoint = round*(1-roundCorner);
-                this.v._length = 0;
-
-                if(this.d === 2 || this.d === 1) {
-                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                    }
-                }else{
-                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                    }
-                }
-            },
-            getValue: function(frameNum){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertRectToPath();
-                }
-
-            },
-            reset: resetShape
+      },
+      convertPolygonToPath: function () {
+        var numPts = Math.floor(this.pt.v);
+        var angle = (Math.PI * 2) / numPts;
+        var rad = this.or.v;
+        var roundness = this.os.v;
+        var perimSegment = (2 * Math.PI * rad) / (numPts * 4);
+        var i;
+        var currentAng = -Math.PI * 0.5;
+        var dir = this.data.d === 3 ? -1 : 1;
+        currentAng += this.r.v;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+        this.paths.length = 0;
+        this.paths[0] = this.v;
+      },
 
-        return RectShapeProperty;
-    }());
+    };
+    extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
 
-    function getShapeProp(elem,data,type){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    }
+    return StarShapePropertyFactory;
+  }());
 
-    function getConstructorFunction() {
-        return ShapeProperty;
-    }
-
-    function getKeyframedConstructorFunction() {
-        return KeyframedShapeProperty;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    ob.getConstructorFunction = getConstructorFunction;
-    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data){
-        return new modifiers[nm](elem, data);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if (!this.closed) {
-        // 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.
-        data.sh.container.addDynamicProperty(data.sh);
-        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
-        this.shapes.push(shapeData);
-        this.addShapeToModifier(shapeData);
-        if (this._isAnimated) {
-            data.setAsAnimated();
-        }
-    }
-};
-ShapeModifier.prototype.init = function(elem,data){
-    this.shapes = [];
-    this.elem = elem;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,data);
-    this.frameId = initialDefaultFrame;
-    this.closed = false;
-    this.k = false;
-    if(this.dynamicProperties.length){
+  var RectShapeProperty = (function () {
+    function RectShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.c = true;
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
+      if (this.dynamicProperties.length) {
         this.k = true;
-    }else{
-        this.getValue(true);
+      } else {
+        this.k = false;
+        this.convertRectToPath();
+      }
     }
+
+    RectShapePropertyFactory.prototype = {
+      convertRectToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var v0 = this.s.v[0] / 2;
+        var v1 = this.s.v[1] / 2;
+        var round = bmMin(v0, v1, this.r.v);
+        var cPoint = round * (1 - roundCorner);
+        this.v._length = 0;
+
+        if (this.d === 2 || this.d === 1) {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
+          this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
+          }
+        } else {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
+          }
+        }
+      },
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertRectToPath();
+        }
+      },
+      reset: resetShape,
+    };
+    extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
+
+    return RectShapePropertyFactory;
+  }());
+
+  function getShapeProp(elem, data, type) {
+    var prop;
+    if (type === 3 || type === 4) {
+      var dataProp = type === 3 ? data.pt : data.ks;
+      var keys = dataProp.k;
+      if (keys.length) {
+        prop = new KeyframedShapeProperty(elem, data, type);
+      } else {
+        prop = new ShapeProperty(elem, data, type);
+      }
+    } else if (type === 5) {
+      prop = new RectShapeProperty(elem, data);
+    } else if (type === 6) {
+      prop = new EllShapeProperty(elem, data);
+    } else if (type === 7) {
+      prop = new StarShapeProperty(elem, data);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  }
+
+  function getConstructorFunction() {
+    return ShapeProperty;
+  }
+
+  function getKeyframedConstructorFunction() {
+    return KeyframedShapeProperty;
+  }
+
+  var ob = {};
+  ob.getShapeProp = getShapeProp;
+  ob.getConstructorFunction = getConstructorFunction;
+  ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
+  return ob;
+}());
+
+/* global shapeCollectionPool, initialDefaultFrame, extendPrototype, DynamicPropertyContainer */
+/* exported ShapeModifiers */
+
+var ShapeModifiers = (function () {
+  var ob = {};
+  var modifiers = {};
+  ob.registerModifier = registerModifier;
+  ob.getModifier = getModifier;
+
+  function registerModifier(nm, factory) {
+    if (!modifiers[nm]) {
+      modifiers[nm] = factory;
+    }
+  }
+
+  function getModifier(nm, elem, data) {
+    return new modifiers[nm](elem, data);
+  }
+
+  return ob;
+}());
+
+function ShapeModifier() {}
+ShapeModifier.prototype.initModifierProperties = function () {};
+ShapeModifier.prototype.addShapeToModifier = function () {};
+ShapeModifier.prototype.addShape = function (data) {
+  if (!this.closed) {
+    // 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.
+    data.sh.container.addDynamicProperty(data.sh);
+    var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() };
+    this.shapes.push(shapeData);
+    this.addShapeToModifier(shapeData);
+    if (this._isAnimated) {
+      data.setAsAnimated();
+    }
+  }
 };
-ShapeModifier.prototype.processKeys = function(){
-    if(this.elem.globalData.frameId === this.frameId){
-        return;
-    }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
+ShapeModifier.prototype.init = function (elem, data) {
+  this.shapes = [];
+  this.elem = elem;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, data);
+  this.frameId = initialDefaultFrame;
+  this.closed = false;
+  this.k = false;
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
+};
+ShapeModifier.prototype.processKeys = function () {
+  if (this.elem.globalData.frameId === this.frameId) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 extendPrototype([DynamicPropertyContainer], ShapeModifier);
-function TrimModifier(){
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, segmentsLengthPool, bez, shapePool, ShapeModifiers */
+
+function TrimModifier() {
 }
 extendPrototype([ShapeModifier], TrimModifier);
-TrimModifier.prototype.initModifierProperties = function(elem, data) {
-    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
-    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
-    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
-    this.sValue = 0;
-    this.eValue = 0;
-    this.getValue = this.processKeys;
-    this.m = data.m;
-    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
+TrimModifier.prototype.initModifierProperties = function (elem, data) {
+  this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
+  this.sValue = 0;
+  this.eValue = 0;
+  this.getValue = this.processKeys;
+  this.m = data.m;
+  this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.addShapeToModifier = function(shapeData){
-    shapeData.pathsData = [];
+TrimModifier.prototype.addShapeToModifier = function (shapeData) {
+  shapeData.pathsData = [];
 };
 
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
+TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
+  var segments = [];
+  if (e <= 1) {
+    segments.push({
+      s: s,
+      e: e,
+    });
+  } else if (s >= 1) {
+    segments.push({
+      s: s - 1,
+      e: e - 1,
+    });
+  } else {
+    segments.push({
+      s: s,
+      e: 1,
+    });
+    segments.push({
+      s: 0,
+      e: e - 1,
+    });
+  }
+  var shapeSegments = [];
+  var i;
+  var len = segments.length;
+  var segmentOb;
+  for (i = 0; i < len; i += 1) {
+    segmentOb = segments[i];
+    if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
+      var shapeS;
+      var shapeE;
+      if (segmentOb.s * totalModifierLength <= addedLength) {
+        shapeS = 0;
+      } else {
+        shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
+      }
+      if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
+        shapeE = 1;
+      } else {
+        shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
+      }
+      shapeSegments.push([shapeS, shapeE]);
+    }
+  }
+  if (!shapeSegments.length) {
+    shapeSegments.push([0, 0]);
+  }
+  return shapeSegments;
+};
+
+TrimModifier.prototype.releasePathsData = function (pathsData) {
+  var i;
+  var len = pathsData.length;
+  for (i = 0; i < len; i += 1) {
+    segmentsLengthPool.release(pathsData[i]);
+  }
+  pathsData.length = 0;
+  return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function (_isFirstFrame) {
+  var s;
+  var e;
+  if (this._mdf || _isFirstFrame) {
+    var o = (this.o.v % 360) / 360;
+    if (o < 0) {
+      o += 1;
+    }
+    if (this.s.v > 1) {
+      s = 1 + o;
+    } else if (this.s.v < 0) {
+      s = 0 + o;
+    } else {
+      s = this.s.v + o;
+    }
+    if (this.e.v > 1) {
+      e = 1 + o;
+    } else if (this.e.v < 0) {
+      e = 0 + o;
+    } else {
+      e = this.e.v + o;
+    }
+
+    if (s > e) {
+      var _s = s;
+      s = e;
+      e = _s;
+    }
+    s = Math.round(s * 10000) * 0.0001;
+    e = Math.round(e * 10000) * 0.0001;
+    this.sValue = s;
+    this.eValue = e;
+  } else {
+    s = this.sValue;
+    e = this.eValue;
+  }
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var pathsData;
+  var pathData;
+  var totalShapeLength;
+  var totalModifierLength = 0;
+
+  if (e === s) {
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].localShapeCollection.releaseShapes();
+      this.shapes[i].shape._mdf = true;
+      this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+      if (this._mdf) {
+        this.shapes[i].pathsData.length = 0;
+      }
+    }
+  } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) {
     var segments = [];
-    if (e <= 1) {
-        segments.push({
-            s: s,
-            e: e
-        });
-    } else if (s >= 1) {
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        });
-    } else {
-        segments.push({
-            s: s,
-            e: 1
-        });
-        segments.push({
-            s: 0,
-            e: e - 1
-        });
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
+    var shapeData;
+    var localShapeCollection;
     for (i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
+      shapeData = this.shapes[i];
+      // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+      if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
+        shapeData.shape.paths = shapeData.localShapeCollection;
+      } else {
+        shapePaths = shapeData.shape.paths;
+        jLen = shapePaths._length;
+        totalShapeLength = 0;
+        if (!shapeData.shape._mdf && shapeData.pathsData.length) {
+          totalShapeLength = shapeData.totalShapeLength;
         } else {
-            var shapeS, shapeE;
-            if (segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
+          pathsData = this.releasePathsData(shapeData.pathsData);
+          for (j = 0; j < jLen; j += 1) {
+            pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
+            pathsData.push(pathData);
+            totalShapeLength += pathData.totalLength;
+          }
+          shapeData.totalShapeLength = totalShapeLength;
+          shapeData.pathsData = pathsData;
         }
+
+        totalModifierLength += totalShapeLength;
+        shapeData.shape._mdf = true;
+      }
     }
-    if (!shapeSegments.length) {
-        shapeSegments.push([0, 0]);
-    }
-    return shapeSegments;
-};
-
-TrimModifier.prototype.releasePathsData = function(pathsData) {
-    var i, len = pathsData.length;
-    for (i = 0; i < len; i += 1) {
-        segments_length_pool.release(pathsData[i]);
-    }
-    pathsData.length = 0;
-    return pathsData;
-};
-
-TrimModifier.prototype.processShapes = function(_isFirstFrame) {
-    var s, e;
-    if (this._mdf || _isFirstFrame) {
-        var o = (this.o.v % 360) / 360;
-        if (o < 0) {
-            o += 1;
-        }
-        s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
-        e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
-        if (s === e) {
-
-        }
-        if (s > e) {
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        s = Math.round(s * 10000) * 0.0001;
-        e = Math.round(e * 10000) * 0.0001;
-        this.sValue = s;
-        this.eValue = e;
-    } else {
-        s = this.sValue;
-        e = this.eValue;
-    }
-    var shapePaths;
-    var i, len = this.shapes.length, j, jLen;
-    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
-
-    if (e === s) {
-        for (i = 0; i < len; i += 1) {
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape._mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-            if (this._mdf) {
-                this.shapes[i].pathsData.length = 0;
-            }
-        }
-    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for (i = 0; i < len; i += 1) {
-            shapeData = this.shapes[i];
-            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
-            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = this.releasePathsData(shapeData.pathsData);
-                    for (j = 0; j < jLen; j += 1) {
-                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape._mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0, edges;
-        for (i = len - 1; i >= 0; i -= 1) {
-            shapeData = this.shapes[i];
-            if (shapeData.shape._mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
-                if (this.m === 2 && len > 1) {
-                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]];
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if (shapeE <= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        });
-                    } else if (shapeS >= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    } else {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        });
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        if (segments.length > 1) {
-                            var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
-                            if (lastShapeInCollection.c) {
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if (this._mdf) {
-        for (i = 0; i < len; i += 1) {
-            //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
-            //Don't remove this even if it's losing cached info.
-            this.shapes[i].pathsData.length = 0;
-            this.shapes[i].shape._mdf = true;
-        }
-    }
-};
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for (i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i]);
-    }
-};
-
-TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
-    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
-    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
-    }
-    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
-    shapePath.setXYAt(points[1], points[5], 'o', pos);
-    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(points[0], points[4], 'v', pos);
-    }
-    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
+    var shapeS = s;
+    var shapeE = e;
     var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if (!shapePath) {
-        shapePath = shape_pool.newElement();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
+    var edges;
+    for (i = len - 1; i >= 0; i -= 1) {
+      shapeData = this.shapes[i];
+      if (shapeData.shape._mdf) {
+        localShapeCollection = shapeData.localShapeCollection;
+        localShapeCollection.releaseShapes();
+        // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+        if (this.m === 2 && len > 1) {
+          edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+          addedLength += shapeData.totalShapeLength;
+        } else {
+          edges = [[shapeS, shapeE]];
+        }
+        jLen = edges.length;
+        for (j = 0; j < jLen; j += 1) {
+          shapeS = edges[j][0];
+          shapeE = edges[j][1];
+          segments.length = 0;
+          if (shapeE <= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength * shapeE,
+            });
+          } else if (shapeS >= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * (shapeS - 1),
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          } else {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength,
+            });
+            segments.push({
+              s: 0,
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          }
+          var newShapesData = this.addShapes(shapeData, segments[0]);
+          if (segments[0].s !== segments[0].e) {
+            if (segments.length > 1) {
+              var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
+              if (lastShapeInCollection.c) {
+                var lastShape = newShapesData.pop();
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
+              } else {
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1]);
+              }
+            }
+            this.addPaths(newShapesData, localShapeCollection);
+          }
+        }
+        shapeData.shape.paths = localShapeCollection;
+      }
     }
-    shapes.push(shapePath);
+  } else if (this._mdf) {
     for (i = 0; i < len; i += 1) {
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for (j = 1; j < jLen; j +=1) {
-            currentLengthData = lengths[j-1];
-            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e) {
-                shapePath.c = false;
-                break;
-            } else {
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if (shapePaths[i].c && lengths.length) {
-            currentLengthData = lengths[j - 1];
-            if (addedLength <= shapeSegment.e) {
-                var segmentLength = lengths[j - 1].addedLength;
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if (shapePath._length) {
-            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
-        }
-        if (addedLength > shapeSegment.e) {
-            break;
-        }
-        if (i < len - 1) {
-            shapePath = shape_pool.newElement();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
+      // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
+      // Don't remove this even if it's losing cached info.
+      this.shapes[i].pathsData.length = 0;
+      this.shapes[i].shape._mdf = true;
     }
-    return shapes;
+  }
 };
 
+TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
+  var i;
+  var len = newPaths.length;
+  for (i = 0; i < len; i += 1) {
+    localShapeCollection.addShape(newPaths[i]);
+  }
+};
+
+TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+  shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+  shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
+  }
+  shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
+  shapePath.setXYAt(points[1], points[5], 'o', pos);
+  shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(points[0], points[4], 'v', pos);
+  }
+  shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
+  var pathsData = shapeData.pathsData;
+  var shapePaths = shapeData.shape.paths.shapes;
+  var i;
+  var len = shapeData.shape.paths._length;
+  var j;
+  var jLen;
+  var addedLength = 0;
+  var currentLengthData;
+  var segmentCount;
+  var lengths;
+  var segment;
+  var shapes = [];
+  var initPos;
+  var newShape = true;
+  if (!shapePath) {
+    shapePath = shapePool.newElement();
+    segmentCount = 0;
+    initPos = 0;
+  } else {
+    segmentCount = shapePath._length;
+    initPos = shapePath._length;
+  }
+  shapes.push(shapePath);
+  for (i = 0; i < len; i += 1) {
+    lengths = pathsData[i].lengths;
+    shapePath.c = shapePaths[i].c;
+    jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
+    for (j = 1; j < jLen; j += 1) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
+        addedLength += currentLengthData.addedLength;
+        shapePath.c = false;
+      } else if (addedLength > shapeSegment.e) {
+        shapePath.c = false;
+        break;
+      } else {
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+        addedLength += currentLengthData.addedLength;
+        segmentCount += 1;
+      }
+    }
+    if (shapePaths[i].c && lengths.length) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength <= shapeSegment.e) {
+        var segmentLength = lengths[j - 1].addedLength;
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+      } else {
+        shapePath.c = false;
+      }
+      addedLength += currentLengthData.addedLength;
+      segmentCount += 1;
+    }
+    if (shapePath._length) {
+      shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+      shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
+    }
+    if (addedLength > shapeSegment.e) {
+      break;
+    }
+    if (i < len - 1) {
+      shapePath = shapePool.newElement();
+      newShape = true;
+      shapes.push(shapePath);
+      segmentCount = 0;
+    }
+  }
+  return shapes;
+};
 
 ShapeModifiers.registerModifier('tm', TrimModifier);
-function RoundCornersModifier(){}
-extendPrototype([ShapeModifier],RoundCornersModifier);
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
-    this._isAnimated = !!this.rd.effectsSequence.length;
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, roundCorner, ShapeModifiers */
+
+function RoundCornersModifier() {}
+extendPrototype([ShapeModifier], RoundCornersModifier);
+RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
+  this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-            }
+RoundCornersModifier.prototype.processPath = function (path, round) {
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var i;
+  var len = path._length;
+  var currentV;
+  var currentI;
+  var currentO;
+  var closerV;
+  var distance;
+  var newPosPerc;
+  var index = 0;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < len; i += 1) {
+    currentV = path.v[i];
+    currentO = path.o[i];
+    currentI = path.i[i];
+    if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
+      if ((i === 0 || i === len - 1) && !path.c) {
+        clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
+        /* clonedPath.v[index] = currentV;
+                clonedPath.o[index] = currentO;
+                clonedPath.i[index] = currentI; */
+        index += 1;
+      } else {
+        if (i === 0) {
+          closerV = path.v[len - 1];
         } else {
-            cloned_path.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);
-            index += 1;
+          closerV = path.v[i - 1];
         }
-    }
-    return cloned_path;
-};
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = iX;
+        iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
+        vY = iY;
+        oX = vX - (vX - currentV[0]) * roundCorner;
+        oY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
 
-RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+        if (i === len - 1) {
+          closerV = path.v[0];
+        } else {
+          closerV = path.v[i + 1];
         }
-
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = oX;
+        oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
+        vY = oY;
+        iX = vX - (vX - currentV[0]) * roundCorner;
+        iY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
+      }
+    } else {
+      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);
+      index += 1;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  return clonedPath;
 };
 
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function PuckerAndBloatModifier(){}
-extendPrototype([ShapeModifier],PuckerAndBloatModifier);
-PuckerAndBloatModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.amount = PropertyFactory.getProp(elem,data.a,0,null,this);
-    this._isAnimated = !!this.amount.effectsSequence.length;
-};
+RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var rd = this.rd.v;
 
-PuckerAndBloatModifier.prototype.processPath = function(path, amount){
-    var percent = amount / 100;
-    var centerPoint = [0, 0];
-    var pathLength = path._length, i = 0;
-    for (i = 0; i < pathLength; i += 1) {
-        centerPoint[0] += path.v[i][0];
-        centerPoint[1] += path.v[i][1];
-    }
-    centerPoint[0] /= pathLength;
-    centerPoint[1] /= pathLength;
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var vX, vY, oX, oY, iX, iY;
-    for(i = 0; i < pathLength; i += 1) {
-        vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
-        vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
-        oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
-        oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
-        iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
-        iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
-        cloned_path.setTripleAt(vX, vY, oX, oY, iX, iY, i);
-    }
-    return cloned_path;
-};
-
-PuckerAndBloatModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var amount = this.amount.v;
-
-    if(amount !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+  if (rd !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
         }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
 };
-ShapeModifiers.registerModifier('pb',PuckerAndBloatModifier);
-function RepeaterModifier(){}
+
+ShapeModifiers.registerModifier('rd', RoundCornersModifier);
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, ShapeModifiers */
+
+function PuckerAndBloatModifier() {}
+extendPrototype([ShapeModifier], PuckerAndBloatModifier);
+PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
+  this._isAnimated = !!this.amount.effectsSequence.length;
+};
+
+PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
+  var percent = amount / 100;
+  var centerPoint = [0, 0];
+  var pathLength = path._length;
+  var i = 0;
+  for (i = 0; i < pathLength; i += 1) {
+    centerPoint[0] += path.v[i][0];
+    centerPoint[1] += path.v[i][1];
+  }
+  centerPoint[0] /= pathLength;
+  centerPoint[1] /= pathLength;
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < pathLength; i += 1) {
+    vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
+    vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
+    oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
+    oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
+    iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
+    iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
+    clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
+  }
+  return clonedPath;
+};
+
+PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var amount = this.amount.v;
+
+  if (amount !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
+        }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
+    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
+};
+ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
+
+/* global extendPrototype, ShapeModifier, TransformPropertyFactory, PropertyFactory, Matrix, ShapeModifiers */
+
+function RepeaterModifier() {}
 extendPrototype([ShapeModifier], RepeaterModifier);
 
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
-    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
-    this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
-    this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
-    this.data = data;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this._isAnimated = !!this.dynamicProperties.length;
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
+RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
+  this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
+  this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
+  this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
+  this.data = data;
+  if (!this.dynamicProperties.length) {
+    this.getValue(true);
+  }
+  this._isAnimated = !!this.dynamicProperties.length;
+  this.pMatrix = new Matrix();
+  this.rMatrix = new Matrix();
+  this.sMatrix = new Matrix();
+  this.tMatrix = new Matrix();
+  this.matrix = new Matrix();
 };
 
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
+  var dir = inv ? -1 : 1;
+  var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
+  var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
+  pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
+  rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  rMatrix.rotate(-transform.r.v * dir * perc);
+  rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+  sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
+  sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
 };
 
-RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
-    this.elem = elem;
-    this.arr = arr;
-    this.pos = pos;
-    this.elemsData = elemsData;
-    this._currentCopies = 0;
-    this._elements = [];
-    this._groups = [];
-    this.frameId = -1;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,arr[pos]);
-    var cont = 0;
-    while(pos>0){
-        pos -= 1;
-        //this._elements.unshift(arr.splice(pos,1)[0]);
-        this._elements.unshift(arr[pos]);
-        cont += 1;
-    }
-    if(this.dynamicProperties.length){
-        this.k = true;
-    }else{
-        this.getValue(true);
-    }
+RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
+  this.elem = elem;
+  this.arr = arr;
+  this.pos = pos;
+  this.elemsData = elemsData;
+  this._currentCopies = 0;
+  this._elements = [];
+  this._groups = [];
+  this.frameId = -1;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, arr[pos]);
+  while (pos > 0) {
+    pos -= 1;
+    // this._elements.unshift(arr.splice(pos,1)[0]);
+    this._elements.unshift(arr[pos]);
+  }
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
 };
 
-RepeaterModifier.prototype.resetElements = function(elements){
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._processed = false;
-        if(elements[i].ty === 'gr'){
-            this.resetElements(elements[i].it);
+RepeaterModifier.prototype.resetElements = function (elements) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._processed = false;
+    if (elements[i].ty === 'gr') {
+      this.resetElements(elements[i].it);
+    }
+  }
+};
+
+RepeaterModifier.prototype.cloneElements = function (elements) {
+  var newElements = JSON.parse(JSON.stringify(elements));
+  this.resetElements(newElements);
+  return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._render = renderFlag;
+    if (elements[i].ty === 'gr') {
+      this.changeGroupRender(elements[i].it, renderFlag);
+    }
+  }
+};
+
+RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
+  var items;
+  var itemsTransform;
+  var i;
+  var dir;
+  var cont;
+  if (this._mdf || _isFirstFrame) {
+    var copies = Math.ceil(this.c.v);
+    if (this._groups.length < copies) {
+      while (this._groups.length < copies) {
+        var group = {
+          it: this.cloneElements(this._elements),
+          ty: 'gr',
+        };
+        group.it.push({
+          a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr',
+        });
+
+        this.arr.splice(0, 0, group);
+        this._groups.splice(0, 0, group);
+        this._currentCopies += 1;
+      }
+      this.elem.reloadShapes();
+    }
+    cont = 0;
+    var renderFlag;
+    for (i = 0; i <= this._groups.length - 1; i += 1) {
+      renderFlag = cont < copies;
+      this._groups[i]._render = renderFlag;
+      this.changeGroupRender(this._groups[i].it, renderFlag);
+      cont += 1;
+    }
+
+    this._currentCopies = copies;
+    /// /
+
+    var offset = this.o.v;
+    var offsetModulo = offset % 1;
+    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+    var pProps = this.pMatrix.props;
+    var rProps = this.rMatrix.props;
+    var sProps = this.sMatrix.props;
+    this.pMatrix.reset();
+    this.rMatrix.reset();
+    this.sMatrix.reset();
+    this.tMatrix.reset();
+    this.matrix.reset();
+    var iteration = 0;
+
+    if (offset > 0) {
+      while (iteration < roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+        iteration += 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+        iteration += offsetModulo;
+      }
+    } else if (offset < 0) {
+      while (iteration > roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+        iteration -= 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
+        iteration -= offsetModulo;
+      }
+    }
+    i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+    dir = this.data.m === 1 ? 1 : -1;
+    cont = this._currentCopies;
+    var j;
+    var jLen;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      jLen = itemsTransform.length;
+      items[items.length - 1].transform.mProps._mdf = true;
+      items[items.length - 1].transform.op._mdf = true;
+      items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
+      if (iteration !== 0) {
+        if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
+          this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
         }
-    }
-};
+        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]);
+        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]);
+        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]);
 
-RepeaterModifier.prototype.cloneElements = function(elements){
-    var i, len = elements.length;
-    var newElements = JSON.parse(JSON.stringify(elements));
-    this.resetElements(newElements);
-    return newElements;
-};
-
-RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._render = renderFlag;
-        if(elements[i].ty === 'gr') {
-            this.changeGroupRender(elements[i].it, renderFlag);
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-    }
-};
-
-RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
-    var items, itemsTransform, i, dir, cont;
-    if(this._mdf || _isFirstFrame){
-        var copies = Math.ceil(this.c.v);
-        if(this._groups.length < copies){
-            while(this._groups.length < copies){
-                var group = {
-                    it:this.cloneElements(this._elements),
-                    ty:'gr'
-                };
-                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
-                
-                this.arr.splice(0,0,group);
-                this._groups.splice(0,0,group);
-                this._currentCopies += 1;
-            }
-            this.elem.reloadShapes();
-        }
-        cont = 0;
-        var renderFlag;
-        for(i = 0; i  <= this._groups.length - 1; i += 1){
-            renderFlag = cont < copies;
-            this._groups[i]._render = renderFlag;
-            this.changeGroupRender(this._groups[i].it, renderFlag);
-            cont += 1;
-        }
-        
-        this._currentCopies = copies;
-        ////
-
-        var offset = this.o.v;
-        var offsetModulo = offset%1;
-        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-        var k;
-        var tMat = this.tr.v.props;
-        var pProps = this.pMatrix.props;
-        var rProps = this.rMatrix.props;
-        var sProps = this.sMatrix.props;
-        this.pMatrix.reset();
-        this.rMatrix.reset();
-        this.sMatrix.reset();
-        this.tMatrix.reset();
         this.matrix.reset();
-        var iteration = 0;
-
-        if(offset > 0) {
-            while(iteration<roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                iteration += 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                iteration += offsetModulo;
-            }
-        } else if(offset < 0) {
-            while(iteration>roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                iteration -= 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                iteration -= offsetModulo;
-            }
+      } else {
+        this.matrix.reset();
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
-        dir = this.data.m === 1 ? 1 : -1;
-        cont = this._currentCopies;
-        var j, jLen;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            jLen = itemsTransform.length;
-            items[items.length - 1].transform.mProps._mdf = true;
-            items[items.length - 1].transform.op._mdf = true;
-            items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
-            if(iteration !== 0){
-                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                }
-                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]);
-                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]);
-                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]);
-                
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-                this.matrix.reset();
-            } else {
-                this.matrix.reset();
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-            }
-            iteration += 1;
-            cont -= 1;
-            i += dir;
-        }
-    } else {
-        cont = this._currentCopies;
-        i = 0;
-        dir = 1;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            items[items.length - 1].transform.mProps._mdf = false;
-            items[items.length - 1].transform.op._mdf = false;
-            cont -= 1;
-            i += dir;
-        }
+      }
+      iteration += 1;
+      cont -= 1;
+      i += dir;
     }
+  } else {
+    cont = this._currentCopies;
+    i = 0;
+    dir = 1;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      items[items.length - 1].transform.mProps._mdf = false;
+      items[items.length - 1].transform.op._mdf = false;
+      cont -= 1;
+      i += dir;
+    }
+  }
 };
 
-RepeaterModifier.prototype.addShape = function(){};
+RepeaterModifier.prototype.addShape = function () {};
 
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = createSizedArray(this._maxLength);
+ShapeModifiers.registerModifier('rp', RepeaterModifier);
+
+/* global createSizedArray, shapePool */
+
+function ShapeCollection() {
+  this._length = 0;
+  this._maxLength = 4;
+  this.shapes = createSizedArray(this._maxLength);
 }
 
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
+ShapeCollection.prototype.addShape = function (shapeData) {
+  if (this._length === this._maxLength) {
+    this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
+    this._maxLength *= 2;
+  }
+  this.shapes[this._length] = shapeData;
+  this._length += 1;
 };
 
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
+ShapeCollection.prototype.releaseShapes = function () {
+  var i;
+  for (i = 0; i < this._length; i += 1) {
+    shapePool.release(this.shapes[i]);
+  }
+  this._length = 0;
 };
+
+/* global createSizedArray, createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
 function DashProperty(elem, data, renderer, container) {
-    this.elem = elem;
-    this.frameId = -1;
-    this.dataProps = createSizedArray(data.length);
-    this.renderer = renderer;
-    this.k = false;
-    this.dashStr = '';
-    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
-    this.dashoffset = createTypedArray('float32',  1);
-    this.initDynamicPropertyContainer(container);
-    var i, len = data.length || 0, prop;
-    for(i = 0; i < len; i += 1) {
-        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
-        this.k = prop.k || this.k;
-        this.dataProps[i] = {n:data[i].n,p:prop};
-    }
-    if(!this.k){
-        this.getValue(true);
-    }
-    this._isAnimated = this.k;
+  this.elem = elem;
+  this.frameId = -1;
+  this.dataProps = createSizedArray(data.length);
+  this.renderer = renderer;
+  this.k = false;
+  this.dashStr = '';
+  this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
+  this.dashoffset = createTypedArray('float32', 1);
+  this.initDynamicPropertyContainer(container);
+  var i;
+  var len = data.length || 0;
+  var prop;
+  for (i = 0; i < len; i += 1) {
+    prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
+    this.k = prop.k || this.k;
+    this.dataProps[i] = { n: data[i].n, p: prop };
+  }
+  if (!this.k) {
+    this.getValue(true);
+  }
+  this._isAnimated = this.k;
 }
 
-DashProperty.prototype.getValue = function(forceRender) {
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
+DashProperty.prototype.getValue = function (forceRender) {
+  if (this.elem.globalData.frameId === this.frameId && !forceRender) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
+  this._mdf = this._mdf || forceRender;
+  if (this._mdf) {
+    var i = 0;
+    var len = this.dataProps.length;
+    if (this.renderer === 'svg') {
+      this.dashStr = '';
     }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
-    this._mdf = this._mdf || forceRender;
-    if (this._mdf) {
-        var i = 0, len = this.dataProps.length;
-        if(this.renderer === 'svg') {
-            this.dashStr = '';
+    for (i = 0; i < len; i += 1) {
+      if (this.dataProps[i].n !== 'o') {
+        if (this.renderer === 'svg') {
+          this.dashStr += ' ' + this.dataProps[i].p.v;
+        } else {
+          this.dashArray[i] = this.dataProps[i].p.v;
         }
-        for(i=0;i<len;i+=1){
-            if(this.dataProps[i].n != 'o'){
-                if(this.renderer === 'svg') {
-                    this.dashStr += ' ' + this.dataProps[i].p.v;
-                }else{
-                    this.dashArray[i] = this.dataProps[i].p.v;
-                }
-            }else{
-                this.dashoffset[0] = this.dataProps[i].p.v;
-            }
-        }
+      } else {
+        this.dashoffset[0] = this.dataProps[i].p.v;
+      }
     }
+  }
 };
 extendPrototype([DynamicPropertyContainer], DashProperty);
-function GradientProperty(elem,data,container){
-    this.data = data;
-    this.c = createTypedArray('uint8c', data.p*4);
-    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-    this.o = createTypedArray('float32', cLength);
-    this._cmdf = false;
-    this._omdf = false;
-    this._collapsable = this.checkCollapsable();
-    this._hasOpacity = cLength;
-    this.initDynamicPropertyContainer(container);
-    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
-    this.k = this.prop.k;
-    this.getValue(true);
+
+/* global createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+function GradientProperty(elem, data, container) {
+  this.data = data;
+  this.c = createTypedArray('uint8c', data.p * 4);
+  var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;
+  this.o = createTypedArray('float32', cLength);
+  this._cmdf = false;
+  this._omdf = false;
+  this._collapsable = this.checkCollapsable();
+  this._hasOpacity = cLength;
+  this.initDynamicPropertyContainer(container);
+  this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
+  this.k = this.prop.k;
+  this.getValue(true);
 }
 
-GradientProperty.prototype.comparePoints = function(values, points) {
-    var i = 0, len = this.o.length/2, diff;
-    while(i < len) {
-        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
-        if(diff > 0.01){
-            return false;
-        }
-        i += 1;
+GradientProperty.prototype.comparePoints = function (values, points) {
+  var i = 0;
+  var len = this.o.length / 2;
+  var diff;
+  while (i < len) {
+    diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
+    if (diff > 0.01) {
+      return false;
     }
-    return true;
+    i += 1;
+  }
+  return true;
 };
 
-GradientProperty.prototype.checkCollapsable = function() {
-    if (this.o.length/2 !== this.c.length/4) {
+GradientProperty.prototype.checkCollapsable = function () {
+  if (this.o.length / 2 !== this.c.length / 4) {
+    return false;
+  }
+  if (this.data.k.k[0].s) {
+    var i = 0;
+    var len = this.data.k.k.length;
+    while (i < len) {
+      if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
         return false;
+      }
+      i += 1;
     }
-    if (this.data.k.k[0].s) {
-        var i = 0, len = this.data.k.k.length;
-        while (i < len) {
-            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
-                return false;
-            }
-            i += 1;
-        }
-    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
-        return false;
-    }
-    return true;
+  } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
+    return false;
+  }
+  return true;
 };
 
-GradientProperty.prototype.getValue = function(forceRender){
-    this.prop.getValue();
-    this._mdf = false;
-    this._cmdf = false;
-    this._omdf = false;
-    if(this.prop._mdf || forceRender){
-        var i, len = this.data.p*4;
-        var mult, val;
-        for(i=0;i<len;i+=1){
-            mult = i%4 === 0 ? 100 : 255;
-            val = Math.round(this.prop.v[i]*mult);
-            if(this.c[i] !== val){
-                this.c[i] = val;
-                this._cmdf = !forceRender;
-            }
-        }
-        if(this.o.length){
-            len = this.prop.v.length;
-            for(i=this.data.p*4;i<len;i+=1){
-                mult = i%2 === 0 ? 100 : 1;
-                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                if(this.o[i-this.data.p*4] !== val){
-                    this.o[i-this.data.p*4] = val;
-                    this._omdf = !forceRender;
-                }
-            }
-        }
-        this._mdf = !forceRender;
+GradientProperty.prototype.getValue = function (forceRender) {
+  this.prop.getValue();
+  this._mdf = false;
+  this._cmdf = false;
+  this._omdf = false;
+  if (this.prop._mdf || forceRender) {
+    var i;
+    var len = this.data.p * 4;
+    var mult;
+    var val;
+    for (i = 0; i < len; i += 1) {
+      mult = i % 4 === 0 ? 100 : 255;
+      val = Math.round(this.prop.v[i] * mult);
+      if (this.c[i] !== val) {
+        this.c[i] = val;
+        this._cmdf = !forceRender;
+      }
     }
+    if (this.o.length) {
+      len = this.prop.v.length;
+      for (i = this.data.p * 4; i < len; i += 1) {
+        mult = i % 2 === 0 ? 100 : 1;
+        val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
+        if (this.o[i - this.data.p * 4] !== val) {
+          this.o[i - this.data.p * 4] = val;
+          this._omdf = !forceRender;
+        }
+      }
+    }
+    this._mdf = !forceRender;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], GradientProperty);
-var buildShapeString = function(pathNodes, length, closed, mat) {
-	if(length === 0) {
-            return '';
-        }
-        var _o = pathNodes.o;
-        var _i = pathNodes.i;
-        var _v = pathNodes.v;
-        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
-        for(i = 1; i < length; i += 1) {
-            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]);
-        }
-        if (closed && length) {
-            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]);
-            shapeString += 'z';
-        }
-        return shapeString;
-}
-var audioControllerFactory = (function() {
 
-	function AudioController(audioFactory) {
-		this.audios = [];
-		this.audioFactory = audioFactory;
-		this._volume = 1;
-		this._isMuted = false;
-	}
+/* exported buildShapeString */
 
-	AudioController.prototype = {
-		addAudio: function(audio) {
-			this.audios.push(audio);
-		},
-		pause: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].pause()
-			}
-		},
-		resume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].resume()
-			}
-		},
-		setRate: function(rateValue) {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].setRate(rateValue)
-			}
-		},
-		createAudio: function(assetPath) {
-			if (this.audioFactory) {
-				return this.audioFactory(assetPath);
-			} else if (Howl) {
-				return new Howl({
-					src: [assetPath]
-				})
-			} else {
-				return {
-					isPlaying: false,
-					play: function(){this.isPlaying = true},
-					seek: function(){this.isPlaying = false},
-					playing: function(){},
-					rate: function(){},
-					setVolume: function(){},
-				}
-			}
-		},
-		setAudioFactory: function(audioFactory) {
-			this.audioFactory = audioFactory;
-		},
-		setVolume: function(value) {
-			this._volume = value;
-			this._updateVolume();
-		},
-		mute: function() {
-			this._isMuted = true;
-			this._updateVolume();
-		},
-		unmute: function() {
-			this._isMuted = false;
-			this._updateVolume();
-		},
-		getVolume: function(value) {
-			return this._volume;
-		},
-		_updateVolume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1))
-			}
-		}
-	}
-
-	return function() {
-		return new AudioController()
-	}
-
-}())
-var ImagePreloader = (function(){
-
-    var proxyImage = (function(){
-        var canvas = createTag('canvas');
-        canvas.width = 1;
-        canvas.height = 1;
-        var ctx = canvas.getContext('2d');
-        ctx.fillStyle = 'rgba(0,0,0,0)';
-        ctx.fillRect(0, 0, 1, 1);
-        return canvas;
-    }())
-
-    function imageLoaded(){
-        this.loadedAssets += 1;
-        if(this.loadedAssets === this.totalImages){
-            if(this.imagesLoadedCb) {
-                this.imagesLoadedCb(null);
-            }
-        }
-    }
-
-    function getAssetsPath(assetData, assetsPath, original_path) {
-        var path = '';
-        if (assetData.e) {
-            path = assetData.p;
-        } else if(assetsPath) {
-            var imagePath = assetData.p;
-            if (imagePath.indexOf('images/') !== -1) {
-                imagePath = imagePath.split('/')[1];
-            }
-            path = assetsPath + imagePath;
-        } else {
-            path = original_path;
-            path += assetData.u ? assetData.u : '';
-            path += assetData.p;
-        }
-        return path;
-    }
-
-    function testImageLoaded(img) {
-        var _count = 0;
-        var intervalId = setInterval(function() {
-            var box = img.getBBox();
-            if (box.width || _count > 500) {
-                this._imageLoaded();
-                clearInterval(intervalId);
-            }
-            _count += 1;
-        }.bind(this), 50)
-    }
-
-    function createImageData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createNS('image');
-        if (isSafari) {
-            this.testImageLoaded(img)
-        } else {
-            img.addEventListener('load', this._imageLoaded, false);
-        }
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.setAttributeNS('http://www.w3.org/1999/xlink','href', path);
-        this._elementHelper.append(img);
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function createImgData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createTag('img');
-        img.crossOrigin = 'anonymous';
-        img.addEventListener('load', this._imageLoaded, false);
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.src = path;
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function loadAssets(assets, cb){
-        this.imagesLoadedCb = cb;
-        var i, len = assets.length;
-        for (i = 0; i < len; i += 1) {
-            if(!assets[i].layers){
-                this.totalImages += 1;
-                this.images.push(this._createImageData(assets[i]));
-            }
-        }
-    }
-
-    function setPath(path){
-        this.path = path || '';
-    }
-
-    function setAssetsPath(path){
-        this.assetsPath = path || '';
-    }
-
-    function getImage(assetData) {
-        var i = 0, len = this.images.length;
-        while (i < len) {
-            if (this.images[i].assetData === assetData) {
-                return this.images[i].img;
-            }
-            i += 1;
-        }
-    }
-
-    function destroy() {
-        this.imagesLoadedCb = null;
-        this.images.length = 0;
-    }
-
-    function loaded() {
-        return this.totalImages === this.loadedAssets;
-    }
-
-    function setCacheType(type, elementHelper) {
-        if (type === 'svg') {
-            this._elementHelper = elementHelper;
-            this._createImageData = this.createImageData.bind(this);
-        } else {
-            this._createImageData = this.createImgData.bind(this);
-        }
-    }
-
-    function ImagePreloader(type){
-        this._imageLoaded = imageLoaded.bind(this);
-        this.testImageLoaded = testImageLoaded.bind(this);
-        this.assetsPath = '';
-        this.path = '';
-        this.totalImages = 0;
-        this.loadedAssets = 0;
-        this.imagesLoadedCb = null;
-        this.images = [];
-    };
-
-    ImagePreloader.prototype = {
-        loadAssets: loadAssets,
-        setAssetsPath: setAssetsPath,
-        setPath: setPath,
-        loaded: loaded,
-        destroy: destroy,
-        getImage: getImage,
-        createImgData: createImgData,
-        createImageData: createImageData,
-        imageLoaded: imageLoaded,
-        setCacheType: setCacheType,
-    }
-
-    return ImagePreloader;
-}());
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	};
-	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)) {
-	   ob.maskType = false;
-	}
-	return ob;
-}());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
-
-	function createFilter(filId){
-        	var fil = createNS('filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
-
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = createNS('feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
-                return feColorMatrix;
-	}
-
-	return ob;
-}());
-var assetLoader = (function(){
-
-	function formatResponse(xhr) {
-		if(xhr.response && typeof xhr.response === 'object') {
-			return xhr.response;
-		} else if(xhr.response && typeof xhr.response === 'string') {
-			return JSON.parse(xhr.response);
-		} else if(xhr.responseText) {
-			return JSON.parse(xhr.responseText);
-		}
-	}
-
-	function loadAsset(path, callback, errorCallback) {
-		var response;
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', path, true);
-		// set responseType after calling open or IE will break.
-		try {
-		    // This crashes on Android WebView prior to KitKat
-		    xhr.responseType = "json";
-		} catch (err) {}
-	    xhr.send();
-	    xhr.onreadystatechange = function () {
-	        if (xhr.readyState == 4) {
-	            if(xhr.status == 200){
-	            	response = formatResponse(xhr);
-	            	callback(response);
-	            }else{
-	                try{
-	            		response = formatResponse(xhr);
-	            		callback(response);
-	                }catch(err){
-	                	if(errorCallback) {
-	                		errorCallback(err);
-	                	}
-	                }
-	            }
-	        }
-	    };
-	}
-	return {
-		load: loadAsset
-	}
-}())
-
-function TextAnimatorProperty(textData, renderType, elem){
-    this._isFirstFrame = true;
-	this._hasMaskedPath = false;
-	this._frameId = -1;
-	this._textData = textData;
-	this._renderType = renderType;
-    this._elem = elem;
-	this._animatorsData = createSizedArray(this._textData.a.length);
-	this._pathData = {};
-	this._moreOptions = {
-		alignment: {}
-	};
-	this.renderedLetters = [];
-    this.lettersChangedFlag = false;
-    this.initDynamicPropertyContainer(elem);
-
-}
-
-TextAnimatorProperty.prototype.searchProperties = function(){
-    var i, len = this._textData.a.length, animatorProps;
-    var getProp = PropertyFactory.getProp;
-    for(i=0;i<len;i+=1){
-        animatorProps = this._textData.a[i];
-        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
-    }
-    if(this._textData.p && 'm' in this._textData.p){
-        this._pathData = {
-            f: getProp(this._elem,this._textData.p.f,0,0,this),
-            l: getProp(this._elem,this._textData.p.l,0,0,this),
-            r: this._textData.p.r,
-            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
-        };
-        this._hasMaskedPath = true;
-    } else {
-        this._hasMaskedPath = false;
-    }
-    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+var buildShapeString = function (pathNodes, length, closed, mat) {
+  if (length === 0) {
+    return '';
+  }
+  var _o = pathNodes.o;
+  var _i = pathNodes.i;
+  var _v = pathNodes.v;
+  var i;
+  var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+  for (i = 1; i < length; i += 1) {
+    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]);
+  }
+  if (closed && length) {
+    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]);
+    shapeString += 'z';
+  }
+  return shapeString;
 };
 
-TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
-    this.lettersChangedFlag = lettersChangedFlag;
-    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
-        return;
+/* global Howl */
+/* exported audioControllerFactory */
+
+var audioControllerFactory = (function () {
+  function AudioController(audioFactory) {
+    this.audios = [];
+    this.audioFactory = audioFactory;
+    this._volume = 1;
+    this._isMuted = false;
+  }
+
+  AudioController.prototype = {
+    addAudio: function (audio) {
+      this.audios.push(audio);
+    },
+    pause: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].pause();
+      }
+    },
+    resume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].resume();
+      }
+    },
+    setRate: function (rateValue) {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].setRate(rateValue);
+      }
+    },
+    createAudio: function (assetPath) {
+      if (this.audioFactory) {
+        return this.audioFactory(assetPath);
+      } if (Howl) {
+        return new Howl({
+          src: [assetPath],
+        });
+      }
+      return {
+        isPlaying: false,
+        play: function () { this.isPlaying = true; },
+        seek: function () { this.isPlaying = false; },
+        playing: function () {},
+        rate: function () {},
+        setVolume: function () {},
+      };
+    },
+    setAudioFactory: function (audioFactory) {
+      this.audioFactory = audioFactory;
+    },
+    setVolume: function (value) {
+      this._volume = value;
+      this._updateVolume();
+    },
+    mute: function () {
+      this._isMuted = true;
+      this._updateVolume();
+    },
+    unmute: function () {
+      this._isMuted = false;
+      this._updateVolume();
+    },
+    getVolume: function () {
+      return this._volume;
+    },
+    _updateVolume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
+      }
+    },
+  };
+
+  return function () {
+    return new AudioController();
+  };
+}());
+
+/* global createTag, createNS, isSafari */
+/* exported ImagePreloader */
+
+var ImagePreloader = (function () {
+  var proxyImage = (function () {
+    var canvas = createTag('canvas');
+    canvas.width = 1;
+    canvas.height = 1;
+    var ctx = canvas.getContext('2d');
+    ctx.fillStyle = 'rgba(0,0,0,0)';
+    ctx.fillRect(0, 0, 1, 1);
+    return canvas;
+  }());
+
+  function imageLoaded() {
+    this.loadedAssets += 1;
+    if (this.loadedAssets === this.totalImages) {
+      if (this.imagesLoadedCb) {
+        this.imagesLoadedCb(null);
+      }
     }
-    this._isFirstFrame = false;
-    var alignment = this._moreOptions.alignment.v;
-    var animators = this._animatorsData;
-    var textData = this._textData;
-    var matrixHelper = this.mHelper;
-    var renderType = this._renderType;
-    var renderedLettersCount = this.renderedLetters.length;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
-    if(this._hasMaskedPath) {
-        mask = this._pathData.m;
-        if(!this._pathData.n || this._pathData._mdf){
-            var paths = mask.v;
-            if(this._pathData.r){
-                paths = paths.reverse();
-            }
-            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
-            pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths._length - 1;
-            var bezierData;
-            totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            this._pathData.pi = pathInfo;
-        }
-        pathInfo = this._pathData.pi;
+  }
 
-        currentLength = this._pathData.f.v;
-        segmentInd = 0;
-        pointInd = 1;
-        segmentLength = 0;
-        flag = true;
-        segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].points;
-                    pointInd = points.length - 1;
-                }
-            }
+  function getAssetsPath(assetData, assetsPath, originalPath) {
+    var path = '';
+    if (assetData.e) {
+      path = assetData.p;
+    } else if (assetsPath) {
+      var imagePath = assetData.p;
+      if (imagePath.indexOf('images/') !== -1) {
+        imagePath = imagePath.split('/')[1];
+      }
+      path = assetsPath + imagePath;
+    } else {
+      path = originalPath;
+      path += assetData.u ? assetData.u : '';
+      path += assetData.p;
+    }
+    return path;
+  }
 
+  function testImageLoaded(img) {
+    var _count = 0;
+    var intervalId = setInterval(function () {
+      var box = img.getBBox();
+      if (box.width || _count > 500) {
+        this._imageLoaded();
+        clearInterval(intervalId);
+      }
+      _count += 1;
+    }.bind(this), 50);
+  }
+
+  function createImageData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createNS('image');
+    if (isSafari) {
+      this.testImageLoaded(img);
+    } else {
+      img.addEventListener('load', this._imageLoaded, false);
+    }
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
+    this._elementHelper.append(img);
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function createImgData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createTag('img');
+    img.crossOrigin = 'anonymous';
+    img.addEventListener('load', this._imageLoaded, false);
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.src = path;
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function loadAssets(assets, cb) {
+    this.imagesLoadedCb = cb;
+    var i;
+    var len = assets.length;
+    for (i = 0; i < len; i += 1) {
+      if (!assets[i].layers) {
+        this.totalImages += 1;
+        this.images.push(this._createImageData(assets[i]));
+      }
+    }
+  }
+
+  function setPath(path) {
+    this.path = path || '';
+  }
+
+  function setAssetsPath(path) {
+    this.assetsPath = path || '';
+  }
+
+  function getImage(assetData) {
+    var i = 0;
+    var len = this.images.length;
+    while (i < len) {
+      if (this.images[i].assetData === assetData) {
+        return this.images[i].img;
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function destroy() {
+    this.imagesLoadedCb = null;
+    this.images.length = 0;
+  }
+
+  function loaded() {
+    return this.totalImages === this.loadedAssets;
+  }
+
+  function setCacheType(type, elementHelper) {
+    if (type === 'svg') {
+      this._elementHelper = elementHelper;
+      this._createImageData = this.createImageData.bind(this);
+    } else {
+      this._createImageData = this.createImgData.bind(this);
+    }
+  }
+
+  function ImagePreloaderFactory() {
+    this._imageLoaded = imageLoaded.bind(this);
+    this.testImageLoaded = testImageLoaded.bind(this);
+    this.assetsPath = '';
+    this.path = '';
+    this.totalImages = 0;
+    this.loadedAssets = 0;
+    this.imagesLoadedCb = null;
+    this.images = [];
+  }
+
+  ImagePreloaderFactory.prototype = {
+    loadAssets: loadAssets,
+    setAssetsPath: setAssetsPath,
+    setPath: setPath,
+    loaded: loaded,
+    destroy: destroy,
+    getImage: getImage,
+    createImgData: createImgData,
+    createImageData: createImageData,
+    imageLoaded: imageLoaded,
+    setCacheType: setCacheType,
+  };
+
+  return ImagePreloaderFactory;
+}());
+
+/* exported featureSupport */
+
+var featureSupport = (function () {
+  var ob = {
+    maskType: true,
+  };
+  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)) {
+    ob.maskType = false;
+  }
+  return ob;
+}());
+
+/* global createNS */
+/* exported filtersFactory */
+
+var filtersFactory = (function () {
+  var ob = {};
+  ob.createFilter = createFilter;
+  ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
+
+  function createFilter(filId) {
+    var fil = createNS('filter');
+    fil.setAttribute('id', filId);
+    fil.setAttribute('filterUnits', 'objectBoundingBox');
+    fil.setAttribute('x', '0%');
+    fil.setAttribute('y', '0%');
+    fil.setAttribute('width', '100%');
+    fil.setAttribute('height', '100%');
+    return fil;
+  }
+
+  function createAlphaToLuminanceFilter() {
+    var feColorMatrix = createNS('feColorMatrix');
+    feColorMatrix.setAttribute('type', 'matrix');
+    feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+    feColorMatrix.setAttribute('values', '0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
+    return feColorMatrix;
+  }
+
+  return ob;
+}());
+
+/* exported assetLoader */
+
+var assetLoader = (function () {
+  function formatResponse(xhr) {
+    if (xhr.response && typeof xhr.response === 'object') {
+      return xhr.response;
+    } if (xhr.response && typeof xhr.response === 'string') {
+      return JSON.parse(xhr.response);
+    } if (xhr.responseText) {
+      return JSON.parse(xhr.responseText);
+    }
+    return null;
+  }
+
+  function loadAsset(path, callback, errorCallback) {
+    var response;
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', path, true);
+    // set responseType after calling open or IE will break.
+    try {
+      // This crashes on Android WebView prior to KitKat
+      xhr.responseType = 'json';
+    } catch (err) {} // eslint-disable-line no-empty
+    xhr.send();
+    xhr.onreadystatechange = function () {
+      if (xhr.readyState === 4) {
+        if (xhr.status === 200) {
+          response = formatResponse(xhr);
+          callback(response);
+        } else {
+          try {
+            response = formatResponse(xhr);
+            callback(response);
+          } catch (err) {
+            if (errorCallback) {
+              errorCallback(err);
+            }
+          }
         }
+      }
+    };
+  }
+  return {
+    load: loadAsset,
+  };
+}());
+
+/* global createSizedArray, PropertyFactory, TextAnimatorDataProperty, bez, addHueToRGB,
+  addSaturationToRGB, addBrightnessToRGB, LetterProps, Matrix, extendPrototype, DynamicPropertyContainer */
+
+function TextAnimatorProperty(textData, renderType, elem) {
+  this._isFirstFrame = true;
+  this._hasMaskedPath = false;
+  this._frameId = -1;
+  this._textData = textData;
+  this._renderType = renderType;
+  this._elem = elem;
+  this._animatorsData = createSizedArray(this._textData.a.length);
+  this._pathData = {};
+  this._moreOptions = {
+    alignment: {},
+  };
+  this.renderedLetters = [];
+  this.lettersChangedFlag = false;
+  this.initDynamicPropertyContainer(elem);
+}
+
+TextAnimatorProperty.prototype.searchProperties = function () {
+  var i;
+  var len = this._textData.a.length;
+  var animatorProps;
+  var getProp = PropertyFactory.getProp;
+  for (i = 0; i < len; i += 1) {
+    animatorProps = this._textData.a[i];
+    this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+  }
+  if (this._textData.p && 'm' in this._textData.p) {
+    this._pathData = {
+      f: getProp(this._elem, this._textData.p.f, 0, 0, this),
+      l: getProp(this._elem, this._textData.p.l, 0, 0, this),
+      r: this._textData.p.r,
+      m: this._elem.maskManager.getMaskProperty(this._textData.p.m),
+    };
+    this._hasMaskedPath = true;
+  } else {
+    this._hasMaskedPath = false;
+  }
+  this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
+};
+
+TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
+  this.lettersChangedFlag = lettersChangedFlag;
+  if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+    return;
+  }
+  this._isFirstFrame = false;
+  var alignment = this._moreOptions.alignment.v;
+  var animators = this._animatorsData;
+  var textData = this._textData;
+  var matrixHelper = this.mHelper;
+  var renderType = this._renderType;
+  var renderedLettersCount = this.renderedLetters.length;
+  var xPos;
+  var yPos;
+  var i;
+  var len;
+  var letters = documentData.l;
+  var pathInfo;
+  var currentLength;
+  var currentPoint;
+  var segmentLength;
+  var flag;
+  var pointInd;
+  var segmentInd;
+  var prevPoint;
+  var points;
+  var segments;
+  var partialLength;
+  var totalLength;
+  var perc;
+  var tanAngle;
+  var mask;
+  if (this._hasMaskedPath) {
+    mask = this._pathData.m;
+    if (!this._pathData.n || this._pathData._mdf) {
+      var paths = mask.v;
+      if (this._pathData.r) {
+        paths = paths.reverse();
+      }
+      // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+      pathInfo = {
+        tLength: 0,
+        segments: [],
+      };
+      len = paths._length - 1;
+      var bezierData;
+      totalLength = 0;
+      for (i = 0; i < len; i += 1) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      i = len;
+      if (mask.v.c) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      this._pathData.pi = pathInfo;
+    }
+    pathInfo = this._pathData.pi;
+
+    currentLength = this._pathData.f.v;
+    segmentInd = 0;
+    pointInd = 1;
+    segmentLength = 0;
+    flag = true;
+    segments = pathInfo.segments;
+    if (currentLength < 0 && mask.v.c) {
+      if (pathInfo.tLength < Math.abs(currentLength)) {
+        currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+      }
+      segmentInd = segments.length - 1;
+      points = segments[segmentInd].points;
+      pointInd = points.length - 1;
+      while (currentLength < 0) {
+        currentLength += points[pointInd].partialLength;
+        pointInd -= 1;
+        if (pointInd < 0) {
+          segmentInd -= 1;
+          points = segments[segmentInd].points;
+          pointInd = points.length - 1;
+        }
+      }
+    }
+    points = segments[segmentInd].points;
+    prevPoint = points[pointInd - 1];
+    currentPoint = points[pointInd];
+    partialLength = currentPoint.partialLength;
+  }
+
+  len = letters.length;
+  xPos = 0;
+  yPos = 0;
+  var yOff = documentData.finalSize * 1.2 * 0.714;
+  var firstLine = true;
+  var animatorProps;
+  var animatorSelector;
+  var j;
+  var jLen;
+  var letterValue;
+
+  jLen = animators.length;
+
+  var mult;
+  var ind = -1;
+  var offf;
+  var xPathPos;
+  var yPathPos;
+  var initPathPos = currentLength;
+  var initSegmentInd = segmentInd;
+  var initPointInd = pointInd;
+  var currentLine = -1;
+  var elemOpacity;
+  var sc;
+  var sw;
+  var fc;
+  var k;
+  var letterSw;
+  var letterSc;
+  var letterFc;
+  var letterM = '';
+  var letterP = this.defaultPropsArray;
+  var letterO;
+
+  //
+  if (documentData.j === 2 || documentData.j === 1) {
+    var animatorJustifyOffset = 0;
+    var animatorFirstCharOffset = 0;
+    var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+    var lastIndex = 0;
+    var isNewLine = true;
+
+    for (i = 0; i < len; i += 1) {
+      if (letters[i].n) {
+        if (animatorJustifyOffset) {
+          animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while (lastIndex < i) {
+          letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+          lastIndex += 1;
+        }
+        animatorJustifyOffset = 0;
+        isNewLine = true;
+      } else {
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.t.propType) {
+            if (isNewLine && documentData.j === 2) {
+              animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+            }
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
+            } else {
+              animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
+            }
+          }
+        }
+        isNewLine = false;
+      }
+    }
+    if (animatorJustifyOffset) {
+      animatorJustifyOffset += animatorFirstCharOffset;
+    }
+    while (lastIndex < i) {
+      letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+      lastIndex += 1;
+    }
+  }
+  //
+
+  for (i = 0; i < len; i += 1) {
+    matrixHelper.reset();
+    elemOpacity = 1;
+    if (letters[i].n) {
+      xPos = 0;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      currentLength = initPathPos;
+      firstLine = false;
+      if (this._hasMaskedPath) {
+        segmentInd = initSegmentInd;
+        pointInd = initPointInd;
         points = segments[segmentInd].points;
         prevPoint = points[pointInd - 1];
         currentPoint = points[pointInd];
         partialLength = currentPoint.partialLength;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.finalSize * 1.2 * 0.714;
-    var firstLine = true;
-    var animatorProps, animatorSelector;
-    var j, jLen;
-    var letterValue;
-
-    jLen = animators.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
-
-    //
-    if(documentData.j === 2 || documentData.j === 1) {
-        var animatorJustifyOffset = 0;
-        var animatorFirstCharOffset = 0;
-        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
-        var lastIndex = 0;
-        var isNewLine = true;
-
-        for (i = 0; i < len; i += 1) {
-            if (letters[i].n) {
-                if(animatorJustifyOffset) {
-                    animatorJustifyOffset += animatorFirstCharOffset;
-                }
-                while (lastIndex < i) {
-                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-                    lastIndex += 1;
-                }
-                animatorJustifyOffset = 0;
-                isNewLine = true;
+        segmentLength = 0;
+      }
+      letterM = '';
+      letterFc = '';
+      letterSw = '';
+      letterO = '';
+      letterP = this.defaultPropsArray;
+    } else {
+      if (this._hasMaskedPath) {
+        if (currentLine !== letters[i].line) {
+          switch (documentData.j) {
+            case 1:
+              currentLength += totalLength - documentData.lineWidths[letters[i].line];
+              break;
+            case 2:
+              currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
+              break;
+            default:
+              break;
+          }
+          currentLine = letters[i].line;
+        }
+        if (ind !== letters[i].ind) {
+          if (letters[ind]) {
+            currentLength += letters[ind].extra;
+          }
+          currentLength += letters[i].an / 2;
+          ind = letters[i].ind;
+        }
+        currentLength += (alignment[0] * letters[i].an) * 0.005;
+        var animatorOffset = 0;
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.p.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.p.v[0] * mult[0];
             } else {
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.t.propType) {
-                        if (isNewLine && documentData.j === 2) {
-                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
-                        }
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
-                        if (mult.length) {
-                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
-                        } else {
-                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
-                        }
-                    }
-                }
-                isNewLine = false;
+              animatorOffset += animatorProps.p.v[0] * mult;
             }
+          }
+          if (animatorProps.a.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.a.v[0] * mult[0];
+            } else {
+              animatorOffset += animatorProps.a.v[0] * mult;
+            }
+          }
         }
-        if(animatorJustifyOffset) {
-            animatorJustifyOffset += animatorFirstCharOffset;
-        }
-        while(lastIndex < i) {
-            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-            lastIndex += 1;
-        }
-    }
-    //
-
-    for( i = 0; i < len; i += 1) {
-
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this._hasMaskedPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
+        flag = true;
+        while (flag) {
+          if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+            matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01);
+            flag = false;
+          } else if (points) {
+            segmentLength += currentPoint.partialLength;
+            pointInd += 1;
+            if (pointInd >= points.length) {
+              pointInd = 0;
+              segmentInd += 1;
+              if (!segments[segmentInd]) {
+                if (mask.v.c) {
+                  pointInd = 0;
+                  segmentInd = 0;
+                  points = segments[segmentInd].points;
+                } else {
+                  segmentLength -= currentPoint.partialLength;
+                  points = null;
+                }
+              } else {
                 points = segments[segmentInd].points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
+              }
             }
-            letterO = letterSw = letterFc = letterM = '';
-            letterP = this.defaultPropsArray;
-        }else{
-            if(this._hasMaskedPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += alignment[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.p.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
+            if (points) {
+              prevPoint = currentPoint;
+              currentPoint = points[pointInd];
+              partialLength = currentPoint.partialLength;
+            }
+          }
+        }
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
+      } else {
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
 
-                    }
-                    if (animatorProps.a.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
+        // Grouping alignment
+        matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0);
+      }
 
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.t.propType) {
+          animatorSelector = animators[j].s;
+          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"
+          if (xPos !== 0 || documentData.j !== 0) {
+            if (this._hasMaskedPath) {
+              if (mult.length) {
+                currentLength += animatorProps.t.v * mult[0];
+              } else {
+                currentLength += animatorProps.t.v * mult;
+              }
+            } else if (mult.length) {
+              xPos += animatorProps.t.v * mult[0];
             } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+              xPos += animatorProps.t.v * mult;
             }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.t.propType) {
-                    animatorSelector = animators[j].s;
-                    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"
-                    if(xPos !== 0 || documentData.j !== 0) {
-                        if(this._hasMaskedPath) {
-                            if(mult.length) {
-                                currentLength += animatorProps.t.v*mult[0];
-                            } else {
-                                currentLength += animatorProps.t.v*mult;
-                            }
-                        }else{
-                            if(mult.length) {
-                                xPos += animatorProps.t.v*mult[0];
-                            } else {
-                                xPos += animatorProps.t.v*mult;
-                            }
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim && documentData.fc) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.a.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.s.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = animators[j].a;
-                animatorSelector = animators[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                if (animatorProps.sk.propType) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if (animatorProps.r.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if (animatorProps.ry.propType) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if (animatorProps.rx.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if (animatorProps.o.propType) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
-                        } else {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim && documentData.fc) {
-                    if(animatorProps.fc.propType){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                            }
-                        }
-                    }
-                    if(animatorProps.fh.propType){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if(animatorProps.fs.propType){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if(animatorProps.fb.propType){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-
-                if (animatorProps.p.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(this._hasMaskedPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim && documentData.fc){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this._hasMaskedPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
-                if (textData.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= alignment[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.finalSize;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                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]];
-            }
-            letterO = elemOpacity;
+          }
         }
-
-        if(renderedLettersCount <= i) {
-            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            this.renderedLetters.push(letterValue);
-            renderedLettersCount += 1;
-            this.lettersChangedFlag = true;
+      }
+      if (documentData.strokeWidthAnim) {
+        sw = documentData.sw || 0;
+      }
+      if (documentData.strokeColorAnim) {
+        if (documentData.sc) {
+          sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
         } else {
-            letterValue = this.renderedLetters[i];
-            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+          sc = [0, 0, 0];
         }
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.a.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+
+          if (mult.length) {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.s.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (mult.length) {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1);
+          } else {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        animatorSelector = animators[j].s;
+        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+        if (animatorProps.sk.propType) {
+          if (mult.length) {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+          } else {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+          }
+        }
+        if (animatorProps.r.propType) {
+          if (mult.length) {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+          } else {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult);
+          }
+        }
+        if (animatorProps.ry.propType) {
+          if (mult.length) {
+            matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
+          } else {
+            matrixHelper.rotateY(animatorProps.ry.v * mult);
+          }
+        }
+        if (animatorProps.rx.propType) {
+          if (mult.length) {
+            matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
+          } else {
+            matrixHelper.rotateX(animatorProps.rx.v * mult);
+          }
+        }
+        if (animatorProps.o.propType) {
+          if (mult.length) {
+            elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0];
+          } else {
+            elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult;
+          }
+        }
+        if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+          if (mult.length) {
+            sw += animatorProps.sw.v * mult[0];
+          } else {
+            sw += animatorProps.sw.v * mult;
+          }
+        }
+        if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+          for (k = 0; k < 3; k += 1) {
+            if (mult.length) {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
+            } else {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
+            }
+          }
+        }
+        if (documentData.fillColorAnim && documentData.fc) {
+          if (animatorProps.fc.propType) {
+            for (k = 0; k < 3; k += 1) {
+              if (mult.length) {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
+              } else {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
+              }
+            }
+          }
+          if (animatorProps.fh.propType) {
+            if (mult.length) {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
+            } else {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult);
+            }
+          }
+          if (animatorProps.fs.propType) {
+            if (mult.length) {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
+            } else {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
+            }
+          }
+          if (animatorProps.fb.propType) {
+            if (mult.length) {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
+            } else {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
+            }
+          }
+        }
+      }
+
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+
+        if (animatorProps.p.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (this._hasMaskedPath) {
+            if (mult.length) {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+            } else {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+            }
+          } else if (mult.length) {
+            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+          }
+        }
+      }
+      if (documentData.strokeWidthAnim) {
+        letterSw = sw < 0 ? 0 : sw;
+      }
+      if (documentData.strokeColorAnim) {
+        letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
+      }
+
+      if (this._hasMaskedPath) {
+        matrixHelper.translate(0, -documentData.ls);
+
+        matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0);
+        if (textData.p.p) {
+          tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+          var rot = (Math.atan(tanAngle) * 180) / Math.PI;
+          if (currentPoint.point[0] < prevPoint.point[0]) {
+            rot += 180;
+          }
+          matrixHelper.rotate((-rot * Math.PI) / 180);
+        }
+        matrixHelper.translate(xPathPos, yPathPos, 0);
+        currentLength -= (alignment[0] * letters[i].an) * 0.005;
+        if (letters[i + 1] && ind !== letters[i + 1].ind) {
+          currentLength += letters[i].an / 2;
+          currentLength += (documentData.tr * 0.001) * documentData.finalSize;
+        }
+      } else {
+        matrixHelper.translate(xPos, yPos, 0);
+
+        if (documentData.ps) {
+          // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+          matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+        }
+        switch (documentData.j) {
+          case 1:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
+            break;
+          case 2:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
+            break;
+          default:
+            break;
+        }
+        matrixHelper.translate(0, -documentData.ls);
+        matrixHelper.translate(offf, 0, 0);
+        matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0);
+        xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize;
+      }
+      if (renderType === 'html') {
+        letterM = matrixHelper.toCSS();
+      } else if (renderType === 'svg') {
+        letterM = matrixHelper.to2dCSS();
+      } else {
+        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]];
+      }
+      letterO = elemOpacity;
     }
+
+    if (renderedLettersCount <= i) {
+      letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
+      this.renderedLetters.push(letterValue);
+      renderedLettersCount += 1;
+      this.lettersChangedFlag = true;
+    } else {
+      letterValue = this.renderedLetters[i];
+      this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+    }
+  }
 };
 
-TextAnimatorProperty.prototype.getValue = function(){
-	if(this._elem.globalData.frameId === this._frameId){
-        return;
-    }
-    this._frameId = this._elem.globalData.frameId;
-    this.iterateDynamicProperties();
+TextAnimatorProperty.prototype.getValue = function () {
+  if (this._elem.globalData.frameId === this._frameId) {
+    return;
+  }
+  this._frameId = this._elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 TextAnimatorProperty.prototype.mHelper = new Matrix();
 TextAnimatorProperty.prototype.defaultPropsArray = [];
 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
+
+/* global PropertyFactory, degToRads, TextSelectorProp */
+/* exported TextAnimatorDataProperty */
+
 function TextAnimatorDataProperty(elem, animatorProps, container) {
-	var defaultData = {propType:false};
-	var getProp = PropertyFactory.getProp;
-	var textAnimator_animatables = animatorProps.a;
-	this.a = {
-		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
-		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
-		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
-		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
-		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
-		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
-		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
-		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
-		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
-		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
-		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
-		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
-		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
-		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
-		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
-		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
-	};
+  var defaultData = { propType: false };
+  var getProp = PropertyFactory.getProp;
+  var textAnimatorAnimatables = animatorProps.a;
+  this.a = {
+    r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
+    rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
+    ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
+    sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
+    sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
+    s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
+    a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
+    o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
+    p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
+    sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
+    sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
+    fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
+    fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
+    fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
+    fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
+    t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData,
+  };
 
-	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
-    this.s.t = animatorProps.s.t;
+  this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
+  this.s.t = animatorProps.s.t;
 }
-function LetterProps(o, sw, sc, fc, m, p){
+
+function LetterProps(o, sw, sc, fc, m, p) {
+  this.o = o;
+  this.sw = sw;
+  this.sc = sc;
+  this.fc = fc;
+  this.m = m;
+  this.p = p;
+  this._mdf = {
+    o: true,
+    sw: !!sw,
+    sc: !!sc,
+    fc: !!fc,
+    m: true,
+    p: true,
+  };
+}
+
+LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
+  this._mdf.o = false;
+  this._mdf.sw = false;
+  this._mdf.sc = false;
+  this._mdf.fc = false;
+  this._mdf.m = false;
+  this._mdf.p = false;
+  var updated = false;
+
+  if (this.o !== o) {
     this.o = o;
+    this._mdf.o = true;
+    updated = true;
+  }
+  if (this.sw !== sw) {
     this.sw = sw;
+    this._mdf.sw = true;
+    updated = true;
+  }
+  if (this.sc !== sc) {
     this.sc = sc;
+    this._mdf.sc = true;
+    updated = true;
+  }
+  if (this.fc !== fc) {
     this.fc = fc;
+    this._mdf.fc = true;
+    updated = true;
+  }
+  if (this.m !== m) {
     this.m = m;
+    this._mdf.m = true;
+    updated = true;
+  }
+  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])) {
     this.p = p;
-    this._mdf = {
-    	o: true,
-    	sw: !!sw,
-    	sc: !!sc,
-    	fc: !!fc,
-    	m: true,
-    	p: true
-    };
-}
-
-LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
-	this._mdf.o = false;
-	this._mdf.sw = false;
-	this._mdf.sc = false;
-	this._mdf.fc = false;
-	this._mdf.m = false;
-	this._mdf.p = false;
-	var updated = false;
-
-	if(this.o !== o) {
-		this.o = o;
-		this._mdf.o = true;
-		updated = true;
-	}
-	if(this.sw !== sw) {
-		this.sw = sw;
-		this._mdf.sw = true;
-		updated = true;
-	}
-	if(this.sc !== sc) {
-		this.sc = sc;
-		this._mdf.sc = true;
-		updated = true;
-	}
-	if(this.fc !== fc) {
-		this.fc = fc;
-		this._mdf.fc = true;
-		updated = true;
-	}
-	if(this.m !== m) {
-		this.m = m;
-		this._mdf.m = true;
-		updated = true;
-	}
-	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])) {
-		this.p = p;
-		this._mdf.p = true;
-		updated = true;
-	}
-	return updated;
-};
-function TextProperty(elem, data){
-	this._frameId = initialDefaultFrame;
-	this.pv = '';
-	this.v = '';
-	this.kf = false;
-	this._isFirstFrame = true;
-	this._mdf = false;
-    this.data = data;
-	this.elem = elem;
-    this.comp = this.elem.comp;
-	this.keysIndex = 0;
-    this.canResize = false;
-    this.minimumFontSize = 1;
-    this.effectsSequence = [];
-	this.currentData = {
-		ascent: 0,
-        boxWidth: this.defaultBoxWidth,
-        f: '',
-        fStyle: '',
-        fWeight: '',
-        fc: '',
-        j: '',
-        justifyOffset: '',
-        l: [],
-        lh: 0,
-        lineWidths: [],
-        ls: '',
-        of: '',
-        s: '',
-        sc: '',
-        sw: 0,
-        t: 0,
-        tr: 0,
-        sz:0,
-        ps:null,
-        fillColorAnim: false,
-        strokeColorAnim: false,
-        strokeWidthAnim: false,
-        yOffset: 0,
-        finalSize:0,
-        finalText:[],
-        finalLineHeight: 0,
-        __complete: false
-
-	};
-    this.copyData(this.currentData, this.data.d.k[0].s);
-
-    if(!this.searchProperty()) {
-        this.completeTextData(this.currentData);
-    }
-}
-
-TextProperty.prototype.defaultBoxWidth = [0,0];
-
-TextProperty.prototype.copyData = function(obj, data) {
-    for(var s in data) {
-        if(data.hasOwnProperty(s)) {
-            obj[s] = data[s];
-        }
-    }
-    return obj;
-}
-
-TextProperty.prototype.setCurrentData = function(data){
-    if(!data.__complete) {
-        this.completeTextData(data);
-    }
-    this.currentData = data;
-    this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
-    this._mdf = true;
+    this._mdf.p = true;
+    updated = true;
+  }
+  return updated;
 };
 
-TextProperty.prototype.searchProperty = function() {
-    return this.searchKeyframes();
-};
+/* global FontManager, initialDefaultFrame, getFontProperties */
+/* exported TextProperty */
 
-TextProperty.prototype.searchKeyframes = function() {
-    this.kf = this.data.d.k.length > 1;
-    if(this.kf) {
-        this.addEffect(this.getKeyframeValue.bind(this));
-    }
-    return this.kf;
+function TextProperty(elem, data) {
+  this._frameId = initialDefaultFrame;
+  this.pv = '';
+  this.v = '';
+  this.kf = false;
+  this._isFirstFrame = true;
+  this._mdf = false;
+  this.data = data;
+  this.elem = elem;
+  this.comp = this.elem.comp;
+  this.keysIndex = 0;
+  this.canResize = false;
+  this.minimumFontSize = 1;
+  this.effectsSequence = [];
+  this.currentData = {
+    ascent: 0,
+    boxWidth: this.defaultBoxWidth,
+    f: '',
+    fStyle: '',
+    fWeight: '',
+    fc: '',
+    j: '',
+    justifyOffset: '',
+    l: [],
+    lh: 0,
+    lineWidths: [],
+    ls: '',
+    of: '',
+    s: '',
+    sc: '',
+    sw: 0,
+    t: 0,
+    tr: 0,
+    sz: 0,
+    ps: null,
+    fillColorAnim: false,
+    strokeColorAnim: false,
+    strokeWidthAnim: false,
+    yOffset: 0,
+    finalSize: 0,
+    finalText: [],
+    finalLineHeight: 0,
+    __complete: false,
+
+  };
+  this.copyData(this.currentData, this.data.d.k[0].s);
+
+  if (!this.searchProperty()) {
+    this.completeTextData(this.currentData);
+  }
 }
 
-TextProperty.prototype.addEffect = function(effectFunction) {
-	this.effectsSequence.push(effectFunction);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.defaultBoxWidth = [0, 0];
+
+TextProperty.prototype.copyData = function (obj, data) {
+  for (var s in data) {
+    if (Object.prototype.hasOwnProperty.call(data, s)) {
+      obj[s] = data[s];
+    }
+  }
+  return obj;
 };
 
-TextProperty.prototype.getValue = function(_finalValue) {
-    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
-        return;
-    }
-    this.currentData.t = this.data.d.k[this.keysIndex].s.t;
-    var currentValue = this.currentData;
-    var currentIndex = this.keysIndex;
-    if(this.lock) {
-        this.setCurrentData(this.currentData);
-        return;
-    }
-    this.lock = true;
-    this._mdf = false;
-    var multipliedValue;
-    var i, len = this.effectsSequence.length;
-    var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
-    for(i = 0; i < len; i += 1) {
-        //Checking if index changed to prevent creating a new object every time the expression updates.
-        if(currentIndex !== this.keysIndex) {
-            finalValue = this.effectsSequence[i](finalValue, finalValue.t);
-        } else {
-            finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
-        }
-    }
-    if(currentValue !== finalValue) {
-        this.setCurrentData(finalValue);
-    }
-    this.pv = this.v = this.currentData;
-    this.lock = false;
-    this.frameId = this.elem.globalData.frameId;
-}
+TextProperty.prototype.setCurrentData = function (data) {
+  if (!data.__complete) {
+    this.completeTextData(data);
+  }
+  this.currentData = data;
+  this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+  this._mdf = true;
+};
 
-TextProperty.prototype.getKeyframeValue = function() {
-    var textKeys = this.data.d.k, textDocumentData;
-    var frameNum = this.elem.comp.renderedFrame;
-    var i = 0, len = textKeys.length;
-    while(i <= len - 1) {
-        textDocumentData = textKeys[i].s;
-        if(i === len - 1 || textKeys[i+1].t > frameNum){
-            break;
-        }
+TextProperty.prototype.searchProperty = function () {
+  return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function () {
+  this.kf = this.data.d.k.length > 1;
+  if (this.kf) {
+    this.addEffect(this.getKeyframeValue.bind(this));
+  }
+  return this.kf;
+};
+
+TextProperty.prototype.addEffect = function (effectFunction) {
+  this.effectsSequence.push(effectFunction);
+  this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function (_finalValue) {
+  if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+    return;
+  }
+  this.currentData.t = this.data.d.k[this.keysIndex].s.t;
+  var currentValue = this.currentData;
+  var currentIndex = this.keysIndex;
+  if (this.lock) {
+    this.setCurrentData(this.currentData);
+    return;
+  }
+  this.lock = true;
+  this._mdf = false;
+  var i; var
+    len = this.effectsSequence.length;
+  var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
+  for (i = 0; i < len; i += 1) {
+    // Checking if index changed to prevent creating a new object every time the expression updates.
+    if (currentIndex !== this.keysIndex) {
+      finalValue = this.effectsSequence[i](finalValue, finalValue.t);
+    } else {
+      finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
+    }
+  }
+  if (currentValue !== finalValue) {
+    this.setCurrentData(finalValue);
+  }
+  this.v = this.currentData;
+  this.pv = this.v;
+  this.lock = false;
+  this.frameId = this.elem.globalData.frameId;
+};
+
+TextProperty.prototype.getKeyframeValue = function () {
+  var textKeys = this.data.d.k;
+  var frameNum = this.elem.comp.renderedFrame;
+  var i = 0; var
+    len = textKeys.length;
+  while (i <= len - 1) {
+    if (i === len - 1 || textKeys[i + 1].t > frameNum) {
+      break;
+    }
+    i += 1;
+  }
+  if (this.keysIndex !== i) {
+    this.keysIndex = i;
+  }
+  return this.data.d.k[this.keysIndex].s;
+};
+
+TextProperty.prototype.buildFinalText = function (text) {
+  var combinedCharacters = FontManager.getCombinedCharacterCodes();
+  var charactersArray = [];
+  var i = 0; var
+    len = text.length;
+  var charCode;
+  while (i < len) {
+    charCode = text.charCodeAt(i);
+    if (combinedCharacters.indexOf(charCode) !== -1) {
+      charactersArray[charactersArray.length - 1] += text.charAt(i);
+    } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      charCode = text.charCodeAt(i + 1);
+      if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
+        charactersArray.push(text.substr(i, 2));
         i += 1;
+      } else {
+        charactersArray.push(text.charAt(i));
+      }
+    } else {
+      charactersArray.push(text.charAt(i));
     }
-    if(this.keysIndex !== i) {
-        this.keysIndex = i;
-    }
-    return this.data.d.k[this.keysIndex].s;
+    i += 1;
+  }
+  return charactersArray;
 };
 
-TextProperty.prototype.buildFinalText = function(text) {
-    var combinedCharacters = FontManager.getCombinedCharacterCodes();
-    var charactersArray = [];
-    var i = 0, len = text.length;
-    var charCode;
-    while (i < len) {
-        charCode = text.charCodeAt(i);
-        if (combinedCharacters.indexOf(charCode) !== -1) {
-            charactersArray[charactersArray.length - 1] += text.charAt(i);
-        } else {
-            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
-                charCode = text.charCodeAt(i + 1);
-                if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
-                    charactersArray.push(text.substr(i, 2));
-                    ++i;
-                } else {
-                    charactersArray.push(text.charAt(i));
-                }
-            } else {
-                charactersArray.push(text.charAt(i));
-            }
-        }
-        i += 1;
-    }
-    return charactersArray;
-}
-
-TextProperty.prototype.completeTextData = function(documentData) {
-    documentData.__complete = true;
-    var fontManager = this.elem.globalData.fontManager;
-    var data = this.data;
-    var letters = [];
-    var i, len;
-    var newLineFlag, index = 0, val;
-    var anchorGrouping = data.m.g;
-    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-    var lineWidth = 0;
-    var maxLineWidth = 0;
-    var j, jLen;
-    var fontData = fontManager.getFontByName(documentData.f);
-    var charData, cLength = 0;
-    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
-
-    var fWeight = 'normal', fStyle = 'normal';
-    len = styles.length;
-    var styleName;
-    for(i=0;i<len;i+=1){
-        styleName = styles[i].toLowerCase();
-        switch(styleName) {
-            case 'italic':
-            fStyle = 'italic';
-            break;
-            case 'bold':
-            fWeight = '700';
-            break;
-            case 'black':
-            fWeight = '900';
-            break;
-            case 'medium':
-            fWeight = '500';
-            break;
-            case 'regular':
-            case 'normal':
-            fWeight = '400';
-            break;
-            case 'light':
-            case 'thin':
-            fWeight = '200';
-            break;
-        }
-    }
-    documentData.fWeight = fontData.fWeight || fWeight;
-    documentData.fStyle = fStyle;
-    documentData.finalSize = documentData.s;
-    documentData.finalText = this.buildFinalText(documentData.t);
-    len = documentData.finalText.length;
-    documentData.finalLineHeight = documentData.lh;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var charCode;
-    if(documentData.sz){
-        var flag = true;
-        var boxWidth = documentData.sz[0];
-        var boxHeight = documentData.sz[1];
-        var currentHeight, finalText;
-        while(flag) {
-            finalText = this.buildFinalText(documentData.t);
-            currentHeight = 0;
-            lineWidth = 0;
-            len = finalText.length;
-            trackingOffset = documentData.tr/1000*documentData.finalSize;
-            var lastSpaceIndex = -1;
-            for(i=0;i<len;i+=1){
-                charCode = finalText[i].charCodeAt(0);
-                newLineFlag = false;
-                if(finalText[i] === ' '){
-                    lastSpaceIndex = i;
-                }else if(charCode === 13 || charCode === 3){
-                    lineWidth = 0;
-                    newLineFlag = true;
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-                }else{
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
-                }
-                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
-                    if(lastSpaceIndex === -1){
-                        len += 1;
-                    } else {
-                        i = lastSpaceIndex;
-                    }
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
-                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
-                    lastSpaceIndex = -1;
-                    lineWidth = 0;
-                }else {
-                    lineWidth += cLength;
-                    lineWidth += trackingOffset;
-                }
-            }
-            currentHeight += fontData.ascent*documentData.finalSize/100;
-            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
-                documentData.finalSize -= 1;
-                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
-            } else {
-                documentData.finalText = finalText;
-                len = documentData.finalText.length;
-                flag = false;
-            }
-        }
-
-    }
-    lineWidth = - trackingOffset;
+TextProperty.prototype.completeTextData = function (documentData) {
+  documentData.__complete = true;
+  var fontManager = this.elem.globalData.fontManager;
+  var data = this.data;
+  var letters = [];
+  var i; var
+    len;
+  var newLineFlag; var index = 0; var
+    val;
+  var anchorGrouping = data.m.g;
+  var currentSize = 0; var currentPos = 0; var currentLine = 0; var
+    lineWidths = [];
+  var lineWidth = 0;
+  var maxLineWidth = 0;
+  var j; var
+    jLen;
+  var fontData = fontManager.getFontByName(documentData.f);
+  var charData; var
     cLength = 0;
-    var uncollapsedSpaces = 0;
-    var currentChar;
-    for (i = 0;i < len ;i += 1) {
+
+  var fontProps = getFontProperties(fontData);
+  documentData.fWeight = fontProps.weight;
+  documentData.fStyle = fontProps.style;
+  documentData.finalSize = documentData.s;
+  documentData.finalText = this.buildFinalText(documentData.t);
+  len = documentData.finalText.length;
+  documentData.finalLineHeight = documentData.lh;
+  var trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+  var charCode;
+  if (documentData.sz) {
+    var flag = true;
+    var boxWidth = documentData.sz[0];
+    var boxHeight = documentData.sz[1];
+    var currentHeight; var
+      finalText;
+    while (flag) {
+      finalText = this.buildFinalText(documentData.t);
+      currentHeight = 0;
+      lineWidth = 0;
+      len = finalText.length;
+      trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+      var lastSpaceIndex = -1;
+      for (i = 0; i < len; i += 1) {
+        charCode = finalText[i].charCodeAt(0);
         newLineFlag = false;
-        currentChar = documentData.finalText[i];
-        charCode = currentChar.charCodeAt(0);
-        if (charCode === 13 || charCode === 3) {
-            uncollapsedSpaces = 0;
-            lineWidths.push(lineWidth);
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidth = - 2 * trackingOffset;
-            val = '';
-            newLineFlag = true;
-            currentLine += 1;
-        }else{
-            val = currentChar;
+        if (finalText[i] === ' ') {
+          lastSpaceIndex = i;
+        } else if (charCode === 13 || charCode === 3) {
+          lineWidth = 0;
+          newLineFlag = true;
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
         }
-        if(fontManager.chars){
-            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-        }else{
-            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
-            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
-        }
-
-        //
-        if(currentChar === ' '){
-            uncollapsedSpaces += cLength + trackingOffset;
+        if (fontManager.chars) {
+          charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+          cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
         } else {
-            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
-            uncollapsedSpaces = 0;
+          // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+          cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
         }
-        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
-        if(anchorGrouping == 2){
-            currentSize += cLength;
-            if(val === '' || val === ' ' || i === len - 1){
-                if(val === '' || val === ' '){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                index += 1;
-                currentSize = 0;
-            }
-        }else if(anchorGrouping == 3){
-            currentSize += cLength;
-            if(val === '' || i === len - 1){
-                if(val === ''){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                currentSize = 0;
-                index += 1;
-            }
-        }else{
-            letters[index].ind = index;
-            letters[index].extra = 0;
-            index += 1;
+        if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
+          if (lastSpaceIndex === -1) {
+            len += 1;
+          } else {
+            i = lastSpaceIndex;
+          }
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
+          finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r');
+          // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+          lastSpaceIndex = -1;
+          lineWidth = 0;
+        } else {
+          lineWidth += cLength;
+          lineWidth += trackingOffset;
         }
+      }
+      currentHeight += (fontData.ascent * documentData.finalSize) / 100;
+      if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+        documentData.finalSize -= 1;
+        documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s;
+      } else {
+        documentData.finalText = finalText;
+        len = documentData.finalText.length;
+        flag = false;
+      }
     }
-    documentData.l = letters;
-    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-    lineWidths.push(lineWidth);
-    if(documentData.sz){
-        documentData.boxWidth = documentData.sz[0];
+  }
+  lineWidth = -trackingOffset;
+  cLength = 0;
+  var uncollapsedSpaces = 0;
+  var currentChar;
+  for (i = 0; i < len; i += 1) {
+    newLineFlag = false;
+    currentChar = documentData.finalText[i];
+    charCode = currentChar.charCodeAt(0);
+    if (charCode === 13 || charCode === 3) {
+      uncollapsedSpaces = 0;
+      lineWidths.push(lineWidth);
+      maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+      lineWidth = -2 * trackingOffset;
+      val = '';
+      newLineFlag = true;
+      currentLine += 1;
+    } else {
+      val = currentChar;
+    }
+    if (fontManager.chars) {
+      charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+      cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
+    } else {
+      // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+      // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+      cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+    }
+
+    //
+    if (currentChar === ' ') {
+      uncollapsedSpaces += cLength + trackingOffset;
+    } else {
+      lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+      uncollapsedSpaces = 0;
+    }
+    letters.push({
+      l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0,
+    });
+    if (anchorGrouping == 2) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || val === ' ' || i === len - 1) {
+        if (val === '' || val === ' ') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        index += 1;
+        currentSize = 0;
+      }
+    } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || i === len - 1) {
+        if (val === '') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        currentSize = 0;
+        index += 1;
+      }
+    } else {
+      letters[index].ind = index;
+      letters[index].extra = 0;
+      index += 1;
+    }
+  }
+  documentData.l = letters;
+  maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+  lineWidths.push(lineWidth);
+  if (documentData.sz) {
+    documentData.boxWidth = documentData.sz[0];
+    documentData.justifyOffset = 0;
+  } else {
+    documentData.boxWidth = maxLineWidth;
+    switch (documentData.j) {
+      case 1:
+        documentData.justifyOffset = -documentData.boxWidth;
+        break;
+      case 2:
+        documentData.justifyOffset = -documentData.boxWidth / 2;
+        break;
+      default:
         documentData.justifyOffset = 0;
-    }else{
-        documentData.boxWidth = maxLineWidth;
-        switch(documentData.j){
-            case 1:
-                documentData.justifyOffset = - documentData.boxWidth;
-                break;
-            case 2:
-                documentData.justifyOffset = - documentData.boxWidth/2;
-                break;
-            default:
-                documentData.justifyOffset = 0;
-        }
     }
-    documentData.lineWidths = lineWidths;
+  }
+  documentData.lineWidths = lineWidths;
 
-    var animators = data.a, animatorData, letterData;
-    jLen = animators.length;
-    var based, ind, indexes = [];
-    for(j=0;j<jLen;j+=1){
-        animatorData = animators[j];
-        if(animatorData.a.sc){
-            documentData.strokeColorAnim = true;
-        }
-        if(animatorData.a.sw){
-            documentData.strokeWidthAnim = true;
-        }
-        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
-            documentData.fillColorAnim = true;
-        }
-        ind = 0;
-        based = animatorData.s.b;
-        for(i=0;i<len;i+=1){
-            letterData = letters[i];
-            letterData.anIndexes[j] = ind;
-            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))){
-                if(animatorData.s.rn === 1){
-                    indexes.push(ind);
-                }
-                ind += 1;
-            }
-        }
-        data.a[j].s.totalChars = ind;
-        var currentInd = -1, newInd;
-        if(animatorData.s.rn === 1){
-            for(i = 0; i < len; i += 1){
-                letterData = letters[i];
-                if(currentInd != letterData.anIndexes[j]){
-                    currentInd = letterData.anIndexes[j];
-                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                }
-                letterData.anIndexes[j] = newInd;
-            }
-        }
+  var animators = data.a; var animatorData; var
+    letterData;
+  jLen = animators.length;
+  var based; var ind; var
+    indexes = [];
+  for (j = 0; j < jLen; j += 1) {
+    animatorData = animators[j];
+    if (animatorData.a.sc) {
+      documentData.strokeColorAnim = true;
     }
-    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
-    documentData.ls = documentData.ls || 0;
-    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+    if (animatorData.a.sw) {
+      documentData.strokeWidthAnim = true;
+    }
+    if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
+      documentData.fillColorAnim = true;
+    }
+    ind = 0;
+    based = animatorData.s.b;
+    for (i = 0; i < len; i += 1) {
+      letterData = letters[i];
+      letterData.anIndexes[j] = ind;
+      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))) { // eslint-disable-line eqeqeq
+        if (animatorData.s.rn === 1) {
+          indexes.push(ind);
+        }
+        ind += 1;
+      }
+    }
+    data.a[j].s.totalChars = ind;
+    var currentInd = -1; var
+      newInd;
+    if (animatorData.s.rn === 1) {
+      for (i = 0; i < len; i += 1) {
+        letterData = letters[i];
+        if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq
+          currentInd = letterData.anIndexes[j];
+          newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
+        }
+        letterData.anIndexes[j] = newInd;
+      }
+    }
+  }
+  documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
+  documentData.ls = documentData.ls || 0;
+  documentData.ascent = (fontData.ascent * documentData.finalSize) / 100;
 };
 
-TextProperty.prototype.updateDocumentData = function(newData, index) {
-	index = index === undefined ? this.keysIndex : index;
-    var dData = this.copyData({}, this.data.d.k[index].s);
-    dData = this.copyData(dData, newData);
-    this.data.d.k[index].s = dData;
-    this.recalculate(index);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.updateDocumentData = function (newData, index) {
+  index = index === undefined ? this.keysIndex : index;
+  var dData = this.copyData({}, this.data.d.k[index].s);
+  dData = this.copyData(dData, newData);
+  this.data.d.k[index].s = dData;
+  this.recalculate(index);
+  this.elem.addDynamicProperty(this);
 };
 
-TextProperty.prototype.recalculate = function(index) {
-    var dData = this.data.d.k[index].s;
-    dData.__complete = false;
-    this.keysIndex = 0;
-    this._isFirstFrame = true;
-    this.getValue(dData);
-}
-
-TextProperty.prototype.canResizeFont = function(_canResize) {
-    this.canResize = _canResize;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.recalculate = function (index) {
+  var dData = this.data.d.k[index].s;
+  dData.__complete = false;
+  this.keysIndex = 0;
+  this._isFirstFrame = true;
+  this.getValue(dData);
 };
 
-TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
-    this.minimumFontSize = Math.floor(_fontValue) || 1;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.canResizeFont = function (_canResize) {
+  this.canResize = _canResize;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
 };
 
-var TextSelectorProp = (function(){
-    var max = Math.max;
-    var min = Math.min;
-    var floor = Math.floor;
+TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
+  this.minimumFontSize = Math.floor(_fontValue) || 1;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
+};
 
-    function TextSelectorProp(elem,data){
-        this._currentTextLength = -1;
-        this.k = false;
-        this.data = data;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.finalS = 0;
-        this.finalE = 0;
-        this.initDynamicPropertyContainer(elem);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
-        if('e' in data){
-            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
-        }else{
-            this.e = {v:100};
+/* global extendPrototype, BezierFactory, PropertyFactory, DynamicPropertyContainer */
+/* exported TextSelectorProp */
+
+var TextSelectorProp = (function () {
+  var max = Math.max;
+  var min = Math.min;
+  var floor = Math.floor;
+
+  function TextSelectorPropFactory(elem, data) {
+    this._currentTextLength = -1;
+    this.k = false;
+    this.data = data;
+    this.elem = elem;
+    this.comp = elem.comp;
+    this.finalS = 0;
+    this.finalE = 0;
+    this.initDynamicPropertyContainer(elem);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this);
+    if ('e' in data) {
+      this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
+    } else {
+      this.e = { v: 100 };
+    }
+    this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this);
+    this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this);
+    this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this);
+    this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
+    if (!this.dynamicProperties.length) {
+      this.getValue();
+    }
+  }
+
+  TextSelectorPropFactory.prototype = {
+    getMult: function (ind) {
+      if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+        this.getValue();
+      }
+      // var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+      var x1 = 0;
+      var y1 = 0;
+      var x2 = 1;
+      var y2 = 1;
+      if (this.ne.v > 0) {
+        x1 = this.ne.v / 100.0;
+      } else {
+        y1 = -this.ne.v / 100.0;
+      }
+      if (this.xe.v > 0) {
+        x2 = 1.0 - this.xe.v / 100.0;
+      } else {
+        y2 = 1.0 + this.xe.v / 100.0;
+      }
+      var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
+
+      var mult = 0;
+      var s = this.finalS;
+      var e = this.finalE;
+      var type = this.data.sh;
+      if (type === 2) {
+        if (e === s) {
+          mult = ind >= e ? 1 : 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
-        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
-        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
-        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
-        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
-        if(!this.dynamicProperties.length){
-            this.getValue();
+        mult = easer(mult);
+      } else if (type === 3) {
+        if (e === s) {
+          mult = ind >= e ? 0 : 1;
+        } else {
+          mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
+
+        mult = easer(mult);
+      } else if (type === 4) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
+          if (mult < 0.5) {
+            mult *= 2;
+          } else {
+            mult = 1 - 2 * (mult - 0.5);
+          }
+        }
+        mult = easer(mult);
+      } else if (type === 5) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          var tot = e - s;
+          /* ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          var x = -tot / 2 + ind;
+          var a = tot / 2;
+          mult = Math.sqrt(1 - (x * x) / (a * a));
+        }
+        mult = easer(mult);
+      } else if (type === 6) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line
+        }
+        mult = easer(mult);
+      } else {
+        if (ind >= floor(s)) {
+          if (ind - s < 0) {
+            mult = max(0, min(min(e, 1) - (s - ind), 1));
+          } else {
+            mult = max(0, min(e - ind, 1));
+          }
+        }
+        mult = easer(mult);
+      }
+      return mult * this.a.v;
+    },
+    getValue: function (newCharsFlag) {
+      this.iterateDynamicProperties();
+      this._mdf = newCharsFlag || this._mdf;
+      this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+      if (newCharsFlag && this.data.r === 2) {
+        this.e.v = this._currentTextLength;
+      }
+      var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
+      var o = this.o.v / divisor;
+      var s = this.s.v / divisor + o;
+      var e = (this.e.v / divisor) + o;
+      if (s > e) {
+        var _s = s;
+        s = e;
+        e = _s;
+      }
+      this.finalS = s;
+      this.finalE = e;
+    },
+  };
+  extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
+
+  function getTextSelectorProp(elem, data, arr) {
+    return new TextSelectorPropFactory(elem, data, arr);
+  }
+
+  return {
+    getTextSelectorProp: getTextSelectorProp,
+  };
+}());
+
+/* global createSizedArray, pooling */
+/* exported poolFactory */
+
+var poolFactory = (function () {
+  return function (initialLength, _create, _release) {
+    var _length = 0;
+    var _maxLength = initialLength;
+    var pool = createSizedArray(_maxLength);
+
+    var ob = {
+      newElement: newElement,
+      release: release,
+    };
+
+    function newElement() {
+      var element;
+      if (_length) {
+        _length -= 1;
+        element = pool[_length];
+      } else {
+        element = _create();
+      }
+      return element;
     }
 
-    TextSelectorProp.prototype = {
-        getMult: function(ind) {
-            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
-                this.getValue();
-            }
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var x1 = 0;
-            var y1 = 0;
-            var x2 = 1;
-            var y2 = 1;
-            if(this.ne.v > 0) {
-                x1 = this.ne.v / 100.0;
-            }
-            else {
-                y1 = -this.ne.v / 100.0;
-            }
-            if(this.xe.v > 0) {
-                x2 = 1.0 - this.xe.v / 100.0;
-            }
-            else {
-                y2 = 1.0 + this.xe.v / 100.0;
-            }
-            var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
-
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if (type === 2){
-                if (e === s) {
-                    mult = ind >= e ? 1 : 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                }
-                mult = easer(mult);
-            } else if(type === 3) {
-                if (e === s) {
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
-                }
-
-                mult = easer(mult);
-            } else if (type === 4) {
-                if (e === s) {
-                    mult = 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                    if (mult < 0.5) {
-                        mult *= 2;
-                    } else {
-                        mult = 1 - 2 * (mult - 0.5);
-                    }
-                }
-                mult = easer(mult);
-            } else if (type === 5) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x * x) / (a * a));
-                }
-                mult = easer(mult);
-            } else if (type === 6) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
-                }
-                mult = easer(mult);
-            } else {
-                if (ind >= floor(s)) {
-                    if (ind - s < 0) {
-                        mult = max(0, min(min(e, 1) - (s - ind), 1));
-                    } else {
-                        mult = max(0, min(e - ind, 1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        },
-        getValue: function(newCharsFlag) {
-            this.iterateDynamicProperties();
-            this._mdf = newCharsFlag || this._mdf;
-            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
-            if(newCharsFlag && this.data.r === 2) {
-                this.e.v = this._currentTextLength;
-            }
-            var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-    }
-    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
+    function release(element) {
+      if (_length === _maxLength) {
+        pool = pooling.double(pool);
+        _maxLength *= 2;
+      }
+      if (_release) {
+        _release(element);
+      }
+      pool[_length] = element;
+      _length += 1;
     }
 
+    return ob;
+  };
+}());
+
+/* global createSizedArray */
+/* exported pooling */
+
+var pooling = (function () {
+  function double(arr) {
+    return arr.concat(createSizedArray(arr.length));
+  }
+
+  return {
+    double: double,
+  };
+}());
+
+/* global createTypedArray, poolFactory */
+/* exported pointPool */
+
+var pointPool = (function () {
+  function create() {
+    return createTypedArray('float32', 2);
+  }
+  return poolFactory(8, create);
+}());
+
+/* global ShapePath, pointPool, poolFactory */
+/* exported shapePool */
+
+var shapePool = (function () {
+  function create() {
+    return new ShapePath();
+  }
+
+  function release(shapePath) {
+    var len = shapePath._length;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      pointPool.release(shapePath.v[i]);
+      pointPool.release(shapePath.i[i]);
+      pointPool.release(shapePath.o[i]);
+      shapePath.v[i] = null;
+      shapePath.i[i] = null;
+      shapePath.o[i] = null;
+    }
+    shapePath._length = 0;
+    shapePath.c = false;
+  }
+
+  function clone(shape) {
+    var cloned = factory.newElement();
+    var i;
+    var len = shape._length === undefined ? shape.v.length : shape._length;
+    cloned.setLength(len);
+    cloned.c = shape.c;
+
+    for (i = 0; i < len; i += 1) {
+      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);
+    }
+    return cloned;
+  }
+
+  var factory = poolFactory(4, create, release);
+  factory.clone = clone;
+
+  return factory;
+}());
+
+/* global createSizedArray, ShapeCollection, shapePool, pooling */
+/* exported shapeCollectionPool */
+
+var shapeCollectionPool = (function () {
+  var ob = {
+    newShapeCollection: newShapeCollection,
+    release: release,
+  };
+
+  var _length = 0;
+  var _maxLength = 4;
+  var pool = createSizedArray(_maxLength);
+
+  function newShapeCollection() {
+    var shapeCollection;
+    if (_length) {
+      _length -= 1;
+      shapeCollection = pool[_length];
+    } else {
+      shapeCollection = new ShapeCollection();
+    }
+    return shapeCollection;
+  }
+
+  function release(shapeCollection) {
+    var i;
+    var len = shapeCollection._length;
+    for (i = 0; i < len; i += 1) {
+      shapePool.release(shapeCollection.shapes[i]);
+    }
+    shapeCollection._length = 0;
+
+    if (_length === _maxLength) {
+      pool = pooling.double(pool);
+      _maxLength *= 2;
+    }
+    pool[_length] = shapeCollection;
+    _length += 1;
+  }
+
+  return ob;
+}());
+
+/* global poolFactory, bezierLengthPool */
+/* exported segmentsLengthPool */
+
+var segmentsLengthPool = (function () {
+  function create() {
     return {
-        getTextSelectorProp: getTextSelectorProp
+      lengths: [],
+      totalLength: 0,
     };
-}());
+  }
 
-    
-var pool_factory = (function() {
-	return function(initialLength, _create, _release, _clone) {
-
-		var _length = 0;
-		var _maxLength = initialLength;
-		var pool = createSizedArray(_maxLength);
-
-		var ob = {
-			newElement: newElement,
-			release: release
-		};
-
-		function newElement(){
-			var element;
-			if(_length){
-				_length -= 1;
-				element = pool[_length];
-			} else {
-				element = _create();
-			}
-			return element;
-		}
-
-		function release(element) {
-			if(_length === _maxLength) {
-				pool = pooling.double(pool);
-				_maxLength = _maxLength*2;
-			}
-			if (_release) {
-				_release(element);
-			}
-			pool[_length] = element;
-			_length += 1;
-		}
-
-		function clone() {
-			var clonedElement = newElement();
-			return _clone(clonedElement);
-		}
-
-		return ob;
-	};
-}());
-
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(createSizedArray(arr.length));
-	}
-
-	return {
-		double: double
-	};
-}());
-var point_pool = (function(){
-
-	function create() {
-		return createTypedArray('float32', 2);
-	}
-	return pool_factory(8, create);
-}());
-var shape_pool = (function(){
-
-	function create() {
-		return new ShapePath();
-	}
-
-	function release(shapePath) {
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-	}
-
-	function clone(shape) {
-		var cloned = factory.newElement();
-		var i, len = shape._length === undefined ? shape.v.length : shape._length;
-		cloned.setLength(len);
-		cloned.c = shape.c;
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			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);
-		}
-		return cloned;
-	}
-
-	var factory = pool_factory(4, create, release);
-	factory.clone = clone;
-
-	return factory;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release
-	};
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = createSizedArray(_maxLength);
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	return ob;
-}());
-var segments_length_pool = (function(){
-
-	function create() {
-		return {
-			lengths: [],
-			totalLength: 0
-		};
-	}
-
-	function release(element) {
-		var i, len = element.lengths.length;
-		for(i=0;i<len;i+=1) {
-			bezier_length_pool.release(element.lengths[i]);
-		}
-		element.lengths.length = 0;
-	}
-
-	return pool_factory(8, create, release);
-}());
-var bezier_length_pool = (function(){
-
-	function create() {
-		return {
-            addedLength: 0,
-            percents: createTypedArray('float32', defaultCurveSegments),
-            lengths: createTypedArray('float32', defaultCurveSegments),
-        };
-	}
-	return pool_factory(8, create);
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
+  function release(element) {
+    var i;
+    var len = element.lengths.length;
+    for (i = 0; i < len; i += 1) {
+      bezierLengthPool.release(element.lengths[i]);
     }
-    this.checkPendingElements();
-};
+    element.lengths.length = 0;
+  }
 
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 3:
-            return this.createNull(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 6:
-            return this.createAudio(layer);
-        case 13:
-            return this.createCamera(layer);
-    }
-    return this.createNull(layer);
-};
+  return poolFactory(8, create, release);
+}());
 
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-};
+/* global createTypedArray, defaultCurveSegments, poolFactory */
+/* exported bezierLengthPool */
 
-BaseRenderer.prototype.createAudio = function(data){
-    return new AudioElement(data, this.globalData, this);
-};
+var bezierLengthPool = (function () {
+  function create() {
+    return {
+      addedLength: 0,
+      percents: createTypedArray('float32', defaultCurveSegments),
+      lengths: createTypedArray('float32', defaultCurveSegments),
+    };
+  }
+  return poolFactory(8, create);
+}());
 
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
+/* global AudioElement, FontManager */
+
+function BaseRenderer() {}
+BaseRenderer.prototype.checkLayers = function (num) {
+  var i;
+  var len = this.layers.length;
+  var data;
+  this.completeLayers = true;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (!this.elements[i]) {
+      data = this.layers[i];
+      if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) {
         this.buildItem(i);
+      }
     }
-    this.checkPendingElements();
+    this.completeLayers = this.elements[i] ? this.completeLayers : false;
+  }
+  this.checkPendingElements();
 };
 
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
+BaseRenderer.prototype.createItem = function (layer) {
+  switch (layer.ty) {
+    case 2:
+      return this.createImage(layer);
+    case 0:
+      return this.createComp(layer);
+    case 1:
+      return this.createSolid(layer);
+    case 3:
+      return this.createNull(layer);
+    case 4:
+      return this.createShape(layer);
+    case 5:
+      return this.createText(layer);
+    case 6:
+      return this.createAudio(layer);
+    case 13:
+      return this.createCamera(layer);
+    default:
+      return this.createNull(layer);
+  }
+};
+
+BaseRenderer.prototype.createCamera = function () {
+  throw new Error('You\'re using a 3d camera. Try the html renderer.');
+};
+
+BaseRenderer.prototype.createAudio = function (data) {
+  return new AudioElement(data, this.globalData, this);
+};
+
+BaseRenderer.prototype.buildAllItems = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    this.buildItem(i);
+  }
+  this.checkPendingElements();
+};
+
+BaseRenderer.prototype.includeLayers = function (newLayers) {
+  this.completeLayers = false;
+  var i;
+  var len = newLayers.length;
+  var j;
+  var jLen = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    j = 0;
+    while (j < jLen) {
+      if (this.layers[j].id === newLayers[i].id) {
+        this.layers[j] = newLayers[i];
+        break;
+      }
+      j += 1;
+    }
+  }
+};
+
+BaseRenderer.prototype.setProjectInterface = function (pInterface) {
+  this.globalData.projectInterface = pInterface;
+};
+
+BaseRenderer.prototype.initItems = function () {
+  if (!this.globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+};
+BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
+  var elements = this.elements;
+  var layers = this.layers;
+  var i = 0;
+  var len = layers.length;
+  while (i < len) {
+    if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq
+      if (!elements[i] || elements[i] === true) {
+        this.buildItem(i);
+        this.addPendingElement(element);
+      } else {
+        hierarchy.push(elements[i]);
+        elements[i].setAsParent();
+        if (layers[i].parent !== undefined) {
+          this.buildElementParenting(element, layers[i].parent, hierarchy);
+        } else {
+          element.setHierarchy(hierarchy);
         }
+      }
     }
+    i += 1;
+  }
 };
 
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
+BaseRenderer.prototype.addPendingElement = function (element) {
+  this.pendingElements.push(element);
 };
 
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
+BaseRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i]);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
     }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while (i < len) {
-        if (layers[i].ind == parentName) {
-            if (!elements[i] || elements[i] === true) {
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i].setAsParent();
-                if(layers[i].parent !== undefined) {
-                    this.buildElementParenting(element, layers[i].parent, hierarchy);
-                } else {
-                    element.setHierarchy(hierarchy);
-                }
-            }
-        }
-        i += 1;
-    }
+  }
 };
 
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
+BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
+  this.globalData.fontManager = new FontManager();
+  this.globalData.fontManager.addChars(animData.chars);
+  this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
+  this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+  this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
+  this.globalData.imageLoader = this.animationItem.imagePreloader;
+  this.globalData.audioController = this.animationItem.audioController;
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
 };
 
-BaseRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i]);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
+/* global createElementID, extendPrototype, BaseRenderer, NullElement, SVGShapeElement, SVGTextLottieElement,
+IImageElement, SVGCompElement, ISolidElement, createNS, locationHref, createSizedArray, expressionsPlugin */
 
-BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.imageLoader = this.animationItem.imagePreloader;
-    this.globalData.audioController = this.animationItem.audioController;
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-}
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.svgElement = createNS('svg');
-    var ariaLabel = '';
-    if (config && config.title) {
-        var titleElement = createNS('title');
-        var titleId = createElementID();
-        titleElement.setAttribute('id', titleId);
-        titleElement.textContent = config.title;
-        this.svgElement.appendChild(titleElement);
-        ariaLabel += titleId;
-    }
-    if (config && config.description) {
-        var descElement = createNS('desc');
-        var descId = createElementID();
-        descElement.setAttribute('id', descId);
-        descElement.textContent = config.description;
-        this.svgElement.appendChild(descElement);
-        ariaLabel += ' ' + descId;
-    }
-    if (ariaLabel) {
-        this.svgElement.setAttribute('aria-labelledby', ariaLabel)
-    }
-    var defs = createNS( 'defs');
-    this.svgElement.appendChild(defs);
-    var maskElement = createNS('g');
-    this.svgElement.appendChild(maskElement);
-    this.layerElement = maskElement;
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        viewBoxOnly: (config && config.viewBoxOnly) || false,
-        viewBoxSize: (config && config.viewBoxSize) || false,
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-        focusable: config && config.focusable,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '100%',
-            height: config && config.filterSize && config.filterSize.height || '100%',
-            x: config && config.filterSize && config.filterSize.x || '0%',
-            y: config && config.filterSize && config.filterSize.y || '0%',
-        }
-    };
+function SVGRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.svgElement = createNS('svg');
+  var ariaLabel = '';
+  if (config && config.title) {
+    var titleElement = createNS('title');
+    var titleId = createElementID();
+    titleElement.setAttribute('id', titleId);
+    titleElement.textContent = config.title;
+    this.svgElement.appendChild(titleElement);
+    ariaLabel += titleId;
+  }
+  if (config && config.description) {
+    var descElement = createNS('desc');
+    var descId = createElementID();
+    descElement.setAttribute('id', descId);
+    descElement.textContent = config.description;
+    this.svgElement.appendChild(descElement);
+    ariaLabel += ' ' + descId;
+  }
+  if (ariaLabel) {
+    this.svgElement.setAttribute('aria-labelledby', ariaLabel);
+  }
+  var defs = createNS('defs');
+  this.svgElement.appendChild(defs);
+  var maskElement = createNS('g');
+  this.svgElement.appendChild(maskElement);
+  this.layerElement = maskElement;
+  this.renderConfig = {
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    hideOnTransparent: !((config && config.hideOnTransparent === false)),
+    viewBoxOnly: (config && config.viewBoxOnly) || false,
+    viewBoxSize: (config && config.viewBoxSize) || false,
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+    focusable: config && config.focusable,
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '100%',
+      height: (config && config.filterSize && config.filterSize.height) || '100%',
+      x: (config && config.filterSize && config.filterSize.x) || '0%',
+      y: (config && config.filterSize && config.filterSize.y) || '0%',
+    },
+  };
 
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        defs: defs,
-        renderConfig: this.renderConfig
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-    this.rendererType = 'svg';
-
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    defs: defs,
+    renderConfig: this.renderConfig,
+  };
+  this.elements = [];
+  this.pendingElements = [];
+  this.destroyed = false;
+  this.rendererType = 'svg';
 }
 
-extendPrototype([BaseRenderer],SVGRenderer);
+extendPrototype([BaseRenderer], SVGRenderer);
 
 SVGRenderer.prototype.createNull = function (data) {
-    return new NullElement(data,this.globalData,this);
+  return new NullElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new SVGShapeElement(data,this.globalData,this);
+  return new SVGShapeElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data,this.globalData,this);
-
+  return new SVGTextLottieElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data,this.globalData,this);
+  return new IImageElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new SVGCompElement(data,this.globalData,this);
-
+  return new SVGCompElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data,this.globalData,this);
+  return new ISolidElement(data, this.globalData, this);
 };
 
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    if(this.renderConfig.viewBoxSize) {
-        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
-    } else {
-        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    }
+SVGRenderer.prototype.configAnimation = function (animData) {
+  this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+  if (this.renderConfig.viewBoxSize) {
+    this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
+  } else {
+    this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
+  }
 
-    if(!this.renderConfig.viewBoxOnly) {
-        this.svgElement.setAttribute('width',animData.w);
-        this.svgElement.setAttribute('height',animData.h);
-        this.svgElement.style.width = '100%';
-        this.svgElement.style.height = '100%';
-        this.svgElement.style.transform = 'translate3d(0,0,0)';
-    }
-    if (this.renderConfig.className) {
-        this.svgElement.setAttribute('class', this.renderConfig.className);
-    }
-    if (this.renderConfig.id) {
-        this.svgElement.setAttribute('id', this.renderConfig.id);
-    }
-    if (this.renderConfig.focusable !== undefined) {
-        this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
-    }
-    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.svgElement);
-    //Mask animation
-    var defs = this.globalData.defs;
+  if (!this.renderConfig.viewBoxOnly) {
+    this.svgElement.setAttribute('width', animData.w);
+    this.svgElement.setAttribute('height', animData.h);
+    this.svgElement.style.width = '100%';
+    this.svgElement.style.height = '100%';
+    this.svgElement.style.transform = 'translate3d(0,0,0)';
+  }
+  if (this.renderConfig.className) {
+    this.svgElement.setAttribute('class', this.renderConfig.className);
+  }
+  if (this.renderConfig.id) {
+    this.svgElement.setAttribute('id', this.renderConfig.id);
+  }
+  if (this.renderConfig.focusable !== undefined) {
+    this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
+  }
+  this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio);
+  // this.layerElement.style.transform = 'translate3d(0,0,0)';
+  // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
+  this.animationItem.wrapper.appendChild(this.svgElement);
+  // Mask animation
+  var defs = this.globalData.defs;
 
-    this.setupGlobalData(animData, defs);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.data = animData;
+  this.setupGlobalData(animData, defs);
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.data = animData;
 
-    var maskElement = createNS( 'clipPath');
-    var rect = createNS('rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = createElementID();
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+  var maskElement = createNS('clipPath');
+  var rect = createNS('rect');
+  rect.setAttribute('width', animData.w);
+  rect.setAttribute('height', animData.h);
+  rect.setAttribute('x', 0);
+  rect.setAttribute('y', 0);
+  var maskId = createElementID();
+  maskElement.setAttribute('id', maskId);
+  maskElement.appendChild(rect);
+  this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + maskId + ')');
 
-    defs.appendChild(maskElement);
-    this.layers = animData.layers;
-    this.elements = createSizedArray(animData.layers.length);
+  defs.appendChild(maskElement);
+  this.layers = animData.layers;
+  this.elements = createSizedArray(animData.layers.length);
 };
 
-
 SVGRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.layerElement = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 SVGRenderer.prototype.updateContainerSize = function () {
 };
 
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
+SVGRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  elements[pos] = true;
+  var element = this.createItem(this.layers[pos]);
 
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
+  elements[pos] = element;
+  if (expressionsPlugin) {
+    if (this.layers[pos].ty === 0) {
+      this.globalData.projectInterface.registerComposition(element);
     }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
+    element.initExpressions();
+  }
+  this.appendElementInPos(element, pos);
+  if (this.layers[pos].tt) {
+    if (!this.elements[pos - 1] || this.elements[pos - 1] === true) {
+      this.buildItem(pos - 1);
+      this.addPendingElement(element);
+    } else {
+      element.setMatte(elements[pos - 1].layerId);
     }
+  }
 };
 
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame === num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    // console.log('-------');
-    // console.log('FRAME ',num);
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    this.globalData._mdf = false;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    if(this.globalData._mdf) {
-        for (i = 0; i < len; i += 1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
+SVGRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+    if (element.data.tt) {
+      var i = 0;
+      var len = this.elements.length;
+      while (i < len) {
+        if (this.elements[i] === element) {
+          element.setMatte(this.elements[i - 1].layerId);
+          break;
         }
         i += 1;
+      }
     }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
-    } else {
-        this.layerElement.appendChild(newElement);
+  }
+};
+
+SVGRenderer.prototype.renderFrame = function (num) {
+  if (this.renderedFrame === num || this.destroyed) {
+    return;
+  }
+  if (num === null) {
+    num = this.renderedFrame;
+  } else {
+    this.renderedFrame = num;
+  }
+  // console.log('-------');
+  // console.log('FRAME ',num);
+  this.globalData.frameNum = num;
+  this.globalData.frameId += 1;
+  this.globalData.projectInterface.currentFrame = num;
+  this.globalData._mdf = false;
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
+  }
+  if (this.globalData._mdf) {
+    for (i = 0; i < len; i += 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+  }
 };
 
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
+SVGRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newElement = element.getBaseElement();
+  if (!newElement) {
+    return;
+  }
+  var i = 0;
+  var nextElement;
+  while (i < pos) {
+    if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
+      nextElement = this.elements[i].getBaseElement();
+    }
+    i += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(newElement, nextElement);
+  } else {
+    this.layerElement.appendChild(newElement);
+  }
 };
 
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
+SVGRenderer.prototype.hide = function () {
+  this.layerElement.style.display = 'none';
 };
 
-function HybridRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.renderConfig = {
-        className: (config && config.className) || '',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '400%',
-            height: config && config.filterSize && config.filterSize.height || '400%',
-            x: config && config.filterSize && config.filterSize.x || '-100%',
-            y: config && config.filterSize && config.filterSize.y || '-100%',
-        }
-    };
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        renderConfig: this.renderConfig
-    };
-    this.pendingElements = [];
-    this.elements = [];
-    this.threeDElements = [];
-    this.destroyed = false;
-    this.camera = null;
-    this.supports3d = true;
-    this.rendererType = 'html';
+SVGRenderer.prototype.show = function () {
+  this.layerElement.style.display = 'block';
+};
 
+/* global extendPrototype, BaseRenderer, SVGRenderer, SVGShapeElement, HShapeElement, SVGTextLottieElement,
+HTextElement, HCameraElement, IImageElement, HImageElement, SVGCompElement, HCompElement, ISolidElement,
+HSolidElement, styleDiv, createTag, createNS */
+
+function HybridRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.renderConfig = {
+    className: (config && config.className) || '',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    hideOnTransparent: !(config && config.hideOnTransparent === false),
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '400%',
+      height: (config && config.filterSize && config.filterSize.height) || '400%',
+      x: (config && config.filterSize && config.filterSize.x) || '-100%',
+      y: (config && config.filterSize && config.filterSize.y) || '-100%',
+    },
+  };
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    renderConfig: this.renderConfig,
+  };
+  this.pendingElements = [];
+  this.elements = [];
+  this.threeDElements = [];
+  this.destroyed = false;
+  this.camera = null;
+  this.supports3d = true;
+  this.rendererType = 'html';
 }
 
-extendPrototype([BaseRenderer],HybridRenderer);
+extendPrototype([BaseRenderer], HybridRenderer);
 
 HybridRenderer.prototype.buildItem = SVGRenderer.prototype.buildItem;
 
-HybridRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-    }
+HybridRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+  }
 };
 
-HybridRenderer.prototype.appendElementInPos = function(element, pos){
-    var newDOMElement = element.getBaseElement();
-    if(!newDOMElement){
-        return;
-    }
-    var layer = this.layers[pos];
-    if(!layer.ddd || !this.supports3d){
-        if(this.threeDElements) {
-            this.addTo3dContainer(newDOMElement,pos);
-        } else {
-            var i = 0;
-            var nextDOMElement, nextLayer, tmpDOMElement;
-            while(i<pos){
-                if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement){
-                    nextLayer = this.elements[i];
-                    tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
-                    nextDOMElement = tmpDOMElement || nextDOMElement;
-                }
-                i += 1;
-            }
-            if(nextDOMElement){
-                if(!layer.ddd || !this.supports3d){
-                    this.layerElement.insertBefore(newDOMElement, nextDOMElement);
-                }
-            } else {
-                if(!layer.ddd || !this.supports3d){
-                    this.layerElement.appendChild(newDOMElement);
-                }
-            }
-        }
-        
+HybridRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newDOMElement = element.getBaseElement();
+  if (!newDOMElement) {
+    return;
+  }
+  var layer = this.layers[pos];
+  if (!layer.ddd || !this.supports3d) {
+    if (this.threeDElements) {
+      this.addTo3dContainer(newDOMElement, pos);
     } else {
-        this.addTo3dContainer(newDOMElement,pos);
+      var i = 0;
+      var nextDOMElement;
+      var nextLayer;
+      var tmpDOMElement;
+      while (i < pos) {
+        if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement) {
+          nextLayer = this.elements[i];
+          tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
+          nextDOMElement = tmpDOMElement || nextDOMElement;
+        }
+        i += 1;
+      }
+      if (nextDOMElement) {
+        if (!layer.ddd || !this.supports3d) {
+          this.layerElement.insertBefore(newDOMElement, nextDOMElement);
+        }
+      } else if (!layer.ddd || !this.supports3d) {
+        this.layerElement.appendChild(newDOMElement);
+      }
     }
+  } else {
+    this.addTo3dContainer(newDOMElement, pos);
+  }
 };
 
 HybridRenderer.prototype.createShape = function (data) {
-    if(!this.supports3d){
-        return new SVGShapeElement(data, this.globalData, this);
-    }
-    return new HShapeElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new SVGShapeElement(data, this.globalData, this);
+  }
+  return new HShapeElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createText = function (data) {
-    if(!this.supports3d){
-        return new SVGTextElement(data, this.globalData, this);
-    }
-    return new HTextElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new SVGTextLottieElement(data, this.globalData, this);
+  }
+  return new HTextElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createCamera = function (data) {
-    this.camera = new HCameraElement(data, this.globalData, this);
-    return this.camera;
+  this.camera = new HCameraElement(data, this.globalData, this);
+  return this.camera;
 };
 
 HybridRenderer.prototype.createImage = function (data) {
-    if(!this.supports3d){
-        return new IImageElement(data, this.globalData, this);
-    }
-    return new HImageElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new IImageElement(data, this.globalData, this);
+  }
+  return new HImageElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createComp = function (data) {
-    if(!this.supports3d){
-        return new SVGCompElement(data, this.globalData, this);
-    }
-    return new HCompElement(data, this.globalData, this);
-
+  if (!this.supports3d) {
+    return new SVGCompElement(data, this.globalData, this);
+  }
+  return new HCompElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createSolid = function (data) {
-    if(!this.supports3d){
-        return new ISolidElement(data, this.globalData, this);
-    }
-    return new HSolidElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new ISolidElement(data, this.globalData, this);
+  }
+  return new HSolidElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
 
-HybridRenderer.prototype.getThreeDContainerByPos = function(pos){
-    var i = 0, len = this.threeDElements.length;
-    while(i<len) {
-        if(this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
-            return this.threeDElements[i].perspectiveElem;
+HybridRenderer.prototype.getThreeDContainerByPos = function (pos) {
+  var i = 0;
+  var len = this.threeDElements.length;
+  while (i < len) {
+    if (this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
+      return this.threeDElements[i].perspectiveElem;
+    }
+    i += 1;
+  }
+  return null;
+};
+
+HybridRenderer.prototype.createThreeDContainer = function (pos, type) {
+  var perspectiveElem = createTag('div');
+  var style;
+  var containerStyle;
+  styleDiv(perspectiveElem);
+  var container = createTag('div');
+  styleDiv(container);
+  if (type === '3d') {
+    style = perspectiveElem.style;
+    style.width = this.globalData.compSize.w + 'px';
+    style.height = this.globalData.compSize.h + 'px';
+    var center = '50% 50%';
+    style.webkitTransformOrigin = center;
+    style.mozTransformOrigin = center;
+    style.transformOrigin = center;
+    containerStyle = container.style;
+    var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+    containerStyle.transform = matrix;
+    containerStyle.webkitTransform = matrix;
+  }
+
+  perspectiveElem.appendChild(container);
+  // this.resizerElem.appendChild(perspectiveElem);
+  var threeDContainerData = {
+    container: container,
+    perspectiveElem: perspectiveElem,
+    startPos: pos,
+    endPos: pos,
+    type: type,
+  };
+  this.threeDElements.push(threeDContainerData);
+  return threeDContainerData;
+};
+
+HybridRenderer.prototype.build3dContainers = function () {
+  var i;
+  var len = this.layers.length;
+  var lastThreeDContainerData;
+  var currentContainer = '';
+  for (i = 0; i < len; i += 1) {
+    if (this.layers[i].ddd && this.layers[i].ty !== 3) {
+      if (currentContainer !== '3d') {
+        currentContainer = '3d';
+        lastThreeDContainerData = this.createThreeDContainer(i, '3d');
+      }
+      lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
+    } else {
+      if (currentContainer !== '2d') {
+        currentContainer = '2d';
+        lastThreeDContainerData = this.createThreeDContainer(i, '2d');
+      }
+      lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
+    }
+  }
+  len = this.threeDElements.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
+  }
+};
+
+HybridRenderer.prototype.addTo3dContainer = function (elem, pos) {
+  var i = 0;
+  var len = this.threeDElements.length;
+  while (i < len) {
+    if (pos <= this.threeDElements[i].endPos) {
+      var j = this.threeDElements[i].startPos;
+      var nextElement;
+      while (j < pos) {
+        if (this.elements[j] && this.elements[j].getBaseElement) {
+          nextElement = this.elements[j].getBaseElement();
         }
-        i += 1;
+        j += 1;
+      }
+      if (nextElement) {
+        this.threeDElements[i].container.insertBefore(elem, nextElement);
+      } else {
+        this.threeDElements[i].container.appendChild(elem);
+      }
+      break;
     }
+    i += 1;
+  }
 };
 
-HybridRenderer.prototype.createThreeDContainer = function(pos, type){
-    var perspectiveElem = createTag('div');
-    styleDiv(perspectiveElem);
-    var container = createTag('div');
-    styleDiv(container);
-    if(type === '3d') {
-        perspectiveElem.style.width = this.globalData.compSize.w+'px';
-        perspectiveElem.style.height = this.globalData.compSize.h+'px';
-        perspectiveElem.style.transformOrigin = perspectiveElem.style.mozTransformOrigin = perspectiveElem.style.webkitTransformOrigin = "50% 50%";
-        container.style.transform = container.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
-    }
-    
-    perspectiveElem.appendChild(container);
-    //this.resizerElem.appendChild(perspectiveElem);
-    var threeDContainerData = {
-        container:container,
-        perspectiveElem:perspectiveElem,
-        startPos: pos,
-        endPos: pos,
-        type: type
-    };
-    this.threeDElements.push(threeDContainerData);
-    return threeDContainerData;
-};
+HybridRenderer.prototype.configAnimation = function (animData) {
+  var resizerElem = createTag('div');
+  var wrapper = this.animationItem.wrapper;
+  var style = resizerElem.style;
+  style.width = animData.w + 'px';
+  style.height = animData.h + 'px';
+  this.resizerElem = resizerElem;
+  styleDiv(resizerElem);
+  style.transformStyle = 'flat';
+  style.mozTransformStyle = 'flat';
+  style.webkitTransformStyle = 'flat';
+  if (this.renderConfig.className) {
+    resizerElem.setAttribute('class', this.renderConfig.className);
+  }
+  wrapper.appendChild(resizerElem);
 
-HybridRenderer.prototype.build3dContainers = function(){
-    var i, len = this.layers.length;
-    var lastThreeDContainerData;
-    var currentContainer = '';
-    for(i=0;i<len;i+=1){
-        if(this.layers[i].ddd && this.layers[i].ty !== 3){
-            if(currentContainer !== '3d'){
-                currentContainer = '3d';
-                lastThreeDContainerData = this.createThreeDContainer(i,'3d');
-            }
-            lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
-        } else {
-            if(currentContainer !== '2d'){
-                currentContainer = '2d';
-                lastThreeDContainerData = this.createThreeDContainer(i,'2d');
-            }
-            lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
-        }
-    }
-    len = this.threeDElements.length;
-    for(i = len - 1; i >= 0; i --) {
-        this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
-    }
-};
-
-HybridRenderer.prototype.addTo3dContainer = function(elem,pos){
-    var i = 0, len = this.threeDElements.length;
-    while(i<len){
-        if(pos <= this.threeDElements[i].endPos){
-            var j = this.threeDElements[i].startPos;
-            var nextElement;
-            while(j<pos){
-                if(this.elements[j] && this.elements[j].getBaseElement){
-                    nextElement = this.elements[j].getBaseElement();
-                }
-                j += 1;
-            }
-            if(nextElement){
-                this.threeDElements[i].container.insertBefore(elem, nextElement);
-            } else {
-                this.threeDElements[i].container.appendChild(elem);
-            }
-            break;
-        }
-        i += 1;
-    }
-};
-
-HybridRenderer.prototype.configAnimation = function(animData){
-    var resizerElem = createTag('div');
-    var wrapper = this.animationItem.wrapper;
-    resizerElem.style.width = animData.w+'px';
-    resizerElem.style.height = animData.h+'px';
-    this.resizerElem = resizerElem;
-    styleDiv(resizerElem);
-    resizerElem.style.transformStyle = resizerElem.style.webkitTransformStyle = resizerElem.style.mozTransformStyle = "flat";
-    if(this.renderConfig.className) {
-      resizerElem.setAttribute('class', this.renderConfig.className);
-    }
-    wrapper.appendChild(resizerElem);
-
-    resizerElem.style.overflow = 'hidden';
-    var svg = createNS('svg');
-    svg.setAttribute('width','1');
-    svg.setAttribute('height','1');
-    styleDiv(svg);
-    this.resizerElem.appendChild(svg);
-    var defs = createNS('defs');
-    svg.appendChild(defs);
-    this.data = animData;
-    //Mask animation
-    this.setupGlobalData(animData, svg);
-    this.globalData.defs = defs;
-    this.layers = animData.layers;
-    this.layerElement = this.resizerElem;
-    this.build3dContainers();
-    this.updateContainerSize();
+  style.overflow = 'hidden';
+  var svg = createNS('svg');
+  svg.setAttribute('width', '1');
+  svg.setAttribute('height', '1');
+  styleDiv(svg);
+  this.resizerElem.appendChild(svg);
+  var defs = createNS('defs');
+  svg.appendChild(defs);
+  this.data = animData;
+  // Mask animation
+  this.setupGlobalData(animData, svg);
+  this.globalData.defs = defs;
+  this.layers = animData.layers;
+  this.layerElement = this.resizerElem;
+  this.build3dContainers();
+  this.updateContainerSize();
 };
 
 HybridRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
-    }
-    this.animationItem.container = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        this.elements[i].destroy();
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.animationItem.container = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    this.elements[i].destroy();
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 HybridRenderer.prototype.updateContainerSize = function () {
-    var elementWidth = this.animationItem.wrapper.offsetWidth;
-    var elementHeight = this.animationItem.wrapper.offsetHeight;
-    var elementRel = elementWidth/elementHeight;
-    var animationRel = this.globalData.compSize.w/this.globalData.compSize.h;
-    var sx,sy,tx,ty;
-    if(animationRel>elementRel){
-        sx = elementWidth/(this.globalData.compSize.w);
-        sy = elementWidth/(this.globalData.compSize.w);
-        tx = 0;
-        ty = ((elementHeight-this.globalData.compSize.h*(elementWidth/this.globalData.compSize.w))/2);
-    }else{
-        sx = elementHeight/(this.globalData.compSize.h);
-        sy = elementHeight/(this.globalData.compSize.h);
-        tx = (elementWidth-this.globalData.compSize.w*(elementHeight/this.globalData.compSize.h))/2;
-        ty = 0;
-    }
-    this.resizerElem.style.transform = this.resizerElem.style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,'+sy+',0,0,0,0,1,0,'+tx+','+ty+',0,1)';
+  var elementWidth = this.animationItem.wrapper.offsetWidth;
+  var elementHeight = this.animationItem.wrapper.offsetHeight;
+  var elementRel = elementWidth / elementHeight;
+  var animationRel = this.globalData.compSize.w / this.globalData.compSize.h;
+  var sx;
+  var sy;
+  var tx;
+  var ty;
+  if (animationRel > elementRel) {
+    sx = elementWidth / (this.globalData.compSize.w);
+    sy = elementWidth / (this.globalData.compSize.w);
+    tx = 0;
+    ty = ((elementHeight - this.globalData.compSize.h * (elementWidth / this.globalData.compSize.w)) / 2);
+  } else {
+    sx = elementHeight / (this.globalData.compSize.h);
+    sy = elementHeight / (this.globalData.compSize.h);
+    tx = (elementWidth - this.globalData.compSize.w * (elementHeight / this.globalData.compSize.h)) / 2;
+    ty = 0;
+  }
+  var style = this.resizerElem.style;
+  style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,' + sy + ',0,0,0,0,1,0,' + tx + ',' + ty + ',0,1)';
+  style.transform = style.webkitTransform;
 };
 
 HybridRenderer.prototype.renderFrame = SVGRenderer.prototype.renderFrame;
 
-HybridRenderer.prototype.hide = function(){
-    this.resizerElem.style.display = 'none';
+HybridRenderer.prototype.hide = function () {
+  this.resizerElem.style.display = 'none';
 };
 
-HybridRenderer.prototype.show = function(){
-    this.resizerElem.style.display = 'block';
+HybridRenderer.prototype.show = function () {
+  this.resizerElem.style.display = 'block';
 };
 
-HybridRenderer.prototype.initItems = function(){
-    this.buildAllItems();
-    if(this.camera){
-        this.camera.setup();
+HybridRenderer.prototype.initItems = function () {
+  this.buildAllItems();
+  if (this.camera) {
+    this.camera.setup();
+  } else {
+    var cWidth = this.globalData.compSize.w;
+    var cHeight = this.globalData.compSize.h;
+    var i;
+    var len = this.threeDElements.length;
+    for (i = 0; i < len; i += 1) {
+      var style = this.threeDElements[i].perspectiveElem.style;
+      style.webkitPerspective = Math.sqrt(Math.pow(cWidth, 2) + Math.pow(cHeight, 2)) + 'px';
+      style.perspective = style.webkitPerspective;
+    }
+  }
+};
+
+HybridRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  var floatingContainer = createTag('div');
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i], floatingContainer, this.globalData.comp, null);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
+    }
+  }
+};
+
+/* global createSizedArray, createElementID, PropertyFactory, ShapePropertyFactory, createNS, locationHref */
+
+function MaskElement(data, element, globalData) {
+  this.data = data;
+  this.element = element;
+  this.globalData = globalData;
+  this.storedData = [];
+  this.masksProperties = this.data.masksProperties || [];
+  this.maskElement = null;
+  var defs = this.globalData.defs;
+  var i;
+  var len = this.masksProperties ? this.masksProperties.length : 0;
+  this.viewData = createSizedArray(len);
+  this.solidPath = '';
+
+  var path;
+  var properties = this.masksProperties;
+  var count = 0;
+  var currentMasks = [];
+  var j;
+  var jLen;
+  var layerId = createElementID();
+  var rect;
+  var expansor;
+  var feMorph;
+  var x;
+  var maskType = 'clipPath';
+  var maskRef = 'clip-path';
+  for (i = 0; i < len; i += 1) {
+    if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
+      maskType = 'mask';
+      maskRef = 'mask';
+    }
+
+    if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
+      rect = createNS('rect');
+      rect.setAttribute('fill', '#ffffff');
+      rect.setAttribute('width', this.element.comp.data.w || 0);
+      rect.setAttribute('height', this.element.comp.data.h || 0);
+      currentMasks.push(rect);
     } else {
-        var cWidth = this.globalData.compSize.w;
-        var cHeight = this.globalData.compSize.h;
-        var i, len = this.threeDElements.length;
-        for(i=0;i<len;i+=1){
-            this.threeDElements[i].perspectiveElem.style.perspective = this.threeDElements[i].perspectiveElem.style.webkitPerspective = Math.sqrt(Math.pow(cWidth,2) + Math.pow(cHeight,2)) + 'px';
-        }
-    }
-};
-
-HybridRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    var floatingContainer = createTag('div');
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i],floatingContainer,this.globalData.comp,null);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
-
-function MaskElement(data,element,globalData) {
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties || [];
-    this.maskElement = null;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties ? this.masksProperties.length : 0;
-    this.viewData = createSizedArray(len);
-    this.solidPath = '';
-
-
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = createElementID();
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
-            rect = createNS( 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w || 0);
-            rect.setAttribute('height', this.element.comp.data.h || 0);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = createNS( 'path');
-        if(properties[i].mode == 'n') {
-            // TODO move this to a factory or to a constructor
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-                elem: path,
-                lastPath: ''
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
-        path.setAttribute('clip-rule','nonzero');
-        var filterID;
-
-        if (properties[i].x.k !== 0) {
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
-            filterID = createElementID();
-            expansor = createNS('filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = createNS('feMorphology');
-            feMorph.setAttribute('operator','erode');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
-        } else {
-            feMorph = null;
-            x = null;
-        }
-
-        // TODO move this to a factory or to a constructor
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = createNS('g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = createNS('mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        // TODO move this to a factory or to a constructor
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-            invRect: rect
-        };
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
+      rect = null;
     }
 
-    this.maskElement = createNS( maskType);
+    path = createNS('path');
+    if (properties[i].mode === 'n') {
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        elem: path,
+        lastPath: '',
+      };
+      defs.appendChild(path);
+    } else {
+      count += 1;
 
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
-    }
+      path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      path.setAttribute('clip-rule', 'nonzero');
+      var filterID;
 
-    if(count > 0){
-        this.maskElement.setAttribute('id', layerId);
-        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
-        defs.appendChild(this.maskElement);
-    }
-    if (this.viewData.length) {
-        this.element.addRenderableComponent(this);
-    }
+      if (properties[i].x.k !== 0) {
+        maskType = 'mask';
+        maskRef = 'mask';
+        x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
+        filterID = createElementID();
+        expansor = createNS('filter');
+        expansor.setAttribute('id', filterID);
+        feMorph = createNS('feMorphology');
+        feMorph.setAttribute('operator', 'erode');
+        feMorph.setAttribute('in', 'SourceGraphic');
+        feMorph.setAttribute('radius', '0');
+        expansor.appendChild(feMorph);
+        defs.appendChild(expansor);
+        path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      } else {
+        feMorph = null;
+        x = null;
+      }
 
+      // TODO move this to a factory or to a constructor
+      this.storedData[i] = {
+        elem: path,
+        x: x,
+        expan: feMorph,
+        lastPath: '',
+        lastOperator: '',
+        filterId: filterID,
+        lastRadius: 0,
+      };
+      if (properties[i].mode === 'i') {
+        jLen = currentMasks.length;
+        var g = createNS('g');
+        for (j = 0; j < jLen; j += 1) {
+          g.appendChild(currentMasks[j]);
+        }
+        var mask = createNS('mask');
+        mask.setAttribute('mask-type', 'alpha');
+        mask.setAttribute('id', layerId + '_' + count);
+        mask.appendChild(path);
+        defs.appendChild(mask);
+        g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
+
+        currentMasks.length = 0;
+        currentMasks.push(g);
+      } else {
+        currentMasks.push(path);
+      }
+      if (properties[i].inv && !this.solidPath) {
+        this.solidPath = this.createLayerSolidPath();
+      }
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        elem: path,
+        lastPath: '',
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        invRect: rect,
+      };
+      if (!this.viewData[i].prop.k) {
+        this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
+      }
+    }
+  }
+
+  this.maskElement = createNS(maskType);
+
+  len = currentMasks.length;
+  for (i = 0; i < len; i += 1) {
+    this.maskElement.appendChild(currentMasks[i]);
+  }
+
+  if (count > 0) {
+    this.maskElement.setAttribute('id', layerId);
+    this.element.maskedElement.setAttribute(maskRef, 'url(' + locationHref + '#' + layerId + ')');
+    defs.appendChild(this.maskElement);
+  }
+  if (this.viewData.length) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
+MaskElement.prototype.getMaskProperty = function (pos) {
+  return this.viewData[pos].prop;
 };
 
 MaskElement.prototype.renderFrame = function (isFirstFrame) {
-    var finalMat = this.element.finalTransform.mat;
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop._mdf || isFirstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op._mdf || isFirstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
-                this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
-            }
-            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
+  var finalMat = this.element.finalTransform.mat;
+  var i;
+  var len = this.masksProperties.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.viewData[i].prop._mdf || isFirstFrame) {
+      this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
     }
+    if (this.viewData[i].op._mdf || isFirstFrame) {
+      this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
+    }
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
+        this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
+      }
+      if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
+        var feMorph = this.storedData[i].expan;
+        if (this.storedData[i].x.v < 0) {
+          if (this.storedData[i].lastOperator !== 'erode') {
+            this.storedData[i].lastOperator = 'erode';
+            this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
+          }
+          feMorph.setAttribute('radius', -this.storedData[i].x.v);
+        } else {
+          if (this.storedData[i].lastOperator !== 'dilate') {
+            this.storedData[i].lastOperator = 'dilate';
+            this.storedData[i].elem.setAttribute('filter', null);
+          }
+          this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
+        }
+      }
+    }
+  }
 };
 
 MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
+  return this.maskElement;
 };
 
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
+MaskElement.prototype.createLayerSolidPath = function () {
+  var path = 'M0,0 ';
+  path += ' h' + this.globalData.compSize.w;
+  path += ' v' + this.globalData.compSize.h;
+  path += ' h-' + this.globalData.compSize.w;
+  path += ' v-' + this.globalData.compSize.h + ' ';
+  return path;
 };
 
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //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];
-        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];
-    }
-        //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];
-    if(pathNodes.c && len > 1){
-        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];
-    }
-    //pathNodes.__renderedString = pathString;
+MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
+  var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
+  var i;
+  var len;
+  len = pathNodes._length;
+  for (i = 1; i < len; i += 1) {
+    // 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];
+    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];
+  }
+  // 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];
+  if (pathNodes.c && len > 1) {
+    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];
+  }
+  // pathNodes.__renderedString = pathString;
 
-    if(viewData.lastPath !== pathString){
-        var pathShapeValue = '';
-        if(viewData.elem){
-            if(pathNodes.c){
-                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
-            }
-            viewData.elem.setAttribute('d',pathShapeValue);
-        }
-        viewData.lastPath = pathString;
+  if (viewData.lastPath !== pathString) {
+    var pathShapeValue = '';
+    if (viewData.elem) {
+      if (pathNodes.c) {
+        pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
+      }
+      viewData.elem.setAttribute('d', pathShapeValue);
     }
+    viewData.lastPath = pathString;
+  }
 };
 
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.masksProperties = null;
+MaskElement.prototype.destroy = function () {
+  this.element = null;
+  this.globalData = null;
+  this.maskElement = null;
+  this.data = null;
+  this.masksProperties = null;
 };
 
 /**
- * @file 
+ * @file
  * Handles AE's layer parenting property.
  *
  */
 
-function HierarchyElement(){}
+function HierarchyElement() {}
 
 HierarchyElement.prototype = {
-	/**
-     * @function 
+  /**
+     * @function
      * Initializes hierarchy properties
      *
      */
-	initHierarchy: function() {
-		//element's parent list
-	    this.hierarchy = [];
-	    //if element is parent of another layer _isParent will be true
-	    this._isParent = false;
-	    this.checkParenting();
-	},
-	/**
-     * @function 
+  initHierarchy: function () {
+    // element's parent list
+    this.hierarchy = [];
+    // if element is parent of another layer _isParent will be true
+    this._isParent = false;
+    this.checkParenting();
+  },
+  /**
+     * @function
      * Sets layer's hierarchy.
      * @param {array} hierarch
      * layer's parent list
      *
-     */ 
-	setHierarchy: function(hierarchy){
-	    this.hierarchy = hierarchy;
-	},
-	/**
-     * @function 
+     */
+  setHierarchy: function (hierarchy) {
+    this.hierarchy = hierarchy;
+  },
+  /**
+     * @function
      * Sets layer as parent.
      *
-     */ 
-	setAsParent: function() {
-	    this._isParent = true;
-	},
-	/**
-     * @function 
+     */
+  setAsParent: function () {
+    this._isParent = true;
+  },
+  /**
+     * @function
      * Searches layer's parenting chain
      *
-     */ 
-	checkParenting: function(){
-	    if (this.data.parent !== undefined){
-	        this.comp.buildElementParenting(this, this.data.parent, []);
-	    }
-	}
+     */
+  checkParenting: function () {
+    if (this.data.parent !== undefined) {
+      this.comp.buildElementParenting(this, this.data.parent, []);
+    }
+  },
 };
+
 /**
- * @file 
+ * @file
  * Handles element's layer frame update.
  * Checks layer in point and out point
  *
  */
 
-function FrameElement(){}
+function FrameElement() {}
 
 FrameElement.prototype = {
-    /**
-     * @function 
+  /**
+     * @function
      * Initializes frame related properties.
      *
      */
-    initFrame: function(){
-        //set to true when inpoint is rendered
-        this._isFirstFrame = false;
-        //list of animated properties
-        this.dynamicProperties = [];
-        // If layer has been modified in current tick this will be true
-        this._mdf = false;
-    },
-    /**
-     * @function 
+  initFrame: function () {
+    // set to true when inpoint is rendered
+    this._isFirstFrame = false;
+    // list of animated properties
+    this.dynamicProperties = [];
+    // If layer has been modified in current tick this will be true
+    this._mdf = false;
+  },
+  /**
+     * @function
      * Calculates all dynamic values
      *
      * @param {number} num
      * current frame number in Layer's time
      * @param {boolean} isVisible
      * if layers is currently in range
-     * 
+     *
      */
-    prepareProperties: function(num, isVisible) {
-        var i, len = this.dynamicProperties.length;
-        for (i = 0;i < len; i += 1) {
-            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i]._mdf) {
-                    this.globalData._mdf = true;
-                    this._mdf = true;
-                }
-            }
+  prepareProperties: function (num, isVisible) {
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+        this.dynamicProperties[i].getValue();
+        if (this.dynamicProperties[i]._mdf) {
+          this.globalData._mdf = true;
+          this._mdf = true;
         }
-    },
-    addDynamicProperty: function(prop) {
-        if(this.dynamicProperties.indexOf(prop) === -1) {
-            this.dynamicProperties.push(prop);
-        }
+      }
     }
+  },
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+    }
+  },
 };
-function TransformElement(){}
+
+/* global TransformPropertyFactory, Matrix */
+
+function TransformElement() {}
 
 TransformElement.prototype = {
-    initTransform: function() {
-        this.finalTransform = {
-            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
-            _matMdf: false,
-            _opMdf: false,
-            mat: new Matrix()
-        };
-        if (this.data.ao) {
-            this.finalTransform.mProp.autoOriented = true;
-        }
+  initTransform: function () {
+    this.finalTransform = {
+      mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 },
+      _matMdf: false,
+      _opMdf: false,
+      mat: new Matrix(),
+    };
+    if (this.data.ao) {
+      this.finalTransform.mProp.autoOriented = true;
+    }
 
-        //TODO: check TYPE 11: Guided elements
-        if (this.data.ty !== 11) {
-            //this.createElements();
-        }
-    },
-    renderTransform: function() {
+    // TODO: check TYPE 11: Guided elements
+    if (this.data.ty !== 11) {
+      // this.createElements();
+    }
+  },
+  renderTransform: function () {
+    this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+    this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
 
-        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
-        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+    if (this.hierarchy) {
+      var mat;
+      var finalMat = this.finalTransform.mat;
+      var i = 0;
+      var len = this.hierarchy.length;
+      // Checking if any of the transformation matrices in the hierarchy chain has changed.
+      if (!this.finalTransform._matMdf) {
+        while (i < len) {
+          if (this.hierarchy[i].finalTransform.mProp._mdf) {
+            this.finalTransform._matMdf = true;
+            break;
+          }
+          i += 1;
+        }
+      }
 
-        if (this.hierarchy) {
-            var mat;
-            var finalMat = this.finalTransform.mat;
-            var i = 0, len = this.hierarchy.length;
-            //Checking if any of the transformation matrices in the hierarchy chain has changed.
-            if (!this.finalTransform._matMdf) {
-                while (i < len) {
-                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
-                        this.finalTransform._matMdf = true;
-                        break;
-                    }
-                    i += 1;
-                }
-            }
-            
-            if (this.finalTransform._matMdf) {
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-                for (i = 0; i < len; i += 1) {
-                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                    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]);
-                }
-            }
-        }
-    },
-    globalToLocal: function(pt) {
-        var transforms = [];
-        transforms.push(this.finalTransform);
-        var flag = true;
-        var comp = this.comp;
-        while (flag) {
-            if (comp.finalTransform) {
-                if (comp.data.hasMask) {
-                    transforms.splice(0, 0, comp.finalTransform);
-                }
-                comp = comp.comp;
-            } else {
-                flag = false;
-            }
-        }
-        var i, len = transforms.length,ptNew;
+      if (this.finalTransform._matMdf) {
+        mat = this.finalTransform.mProp.v.props;
+        finalMat.cloneFromProps(mat);
         for (i = 0; i < len; i += 1) {
-            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
-            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+          mat = this.hierarchy[i].finalTransform.mProp.v.props;
+          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]);
         }
-        return pt;
-    },
-    mHelper: new Matrix()
+      }
+    }
+  },
+  globalToLocal: function (pt) {
+    var transforms = [];
+    transforms.push(this.finalTransform);
+    var flag = true;
+    var comp = this.comp;
+    while (flag) {
+      if (comp.finalTransform) {
+        if (comp.data.hasMask) {
+          transforms.splice(0, 0, comp.finalTransform);
+        }
+        comp = comp.comp;
+      } else {
+        flag = false;
+      }
+    }
+    var i;
+    var len = transforms.length;
+    var ptNew;
+    for (i = 0; i < len; i += 1) {
+      ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+      // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+      pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+    }
+    return pt;
+  },
+  mHelper: new Matrix(),
 };
-function RenderableElement(){
+
+function RenderableElement() {
 
 }
 
 RenderableElement.prototype = {
-    initRenderable: function() {
-        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
-        this.isInRange = false;
-        //layer's display state
-        this.hidden = false;
-        // If layer's transparency equals 0, it can be hidden
-        this.isTransparent = false;
-        //list of animated components
-        this.renderableComponents = [];
-    },
-    addRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) === -1) {
-            this.renderableComponents.push(component);
-        }
-    },
-    removeRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) !== -1) {
-            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
-        }
-    },
-    prepareRenderableFrame: function(num) {
-        this.checkLayerLimits(num);
-    },
-    checkTransparency: function(){
-        if(this.finalTransform.mProp.o.v <= 0) {
-            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
-                this.isTransparent = true;
-                this.hide();
-            }
-        } else if(this.isTransparent) {
-            this.isTransparent = false;
-            this.show();
-        }
-    },
-    /**
-     * @function 
+  initRenderable: function () {
+    // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+    this.isInRange = false;
+    // layer's display state
+    this.hidden = false;
+    // If layer's transparency equals 0, it can be hidden
+    this.isTransparent = false;
+    // list of animated components
+    this.renderableComponents = [];
+  },
+  addRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) === -1) {
+      this.renderableComponents.push(component);
+    }
+  },
+  removeRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) !== -1) {
+      this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+    }
+  },
+  prepareRenderableFrame: function (num) {
+    this.checkLayerLimits(num);
+  },
+  checkTransparency: function () {
+    if (this.finalTransform.mProp.o.v <= 0) {
+      if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
+        this.isTransparent = true;
+        this.hide();
+      }
+    } else if (this.isTransparent) {
+      this.isTransparent = false;
+      this.show();
+    }
+  },
+  /**
+     * @function
      * Initializes frame related properties.
      *
      * @param {number} num
      * current frame number in Layer's time
-     * 
+     *
      */
-    checkLayerLimits: function(num) {
-        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-        {
-            if(this.isInRange !== true){
-                this.globalData._mdf = true;
-                this._mdf = true;
-                this.isInRange = true;
-                this.show();
-            }
-        } else {
-            if(this.isInRange !== false){
-                this.globalData._mdf = true;
-                this.isInRange = false;
-                this.hide();
-            }
-        }
-    },
-    renderRenderable: function() {
-        var i, len = this.renderableComponents.length;
-        for(i = 0; i < len; i += 1) {
-            this.renderableComponents[i].renderFrame(this._isFirstFrame);
-        }
-        /*this.maskManager.renderFrame(this.finalTransform.mat);
-        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
-    },
-    sourceRectAtTime: function(){
-        return {
-            top:0,
-            left:0,
-            width:100,
-            height:100
-        };
-    },
-    getLayerSize: function(){
-        if(this.data.ty === 5){
-            return {w:this.data.textData.width,h:this.data.textData.height};
-        }else{
-            return {w:this.data.width,h:this.data.height};
-        }
+  checkLayerLimits: function (num) {
+    if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
+      if (this.isInRange !== true) {
+        this.globalData._mdf = true;
+        this._mdf = true;
+        this.isInRange = true;
+        this.show();
+      }
+    } else if (this.isInRange !== false) {
+      this.globalData._mdf = true;
+      this.isInRange = false;
+      this.hide();
     }
+  },
+  renderRenderable: function () {
+    var i;
+    var len = this.renderableComponents.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderableComponents[i].renderFrame(this._isFirstFrame);
+    }
+    /* this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
+  },
+  sourceRectAtTime: function () {
+    return {
+      top: 0,
+      left: 0,
+      width: 100,
+      height: 100,
+    };
+  },
+  getLayerSize: function () {
+    if (this.data.ty === 5) {
+      return { w: this.data.textData.width, h: this.data.textData.height };
+    }
+    return { w: this.data.width, h: this.data.height };
+  },
 };
+
+/* global extendPrototype, RenderableElement, createProxyFunction */
+
 function RenderableDOMElement() {}
 
-(function(){
-    var _prototype = {
-        initElement: function(data,globalData,comp) {
-            this.initFrame();
-            this.initBaseData(data, globalData, comp);
-            this.initTransform(data, globalData, comp);
-            this.initHierarchy();
-            this.initRenderable();
-            this.initRendererElement();
-            this.createContainerElements();
-            this.createRenderableComponents();
-            this.createContent();
-            this.hide();
-        },
-        hide: function(){
-            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-                var elem = this.baseElement || this.layerElement;
-                elem.style.display = 'none';
-                this.hidden = true;
-            }
-        },
-        show: function(){
-            if (this.isInRange && !this.isTransparent){
-                if (!this.data.hd) {
-                    var elem = this.baseElement || this.layerElement;
-                    elem.style.display = 'block';
-                }
-                this.hidden = false;
-                this._isFirstFrame = true;
-            }
-        },
-        renderFrame: function() {
-            //If it is exported as hidden (data.hd === true) no need to render
-            //If it is not visible no need to render
-            if (this.data.hd || this.hidden) {
-                return;
-            }
-            this.renderTransform();
-            this.renderRenderable();
-            this.renderElement();
-            this.renderInnerContent();
-            if (this._isFirstFrame) {
-                this._isFirstFrame = false;
-            }
-        },
-        renderInnerContent: function() {},
-        prepareFrame: function(num) {
-            this._mdf = false;
-            this.prepareRenderableFrame(num);
-            this.prepareProperties(num, this.isInRange);
-            this.checkTransparency();
-        },
-        destroy: function(){
-            this.innerElem =  null;
-            this.destroyBaseElement();
+(function () {
+  var _prototype = {
+    initElement: function (data, globalData, comp) {
+      this.initFrame();
+      this.initBaseData(data, globalData, comp);
+      this.initTransform(data, globalData, comp);
+      this.initHierarchy();
+      this.initRenderable();
+      this.initRendererElement();
+      this.createContainerElements();
+      this.createRenderableComponents();
+      this.createContent();
+      this.hide();
+    },
+    hide: function () {
+      if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+        var elem = this.baseElement || this.layerElement;
+        elem.style.display = 'none';
+        this.hidden = true;
+      }
+    },
+    show: function () {
+      if (this.isInRange && !this.isTransparent) {
+        if (!this.data.hd) {
+          var elem = this.baseElement || this.layerElement;
+          elem.style.display = 'block';
         }
-    };
-    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+        this.hidden = false;
+        this._isFirstFrame = true;
+      }
+    },
+    renderFrame: function () {
+      // If it is exported as hidden (data.hd === true) no need to render
+      // If it is not visible no need to render
+      if (this.data.hd || this.hidden) {
+        return;
+      }
+      this.renderTransform();
+      this.renderRenderable();
+      this.renderElement();
+      this.renderInnerContent();
+      if (this._isFirstFrame) {
+        this._isFirstFrame = false;
+      }
+    },
+    renderInnerContent: function () {},
+    prepareFrame: function (num) {
+      this._mdf = false;
+      this.prepareRenderableFrame(num);
+      this.prepareProperties(num, this.isInRange);
+      this.checkTransparency();
+    },
+    destroy: function () {
+      this.innerElem = null;
+      this.destroyBaseElement();
+    },
+  };
+  extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
 }());
+
+/* exported ProcessedElement */
+
 function ProcessedElement(element, position) {
-	this.elem = element;
-	this.pos = position;
+  this.elem = element;
+  this.pos = position;
 }
+
+/* global createNS */
+
 function SVGStyleData(data, level) {
-	this.data = data;
-	this.type = data.ty;
-	this.d = '';
-	this.lvl = level;
-	this._mdf = false;
-	this.closed = data.hd === true;
-	this.pElem = createNS('path');
-	this.msElem = null;
+  this.data = data;
+  this.type = data.ty;
+  this.d = '';
+  this.lvl = level;
+  this._mdf = false;
+  this.closed = data.hd === true;
+  this.pElem = createNS('path');
+  this.msElem = null;
 }
 
-SVGStyleData.prototype.reset = function() {
-	this.d = '';
-	this._mdf = false;
+SVGStyleData.prototype.reset = function () {
+  this.d = '';
+  this._mdf = false;
 };
+
 function SVGShapeData(transformers, level, shape) {
-    this.caches = [];
-    this.styles = [];
-    this.transformers = transformers;
-    this.lStr = '';
-    this.sh = shape;
-    this.lvl = level;
-    //TODO find if there are some cases where _isAnimated can be false. 
-    // For now, since shapes add up with other shapes. They have to be calculated every time.
-    // One way of finding out is checking if all styles associated to this shape depend only of this shape
-    this._isAnimated = !!shape.k;
-    // TODO: commenting this for now since all shapes are animated
-    var i = 0, len = transformers.length;
-    while(i < len) {
-    	if(transformers[i].mProps.dynamicProperties.length) {
-    		this._isAnimated = true;
-    		break;
-    	}
-    	i += 1;
+  this.caches = [];
+  this.styles = [];
+  this.transformers = transformers;
+  this.lStr = '';
+  this.sh = shape;
+  this.lvl = level;
+  // TODO find if there are some cases where _isAnimated can be false.
+  // For now, since shapes add up with other shapes. They have to be calculated every time.
+  // One way of finding out is checking if all styles associated to this shape depend only of this shape
+  this._isAnimated = !!shape.k;
+  // TODO: commenting this for now since all shapes are animated
+  var i = 0;
+  var len = transformers.length;
+  while (i < len) {
+    if (transformers[i].mProps.dynamicProperties.length) {
+      this._isAnimated = true;
+      break;
     }
+    i += 1;
+  }
 }
 
-SVGShapeData.prototype.setAsAnimated = function() {
-    this._isAnimated = true;
-}
+SVGShapeData.prototype.setAsAnimated = function () {
+  this._isAnimated = true;
+};
+
+/* exported SVGTransformData */
+
 function SVGTransformData(mProps, op, container) {
-	this.transform = {
-		mProps: mProps,
-		op: op,
-		container: container
-	};
-	this.elements = [];
-    this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
+  this.transform = {
+    mProps: mProps,
+    op: op,
+    container: container,
+  };
+  this.elements = [];
+  this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
 }
-function SVGStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
-    this._isAnimated = !!this._isAnimated;
+
+/* global DashProperty, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
-function SVGFillStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
+
+/* global PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
-function SVGGradientFillStyleData(elem, data, styleOb){
-    this.initDynamicPropertyContainer(elem);
-    this.getValue = this.iterateDynamicProperties;
-    this.initGradientData(elem, data, styleOb);
+
+/* global PropertyFactory, degToRads, GradientProperty, createElementID, createNS, locationHref,
+extendPrototype, DynamicPropertyContainer */
+
+function SVGGradientFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.initGradientData(elem, data, styleOb);
 }
 
-SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){
-    this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-    this.s = PropertyFactory.getProp(elem,data.s,1,null,this);
-    this.e = PropertyFactory.getProp(elem,data.e,1,null,this);
-    this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this);
-    this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this);
-    this.g = new GradientProperty(elem,data.g,this);
-    this.style = styleOb;
-    this.stops = [];
-    this.setGradientData(styleOb.pElem, data);
-    this.setGradientOpacity(data, styleOb);
-    this._isAnimated = !!this._isAnimated;
-
+SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) {
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.s = PropertyFactory.getProp(elem, data.s, 1, null, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 1, null, this);
+  this.h = PropertyFactory.getProp(elem, data.h || { k: 0 }, 0, 0.01, this);
+  this.a = PropertyFactory.getProp(elem, data.a || { k: 0 }, 0, degToRads, this);
+  this.g = new GradientProperty(elem, data.g, this);
+  this.style = styleOb;
+  this.stops = [];
+  this.setGradientData(styleOb.pElem, data);
+  this.setGradientOpacity(data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 };
 
-SVGGradientFillStyleData.prototype.setGradientData = function(pathElement,data){
+SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) {
+  var gradientId = createElementID();
+  var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+  gfill.setAttribute('id', gradientId);
+  gfill.setAttribute('spreadMethod', 'pad');
+  gfill.setAttribute('gradientUnits', 'userSpaceOnUse');
+  var stops = [];
+  var stop;
+  var j;
+  var jLen;
+  jLen = data.g.p * 4;
+  for (j = 0; j < jLen; j += 4) {
+    stop = createNS('stop');
+    gfill.appendChild(stop);
+    stops.push(stop);
+  }
+  pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + gradientId + ')');
 
-    var gradientId = createElementID();
-    var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-    gfill.setAttribute('id',gradientId);
-    gfill.setAttribute('spreadMethod','pad');
-    gfill.setAttribute('gradientUnits','userSpaceOnUse');
-    var stops = [];
-    var stop, j, jLen;
-    jLen = data.g.p*4;
-    for(j=0;j<jLen;j+=4){
-        stop = createNS('stop');
-        gfill.appendChild(stop);
-        stops.push(stop);
-    }
-    pathElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+gradientId+')');
-    
-    this.gf = gfill;
-    this.cst = stops;
+  this.gf = gfill;
+  this.cst = stops;
 };
 
-SVGGradientFillStyleData.prototype.setGradientOpacity = function(data, styleOb){
-    if(this.g._hasOpacity && !this.g._collapsable){
-        var stop, j, jLen;
-        var mask = createNS("mask");
-        var maskElement = createNS( 'path');
-        mask.appendChild(maskElement);
-        var opacityId = createElementID();
-        var maskId = createElementID();
-        mask.setAttribute('id',maskId);
-        var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-        opFill.setAttribute('id',opacityId);
-        opFill.setAttribute('spreadMethod','pad');
-        opFill.setAttribute('gradientUnits','userSpaceOnUse');
-        jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
-        var stops = this.stops;
-        for(j=data.g.p*4;j<jLen;j+=2){
-            stop = createNS('stop');
-            stop.setAttribute('stop-color','rgb(255,255,255)');
-            opFill.appendChild(stop);
-            stops.push(stop);
-        }
-        maskElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+opacityId+')');
-        this.of = opFill;
-        this.ms = mask;
-        this.ost = stops;
-        this.maskId = maskId;
-        styleOb.msElem = maskElement;
+SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) {
+  if (this.g._hasOpacity && !this.g._collapsable) {
+    var stop;
+    var j;
+    var jLen;
+    var mask = createNS('mask');
+    var maskElement = createNS('path');
+    mask.appendChild(maskElement);
+    var opacityId = createElementID();
+    var maskId = createElementID();
+    mask.setAttribute('id', maskId);
+    var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+    opFill.setAttribute('id', opacityId);
+    opFill.setAttribute('spreadMethod', 'pad');
+    opFill.setAttribute('gradientUnits', 'userSpaceOnUse');
+    jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
+    var stops = this.stops;
+    for (j = data.g.p * 4; j < jLen; j += 2) {
+      stop = createNS('stop');
+      stop.setAttribute('stop-color', 'rgb(255,255,255)');
+      opFill.appendChild(stop);
+      stops.push(stop);
     }
+    maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + opacityId + ')');
+    this.of = opFill;
+    this.ms = mask;
+    this.ost = stops;
+    this.maskId = maskId;
+    styleOb.msElem = maskElement;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
-function SVGGradientStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-    this.initGradientData(elem, data, styleOb);
-    this._isAnimated = !!this._isAnimated;
+
+/* global PropertyFactory, DashProperty, extendPrototype, SVGGradientFillStyleData, DynamicPropertyContainer */
+
+function SVGGradientStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.initGradientData(elem, data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
+
+/* global createNS */
+/* exported ShapeGroupData */
+
 function ShapeGroupData() {
-	this.it = [];
-    this.prevViewData = [];
-    this.gr = createNS('g');
+  this.it = [];
+  this.prevViewData = [];
+  this.gr = createNS('g');
 }
-var SVGElementsRenderer = (function() {
-	var _identityMatrix = new Matrix();
-	var _matrixHelper = new Matrix();
 
-	var ob = {
-		createRenderFunction: createRenderFunction
-	}
+/* global Matrix, buildShapeString, bmFloor */
+/* exported SVGElementsRenderer */
 
-	function createRenderFunction(data) {
-	    var ty = data.ty;
-	    switch(data.ty) {
-	        case 'fl':
-	        return renderFill;
-	        case 'gf':
-	        return renderGradient;
-	        case 'gs':
-	        return renderGradientStroke;
-	        case 'st':
-	        return renderStroke;
-	        case 'sh':
-	        case 'el':
-	        case 'rc':
-	        case 'sr':
-	        return renderPath;
-	        case 'tr':
-	        return renderContentTransform;
-	    }
-	}
+var SVGElementsRenderer = (function () {
+  var _identityMatrix = new Matrix();
+  var _matrixHelper = new Matrix();
 
-	function renderContentTransform(styleData, itemData, isFirstFrame) {
-	    if(isFirstFrame || itemData.transform.op._mdf){
-	        itemData.transform.container.setAttribute('opacity',itemData.transform.op.v);
-	    }
-	    if(isFirstFrame || itemData.transform.mProps._mdf){
-	        itemData.transform.container.setAttribute('transform',itemData.transform.mProps.v.to2dCSS());
-	    }
-	}
+  var ob = {
+    createRenderFunction: createRenderFunction,
+  };
 
-	function renderPath(styleData, itemData, isFirstFrame) {
-	    var j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = itemData.styles.length;
-	    var lvl = itemData.lvl;
-	    var paths, mat, props, iterations, k;
-	    for(l=0;l<lLen;l+=1){
-	        redraw = itemData.sh._mdf || isFirstFrame;
-	        if(itemData.styles[l].lvl < lvl){
-	            mat = _matrixHelper.reset();
-	            iterations = lvl - itemData.styles[l].lvl;
-	            k = itemData.transformers.length-1;
-	            while(!redraw && iterations > 0) {
-	                redraw = itemData.transformers[k].mProps._mdf || redraw;
-	                iterations --;
-	                k --;
-	            }
-	            if(redraw) {
-	                iterations = lvl - itemData.styles[l].lvl;
-	                k = itemData.transformers.length-1;
-	                while(iterations > 0) {
-	                    props = itemData.transformers[k].mProps.v.props;
-	                    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]);
-	                    iterations --;
-	                    k --;
-	                }
-	            }
-	        } else {
-	            mat = _identityMatrix;
-	        }
-	        paths = itemData.sh.paths;
-	        jLen = paths._length;
-	        if(redraw){
-	            pathStringTransformed = '';
-	            for(j=0;j<jLen;j+=1){
-	                pathNodes = paths.shapes[j];
-	                if(pathNodes && pathNodes._length){
-	                    pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
-	                }
-	            }
-	            itemData.caches[l] = pathStringTransformed;
-	        } else {
-	            pathStringTransformed = itemData.caches[l];
-	        }
-	        itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
-	        itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
-	    }
-	}
+  function createRenderFunction(data) {
+    switch (data.ty) {
+      case 'fl':
+        return renderFill;
+      case 'gf':
+        return renderGradient;
+      case 'gs':
+        return renderGradientStroke;
+      case 'st':
+        return renderStroke;
+      case 'sh':
+      case 'el':
+      case 'rc':
+      case 'sr':
+        return renderPath;
+      case 'tr':
+        return renderContentTransform;
+      default:
+        return null;
+    }
+  }
 
-	function renderFill (styleData,itemData, isFirstFrame){
-	    var styleElem = itemData.style;
+  function renderContentTransform(styleData, itemData, isFirstFrame) {
+    if (isFirstFrame || itemData.transform.op._mdf) {
+      itemData.transform.container.setAttribute('opacity', itemData.transform.op.v);
+    }
+    if (isFirstFrame || itemData.transform.mProps._mdf) {
+      itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS());
+    }
+  }
 
-	    if(itemData.c._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill','rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill-opacity',itemData.o.v);
-	    }
-	};
+  function renderPath(styleData, itemData, isFirstFrame) {
+    var j;
+    var jLen;
+    var pathStringTransformed;
+    var redraw;
+    var pathNodes;
+    var l;
+    var lLen = itemData.styles.length;
+    var lvl = itemData.lvl;
+    var paths;
+    var mat;
+    var props;
+    var iterations;
+    var k;
+    for (l = 0; l < lLen; l += 1) {
+      redraw = itemData.sh._mdf || isFirstFrame;
+      if (itemData.styles[l].lvl < lvl) {
+        mat = _matrixHelper.reset();
+        iterations = lvl - itemData.styles[l].lvl;
+        k = itemData.transformers.length - 1;
+        while (!redraw && iterations > 0) {
+          redraw = itemData.transformers[k].mProps._mdf || redraw;
+          iterations -= 1;
+          k -= 1;
+        }
+        if (redraw) {
+          iterations = lvl - itemData.styles[l].lvl;
+          k = itemData.transformers.length - 1;
+          while (iterations > 0) {
+            props = itemData.transformers[k].mProps.v.props;
+            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]);
+            iterations -= 1;
+            k -= 1;
+          }
+        }
+      } else {
+        mat = _identityMatrix;
+      }
+      paths = itemData.sh.paths;
+      jLen = paths._length;
+      if (redraw) {
+        pathStringTransformed = '';
+        for (j = 0; j < jLen; j += 1) {
+          pathNodes = paths.shapes[j];
+          if (pathNodes && pathNodes._length) {
+            pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
+          }
+        }
+        itemData.caches[l] = pathStringTransformed;
+      } else {
+        pathStringTransformed = itemData.caches[l];
+      }
+      itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
+      itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
+    }
+  }
 
-	function renderGradientStroke (styleData, itemData, isFirstFrame) {
-	    renderGradient(styleData, itemData, isFirstFrame);
-	    renderStroke(styleData, itemData, isFirstFrame);
-	}
+  function renderFill(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
 
-	function renderGradient(styleData, itemData, isFirstFrame) {
-	    var gfill = itemData.gf;
-	    var hasOpacity = itemData.g._hasOpacity;
-	    var pt1 = itemData.s.v, pt2 = itemData.e.v;
+    if (itemData.c._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill-opacity', itemData.o.v);
+    }
+  }
 
-	    if (itemData.o._mdf || isFirstFrame) {
-	        var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
-	        itemData.style.pElem.setAttribute(attr, itemData.o.v);
-	    }
-	    if (itemData.s._mdf || isFirstFrame) {
-	        var attr1 = styleData.t === 1 ? 'x1' : 'cx';
-	        var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
-	        gfill.setAttribute(attr1, pt1[0]);
-	        gfill.setAttribute(attr2, pt1[1]);
-	        if (hasOpacity && !itemData.g._collapsable) {
-	            itemData.of.setAttribute(attr1, pt1[0]);
-	            itemData.of.setAttribute(attr2, pt1[1]);
-	        }
-	    }
-	    var stops, i, len, stop;
-	    if (itemData.g._cmdf || isFirstFrame) {
-	        stops = itemData.cst;
-	        var cValues = itemData.g.c;
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1){
-	            stop = stops[i];
-	            stop.setAttribute('offset', cValues[i * 4] + '%');
-	            stop.setAttribute('stop-color','rgb('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ')');
-	        }
-	    }
-	    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
-	        var oValues = itemData.g.o;
-	        if(itemData.g._collapsable) {
-	            stops = itemData.cst;
-	        } else {
-	            stops = itemData.ost;
-	        }
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1) {
-	            stop = stops[i];
-	            if(!itemData.g._collapsable) {
-	                stop.setAttribute('offset', oValues[i * 2] + '%');
-	            }
-	            stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
-	        }
-	    }
-	    if (styleData.t === 1) {
-	        if (itemData.e._mdf  || isFirstFrame) {
-	            gfill.setAttribute('x2', pt2[0]);
-	            gfill.setAttribute('y2', pt2[1]);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('x2', pt2[0]);
-	                itemData.of.setAttribute('y2', pt2[1]);
-	            }
-	        }
-	    } else {
-	        var rad;
-	        if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
-	            rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            gfill.setAttribute('r', rad);
-	            if(hasOpacity && !itemData.g._collapsable){
-	                itemData.of.setAttribute('r', rad);
-	            }
-	        }
-	        if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
-	            if (!rad) {
-	                rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            }
-	            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+  function renderGradientStroke(styleData, itemData, isFirstFrame) {
+    renderGradient(styleData, itemData, isFirstFrame);
+    renderStroke(styleData, itemData, isFirstFrame);
+  }
 
-	            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-	            var dist = rad * percent;
-	            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-	            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-	            gfill.setAttribute('fx', x);
-	            gfill.setAttribute('fy', y);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('fx', x);
-	                itemData.of.setAttribute('fy', y);
-	            }
-	        }
-	        //gfill.setAttribute('fy','200');
-	    }
-	};
+  function renderGradient(styleData, itemData, isFirstFrame) {
+    var gfill = itemData.gf;
+    var hasOpacity = itemData.g._hasOpacity;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
 
-	function renderStroke(styleData, itemData, isFirstFrame) {
-	    var styleElem = itemData.style;
-	    var d = itemData.d;
-	    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
-	        styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
-	        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
-	    }
-	    if(itemData.c && (itemData.c._mdf || isFirstFrame)){
-	        styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
-	    }
-	    if(itemData.w._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
-	        if(styleElem.msElem){
-	            styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
-	        }
-	    }
-	};
+    if (itemData.o._mdf || isFirstFrame) {
+      var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
+      itemData.style.pElem.setAttribute(attr, itemData.o.v);
+    }
+    if (itemData.s._mdf || isFirstFrame) {
+      var attr1 = styleData.t === 1 ? 'x1' : 'cx';
+      var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
+      gfill.setAttribute(attr1, pt1[0]);
+      gfill.setAttribute(attr2, pt1[1]);
+      if (hasOpacity && !itemData.g._collapsable) {
+        itemData.of.setAttribute(attr1, pt1[0]);
+        itemData.of.setAttribute(attr2, pt1[1]);
+      }
+    }
+    var stops;
+    var i;
+    var len;
+    var stop;
+    if (itemData.g._cmdf || isFirstFrame) {
+      stops = itemData.cst;
+      var cValues = itemData.g.c;
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        stop.setAttribute('offset', cValues[i * 4] + '%');
+        stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')');
+      }
+    }
+    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
+      var oValues = itemData.g.o;
+      if (itemData.g._collapsable) {
+        stops = itemData.cst;
+      } else {
+        stops = itemData.ost;
+      }
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        if (!itemData.g._collapsable) {
+          stop.setAttribute('offset', oValues[i * 2] + '%');
+        }
+        stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
+      }
+    }
+    if (styleData.t === 1) {
+      if (itemData.e._mdf || isFirstFrame) {
+        gfill.setAttribute('x2', pt2[0]);
+        gfill.setAttribute('y2', pt2[1]);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('x2', pt2[0]);
+          itemData.of.setAttribute('y2', pt2[1]);
+        }
+      }
+    } else {
+      var rad;
+      if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
+        rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        gfill.setAttribute('r', rad);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('r', rad);
+        }
+      }
+      if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
+        if (!rad) {
+          rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        }
+        var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
 
-	return ob;
-}())
+        var percent = itemData.h.v;
+        if (percent >= 1) {
+          percent = 0.99;
+        } else if (percent <= -1) {
+          percent = -0.99;
+        }
+        var dist = rad * percent;
+        var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+        var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+        gfill.setAttribute('fx', x);
+        gfill.setAttribute('fy', y);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('fx', x);
+          itemData.of.setAttribute('fy', y);
+        }
+      }
+      // gfill.setAttribute('fy','200');
+    }
+  }
+
+  function renderStroke(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
+    var d = itemData.d;
+    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
+      styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
+      styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
+    }
+    if (itemData.c && (itemData.c._mdf || isFirstFrame)) {
+      styleElem.pElem.setAttribute('stroke', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
+    }
+    if (itemData.w._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
+      if (styleElem.msElem) {
+        styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
+      }
+    }
+  }
+
+  return ob;
+}());
+
+/* global Matrix */
+
 function ShapeTransformManager() {
-	this.sequences = {};
-	this.sequenceList = [];
-    this.transform_key_count = 0;
+  this.sequences = {};
+  this.sequenceList = [];
+  this.transform_key_count = 0;
 }
 
 ShapeTransformManager.prototype = {
-	addTransformSequence: function(transforms) {
-		var i, len = transforms.length;
-		var key = '_';
-		for(i = 0; i < len; i += 1) {
-			key += transforms[i].transform.key + '_';
-		}
-		var sequence = this.sequences[key];
-		if(!sequence) {
-			sequence = {
-				transforms: [].concat(transforms),
-				finalTransform: new Matrix(),
-				_mdf: false
-			};
-			this.sequences[key] = sequence;
-			this.sequenceList.push(sequence);
-		}
-		return sequence;
-	},
-	processSequence: function(sequence, isFirstFrame) {
-		var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
-		while (i < len && !isFirstFrame) {
-			if (sequence.transforms[i].transform.mProps._mdf) {
-				_mdf = true;
-				break;
-			}
-			i += 1
-		}
-		if (_mdf) {
-			var props;
-			sequence.finalTransform.reset();
-			for (i = len - 1; i >= 0; i -= 1) {
-		        props = sequence.transforms[i].transform.mProps.v.props;
-		        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]);
-			}
-		}
-		sequence._mdf = _mdf;
-		
-	},
-	processSequences: function(isFirstFrame) {
-		var i, len = this.sequenceList.length;
-		for (i = 0; i < len; i += 1) {
-			this.processSequence(this.sequenceList[i], isFirstFrame);
-		}
+  addTransformSequence: function (transforms) {
+    var i;
+    var len = transforms.length;
+    var key = '_';
+    for (i = 0; i < len; i += 1) {
+      key += transforms[i].transform.key + '_';
+    }
+    var sequence = this.sequences[key];
+    if (!sequence) {
+      sequence = {
+        transforms: [].concat(transforms),
+        finalTransform: new Matrix(),
+        _mdf: false,
+      };
+      this.sequences[key] = sequence;
+      this.sequenceList.push(sequence);
+    }
+    return sequence;
+  },
+  processSequence: function (sequence, isFirstFrame) {
+    var i = 0;
+    var len = sequence.transforms.length;
+    var _mdf = isFirstFrame;
+    while (i < len && !isFirstFrame) {
+      if (sequence.transforms[i].transform.mProps._mdf) {
+        _mdf = true;
+        break;
+      }
+      i += 1;
+    }
+    if (_mdf) {
+      var props;
+      sequence.finalTransform.reset();
+      for (i = len - 1; i >= 0; i -= 1) {
+        props = sequence.transforms[i].transform.mProps.v.props;
+        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]);
+      }
+    }
+    sequence._mdf = _mdf;
+  },
+  processSequences: function (isFirstFrame) {
+    var i;
+    var len = this.sequenceList.length;
+    for (i = 0; i < len; i += 1) {
+      this.processSequence(this.sequenceList[i], isFirstFrame);
+    }
+  },
+  getNewKey: function () {
+    this.transform_key_count += 1;
+    return '_' + this.transform_key_count;
+  },
+};
 
-	},
-	getNewKey: function() {
-		return '_' + this.transform_key_count++;
-	}
-}
-function BaseElement(){
+/* global LayerExpressionInterface, EffectsExpressionInterface, CompExpressionInterface, ShapeExpressionInterface,
+TextExpressionInterface, getBlendMode,createElementID, EffectsManager */
+
+function BaseElement() {
 }
 
 BaseElement.prototype = {
-    checkMasks: function(){
-        if(!this.data.hasMask){
-            return false;
-        }
-        var i = 0, len = this.data.masksProperties.length;
-        while(i<len) {
-            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-                return true;
-            }
-            i += 1;
-        }
-        return false;
-    },
-    initExpressions: function(){
-        this.layerInterface = LayerExpressionInterface(this);
-        if(this.data.hasMask && this.maskManager) {
-            this.layerInterface.registerMaskInterface(this.maskManager);
-        }
-        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-        this.layerInterface.registerEffectsInterface(effectsInterface);
-
-        if(this.data.ty === 0 || this.data.xt){
-            this.compInterface = CompExpressionInterface(this);
-        } else if(this.data.ty === 4){
-            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
-            this.layerInterface.content = this.layerInterface.shapeInterface;
-        } else if(this.data.ty === 5){
-            this.layerInterface.textInterface = TextExpressionInterface(this);
-            this.layerInterface.text = this.layerInterface.textInterface;
-        }
-    },
-    setBlendMode: function(){
-        var blendModeValue = getBlendMode(this.data.bm);
-        var elem = this.baseElement || this.layerElement;
-
-        elem.style['mix-blend-mode'] = blendModeValue;
-    },
-    initBaseData: function(data, globalData, comp){
-        this.globalData = globalData;
-        this.comp = comp;
-        this.data = data;
-        this.layerId = createElementID();
-        
-        //Stretch factor for old animations missing this property.
-        if(!this.data.sr){
-            this.data.sr = 1;
-        }
-        // effects manager
-        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-        
-    },
-    getType: function(){
-        return this.type;
+  checkMasks: function () {
+    if (!this.data.hasMask) {
+      return false;
     }
-    ,sourceRectAtTime: function(){}
-}
-function NullElement(data,globalData,comp){
-    this.initFrame();
-	this.initBaseData(data, globalData, comp);
-    this.initFrame();
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
+    var i = 0;
+    var len = this.data.masksProperties.length;
+    while (i < len) {
+      if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+        return true;
+      }
+      i += 1;
+    }
+    return false;
+  },
+  initExpressions: function () {
+    this.layerInterface = LayerExpressionInterface(this);
+    if (this.data.hasMask && this.maskManager) {
+      this.layerInterface.registerMaskInterface(this.maskManager);
+    }
+    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
+    this.layerInterface.registerEffectsInterface(effectsInterface);
+
+    if (this.data.ty === 0 || this.data.xt) {
+      this.compInterface = CompExpressionInterface(this);
+    } else if (this.data.ty === 4) {
+      this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
+      this.layerInterface.content = this.layerInterface.shapeInterface;
+    } else if (this.data.ty === 5) {
+      this.layerInterface.textInterface = TextExpressionInterface(this);
+      this.layerInterface.text = this.layerInterface.textInterface;
+    }
+  },
+  setBlendMode: function () {
+    var blendModeValue = getBlendMode(this.data.bm);
+    var elem = this.baseElement || this.layerElement;
+
+    elem.style['mix-blend-mode'] = blendModeValue;
+  },
+  initBaseData: function (data, globalData, comp) {
+    this.globalData = globalData;
+    this.comp = comp;
+    this.data = data;
+    this.layerId = createElementID();
+
+    // Stretch factor for old animations missing this property.
+    if (!this.data.sr) {
+      this.data.sr = 1;
+    }
+    // effects manager
+    this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
+  },
+  getType: function () {
+    return this.type;
+  },
+  sourceRectAtTime: function () {},
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement */
+
+function NullElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initFrame();
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
 }
 
-NullElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
+NullElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-NullElement.prototype.renderFrame = function() {
+NullElement.prototype.renderFrame = function () {
 };
 
-NullElement.prototype.getBaseElement = function() {
-	return null;
+NullElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-NullElement.prototype.destroy = function() {
+NullElement.prototype.destroy = function () {
 };
 
-NullElement.prototype.sourceRectAtTime = function() {
+NullElement.prototype.sourceRectAtTime = function () {
 };
 
-NullElement.prototype.hide = function() {
+NullElement.prototype.hide = function () {
 };
 
-extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
 
-function SVGBaseElement(){
+/* global filtersFactory, featureSupport, filtersFactory, createElementID, createNS, MaskElement, SVGEffects, locationHref */
+
+function SVGBaseElement() {
 }
 
 SVGBaseElement.prototype = {
-    initRendererElement: function() {
-        this.layerElement = createNS('g');
-    },
-    createContainerElements: function(){
-        this.matteElement = createNS('g');
-        this.transformedElement = this.layerElement;
-        this.maskedElement = this.layerElement;
-        this._sizeChanged = false;
-        var layerElementParent = null;
-        //If this layer acts as a mask for the following layer
-        var filId, fil, gg;
-        if (this.data.td) {
-            if (this.data.td == 3 || this.data.td == 1) {
-                var masker = createNS('mask');
-                masker.setAttribute('id', this.layerId);
-                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
-                masker.appendChild(this.layerElement);
-                layerElementParent = masker;
-                this.globalData.defs.appendChild(masker);
-                // This is only for IE and Edge when mask if of type alpha
-                if (!featureSupport.maskType && this.data.td == 1) {
-                    masker.setAttribute('mask-type', 'luminance');
-                    filId = createElementID();
-                    fil = filtersFactory.createFilter(filId);
-                    this.globalData.defs.appendChild(fil);
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    masker.appendChild(gg);
-                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
-                }
-            } else if(this.data.td == 2) {
-                var maskGroup = createNS('mask');
-                maskGroup.setAttribute('id', this.layerId);
-                maskGroup.setAttribute('mask-type','alpha');
-                var maskGrouper = createNS('g');
-                maskGroup.appendChild(maskGrouper);
-                filId = createElementID();
-                fil = filtersFactory.createFilter(filId);
-                ////
+  initRendererElement: function () {
+    this.layerElement = createNS('g');
+  },
+  createContainerElements: function () {
+    this.matteElement = createNS('g');
+    this.transformedElement = this.layerElement;
+    this.maskedElement = this.layerElement;
+    this._sizeChanged = false;
+    var layerElementParent = null;
+    // If this layer acts as a mask for the following layer
+    var filId;
+    var fil;
+    var gg;
+    if (this.data.td) {
+      if (this.data.td == 3 || this.data.td == 1) { // eslint-disable-line eqeqeq
+        var masker = createNS('mask');
+        masker.setAttribute('id', this.layerId);
+        masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha'); // eslint-disable-line eqeqeq
+        masker.appendChild(this.layerElement);
+        layerElementParent = masker;
+        this.globalData.defs.appendChild(masker);
+        // This is only for IE and Edge when mask if of type alpha
+        if (!featureSupport.maskType && this.data.td == 1) { // eslint-disable-line eqeqeq
+          masker.setAttribute('mask-type', 'luminance');
+          filId = createElementID();
+          fil = filtersFactory.createFilter(filId);
+          this.globalData.defs.appendChild(fil);
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          masker.appendChild(gg);
+          gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        }
+      } else if (this.data.td == 2) { // eslint-disable-line eqeqeq
+        var maskGroup = createNS('mask');
+        maskGroup.setAttribute('id', this.layerId);
+        maskGroup.setAttribute('mask-type', 'alpha');
+        var maskGrouper = createNS('g');
+        maskGroup.appendChild(maskGrouper);
+        filId = createElementID();
+        fil = filtersFactory.createFilter(filId);
+        /// /
 
-                // This solution doesn't work on Android when meta tag with viewport attribute is set
-                /*var feColorMatrix = createNS('feColorMatrix');
+        // This solution doesn't work on Android when meta tag with viewport attribute is set
+        /* var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type', 'matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
                 feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-                fil.appendChild(feColorMatrix);*/
-                ////
-                var feCTr = createNS('feComponentTransfer');
-                feCTr.setAttribute('in','SourceGraphic');
-                fil.appendChild(feCTr);
-                var feFunc = createNS('feFuncA');
-                feFunc.setAttribute('type','table');
-                feFunc.setAttribute('tableValues','1.0 0.0');
-                feCTr.appendChild(feFunc);
-                ////
-                this.globalData.defs.appendChild(fil);
-                var alphaRect = createNS('rect');
-                alphaRect.setAttribute('width',  this.comp.data.w);
-                alphaRect.setAttribute('height', this.comp.data.h);
-                alphaRect.setAttribute('x','0');
-                alphaRect.setAttribute('y','0');
-                alphaRect.setAttribute('fill','#ffffff');
-                alphaRect.setAttribute('opacity','0');
-                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
-                maskGrouper.appendChild(alphaRect);
-                maskGrouper.appendChild(this.layerElement);
-                layerElementParent = maskGrouper;
-                if (!featureSupport.maskType) {
-                    maskGroup.setAttribute('mask-type', 'luminance');
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    maskGrouper.appendChild(alphaRect);
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    maskGrouper.appendChild(gg);
-                }
-                this.globalData.defs.appendChild(maskGroup);
-            }
-        } else if (this.data.tt) {
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        } else {
-            this.baseElement = this.layerElement;
+                fil.appendChild(feColorMatrix); */
+        /// /
+        var feCTr = createNS('feComponentTransfer');
+        feCTr.setAttribute('in', 'SourceGraphic');
+        fil.appendChild(feCTr);
+        var feFunc = createNS('feFuncA');
+        feFunc.setAttribute('type', 'table');
+        feFunc.setAttribute('tableValues', '1.0 0.0');
+        feCTr.appendChild(feFunc);
+        /// /
+        this.globalData.defs.appendChild(fil);
+        var alphaRect = createNS('rect');
+        alphaRect.setAttribute('width', this.comp.data.w);
+        alphaRect.setAttribute('height', this.comp.data.h);
+        alphaRect.setAttribute('x', '0');
+        alphaRect.setAttribute('y', '0');
+        alphaRect.setAttribute('fill', '#ffffff');
+        alphaRect.setAttribute('opacity', '0');
+        maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        maskGrouper.appendChild(alphaRect);
+        maskGrouper.appendChild(this.layerElement);
+        layerElementParent = maskGrouper;
+        if (!featureSupport.maskType) {
+          maskGroup.setAttribute('mask-type', 'luminance');
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          maskGrouper.appendChild(alphaRect);
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          maskGrouper.appendChild(gg);
         }
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id', this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
-        if (this.data.ty === 0 && !this.data.hd) {
-            var cp = createNS( 'clipPath');
-            var pt = createNS('path');
-            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
-            var clipId = createElementID();
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-
-            if (this.checkMasks()) {
-                var cpGroup = createNS('g');
-                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
-                cpGroup.appendChild(this.layerElement);
-                this.transformedElement = cpGroup;
-                if (layerElementParent) {
-                    layerElementParent.appendChild(this.transformedElement);
-                } else {
-                    this.baseElement = this.transformedElement;
-                }
-            } else {
-                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
-            }
-            
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-
-    },
-    renderElement: function() {
-        if (this.finalTransform._matMdf) {
-            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
-        }
-        if (this.finalTransform._opMdf) {
-            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
-        }
-    },
-    destroyBaseElement: function() {
-        this.layerElement = null;
-        this.matteElement = null;
-        this.maskManager.destroy();
-    },
-    getBaseElement: function() {
-        if (this.data.hd) {
-            return null;
-        }
-        return this.baseElement;
-    },
-    createRenderableComponents: function() {
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-        this.renderableEffectsManager = new SVGEffects(this);
-    },
-    setMatte: function(id) {
-        if (!this.matteElement) {
-            return;
-        }
-        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
+        this.globalData.defs.appendChild(maskGroup);
+      }
+    } else if (this.data.tt) {
+      this.matteElement.appendChild(this.layerElement);
+      layerElementParent = this.matteElement;
+      this.baseElement = this.matteElement;
+    } else {
+      this.baseElement = this.layerElement;
     }
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+    if (this.data.ty === 0 && !this.data.hd) {
+      var cp = createNS('clipPath');
+      var pt = createNS('path');
+      pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+      var clipId = createElementID();
+      cp.setAttribute('id', clipId);
+      cp.appendChild(pt);
+      this.globalData.defs.appendChild(cp);
+
+      if (this.checkMasks()) {
+        var cpGroup = createNS('g');
+        cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+        cpGroup.appendChild(this.layerElement);
+        this.transformedElement = cpGroup;
+        if (layerElementParent) {
+          layerElementParent.appendChild(this.transformedElement);
+        } else {
+          this.baseElement = this.transformedElement;
+        }
+      } else {
+        this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+      }
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    if (this.finalTransform._matMdf) {
+      this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+    }
+    if (this.finalTransform._opMdf) {
+      this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+    }
+  },
+  destroyBaseElement: function () {
+    this.layerElement = null;
+    this.matteElement = null;
+    this.maskManager.destroy();
+  },
+  getBaseElement: function () {
+    if (this.data.hd) {
+      return null;
+    }
+    return this.baseElement;
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+    this.renderableEffectsManager = new SVGEffects(this);
+  },
+  setMatte: function (id) {
+    if (!this.matteElement) {
+      return;
+    }
+    this.matteElement.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+  },
 };
-function IShapeElement(){
+
+/* global ProcessedElement */
+
+function IShapeElement() {
 }
 
 IShapeElement.prototype = {
-    addShapeToModifiers: function(data) {
-        var i, len = this.shapeModifiers.length;
-        for(i=0;i<len;i+=1){
-            this.shapeModifiers[i].addShape(data);
-        }
-    },
-    isShapeInAnimatedModifiers: function(data) {
-        var i = 0, len = this.shapeModifiers.length;
-        while(i < len) {
-            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
-                return true;
-            }
-        }
-        return false;
-    },
-    renderModifiers: function() {
-        if(!this.shapeModifiers.length){
-            return;
-        }
-        var i, len = this.shapes.length;
-        for(i=0;i<len;i+=1){
-            this.shapes[i].sh.reset();
-        }
-
-        len = this.shapeModifiers.length;
-        for(i=len-1;i>=0;i-=1){
-            this.shapeModifiers[i].processShapes(this._isFirstFrame);
-        }
-    },
-    lcEnum: {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'square'
-    },
-    ljEnum: {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    },
-    searchProcessedElement: function(elem){
-        var elements = this.processedElements;
-        var i = 0, len = elements.length;
-        while (i < len) {
-            if (elements[i].elem === elem) {
-                return elements[i].pos;
-            }
-            i += 1;
-        }
-        return 0;
-    },
-    addProcessedElement: function(elem, pos){
-        var elements = this.processedElements;
-        var i = elements.length;
-        while(i) {
-            i -= 1;
-            if (elements[i].elem === elem) {
-                elements[i].pos = pos;
-                return;
-            }
-        }
-        elements.push(new ProcessedElement(elem, pos));
-    },
-    prepareFrame: function(num) {
-        this.prepareRenderableFrame(num);
-        this.prepareProperties(num, this.isInRange);
+  addShapeToModifiers: function (data) {
+    var i;
+    var len = this.shapeModifiers.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapeModifiers[i].addShape(data);
     }
-};
-function ITextElement(){
-}
+  },
+  isShapeInAnimatedModifiers: function (data) {
+    var i = 0;
+    var len = this.shapeModifiers.length;
+    while (i < len) {
+      if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  renderModifiers: function () {
+    if (!this.shapeModifiers.length) {
+      return;
+    }
+    var i;
+    var len = this.shapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].sh.reset();
+    }
 
-ITextElement.prototype.initElement = function(data,globalData,comp){
-    this.lettersChangedFlag = true;
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
-    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
-    this.initRenderable();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    this.createContent();
-    this.hide();
-    this.textAnimator.searchProperties(this.dynamicProperties);
-};
-
-ITextElement.prototype.prepareFrame = function(num) {
-    this._mdf = false;
+    len = this.shapeModifiers.length;
+    for (i = len - 1; i >= 0; i -= 1) {
+      this.shapeModifiers[i].processShapes(this._isFirstFrame);
+    }
+  },
+  lcEnum: {
+    1: 'butt',
+    2: 'round',
+    3: 'square',
+  },
+  ljEnum: {
+    1: 'miter',
+    2: 'round',
+    3: 'bevel',
+  },
+  searchProcessedElement: function (elem) {
+    var elements = this.processedElements;
+    var i = 0;
+    var len = elements.length;
+    while (i < len) {
+      if (elements[i].elem === elem) {
+        return elements[i].pos;
+      }
+      i += 1;
+    }
+    return 0;
+  },
+  addProcessedElement: function (elem, pos) {
+    var elements = this.processedElements;
+    var i = elements.length;
+    while (i) {
+      i -= 1;
+      if (elements[i].elem === elem) {
+        elements[i].pos = pos;
+        return;
+      }
+    }
+    elements.push(new ProcessedElement(elem, pos));
+  },
+  prepareFrame: function (num) {
     this.prepareRenderableFrame(num);
     this.prepareProperties(num, this.isInRange);
-    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
-        this.buildNewText();
-        this.textProperty._isFirstFrame = false;
-        this.textProperty._mdf = false;
-    }
+  },
 };
 
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        pathNodes = shapes[j].ks.k;
-        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
-    }
-    return shapeStr;
+/* global TextProperty, TextAnimatorProperty, buildShapeString, LetterProps */
+
+function ITextElement() {
+}
+
+ITextElement.prototype.initElement = function (data, globalData, comp) {
+  this.lettersChangedFlag = true;
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+  this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
+  this.initRenderable();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  this.createContent();
+  this.hide();
+  this.textAnimator.searchProperties(this.dynamicProperties);
 };
 
-ITextElement.prototype.updateDocumentData = function(newData, index) {
-    this.textProperty.updateDocumentData(newData, index);
+ITextElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
+    this.buildNewText();
+    this.textProperty._isFirstFrame = false;
+    this.textProperty._mdf = false;
+  }
 };
 
-ITextElement.prototype.canResizeFont = function(_canResize) {
-    this.textProperty.canResizeFont(_canResize);
+ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
+  var j;
+  var jLen = shapes.length;
+  var pathNodes;
+  var shapeStr = '';
+  for (j = 0; j < jLen; j += 1) {
+    pathNodes = shapes[j].ks.k;
+    shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
+  }
+  return shapeStr;
 };
 
-ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
-    this.textProperty.setMinimumFontSize(_fontSize);
+ITextElement.prototype.updateDocumentData = function (newData, index) {
+  this.textProperty.updateDocumentData(newData, index);
 };
 
-ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
-    if(documentData.ps){
-        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-    }
-    matrixHelper.translate(0,-documentData.ls,0);
-    switch(documentData.j){
-        case 1:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
-            break;
-        case 2:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
-            break;
-    }
-    matrixHelper.translate(xPos, yPos, 0);
+ITextElement.prototype.canResizeFont = function (_canResize) {
+  this.textProperty.canResizeFont(_canResize);
 };
 
+ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
+  this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-ITextElement.prototype.buildColor = function(colorData) {
-    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
+ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
+  if (documentData.ps) {
+    matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+  }
+  matrixHelper.translate(0, -documentData.ls, 0);
+  switch (documentData.j) {
+    case 1:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
+      break;
+    case 2:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
+      break;
+    default:
+      break;
+  }
+  matrixHelper.translate(xPos, yPos, 0);
+};
+
+ITextElement.prototype.buildColor = function (colorData) {
+  return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
 
-ITextElement.prototype.destroy = function(){
-    
+ITextElement.prototype.destroy = function () {
+
 };
-function ICompElement(){}
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement */
+
+function ICompElement() {}
 
 extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
 
-ICompElement.prototype.initElement = function(data,globalData,comp) {
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.initTransform(data, globalData, comp);
-    this.initRenderable();
-    this.initHierarchy();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-    this.hide();
+ICompElement.prototype.initElement = function (data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initTransform(data, globalData, comp);
+  this.initRenderable();
+  this.initHierarchy();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  if (this.data.xt || !globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+  this.hide();
 };
 
-/*ICompElement.prototype.hide = function(){
+/* ICompElement.prototype.hide = function(){
     if(!this.hidden){
         this.hideElement();
         var i,len = this.elements.length;
@@ -8120,1141 +8604,1206 @@
             }
         }
     }
-};*/
+}; */
 
-ICompElement.prototype.prepareFrame = function(num){
-    this._mdf = false;
-    this.prepareRenderableFrame(num);
-    this.prepareProperties(num, this.isInRange);
-    if(!this.isInRange && !this.data.xt){
-        return;
-    }
+ICompElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (!this.isInRange && !this.data.xt) {
+    return;
+  }
 
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    if (timeRemapped === this.data.op) {
+      timeRemapped = this.data.op - 1;
     }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
+    this.renderedFrame = timeRemapped;
+  } else {
+    this.renderedFrame = num / this.data.sr;
+  }
+  var i;
+  var len = this.elements.length;
+  if (!this.completeLayers) {
+    this.checkLayers(this.renderedFrame);
+  }
+  // This iteration needs to be backwards because of how expressions connect between each other
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+      if (this.elements[i]._mdf) {
+        this._mdf = true;
+      }
     }
-    //This iteration needs to be backwards because of how expressions connect between each other
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-            if(this.elements[i]._mdf) {
-                this._mdf = true;
-            }
-        }
-    }
+  }
 };
 
-ICompElement.prototype.renderInnerContent = function() {
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i += 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+ICompElement.prototype.renderInnerContent = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
+ICompElement.prototype.setElements = function (elems) {
+  this.elements = elems;
 };
 
-ICompElement.prototype.getElements = function(){
-    return this.elements;
+ICompElement.prototype.getElements = function () {
+  return this.elements;
 };
 
-ICompElement.prototype.destroyElements = function(){
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
+ICompElement.prototype.destroyElements = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
+  }
 };
 
-ICompElement.prototype.destroy = function(){
-    this.destroyElements();
-    this.destroyBaseElement();
+ICompElement.prototype.destroy = function () {
+  this.destroyElements();
+  this.destroyBaseElement();
 };
 
-function IImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
-    this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, createNS */
+
+function IImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
+  this.sourceRect = {
+    top: 0, left: 0, width: this.assetData.w, height: this.assetData.h,
+  };
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
 
-IImageElement.prototype.createContent = function(){
+IImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.innerElem = createNS('image');
+  this.innerElem.setAttribute('width', this.assetData.w + 'px');
+  this.innerElem.setAttribute('height', this.assetData.h + 'px');
+  this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
+  this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
 
-    this.innerElem = createNS('image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    
-    this.layerElement.appendChild(this.innerElem);
+  this.layerElement.appendChild(this.innerElem);
 };
 
-IImageElement.prototype.sourceRectAtTime = function() {
-	return this.sourceRect;
-}
-function ISolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
+IImageElement.prototype.sourceRectAtTime = function () {
+  return this.sourceRect;
+};
+
+/* global extendPrototype, IImageElement, createNS */
+
+function ISolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createContent = function(){
-
-    var rect = createNS('rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
+ISolidElement.prototype.createContent = function () {
+  var rect = createNS('rect');
+  /// /rect.style.width = this.data.sw;
+  /// /rect.style.height = this.data.sh;
+  /// /rect.style.fill = this.data.sc;
+  rect.setAttribute('width', this.data.sw);
+  rect.setAttribute('height', this.data.sh);
+  rect.setAttribute('fill', this.data.sc);
+  this.layerElement.appendChild(rect);
 };
-function AudioElement(data,globalData,comp){
-    this.initFrame();
-    this.initRenderable();
-    this.assetData = globalData.getAssetData(data.refId);
-	this.initBaseData(data, globalData, comp);
-	this._isPlaying = false;
-	this._canPlay = false;
-	var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.audio = this.globalData.audioController.createAudio(assetPath);
-    this._currentTime = 0;
-    this.globalData.audioController.addAudio(this);
-    this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate,this) : {_placeholder:true};
+
+/* global PropertyFactory, extendPrototype, RenderableElement, BaseElement, FrameElement */
+
+function AudioElement(data, globalData, comp) {
+  this.initFrame();
+  this.initRenderable();
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initBaseData(data, globalData, comp);
+  this._isPlaying = false;
+  this._canPlay = false;
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.audio = this.globalData.audioController.createAudio(assetPath);
+  this._currentTime = 0;
+  this.globalData.audioController.addAudio(this);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
-AudioElement.prototype.prepareFrame = function(num) {
-    this.prepareRenderableFrame(num, true);
-    this.prepareProperties(num, true);
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        this._currentTime = timeRemapped;
-    } else {
-        this._currentTime = num / this.data.sr;
+AudioElement.prototype.prepareFrame = function (num) {
+  this.prepareRenderableFrame(num, true);
+  this.prepareProperties(num, true);
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    this._currentTime = timeRemapped;
+  } else {
+    this._currentTime = num / this.data.sr;
+  }
+};
+
+extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
+
+AudioElement.prototype.renderFrame = function () {
+  if (this.isInRange && this._canPlay) {
+    if (!this._isPlaying) {
+      this.audio.play();
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
+      this._isPlaying = true;
+    } else if (!this.audio.playing()
+      || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
+    ) {
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
     }
+  }
 };
 
-extendPrototype([RenderableElement,BaseElement,FrameElement], AudioElement);
-
-AudioElement.prototype.renderFrame = function() {
-	if (this.isInRange && this._canPlay) {
-		if (!this._isPlaying) {
-			this.audio.play();
-			this.audio.seek(this._currentTime / this.globalData.frameRate);
-			this._isPlaying = true;
-		} else if (!this.audio.playing()
-			|| Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
-		) {
-			this.audio.seek(this._currentTime / this.globalData.frameRate)
-		}
-	}
+AudioElement.prototype.show = function () {
+  // this.audio.play()
 };
 
-AudioElement.prototype.show = function() {
-	// this.audio.play()
+AudioElement.prototype.hide = function () {
+  this.audio.pause();
+  this._isPlaying = false;
 };
 
-AudioElement.prototype.hide = function() {
-	this.audio.pause();
-	this._isPlaying = false;
+AudioElement.prototype.pause = function () {
+  this.audio.pause();
+  this._isPlaying = false;
+  this._canPlay = false;
 };
 
-AudioElement.prototype.pause = function() {
-	this.audio.pause();
-	this._isPlaying = false;
-	this._canPlay = false;
+AudioElement.prototype.resume = function () {
+  this._canPlay = true;
 };
 
-AudioElement.prototype.resume = function() {
-	this._canPlay = true;
+AudioElement.prototype.setRate = function (rateValue) {
+  this.audio.rate(rateValue);
 };
 
-AudioElement.prototype.setRate = function(rateValue) {
-	this.audio.rate(rateValue);
+AudioElement.prototype.volume = function (volumeValue) {
+  this.audio.volume(volumeValue);
 };
 
-AudioElement.prototype.volume = function(volumeValue) {
-	this.audio.volume(volumeValue);
+AudioElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-AudioElement.prototype.getBaseElement = function() {
-	return null;
+AudioElement.prototype.destroy = function () {
 };
 
-AudioElement.prototype.destroy = function() {
+AudioElement.prototype.sourceRectAtTime = function () {
 };
 
-AudioElement.prototype.sourceRectAtTime = function() {
+AudioElement.prototype.initExpressions = function () {
 };
 
-AudioElement.prototype.initExpressions = function() {
-};
+/* global createSizedArray, PropertyFactory, extendPrototype, SVGRenderer, ICompElement, SVGBaseElement */
 
-
-function SVGCompElement(data,globalData,comp){
-    this.layers = data.layers;
-    this.supports3d = true;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
-    //this.layerElement = createNS('g');
-    this.initElement(data,globalData,comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+function SVGCompElement(data, globalData, comp) {
+  this.layers = data.layers;
+  this.supports3d = true;
+  this.completeLayers = false;
+  this.pendingElements = [];
+  this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+  // this.layerElement = createNS('g');
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement);
-function SVGTextElement(data,globalData,comp){
-    this.textSpans = [];
-    this.renderType = 'svg';
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, ITextElement, createSizedArray, createNS */
+
+function SVGTextLottieElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.renderType = 'svg';
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], SVGTextElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement);
 
-SVGTextElement.prototype.createContent = function(){
-
-    if (this.data.singleShape && !this.globalData.fontManager.chars) {
-        this.textContainer = createNS('text');
-    }
+SVGTextLottieElement.prototype.createContent = function () {
+  if (this.data.singleShape && !this.globalData.fontManager.chars) {
+    this.textContainer = createNS('text');
+  }
 };
 
-SVGTextElement.prototype.buildTextContents = function(textArray) {
-    var i = 0, len = textArray.length;
-    var textContents = [], currentTextContent = '';
-    while (i < len) {
-        if(textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
-            textContents.push(currentTextContent);
-            currentTextContent = '';
+SVGTextLottieElement.prototype.buildTextContents = function (textArray) {
+  var i = 0;
+  var len = textArray.length;
+  var textContents = [];
+  var currentTextContent = '';
+  while (i < len) {
+    if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
+      textContents.push(currentTextContent);
+      currentTextContent = '';
+    } else {
+      currentTextContent += textArray[i];
+    }
+    i += 1;
+  }
+  textContents.push(currentTextContent);
+  return textContents;
+};
+
+SVGTextLottieElement.prototype.buildNewText = function () {
+  var i;
+  var len;
+
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
+  if (documentData.fc) {
+    this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
+  } else {
+    this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
+  }
+  if (documentData.sc) {
+    this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
+    this.layerElement.setAttribute('stroke-width', documentData.sw);
+  }
+  this.layerElement.setAttribute('font-size', documentData.finalSize);
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  if (fontData.fClass) {
+    this.layerElement.setAttribute('class', fontData.fClass);
+  } else {
+    this.layerElement.setAttribute('font-family', fontData.fFamily);
+    var fWeight = documentData.fWeight;
+    var fStyle = documentData.fStyle;
+    this.layerElement.setAttribute('font-style', fStyle);
+    this.layerElement.setAttribute('font-weight', fWeight);
+  }
+  this.layerElement.setAttribute('aria-label', documentData.t);
+
+  var letters = documentData.l || [];
+  var usesGlyphs = !!this.globalData.fontManager.chars;
+  len = letters.length;
+
+  var tSpan;
+  var matrixHelper = this.mHelper;
+  var shapes;
+  var shapeStr = '';
+  var singleShape = this.data.singleShape;
+  var xPos = 0;
+  var yPos = 0;
+  var firstLine = true;
+  var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
+  if (singleShape && !usesGlyphs && !documentData.sz) {
+    var tElement = this.textContainer;
+    var justify = 'start';
+    switch (documentData.j) {
+      case 1:
+        justify = 'end';
+        break;
+      case 2:
+        justify = 'middle';
+        break;
+      default:
+        justify = 'start';
+        break;
+    }
+    tElement.setAttribute('text-anchor', justify);
+    tElement.setAttribute('letter-spacing', trackingOffset);
+    var textContent = this.buildTextContents(documentData.finalText);
+    len = textContent.length;
+    yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
+    for (i = 0; i < len; i += 1) {
+      tSpan = this.textSpans[i] || createNS('tspan');
+      tSpan.textContent = textContent[i];
+      tSpan.setAttribute('x', 0);
+      tSpan.setAttribute('y', yPos);
+      tSpan.style.display = 'inherit';
+      tElement.appendChild(tSpan);
+      this.textSpans[i] = tSpan;
+      yPos += documentData.finalLineHeight;
+    }
+
+    this.layerElement.appendChild(tElement);
+  } else {
+    var cachedSpansLength = this.textSpans.length;
+    var shapeData;
+    var charData;
+    for (i = 0; i < len; i += 1) {
+      if (!usesGlyphs || !singleShape || i === 0) {
+        tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs ? 'path' : 'text');
+        if (cachedSpansLength <= i) {
+          tSpan.setAttribute('stroke-linecap', 'butt');
+          tSpan.setAttribute('stroke-linejoin', 'round');
+          tSpan.setAttribute('stroke-miterlimit', '4');
+          this.textSpans[i] = tSpan;
+          this.layerElement.appendChild(tSpan);
+        }
+        tSpan.style.display = 'inherit';
+      }
+
+      matrixHelper.reset();
+      matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+      if (singleShape) {
+        if (letters[i].n) {
+          xPos = -trackingOffset;
+          yPos += documentData.yOffset;
+          yPos += firstLine ? 1 : 0;
+          firstLine = false;
+        }
+        this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
+        xPos += letters[i].l || 0;
+        // xPos += letters[i].val === ' ' ? 0 : trackingOffset;
+        xPos += trackingOffset;
+      }
+      if (usesGlyphs) {
+        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+        shapeData = (charData && charData.data) || {};
+        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+        if (!singleShape) {
+          tSpan.setAttribute('d', this.createPathShape(matrixHelper, shapes));
         } else {
-            currentTextContent += textArray[i];
+          shapeStr += this.createPathShape(matrixHelper, shapes);
         }
-        i += 1;
+      } else {
+        if (singleShape) {
+          tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')');
+        }
+        tSpan.textContent = letters[i].val;
+        tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
+      }
+      //
     }
-    textContents.push(currentTextContent);
-    return textContents;
+    if (singleShape && tSpan) {
+      tSpan.setAttribute('d', shapeStr);
+    }
+  }
+  while (i < this.textSpans.length) {
+    this.textSpans[i].style.display = 'none';
+    i += 1;
+  }
+
+  this._sizeChanged = true;
+};
+
+SVGTextLottieElement.prototype.sourceRectAtTime = function () {
+  this.prepareFrame(this.comp.renderedFrame - this.data.st);
+  this.renderInnerContent();
+  if (this._sizeChanged) {
+    this._sizeChanged = false;
+    var textBox = this.layerElement.getBBox();
+    this.bbox = {
+      top: textBox.y,
+      left: textBox.x,
+      width: textBox.width,
+      height: textBox.height,
+    };
+  }
+  return this.bbox;
+};
+
+SVGTextLottieElement.prototype.renderInnerContent = function () {
+  if (!this.data.singleShape) {
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+    if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
+      this._sizeChanged = true;
+      var i;
+      var len;
+      var renderedLetters = this.textAnimator.renderedLetters;
+
+      var letters = this.textProperty.currentData.l;
+
+      len = letters.length;
+      var renderedLetter;
+      var textSpan;
+      for (i = 0; i < len; i += 1) {
+        if (!letters[i].n) {
+          renderedLetter = renderedLetters[i];
+          textSpan = this.textSpans[i];
+          if (renderedLetter._mdf.m) {
+            textSpan.setAttribute('transform', renderedLetter.m);
+          }
+          if (renderedLetter._mdf.o) {
+            textSpan.setAttribute('opacity', renderedLetter.o);
+          }
+          if (renderedLetter._mdf.sw) {
+            textSpan.setAttribute('stroke-width', renderedLetter.sw);
+          }
+          if (renderedLetter._mdf.sc) {
+            textSpan.setAttribute('stroke', renderedLetter.sc);
+          }
+          if (renderedLetter._mdf.fc) {
+            textSpan.setAttribute('fill', renderedLetter.fc);
+          }
+        }
+      }
+    }
+  }
+};
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement,
+FrameElement, RenderableDOMElement, Matrix, SVGStyleData, SVGStrokeStyleData, SVGFillStyleData,
+SVGGradientFillStyleData, SVGGradientStrokeStyleData, locationHref, getBlendMode, ShapeGroupData,
+TransformPropertyFactory, SVGTransformData, ShapePropertyFactory, SVGShapeData, SVGElementsRenderer, ShapeModifiers */
+
+function SVGShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
 }
 
-SVGTextElement.prototype.buildNewText = function(){
-    var i, len;
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
 
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
-    if(documentData.fc) {
-        this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
-    }else{
-        this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
-    }
-    if(documentData.sc){
-        this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
-        this.layerElement.setAttribute('stroke-width', documentData.sw);
-    }
-    this.layerElement.setAttribute('font-size', documentData.finalSize);
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(fontData.fClass){
-        this.layerElement.setAttribute('class',fontData.fClass);
-    } else {
-        this.layerElement.setAttribute('font-family', fontData.fFamily);
-        var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-        this.layerElement.setAttribute('font-style', fStyle);
-        this.layerElement.setAttribute('font-weight', fWeight);
-    }
-    this.layerElement.setAttribute('aria-label', documentData.t);
-
-    var letters = documentData.l || [];
-    var usesGlyphs = !!this.globalData.fontManager.chars;
-    len = letters.length;
-
-    var tSpan;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '', singleShape = this.data.singleShape;
-    var xPos = 0, yPos = 0, firstLine = true;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    if(singleShape && !usesGlyphs && !documentData.sz) {
-        var tElement = this.textContainer;
-        var justify = 'start';
-        switch(documentData.j) {
-            case 1:
-                justify = 'end';
-                break;
-            case 2:
-                justify = 'middle';
-                break;
-        }
-        tElement.setAttribute('text-anchor',justify);
-        tElement.setAttribute('letter-spacing',trackingOffset);
-        var textContent = this.buildTextContents(documentData.finalText);
-        len = textContent.length;
-        yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
-        for ( i = 0; i < len; i += 1) {
-            tSpan = this.textSpans[i] || createNS('tspan');
-            tSpan.textContent = textContent[i];
-            tSpan.setAttribute('x', 0);
-            tSpan.setAttribute('y', yPos);
-            tSpan.style.display = 'inherit';
-            tElement.appendChild(tSpan);
-            this.textSpans[i] = tSpan;
-            yPos += documentData.finalLineHeight;
-        }
-        
-        this.layerElement.appendChild(tElement);
-    } else {
-        var cachedSpansLength = this.textSpans.length;
-        var shapeData, charData;
-        for (i = 0; i < len; i += 1) {
-            if(!usesGlyphs || !singleShape || i === 0){
-                tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs?'path':'text');
-                if (cachedSpansLength <= i) {
-                    tSpan.setAttribute('stroke-linecap', 'butt');
-                    tSpan.setAttribute('stroke-linejoin','round');
-                    tSpan.setAttribute('stroke-miterlimit','4');
-                    this.textSpans[i] = tSpan;
-                    this.layerElement.appendChild(tSpan);
-                }
-                tSpan.style.display = 'inherit';
-            }
-            
-            matrixHelper.reset();
-            matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
-            if (singleShape) {
-                if(letters[i].n) {
-                    xPos = -trackingOffset;
-                    yPos += documentData.yOffset;
-                    yPos += firstLine ? 1 : 0;
-                    firstLine = false;
-                }
-                this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
-                xPos += letters[i].l || 0;
-                //xPos += letters[i].val === ' ' ? 0 : trackingOffset;
-                xPos += trackingOffset;
-            }
-            if(usesGlyphs) {
-                charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-                shapeData = charData && charData.data || {};
-                shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
-                if(!singleShape){
-                    tSpan.setAttribute('d',this.createPathShape(matrixHelper,shapes));
-                } else {
-                    shapeStr += this.createPathShape(matrixHelper,shapes);
-                }
-            } else {
-                if(singleShape) {
-                    tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")");
-                }
-                tSpan.textContent = letters[i].val;
-                tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            }
-            //
-        }
-        if (singleShape && tSpan) {
-            tSpan.setAttribute('d',shapeStr);
-        }
-    }
-    while (i < this.textSpans.length){
-        this.textSpans[i].style.display = 'none';
-        i += 1;
-    }
-    
-    this._sizeChanged = true;
-};
-
-SVGTextElement.prototype.sourceRectAtTime = function(time){
-    this.prepareFrame(this.comp.renderedFrame - this.data.st);
-    this.renderInnerContent();
-    if(this._sizeChanged){
-        this._sizeChanged = false;
-        var textBox = this.layerElement.getBBox();
-        this.bbox = {
-            top: textBox.y,
-            left: textBox.x,
-            width: textBox.width,
-            height: textBox.height
-        };
-    }
-    return this.bbox;
-};
-
-SVGTextElement.prototype.renderInnerContent = function(){
-
-    if(!this.data.singleShape){
-        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
-        if(this.lettersChangedFlag || this.textAnimator.lettersChangedFlag){
-            this._sizeChanged = true;
-            var  i,len;
-            var renderedLetters = this.textAnimator.renderedLetters;
-
-            var letters = this.textProperty.currentData.l;
-
-            len = letters.length;
-            var renderedLetter, textSpan;
-            for(i=0;i<len;i+=1){
-                if(letters[i].n){
-                    continue;
-                }
-                renderedLetter = renderedLetters[i];
-                textSpan = this.textSpans[i];
-                if(renderedLetter._mdf.m) {
-                    textSpan.setAttribute('transform',renderedLetter.m);
-                }
-                if(renderedLetter._mdf.o) {
-                    textSpan.setAttribute('opacity',renderedLetter.o);
-                }
-                if(renderedLetter._mdf.sw){
-                    textSpan.setAttribute('stroke-width',renderedLetter.sw);
-                }
-                if(renderedLetter._mdf.sc){
-                    textSpan.setAttribute('stroke',renderedLetter.sc);
-                }
-                if(renderedLetter._mdf.fc){
-                    textSpan.setAttribute('fill',renderedLetter.fc);
-                }
-            }
-        }
-    }
-};
-
-function SVGShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
-}
-
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
-
-SVGShapeElement.prototype.initSecondaryElement = function() {
+SVGShapeElement.prototype.initSecondaryElement = function () {
 };
 
 SVGShapeElement.prototype.identityMatrix = new Matrix();
 
-SVGShapeElement.prototype.buildExpressionInterface = function(){};
+SVGShapeElement.prototype.buildExpressionInterface = function () {};
 
-SVGShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
+SVGShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
 };
 
 /*
 This method searches for multiple shapes that affect a single element and one of them is animated
 */
-SVGShapeElement.prototype.filterUniqueShapes = function(){
-    var i, len = this.shapes.length, shape;
-    var j, jLen = this.stylesList.length;
-    var style, count = 0;
-    var tempShapes = [];
-    var areAnimated = false;
-    for(j = 0; j < jLen; j += 1) {
-        style = this.stylesList[j];
-        areAnimated = false;
-        tempShapes.length = 0;
-        for(i = 0; i < len; i += 1) {
-            shape = this.shapes[i];
-            if(shape.styles.indexOf(style) !== -1) {
-                tempShapes.push(shape);
-                areAnimated = shape._isAnimated || areAnimated;
-            }
-        }
-        if(tempShapes.length > 1 && areAnimated) {
-            this.setShapesAsAnimated(tempShapes);
-        }
-    }
-}
-
-SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
-    var i, len = shapes.length;
-    for(i = 0; i < len; i += 1) {
-        shapes[i].setAsAnimated();
-    }
-}
-
-SVGShapeElement.prototype.createStyleElement = function(data, level){
-    //TODO: prevent drawing of hidden styles
-    var elementData;
-    var styleOb = new SVGStyleData(data, level);
-
-    var pathElement = styleOb.pElem;
-    if(data.ty === 'st') {
-        elementData = new SVGStrokeStyleData(this, data, styleOb);
-    } else if(data.ty === 'fl') {
-        elementData = new SVGFillStyleData(this, data, styleOb);
-    } else if(data.ty === 'gf' || data.ty === 'gs') {
-        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
-        elementData = new gradientConstructor(this, data, styleOb);
-        this.globalData.defs.appendChild(elementData.gf);
-        if (elementData.maskId) {
-            this.globalData.defs.appendChild(elementData.ms);
-            this.globalData.defs.appendChild(elementData.of);
-            pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
-        }
-    }
-    
-    if(data.ty === 'st' || data.ty === 'gs') {
-        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
-        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
-        pathElement.setAttribute('fill-opacity','0');
-        if(data.lj === 1) {
-            pathElement.setAttribute('stroke-miterlimit',data.ml);
-        }
-    }
-
-    if(data.r === 2) {
-        pathElement.setAttribute('fill-rule', 'evenodd');
-    }
-
-    if(data.ln){
-        pathElement.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        pathElement.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    this.stylesList.push(styleOb);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = new ShapeGroupData();
-    if(data.ln){
-        elementData.gr.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        elementData.gr.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    return elementData;
-};
-
-SVGShapeElement.prototype.createTransformElement = function(data, container) {
-    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
-    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
-    var ty = 4;
-    if(data.ty === 'rc'){
-        ty = 5;
-    }else if(data.ty === 'el'){
-        ty = 6;
-    }else if(data.ty === 'sr'){
-        ty = 7;
-    }
-    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
-    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
-    var i = 0, len = this.animatedContents.length;
-    while(i < len) {
-        if(this.animatedContents[i].element === element) {
-            return;
-        }
-        i += 1;
-    }
-    this.animatedContents.push({
-        fn: SVGElementsRenderer.createRenderFunction(data),
-        element: element,
-        data: data
-    });
-};
-
-SVGShapeElement.prototype.setElementStyles = function(elementData){
-    var arr = elementData.styles;
-    var j, jLen = this.stylesList.length;
-    for (j = 0; j < jLen; j += 1) {
-        if (!this.stylesList[j].closed) {
-            arr.push(this.stylesList[j]);
-        }
-    }
-};
-
-SVGShapeElement.prototype.reloadShapes = function(){
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for( i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
-    len = this.dynamicProperties.length;
-    for(i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-};
-
-SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._render = render;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], level);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].style.pElem);
-            }
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].gr);
-            }
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                itemsData[i] = this.createTransformElement(arr[i], container);
-            }
-            currentTransform = itemsData[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
-            }
-            this.setElementStyles(itemsData[i]);
-
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        }else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                render = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    len = ownStyles.length;
-    for(i=0;i<len;i+=1){
-        ownStyles[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-SVGShapeElement.prototype.renderInnerContent = function() {
-    this.renderModifiers();
-    var i, len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        this.stylesList[i].reset();
-    }
-    this.renderShape();
-
+SVGShapeElement.prototype.filterUniqueShapes = function () {
+  var i;
+  var len = this.shapes.length;
+  var shape;
+  var j;
+  var jLen = this.stylesList.length;
+  var style;
+  var tempShapes = [];
+  var areAnimated = false;
+  for (j = 0; j < jLen; j += 1) {
+    style = this.stylesList[j];
+    areAnimated = false;
+    tempShapes.length = 0;
     for (i = 0; i < len; i += 1) {
-        if (this.stylesList[i]._mdf || this._isFirstFrame) {
-            if(this.stylesList[i].msElem){
-                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                //Adding M0 0 fixes same mask bug on all browsers
-                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
-            }
-            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
-        }
+      shape = this.shapes[i];
+      if (shape.styles.indexOf(style) !== -1) {
+        tempShapes.push(shape);
+        areAnimated = shape._isAnimated || areAnimated;
+      }
     }
+    if (tempShapes.length > 1 && areAnimated) {
+      this.setShapesAsAnimated(tempShapes);
+    }
+  }
 };
 
-SVGShapeElement.prototype.renderShape = function() {
-    var i, len = this.animatedContents.length;
-    var animatedContent;
-    for(i = 0; i < len; i += 1) {
-        animatedContent = this.animatedContents[i];
-        if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
-            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
-        }
-    }
-}
-
-SVGShapeElement.prototype.destroy = function(){
-    this.destroyBaseElement();
-    this.shapesData = null;
-    this.itemsData = null;
+SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
+  var i;
+  var len = shapes.length;
+  for (i = 0; i < len; i += 1) {
+    shapes[i].setAsAnimated();
+  }
 };
 
-function SVGTintFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    feColorMatrix.setAttribute('result','f2');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-    if(filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k){
-        var feMerge = createNS('feMerge');
-        filter.appendChild(feMerge);
-        var feMergeNode;
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','SourceGraphic');
-        feMerge.appendChild(feMergeNode);
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','f2');
-        feMerge.appendChild(feMergeNode);
-    }
-}
+SVGShapeElement.prototype.createStyleElement = function (data, level) {
+  // TODO: prevent drawing of hidden styles
+  var elementData;
+  var styleOb = new SVGStyleData(data, level);
 
-SVGTintFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var colorBlack = this.filterManager.effectElements[0].p.v;
-        var colorWhite = this.filterManager.effectElements[1].p.v;
-        var opacity = this.filterManager.effectElements[2].p.v/100;
-        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 ' + opacity + ' 0');
+  var pathElement = styleOb.pElem;
+  if (data.ty === 'st') {
+    elementData = new SVGStrokeStyleData(this, data, styleOb);
+  } else if (data.ty === 'fl') {
+    elementData = new SVGFillStyleData(this, data, styleOb);
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+    elementData = new GradientConstructor(this, data, styleOb);
+    this.globalData.defs.appendChild(elementData.gf);
+    if (elementData.maskId) {
+      this.globalData.defs.appendChild(elementData.ms);
+      this.globalData.defs.appendChild(elementData.of);
+      pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
     }
+  }
+
+  if (data.ty === 'st' || data.ty === 'gs') {
+    pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+    pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
+    pathElement.setAttribute('fill-opacity', '0');
+    if (data.lj === 1) {
+      pathElement.setAttribute('stroke-miterlimit', data.ml);
+    }
+  }
+
+  if (data.r === 2) {
+    pathElement.setAttribute('fill-rule', 'evenodd');
+  }
+
+  if (data.ln) {
+    pathElement.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    pathElement.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  this.stylesList.push(styleOb);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
 };
-function SVGFillFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-}
-SVGFillFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color = this.filterManager.effectElements[2].p.v;
-        var opacity = this.filterManager.effectElements[6].p.v;
-        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');
-    }
+
+SVGShapeElement.prototype.createGroupElement = function (data) {
+  var elementData = new ShapeGroupData();
+  if (data.ln) {
+    elementData.gr.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    elementData.gr.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  return elementData;
 };
-function SVGGaussianBlurEffect(filter, filterManager){
-    // Outset the filter region by 100% on all sides to accommodate blur expansion.
-    filter.setAttribute('x','-100%');
-    filter.setAttribute('y','-100%');
-    filter.setAttribute('width','300%');
-    filter.setAttribute('height','300%');
 
-    this.filterManager = filterManager;
-    var feGaussianBlur = createNS('feGaussianBlur');
-    filter.appendChild(feGaussianBlur);
-    this.feGaussianBlur = feGaussianBlur;
-}
+SVGShapeElement.prototype.createTransformElement = function (data, container) {
+  var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
+  var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-SVGGaussianBlurEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        // Empirical value, matching AE's blur appearance.
-        var kBlurrinessToSigma = 0.3;
-        var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
+  var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-        // Dimensions mapping:
-        //
-        //   1 -> horizontal & vertical
-        //   2 -> horizontal only
-        //   3 -> vertical only
-        //
-        var dimensions = this.filterManager.effectElements[1].p.v;
-        var sigmaX = (dimensions == 3) ? 0 : sigma;
-        var sigmaY = (dimensions == 2) ? 0 : sigma;
-
-        this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + " " + sigmaY);
-
-        // Repeat edges mapping:
-        //
-        //   0 -> off -> duplicate
-        //   1 -> on  -> wrap
-        var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate';
-        this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
+  var i = 0;
+  var len = this.animatedContents.length;
+  while (i < len) {
+    if (this.animatedContents[i].element === element) {
+      return;
     }
-}
-function SVGStrokeEffect(elem, filterManager){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.elem = elem;
-    this.paths = [];
-}
+    i += 1;
+  }
+  this.animatedContents.push({
+    fn: SVGElementsRenderer.createRenderFunction(data),
+    element: element,
+    data: data,
+  });
+};
 
-SVGStrokeEffect.prototype.initialize = function(){
+SVGShapeElement.prototype.setElementStyles = function (elementData) {
+  var arr = elementData.styles;
+  var j;
+  var jLen = this.stylesList.length;
+  for (j = 0; j < jLen; j += 1) {
+    if (!this.stylesList[j].closed) {
+      arr.push(this.stylesList[j]);
+    }
+  }
+};
 
-    var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-    var path,groupPath, i, len;
-    if(this.filterManager.effectElements[1].p.v === 1){
-        len = this.elem.maskManager.masksProperties.length;
-        i = 0;
+SVGShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
+  var ownTransformers = [].concat(transformers);
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var currentTransform;
+  var modifier;
+  var processedPos;
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._render = render;
     } else {
-        i = this.filterManager.effectElements[0].p.v - 1;
-        len = i + 1;
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    groupPath = createNS('g'); 
-    groupPath.setAttribute('fill','none');
-    groupPath.setAttribute('stroke-linecap','round');
-    groupPath.setAttribute('stroke-dashoffset',1);
-    for(i;i<len;i+=1){
-        path = createNS('path');
-        groupPath.appendChild(path);
-        this.paths.push({p:path,m:i});
-    }
-    if(this.filterManager.effectElements[10].p.v === 3){
-        var mask = createNS('mask');
-        var id = createElementID();
-        mask.setAttribute('id',id);
-        mask.setAttribute('mask-type','alpha');
-        mask.appendChild(groupPath);
-        this.elem.globalData.defs.appendChild(mask);
-        var g = createNS('g');
-        g.setAttribute('mask','url(' + locationHref + '#'+id+')');
-        while (elemChildren[0]) {
-            g.appendChild(elemChildren[0]);
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], level);
+      } else {
+        itemsData[i].style.closed = false;
+      }
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].style.pElem);
+      }
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
+        for (j = 0; j < jLen; j += 1) {
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        this.elem.layerElement.appendChild(g);
-        this.masker = mask;
-        groupPath.setAttribute('stroke','#fff');
-    } else if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(this.filterManager.effectElements[10].p.v === 2){
-            elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-            while(elemChildren.length){
-                this.elem.layerElement.removeChild(elemChildren[0]);
-            }
-        }
-        this.elem.layerElement.appendChild(groupPath);
-        this.elem.layerElement.removeAttribute('mask');
-        groupPath.setAttribute('stroke','#fff');
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].gr);
+      }
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        itemsData[i] = this.createTransformElement(arr[i], container);
+      }
+      currentTransform = itemsData[i].transform;
+      ownTransformers.push(currentTransform);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+      }
+      this.setElementStyles(itemsData[i]);
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        render = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-    this.initialized = true;
-    this.pathMasker = groupPath;
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  len = ownStyles.length;
+  for (i = 0; i < len; i += 1) {
+    ownStyles[i].closed = true;
+  }
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
 };
 
-SVGStrokeEffect.prototype.renderFrame = function(forceRender){
-    if(!this.initialized){
-        this.initialize();
-    }
-    var i, len = this.paths.length;
-    var mask, path;
-    for(i=0;i<len;i+=1){
-        if(this.paths[i].m === -1) {
-            continue;
-        }
-        mask = this.elem.maskManager.viewData[this.paths[i].m];
-        path = this.paths[i].p;
-        if(forceRender || this.filterManager._mdf || mask.prop._mdf){
-            path.setAttribute('d',mask.lastPath);
-        }
-        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){
-            var dasharrayValue;
-            if(this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100){
-                var s = Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var e = Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var l = path.getTotalLength();
-                dasharrayValue = '0 0 0 ' + l*s + ' ';
-                var lineLength = l*(e-s);
-                var segment = 1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-                var units = Math.floor(lineLength/segment);
-                var j;
-                for(j=0;j<units;j+=1){
-                    dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100 + ' ';
-                }
-                dasharrayValue += '0 ' + l*10 + ' 0 0';
-            } else {
-                dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-            }
-            path.setAttribute('stroke-dasharray',dasharrayValue);
-        }
-    }
-    if(forceRender || this.filterManager.effectElements[4].p._mdf){
-        this.pathMasker.setAttribute('stroke-width',this.filterManager.effectElements[4].p.v*2);
-    }
-    
-    if(forceRender || this.filterManager.effectElements[6].p._mdf){
-        this.pathMasker.setAttribute('opacity',this.filterManager.effectElements[6].p.v);
-    }
-    if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(forceRender || this.filterManager.effectElements[3].p._mdf){
-            var color = this.filterManager.effectElements[3].p.v;
-            this.pathMasker.setAttribute('stroke','rgb('+bm_floor(color[0]*255)+','+bm_floor(color[1]*255)+','+bm_floor(color[2]*255)+')');
-        }
-    }
-};
-function SVGTritoneFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    var feComponentTransfer = createNS('feComponentTransfer');
-    feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-    filter.appendChild(feComponentTransfer);
-    this.matrixFilter = feComponentTransfer;
-    var feFuncR = createNS('feFuncR');
-    feFuncR.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncR);
-    this.feFuncR = feFuncR;
-    var feFuncG = createNS('feFuncG');
-    feFuncG.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncG);
-    this.feFuncG = feFuncG;
-    var feFuncB = createNS('feFuncB');
-    feFuncB.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncB);
-    this.feFuncB = feFuncB;
-}
+SVGShapeElement.prototype.renderInnerContent = function () {
+  this.renderModifiers();
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    this.stylesList[i].reset();
+  }
+  this.renderShape();
 
-SVGTritoneFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color1 = this.filterManager.effectElements[0].p.v;
-        var color2 = this.filterManager.effectElements[1].p.v;
-        var color3 = this.filterManager.effectElements[2].p.v;
-        var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
-        var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
-        var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
-        this.feFuncR.setAttribute('tableValues', tableR);
-        this.feFuncG.setAttribute('tableValues', tableG);
-        this.feFuncB.setAttribute('tableValues', tableB);
-        //var opacity = this.filterManager.effectElements[2].p.v/100;
-        //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 ' + opacity + ' 0');
+  for (i = 0; i < len; i += 1) {
+    if (this.stylesList[i]._mdf || this._isFirstFrame) {
+      if (this.stylesList[i].msElem) {
+        this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+        // Adding M0 0 fixes same mask bug on all browsers
+        this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+      }
+      this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
     }
-};
-function SVGProLevelsFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var effectElements = this.filterManager.effectElements;
-    var feComponentTransfer = createNS('feComponentTransfer');
-    var feFuncR, feFuncG, feFuncB;
-    
-    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){
-        this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
-    }
-    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){
-        this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
-    }
-    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){
-        this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-    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){
-        this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
-    }
-    
-    if(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA){
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        feComponentTransfer = createNS('feComponentTransfer');
-    }
-
-    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){
-
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
-        this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
-        this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-}
-
-SVGProLevelsFilter.prototype.createFeFunc = function(type, feComponentTransfer) {
-    var feFunc = createNS(type);
-    feFunc.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFunc);
-    return feFunc;
+  }
 };
 
-SVGProLevelsFilter.prototype.getTableValue = function(inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
-    var cnt = 0;
-    var segments = 256;
-    var perc;
-    var min = Math.min(inputBlack, inputWhite);
-    var max = Math.max(inputBlack, inputWhite);
-    var table = Array.call(null,{length:segments});
-    var colorValue;
-    var pos = 0;
-    var outputDelta = outputWhite - outputBlack; 
-    var inputDelta = inputWhite - inputBlack; 
-    while(cnt <= 256) {
-        perc = cnt/256;
-        if(perc <= min){
-            colorValue = inputDelta < 0 ? outputWhite : outputBlack;
-        } else if(perc >= max){
-            colorValue = inputDelta < 0 ? outputBlack : outputWhite;
-        } else {
-            colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
-        }
-        table[pos++] = colorValue;
-        cnt += 256/(segments-1);
+SVGShapeElement.prototype.renderShape = function () {
+  var i;
+  var len = this.animatedContents.length;
+  var animatedContent;
+  for (i = 0; i < len; i += 1) {
+    animatedContent = this.animatedContents[i];
+    if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
+      animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
     }
-    return table.join(' ');
+  }
 };
 
-SVGProLevelsFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var val, cnt, perc, bezier;
-        var effectElements = this.filterManager.effectElements;
-        if(this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)){
-            val = this.getTableValue(effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v,effectElements[7].p.v);
-            this.feFuncRComposed.setAttribute('tableValues',val);
-            this.feFuncGComposed.setAttribute('tableValues',val);
-            this.feFuncBComposed.setAttribute('tableValues',val);
-        }
-
-
-        if(this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)){
-            val = this.getTableValue(effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v,effectElements[14].p.v);
-            this.feFuncR.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)){
-            val = this.getTableValue(effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v,effectElements[21].p.v);
-            this.feFuncG.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)){
-            val = this.getTableValue(effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v,effectElements[28].p.v);
-            this.feFuncB.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)){
-            val = this.getTableValue(effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v,effectElements[35].p.v);
-            this.feFuncA.setAttribute('tableValues',val);
-        }
-        
-    }
+SVGShapeElement.prototype.destroy = function () {
+  this.destroyBaseElement();
+  this.shapesData = null;
+  this.itemsData = null;
 };
-function SVGDropShadowEffect(filter, filterManager) {
-    var filterSize = filterManager.container.globalData.renderConfig.filterSize
-    filter.setAttribute('x', filterSize.x);
-    filter.setAttribute('y', filterSize.y);
-    filter.setAttribute('width', filterSize.width);
-    filter.setAttribute('height', filterSize.height);
-    this.filterManager = filterManager;
 
-    var feGaussianBlur = createNS('feGaussianBlur');
-    feGaussianBlur.setAttribute('in','SourceAlpha');
-    feGaussianBlur.setAttribute('result','drop_shadow_1');
-    feGaussianBlur.setAttribute('stdDeviation','0');
-    this.feGaussianBlur = feGaussianBlur;
-    filter.appendChild(feGaussianBlur);
+/* global createNS */
 
-    var feOffset = createNS('feOffset');
-    feOffset.setAttribute('dx','25');
-    feOffset.setAttribute('dy','0');
-    feOffset.setAttribute('in','drop_shadow_1');
-    feOffset.setAttribute('result','drop_shadow_2');
-    this.feOffset = feOffset;
-    filter.appendChild(feOffset);
-    var feFlood = createNS('feFlood');
-    feFlood.setAttribute('flood-color','#00ff00');
-    feFlood.setAttribute('flood-opacity','1');
-    feFlood.setAttribute('result','drop_shadow_3');
-    this.feFlood = feFlood;
-    filter.appendChild(feFlood);
-
-    var feComposite = createNS('feComposite');
-    feComposite.setAttribute('in','drop_shadow_3');
-    feComposite.setAttribute('in2','drop_shadow_2');
-    feComposite.setAttribute('operator','in');
-    feComposite.setAttribute('result','drop_shadow_4');
-    filter.appendChild(feComposite);
-
-
+function SVGTintFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  feColorMatrix.setAttribute('result', 'f2');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+  if (filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k) {
     var feMerge = createNS('feMerge');
     filter.appendChild(feMerge);
     var feMergeNode;
     feMergeNode = createNS('feMergeNode');
+    feMergeNode.setAttribute('in', 'SourceGraphic');
     feMerge.appendChild(feMergeNode);
     feMergeNode = createNS('feMergeNode');
-    feMergeNode.setAttribute('in','SourceGraphic');
-    this.feMergeNode = feMergeNode;
-    this.feMerge = feMerge;
-    this.originalNodeAdded = false;
+    feMergeNode.setAttribute('in', 'f2');
     feMerge.appendChild(feMergeNode);
+  }
 }
 
-SVGDropShadowEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        if(forceRender || this.filterManager.effectElements[4].p._mdf){
-            this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+SVGTintFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var colorBlack = this.filterManager.effectElements[0].p.v;
+    var colorWhite = this.filterManager.effectElements[1].p.v;
+    var opacity = this.filterManager.effectElements[2].p.v / 100;
+    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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGFillFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+}
+SVGFillFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color = this.filterManager.effectElements[2].p.v;
+    var opacity = this.filterManager.effectElements[6].p.v;
+    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');
+  }
+};
+
+/* global createNS */
+
+function SVGGaussianBlurEffect(filter, filterManager) {
+  // Outset the filter region by 100% on all sides to accommodate blur expansion.
+  filter.setAttribute('x', '-100%');
+  filter.setAttribute('y', '-100%');
+  filter.setAttribute('width', '300%');
+  filter.setAttribute('height', '300%');
+
+  this.filterManager = filterManager;
+  var feGaussianBlur = createNS('feGaussianBlur');
+  filter.appendChild(feGaussianBlur);
+  this.feGaussianBlur = feGaussianBlur;
+}
+
+SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    // Empirical value, matching AE's blur appearance.
+    var kBlurrinessToSigma = 0.3;
+    var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+
+    // Dimensions mapping:
+    //
+    //   1 -> horizontal & vertical
+    //   2 -> horizontal only
+    //   3 -> vertical only
+    //
+    var dimensions = this.filterManager.effectElements[1].p.v;
+    var sigmaX = (dimensions == 3) ? 0 : sigma; // eslint-disable-line eqeqeq
+    var sigmaY = (dimensions == 2) ? 0 : sigma; // eslint-disable-line eqeqeq
+
+    this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + ' ' + sigmaY);
+
+    // Repeat edges mapping:
+    //
+    //   0 -> off -> duplicate
+    //   1 -> on  -> wrap
+    var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate'; // eslint-disable-line eqeqeq
+    this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+  }
+};
+
+/* global createNS, createElementID, locationHref, bmFloor */
+
+function SVGStrokeEffect(elem, filterManager) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.elem = elem;
+  this.paths = [];
+}
+
+SVGStrokeEffect.prototype.initialize = function () {
+  var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+  var path;
+  var groupPath;
+  var i;
+  var len;
+  if (this.filterManager.effectElements[1].p.v === 1) {
+    len = this.elem.maskManager.masksProperties.length;
+    i = 0;
+  } else {
+    i = this.filterManager.effectElements[0].p.v - 1;
+    len = i + 1;
+  }
+  groupPath = createNS('g');
+  groupPath.setAttribute('fill', 'none');
+  groupPath.setAttribute('stroke-linecap', 'round');
+  groupPath.setAttribute('stroke-dashoffset', 1);
+  for (i; i < len; i += 1) {
+    path = createNS('path');
+    groupPath.appendChild(path);
+    this.paths.push({ p: path, m: i });
+  }
+  if (this.filterManager.effectElements[10].p.v === 3) {
+    var mask = createNS('mask');
+    var id = createElementID();
+    mask.setAttribute('id', id);
+    mask.setAttribute('mask-type', 'alpha');
+    mask.appendChild(groupPath);
+    this.elem.globalData.defs.appendChild(mask);
+    var g = createNS('g');
+    g.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+    while (elemChildren[0]) {
+      g.appendChild(elemChildren[0]);
+    }
+    this.elem.layerElement.appendChild(g);
+    this.masker = mask;
+    groupPath.setAttribute('stroke', '#fff');
+  } else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (this.filterManager.effectElements[10].p.v === 2) {
+      elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+      while (elemChildren.length) {
+        this.elem.layerElement.removeChild(elemChildren[0]);
+      }
+    }
+    this.elem.layerElement.appendChild(groupPath);
+    this.elem.layerElement.removeAttribute('mask');
+    groupPath.setAttribute('stroke', '#fff');
+  }
+  this.initialized = true;
+  this.pathMasker = groupPath;
+};
+
+SVGStrokeEffect.prototype.renderFrame = function (forceRender) {
+  if (!this.initialized) {
+    this.initialize();
+  }
+  var i;
+  var len = this.paths.length;
+  var mask;
+  var path;
+  for (i = 0; i < len; i += 1) {
+    if (this.paths[i].m !== -1) {
+      mask = this.elem.maskManager.viewData[this.paths[i].m];
+      path = this.paths[i].p;
+      if (forceRender || this.filterManager._mdf || mask.prop._mdf) {
+        path.setAttribute('d', mask.lastPath);
+      }
+      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) {
+        var dasharrayValue;
+        if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) {
+          var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var l = path.getTotalLength();
+          dasharrayValue = '0 0 0 ' + l * s + ' ';
+          var lineLength = l * (e - s);
+          var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
+          var units = Math.floor(lineLength / segment);
+          var j;
+          for (j = 0; j < units; j += 1) {
+            dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' ';
+          }
+          dasharrayValue += '0 ' + l * 10 + ' 0 0';
+        } else {
+          dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
         }
-        if(forceRender || this.filterManager.effectElements[0].p._mdf){
-            var col = this.filterManager.effectElements[0].p.v;
-            this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255)));
-        }
-        if(forceRender || this.filterManager.effectElements[1].p._mdf){
-            this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255);
-        }
-        if(forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf){
-            var distance = this.filterManager.effectElements[3].p.v;
-            var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
-            var x = distance * Math.cos(angle);
-            var y = distance * Math.sin(angle);
-            this.feOffset.setAttribute('dx', x);
-            this.feOffset.setAttribute('dy', y);
-        }
-        /*if(forceRender || this.filterManager.effectElements[5].p._mdf){
+        path.setAttribute('stroke-dasharray', dasharrayValue);
+      }
+    }
+  }
+  if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+    this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2);
+  }
+
+  if (forceRender || this.filterManager.effectElements[6].p._mdf) {
+    this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v);
+  }
+  if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (forceRender || this.filterManager.effectElements[3].p._mdf) {
+      var color = this.filterManager.effectElements[3].p.v;
+      this.pathMasker.setAttribute('stroke', 'rgb(' + bmFloor(color[0] * 255) + ',' + bmFloor(color[1] * 255) + ',' + bmFloor(color[2] * 255) + ')');
+    }
+  }
+};
+
+/* global createNS */
+
+function SVGTritoneFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  var feComponentTransfer = createNS('feComponentTransfer');
+  feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+  filter.appendChild(feComponentTransfer);
+  this.matrixFilter = feComponentTransfer;
+  var feFuncR = createNS('feFuncR');
+  feFuncR.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncR);
+  this.feFuncR = feFuncR;
+  var feFuncG = createNS('feFuncG');
+  feFuncG.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncG);
+  this.feFuncG = feFuncG;
+  var feFuncB = createNS('feFuncB');
+  feFuncB.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncB);
+  this.feFuncB = feFuncB;
+}
+
+SVGTritoneFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color1 = this.filterManager.effectElements[0].p.v;
+    var color2 = this.filterManager.effectElements[1].p.v;
+    var color3 = this.filterManager.effectElements[2].p.v;
+    var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
+    var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
+    var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
+    this.feFuncR.setAttribute('tableValues', tableR);
+    this.feFuncG.setAttribute('tableValues', tableG);
+    this.feFuncB.setAttribute('tableValues', tableB);
+    // var opacity = this.filterManager.effectElements[2].p.v/100;
+    // 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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGProLevelsFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var effectElements = this.filterManager.effectElements;
+  var feComponentTransfer = createNS('feComponentTransfer');
+
+  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) {
+    this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
+  }
+  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) {
+    this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
+  }
+  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) {
+    this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+  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) {
+    this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
+  }
+
+  if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    feComponentTransfer = createNS('feComponentTransfer');
+  }
+
+  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) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
+    this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
+    this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+}
+
+SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) {
+  var feFunc = createNS(type);
+  feFunc.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFunc);
+  return feFunc;
+};
+
+SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
+  var cnt = 0;
+  var segments = 256;
+  var perc;
+  var min = Math.min(inputBlack, inputWhite);
+  var max = Math.max(inputBlack, inputWhite);
+  var table = Array.call(null, { length: segments });
+  var colorValue;
+  var pos = 0;
+  var outputDelta = outputWhite - outputBlack;
+  var inputDelta = inputWhite - inputBlack;
+  while (cnt <= 256) {
+    perc = cnt / 256;
+    if (perc <= min) {
+      colorValue = inputDelta < 0 ? outputWhite : outputBlack;
+    } else if (perc >= max) {
+      colorValue = inputDelta < 0 ? outputBlack : outputWhite;
+    } else {
+      colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
+    }
+    table[pos] = colorValue;
+    pos += 1;
+    cnt += 256 / (segments - 1);
+  }
+  return table.join(' ');
+};
+
+SVGProLevelsFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var val;
+    var effectElements = this.filterManager.effectElements;
+    if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) {
+      val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v);
+      this.feFuncRComposed.setAttribute('tableValues', val);
+      this.feFuncGComposed.setAttribute('tableValues', val);
+      this.feFuncBComposed.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) {
+      val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v);
+      this.feFuncR.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) {
+      val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v);
+      this.feFuncG.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) {
+      val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v);
+      this.feFuncB.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) {
+      val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v);
+      this.feFuncA.setAttribute('tableValues', val);
+    }
+  }
+};
+
+/* global createNS, rgbToHex, degToRads */
+
+function SVGDropShadowEffect(filter, filterManager) {
+  var filterSize = filterManager.container.globalData.renderConfig.filterSize;
+  filter.setAttribute('x', filterSize.x);
+  filter.setAttribute('y', filterSize.y);
+  filter.setAttribute('width', filterSize.width);
+  filter.setAttribute('height', filterSize.height);
+  this.filterManager = filterManager;
+
+  var feGaussianBlur = createNS('feGaussianBlur');
+  feGaussianBlur.setAttribute('in', 'SourceAlpha');
+  feGaussianBlur.setAttribute('result', 'drop_shadow_1');
+  feGaussianBlur.setAttribute('stdDeviation', '0');
+  this.feGaussianBlur = feGaussianBlur;
+  filter.appendChild(feGaussianBlur);
+
+  var feOffset = createNS('feOffset');
+  feOffset.setAttribute('dx', '25');
+  feOffset.setAttribute('dy', '0');
+  feOffset.setAttribute('in', 'drop_shadow_1');
+  feOffset.setAttribute('result', 'drop_shadow_2');
+  this.feOffset = feOffset;
+  filter.appendChild(feOffset);
+  var feFlood = createNS('feFlood');
+  feFlood.setAttribute('flood-color', '#00ff00');
+  feFlood.setAttribute('flood-opacity', '1');
+  feFlood.setAttribute('result', 'drop_shadow_3');
+  this.feFlood = feFlood;
+  filter.appendChild(feFlood);
+
+  var feComposite = createNS('feComposite');
+  feComposite.setAttribute('in', 'drop_shadow_3');
+  feComposite.setAttribute('in2', 'drop_shadow_2');
+  feComposite.setAttribute('operator', 'in');
+  feComposite.setAttribute('result', 'drop_shadow_4');
+  filter.appendChild(feComposite);
+
+  var feMerge = createNS('feMerge');
+  filter.appendChild(feMerge);
+  var feMergeNode;
+  feMergeNode = createNS('feMergeNode');
+  feMerge.appendChild(feMergeNode);
+  feMergeNode = createNS('feMergeNode');
+  feMergeNode.setAttribute('in', 'SourceGraphic');
+  this.feMergeNode = feMergeNode;
+  this.feMerge = feMerge;
+  this.originalNodeAdded = false;
+  feMerge.appendChild(feMergeNode);
+}
+
+SVGDropShadowEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+      this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+    }
+    if (forceRender || this.filterManager.effectElements[0].p._mdf) {
+      var col = this.filterManager.effectElements[0].p.v;
+      this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255)));
+    }
+    if (forceRender || this.filterManager.effectElements[1].p._mdf) {
+      this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255);
+    }
+    if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {
+      var distance = this.filterManager.effectElements[3].p.v;
+      var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
+      var x = distance * Math.cos(angle);
+      var y = distance * Math.sin(angle);
+      this.feOffset.setAttribute('dx', x);
+      this.feOffset.setAttribute('dy', y);
+    }
+    /* if(forceRender || this.filterManager.effectElements[5].p._mdf){
             if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
                 this.feMerge.removeChild(this.feMergeNode);
                 this.originalNodeAdded = false;
@@ -9262,4452 +9811,4719 @@
                 this.feMerge.appendChild(this.feMergeNode);
                 this.originalNodeAdded = true;
             }
-        }*/
-    }
+        } */
+  }
 };
+
+/* global createElementID, createNS */
+
 var _svgMatteSymbols = [];
 
-function SVGMatte3Effect(filterElem, filterManager, elem){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.filterElem = filterElem;
-    this.elem = elem;
-    elem.matteElement = createNS('g');
-    elem.matteElement.appendChild(elem.layerElement);
-    elem.matteElement.appendChild(elem.transformedElement);
-    elem.baseElement = elem.matteElement;
+function SVGMatte3Effect(filterElem, filterManager, elem) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.filterElem = filterElem;
+  this.elem = elem;
+  elem.matteElement = createNS('g');
+  elem.matteElement.appendChild(elem.layerElement);
+  elem.matteElement.appendChild(elem.transformedElement);
+  elem.baseElement = elem.matteElement;
 }
 
-SVGMatte3Effect.prototype.findSymbol = function(mask) {
-    var i = 0, len = _svgMatteSymbols.length;
-    while(i < len) {
-        if(_svgMatteSymbols[i] === mask) {
-            return _svgMatteSymbols[i];
-        }
-        i += 1;
+SVGMatte3Effect.prototype.findSymbol = function (mask) {
+  var i = 0;
+  var len = _svgMatteSymbols.length;
+  while (i < len) {
+    if (_svgMatteSymbols[i] === mask) {
+      return _svgMatteSymbols[i];
     }
-    return null;
+    i += 1;
+  }
+  return null;
 };
 
-SVGMatte3Effect.prototype.replaceInParent = function(mask, symbolId) {
-    var parentNode = mask.layerElement.parentNode;
-    if(!parentNode) {
-        return;
+SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) {
+  var parentNode = mask.layerElement.parentNode;
+  if (!parentNode) {
+    return;
+  }
+  var children = parentNode.children;
+  var i = 0;
+  var len = children.length;
+  while (i < len) {
+    if (children[i] === mask.layerElement) {
+      break;
     }
-    var children = parentNode.children;
-    var i = 0, len = children.length;
-    while (i < len) {
-        if (children[i] === mask.layerElement) {
-            break;
-        }
-        i += 1;
-    }
-    var nextChild;
-    if (i <= len - 2) {
-        nextChild = children[i + 1];
-    }
+    i += 1;
+  }
+  var nextChild;
+  if (i <= len - 2) {
+    nextChild = children[i + 1];
+  }
+  var useElem = createNS('use');
+  useElem.setAttribute('href', '#' + symbolId);
+  if (nextChild) {
+    parentNode.insertBefore(useElem, nextChild);
+  } else {
+    parentNode.appendChild(useElem);
+  }
+};
+
+SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) {
+  if (!this.findSymbol(mask)) {
+    var symbolId = createElementID();
+    var masker = createNS('mask');
+    masker.setAttribute('id', mask.layerId);
+    masker.setAttribute('mask-type', 'alpha');
+    _svgMatteSymbols.push(mask);
+    var defs = elem.globalData.defs;
+    defs.appendChild(masker);
+    var symbol = createNS('symbol');
+    symbol.setAttribute('id', symbolId);
+    this.replaceInParent(mask, symbolId);
+    symbol.appendChild(mask.layerElement);
+    defs.appendChild(symbol);
     var useElem = createNS('use');
     useElem.setAttribute('href', '#' + symbolId);
-    if(nextChild) {
-        parentNode.insertBefore(useElem, nextChild);
-    } else {
-        parentNode.appendChild(useElem);
-    }
+    masker.appendChild(useElem);
+    mask.data.hd = false;
+    mask.show();
+  }
+  elem.setMatte(mask.layerId);
 };
 
-SVGMatte3Effect.prototype.setElementAsMask = function(elem, mask) {
-    if(!this.findSymbol(mask)) {
-        var symbolId = createElementID();
-        var masker = createNS('mask');
-        masker.setAttribute('id', mask.layerId);
-        masker.setAttribute('mask-type', 'alpha');
-        _svgMatteSymbols.push(mask);
-        var defs = elem.globalData.defs;
-        defs.appendChild(masker);
-        var symbol = createNS('symbol');
-        symbol.setAttribute('id', symbolId);
-        this.replaceInParent(mask, symbolId);
-        symbol.appendChild(mask.layerElement);
-        defs.appendChild(symbol);
-        var useElem = createNS('use');
-        useElem.setAttribute('href', '#' + symbolId);
-        masker.appendChild(useElem);
-        mask.data.hd = false;
-        mask.show();
+SVGMatte3Effect.prototype.initialize = function () {
+  var ind = this.filterManager.effectElements[0].p.v;
+  var elements = this.elem.comp.elements;
+  var i = 0;
+  var len = elements.length;
+  while (i < len) {
+    if (elements[i] && elements[i].data.ind === ind) {
+      this.setElementAsMask(this.elem, elements[i]);
     }
-    elem.setMatte(mask.layerId);
+    i += 1;
+  }
+  this.initialized = true;
 };
 
-SVGMatte3Effect.prototype.initialize = function() {
-    var ind = this.filterManager.effectElements[0].p.v;
-    var elements = this.elem.comp.elements;
-    var i = 0, len = elements.length;
-    while (i < len) {
-    	if (elements[i] && elements[i].data.ind === ind) {
-    		this.setElementAsMask(this.elem, elements[i]);
-    	}
-    	i += 1;
-    }
-    this.initialized = true;
+SVGMatte3Effect.prototype.renderFrame = function () {
+  if (!this.initialized) {
+    this.initialize();
+  }
 };
 
-SVGMatte3Effect.prototype.renderFrame = function() {
-	if(!this.initialized) {
-		this.initialize();
-	}
-};
-function SVGEffects(elem){
-    var i, len = elem.data.ef ? elem.data.ef.length : 0;
-    var filId = createElementID();
-    var fil = filtersFactory.createFilter(filId);
-    var count = 0;
-    this.filters = [];
-    var filterManager;
-    for(i=0;i<len;i+=1){
-        filterManager = null;
-        if(elem.data.ef[i].ty === 20){
-            count += 1;
-            filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 21){
-            count += 1;
-            filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 22){
-            filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 23){
-            count += 1;
-            filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 24){
-            count += 1;
-            filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 25){
-            count += 1;
-            filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 28){
-            //count += 1;
-            filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
-        }else if(elem.data.ef[i].ty === 29){
-            count += 1;
-            filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
-        }
-        if(filterManager) {
-            this.filters.push(filterManager);
-        }
+/* global createElementID, filtersFactory, SVGTintFilter, SVGFillFilter, SVGStrokeEffect, SVGTritoneFilter,
+SVGProLevelsFilter, SVGDropShadowEffect, SVGMatte3Effect, SVGGaussianBlurEffect, locationHref */
+
+function SVGEffects(elem) {
+  var i;
+  var len = elem.data.ef ? elem.data.ef.length : 0;
+  var filId = createElementID();
+  var fil = filtersFactory.createFilter(filId);
+  var count = 0;
+  this.filters = [];
+  var filterManager;
+  for (i = 0; i < len; i += 1) {
+    filterManager = null;
+    if (elem.data.ef[i].ty === 20) {
+      count += 1;
+      filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 21) {
+      count += 1;
+      filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 22) {
+      filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 23) {
+      count += 1;
+      filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 24) {
+      count += 1;
+      filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 25) {
+      count += 1;
+      filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 28) {
+      // count += 1;
+      filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
+    } else if (elem.data.ef[i].ty === 29) {
+      count += 1;
+      filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
     }
-    if(count){
-        elem.globalData.defs.appendChild(fil);
-        elem.layerElement.setAttribute('filter','url(' + locationHref + '#'+filId+')');
+    if (filterManager) {
+      this.filters.push(filterManager);
     }
-    if (this.filters.length) {
-        elem.addRenderableComponent(this);
-    }
+  }
+  if (count) {
+    elem.globalData.defs.appendChild(fil);
+    elem.layerElement.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+  }
+  if (this.filters.length) {
+    elem.addRenderableComponent(this);
+  }
 }
 
-SVGEffects.prototype.renderFrame = function(_isFirstFrame){
-    var i, len = this.filters.length;
-    for(i=0;i<len;i+=1){
-        this.filters[i].renderFrame(_isFirstFrame);
-    }
+SVGEffects.prototype.renderFrame = function (_isFirstFrame) {
+  var i;
+  var len = this.filters.length;
+  for (i = 0; i < len; i += 1) {
+    this.filters[i].renderFrame(_isFirstFrame);
+  }
 };
+
 function CVEffects() {
 
 }
-CVEffects.prototype.renderFrame = function(){};
-function HBaseElement(data,globalData,comp){}
+CVEffects.prototype.renderFrame = function () {};
+
+/* global createTag, createNS, styleDiv, CVEffects, MaskElement, SVGBaseElement, HybridRenderer */
+
+function HBaseElement() {}
 HBaseElement.prototype = {
-    checkBlendMode: function(){},
-    initRendererElement: function(){
-        this.baseElement = createTag(this.data.tg || 'div');
-        if(this.data.hasMask) {
-            this.svgElement = createNS('svg');
-            this.layerElement = createNS('g');
-            this.maskedElement = this.layerElement;
-            this.svgElement.appendChild(this.layerElement);
-            this.baseElement.appendChild(this.svgElement);
-        } else {
-            this.layerElement = this.baseElement;
-        }
-        styleDiv(this.baseElement);
-    },
-    createContainerElements: function(){
-        this.renderableEffectsManager = new CVEffects(this);
-        this.transformedElement = this.baseElement;
-        this.maskedElement = this.layerElement;
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id',this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-    },
-    renderElement: function() {
-        if(this.finalTransform._matMdf){
-            this.transformedElement.style.transform = this.transformedElement.style.webkitTransform = this.finalTransform.mat.toCSS();
-        }
-        if(this.finalTransform._opMdf){
-            this.transformedElement.style.opacity = this.finalTransform.mProp.o.v;
-        }
-    },
-    renderFrame: function() {
-        //If it is exported as hidden (data.hd === true) no need to render
-        //If it is not visible no need to render
-        if (this.data.hd || this.hidden) {
-            return;
-        }
-        this.renderTransform();
-        this.renderRenderable();
-        this.renderElement();
-        this.renderInnerContent();
-        if (this._isFirstFrame) {
-            this._isFirstFrame = false;
-        }
-    },
-    destroy: function(){
-        this.layerElement = null;
-        this.transformedElement = null;
-        if(this.matteElement) {
-            this.matteElement = null;
-        }
-        if(this.maskManager) {
-            this.maskManager.destroy();
-            this.maskManager = null;
-        }
-    },
-    createRenderableComponents: function(){
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-    },
-    addEffects: function(){
-    },
-    setMatte: function(){}
+  checkBlendMode: function () {},
+  initRendererElement: function () {
+    this.baseElement = createTag(this.data.tg || 'div');
+    if (this.data.hasMask) {
+      this.svgElement = createNS('svg');
+      this.layerElement = createNS('g');
+      this.maskedElement = this.layerElement;
+      this.svgElement.appendChild(this.layerElement);
+      this.baseElement.appendChild(this.svgElement);
+    } else {
+      this.layerElement = this.baseElement;
+    }
+    styleDiv(this.baseElement);
+  },
+  createContainerElements: function () {
+    this.renderableEffectsManager = new CVEffects(this);
+    this.transformedElement = this.baseElement;
+    this.maskedElement = this.layerElement;
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    var transformedElementStyle = this.transformedElement ? this.transformedElement.style : {};
+    if (this.finalTransform._matMdf) {
+      var matrixValue = this.finalTransform.mat.toCSS();
+      transformedElementStyle.transform = matrixValue;
+      transformedElementStyle.webkitTransform = matrixValue;
+    }
+    if (this.finalTransform._opMdf) {
+      transformedElementStyle.opacity = this.finalTransform.mProp.o.v;
+    }
+  },
+  renderFrame: function () {
+    // If it is exported as hidden (data.hd === true) no need to render
+    // If it is not visible no need to render
+    if (this.data.hd || this.hidden) {
+      return;
+    }
+    this.renderTransform();
+    this.renderRenderable();
+    this.renderElement();
+    this.renderInnerContent();
+    if (this._isFirstFrame) {
+      this._isFirstFrame = false;
+    }
+  },
+  destroy: function () {
+    this.layerElement = null;
+    this.transformedElement = null;
+    if (this.matteElement) {
+      this.matteElement = null;
+    }
+    if (this.maskManager) {
+      this.maskManager.destroy();
+      this.maskManager = null;
+    }
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+  },
+  addEffects: function () {
+  },
+  setMatte: function () {},
 };
 HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;
 HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;
 HBaseElement.prototype.buildElementParenting = HybridRenderer.prototype.buildElementParenting;
-function HSolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
-}
-extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], HSolidElement);
 
-HSolidElement.prototype.createContent = function(){
-    var rect;
-    if(this.data.hasMask){
-        rect = createNS('rect');
-        rect.setAttribute('width',this.data.sw);
-        rect.setAttribute('height',this.data.sh);
-        rect.setAttribute('fill',this.data.sc);
-        this.svgElement.setAttribute('width',this.data.sw);
-        this.svgElement.setAttribute('height',this.data.sh);
-    } else {
-        rect = createTag('div');
-        rect.style.width = this.data.sw + 'px';
-        rect.style.height = this.data.sh + 'px';
-        rect.style.backgroundColor = this.data.sc;
-    }
-    this.layerElement.appendChild(rect);
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, createNS, createTag */
+
+function HSolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
+}
+extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement);
+
+HSolidElement.prototype.createContent = function () {
+  var rect;
+  if (this.data.hasMask) {
+    rect = createNS('rect');
+    rect.setAttribute('width', this.data.sw);
+    rect.setAttribute('height', this.data.sh);
+    rect.setAttribute('fill', this.data.sc);
+    this.svgElement.setAttribute('width', this.data.sw);
+    this.svgElement.setAttribute('height', this.data.sh);
+  } else {
+    rect = createTag('div');
+    rect.style.width = this.data.sw + 'px';
+    rect.style.height = this.data.sh + 'px';
+    rect.style.backgroundColor = this.data.sc;
+  }
+  this.layerElement.appendChild(rect);
 };
 
-function HCompElement(data,globalData,comp){
-    this.layers = data.layers;
-    this.supports3d = !data.hasMask;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
-    this.initElement(data,globalData,comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+/* global createSizedArray, PropertyFactory, extendPrototype, HybridRenderer, ICompElement, HBaseElement */
+
+function HCompElement(data, globalData, comp) {
+  this.layers = data.layers;
+  this.supports3d = !data.hasMask;
+  this.completeLayers = false;
+  this.pendingElements = [];
+  this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([HybridRenderer, ICompElement, HBaseElement], HCompElement);
 HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements;
 
-HCompElement.prototype.createContainerElements = function(){
-    this._createBaseContainerElements();
-    //divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
-    if(this.data.hasMask){
-        this.svgElement.setAttribute('width',this.data.w);
-        this.svgElement.setAttribute('height',this.data.h);
-        this.transformedElement = this.baseElement;
-    } else {
-        this.transformedElement = this.layerElement;
-    }
+HCompElement.prototype.createContainerElements = function () {
+  this._createBaseContainerElements();
+  // divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
+  if (this.data.hasMask) {
+    this.svgElement.setAttribute('width', this.data.w);
+    this.svgElement.setAttribute('height', this.data.h);
+    this.transformedElement = this.baseElement;
+  } else {
+    this.transformedElement = this.layerElement;
+  }
 };
 
-HCompElement.prototype.addTo3dContainer = function(elem,pos) {
-    var j = 0;
-    var nextElement;
-    while(j<pos){
-        if(this.elements[j] && this.elements[j].getBaseElement){
-            nextElement = this.elements[j].getBaseElement();
-        }
-        j += 1;
+HCompElement.prototype.addTo3dContainer = function (elem, pos) {
+  var j = 0;
+  var nextElement;
+  while (j < pos) {
+    if (this.elements[j] && this.elements[j].getBaseElement) {
+      nextElement = this.elements[j].getBaseElement();
     }
-    if(nextElement){
-        this.layerElement.insertBefore(elem, nextElement);
-    } else {
-        this.layerElement.appendChild(elem);
-    }
-}
+    j += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(elem, nextElement);
+  } else {
+    this.layerElement.appendChild(elem);
+  }
+};
 
-function HShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    this.shapesContainer = createNS('g');
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    this.currentBBox = {
-        x:999999,
-        y: -999999,
-        h: 0,
-        w: 0
-    };
+/* global createNS, extendPrototype, BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement,
+HierarchyElement, FrameElement, RenderableElement, createNS, bmMin, bmSqrt, bmMin, bmMax, bmPow */
+
+function HShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  this.shapesContainer = createNS('g');
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  this.currentBBox = {
+    x: 999999,
+    y: -999999,
+    h: 0,
+    w: 0,
+  };
 }
-extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement], HShapeElement);
+extendPrototype([BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement], HShapeElement);
 HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent;
 
-HShapeElement.prototype.createContent = function(){
-    var cont;
-    this.baseElement.style.fontSize = 0;
-    if (this.data.hasMask) {
-        this.layerElement.appendChild(this.shapesContainer);
-        cont = this.svgElement;
-    } else {
-        cont = createNS('svg');
-        var size = this.comp.data ? this.comp.data : this.globalData.compSize;
-        cont.setAttribute('width',size.w);
-        cont.setAttribute('height',size.h);
-        cont.appendChild(this.shapesContainer);
-        this.layerElement.appendChild(cont);
-    }
-
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0, [], true);
-    this.filterUniqueShapes();
-    this.shapeCont = cont;
-};
-
-HShapeElement.prototype.getTransformedPoint = function(transformers, point) {
-    var i, len = transformers.length;
-    for(i = 0; i < len; i += 1) {
-        point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
-    }
-    return point;
-}
-
-HShapeElement.prototype.calculateShapeBoundingBox = function(item, boundingBox) {
-    var shape = item.sh.v;
-    var transformers = item.transformers;
-    var i, len = shape._length, vPoint, oPoint, nextIPoint, nextVPoint, bounds;
-    if (len <= 1) {
-        return;
-    }
-    for (i = 0; i < len - 1; i += 1) {
-        vPoint = this.getTransformedPoint(transformers, shape.v[i]);
-        oPoint = this.getTransformedPoint(transformers, shape.o[i]);
-        nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
-        nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
-        this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
-    }
-    if(shape.c) {
-        vPoint = this.getTransformedPoint(transformers, shape.v[i]);
-        oPoint = this.getTransformedPoint(transformers, shape.o[i]);
-        nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
-        nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
-        this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
-    }
-}
-
-HShapeElement.prototype.checkBounds = function(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
-    this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
-    var bounds = this.shapeBoundingBox;
-    boundingBox.x = bm_min(bounds.left, boundingBox.x);
-    boundingBox.xMax = bm_max(bounds.right, boundingBox.xMax);
-    boundingBox.y = bm_min(bounds.top, boundingBox.y);
-    boundingBox.yMax = bm_max(bounds.bottom, boundingBox.yMax);
-}
-
-HShapeElement.prototype.shapeBoundingBox = {
-    left:0,
-    right:0,
-    top:0,
-    bottom:0,
-}
-
-HShapeElement.prototype.tempBoundingBox = {
-    x:0,
-    xMax:0,
-    y:0,
-    yMax:0,
-    width:0,
-    height:0
-}
-
-HShapeElement.prototype.getBoundsOfCurve = function(p0, p1, p2, p3) {
-
-    var bounds = [[p0[0],p3[0]], [p0[1],p3[1]]];
-
-    for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) {
-
-      b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
-      a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
-      c = 3 * p1[i] - 3 * p0[i];
-
-      b = b | 0;
-      a = a | 0;
-      c = c | 0;
-
-      if (a === 0) {
-
-        if (b === 0) {
-          continue;
-        }
-
-        t = -c / b;
-
-        if (0 < t && t < 1) {
-          bounds[i].push(this.calculateF(t,p0,p1,p2,p3,i));
-        }
-        continue;
-      }
-
-      b2ac = b * b - 4 * c * a;
-
-      if (b2ac < 0) {
-        continue;
-      }
-
-      t1 = (-b + bm_sqrt(b2ac))/(2 * a);
-      if (0 < t1 && t1 < 1) bounds[i].push(this.calculateF(t1,p0,p1,p2,p3,i));
-
-      t2 = (-b - bm_sqrt(b2ac))/(2 * a);
-      if (0 < t2 && t2 < 1) bounds[i].push(this.calculateF(t2,p0,p1,p2,p3,i));
-
-    }
-
-    this.shapeBoundingBox.left = bm_min.apply(null, bounds[0]);
-    this.shapeBoundingBox.top = bm_min.apply(null, bounds[1]);
-    this.shapeBoundingBox.right = bm_max.apply(null, bounds[0]);
-    this.shapeBoundingBox.bottom = bm_max.apply(null, bounds[1]);
-  };
-
-  HShapeElement.prototype.calculateF = function(t, p0, p1, p2, p3, i) {
-    return bm_pow(1-t, 3) * p0[i]
-        + 3 * bm_pow(1-t, 2) * t * p1[i]
-        + 3 * (1-t) * bm_pow(t, 2) * p2[i]
-        + bm_pow(t, 3) * p3[i];
+HShapeElement.prototype.createContent = function () {
+  var cont;
+  this.baseElement.style.fontSize = 0;
+  if (this.data.hasMask) {
+    this.layerElement.appendChild(this.shapesContainer);
+    cont = this.svgElement;
+  } else {
+    cont = createNS('svg');
+    var size = this.comp.data ? this.comp.data : this.globalData.compSize;
+    cont.setAttribute('width', size.w);
+    cont.setAttribute('height', size.h);
+    cont.appendChild(this.shapesContainer);
+    this.layerElement.appendChild(cont);
   }
 
-HShapeElement.prototype.calculateBoundingBox = function(itemsData, boundingBox) {
-    var i, len = itemsData.length, path;
-    for(i = 0; i < len; i += 1) {
-        if(itemsData[i] && itemsData[i].sh) {
-            this.calculateShapeBoundingBox(itemsData[i], boundingBox)
-        } else if(itemsData[i] && itemsData[i].it) {
-            this.calculateBoundingBox(itemsData[i].it, boundingBox)
-        }
-    }
-}
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], true);
+  this.filterUniqueShapes();
+  this.shapeCont = cont;
+};
 
-HShapeElement.prototype.currentBoxContains = function(box) {
-    return this.currentBBox.x <= box.x 
-    && this.currentBBox.y <= box.y 
+HShapeElement.prototype.getTransformedPoint = function (transformers, point) {
+  var i;
+  var len = transformers.length;
+  for (i = 0; i < len; i += 1) {
+    point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
+  }
+  return point;
+};
+
+HShapeElement.prototype.calculateShapeBoundingBox = function (item, boundingBox) {
+  var shape = item.sh.v;
+  var transformers = item.transformers;
+  var i;
+  var len = shape._length;
+  var vPoint;
+  var oPoint;
+  var nextIPoint;
+  var nextVPoint;
+  if (len <= 1) {
+    return;
+  }
+  for (i = 0; i < len - 1; i += 1) {
+    vPoint = this.getTransformedPoint(transformers, shape.v[i]);
+    oPoint = this.getTransformedPoint(transformers, shape.o[i]);
+    nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
+    nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
+    this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
+  }
+  if (shape.c) {
+    vPoint = this.getTransformedPoint(transformers, shape.v[i]);
+    oPoint = this.getTransformedPoint(transformers, shape.o[i]);
+    nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
+    nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
+    this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
+  }
+};
+
+HShapeElement.prototype.checkBounds = function (vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
+  this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
+  var bounds = this.shapeBoundingBox;
+  boundingBox.x = bmMin(bounds.left, boundingBox.x);
+  boundingBox.xMax = bmMax(bounds.right, boundingBox.xMax);
+  boundingBox.y = bmMin(bounds.top, boundingBox.y);
+  boundingBox.yMax = bmMax(bounds.bottom, boundingBox.yMax);
+};
+
+HShapeElement.prototype.shapeBoundingBox = {
+  left: 0,
+  right: 0,
+  top: 0,
+  bottom: 0,
+};
+
+HShapeElement.prototype.tempBoundingBox = {
+  x: 0,
+  xMax: 0,
+  y: 0,
+  yMax: 0,
+  width: 0,
+  height: 0,
+};
+
+HShapeElement.prototype.getBoundsOfCurve = function (p0, p1, p2, p3) {
+  var bounds = [[p0[0], p3[0]], [p0[1], p3[1]]];
+
+  for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) { // eslint-disable-line no-plusplus
+    b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
+    a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
+    c = 3 * p1[i] - 3 * p0[i];
+
+    b |= 0; // eslint-disable-line no-bitwise
+    a |= 0; // eslint-disable-line no-bitwise
+    c |= 0; // eslint-disable-line no-bitwise
+
+    if (a === 0 && b === 0) {
+      //
+    } else if (a === 0) {
+      t = -c / b;
+
+      if (t > 0 && t < 1) {
+        bounds[i].push(this.calculateF(t, p0, p1, p2, p3, i));
+      }
+    } else {
+      b2ac = b * b - 4 * c * a;
+
+      if (b2ac >= 0) {
+        t1 = (-b + bmSqrt(b2ac)) / (2 * a);
+        if (t1 > 0 && t1 < 1) bounds[i].push(this.calculateF(t1, p0, p1, p2, p3, i));
+        t2 = (-b - bmSqrt(b2ac)) / (2 * a);
+        if (t2 > 0 && t2 < 1) bounds[i].push(this.calculateF(t2, p0, p1, p2, p3, i));
+      }
+    }
+  }
+
+  this.shapeBoundingBox.left = bmMin.apply(null, bounds[0]);
+  this.shapeBoundingBox.top = bmMin.apply(null, bounds[1]);
+  this.shapeBoundingBox.right = bmMax.apply(null, bounds[0]);
+  this.shapeBoundingBox.bottom = bmMax.apply(null, bounds[1]);
+};
+
+HShapeElement.prototype.calculateF = function (t, p0, p1, p2, p3, i) {
+  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];
+};
+
+HShapeElement.prototype.calculateBoundingBox = function (itemsData, boundingBox) {
+  var i;
+  var len = itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    if (itemsData[i] && itemsData[i].sh) {
+      this.calculateShapeBoundingBox(itemsData[i], boundingBox);
+    } else if (itemsData[i] && itemsData[i].it) {
+      this.calculateBoundingBox(itemsData[i].it, boundingBox);
+    }
+  }
+};
+
+HShapeElement.prototype.currentBoxContains = function (box) {
+  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
-}
-
-HShapeElement.prototype.renderInnerContent = function() {
-    this._renderShapeFrame();
-
-    if(!this.hidden && (this._isFirstFrame || this._mdf)) {
-        var tempBoundingBox = this.tempBoundingBox;
-        var max = 999999;
-        tempBoundingBox.x = max;
-        tempBoundingBox.xMax = -max;
-        tempBoundingBox.y = max;
-        tempBoundingBox.yMax = -max;
-        this.calculateBoundingBox(this.itemsData, tempBoundingBox);
-        tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
-        tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
-        //var tempBoundingBox = this.shapeCont.getBBox();
-        if(this.currentBoxContains(tempBoundingBox)) {
-            return;
-        }
-        var changed = false;
-        if(this.currentBBox.w !== tempBoundingBox.width){
-            this.currentBBox.w = tempBoundingBox.width;
-            this.shapeCont.setAttribute('width',tempBoundingBox.width);
-            changed = true;
-        }
-        if(this.currentBBox.h !== tempBoundingBox.height){
-            this.currentBBox.h = tempBoundingBox.height;
-            this.shapeCont.setAttribute('height',tempBoundingBox.height);
-            changed = true;
-        }
-        if(changed  || this.currentBBox.x !== tempBoundingBox.x  || this.currentBBox.y !== tempBoundingBox.y){
-            this.currentBBox.w = tempBoundingBox.width;
-            this.currentBBox.h = tempBoundingBox.height;
-            this.currentBBox.x = tempBoundingBox.x;
-            this.currentBBox.y = tempBoundingBox.y;
-
-            this.shapeCont.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
-            this.shapeCont.style.transform = this.shapeCont.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
-        }
-    }
-
+    && this.currentBBox.height + this.currentBBox.y >= box.y + box.height;
 };
-function HTextElement(data,globalData,comp){
-    this.textSpans = [];
-    this.textPaths = [];
-    this.currentBBox = {
-        x:999999,
-        y: -999999,
-        h: 0,
-        w: 0
-    };
+
+HShapeElement.prototype.renderInnerContent = function () {
+  this._renderShapeFrame();
+
+  if (!this.hidden && (this._isFirstFrame || this._mdf)) {
+    var tempBoundingBox = this.tempBoundingBox;
+    var max = 999999;
+    tempBoundingBox.x = max;
+    tempBoundingBox.xMax = -max;
+    tempBoundingBox.y = max;
+    tempBoundingBox.yMax = -max;
+    this.calculateBoundingBox(this.itemsData, tempBoundingBox);
+    tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
+    tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
+    // var tempBoundingBox = this.shapeCont.getBBox();
+    if (this.currentBoxContains(tempBoundingBox)) {
+      return;
+    }
+    var changed = false;
+    if (this.currentBBox.w !== tempBoundingBox.width) {
+      this.currentBBox.w = tempBoundingBox.width;
+      this.shapeCont.setAttribute('width', tempBoundingBox.width);
+      changed = true;
+    }
+    if (this.currentBBox.h !== tempBoundingBox.height) {
+      this.currentBBox.h = tempBoundingBox.height;
+      this.shapeCont.setAttribute('height', tempBoundingBox.height);
+      changed = true;
+    }
+    if (changed || this.currentBBox.x !== tempBoundingBox.x || this.currentBBox.y !== tempBoundingBox.y) {
+      this.currentBBox.w = tempBoundingBox.width;
+      this.currentBBox.h = tempBoundingBox.height;
+      this.currentBBox.x = tempBoundingBox.x;
+      this.currentBBox.y = tempBoundingBox.y;
+
+      this.shapeCont.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
+      var shapeStyle = this.shapeCont.style;
+      var shapeTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
+      shapeStyle.transform = shapeTransform;
+      shapeStyle.webkitTransform = shapeTransform;
+    }
+  }
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, ITextElement, createSizedArray, createTag, styleDiv, createNS */
+
+function HTextElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.textPaths = [];
+  this.currentBBox = {
+    x: 999999,
+    y: -999999,
+    h: 0,
+    w: 0,
+  };
+  this.renderType = 'svg';
+  this.isMasked = false;
+  this.initElement(data, globalData, comp);
+}
+extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement);
+
+HTextElement.prototype.createContent = function () {
+  this.isMasked = this.checkMasks();
+  if (this.isMasked) {
     this.renderType = 'svg';
-    this.isMasked = false;
-    this.initElement(data,globalData,comp);
+    this.compW = this.comp.data.w;
+    this.compH = this.comp.data.h;
+    this.svgElement.setAttribute('width', this.compW);
+    this.svgElement.setAttribute('height', this.compH);
+    var g = createNS('g');
+    this.maskedElement.appendChild(g);
+    this.innerElem = g;
+  } else {
+    this.renderType = 'html';
+    this.innerElem = this.layerElement;
+  }
 
-}
-extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], HTextElement);
-
-HTextElement.prototype.createContent = function(){
-    this.isMasked = this.checkMasks();
-    if(this.isMasked){
-        this.renderType = 'svg';
-        this.compW = this.comp.data.w;
-        this.compH = this.comp.data.h;
-        this.svgElement.setAttribute('width',this.compW);
-        this.svgElement.setAttribute('height',this.compH);
-        var g = createNS('g');
-        this.maskedElement.appendChild(g);
-        this.innerElem = g;
-    } else {
-        this.renderType = 'html';
-        this.innerElem = this.layerElement;
-    }
-
-    this.checkParenting();
-
+  this.checkParenting();
 };
 
-HTextElement.prototype.buildNewText = function(){
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
-    var innerElemStyle = this.innerElem.style;
-    innerElemStyle.color = innerElemStyle.fill = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
-    if(documentData.sc){
-        innerElemStyle.stroke = this.buildColor(documentData.sc);
-        innerElemStyle.strokeWidth = documentData.sw+'px';
+HTextElement.prototype.buildNewText = function () {
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
+  var innerElemStyle = this.innerElem.style;
+  var textColor = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
+  innerElemStyle.fill = textColor;
+  innerElemStyle.color = textColor;
+  if (documentData.sc) {
+    innerElemStyle.stroke = this.buildColor(documentData.sc);
+    innerElemStyle.strokeWidth = documentData.sw + 'px';
+  }
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  if (!this.globalData.fontManager.chars) {
+    innerElemStyle.fontSize = documentData.finalSize + 'px';
+    innerElemStyle.lineHeight = documentData.finalSize + 'px';
+    if (fontData.fClass) {
+      this.innerElem.className = fontData.fClass;
+    } else {
+      innerElemStyle.fontFamily = fontData.fFamily;
+      var fWeight = documentData.fWeight;
+      var fStyle = documentData.fStyle;
+      innerElemStyle.fontStyle = fStyle;
+      innerElemStyle.fontWeight = fWeight;
     }
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(!this.globalData.fontManager.chars){
-        innerElemStyle.fontSize = documentData.finalSize+'px';
-        innerElemStyle.lineHeight = documentData.finalSize+'px';
-        if(fontData.fClass){
-            this.innerElem.className = fontData.fClass;
+  }
+  var i;
+  var len;
+
+  var letters = documentData.l;
+  len = letters.length;
+  var tSpan;
+  var tParent;
+  var tCont;
+  var matrixHelper = this.mHelper;
+  var shapes;
+  var shapeStr = '';
+  var cnt = 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.globalData.fontManager.chars) {
+      if (!this.textPaths[cnt]) {
+        tSpan = createNS('path');
+        tSpan.setAttribute('stroke-linecap', 'butt');
+        tSpan.setAttribute('stroke-linejoin', 'round');
+        tSpan.setAttribute('stroke-miterlimit', '4');
+      } else {
+        tSpan = this.textPaths[cnt];
+      }
+      if (!this.isMasked) {
+        if (this.textSpans[cnt]) {
+          tParent = this.textSpans[cnt];
+          tCont = tParent.children[0];
         } else {
-            innerElemStyle.fontFamily = fontData.fFamily;
-            var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-            innerElemStyle.fontStyle = fStyle;
-            innerElemStyle.fontWeight = fWeight;
+          tParent = createTag('div');
+          tParent.style.lineHeight = 0;
+          tCont = createNS('svg');
+          tCont.appendChild(tSpan);
+          styleDiv(tParent);
         }
+      }
+    } else if (!this.isMasked) {
+      if (this.textSpans[cnt]) {
+        tParent = this.textSpans[cnt];
+        tSpan = this.textPaths[cnt];
+      } else {
+        tParent = createTag('span');
+        styleDiv(tParent);
+        tSpan = createTag('span');
+        styleDiv(tSpan);
+        tParent.appendChild(tSpan);
+      }
+    } else {
+      tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
     }
-    var i, len;
+    // tSpan.setAttribute('visibility', 'hidden');
+    if (this.globalData.fontManager.chars) {
+      var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+      var shapeData;
+      if (charData) {
+        shapeData = charData.data;
+      } else {
+        shapeData = null;
+      }
+      matrixHelper.reset();
+      if (shapeData && shapeData.shapes) {
+        shapes = shapeData.shapes[0].it;
+        matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+        shapeStr = this.createPathShape(matrixHelper, shapes);
+        tSpan.setAttribute('d', shapeStr);
+      }
+      if (!this.isMasked) {
+        this.innerElem.appendChild(tParent);
+        if (shapeData && shapeData.shapes) {
+          // document.body.appendChild is needed to get exact measure of shape
+          document.body.appendChild(tCont);
+          var boundingBox = tCont.getBBox();
+          tCont.setAttribute('width', boundingBox.width + 2);
+          tCont.setAttribute('height', boundingBox.height + 2);
+          tCont.setAttribute('viewBox', (boundingBox.x - 1) + ' ' + (boundingBox.y - 1) + ' ' + (boundingBox.width + 2) + ' ' + (boundingBox.height + 2));
+          var tContStyle = tCont.style;
+          var tContTranslation = 'translate(' + (boundingBox.x - 1) + 'px,' + (boundingBox.y - 1) + 'px)';
+          tContStyle.transform = tContTranslation;
+          tContStyle.webkitTransform = tContTranslation;
 
-    var letters = documentData.l;
-    len = letters.length;
-    var tSpan,tParent,tCont;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '';
-    var cnt = 0;
-    for (i = 0;i < len ;i += 1) {
-        if(this.globalData.fontManager.chars){
-            if(!this.textPaths[cnt]){
-                tSpan = createNS('path');
-                tSpan.setAttribute('stroke-linecap', 'butt');
-                tSpan.setAttribute('stroke-linejoin','round');
-                tSpan.setAttribute('stroke-miterlimit','4');
-            } else {
-                tSpan = this.textPaths[cnt];
-            }
-            if(!this.isMasked){
-                if(this.textSpans[cnt]){
-                    tParent = this.textSpans[cnt];
-                    tCont = tParent.children[0];
-                } else {
-
-                    tParent = createTag('div');
-                    tParent.style.lineHeight = 0;
-                    tCont = createNS('svg');
-                    tCont.appendChild(tSpan);
-                    styleDiv(tParent);
-                }
-            }
-        }else{
-            if(!this.isMasked){
-                if(this.textSpans[cnt]){
-                    tParent = this.textSpans[cnt];
-                    tSpan = this.textPaths[cnt];
-                } else {
-                    tParent = createTag('span');
-                    styleDiv(tParent);
-                    tSpan = createTag('span');
-                    styleDiv(tSpan);
-                    tParent.appendChild(tSpan);
-                }
-            } else {
-                tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
-            }
+          letters[i].yOffset = boundingBox.y - 1;
+        } else {
+          tCont.setAttribute('width', 1);
+          tCont.setAttribute('height', 1);
         }
-        //tSpan.setAttribute('visibility', 'hidden');
-        if(this.globalData.fontManager.chars){
-            var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-            var shapeData;
-            if(charData){
-                shapeData = charData.data;
-            } else {
-                shapeData = null;
-            }
-            matrixHelper.reset();
-            if(shapeData && shapeData.shapes){
-                shapes = shapeData.shapes[0].it;
-                matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
-                shapeStr = this.createPathShape(matrixHelper,shapes);
-                tSpan.setAttribute('d',shapeStr);
-            }
-            if(!this.isMasked){
-                this.innerElem.appendChild(tParent);
-                if(shapeData && shapeData.shapes){
-
-                    //document.body.appendChild is needed to get exact measure of shape
-                    document.body.appendChild(tCont);
-                    var boundingBox = tCont.getBBox();
-                    tCont.setAttribute('width',boundingBox.width + 2);
-                    tCont.setAttribute('height',boundingBox.height + 2);
-                    tCont.setAttribute('viewBox',(boundingBox.x-1)+' '+ (boundingBox.y-1)+' '+ (boundingBox.width+2)+' '+ (boundingBox.height+2));
-                    tCont.style.transform = tCont.style.webkitTransform = 'translate(' + (boundingBox.x-1) + 'px,' + (boundingBox.y-1) + 'px)';
-
-                    letters[i].yOffset = boundingBox.y-1;
-
-                } else{
-                    tCont.setAttribute('width',1);
-                    tCont.setAttribute('height',1);
-                }
-                    tParent.appendChild(tCont);
-            }else{
-                this.innerElem.appendChild(tSpan);
-            }
-        }else{
-            tSpan.textContent = letters[i].val;
-            tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            if(!this.isMasked){
-                this.innerElem.appendChild(tParent);
-                //
-                tSpan.style.transform = tSpan.style.webkitTransform = 'translate3d(0,'+ -documentData.finalSize/1.2+'px,0)';
-            } else {
-                this.innerElem.appendChild(tSpan);
-            }
-        }
+        tParent.appendChild(tCont);
+      } else {
+        this.innerElem.appendChild(tSpan);
+      }
+    } else {
+      tSpan.textContent = letters[i].val;
+      tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
+      if (!this.isMasked) {
+        this.innerElem.appendChild(tParent);
         //
-        if(!this.isMasked){
-            this.textSpans[cnt] = tParent;
-        }else{
-            this.textSpans[cnt] = tSpan;
-        }
-        this.textSpans[cnt].style.display = 'block';
-        this.textPaths[cnt] = tSpan;
-        cnt += 1;
+        var tStyle = tSpan.style;
+        var tSpanTranslation = 'translate3d(0,' + -documentData.finalSize / 1.2 + 'px,0)';
+        tStyle.transform = tSpanTranslation;
+        tStyle.webkitTransform = tSpanTranslation;
+      } else {
+        this.innerElem.appendChild(tSpan);
+      }
     }
-    while(cnt < this.textSpans.length){
-        this.textSpans[cnt].style.display = 'none';
-        cnt += 1;
+    //
+    if (!this.isMasked) {
+      this.textSpans[cnt] = tParent;
+    } else {
+      this.textSpans[cnt] = tSpan;
     }
+    this.textSpans[cnt].style.display = 'block';
+    this.textPaths[cnt] = tSpan;
+    cnt += 1;
+  }
+  while (cnt < this.textSpans.length) {
+    this.textSpans[cnt].style.display = 'none';
+    cnt += 1;
+  }
 };
 
-HTextElement.prototype.renderInnerContent = function() {
+HTextElement.prototype.renderInnerContent = function () {
+  var svgStyle;
+  if (this.data.singleShape) {
+    if (!this._isFirstFrame && !this.lettersChangedFlag) {
+      return;
+    } if (this.isMasked && this.finalTransform._matMdf) {
+      // Todo Benchmark if using this is better than getBBox
+      this.svgElement.setAttribute('viewBox', -this.finalTransform.mProp.p.v[0] + ' ' + -this.finalTransform.mProp.p.v[1] + ' ' + this.compW + ' ' + this.compH);
+      svgStyle = this.svgElement.style;
+      var translation = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
+      svgStyle.transform = translation;
+      svgStyle.webkitTransform = translation;
+    }
+  }
 
-    if(this.data.singleShape){
-        if(!this._isFirstFrame && !this.lettersChangedFlag){
-            return;
+  this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  if (!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag) {
+    return;
+  }
+  var i;
+  var len;
+  var count = 0;
+  var renderedLetters = this.textAnimator.renderedLetters;
+
+  var letters = this.textProperty.currentData.l;
+
+  len = letters.length;
+  var renderedLetter;
+  var textSpan;
+  var textPath;
+  for (i = 0; i < len; i += 1) {
+    if (letters[i].n) {
+      count += 1;
+    } else {
+      textSpan = this.textSpans[i];
+      textPath = this.textPaths[i];
+      renderedLetter = renderedLetters[count];
+      count += 1;
+      if (renderedLetter._mdf.m) {
+        if (!this.isMasked) {
+          textSpan.style.webkitTransform = renderedLetter.m;
+          textSpan.style.transform = renderedLetter.m;
         } else {
-            // Todo Benchmark if using this is better than getBBox
-             if(this.isMasked && this.finalTransform._matMdf){
-                 this.svgElement.setAttribute('viewBox',-this.finalTransform.mProp.p.v[0]+' '+ -this.finalTransform.mProp.p.v[1]+' '+this.compW+' '+this.compH);
-                this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
-             }
+          textSpan.setAttribute('transform', renderedLetter.m);
         }
+      }
+      /// /textSpan.setAttribute('opacity',renderedLetter.o);
+      textSpan.style.opacity = renderedLetter.o;
+      if (renderedLetter.sw && renderedLetter._mdf.sw) {
+        textPath.setAttribute('stroke-width', renderedLetter.sw);
+      }
+      if (renderedLetter.sc && renderedLetter._mdf.sc) {
+        textPath.setAttribute('stroke', renderedLetter.sc);
+      }
+      if (renderedLetter.fc && renderedLetter._mdf.fc) {
+        textPath.setAttribute('fill', renderedLetter.fc);
+        textPath.style.color = renderedLetter.fc;
+      }
+    }
+  }
+
+  if (this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)) {
+    var boundingBox = this.innerElem.getBBox();
+
+    if (this.currentBBox.w !== boundingBox.width) {
+      this.currentBBox.w = boundingBox.width;
+      this.svgElement.setAttribute('width', boundingBox.width);
+    }
+    if (this.currentBBox.h !== boundingBox.height) {
+      this.currentBBox.h = boundingBox.height;
+      this.svgElement.setAttribute('height', boundingBox.height);
     }
 
-    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
-    if(!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag){
-        return;
+    var margin = 1;
+    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)) {
+      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;
+
+      this.svgElement.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
+      svgStyle = this.svgElement.style;
+      var svgTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
+      svgStyle.transform = svgTransform;
+      svgStyle.webkitTransform = svgTransform;
     }
-    var  i,len, count = 0;
-    var renderedLetters = this.textAnimator.renderedLetters;
-
-    var letters = this.textProperty.currentData.l;
-
-    len = letters.length;
-    var renderedLetter, textSpan, textPath;
-    for(i=0;i<len;i+=1){
-        if(letters[i].n){
-            count += 1;
-            continue;
-        }
-        textSpan = this.textSpans[i];
-        textPath = this.textPaths[i];
-        renderedLetter = renderedLetters[count];
-        count += 1;
-        if(renderedLetter._mdf.m) {
-            if(!this.isMasked){
-                textSpan.style.transform = textSpan.style.webkitTransform = renderedLetter.m;
-            }else{
-                textSpan.setAttribute('transform',renderedLetter.m);
-            }
-        }
-        ////textSpan.setAttribute('opacity',renderedLetter.o);
-        textSpan.style.opacity = renderedLetter.o;
-        if(renderedLetter.sw && renderedLetter._mdf.sw){
-            textPath.setAttribute('stroke-width',renderedLetter.sw);
-        }
-        if(renderedLetter.sc && renderedLetter._mdf.sc){
-            textPath.setAttribute('stroke',renderedLetter.sc);
-        }
-        if(renderedLetter.fc && renderedLetter._mdf.fc){
-            textPath.setAttribute('fill',renderedLetter.fc);
-            textPath.style.color = renderedLetter.fc;
-        }
-    }
-
-    if(this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)){
-        var boundingBox = this.innerElem.getBBox();
-
-        if(this.currentBBox.w !== boundingBox.width){
-            this.currentBBox.w = boundingBox.width;
-            this.svgElement.setAttribute('width',boundingBox.width);
-        }
-        if(this.currentBBox.h !== boundingBox.height){
-            this.currentBBox.h = boundingBox.height;
-            this.svgElement.setAttribute('height',boundingBox.height);
-        }
-
-        var margin = 1;
-        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)){
-            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;
-
-            this.svgElement.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
-            this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
-        }
-    }
+  }
 };
-function HImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement,
+FrameElement, RenderableElement, createNS */
+
+function HImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement], HImageElement);
+extendPrototype([BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement);
 
+HImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  var img = new Image();
 
-HImageElement.prototype.createContent = function(){
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
-    var img = new Image();
-
-    if(this.data.hasMask){
-        this.imageElem = createNS('image');
-        this.imageElem.setAttribute('width',this.assetData.w+"px");
-        this.imageElem.setAttribute('height',this.assetData.h+"px");
-        this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-        this.layerElement.appendChild(this.imageElem);
-        this.baseElement.setAttribute('width',this.assetData.w);
-        this.baseElement.setAttribute('height',this.assetData.h);
-    } else {
-        this.layerElement.appendChild(img);
-    }
-    img.crossOrigin = 'anonymous';
-    img.src = assetPath;
-    if(this.data.ln){
-        this.baseElement.setAttribute('id',this.data.ln);
-    }
+  if (this.data.hasMask) {
+    this.imageElem = createNS('image');
+    this.imageElem.setAttribute('width', this.assetData.w + 'px');
+    this.imageElem.setAttribute('height', this.assetData.h + 'px');
+    this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
+    this.layerElement.appendChild(this.imageElem);
+    this.baseElement.setAttribute('width', this.assetData.w);
+    this.baseElement.setAttribute('height', this.assetData.h);
+  } else {
+    this.layerElement.appendChild(img);
+  }
+  img.crossOrigin = 'anonymous';
+  img.src = assetPath;
+  if (this.data.ln) {
+    this.baseElement.setAttribute('id', this.data.ln);
+  }
 };
-function HCameraElement(data,globalData,comp){
-    this.initFrame();
-    this.initBaseData(data,globalData,comp);
-    this.initHierarchy();
-    var getProp = PropertyFactory.getProp;
-    this.pe = getProp(this,data.pe,0,0,this);
-    if(data.ks.p.s){
-        this.px = getProp(this,data.ks.p.x,1,0,this);
-        this.py = getProp(this,data.ks.p.y,1,0,this);
-        this.pz = getProp(this,data.ks.p.z,1,0,this);
-    }else{
-        this.p = getProp(this,data.ks.p,1,0,this);
+
+/* global PropertyFactory, degToRads, Matrix, extendPrototype, BaseElement, FrameElement, HierarchyElement */
+
+function HCameraElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initHierarchy();
+  var getProp = PropertyFactory.getProp;
+  this.pe = getProp(this, data.pe, 0, 0, this);
+  if (data.ks.p.s) {
+    this.px = getProp(this, data.ks.p.x, 1, 0, this);
+    this.py = getProp(this, data.ks.p.y, 1, 0, this);
+    this.pz = getProp(this, data.ks.p.z, 1, 0, this);
+  } else {
+    this.p = getProp(this, data.ks.p, 1, 0, this);
+  }
+  if (data.ks.a) {
+    this.a = getProp(this, data.ks.a, 1, 0, this);
+  }
+  if (data.ks.or.k.length && data.ks.or.k[0].to) {
+    var i;
+    var len = data.ks.or.k.length;
+    for (i = 0; i < len; i += 1) {
+      data.ks.or.k[i].to = null;
+      data.ks.or.k[i].ti = null;
     }
-    if(data.ks.a){
-        this.a = getProp(this,data.ks.a,1,0,this);
-    }
-    if(data.ks.or.k.length && data.ks.or.k[0].to){
-        var i,len = data.ks.or.k.length;
-        for(i=0;i<len;i+=1){
-            data.ks.or.k[i].to = null;
-            data.ks.or.k[i].ti = null;
-        }
-    }
-    this.or = getProp(this,data.ks.or,1,degToRads,this);
-    this.or.sh = true;
-    this.rx = getProp(this,data.ks.rx,0,degToRads,this);
-    this.ry = getProp(this,data.ks.ry,0,degToRads,this);
-    this.rz = getProp(this,data.ks.rz,0,degToRads,this);
-    this.mat = new Matrix();
-    this._prevMat = new Matrix();
-    this._isFirstFrame = true;
-    
-    // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
-    this.finalTransform = {
-        mProp: this
-    };
+  }
+  this.or = getProp(this, data.ks.or, 1, degToRads, this);
+  this.or.sh = true;
+  this.rx = getProp(this, data.ks.rx, 0, degToRads, this);
+  this.ry = getProp(this, data.ks.ry, 0, degToRads, this);
+  this.rz = getProp(this, data.ks.rz, 0, degToRads, this);
+  this.mat = new Matrix();
+  this._prevMat = new Matrix();
+  this._isFirstFrame = true;
+
+  // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
+  this.finalTransform = {
+    mProp: this,
+  };
 }
 extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement);
 
-HCameraElement.prototype.setup = function() {
-    var i, len = this.comp.threeDElements.length, comp;
-    for(i=0;i<len;i+=1){
-        //[perspectiveElem,container]
+HCameraElement.prototype.setup = function () {
+  var i;
+  var len = this.comp.threeDElements.length;
+  var comp;
+  var perspectiveStyle;
+  var containerStyle;
+  for (i = 0; i < len; i += 1) {
+    // [perspectiveElem,container]
+    comp = this.comp.threeDElements[i];
+    if (comp.type === '3d') {
+      perspectiveStyle = comp.perspectiveElem.style;
+      containerStyle = comp.container.style;
+      var perspective = this.pe.v + 'px';
+      var origin = '0px 0px 0px';
+      var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+      perspectiveStyle.perspective = perspective;
+      perspectiveStyle.webkitPerspective = perspective;
+      containerStyle.transformOrigin = origin;
+      containerStyle.mozTransformOrigin = origin;
+      containerStyle.webkitTransformOrigin = origin;
+      perspectiveStyle.transform = matrix;
+      perspectiveStyle.webkitTransform = matrix;
+    }
+  }
+};
+
+HCameraElement.prototype.createElements = function () {
+};
+
+HCameraElement.prototype.hide = function () {
+};
+
+HCameraElement.prototype.renderFrame = function () {
+  var _mdf = this._isFirstFrame;
+  var i;
+  var len;
+  if (this.hierarchy) {
+    len = this.hierarchy.length;
+    for (i = 0; i < len; i += 1) {
+      _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
+    }
+  }
+  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)) {
+    this.mat.reset();
+
+    if (this.hierarchy) {
+      len = this.hierarchy.length - 1;
+      for (i = len; i >= 0; i -= 1) {
+        var mTransf = this.hierarchy[i].finalTransform.mProp;
+        this.mat.translate(-mTransf.p.v[0], -mTransf.p.v[1], mTransf.p.v[2]);
+        this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
+        this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
+        this.mat.scale(1 / mTransf.s.v[0], 1 / mTransf.s.v[1], 1 / mTransf.s.v[2]);
+        this.mat.translate(mTransf.a.v[0], mTransf.a.v[1], mTransf.a.v[2]);
+      }
+    }
+    if (this.p) {
+      this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]);
+    } else {
+      this.mat.translate(-this.px.v, -this.py.v, this.pz.v);
+    }
+    if (this.a) {
+      var diffVector;
+      if (this.p) {
+        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]];
+      } else {
+        diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
+      }
+      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));
+      var lookDir = [diffVector[0] / mag, diffVector[1] / mag, diffVector[2] / mag];
+      var lookLengthOnXZ = Math.sqrt(lookDir[2] * lookDir[2] + lookDir[0] * lookDir[0]);
+      var mRotationX = (Math.atan2(lookDir[1], lookLengthOnXZ));
+      var mRotationY = (Math.atan2(lookDir[0], -lookDir[2]));
+      this.mat.rotateY(mRotationY).rotateX(-mRotationX);
+    }
+    this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
+    this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
+    this.mat.translate(this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0);
+    this.mat.translate(0, 0, this.pe.v);
+
+    var hasMatrixChanged = !this._prevMat.equals(this.mat);
+    if ((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
+      len = this.comp.threeDElements.length;
+      var comp;
+      var perspectiveStyle;
+      var containerStyle;
+      for (i = 0; i < len; i += 1) {
         comp = this.comp.threeDElements[i];
-        if(comp.type === '3d') {
-            comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
-            comp.container.style.transformOrigin = comp.container.style.mozTransformOrigin = comp.container.style.webkitTransformOrigin = "0px 0px 0px";
-            comp.perspectiveElem.style.transform = comp.perspectiveElem.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+        if (comp.type === '3d') {
+          if (hasMatrixChanged) {
+            var matValue = this.mat.toCSS();
+            containerStyle = comp.container.style;
+            containerStyle.transform = matValue;
+            containerStyle.webkitTransform = matValue;
+          }
+          if (this.pe._mdf) {
+            perspectiveStyle = comp.perspectiveElem.style;
+            perspectiveStyle.perspective = this.pe.v + 'px';
+            perspectiveStyle.webkitPerspective = this.pe.v + 'px';
+          }
         }
+      }
+      this.mat.clone(this._prevMat);
     }
+  }
+  this._isFirstFrame = false;
 };
 
-HCameraElement.prototype.createElements = function(){
+HCameraElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-HCameraElement.prototype.hide = function(){
+HCameraElement.prototype.destroy = function () {
 };
+HCameraElement.prototype.getBaseElement = function () { return null; };
 
-HCameraElement.prototype.renderFrame = function(){
-    var _mdf = this._isFirstFrame;
-    var i, len;
-    if(this.hierarchy){
-        len = this.hierarchy.length;
-        for(i=0;i<len;i+=1){
-            _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
-        }
-    }
-    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)) {
-        this.mat.reset();
-
-        if(this.hierarchy){
-            var mat;
-            len = this.hierarchy.length - 1;
-            for (i = len; i >= 0; i -= 1) {
-                var mTransf = this.hierarchy[i].finalTransform.mProp;
-                this.mat.translate(-mTransf.p.v[0],-mTransf.p.v[1],mTransf.p.v[2]);
-                this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
-                this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
-                this.mat.scale(1/mTransf.s.v[0],1/mTransf.s.v[1],1/mTransf.s.v[2]);
-                this.mat.translate(mTransf.a.v[0],mTransf.a.v[1],mTransf.a.v[2]);
-            }
-        }
-        if (this.p) {
-            this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]);
-        } else {
-            this.mat.translate(-this.px.v,-this.py.v,this.pz.v);
-        }
-        if (this.a) {
-            var diffVector
-            if (this.p) {
-                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]];
-            } else {
-                diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
-            }
-            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));
-            var lookDir = [diffVector[0]/mag,diffVector[1]/mag,diffVector[2]/mag];
-            var lookLengthOnXZ = Math.sqrt( lookDir[2]*lookDir[2] + lookDir[0]*lookDir[0] );
-            var m_rotationX = (Math.atan2( lookDir[1], lookLengthOnXZ ));
-            var m_rotationY = (Math.atan2( lookDir[0], -lookDir[2]));
-            this.mat.rotateY(m_rotationY).rotateX(-m_rotationX);
-
-        }
-        this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
-        this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
-        this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0);
-        this.mat.translate(0,0,this.pe.v);
-
-
-        
-
-        var hasMatrixChanged = !this._prevMat.equals(this.mat);
-        if((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
-            len = this.comp.threeDElements.length;
-            var comp;
-            for(i=0;i<len;i+=1){
-                comp = this.comp.threeDElements[i];
-                if(comp.type === '3d') {
-                    if(hasMatrixChanged) {
-                        comp.container.style.transform = comp.container.style.webkitTransform = this.mat.toCSS();
-                    }
-                    if(this.pe._mdf) {
-                        comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
-                    }
-                }
-            }
-            this.mat.clone(this._prevMat);
-        }
-    }
-    this._isFirstFrame = false;
-};
-
-HCameraElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
-};
-
-HCameraElement.prototype.destroy = function(){
-};
-HCameraElement.prototype.getBaseElement = function(){return null;};
 function HEffects() {
 }
-HEffects.prototype.renderFrame = function(){};
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
+HEffects.prototype.renderFrame = function () {};
 
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+/* global createTag, AnimationItem */
+/* exported animationManager */
+
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
+    while (i < len) {
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      window.requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            window.requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    window.requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        window.requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations(animationData, standalone, renderer) {
+    var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+      [].slice.call(document.getElementsByClassName('bodymovin')));
+    var i;
+    var lenAnims = animElements.length;
+    for (i = 0; i < lenAnims; i += 1) {
+      if (renderer) {
+        animElements[i].setAttribute('data-bm-type', renderer);
+      }
+      registerAnimation(animElements[i], animationData);
     }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
-                  [].slice.call(document.getElementsByClassName('bodymovin')));
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerText = '';
-            var div = createTag('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
+    if (standalone && lenAnims === 0) {
+      if (!renderer) {
+        renderer = 'svg';
+      }
+      var body = document.getElementsByTagName('body')[0];
+      body.innerText = '';
+      var div = createTag('div');
+      div.style.width = '100%';
+      div.style.height = '100%';
+      div.setAttribute('data-bm-type', renderer);
+      body.appendChild(div);
+      registerAnimation(div, animationData);
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                window.requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        window.requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function freeze() {
-        _isFrozen = true;
+  function freeze() {
+    _isFrozen = true;
+  }
+
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
+
+  function setVolume(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setVolume(val, animation);
     }
+  }
 
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
+  function mute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.mute(animation);
     }
+  }
 
-    function setVolume(val,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setVolume(val, animation);
-        }
+  function unmute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.unmute(animation);
     }
+  }
 
-    function mute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.mute(animation);
-        }
-    }
-
-    function unmute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.unmute(animation);
-        }
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.setVolume = setVolume;
-    moduleOb.mute = mute;
-    moduleOb.unmute = unmute;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.setVolume = setVolume;
+  moduleOb.mute = mute;
+  moduleOb.unmute = unmute;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
+/* global createElementID, subframeEnabled, ProjectInterface, ImagePreloader, audioControllerFactory, extendPrototype, BaseEvent,
+CanvasRenderer, SVGRenderer, HybridRenderer, assetLoader, dataManager, expressionsPlugin, BMEnterFrameEvent, BMCompleteLoopEvent,
+BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent,
+BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent */
+
 var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.firstFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.playCount = 0;
-    this.animationData = {};
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = createElementID();
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.isSubframeEnabled = subframeEnabled;
-    this.segments = [];
-    this._idle = true;
-    this._completedLoop = false;
-    this.projectInterface = ProjectInterface();
-    this.imagePreloader = new ImagePreloader();
-    this.audioController = audioControllerFactory();
+  this._cbs = [];
+  this.name = '';
+  this.path = '';
+  this.isLoaded = false;
+  this.currentFrame = 0;
+  this.currentRawFrame = 0;
+  this.firstFrame = 0;
+  this.totalFrames = 0;
+  this.frameRate = 0;
+  this.frameMult = 0;
+  this.playSpeed = 1;
+  this.playDirection = 1;
+  this.playCount = 0;
+  this.animationData = {};
+  this.assets = [];
+  this.isPaused = true;
+  this.autoplay = false;
+  this.loop = true;
+  this.renderer = null;
+  this.animationID = createElementID();
+  this.assetsPath = '';
+  this.timeCompleted = 0;
+  this.segmentPos = 0;
+  this.isSubframeEnabled = subframeEnabled;
+  this.segments = [];
+  this._idle = true;
+  this._completedLoop = false;
+  this.projectInterface = ProjectInterface();
+  this.imagePreloader = new ImagePreloader();
+  this.audioController = audioControllerFactory();
 };
 
 extendPrototype([BaseEvent], AnimationItem);
 
-AnimationItem.prototype.setParams = function(params) {
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-    if (params.loop === ''
+AnimationItem.prototype.setParams = function (params) {
+  if (params.wrapper || params.container) {
+    this.wrapper = params.wrapper || params.container;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    case 'svg':
+      this.renderer = new SVGRenderer(this, params.rendererSettings);
+      break;
+    default:
+      this.renderer = new HybridRenderer(this, params.rendererSettings);
+      break;
+  }
+  this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+  if (params.loop === ''
         || params.loop === null
         || params.loop === undefined
-        || params.loop === true)
-    {
-        this.loop = true;
-    } else if (params.loop === false) {
-        this.loop = false;
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = params.assetsPath;
+  this.initialSegment = params.initialSegment;
+  if (params.audioFactory) {
+    this.audioController.setAudioFactory(params.audioFactory);
+  }
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    if (params.path.lastIndexOf('\\') !== -1) {
+      this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
     } else {
-        this.loop = parseInt(params.loop);
+      this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
     }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = params.assetsPath;
-    this.initialSegment = params.initialSegment;
-    if (params.audioFactory) {
-        this.audioController.setAudioFactory(params.audioFactory);
-    }
-    if (params.animationData) {
-        this.configAnimation(params.animationData);
-    } else if(params.path){
+    this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
+    this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
 
-        if( params.path.lastIndexOf('\\') !== -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        } else {
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-
-        assetLoader.load(params.path, this.configAnimation.bind(this), function() {
-            this.trigger('data_failed');
-        }.bind(this));
-    }
-
+    assetLoader.load(params.path, this.configAnimation.bind(this), function () {
+      this.trigger('data_failed');
+    }.bind(this));
+  }
 };
 
 AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
+  if (animationData) {
+    if (typeof animationData !== 'object') {
+      animationData = JSON.parse(animationData);
     }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
+  }
+  var params = {
+    wrapper: wrapper,
+    animationData: animationData,
+  };
+  var wrapperAttributes = wrapper.attributes;
 
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
+  params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-animation-path').value
+    : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-path').value
+      : wrapperAttributes.getNamedItem('bm-path')
+        ? wrapperAttributes.getNamedItem('bm-path').value
+        : '';
+  params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-type').value
+    : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-type').value
+      : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
+        ? wrapperAttributes.getNamedItem('bm-type').value
+        : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
+          ? wrapperAttributes.getNamedItem('data-bm-renderer').value
+          : wrapperAttributes.getNamedItem('bm-renderer')
+            ? wrapperAttributes.getNamedItem('bm-renderer').value
+            : 'canvas';
 
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
+  var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-loop').value
+    : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-loop').value
+      : wrapperAttributes.getNamedItem('bm-loop')
+        ? wrapperAttributes.getNamedItem('bm-loop').value
+        : '';
+  if (loop === 'false') {
+    params.loop = false;
+  } else if (loop === 'true') {
+    params.loop = true;
+  } else if (loop !== '') {
+    params.loop = parseInt(loop, 10);
+  }
+  var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-autoplay').value
+    : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-autoplay').value
+      : wrapperAttributes.getNamedItem('bm-autoplay')
+        ? wrapperAttributes.getNamedItem('bm-autoplay').value
+        : true;
+  params.autoplay = autoplay !== 'false';
+
+  params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-name').value
+    : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-name').value
+      : wrapperAttributes.getNamedItem('bm-name')
+        ? wrapperAttributes.getNamedItem('bm-name').value
+        : '';
+  var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-prerender').value
+    : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-prerender').value
+      : wrapperAttributes.getNamedItem('bm-prerender')
+        ? wrapperAttributes.getNamedItem('bm-prerender').value
+        : '';
+
+  if (prerender === 'false') {
+    params.prerender = false;
+  }
+  this.setParams(params);
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
+  }
+  if (data.chars || data.fonts) {
+    this.renderer.globalData.fontManager.addChars(data.chars);
+    this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
+  }
+  if (data.assets) {
+    len = data.assets.length;
+    for (i = 0; i < len; i += 1) {
+      this.animationData.assets.push(data.assets[i]);
     }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
-        this.trigger('data_failed');
-    }.bind(this));
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.trigger('data_ready');
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  var segment = segments.shift();
+  this.timeCompleted = segment.time * this.frameRate;
+  var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
+  this.segmentPos += 1;
+  assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
+    this.trigger('data_failed');
+  }.bind(this));
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
-    }
-    this.loadNextSegment();
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.imagesLoaded = function() {
-    this.trigger('loaded_images');
-    this.checkLoaded()
-}
+AnimationItem.prototype.imagesLoaded = function () {
+  this.trigger('loaded_images');
+  this.checkLoaded();
+};
 
-AnimationItem.prototype.preloadImages = function() {
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
-}
+AnimationItem.prototype.preloadImages = function () {
+  this.imagePreloader.setAssetsPath(this.assetsPath);
+  this.imagePreloader.setPath(this.path);
+  this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
+};
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    try {
-        this.animationData = animData;
+  if (!this.renderer) {
+    return;
+  }
+  try {
+    this.animationData = animData;
 
-        if (this.initialSegment) {
-            this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
-            this.firstFrame = Math.round(this.initialSegment[0]);
-        } else {
-            this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-            this.firstFrame = Math.round(this.animationData.ip);
-        }
-        this.renderer.configAnimation(animData);
-        if(!animData.assets){
-            animData.assets = [];
-        }
-
-        this.assets = this.animationData.assets;
-        this.frameRate = this.animationData.fr;
-        this.frameMult = this.animationData.fr / 1000;
-        this.renderer.searchExtraCompositions(animData.assets);
-        this.trigger('config_ready');
-        this.preloadImages();
-        this.loadSegments();
-        this.updaFrameModifier();
-        this.waitForFontsLoaded();
-        if (this.isPaused) {
-            this.audioController.pause();
-        }
-    } catch(error) {
-        this.triggerConfigError(error);
+    if (this.initialSegment) {
+      this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+      this.firstFrame = Math.round(this.initialSegment[0]);
+    } else {
+      this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+      this.firstFrame = Math.round(this.animationData.ip);
     }
+    this.renderer.configAnimation(animData);
+    if (!animData.assets) {
+      animData.assets = [];
+    }
+
+    this.assets = this.animationData.assets;
+    this.frameRate = this.animationData.fr;
+    this.frameMult = this.animationData.fr / 1000;
+    this.renderer.searchExtraCompositions(animData.assets);
+    this.trigger('config_ready');
+    this.preloadImages();
+    this.loadSegments();
+    this.updaFrameModifier();
+    this.waitForFontsLoaded();
+    if (this.isPaused) {
+      this.audioController.pause();
+    }
+  } catch (error) {
+    this.triggerConfigError(error);
+  }
 };
 
-AnimationItem.prototype.waitForFontsLoaded = function(){
-    if(!this.renderer) {
-        return;
-    }
-    if(this.renderer.globalData.fontManager.isLoaded){
-        this.checkLoaded();
-    }else{
-        setTimeout(this.waitForFontsLoaded.bind(this),20);
-    }
-}
+AnimationItem.prototype.waitForFontsLoaded = function () {
+  if (!this.renderer) {
+    return;
+  }
+  if (this.renderer.globalData.fontManager.isLoaded) {
+    this.checkLoaded();
+  } else {
+    setTimeout(this.waitForFontsLoaded.bind(this), 20);
+  }
+};
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded 
+  if (!this.isLoaded
         && this.renderer.globalData.fontManager.isLoaded
         && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')
-    ) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function() {
-            this.trigger('DOMLoaded');
-        }.bind(this), 0);
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
+  ) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    setTimeout(function () {
+      this.trigger('DOMLoaded');
+    }.bind(this), 0);
+    this.gotoFrame();
+    if (this.autoplay) {
+      this.play();
+    }
+  }
 };
 
 AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
+  this.renderer.updateContainerSize();
 };
 
-AnimationItem.prototype.setSubframe = function(flag){
-    this.isSubframeEnabled = !!flag;
+AnimationItem.prototype.setSubframe = function (flag) {
+  this.isSubframeEnabled = !!flag;
 };
 
 AnimationItem.prototype.gotoFrame = function () {
-    this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
+  this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
 
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
+  if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
+    this.currentFrame = this.timeCompleted;
+  }
+  this.trigger('enterFrame');
+  this.renderFrame();
 };
 
 AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    try {
-        this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-    } catch(error) {
-        this.triggerRenderFrameError(error);
-    }
+  if (this.isLoaded === false) {
+    return;
+  }
+  try {
+    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
+  } catch (error) {
+    this.triggerRenderFrameError(error);
+  }
 };
 
 AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.isPaused = false;
+    this.audioController.resume();
+    if (this._idle) {
+      this._idle = false;
+      this.trigger('_active');
     }
-    if (this.isPaused === true) {
-        this.isPaused = false;
-        this.audioController.resume();
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
+  }
 };
 
 AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        this._idle = true;
-        this.trigger('_idle');
-        this.audioController.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === false) {
+    this.isPaused = true;
+    this._idle = true;
+    this.trigger('_idle');
+    this.audioController.pause();
+  }
 };
 
 AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.play();
+  } else {
+    this.pause();
+  }
 };
 
 AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.playCount = 0;
-    this._completedLoop = false;
-    this.setCurrentRawFrameValue(0);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.pause();
+  this.playCount = 0;
+  this._completedLoop = false;
+  this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
+  if (name && this.name !== name) {
+    return;
+  }
+  if (isFrame) {
+    this.setCurrentRawFrameValue(value);
+  } else {
+    this.setCurrentRawFrameValue(value * this.frameModifier);
+  }
+  this.pause();
 };
 
 AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
+  this.goToAndStop(value, isFrame, name);
+  this.play();
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    var nextValue = this.currentRawFrame + value * this.frameModifier;
-    var _isComplete = false;
-    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
-    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
-    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
-        if (!this.loop || this.playCount === this.loop) {
-            if (!this.checkSegments(nextValue >  this.totalFrames ? nextValue % this.totalFrames : 0)) {
-                _isComplete = true;
-                nextValue = this.totalFrames - 1;
-            }
-        } else if (nextValue >= this.totalFrames) {
-            this.playCount += 1;
-            if (!this.checkSegments(nextValue % this.totalFrames)) {
-                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
-                this._completedLoop = true;
-                this.trigger('loopComplete');
-            }
-        } else {
-            this.setCurrentRawFrameValue(nextValue);
-        }
-    } else if(nextValue < 0) {
-        if (!this.checkSegments(nextValue % this.totalFrames)) {
-            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
-                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
-                if(!this._completedLoop) {
-                    this._completedLoop = true;
-                } else {
-                    this.trigger('loopComplete');
-                }
-            } else {
-                _isComplete = true;
-                nextValue = 0;
-            }
-        }
+  if (this.isPaused === true || this.isLoaded === false) {
+    return;
+  }
+  var nextValue = this.currentRawFrame + value * this.frameModifier;
+  var _isComplete = false;
+  // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+  // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+  if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+    if (!this.loop || this.playCount === this.loop) {
+      if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
+        _isComplete = true;
+        nextValue = this.totalFrames - 1;
+      }
+    } else if (nextValue >= this.totalFrames) {
+      this.playCount += 1;
+      if (!this.checkSegments(nextValue % this.totalFrames)) {
+        this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+        this._completedLoop = true;
+        this.trigger('loopComplete');
+      }
     } else {
-        this.setCurrentRawFrameValue(nextValue);
+      this.setCurrentRawFrameValue(nextValue);
     }
-    if (_isComplete) {
-        this.setCurrentRawFrameValue(nextValue);
-        this.pause();
-        this.trigger('complete');
+  } else if (nextValue < 0) {
+    if (!this.checkSegments(nextValue % this.totalFrames)) {
+      if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) { // eslint-disable-line no-plusplus
+        this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+        if (!this._completedLoop) {
+          this._completedLoop = true;
+        } else {
+          this.trigger('loopComplete');
+        }
+      } else {
+        _isComplete = true;
+        nextValue = 0;
+      }
     }
+  } else {
+    this.setCurrentRawFrameValue(nextValue);
+  }
+  if (_isComplete) {
+    this.setCurrentRawFrameValue(nextValue);
+    this.pause();
+    this.trigger('complete');
+  }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr, offset){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0.001 + offset);
+AnimationItem.prototype.adjustSegment = function (arr, offset) {
+  this.playCount = 0;
+  if (arr[1] < arr[0]) {
+    if (this.frameModifier > 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(-1);
+      }
     }
-    this.trigger('segmentStart');
+    this.totalFrames = arr[0] - arr[1];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[1];
+    this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
+  } else if (arr[1] > arr[0]) {
+    if (this.frameModifier < 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(1);
+      }
+    }
+    this.totalFrames = arr[1] - arr[0];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[0];
+    this.setCurrentRawFrameValue(0.001 + offset);
+  }
+  this.trigger('segmentStart');
 };
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init;
-        }
+AnimationItem.prototype.setSegment = function (init, end) {
+  var pendingFrame = -1;
+  if (this.isPaused) {
+    if (this.currentRawFrame + this.firstFrame < init) {
+      pendingFrame = init;
+    } else if (this.currentRawFrame + this.firstFrame > end) {
+      pendingFrame = end - init;
     }
+  }
 
-    this.firstFrame = init;
-    this.timeCompleted = this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
+  this.firstFrame = init;
+  this.totalFrames = end - init;
+  this.timeCompleted = this.totalFrames;
+  if (pendingFrame !== -1) {
+    this.goToAndStop(pendingFrame, true);
+  }
 };
 
 AnimationItem.prototype.playSegments = function (arr, forceFlag) {
-    if (forceFlag) {
-        this.segments.length = 0;
+  if (forceFlag) {
+    this.segments.length = 0;
+  }
+  if (typeof arr[0] === 'object') {
+    var i;
+    var len = arr.length;
+    for (i = 0; i < len; i += 1) {
+      this.segments.push(arr[i]);
     }
-    if (typeof arr[0] === 'object') {
-        var i, len = arr.length;
-        for (i = 0; i < len; i += 1) {
-            this.segments.push(arr[i]);
-        }
-    } else {
-        this.segments.push(arr);
-    }
-    if (this.segments.length && forceFlag) {
-        this.adjustSegment(this.segments.shift(), 0);
-    }
-    if (this.isPaused) {
-        this.play();
-    }
+  } else {
+    this.segments.push(arr);
+  }
+  if (this.segments.length && forceFlag) {
+    this.adjustSegment(this.segments.shift(), 0);
+  }
+  if (this.isPaused) {
+    this.play();
+  }
 };
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip,this.animationData.op]);
-    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if (forceFlag) {
-        this.checkSegments(0);
-    }
+  this.segments.length = 0;
+  this.segments.push([this.animationData.ip, this.animationData.op]);
+  // this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+  if (forceFlag) {
+    this.checkSegments(0);
+  }
 };
-AnimationItem.prototype.checkSegments = function(offset) {
-    if (this.segments.length) {
-        this.adjustSegment(this.segments.shift(), offset);
-        return true;
-    }
-    return false;
+AnimationItem.prototype.checkSegments = function (offset) {
+  if (this.segments.length) {
+    this.adjustSegment(this.segments.shift(), offset);
+    return true;
+  }
+  return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this.imagePreloader.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this.imagePreloader.destroy();
+  this.trigger('destroy');
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
+  this.renderer = null;
+  this.imagePreloader = null;
+  this.projectInterface = null;
 };
 
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    this.gotoFrame();
+AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
+  this.currentRawFrame = value;
+  this.gotoFrame();
 };
 
 AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
+  this.playSpeed = val;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
+  this.playDirection = val < 0 ? -1 : 1;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setVolume = function (val, name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.setVolume(val);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.setVolume(val);
 };
 
 AnimationItem.prototype.getVolume = function () {
-    return this.audioController.getVolume();
+  return this.audioController.getVolume();
 };
 
 AnimationItem.prototype.mute = function (name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.mute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.mute();
 };
 
 AnimationItem.prototype.unmute = function (name) {
-    if(name && this.name !== name){
-        return;
-    }
-    this.audioController.unmute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.unmute();
 };
 
 AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-    this.audioController.setRate(this.playSpeed * this.playDirection)
+  this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
+  this.audioController.setRate(this.playSpeed * this.playDirection);
 };
 
 AnimationItem.prototype.getPath = function () {
-    return this.path;
+  return this.path;
 };
 
 AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(assetData.e) {
-        path = assetData.p;
-    } else if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
+  var path = '';
+  if (assetData.e) {
+    path = assetData.p;
+  } else if (this.assetsPath) {
+    var imagePath = assetData.p;
+    if (imagePath.indexOf('images/') !== -1) {
+      imagePath = imagePath.split('/')[1];
     }
-    return path;
+    path = this.assetsPath + imagePath;
+  } else {
+    path = this.path;
+    path += assetData.u ? assetData.u : '';
+    path += assetData.p;
+  }
+  return path;
 };
 
 AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
+  var i = 0;
+  var len = this.assets.length;
+  while (i < len) {
+    if (id === this.assets[i].id) {
+      return this.assets[i];
     }
+    i += 1;
+  }
+  return null;
 };
 
 AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
+  this.renderer.hide();
 };
 
 AnimationItem.prototype.show = function () {
-    this.renderer.show();
+  this.renderer.show();
 };
 
 AnimationItem.prototype.getDuration = function (isFrame) {
-    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+  return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
 };
 
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
+AnimationItem.prototype.trigger = function (name) {
+  if (this._cbs && this._cbs[name]) {
+    switch (name) {
+      case 'enterFrame':
+        this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
+        break;
+      case 'loopComplete':
+        this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+        break;
+      case 'complete':
+        this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
+        break;
+      case 'segmentStart':
+        this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+        break;
+      case 'destroy':
+        this.triggerEvent(name, new BMDestroyEvent(name, this));
+        break;
+      default:
+        this.triggerEvent(name);
     }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
+  }
+  if (name === 'enterFrame' && this.onEnterFrame) {
+    this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
+  }
+  if (name === 'loopComplete' && this.onLoopComplete) {
+    this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+  }
+  if (name === 'complete' && this.onComplete) {
+    this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
+  }
+  if (name === 'segmentStart' && this.onSegmentStart) {
+    this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+  }
+  if (name === 'destroy' && this.onDestroy) {
+    this.onDestroy.call(this, new BMDestroyEvent(name, this));
+  }
 };
 
-AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
+AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
+  var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-    var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
 
-    if (this.onError) {
-        this.onError.call(this, error);
+AnimationItem.prototype.triggerConfigError = function (nativeError) {
+  var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
+
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
+
+/* global CompExpressionInterface, expressionsPlugin: writable */
+/* exported expressionsPlugin */
+
+var Expressions = (function () {
+  var ob = {};
+  ob.initExpressions = initExpressions;
+
+  function initExpressions(animation) {
+    var stackCount = 0;
+    var registers = [];
+
+    function pushExpression() {
+      stackCount += 1;
     }
-}
 
-AnimationItem.prototype.triggerConfigError = function(nativeError) {
-
-    var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
+    function popExpression() {
+      stackCount -= 1;
+      if (stackCount === 0) {
+        releaseInstances();
+      }
     }
-}
-var Expressions = (function(){
-    var ob = {};
-    ob.initExpressions = initExpressions;
 
-
-    function initExpressions(animation){
-
-    	var stackCount = 0;
-    	var registers = [];
-
-    	function pushExpression() {
-			stackCount += 1;
-    	}
-
-    	function popExpression() {
-			stackCount -= 1;
-			if (stackCount === 0) {
-				releaseInstances();
-			}
-    	}
-
-    	function registerExpressionProperty(expression) {
-    		if (registers.indexOf(expression) === -1) {
-				registers.push(expression)
-    		}
-    	}
-
-    	function releaseInstances() {
-    		var i, len = registers.length;
-    		for (i = 0; i < len; i += 1) {
-				registers[i].release();
-    		}
-    		registers.length = 0;
-    	}
-
-        animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
-        animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
-        animation.renderer.globalData.pushExpression = pushExpression;
-        animation.renderer.globalData.popExpression = popExpression;
-        animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+    function registerExpressionProperty(expression) {
+      if (registers.indexOf(expression) === -1) {
+        registers.push(expression);
+      }
     }
-   return ob;
+
+    function releaseInstances() {
+      var i;
+      var len = registers.length;
+      for (i = 0; i < len; i += 1) {
+        registers[i].release();
+      }
+      registers.length = 0;
+    }
+
+    animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
+    animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
+    animation.renderer.globalData.pushExpression = pushExpression;
+    animation.renderer.globalData.popExpression = popExpression;
+    animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+  }
+  return ob;
 }());
 
 expressionsPlugin = Expressions;
 
-var ExpressionManager = (function(){
-    'use strict';
-    var ob = {};
-    var Math = BMMath;
-    var window = null;
-    var document = null;
+/* eslint-disable camelcase, no-unused-vars */
+/* global BMMath, BezierFactory, createTypedArray, degToRads, shapePool */
 
-    function $bm_isInstanceOfArray(arr) {
-        return arr.constructor === Array || arr.constructor === Float32Array;
+var ExpressionManager = (function () {
+  'use strict';
+
+  var ob = {};
+  var Math = BMMath;
+  var window = null;
+  var document = null;
+
+  function $bm_isInstanceOfArray(arr) {
+    return arr.constructor === Array || arr.constructor === Float32Array;
+  }
+
+  function isNumerable(tOfV, v) {
+    return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+  }
+
+  function $bm_neg(a) {
+    var tOfA = typeof a;
+    if (tOfA === 'number' || tOfA === 'boolean' || a instanceof Number) {
+      return -a;
+    }
+    if ($bm_isInstanceOfArray(a)) {
+      var i;
+      var lenA = a.length;
+      var retArr = [];
+      for (i = 0; i < lenA; i += 1) {
+        retArr[i] = -a[i];
+      }
+      return retArr;
+    }
+    if (a.propType) {
+      return a.v;
+    }
+    return -a;
+  }
+
+  var easeInBez = BezierFactory.getBezierEasing(0.333, 0, 0.833, 0.833, 'easeIn').get;
+  var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, 0.667, 1, 'easeOut').get;
+  var easeInOutBez = BezierFactory.getBezierEasing(0.33, 0, 0.667, 1, 'easeInOut').get;
+
+  function sum(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (tOfA === 'string' || tOfB === 'string') {
+      return a + b;
+    }
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a + b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] += b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a + b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] + b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+  var add = sum;
+
+  function sub(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      if (tOfA === 'string') {
+        a = parseInt(a, 10);
+      }
+      if (tOfB === 'string') {
+        b = parseInt(b, 10);
+      }
+      return a - b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] -= b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a - b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] - b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+
+  function mul(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a * b;
     }
 
-    function isNumerable(tOfV, v) {
-        return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] * b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a * b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+
+  function div(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a / b;
+    }
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] / b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a / b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+  function mod(a, b) {
+    if (typeof a === 'string') {
+      a = parseInt(a, 10);
+    }
+    if (typeof b === 'string') {
+      b = parseInt(b, 10);
+    }
+    return a % b;
+  }
+  var $bm_sum = sum;
+  var $bm_sub = sub;
+  var $bm_mul = mul;
+  var $bm_div = div;
+  var $bm_mod = mod;
+
+  function clamp(num, min, max) {
+    if (min > max) {
+      var mm = max;
+      max = min;
+      min = mm;
+    }
+    return Math.min(Math.max(num, min), max);
+  }
+
+  function radiansToDegrees(val) {
+    return val / degToRads;
+  }
+  var radians_to_degrees = radiansToDegrees;
+
+  function degreesToRadians(val) {
+    return val * degToRads;
+  }
+  var degrees_to_radians = radiansToDegrees;
+
+  var helperLengthArray = [0, 0, 0, 0, 0, 0];
+
+  function length(arr1, arr2) {
+    if (typeof arr1 === 'number' || arr1 instanceof Number) {
+      arr2 = arr2 || 0;
+      return Math.abs(arr1 - arr2);
+    }
+    if (!arr2) {
+      arr2 = helperLengthArray;
+    }
+    var i;
+    var len = Math.min(arr1.length, arr2.length);
+    var addedLength = 0;
+    for (i = 0; i < len; i += 1) {
+      addedLength += Math.pow(arr2[i] - arr1[i], 2);
+    }
+    return Math.sqrt(addedLength);
+  }
+
+  function normalize(vec) {
+    return div(vec, length(vec));
+  }
+
+  function rgbToHsl(val) {
+    var r = val[0]; var g = val[1]; var b = val[2];
+    var max = Math.max(r, g, b);
+    var min = Math.min(r, g, b);
+    var h;
+    var s;
+    var l = (max + min) / 2;
+
+    if (max === min) {
+      h = 0; // achromatic
+      s = 0; // achromatic
+    } else {
+      var d = max - min;
+      s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+      switch (max) {
+        case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+        case g: h = (b - r) / d + 2; break;
+        case b: h = (r - g) / d + 4; break;
+        default: break;
+      }
+      h /= 6;
     }
 
-    function $bm_neg(a){
-        var tOfA = typeof a;
-        if(tOfA === 'number' || tOfA === 'boolean'  || a instanceof Number ){
-            return -a;
-        }
-        if($bm_isInstanceOfArray(a)){
-            var i, lenA = a.length;
-            var retArr = [];
-            for(i=0;i<lenA;i+=1){
-                retArr[i] = -a[i];
-            }
-            return retArr;
-        }
-        if (a.propType) {
-            return a.v;
-        }
+    return [h, s, l, val[3]];
+  }
+
+  function hue2rgb(p, q, t) {
+    if (t < 0) t += 1;
+    if (t > 1) t -= 1;
+    if (t < 1 / 6) return p + (q - p) * 6 * t;
+    if (t < 1 / 2) return q;
+    if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
+    return p;
+  }
+
+  function hslToRgb(val) {
+    var h = val[0];
+    var s = val[1];
+    var l = val[2];
+
+    var r;
+    var g;
+    var b;
+
+    if (s === 0) {
+      r = l; // achromatic
+      b = l; // achromatic
+      g = l; // achromatic
+    } else {
+      var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+      var p = 2 * l - q;
+      r = hue2rgb(p, q, h + 1 / 3);
+      g = hue2rgb(p, q, h);
+      b = hue2rgb(p, q, h - 1 / 3);
     }
 
-    var easeInBez = BezierFactory.getBezierEasing(0.333,0,.833,.833, 'easeIn').get;
-    var easeOutBez = BezierFactory.getBezierEasing(0.167,0.167,.667,1, 'easeOut').get;
-    var easeInOutBez = BezierFactory.getBezierEasing(.33,0,.667,1, 'easeInOut').get;
+    return [r, g, b, val[3]];
+  }
 
-    function sum(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(tOfA === 'string' || tOfB === 'string'){
-            return a + b;
-        }
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a + b;
-        }
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] + b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a + b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] + b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+  function linear(t, tMin, tMax, value1, value2) {
+    if (value1 === undefined || value2 === undefined) {
+      value1 = tMin;
+      value2 = tMax;
+      tMin = 0;
+      tMax = 1;
     }
-    var add = sum;
-
-    function sub(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            if(tOfA === 'string') {
-                a = parseInt(a);
-            }
-            if(tOfB === 'string') {
-                b = parseInt(b);
-            }
-            return a - b;
-        }
-        if( $bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] - b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) &&  $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a - b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] - b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+    if (tMax < tMin) {
+      var _tMin = tMax;
+      tMax = tMin;
+      tMin = _tMin;
     }
-
-    function mul(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a * b;
-        }
-
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] * b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a * b[i];
-            }
-            return arr;
-        }
-        return 0;
+    if (t <= tMin) {
+      return value1;
+    } if (t >= tMax) {
+      return value2;
     }
-
-    function div(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a / b;
-        }
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] / b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a / b[i];
-            }
-            return arr;
-        }
-        return 0;
+    var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin);
+    if (!value1.length) {
+      return value1 + (value2 - value1) * perc;
     }
-    function mod(a,b) {
-        if(typeof a === 'string') {
-            a = parseInt(a);
-        }
-        if(typeof b === 'string') {
-            b = parseInt(b);
-        }
-        return a % b;
+    var i;
+    var len = value1.length;
+    var arr = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      arr[i] = value1[i] + (value2[i] - value1[i]) * perc;
     }
-    var $bm_sum = sum;
-    var $bm_sub = sub;
-    var $bm_mul = mul;
-    var $bm_div = div;
-    var $bm_mod = mod;
-
-    function clamp(num, min, max) {
-        if(min > max){
-            var mm = max;
-            max = min;
-            min = mm;
-        }
-        return Math.min(Math.max(num, min), max);
+    return arr;
+  }
+  function random(min, max) {
+    if (max === undefined) {
+      if (min === undefined) {
+        min = 0;
+        max = 1;
+      } else {
+        max = min;
+        min = undefined;
+      }
     }
-
-    function radiansToDegrees(val) {
-        return val/degToRads;
+    if (max.length) {
+      var i;
+      var len = max.length;
+      if (!min) {
+        min = createTypedArray('float32', len);
+      }
+      var arr = createTypedArray('float32', len);
+      var rnd = BMMath.random();
+      for (i = 0; i < len; i += 1) {
+        arr[i] = min[i] + rnd * (max[i] - min[i]);
+      }
+      return arr;
     }
-    var radians_to_degrees = radiansToDegrees;
-
-    function degreesToRadians(val) {
-        return val*degToRads;
+    if (min === undefined) {
+      min = 0;
     }
-    var degrees_to_radians = radiansToDegrees;
+    var rndm = BMMath.random();
+    return min + rndm * (max - min);
+  }
 
-    var helperLengthArray = [0,0,0,0,0,0];
-
-    function length(arr1, arr2) {
-        if (typeof arr1 === 'number' || arr1 instanceof Number) {
-            arr2 = arr2 || 0;
-            return Math.abs(arr1 - arr2);
-        }
-        if(!arr2) {
-            arr2 = helperLengthArray;
-        }
-        var i, len = Math.min(arr1.length, arr2.length);
-        var addedLength = 0;
-        for (i = 0; i < len; i += 1) {
-            addedLength += Math.pow(arr2[i] - arr1[i], 2);
-        }
-        return Math.sqrt(addedLength);
+  function createPath(points, inTangents, outTangents, closed) {
+    var i;
+    var len = points.length;
+    var path = shapePool.newElement();
+    path.setPathData(!!closed, len);
+    var arrPlaceholder = [0, 0];
+    var inVertexPoint;
+    var outVertexPoint;
+    for (i = 0; i < len; i += 1) {
+      inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
+      outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
+      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);
     }
+    return path;
+  }
 
-    function normalize(vec) {
-        return div(vec, length(vec));
-    }
+  function initiateExpression(elem, data, property) {
+    var val = data.x;
+    var needsVelocity = /velocity(?![\w\d])/.test(val);
+    var _needsRandom = val.indexOf('random') !== -1;
+    var elemType = elem.data.ty;
+    var transform;
+    var $bm_transform;
+    var content;
+    var effect;
+    var thisProperty = property;
+    thisProperty.valueAtTime = thisProperty.getValueAtTime;
+    Object.defineProperty(thisProperty, 'value', {
+      get: function () {
+        return thisProperty.v;
+      },
+    });
+    elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate;
+    elem.comp.displayStartTime = 0;
+    var inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    var outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    var width = elem.data.sw ? elem.data.sw : 0;
+    var height = elem.data.sh ? elem.data.sh : 0;
+    var name = elem.data.nm;
+    var loopIn;
+    var loop_in;
+    var loopOut;
+    var loop_out;
+    var smooth;
+    var toWorld;
+    var fromWorld;
+    var fromComp;
+    var toComp;
+    var fromCompToSurface;
+    var position;
+    var rotation;
+    var anchorPoint;
+    var scale;
+    var thisLayer;
+    var thisComp;
+    var mask;
+    var valueAtTime;
+    var velocityAtTime;
 
-    function rgbToHsl(val) {
-        var r = val[0]; var g = val[1]; var b = val[2];
-        var max = Math.max(r, g, b), min = Math.min(r, g, b);
-        var h, s, l = (max + min) / 2;
+    var scoped_bm_rt;
+    var expression_function = eval('[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]')[0]; // eslint-disable-line no-eval
+    var numKeys = property.kf ? data.k.length : 0;
 
-        if(max == min){
-            h = s = 0; // achromatic
-        }else{
-            var d = max - min;
-            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
-            switch(max){
-                case r: h = (g - b) / d + (g < b ? 6 : 0); break;
-                case g: h = (b - r) / d + 2; break;
-                case b: h = (r - g) / d + 4; break;
-            }
-            h /= 6;
+    var active = !this.data || this.data.hd !== true;
+
+    var wiggle = function wiggle(freq, amp) {
+      var iWiggle;
+      var j;
+      var lenWiggle = this.pv.length ? this.pv.length : 1;
+      var addedAmps = createTypedArray('float32', lenWiggle);
+      freq = 5;
+      var iterations = Math.floor(time * freq);
+      iWiggle = 0;
+      j = 0;
+      while (iWiggle < iterations) {
+        // var rnd = BMMath.random();
+        for (j = 0; j < lenWiggle; j += 1) {
+          addedAmps[j] += -amp + amp * 2 * BMMath.random();
+          // addedAmps[j] += -amp + amp*2*rnd;
         }
-
-        return [h, s, l,val[3]];
-    }
-
-    function hue2rgb(p, q, t){
-        if(t < 0) t += 1;
-        if(t > 1) t -= 1;
-        if(t < 1/6) return p + (q - p) * 6 * t;
-        if(t < 1/2) return q;
-        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
-        return p;
-    }
-
-    function hslToRgb(val){
-        var h = val[0];
-        var s = val[1];
-        var l = val[2];
-
-        var r, g, b;
-
-        if(s === 0){
-            r = g = b = l; // achromatic
-        }else{
-
-            var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-            var p = 2 * l - q;
-            r = hue2rgb(p, q, h + 1/3);
-            g = hue2rgb(p, q, h);
-            b = hue2rgb(p, q, h - 1/3);
-        }
-
-        return [r, g , b, val[3]];
-    }
-
-    function linear(t, tMin, tMax, value1, value2){
-        if(value1 === undefined || value2 === undefined){
-            value1 = tMin;
-            value2 = tMax;
-            tMin = 0;
-            tMax = 1;
-        }
-        if(tMax < tMin) {
-            var _tMin = tMax;
-            tMax = tMin;
-            tMin = _tMin;
-        }
-        if(t <= tMin) {
-            return value1;
-        }else if(t >= tMax){
-            return value2;
-        }
-        var perc = tMax === tMin ? 0 : (t-tMin)/(tMax-tMin);
-        if(!value1.length){
-            return value1 + (value2-value1)*perc;
-        }
-        var i, len = value1.length;
-        var arr = createTypedArray('float32', len);
-        for(i=0;i<len;i+=1){
-            arr[i] = value1[i] + (value2[i]-value1[i])*perc;
+        iWiggle += 1;
+      }
+      // var rnd2 = BMMath.random();
+      var periods = time * freq;
+      var perc = periods - Math.floor(periods);
+      var arr = createTypedArray('float32', lenWiggle);
+      if (lenWiggle > 1) {
+        for (j = 0; j < lenWiggle; j += 1) {
+          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;
+          // arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
         }
         return arr;
-    }
-    function random(min,max){
-        if(max === undefined){
-            if(min === undefined){
-                min = 0;
-                max = 1;
-            } else {
-                max = min;
-                min = undefined;
-            }
-        }
-        if(max.length){
-            var i, len = max.length;
-            if(!min){
-                min = createTypedArray('float32', len);
-            }
-            var arr = createTypedArray('float32', len);
-            var rnd = BMMath.random();
-            for(i=0;i<len;i+=1){
-                arr[i] = min[i] + rnd*(max[i]-min[i]);
-            }
-            return arr;
-        }
-        if(min === undefined){
-            min = 0;
-        }
-        var rndm = BMMath.random();
-        return min + rndm*(max-min);
+      }
+      return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc;
+    }.bind(this);
+
+    if (thisProperty.loopIn) {
+      loopIn = thisProperty.loopIn.bind(thisProperty);
+      loop_in = loopIn;
     }
 
-    function createPath(points, inTangents, outTangents, closed) {
-        var i, len = points.length;
-        var path = shape_pool.newElement();
-        path.setPathData(!!closed, len);
-        var arrPlaceholder = [0,0], inVertexPoint, outVertexPoint;
-        for(i = 0; i < len; i += 1) {
-            inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
-            outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
-            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);
-        }
-        return path;
+    if (thisProperty.loopOut) {
+      loopOut = thisProperty.loopOut.bind(thisProperty);
+      loop_out = loopOut;
     }
 
-    function initiateExpression(elem,data,property){
-        var val = data.x;
-        var needsVelocity = /velocity(?![\w\d])/.test(val);
-        var _needsRandom = val.indexOf('random') !== -1;
-        var elemType = elem.data.ty;
-        var transform,$bm_transform,content,effect;
-        var thisProperty = property;
-        thisProperty.valueAtTime = thisProperty.getValueAtTime;
-        Object.defineProperty(thisProperty, 'value', {
-            get: function() {
-                return thisProperty.v
-            }
-        })
-        elem.comp.frameDuration = 1/elem.comp.globalData.frameRate;
-        elem.comp.displayStartTime = 0;
-        var inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        var outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        var width = elem.data.sw ? elem.data.sw : 0;
-        var height = elem.data.sh ? elem.data.sh : 0;
-        var name = elem.data.nm;
-        var loopIn, loop_in, loopOut, loop_out, smooth;
-        var toWorld,fromWorld,fromComp,toComp,fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp,mask,valueAtTime,velocityAtTime;
-        var __expression_functions = [];
-        if(data.xf) {
-            var i, len = data.xf.length;
-            for(i = 0; i < len; i += 1) {
-                __expression_functions[i] = eval('(function(){ return ' + data.xf[i] + '}())');
-            }
-        }
-
-        var scoped_bm_rt;
-        var expression_function = eval('[function _expression_function(){' + val+';scoped_bm_rt=$bm_rt}' + ']')[0];
-        var numKeys = property.kf ? data.k.length : 0;
-
-        var active = !this.data || this.data.hd !== true;
-
-        var wiggle = function wiggle(freq,amp){
-            var i,j, len = this.pv.length ? this.pv.length : 1;
-            var addedAmps = createTypedArray('float32', len);
-            freq = 5;
-            var iterations = Math.floor(time*freq);
-            i = 0;
-            j = 0;
-            while(i<iterations){
-                //var rnd = BMMath.random();
-                for(j=0;j<len;j+=1){
-                    addedAmps[j] += -amp + amp*2*BMMath.random();
-                    //addedAmps[j] += -amp + amp*2*rnd;
-                }
-                i += 1;
-            }
-            //var rnd2 = BMMath.random();
-            var periods = time*freq;
-            var perc = periods - Math.floor(periods);
-            var arr = createTypedArray('float32', len);
-            if(len>1){
-                for(j=0;j<len;j+=1){
-                    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;
-                    //arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
-                }
-                return arr;
-            } else {
-                return this.pv + addedAmps[0] + (-amp + amp*2*BMMath.random())*perc;
-            }
-        }.bind(this);
-
-        if(thisProperty.loopIn) {
-            loopIn = thisProperty.loopIn.bind(thisProperty);
-            loop_in = loopIn;
-        }
-
-        if(thisProperty.loopOut) {
-            loopOut = thisProperty.loopOut.bind(thisProperty);
-            loop_out = loopOut;
-        }
-
-        if(thisProperty.smooth) {
-            smooth = thisProperty.smooth.bind(thisProperty);
-        }
-
-        function loopInDuration(type,duration){
-            return loopIn(type,duration,true);
-        }
-
-        function loopOutDuration(type,duration){
-            return loopOut(type,duration,true);
-        }
-
-        if(this.getValueAtTime) {
-            valueAtTime = this.getValueAtTime.bind(this);
-        }
-
-        if(this.getVelocityAtTime) {
-            velocityAtTime = this.getVelocityAtTime.bind(this);
-        }
-
-        var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
-
-        function lookAt(elem1,elem2){
-            var fVec = [elem2[0]-elem1[0],elem2[1]-elem1[1],elem2[2]-elem1[2]];
-            var pitch = Math.atan2(fVec[0],Math.sqrt(fVec[1]*fVec[1]+fVec[2]*fVec[2]))/degToRads;
-            var yaw = -Math.atan2(fVec[1],fVec[2])/degToRads;
-            return [yaw,pitch,0];
-        }
-
-        function easeOut(t, tMin, tMax, val1, val2){
-            return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function easeIn(t, tMin, tMax, val1, val2){
-            return applyEase(easeInBez, t, tMin, tMax, val1, val2);
-        }
-
-        function ease(t, tMin, tMax, val1, val2){
-            return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function applyEase(fn, t, tMin, tMax, val1, val2) {
-            if(val1 === undefined){
-                val1 = tMin;
-                val2 = tMax;
-            } else {
-                t = (t - tMin) / (tMax - tMin);
-            }
-            t = t > 1 ? 1 : t < 0 ? 0 : t;
-            var mult = fn(t);
-            if($bm_isInstanceOfArray(val1)) {
-                var i, len = val1.length;
-                var arr = createTypedArray('float32', len);
-                for (i = 0; i < len; i += 1) {
-                    arr[i] = (val2[i] - val1[i]) * mult + val1[i];
-                }
-                return arr;
-            } else {
-                return (val2 - val1) * mult + val1;
-            }
-        }
-
-        function nearestKey(time){
-            var i, len = data.k.length,index,keyTime;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                index = 0;
-                keyTime = 0;
-            } else {
-                index = -1;
-                time *= elem.comp.globalData.frameRate;
-                if (time < data.k[0].t) {
-                    index = 1;
-                    keyTime = data.k[0].t;
-                } else {
-                    for(i=0;i<len-1;i+=1){
-                        if(time === data.k[i].t){
-                            index = i + 1;
-                            keyTime = data.k[i].t;
-                            break;
-                        }else if(time>data.k[i].t && time<data.k[i+1].t){
-                            if(time-data.k[i].t > data.k[i+1].t - time){
-                                index = i + 2;
-                                keyTime = data.k[i+1].t;
-                            } else {
-                                index = i + 1;
-                                keyTime = data.k[i].t;
-                            }
-                            break;
-                        }
-                    }
-                    if(index === -1){
-                        index = i + 1;
-                        keyTime = data.k[i].t;
-                    }
-                }
-                
-            }
-            var ob = {};
-            ob.index = index;
-            ob.time = keyTime/elem.comp.globalData.frameRate;
-            return ob;
-        }
-
-        function key(ind){
-            var ob, i, len;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                throw new Error('The property has no keyframe at index ' + ind);
-            }
-            ind -= 1;
-            ob = {
-                time: data.k[ind].t/elem.comp.globalData.frameRate,
-                value: []
-            };
-            var arr = data.k[ind].hasOwnProperty('s') ? data.k[ind].s : data.k[ind - 1].e;
-
-            len = arr.length;
-            for(i=0;i<len;i+=1){
-                ob[i] = arr[i];
-                ob.value[i] = arr[i]
-            }
-            return ob;
-        }
-
-        function framesToTime(frames, fps) { 
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return frames / fps;
-        }
-
-        function timeToFrames(t, fps) {
-            if (!t && t !== 0) {
-                t = time;
-            }
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return t * fps;
-        }
-
-        function seedRandom(seed){
-            BMMath.seedrandom(randSeed + seed);
-        }
-
-        function sourceRectAtTime() {
-            return elem.sourceRectAtTime();
-        }
-
-        function substring(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substring(init)
-                }
-                return value.substring(init, end)
-            }
-            return '';
-        }
-
-        function substr(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substr(init)
-                }
-                return value.substr(init, end)
-            }
-            return '';
-        }
-
-        function posterizeTime(framesPerSecond) {
-            time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond
-            value = valueAtTime(time)
-        }
-
-        var time, velocity, value, text, textIndex, textTotal, selectorValue;
-        var index = elem.data.ind;
-        var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-        var parent;
-        var randSeed = Math.floor(Math.random()*1000000);
-        var globalData = elem.globalData;
-        function executeExpression(_value) {
-            // globalData.pushExpression();
-            value = _value;
-            if (_needsRandom) {
-                seedRandom(randSeed);
-            }
-            if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
-                return value;
-            }
-            if(this.propType === 'textSelector'){
-                textIndex = this.textIndex;
-                textTotal = this.textTotal;
-                selectorValue = this.selectorValue;
-            }
-            if (!thisLayer) {
-                text = elem.layerInterface.text;
-                thisLayer = elem.layerInterface;
-                thisComp = elem.comp.compInterface;
-                toWorld = thisLayer.toWorld.bind(thisLayer);
-                fromWorld = thisLayer.fromWorld.bind(thisLayer);
-                fromComp = thisLayer.fromComp.bind(thisLayer);
-                toComp = thisLayer.toComp.bind(thisLayer);
-                mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
-                fromCompToSurface = fromComp;
-            }
-            if (!transform) {
-                transform = elem.layerInterface("ADBE Transform Group");
-                $bm_transform = transform;
-                if(transform) {
-                    anchorPoint = transform.anchorPoint;
-                    /*position = transform.position;
-                    rotation = transform.rotation;
-                    scale = transform.scale;*/
-                }
-            }
-            
-            if (elemType === 4 && !content) {
-                content = thisLayer("ADBE Root Vectors Group");
-            }
-            if (!effect) {
-                effect = thisLayer(4);
-            }
-            hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-            if (hasParent && !parent) {
-                parent = elem.hierarchy[0].layerInterface;
-            }
-            time = this.comp.renderedFrame/this.comp.globalData.frameRate;
-            if (needsVelocity) {
-                velocity = velocityAtTime(time);
-            }
-            expression_function();
-            this.frameExpressionId = elem.globalData.frameId;
-
-            //TODO: Check if it's possible to return on ShapeInterface the .v value
-            if (scoped_bm_rt.propType === "shape") {
-                scoped_bm_rt = scoped_bm_rt.v;
-            }
-            // globalData.popExpression();
-            return scoped_bm_rt;
-        }
-        return executeExpression;
+    if (thisProperty.smooth) {
+      smooth = thisProperty.smooth.bind(thisProperty);
     }
 
-    ob.initiateExpression = initiateExpression;
-    return ob;
-}());
-var expressionHelpers = (function(){
-
-    function searchExpressions(elem,data,prop){
-        if(data.x){
-            prop.k = true;
-            prop.x = true;
-            prop.initiateExpression = ExpressionManager.initiateExpression;
-            prop.effectsSequence.push(prop.initiateExpression(elem,data,prop).bind(prop));
-        }
+    function loopInDuration(type, duration) {
+      return loopIn(type, duration, true);
     }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
+    function loopOutDuration(type, duration) {
+      return loopOut(type, duration, true);
     }
 
-    function getSpeedAtTime(frameNum) {
-        var delta = -0.01;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var speed = 0;
-        if(v1.length){
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                speed += Math.pow(v2[i] - v1[i], 2);
-            }
-            speed = Math.sqrt(speed) * 100;
+    if (this.getValueAtTime) {
+      valueAtTime = this.getValueAtTime.bind(this);
+    }
+
+    if (this.getVelocityAtTime) {
+      velocityAtTime = this.getVelocityAtTime.bind(this);
+    }
+
+    var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
+
+    function lookAt(elem1, elem2) {
+      var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]];
+      var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads;
+      var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads;
+      return [yaw, pitch, 0];
+    }
+
+    function easeOut(t, tMin, tMax, val1, val2) {
+      return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function easeIn(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInBez, t, tMin, tMax, val1, val2);
+    }
+
+    function ease(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function applyEase(fn, t, tMin, tMax, val1, val2) {
+      if (val1 === undefined) {
+        val1 = tMin;
+        val2 = tMax;
+      } else {
+        t = (t - tMin) / (tMax - tMin);
+      }
+      if (t > 1) {
+        t = 1;
+      } else if (t < 0) {
+        t = 0;
+      }
+      var mult = fn(t);
+      if ($bm_isInstanceOfArray(val1)) {
+        var iKey;
+        var lenKey = val1.length;
+        var arr = createTypedArray('float32', lenKey);
+        for (iKey = 0; iKey < lenKey; iKey += 1) {
+          arr[iKey] = (val2[iKey] - val1[iKey]) * mult + val1[iKey];
+        }
+        return arr;
+      }
+      return (val2 - val1) * mult + val1;
+    }
+
+    function nearestKey(time) {
+      var iKey;
+      var lenKey = data.k.length;
+      var index;
+      var keyTime;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        index = 0;
+        keyTime = 0;
+      } else {
+        index = -1;
+        time *= elem.comp.globalData.frameRate;
+        if (time < data.k[0].t) {
+          index = 1;
+          keyTime = data.k[0].t;
         } else {
-            speed = 0;
+          for (iKey = 0; iKey < lenKey - 1; iKey += 1) {
+            if (time === data.k[iKey].t) {
+              index = iKey + 1;
+              keyTime = data.k[iKey].t;
+              break;
+            } else if (time > data.k[iKey].t && time < data.k[iKey + 1].t) {
+              if (time - data.k[iKey].t > data.k[iKey + 1].t - time) {
+                index = iKey + 2;
+                keyTime = data.k[iKey + 1].t;
+              } else {
+                index = iKey + 1;
+                keyTime = data.k[iKey].t;
+              }
+              break;
+            }
+          }
+          if (index === -1) {
+            index = iKey + 1;
+            keyTime = data.k[iKey].t;
+          }
         }
-        return speed;
+      }
+      var obKey = {};
+      obKey.index = index;
+      obKey.time = keyTime / elem.comp.globalData.frameRate;
+      return obKey;
     }
 
-    function getVelocityAtTime(frameNum) {
-        if(this.vel !== undefined){
-            return this.vel;
-        }
-        var delta = -0.001;
-        //frameNum += this.elem.data.st;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var velocity;
-        if(v1.length){
-            velocity = createTypedArray('float32', v1.length);
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                //removing frameRate
-                //if needed, don't add it here
-                //velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
-                velocity[i] = (v2[i] - v1[i])/delta;
-            }
-        } else {
-            velocity = (v2 - v1)/delta;
-        }
-        return velocity;
+    function key(ind) {
+      var obKey;
+      var iKey;
+      var lenKey;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        throw new Error('The property has no keyframe at index ' + ind);
+      }
+      ind -= 1;
+      obKey = {
+        time: data.k[ind].t / elem.comp.globalData.frameRate,
+        value: [],
+      };
+      var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;
+
+      lenKey = arr.length;
+      for (iKey = 0; iKey < lenKey; iKey += 1) {
+        obKey[iKey] = arr[iKey];
+        obKey.value[iKey] = arr[iKey];
+      }
+      return obKey;
     }
 
-    function getStaticValueAtTime() {
-        return this.pv;
+    function framesToTime(frames, fps) {
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return frames / fps;
     }
 
-    function setGroupProperty(propertyGroup){
-        this.propertyGroup = propertyGroup;
+    function timeToFrames(t, fps) {
+      if (!t && t !== 0) {
+        t = time;
+      }
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return t * fps;
     }
 
-	return {
-		searchExpressions: searchExpressions,
-		getSpeedAtTime: getSpeedAtTime,
-		getVelocityAtTime: getVelocityAtTime,
-		getValueAtTime: getValueAtTime,
-		getStaticValueAtTime: getStaticValueAtTime,
-		setGroupProperty: setGroupProperty,
-	}
-}());
-(function addPropertyDecorator() {
-
-    function loopOut(type,duration,durationFlag){
-        if(!this.k || !this.keyframes){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var lastKeyFrame = keyframes[keyframes.length - 1].t;
-        if(currentFrame<=lastKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, firstKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,lastKeyFrame - this.elem.data.ip);
-                } else {
-                    cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate*duration);
-                }
-                firstKeyFrame = lastKeyFrame - cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(iterations % 2 !== 0){
-                    return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = (endV[i]-initV[i])*repeats + current[i];
-                    }
-                    return ret;
-                }
-                return (endV-initV)*repeats + current;
-            } else if(type === 'continue'){
-                var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(lastValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = lastValue[i] + (lastValue[i]-nextLastValue[i])*((currentFrame - lastKeyFrame)/ this.comp.globalData.frameRate)/0.0005;
-                    }
-                    return ret;
-                }
-                return lastValue + (lastValue-nextLastValue)*(((currentFrame - lastKeyFrame))/0.001);
-            }
-            return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function seedRandom(seed) {
+      BMMath.seedrandom(randSeed + seed);
     }
 
-    function loopIn(type,duration, durationFlag) {
-        if(!this.k){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var firstKeyFrame = keyframes[0].t;
-        if(currentFrame>=firstKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, lastKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                lastKeyFrame = keyframes[duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,this.elem.data.op - firstKeyFrame);
-                } else {
-                    cycleDuration = Math.abs(elem.comp.globalData.frameRate*duration);
-                }
-                lastKeyFrame = firstKeyFrame + cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((firstKeyFrame - currentFrame)/cycleDuration);
-                if(iterations % 2 === 0){
-                    return this.getValueAtTime((((firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((firstKeyFrame - currentFrame)/cycleDuration)+1;
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = current[i]-(endV[i]-initV[i])*repeats;
-                    }
-                    return ret;
-                }
-                return current-(endV-initV)*repeats;
-            } else if(type === 'continue'){
-                var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(firstValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = firstValue[i] + (firstValue[i]-nextFirstValue[i])*(firstKeyFrame - currentFrame)/0.001;
-                    }
-                    return ret;
-                }
-                return firstValue + (firstValue-nextFirstValue)*(firstKeyFrame - currentFrame)/0.001;
-            }
-            return this.getValueAtTime(((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function sourceRectAtTime() {
+      return elem.sourceRectAtTime();
     }
 
-    function smooth(width, samples) {
-        if (!this.k){
-            return this.pv;
+    function substring(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substring(init);
         }
-        width = (width || 0.4) * 0.5;
-        samples = Math.floor(samples || 5);
-        if (samples <= 1) {
-            return this.pv;
+        return value.substring(init, end);
+      }
+      return '';
+    }
+
+    function substr(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substr(init);
         }
-        var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
-        var initFrame = currentTime - width;
-        var endFrame = currentTime + width;
-        var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
-        var i = 0, j = 0;
-        var value;
-        if (this.pv.length) {
-            value = createTypedArray('float32', this.pv.length);
-        } else {
-            value = 0;
-        }
-        var sampleValue;
-        while (i < samples) {
-            sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
-            if(this.pv.length) {
-                for (j = 0; j < this.pv.length; j += 1) {
-                    value[j] += sampleValue[j];
-                }
-            } else {
-                value += sampleValue;
-            }
-            i += 1;
-        }
-        if(this.pv.length) {
-            for (j = 0; j < this.pv.length; j += 1) {
-                value[j] /= samples;
-            }
-        } else {
-            value /= samples;
-        }
+        return value.substr(init, end);
+      }
+      return '';
+    }
+
+    function posterizeTime(framesPerSecond) {
+      time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond;
+      value = valueAtTime(time);
+    }
+
+    var time;
+    var velocity;
+    var value;
+    var text;
+    var textIndex;
+    var textTotal;
+    var selectorValue;
+    var index = elem.data.ind;
+    var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+    var parent;
+    var randSeed = Math.floor(Math.random() * 1000000);
+    var globalData = elem.globalData;
+    function executeExpression(_value) {
+      // globalData.pushExpression();
+      value = _value;
+      if (_needsRandom) {
+        seedRandom(randSeed);
+      }
+      if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
         return value;
+      }
+      if (this.propType === 'textSelector') {
+        textIndex = this.textIndex;
+        textTotal = this.textTotal;
+        selectorValue = this.selectorValue;
+      }
+      if (!thisLayer) {
+        text = elem.layerInterface.text;
+        thisLayer = elem.layerInterface;
+        thisComp = elem.comp.compInterface;
+        toWorld = thisLayer.toWorld.bind(thisLayer);
+        fromWorld = thisLayer.fromWorld.bind(thisLayer);
+        fromComp = thisLayer.fromComp.bind(thisLayer);
+        toComp = thisLayer.toComp.bind(thisLayer);
+        mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
+        fromCompToSurface = fromComp;
+      }
+      if (!transform) {
+        transform = elem.layerInterface('ADBE Transform Group');
+        $bm_transform = transform;
+        if (transform) {
+          anchorPoint = transform.anchorPoint;
+          /* position = transform.position;
+                    rotation = transform.rotation;
+                    scale = transform.scale; */
+        }
+      }
+
+      if (elemType === 4 && !content) {
+        content = thisLayer('ADBE Root Vectors Group');
+      }
+      if (!effect) {
+        effect = thisLayer(4);
+      }
+      hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+      if (hasParent && !parent) {
+        parent = elem.hierarchy[0].layerInterface;
+      }
+      time = this.comp.renderedFrame / this.comp.globalData.frameRate;
+      if (needsVelocity) {
+        velocity = velocityAtTime(time);
+      }
+      expression_function();
+      this.frameExpressionId = elem.globalData.frameId;
+
+      // TODO: Check if it's possible to return on ShapeInterface the .v value
+      if (scoped_bm_rt.propType === 'shape') {
+        scoped_bm_rt = scoped_bm_rt.v;
+      }
+      // globalData.popExpression();
+      return scoped_bm_rt;
     }
+    return executeExpression;
+  }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
-    }
-
-    function getTransformValueAtTime(time) {
-        if (!this._transformCachingAtTime) {
-            this._transformCachingAtTime = {
-                v: new Matrix(),
-            };
-        }
-        ////
-        var matrix = this._transformCachingAtTime.v;
-        matrix.cloneFromProps(this.pre.props);
-        if (this.appliedTransformations < 1) {
-            var anchor = this.a.getValueAtTime(time);
-            matrix.translate(
-                -anchor[0] * this.a.mult,
-                -anchor[1] * this.a.mult,
-                anchor[2] * this.a.mult
-            );
-        }
-        if (this.appliedTransformations < 2) {
-            var scale = this.s.getValueAtTime(time);
-            matrix.scale(
-                scale[0] * this.s.mult,
-                scale[1] * this.s.mult,
-                scale[2] * this.s.mult
-            );
-        }
-        if (this.sk && this.appliedTransformations < 3) {
-            var skew = this.sk.getValueAtTime(time);
-            var skewAxis = this.sa.getValueAtTime(time);
-            matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
-        }
-        if (this.r && this.appliedTransformations < 4) {
-            var rotation = this.r.getValueAtTime(time);
-            matrix.rotate(-rotation * this.r.mult);
-        } else if (!this.r && this.appliedTransformations < 4){
-            var rotationZ = this.rz.getValueAtTime(time);
-            var rotationY = this.ry.getValueAtTime(time);
-            var rotationX = this.rx.getValueAtTime(time);
-            var orientation = this.or.getValueAtTime(time);
-            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);
-        }
-        if (this.data.p && this.data.p.s) {
-            var positionX = this.px.getValueAtTime(time);
-            var positionY = this.py.getValueAtTime(time);
-            if (this.data.p.z) {
-                var positionZ = this.pz.getValueAtTime(time);
-                matrix.translate(
-                    positionX * this.px.mult,
-                    positionY * this.py.mult,
-                    -positionZ * this.pz.mult
-                );
-            } else {
-                matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
-            }
-        } else {
-            var position = this.p.getValueAtTime(time);
-            matrix.translate(
-                position[0] * this.p.mult,
-                position[1] * this.p.mult,
-                -position[2] * this.p.mult
-            );
-        }
-        return matrix;
-        ////
-    }
-
-    function getTransformStaticValueAtTime(time) {
-        return this.v.clone(new Matrix());
-    }
-
-    var getTransformProperty = TransformPropertyFactory.getTransformProperty;
-    TransformPropertyFactory.getTransformProperty = function(elem, data, container) {
-        var prop = getTransformProperty(elem, data, container);
-        if(prop.dynamicProperties.length) {
-            prop.getValueAtTime = getTransformValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        return prop;
-    };
-
-    var propertyGetProp = PropertyFactory.getProp;
-    PropertyFactory.getProp = function(elem,data,type, mult, container){
-        var prop = propertyGetProp(elem,data,type, mult, container);
-        //prop.getVelocityAtTime = getVelocityAtTime;
-        //prop.loopOut = loopOut;
-        //prop.loopIn = loopIn;
-        if(prop.kf){
-            prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        prop.loopOut = loopOut;
-        prop.loopIn = loopIn;
-        prop.smooth = smooth;
-        prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
-        prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
-        prop.numKeys = data.a === 1 ? data.k.length : 0;
-        prop.propertyIndex = data.ix;
-        var value = 0;
-        if(type !== 0) {
-            value = createTypedArray('float32', data.a === 1 ?  data.k[0].s.length : data.k.length);
-        }
-        prop._cachingAtTime = {
-            lastFrame: initialDefaultFrame,
-            lastIndex: 0,
-            value: value
-        };
-        expressionHelpers.searchExpressions(elem,data,prop);
-        if(prop.k){
-            container.addDynamicProperty(prop);
-        }
-
-        return prop;
-    };
-
-    function getShapeValueAtTime(frameNum) {
-        //For now this caching object is created only when needed instead of creating it when the shape is initialized.
-        if (!this._cachingAtTime) {
-            this._cachingAtTime = {
-                shapeValue: shape_pool.clone(this.pv),
-                lastIndex: 0,
-                lastTime: initialDefaultFrame
-            };
-        }
-        
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastTime) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
-            this._cachingAtTime.lastTime = frameNum;
-            this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
-        }
-        return this._cachingAtTime.shapeValue;
-    }
-
-    var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
-    var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
-
-    function ShapeExpressions(){}
-    ShapeExpressions.prototype = {
-        vertices: function(prop, time){
-            if (this.k) {
-                this.getValue();
-            }
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            var i, len = shapePath._length;
-            var vertices = shapePath[prop];
-            var points = shapePath.v;
-            var arr = createSizedArray(len);
-            for(i = 0; i < len; i += 1) {
-                if(prop === 'i' || prop === 'o') {
-                    arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
-                } else {
-                    arr[i] = [vertices[i][0], vertices[i][1]];
-                }
-                
-            }
-            return arr;
-        },
-        points: function(time){
-            return this.vertices('v', time);
-        },
-        inTangents: function(time){
-            return this.vertices('i', time);
-        },
-        outTangents: function(time){
-            return this.vertices('o', time);
-        },
-        isClosed: function(){
-            return this.v.c;
-        },
-        pointOnPath: function(perc, time){
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            if(!this._segmentsLength) {
-                this._segmentsLength = bez.getSegmentsLength(shapePath);
-            }
-
-            var segmentsLength = this._segmentsLength;
-            var lengths = segmentsLength.lengths;
-            var lengthPos = segmentsLength.totalLength * perc;
-            var i = 0, len = lengths.length;
-            var j = 0, jLen;
-            var accumulatedLength = 0, pt;
-            while(i < len) {
-                if(accumulatedLength + lengths[i].addedLength > lengthPos) {
-                    var initIndex = i;
-                    var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
-                    var segmentPerc = (lengthPos - accumulatedLength)/lengths[i].addedLength;
-                    pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
-                    break;
-                } else {
-                    accumulatedLength += lengths[i].addedLength;
-                }
-                i += 1;
-            }
-            if(!pt){
-                pt = shapePath.c ? [shapePath.v[0][0],shapePath.v[0][1]]:[shapePath.v[shapePath._length-1][0],shapePath.v[shapePath._length-1][1]];
-            }
-            return pt;
-        },
-        vectorOnPath: function(perc, time, vectorType){
-            //perc doesn't use triple equality because it can be a Number object as well as a primitive.
-            perc = perc == 1 ? this.v.c ? 0 : 0.999 : perc;
-            var pt1 = this.pointOnPath(perc, time);
-            var pt2 = this.pointOnPath(perc + 0.001, time);
-            var xLength = pt2[0] - pt1[0];
-            var yLength = pt2[1] - pt1[1];
-            var magnitude = Math.sqrt(Math.pow(xLength,2) + Math.pow(yLength,2));
-            if (magnitude === 0) {
-                return [0,0];
-            }
-            var unitVector = vectorType === 'tangent' ? [xLength/magnitude, yLength/magnitude] : [-yLength/magnitude, xLength/magnitude];
-            return unitVector;
-        },
-        tangentOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'tangent');
-        },
-        normalOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'normal');
-        },
-        setGroupProperty: expressionHelpers.setGroupProperty,
-        getValueAtTime: expressionHelpers.getStaticValueAtTime
-    };
-    extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
-    extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
-    KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
-    KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
-
-    var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
-    ShapePropertyFactory.getShapeProp = function(elem,data,type, arr, trims){
-        var prop = propertyGetShapeProp(elem,data,type, arr, trims);
-        prop.propertyIndex = data.ix;
-        prop.lock = false;
-        if(type === 3){
-            expressionHelpers.searchExpressions(elem,data.pt,prop);
-        } else if(type === 4){
-            expressionHelpers.searchExpressions(elem,data.ks,prop);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    };
+  ob.initiateExpression = initiateExpression;
+  return ob;
 }());
+
+/* global ExpressionManager, createTypedArray */
+/* exported expressionHelpers */
+
+var expressionHelpers = (function () {
+  function searchExpressions(elem, data, prop) {
+    if (data.x) {
+      prop.k = true;
+      prop.x = true;
+      prop.initiateExpression = ExpressionManager.initiateExpression;
+      prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop));
+    }
+  }
+
+  function getValueAtTime(frameNum) {
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastFrame) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
+      this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
+      this._cachingAtTime.lastFrame = frameNum;
+    }
+    return this._cachingAtTime.value;
+  }
+
+  function getSpeedAtTime(frameNum) {
+    var delta = -0.01;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var speed = 0;
+    if (v1.length) {
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        speed += Math.pow(v2[i] - v1[i], 2);
+      }
+      speed = Math.sqrt(speed) * 100;
+    } else {
+      speed = 0;
+    }
+    return speed;
+  }
+
+  function getVelocityAtTime(frameNum) {
+    if (this.vel !== undefined) {
+      return this.vel;
+    }
+    var delta = -0.001;
+    // frameNum += this.elem.data.st;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var velocity;
+    if (v1.length) {
+      velocity = createTypedArray('float32', v1.length);
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        // removing frameRate
+        // if needed, don't add it here
+        // velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
+        velocity[i] = (v2[i] - v1[i]) / delta;
+      }
+    } else {
+      velocity = (v2 - v1) / delta;
+    }
+    return velocity;
+  }
+
+  function getStaticValueAtTime() {
+    return this.pv;
+  }
+
+  function setGroupProperty(propertyGroup) {
+    this.propertyGroup = propertyGroup;
+  }
+
+  return {
+    searchExpressions: searchExpressions,
+    getSpeedAtTime: getSpeedAtTime,
+    getVelocityAtTime: getVelocityAtTime,
+    getValueAtTime: getValueAtTime,
+    getStaticValueAtTime: getStaticValueAtTime,
+    setGroupProperty: setGroupProperty,
+  };
+}());
+
+/* global createTypedArray, Matrix, TransformPropertyFactory, expressionHelpers, PropertyFactory, expressionHelpers,
+initialDefaultFrame, shapePool, ShapePropertyFactory, bez, extendPrototype, ExpressionManager, createSizedArray */
+
+(function addPropertyDecorator() {
+  function loopOut(type, duration, durationFlag) {
+    if (!this.k || !this.keyframes) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var lastKeyFrame = keyframes[keyframes.length - 1].t;
+    if (currentFrame <= lastKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var firstKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip);
+      } else {
+        cycleDuration = Math.abs(lastKeyFrame - this.elem.comp.globalData.frameRate * duration);
+      }
+      firstKeyFrame = lastKeyFrame - cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (iterations % 2 !== 0) {
+          return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+        var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = (endV[i] - initV[i]) * repeats + current[i];
+        }
+        return ret;
+      }
+      return (endV - initV) * repeats + current;
+    } else if (type === 'continue') {
+      var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(lastValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+            ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005; // eslint-disable-line
+        }
+        return ret;
+      }
+      return lastValue + (lastValue - nextLastValue) * (((currentFrame - lastKeyFrame)) / 0.001);
+    }
+      return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function loopIn(type, duration, durationFlag) {
+    if (!this.k) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var firstKeyFrame = keyframes[0].t;
+    if (currentFrame >= firstKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var lastKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      lastKeyFrame = keyframes[duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame);
+      } else {
+        cycleDuration = Math.abs(this.elem.comp.globalData.frameRate * duration);
+      }
+      lastKeyFrame = firstKeyFrame + cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration);
+      if (iterations % 2 === 0) {
+          return this.getValueAtTime((((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var current = this.getValueAtTime((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration) + firstKeyFrame) / this.comp.globalData.frameRate, 0);
+      var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1;
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = current[i] - (endV[i] - initV[i]) * repeats;
+        }
+        return ret;
+      }
+      return current - (endV - initV) * repeats;
+    } else if (type === 'continue') {
+      var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(firstValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = firstValue[i] + ((firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame)) / 0.001;
+        }
+        return ret;
+      }
+      return firstValue + ((firstValue - nextFirstValue) * (firstKeyFrame - currentFrame)) / 0.001;
+    }
+      return this.getValueAtTime(((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame))) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function smooth(width, samples) {
+    if (!this.k) {
+      return this.pv;
+    }
+    width = (width || 0.4) * 0.5;
+    samples = Math.floor(samples || 5);
+    if (samples <= 1) {
+      return this.pv;
+    }
+    var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
+    var initFrame = currentTime - width;
+    var endFrame = currentTime + width;
+    var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
+    var i = 0;
+    var j = 0;
+    var value;
+    if (this.pv.length) {
+      value = createTypedArray('float32', this.pv.length);
+    } else {
+      value = 0;
+    }
+    var sampleValue;
+    while (i < samples) {
+      sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
+      if (this.pv.length) {
+        for (j = 0; j < this.pv.length; j += 1) {
+          value[j] += sampleValue[j];
+        }
+      } else {
+        value += sampleValue;
+      }
+      i += 1;
+    }
+    if (this.pv.length) {
+      for (j = 0; j < this.pv.length; j += 1) {
+        value[j] /= samples;
+      }
+    } else {
+      value /= samples;
+    }
+    return value;
+  }
+
+  function getTransformValueAtTime(time) {
+    if (!this._transformCachingAtTime) {
+      this._transformCachingAtTime = {
+        v: new Matrix(),
+      };
+    }
+    /// /
+    var matrix = this._transformCachingAtTime.v;
+    matrix.cloneFromProps(this.pre.props);
+    if (this.appliedTransformations < 1) {
+      var anchor = this.a.getValueAtTime(time);
+      matrix.translate(
+        -anchor[0] * this.a.mult,
+        -anchor[1] * this.a.mult,
+        anchor[2] * this.a.mult
+      );
+    }
+    if (this.appliedTransformations < 2) {
+      var scale = this.s.getValueAtTime(time);
+      matrix.scale(
+        scale[0] * this.s.mult,
+        scale[1] * this.s.mult,
+        scale[2] * this.s.mult
+      );
+    }
+    if (this.sk && this.appliedTransformations < 3) {
+      var skew = this.sk.getValueAtTime(time);
+      var skewAxis = this.sa.getValueAtTime(time);
+      matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
+    }
+    if (this.r && this.appliedTransformations < 4) {
+      var rotation = this.r.getValueAtTime(time);
+      matrix.rotate(-rotation * this.r.mult);
+    } else if (!this.r && this.appliedTransformations < 4) {
+      var rotationZ = this.rz.getValueAtTime(time);
+      var rotationY = this.ry.getValueAtTime(time);
+      var rotationX = this.rx.getValueAtTime(time);
+      var orientation = this.or.getValueAtTime(time);
+      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);
+    }
+    if (this.data.p && this.data.p.s) {
+      var positionX = this.px.getValueAtTime(time);
+      var positionY = this.py.getValueAtTime(time);
+      if (this.data.p.z) {
+        var positionZ = this.pz.getValueAtTime(time);
+        matrix.translate(
+          positionX * this.px.mult,
+          positionY * this.py.mult,
+          -positionZ * this.pz.mult
+        );
+      } else {
+        matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
+      }
+    } else {
+      var position = this.p.getValueAtTime(time);
+      matrix.translate(
+        position[0] * this.p.mult,
+        position[1] * this.p.mult,
+        -position[2] * this.p.mult
+      );
+    }
+    return matrix;
+    /// /
+  }
+
+  function getTransformStaticValueAtTime() {
+    return this.v.clone(new Matrix());
+  }
+
+  var getTransformProperty = TransformPropertyFactory.getTransformProperty;
+  TransformPropertyFactory.getTransformProperty = function (elem, data, container) {
+    var prop = getTransformProperty(elem, data, container);
+    if (prop.dynamicProperties.length) {
+      prop.getValueAtTime = getTransformValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    return prop;
+  };
+
+  var propertyGetProp = PropertyFactory.getProp;
+  PropertyFactory.getProp = function (elem, data, type, mult, container) {
+    var prop = propertyGetProp(elem, data, type, mult, container);
+    // prop.getVelocityAtTime = getVelocityAtTime;
+    // prop.loopOut = loopOut;
+    // prop.loopIn = loopIn;
+    if (prop.kf) {
+      prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    prop.loopOut = loopOut;
+    prop.loopIn = loopIn;
+    prop.smooth = smooth;
+    prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
+    prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
+    prop.numKeys = data.a === 1 ? data.k.length : 0;
+    prop.propertyIndex = data.ix;
+    var value = 0;
+    if (type !== 0) {
+      value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);
+    }
+    prop._cachingAtTime = {
+      lastFrame: initialDefaultFrame,
+      lastIndex: 0,
+      value: value,
+    };
+    expressionHelpers.searchExpressions(elem, data, prop);
+    if (prop.k) {
+      container.addDynamicProperty(prop);
+    }
+
+    return prop;
+  };
+
+  function getShapeValueAtTime(frameNum) {
+    // For now this caching object is created only when needed instead of creating it when the shape is initialized.
+    if (!this._cachingAtTime) {
+      this._cachingAtTime = {
+        shapeValue: shapePool.clone(this.pv),
+        lastIndex: 0,
+        lastTime: initialDefaultFrame,
+      };
+    }
+
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastTime) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
+      this._cachingAtTime.lastTime = frameNum;
+      this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
+    }
+    return this._cachingAtTime.shapeValue;
+  }
+
+  var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
+  var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
+
+  function ShapeExpressions() {}
+  ShapeExpressions.prototype = {
+    vertices: function (prop, time) {
+      if (this.k) {
+        this.getValue();
+      }
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      var i;
+      var len = shapePath._length;
+      var vertices = shapePath[prop];
+      var points = shapePath.v;
+      var arr = createSizedArray(len);
+      for (i = 0; i < len; i += 1) {
+        if (prop === 'i' || prop === 'o') {
+          arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
+        } else {
+          arr[i] = [vertices[i][0], vertices[i][1]];
+        }
+      }
+      return arr;
+    },
+    points: function (time) {
+      return this.vertices('v', time);
+    },
+    inTangents: function (time) {
+      return this.vertices('i', time);
+    },
+    outTangents: function (time) {
+      return this.vertices('o', time);
+    },
+    isClosed: function () {
+      return this.v.c;
+    },
+    pointOnPath: function (perc, time) {
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      if (!this._segmentsLength) {
+        this._segmentsLength = bez.getSegmentsLength(shapePath);
+      }
+
+      var segmentsLength = this._segmentsLength;
+      var lengths = segmentsLength.lengths;
+      var lengthPos = segmentsLength.totalLength * perc;
+      var i = 0;
+      var len = lengths.length;
+      var accumulatedLength = 0;
+      var pt;
+      while (i < len) {
+        if (accumulatedLength + lengths[i].addedLength > lengthPos) {
+          var initIndex = i;
+          var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
+          var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength;
+          pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
+          break;
+        } else {
+          accumulatedLength += lengths[i].addedLength;
+        }
+        i += 1;
+      }
+      if (!pt) {
+        pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]];
+      }
+      return pt;
+    },
+    vectorOnPath: function (perc, time, vectorType) {
+      // perc doesn't use triple equality because it can be a Number object as well as a primitive.
+      if (perc == 1) { // eslint-disable-line eqeqeq
+        perc = this.v.c;
+      } else if (perc == 0) { // eslint-disable-line eqeqeq
+        perc = 0.999;
+      }
+      var pt1 = this.pointOnPath(perc, time);
+      var pt2 = this.pointOnPath(perc + 0.001, time);
+      var xLength = pt2[0] - pt1[0];
+      var yLength = pt2[1] - pt1[1];
+      var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2));
+      if (magnitude === 0) {
+        return [0, 0];
+      }
+      var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude];
+      return unitVector;
+    },
+    tangentOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'tangent');
+    },
+    normalOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'normal');
+    },
+    setGroupProperty: expressionHelpers.setGroupProperty,
+    getValueAtTime: expressionHelpers.getStaticValueAtTime,
+  };
+  extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
+  extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
+  KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
+  KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
+
+  var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
+  ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) {
+    var prop = propertyGetShapeProp(elem, data, type, arr, trims);
+    prop.propertyIndex = data.ix;
+    prop.lock = false;
+    if (type === 3) {
+      expressionHelpers.searchExpressions(elem, data.pt, prop);
+    } else if (type === 4) {
+      expressionHelpers.searchExpressions(elem, data.ks, prop);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  };
+}());
+
+/* global ExpressionManager, TextProperty */
+
 (function addDecorator() {
-
-    function searchExpressions(){
-        if(this.data.d.x){
-            this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this);
-            this.addEffect(this.getExpressionValue.bind(this));
-            return true;
-        }
+  function searchExpressions() {
+    if (this.data.d.x) {
+      this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this);
+      this.addEffect(this.getExpressionValue.bind(this));
+      return true;
     }
+    return null;
+  }
 
-    TextProperty.prototype.getExpressionValue = function(currentValue, text) {
-        var newValue = this.calculateExpression(text);
-        if(currentValue.t !== newValue) {
-            var newData = {};
-            this.copyData(newData, currentValue);
-            newData.t = newValue.toString();
-            newData.__complete = false;
-            return newData;
-        }
-        return currentValue;
+  TextProperty.prototype.getExpressionValue = function (currentValue, text) {
+    var newValue = this.calculateExpression(text);
+    if (currentValue.t !== newValue) {
+      var newData = {};
+      this.copyData(newData, currentValue);
+      newData.t = newValue.toString();
+      newData.__complete = false;
+      return newData;
     }
+    return currentValue;
+  };
 
-    TextProperty.prototype.searchProperty = function(){
+  TextProperty.prototype.searchProperty = function () {
+    var isKeyframed = this.searchKeyframes();
+    var hasExpressions = this.searchExpressions();
+    this.kf = isKeyframed || hasExpressions;
+    return this.kf;
+  };
 
-        var isKeyframed = this.searchKeyframes();
-        var hasExpressions = this.searchExpressions();
-        this.kf = isKeyframed || hasExpressions;
-        return this.kf;
-    };
-
-    TextProperty.prototype.searchExpressions = searchExpressions;
-    
+  TextProperty.prototype.searchExpressions = searchExpressions;
 }());
+
+/* global propertyGroupFactory, PropertyInterface */
+/* exported ShapePathInterface */
+
 var ShapePathInterface = (
 
-	function() {
+  function () {
+    return function pathInterfaceFactory(shape, view, propertyGroup) {
+      var prop = view.sh;
 
-		return function pathInterfaceFactory(shape,view,propertyGroup){
-		    var prop = view.sh;
-
-		    function interfaceFunction(val){
-		        if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2){
-		            return interfaceFunction.path;
-		        }
-		    }
-
-		    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-		    prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
-		    Object.defineProperties(interfaceFunction, {
-		        'path': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        'shape': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        '_name': { value: shape.nm },
-		        'ix': { value: shape.ix },
-		        'propertyIndex': { value: shape.ix },
-		        'mn': { value: shape.mn },
-		        'propertyGroup': {value: propertyGroup},
-		    });
-		    return interfaceFunction;
-		}
-	}()
-)
-var propertyGroupFactory = (function() {
-	return function(interfaceFunction, parentPropertyGroup) {
-		return function(val) {
-			val = val === undefined ? 1 : val
-			if(val <= 0){
-			    return interfaceFunction;
-			} else{
-			    return parentPropertyGroup(val-1);
-			}
-		}
-	}
-}())
-var PropertyInterface = (function() {
-	return function(propertyName, propertyGroup) {
-
-		var interfaceFunction = {
-			_name: propertyName
-		}
-
-		function _propertyGroup(val){
-		    val = val === undefined ? 1 : val
-		    if(val <= 0){
-		        return interfaceFunction;
-		    } else {
-		        return propertyGroup(--val);
-		    }
-		}
-
-		return _propertyGroup;
-	}
-}())
-var ShapeExpressionInterface = (function(){
-
-    function iterateElements(shapes,view, propertyGroup){
-        var arr = [];
-        var i, len = shapes ? shapes.length : 0;
-        for(i=0;i<len;i+=1){
-            if(shapes[i].ty == 'gr'){
-                arr.push(groupInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'fl'){
-                arr.push(fillInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'st'){
-                arr.push(strokeInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tm'){
-                arr.push(trimInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tr'){
-                //arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'el'){
-                arr.push(ellipseInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'sr'){
-                arr.push(starInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'sh'){
-                arr.push(ShapePathInterface(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rc'){
-                arr.push(rectInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rd'){
-                arr.push(roundedInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rp'){
-                arr.push(repeaterInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }
+      function interfaceFunction(val) {
+        if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {
+          return interfaceFunction.path;
         }
-        return arr;
-    }
+        return null;
+      }
 
-    function contentsInterfaceFactory(shape,view, propertyGroup){
-       var interfaces;
-       var interfaceFunction = function _interfaceFunction(value){
-           var i = 0, len = interfaces.length;
-            while(i<len){
-                if(interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value){
-                   return interfaces[i];
-                }
-                i+=1;
+      var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+      prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
+      Object.defineProperties(interfaceFunction, {
+        path: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-            if(typeof value === 'number'){
-               return interfaces[value-1];
+            return prop;
+          },
+        },
+        shape: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-       };
-
-       interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-       interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
-       interfaceFunction.numProperties = interfaces.length;
-       var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-       interfaceFunction.transform = transformInterface;
-       interfaceFunction.propertyIndex = shape.cix;
-       interfaceFunction._name = shape.nm;
-
-       return interfaceFunction;
-   }
-
-    function groupInterfaceFactory(shape,view, propertyGroup){
-        var interfaceFunction = function _interfaceFunction(value){
-            switch(value){
-                case 'ADBE Vectors Group':
-                case 'Contents':
-                case 2:
-                    return interfaceFunction.content;
-                //Not necessary for now. Keeping them here in case a new case appears
-                //case 'ADBE Vector Transform Group':
-                //case 3:
-                default:
-                    return interfaceFunction.transform;
-            }
-        };
-        interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var content = contentsInterfaceFactory(shape,view,interfaceFunction.propertyGroup);
-        var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-        interfaceFunction.content = content;
-        interfaceFunction.transform = transformInterface;
-        Object.defineProperty(interfaceFunction, '_name', {
-            get: function(){
-                return shape.nm;
-            }
-        });
-        //interfaceFunction.content = interfaceFunction;
-        interfaceFunction.numProperties = shape.np;
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.nm = shape.nm;
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function fillInterfaceFactory(shape,view,propertyGroup){
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
-        return interfaceFunction;
-    }
-
-    function strokeInterfaceFactory(shape,view,propertyGroup){
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
-        function addPropertyToDashOb(i) {
-            Object.defineProperty(dashOb, shape.d[i].nm, {
-                get: ExpressionPropertyInterface(view.d.dataProps[i].p)
-            });
-        }
-        var i, len = shape.d ? shape.d.length : 0;
-        var dashOb = {};
-        for (i = 0; i < len; i += 1) {
-            addPropertyToDashOb(i);
-            view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
-        }
-
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            } else if(val === 'Stroke Width' || val === 'stroke width'){
-                return interfaceFunction.strokeWidth;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            'strokeWidth': {
-                get: ExpressionPropertyInterface(view.w)
-            },
-            'dash': {
-                get: function() {
-                    return dashOb;
-                }
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
-        return interfaceFunction;
-    }
-
-    function trimInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(val){
-            if(val === shape.e.ix || val === 'End' || val === 'end'){
-                return interfaceFunction.end;
-            }
-            if(val === shape.s.ix){
-                return interfaceFunction.start;
-            }
-            if(val === shape.o.ix){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-
-        view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
-        view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.propertyGroup = propertyGroup;
-
-        Object.defineProperties(interfaceFunction, {
-            'start': {
-                get: ExpressionPropertyInterface(view.s)
-            },
-            'end': {
-                get: ExpressionPropertyInterface(view.e)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function transformInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.a.ix === value || value === 'Anchor Point'){
-                return interfaceFunction.anchorPoint;
-            }
-            if(shape.o.ix === value || value === 'Opacity'){
-                return interfaceFunction.opacity;
-            }
-            if(shape.p.ix === value || value === 'Position'){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation'){
-                return interfaceFunction.rotation;
-            }
-            if(shape.s.ix === value || value === 'Scale'){
-                return interfaceFunction.scale;
-            }
-            if(shape.sk && shape.sk.ix === value || value === 'Skew'){
-                return interfaceFunction.skew;
-            }
-            if(shape.sa && shape.sa.ix === value || value === 'Skew Axis'){
-                return interfaceFunction.skewAxis;
-            }
-        }
-        
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
-        view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
-        view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(view.transform.mProps.sk){
-            view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
-            view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
-        }
-        view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'opacity': {
-                get: ExpressionPropertyInterface(view.transform.mProps.o)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(view.transform.mProps.p)
-            },
-            'anchorPoint': {
-                get: ExpressionPropertyInterface(view.transform.mProps.a)
-            },
-            'scale': {
-                get: ExpressionPropertyInterface(view.transform.mProps.s)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(view.transform.mProps.r)
-            },
-            'skew': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sk)
-            },
-            'skewAxis': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sa)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.ty = 'tr';
-        interfaceFunction.mn = shape.mn;
-        interfaceFunction.propertyGroup = propertyGroup;
-        return interfaceFunction;
-    }
-
-    function ellipseInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.s.ix === value){
-                return interfaceFunction.size;
-            }
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function starInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.rotation;
-            }
-            if(shape.pt.ix === value){
-                return interfaceFunction.points;
-            }
-            if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
-                return interfaceFunction.outerRadius;
-            }
-            if(shape.os.ix === value){
-                return interfaceFunction.outerRoundness;
-            }
-            if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
-                return interfaceFunction.innerRadius;
-            }
-            if(shape.is && shape.is.ix === value){
-                return interfaceFunction.innerRoundness;
-            }
-
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
-        prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
-        prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(shape.ir){
-            prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
-            prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
-        }
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'points': {
-                get: ExpressionPropertyInterface(prop.pt)
-            },
-            'outerRadius': {
-                get: ExpressionPropertyInterface(prop.or)
-            },
-            'outerRoundness': {
-                get: ExpressionPropertyInterface(prop.os)
-            },
-            'innerRadius': {
-                get: ExpressionPropertyInterface(prop.ir)
-            },
-            'innerRoundness': {
-                get: ExpressionPropertyInterface(prop.is)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function rectInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.roundness;
-            }
-            if(shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size'){
-                return interfaceFunction.size;
-            }
-
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'roundness': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function roundedInterfaceFactory(shape,view,propertyGroup){
-       
-        function interfaceFunction(value){
-            if(shape.r.ix === value || 'Round Corners 1' === value){
-                return interfaceFunction.radius;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'radius': {
-                get: ExpressionPropertyInterface(prop.rd)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function repeaterInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.c.ix === value || 'Copies' === value){
-                return interfaceFunction.copies;
-            } else if(shape.o.ix === value || 'Offset' === value){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
-        prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'copies': {
-                get: ExpressionPropertyInterface(prop.c)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(prop.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    return function(shapes,view,propertyGroup) {
-        var interfaces;
-        function _interfaceFunction(value){
-            if(typeof value === 'number'){
-                value = value === undefined ? 1 : value
-                if (value === 0) {
-                    return propertyGroup
-                } else {
-                    return interfaces[value-1];
-                }
-            } else {
-                var i = 0, len = interfaces.length;
-                while(i<len){
-                    if(interfaces[i]._name === value){
-                        return interfaces[i];
-                    }
-                    i+=1;
-                }
-            }
-        }
-        function parentGroupWrapper() {
-            return propertyGroup
-        }
-        _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
-        interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
-        _interfaceFunction.numProperties = interfaces.length;
-        _interfaceFunction._name = 'Contents';
-        return _interfaceFunction;
+            return prop;
+          },
+        },
+        _name: { value: shape.nm },
+        ix: { value: shape.ix },
+        propertyIndex: { value: shape.ix },
+        mn: { value: shape.mn },
+        propertyGroup: { value: propertyGroup },
+      });
+      return interfaceFunction;
     };
+  }()
+);
+
+/* exported propertyGroupFactory */
+
+var propertyGroupFactory = (function () {
+  return function (interfaceFunction, parentPropertyGroup) {
+    return function (val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return parentPropertyGroup(val - 1);
+    };
+  };
 }());
 
-var TextExpressionInterface = (function(){
-	return function(elem){
-        var _prevValue, _sourceText;
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Text Document":
-                    return _thisLayerFunction.sourceText;
-            }
-        }
-        Object.defineProperty(_thisLayerFunction, "sourceText", {
-            get: function(){
-                elem.textProperty.getValue()
-                var stringValue = elem.textProperty.currentData.t;
-                if(stringValue !== _prevValue) {
-                    elem.textProperty.currentData.t = _prevValue;
-                    _sourceText = new String(stringValue);
-                    //If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
-                    _sourceText.value = stringValue ? stringValue : new String(stringValue);
-                }
-                return _sourceText;
-            }
-        });
-        return _thisLayerFunction;
+/* exported PropertyInterface */
+
+var PropertyInterface = (function () {
+  return function (propertyName, propertyGroup) {
+    var interfaceFunction = {
+      _name: propertyName,
     };
+
+    function _propertyGroup(val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return propertyGroup(val - 1);
+    }
+
+    return _propertyGroup;
+  };
 }());
-var LayerExpressionInterface = (function (){
 
-    function getMatrix(time) {
-        var toWorldMat = new Matrix();
-        if (time !== undefined) {
-            var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
-            propMatrix.clone(toWorldMat);
-        } else {
-            var transformMat = this._elem.finalTransform.mProp;
-            transformMat.applyToMatrix(toWorldMat);
+/* global ExpressionPropertyInterface, PropertyInterface, propertyGroupFactory, ShapePathInterface */
+/* exported ShapeExpressionInterface */
+
+var ShapeExpressionInterface = (function () {
+  function iterateElements(shapes, view, propertyGroup) {
+    var arr = [];
+    var i;
+    var len = shapes ? shapes.length : 0;
+    for (i = 0; i < len; i += 1) {
+      if (shapes[i].ty === 'gr') {
+        arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'fl') {
+        arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'st') {
+        arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tm') {
+        arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tr') {
+        // arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
+      } else if (shapes[i].ty === 'el') {
+        arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sr') {
+        arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sh') {
+        arr.push(ShapePathInterface(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rc') {
+        arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rd') {
+        arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rp') {
+        arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup));
+      }
+    }
+    return arr;
+  }
+
+  function contentsInterfaceFactory(shape, view, propertyGroup) {
+    var interfaces;
+    var interfaceFunction = function _interfaceFunction(value) {
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) {
+          return interfaces[i];
         }
-        return toWorldMat;
-    }
-
-    function toWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function toWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function fromWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function fromWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function applyPoint(matrix, arr) {
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.applyToPointArray(arr[0],arr[1],arr[2]||0);
-    }
-
-    function invertPoint(matrix, arr) {
-        if (this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.inversePoint(arr);
-    }
-
-    function fromComp(arr){
-        var toWorldMat = new Matrix();
-        toWorldMat.reset();
-        this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
-            }
-            return toWorldMat.inversePoint(arr);
-        }
-        return toWorldMat.inversePoint(arr);
-    }
-
-    function sampleImage() {
-        return [1,1,1,1];
-    }
-
-
-    return function(elem){
-
-        var transformInterface;
-
-        function _registerMaskInterface(maskManager){
-            _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
-        }
-        function _registerEffectsInterface(effects){
-            _thisLayerFunction.effect = effects;
-        }
-
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Root Vectors Group":
-                case "Contents":
-                case 2:
-                    return _thisLayerFunction.shapeInterface;
-                case 1:
-                case 6:
-                case "Transform":
-                case "transform":
-                case "ADBE Transform Group":
-                    return transformInterface;
-                case 4:
-                case "ADBE Effect Parade":
-                case "effects":
-                case "Effects":
-                    return _thisLayerFunction.effect;
-                case "ADBE Text Properties":
-                    return _thisLayerFunction.textInterface;
-            }
-        }
-        _thisLayerFunction.getMatrix = getMatrix;
-        _thisLayerFunction.invertPoint = invertPoint;
-        _thisLayerFunction.applyPoint = applyPoint;
-        _thisLayerFunction.toWorld = toWorld;
-        _thisLayerFunction.toWorldVec = toWorldVec;
-        _thisLayerFunction.fromWorld = fromWorld;
-        _thisLayerFunction.fromWorldVec = fromWorldVec;
-        _thisLayerFunction.toComp = toWorld;
-        _thisLayerFunction.fromComp = fromComp;
-        _thisLayerFunction.sampleImage = sampleImage;
-        _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
-        _thisLayerFunction._elem = elem;
-        transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
-        var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
-        Object.defineProperties(_thisLayerFunction,{
-            hasParent: {
-                get: function(){
-                    return elem.hierarchy.length;
-                }
-            },
-            parent: {
-                get: function(){
-                    return elem.hierarchy[0].layerInterface;
-                }
-            },
-            rotation: getDescriptor(transformInterface, 'rotation'),
-            scale: getDescriptor(transformInterface, 'scale'),
-            position: getDescriptor(transformInterface, 'position'),
-            opacity: getDescriptor(transformInterface, 'opacity'),
-            anchorPoint: anchorPointDescriptor,
-            anchor_point: anchorPointDescriptor,
-            transform: {
-                get: function () {
-                    return transformInterface;
-                }
-            },
-            active: {
-                get: function(){
-                    return elem.isInRange;
-                }
-            }
-        });
-
-        _thisLayerFunction.startTime = elem.data.st;
-        _thisLayerFunction.index = elem.data.ind;
-        _thisLayerFunction.source = elem.data.refId;
-        _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
-        _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
-        _thisLayerFunction.inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        _thisLayerFunction.outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        _thisLayerFunction._name = elem.data.nm;
-
-        _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
-        _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
-        return _thisLayerFunction;
+        i += 1;
+      }
+      if (typeof value === 'number') {
+        return interfaces[value - 1];
+      }
+      return null;
     };
+
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
+    interfaceFunction.numProperties = interfaces.length;
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.transform = transformInterface;
+    interfaceFunction.propertyIndex = shape.cix;
+    interfaceFunction._name = shape.nm;
+
+    return interfaceFunction;
+  }
+
+  function groupInterfaceFactory(shape, view, propertyGroup) {
+    var interfaceFunction = function _interfaceFunction(value) {
+      switch (value) {
+        case 'ADBE Vectors Group':
+        case 'Contents':
+        case 2:
+          return interfaceFunction.content;
+          // Not necessary for now. Keeping them here in case a new case appears
+          // case 'ADBE Vector Transform Group':
+          // case 3:
+        default:
+          return interfaceFunction.transform;
+      }
+    };
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup);
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.content = content;
+    interfaceFunction.transform = transformInterface;
+    Object.defineProperty(interfaceFunction, '_name', {
+      get: function () {
+        return shape.nm;
+      },
+    });
+    // interfaceFunction.content = interfaceFunction;
+    interfaceFunction.numProperties = shape.np;
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.nm = shape.nm;
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function fillInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
+    return interfaceFunction;
+  }
+
+  function strokeInterfaceFactory(shape, view, propertyGroup) {
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
+    function addPropertyToDashOb(i) {
+      Object.defineProperty(dashOb, shape.d[i].nm, {
+        get: ExpressionPropertyInterface(view.d.dataProps[i].p),
+      });
+    }
+    var i;
+    var len = shape.d ? shape.d.length : 0;
+    var dashOb = {};
+    for (i = 0; i < len; i += 1) {
+      addPropertyToDashOb(i);
+      view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
+    }
+
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      } if (val === 'Stroke Width' || val === 'stroke width') {
+        return interfaceFunction.strokeWidth;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      strokeWidth: {
+        get: ExpressionPropertyInterface(view.w),
+      },
+      dash: {
+        get: function () {
+          return dashOb;
+        },
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
+    return interfaceFunction;
+  }
+
+  function trimInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === shape.e.ix || val === 'End' || val === 'end') {
+        return interfaceFunction.end;
+      }
+      if (val === shape.s.ix) {
+        return interfaceFunction.start;
+      }
+      if (val === shape.o.ix) {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+
+    view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
+    view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.propertyGroup = propertyGroup;
+
+    Object.defineProperties(interfaceFunction, {
+      start: {
+        get: ExpressionPropertyInterface(view.s),
+      },
+      end: {
+        get: ExpressionPropertyInterface(view.e),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function transformInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.a.ix === value || value === 'Anchor Point') {
+        return interfaceFunction.anchorPoint;
+      }
+      if (shape.o.ix === value || value === 'Opacity') {
+        return interfaceFunction.opacity;
+      }
+      if (shape.p.ix === value || value === 'Position') {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') {
+        return interfaceFunction.rotation;
+      }
+      if (shape.s.ix === value || value === 'Scale') {
+        return interfaceFunction.scale;
+      }
+      if ((shape.sk && shape.sk.ix === value) || value === 'Skew') {
+        return interfaceFunction.skew;
+      }
+      if ((shape.sa && shape.sa.ix === value) || value === 'Skew Axis') {
+        return interfaceFunction.skewAxis;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
+    view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
+    view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (view.transform.mProps.sk) {
+      view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
+      view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
+    }
+    view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      opacity: {
+        get: ExpressionPropertyInterface(view.transform.mProps.o),
+      },
+      position: {
+        get: ExpressionPropertyInterface(view.transform.mProps.p),
+      },
+      anchorPoint: {
+        get: ExpressionPropertyInterface(view.transform.mProps.a),
+      },
+      scale: {
+        get: ExpressionPropertyInterface(view.transform.mProps.s),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(view.transform.mProps.r),
+      },
+      skew: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sk),
+      },
+      skewAxis: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sa),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.ty = 'tr';
+    interfaceFunction.mn = shape.mn;
+    interfaceFunction.propertyGroup = propertyGroup;
+    return interfaceFunction;
+  }
+
+  function ellipseInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.s.ix === value) {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function starInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.rotation;
+      }
+      if (shape.pt.ix === value) {
+        return interfaceFunction.points;
+      }
+      if (shape.or.ix === value || value === 'ADBE Vector Star Outer Radius') {
+        return interfaceFunction.outerRadius;
+      }
+      if (shape.os.ix === value) {
+        return interfaceFunction.outerRoundness;
+      }
+      if (shape.ir && (shape.ir.ix === value || value === 'ADBE Vector Star Inner Radius')) {
+        return interfaceFunction.innerRadius;
+      }
+      if (shape.is && shape.is.ix === value) {
+        return interfaceFunction.innerRoundness;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
+    prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
+    prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (shape.ir) {
+      prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
+      prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
+    }
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      points: {
+        get: ExpressionPropertyInterface(prop.pt),
+      },
+      outerRadius: {
+        get: ExpressionPropertyInterface(prop.or),
+      },
+      outerRoundness: {
+        get: ExpressionPropertyInterface(prop.os),
+      },
+      innerRadius: {
+        get: ExpressionPropertyInterface(prop.ir),
+      },
+      innerRoundness: {
+        get: ExpressionPropertyInterface(prop.is),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function rectInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.roundness;
+      }
+      if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      roundness: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function roundedInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.r.ix === value || value === 'Round Corners 1') {
+        return interfaceFunction.radius;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      radius: {
+        get: ExpressionPropertyInterface(prop.rd),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function repeaterInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.c.ix === value || value === 'Copies') {
+        return interfaceFunction.copies;
+      } if (shape.o.ix === value || value === 'Offset') {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
+    prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      copies: {
+        get: ExpressionPropertyInterface(prop.c),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(prop.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  return function (shapes, view, propertyGroup) {
+    var interfaces;
+    function _interfaceFunction(value) {
+      if (typeof value === 'number') {
+        value = value === undefined ? 1 : value;
+        if (value === 0) {
+          return propertyGroup;
+        }
+        return interfaces[value - 1];
+      }
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value) {
+          return interfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    }
+    function parentGroupWrapper() {
+      return propertyGroup;
+    }
+    _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
+    interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
+    _interfaceFunction.numProperties = interfaces.length;
+    _interfaceFunction._name = 'Contents';
+    return _interfaceFunction;
+  };
 }());
 
+/* exported TextExpressionInterface */
+
+var TextExpressionInterface = (function () {
+  return function (elem) {
+    var _prevValue;
+    var _sourceText;
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Text Document':
+          return _thisLayerFunction.sourceText;
+        default:
+          return null;
+      }
+    }
+    Object.defineProperty(_thisLayerFunction, 'sourceText', {
+      get: function () {
+        elem.textProperty.getValue();
+        var stringValue = elem.textProperty.currentData.t;
+        if (stringValue !== _prevValue) {
+          elem.textProperty.currentData.t = _prevValue;
+          _sourceText = new String(stringValue); // eslint-disable-line no-new-wrappers
+          // If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
+          _sourceText.value = stringValue || new String(stringValue); // eslint-disable-line no-new-wrappers
+        }
+        return _sourceText;
+      },
+    });
+    return _thisLayerFunction;
+  };
+}());
+
+/* global Matrix, MaskManagerInterface, TransformExpressionInterface, getDescriptor */
+/* exported LayerExpressionInterface */
+
+var LayerExpressionInterface = (function () {
+  function getMatrix(time) {
+    var toWorldMat = new Matrix();
+    if (time !== undefined) {
+      var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
+      propMatrix.clone(toWorldMat);
+    } else {
+      var transformMat = this._elem.finalTransform.mProp;
+      transformMat.applyToMatrix(toWorldMat);
+    }
+    return toWorldMat;
+  }
+
+  function toWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function toWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function fromWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function fromWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function applyPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.applyToPointArray(arr[0], arr[1], arr[2] || 0);
+  }
+
+  function invertPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.inversePoint(arr);
+  }
+
+  function fromComp(arr) {
+    var toWorldMat = new Matrix();
+    toWorldMat.reset();
+    this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
+      }
+      return toWorldMat.inversePoint(arr);
+    }
+    return toWorldMat.inversePoint(arr);
+  }
+
+  function sampleImage() {
+    return [1, 1, 1, 1];
+  }
+
+  return function (elem) {
+    var transformInterface;
+
+    function _registerMaskInterface(maskManager) {
+      _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
+    }
+    function _registerEffectsInterface(effects) {
+      _thisLayerFunction.effect = effects;
+    }
+
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Root Vectors Group':
+        case 'Contents':
+        case 2:
+          return _thisLayerFunction.shapeInterface;
+        case 1:
+        case 6:
+        case 'Transform':
+        case 'transform':
+        case 'ADBE Transform Group':
+          return transformInterface;
+        case 4:
+        case 'ADBE Effect Parade':
+        case 'effects':
+        case 'Effects':
+          return _thisLayerFunction.effect;
+        case 'ADBE Text Properties':
+          return _thisLayerFunction.textInterface;
+        default:
+          return null;
+      }
+    }
+    _thisLayerFunction.getMatrix = getMatrix;
+    _thisLayerFunction.invertPoint = invertPoint;
+    _thisLayerFunction.applyPoint = applyPoint;
+    _thisLayerFunction.toWorld = toWorld;
+    _thisLayerFunction.toWorldVec = toWorldVec;
+    _thisLayerFunction.fromWorld = fromWorld;
+    _thisLayerFunction.fromWorldVec = fromWorldVec;
+    _thisLayerFunction.toComp = toWorld;
+    _thisLayerFunction.fromComp = fromComp;
+    _thisLayerFunction.sampleImage = sampleImage;
+    _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
+    _thisLayerFunction._elem = elem;
+    transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
+    var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
+    Object.defineProperties(_thisLayerFunction, {
+      hasParent: {
+        get: function () {
+          return elem.hierarchy.length;
+        },
+      },
+      parent: {
+        get: function () {
+          return elem.hierarchy[0].layerInterface;
+        },
+      },
+      rotation: getDescriptor(transformInterface, 'rotation'),
+      scale: getDescriptor(transformInterface, 'scale'),
+      position: getDescriptor(transformInterface, 'position'),
+      opacity: getDescriptor(transformInterface, 'opacity'),
+      anchorPoint: anchorPointDescriptor,
+      anchor_point: anchorPointDescriptor,
+      transform: {
+        get: function () {
+          return transformInterface;
+        },
+      },
+      active: {
+        get: function () {
+          return elem.isInRange;
+        },
+      },
+    });
+
+    _thisLayerFunction.startTime = elem.data.st;
+    _thisLayerFunction.index = elem.data.ind;
+    _thisLayerFunction.source = elem.data.refId;
+    _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
+    _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
+    _thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    _thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    _thisLayerFunction._name = elem.data.nm;
+
+    _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
+    _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
+    return _thisLayerFunction;
+  };
+}());
+
+/* exported CompExpressionInterface */
+
 var CompExpressionInterface = (function () {
-    return function(comp) {
-        function _thisLayerFunction(name) {
-            var i = 0, len = comp.layers.length;
-            while ( i < len) {
-                if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
-                    return comp.elements[i].layerInterface;
-                }
-                i += 1;
-            }
-            return null;
-            //return {active:false};
+  return function (comp) {
+    function _thisLayerFunction(name) {
+      var i = 0;
+      var len = comp.layers.length;
+      while (i < len) {
+        if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
+          return comp.elements[i].layerInterface;
         }
-        Object.defineProperty(_thisLayerFunction, "_name", { value: comp.data.nm });
-        _thisLayerFunction.layer = _thisLayerFunction;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
-        _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
-        _thisLayerFunction.displayStartTime = 0;
-        _thisLayerFunction.numLayers = comp.layers.length;
-        return _thisLayerFunction;
-    };
-}());
-var TransformExpressionInterface = (function (){
-    return function(transform){
-        function _thisFunction(name){
-            switch(name){
-                case "scale":
-                case "Scale":
-                case "ADBE Scale":
-                case 6:
-                    return _thisFunction.scale;
-                case "rotation":
-                case "Rotation":
-                case "ADBE Rotation":
-                case "ADBE Rotate Z":
-                case 10:
-                    return _thisFunction.rotation;
-                case "ADBE Rotate X":
-                    return _thisFunction.xRotation;
-                case "ADBE Rotate Y":
-                    return _thisFunction.yRotation;
-                case "position":
-                case "Position":
-                case "ADBE Position":
-                case 2:
-                    return _thisFunction.position;
-                case 'ADBE Position_0':
-                    return _thisFunction.xPosition;
-                case 'ADBE Position_1':
-                    return _thisFunction.yPosition;
-                case 'ADBE Position_2':
-                    return _thisFunction.zPosition;
-                case "anchorPoint":
-                case "AnchorPoint":
-                case "Anchor Point":
-                case "ADBE AnchorPoint":
-                case 1:
-                    return _thisFunction.anchorPoint;
-                case "opacity":
-                case "Opacity":
-                case 11:
-                    return _thisFunction.opacity;
-            }
-        }
-        Object.defineProperty(_thisFunction, "rotation", {
-            get: ExpressionPropertyInterface(transform.r || transform.rz)
-        });
-
-        Object.defineProperty(_thisFunction, "zRotation", {
-            get: ExpressionPropertyInterface(transform.rz || transform.r)
-        });
-
-        Object.defineProperty(_thisFunction, "xRotation", {
-            get: ExpressionPropertyInterface(transform.rx)
-        });
-
-        Object.defineProperty(_thisFunction, "yRotation", {
-            get: ExpressionPropertyInterface(transform.ry)
-        });
-        Object.defineProperty(_thisFunction, "scale", {
-            get: ExpressionPropertyInterface(transform.s)
-        });
-
-        if(transform.p) {
-            var _transformFactory = ExpressionPropertyInterface(transform.p);
-        } else {
-            var _px = ExpressionPropertyInterface(transform.px);
-            var _py = ExpressionPropertyInterface(transform.py);
-            var _pz;
-            if (transform.pz) {
-                _pz = ExpressionPropertyInterface(transform.pz);
-            }
-        }
-        Object.defineProperty(_thisFunction, "position", {
-            get: function () {
-                if(transform.p) {
-                    return _transformFactory();
-                } else {
-                    return [
-                        _px(),
-                        _py(),
-                        _pz ? _pz() : 0];
-                }
-            }
-        });
-
-        Object.defineProperty(_thisFunction, "xPosition", {
-            get: ExpressionPropertyInterface(transform.px)
-        });
-
-        Object.defineProperty(_thisFunction, "yPosition", {
-            get: ExpressionPropertyInterface(transform.py)
-        });
-
-        Object.defineProperty(_thisFunction, "zPosition", {
-            get: ExpressionPropertyInterface(transform.pz)
-        });
-
-        Object.defineProperty(_thisFunction, "anchorPoint", {
-            get: ExpressionPropertyInterface(transform.a)
-        });
-
-        Object.defineProperty(_thisFunction, "opacity", {
-            get: ExpressionPropertyInterface(transform.o)
-        });
-
-        Object.defineProperty(_thisFunction, "skew", {
-            get: ExpressionPropertyInterface(transform.sk)
-        });
-
-        Object.defineProperty(_thisFunction, "skewAxis", {
-            get: ExpressionPropertyInterface(transform.sa)
-        });
-
-        Object.defineProperty(_thisFunction, "orientation", {
-            get: ExpressionPropertyInterface(transform.or)
-        });
-
-        return _thisFunction;
-    };
-}());
-var ProjectInterface = (function (){
-
-    function registerComposition(comp){
-        this.compositions.push(comp);
+        i += 1;
+      }
+      return null;
+      // return {active:false};
     }
-
-    return function(){
-        function _thisProjectFunction(name){
-            var i = 0, len = this.compositions.length;
-            while(i<len){
-                if(this.compositions[i].data && this.compositions[i].data.nm === name){
-                    if(this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
-                        this.compositions[i].prepareFrame(this.currentFrame);
-                    }
-                    return this.compositions[i].compInterface;
-                }
-                i+=1;
-            }
-        }
-
-        _thisProjectFunction.compositions = [];
-        _thisProjectFunction.currentFrame = 0;
-
-        _thisProjectFunction.registerComposition = registerComposition;
-
-
-
-        return _thisProjectFunction;
-    };
+    Object.defineProperty(_thisLayerFunction, '_name', { value: comp.data.nm });
+    _thisLayerFunction.layer = _thisLayerFunction;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
+    _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
+    _thisLayerFunction.displayStartTime = 0;
+    _thisLayerFunction.numLayers = comp.layers.length;
+    return _thisLayerFunction;
+  };
 }());
-var EffectsExpressionInterface = (function (){
-    var ob = {
-        createEffectsInterface: createEffectsInterface
-    };
 
-    function createEffectsInterface(elem, propertyGroup){
-        if(elem.effectsManager){
+/* global ExpressionPropertyInterface */
+/* exported TransformExpressionInterface */
 
-            var effectElements = [];
-            var effectsData = elem.data.ef;
-            var i, len = elem.effectsManager.effectElements.length;
-            for(i=0;i<len;i+=1){
-                effectElements.push(createGroupInterface(effectsData[i],elem.effectsManager.effectElements[i],propertyGroup,elem));
-            }
-
-            var effects = elem.data.ef || [];
-            var groupInterface = function(name){
-                i = 0, len = effects.length;
-                while(i<len) {
-                    if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                        return effectElements[i];
-                    }
-                    i += 1;
-                }
-            };
-            Object.defineProperty(groupInterface, 'numProperties', {
-                get: function(){
-                    return effects.length;
-                }
-            });
-            return groupInterface
-        }
+var TransformExpressionInterface = (function () {
+  return function (transform) {
+    function _thisFunction(name) {
+      switch (name) {
+        case 'scale':
+        case 'Scale':
+        case 'ADBE Scale':
+        case 6:
+          return _thisFunction.scale;
+        case 'rotation':
+        case 'Rotation':
+        case 'ADBE Rotation':
+        case 'ADBE Rotate Z':
+        case 10:
+          return _thisFunction.rotation;
+        case 'ADBE Rotate X':
+          return _thisFunction.xRotation;
+        case 'ADBE Rotate Y':
+          return _thisFunction.yRotation;
+        case 'position':
+        case 'Position':
+        case 'ADBE Position':
+        case 2:
+          return _thisFunction.position;
+        case 'ADBE Position_0':
+          return _thisFunction.xPosition;
+        case 'ADBE Position_1':
+          return _thisFunction.yPosition;
+        case 'ADBE Position_2':
+          return _thisFunction.zPosition;
+        case 'anchorPoint':
+        case 'AnchorPoint':
+        case 'Anchor Point':
+        case 'ADBE AnchorPoint':
+        case 1:
+          return _thisFunction.anchorPoint;
+        case 'opacity':
+        case 'Opacity':
+        case 11:
+          return _thisFunction.opacity;
+        default:
+          return null;
+      }
     }
-
-    function createGroupInterface(data,elements, propertyGroup, elem){
-
-        function groupInterface(name){
-            var effects = data.ef, i = 0, len = effects.length;
-            while(i<len) {
-                if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                    if(effects[i].ty === 5){
-                        return effectElements[i];
-                    } else {
-                        return effectElements[i]();
-                    }
-                }
-                i += 1;
-            }
-            throw new Error();
-        };
-        var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
-
-        var effectElements = [];
-        var i, len = data.ef.length;
-        for(i=0;i<len;i+=1){
-            if(data.ef[i].ty === 5){
-                effectElements.push(createGroupInterface(data.ef[i],elements.effectElements[i],elements.effectElements[i].propertyGroup, elem));
-            } else {
-                effectElements.push(createValueInterface(elements.effectElements[i],data.ef[i].ty, elem, _propertyGroup));
-            }
-        }
-
-        if(data.mn === 'ADBE Color Control'){
-            Object.defineProperty(groupInterface, 'color', {
-                get: function(){
-                    return effectElements[0]();
-                }
-            });
-        }
-        Object.defineProperties(groupInterface, {
-            numProperties: {
-                get: function(){
-                    return data.np;
-                }
-            },
-            _name: { value: data.nm },
-            propertyGroup: {value: _propertyGroup},
-        });
-        groupInterface.active = groupInterface.enabled = data.en !== 0;
-        return groupInterface;
-    }
-
-    function createValueInterface(element, type, elem, propertyGroup){
-        var expressionProperty = ExpressionPropertyInterface(element.p);
-        function interfaceFunction(){
-            if(type === 10){
-                return elem.comp.compInterface(element.p.v);
-            }
-            return expressionProperty();
-        }
-
-        if(element.p.setGroupProperty) {
-            element.p.setGroupProperty(PropertyInterface('', propertyGroup));
-        }
-
-        return interfaceFunction;
-    }
-
-    return ob;
-
-}());
-var MaskManagerInterface = (function(){
-
-	function MaskInterface(mask, data){
-		this._mask = mask;
-		this._data = data;
-	}
-	Object.defineProperty(MaskInterface.prototype, 'maskPath', {
-        get: function(){
-            if(this._mask.prop.k){
-                this._mask.prop.getValue();
-            }
-            return this._mask.prop;
-        }
-    });
-	Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
-        get: function(){
-            if(this._mask.op.k){
-                this._mask.op.getValue();
-            }
-            return this._mask.op.v * 100;
-        }
+    Object.defineProperty(_thisFunction, 'rotation', {
+      get: ExpressionPropertyInterface(transform.r || transform.rz),
     });
 
-	var MaskManager = function(maskManager, elem){
-		var _maskManager = maskManager;
-		var _elem = elem;
-		var _masksInterfaces = createSizedArray(maskManager.viewData.length);
-		var i, len = maskManager.viewData.length;
-		for(i = 0; i < len; i += 1) {
-			_masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
-		}
+    Object.defineProperty(_thisFunction, 'zRotation', {
+      get: ExpressionPropertyInterface(transform.rz || transform.r),
+    });
 
-		var maskFunction = function(name){
-			i = 0;
-		    while(i<len){
-		        if(maskManager.masksProperties[i].nm === name){
-		            return _masksInterfaces[i];
-		        }
-		        i += 1;
-		    }
-		};
-		return maskFunction;
-	};
-	return MaskManager;
+    Object.defineProperty(_thisFunction, 'xRotation', {
+      get: ExpressionPropertyInterface(transform.rx),
+    });
+
+    Object.defineProperty(_thisFunction, 'yRotation', {
+      get: ExpressionPropertyInterface(transform.ry),
+    });
+    Object.defineProperty(_thisFunction, 'scale', {
+      get: ExpressionPropertyInterface(transform.s),
+    });
+    var _px;
+    var _py;
+    var _pz;
+    var _transformFactory;
+    if (transform.p) {
+      _transformFactory = ExpressionPropertyInterface(transform.p);
+    } else {
+      _px = ExpressionPropertyInterface(transform.px);
+      _py = ExpressionPropertyInterface(transform.py);
+      if (transform.pz) {
+        _pz = ExpressionPropertyInterface(transform.pz);
+      }
+    }
+    Object.defineProperty(_thisFunction, 'position', {
+      get: function () {
+        if (transform.p) {
+          return _transformFactory();
+        }
+        return [
+          _px(),
+          _py(),
+          _pz ? _pz() : 0];
+      },
+    });
+
+    Object.defineProperty(_thisFunction, 'xPosition', {
+      get: ExpressionPropertyInterface(transform.px),
+    });
+
+    Object.defineProperty(_thisFunction, 'yPosition', {
+      get: ExpressionPropertyInterface(transform.py),
+    });
+
+    Object.defineProperty(_thisFunction, 'zPosition', {
+      get: ExpressionPropertyInterface(transform.pz),
+    });
+
+    Object.defineProperty(_thisFunction, 'anchorPoint', {
+      get: ExpressionPropertyInterface(transform.a),
+    });
+
+    Object.defineProperty(_thisFunction, 'opacity', {
+      get: ExpressionPropertyInterface(transform.o),
+    });
+
+    Object.defineProperty(_thisFunction, 'skew', {
+      get: ExpressionPropertyInterface(transform.sk),
+    });
+
+    Object.defineProperty(_thisFunction, 'skewAxis', {
+      get: ExpressionPropertyInterface(transform.sa),
+    });
+
+    Object.defineProperty(_thisFunction, 'orientation', {
+      get: ExpressionPropertyInterface(transform.or),
+    });
+
+    return _thisFunction;
+  };
 }());
 
-var ExpressionPropertyInterface = (function() {
+/* exported ProjectInterface */
 
-    var defaultUnidimensionalValue = {pv:0, v:0, mult: 1}
-    var defaultMultidimensionalValue = {pv:[0,0,0], v:[0,0,0], mult: 1}
+var ProjectInterface = (function () {
+  function registerComposition(comp) {
+    this.compositions.push(comp);
+  }
 
-    function completeProperty(expressionValue, property, type) {
-        Object.defineProperty(expressionValue, 'velocity', {
-            get: function(){
-                return property.getVelocityAtTime(property.comp.currentFrame);
-            }
-        });
-        expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
-        expressionValue.key = function(pos) {
-            if (!expressionValue.numKeys) {
-                return 0;
-            } else {
-                var value = '';
-                if ('s' in property.keyframes[pos-1]) {
-                    value = property.keyframes[pos-1].s;
-                } else if ('e' in property.keyframes[pos-2]) {
-                    value = property.keyframes[pos-2].e;
-                } else {
-                    value = property.keyframes[pos-2].s;
-                }
-                var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value);
-                valueProp.time = property.keyframes[pos-1].t / property.elem.comp.globalData.frameRate;
-                valueProp.value = type === 'unidimensional' ? value[0] : value;
-                return valueProp;
-            }
-        };
-        expressionValue.valueAtTime = property.getValueAtTime;
-        expressionValue.speedAtTime = property.getSpeedAtTime;
-        expressionValue.velocityAtTime = property.getVelocityAtTime;
-        expressionValue.propertyGroup = property.propertyGroup;
+  return function () {
+    function _thisProjectFunction(name) {
+      var i = 0;
+      var len = this.compositions.length;
+      while (i < len) {
+        if (this.compositions[i].data && this.compositions[i].data.nm === name) {
+          if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
+            this.compositions[i].prepareFrame(this.currentFrame);
+          }
+          return this.compositions[i].compInterface;
+        }
+        i += 1;
+      }
+      return null;
     }
 
-    function UnidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultUnidimensionalValue;
+    _thisProjectFunction.compositions = [];
+    _thisProjectFunction.currentFrame = 0;
+
+    _thisProjectFunction.registerComposition = registerComposition;
+
+    return _thisProjectFunction;
+  };
+}());
+
+/* global propertyGroupFactory, ExpressionPropertyInterface, PropertyInterface */
+/* exported EffectsExpressionInterface */
+
+var EffectsExpressionInterface = (function () {
+  var ob = {
+    createEffectsInterface: createEffectsInterface,
+  };
+
+  function createEffectsInterface(elem, propertyGroup) {
+    if (elem.effectsManager) {
+      var effectElements = [];
+      var effectsData = elem.data.ef;
+      var i;
+      var len = elem.effectsManager.effectElements.length;
+      for (i = 0; i < len; i += 1) {
+        effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem));
+      }
+
+      var effects = elem.data.ef || [];
+      var groupInterface = function (name) {
+        i = 0;
+        len = effects.length;
+        while (i < len) {
+          if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+            return effectElements[i];
+          }
+          i += 1;
         }
-        var mult = 1 / property.mult;
-        var val = property.pv * mult;
-        var expressionValue = new Number(val);
+        return null;
+      };
+      Object.defineProperty(groupInterface, 'numProperties', {
+        get: function () {
+          return effects.length;
+        },
+      });
+      return groupInterface;
+    }
+    return null;
+  }
+
+  function createGroupInterface(data, elements, propertyGroup, elem) {
+    function groupInterface(name) {
+      var effects = data.ef;
+      var i = 0;
+      var len = effects.length;
+      while (i < len) {
+        if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+          if (effects[i].ty === 5) {
+            return effectElements[i];
+          }
+          return effectElements[i]();
+        }
+        i += 1;
+      }
+      throw new Error();
+    }
+    var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
+
+    var effectElements = [];
+    var i;
+    var len = data.ef.length;
+    for (i = 0; i < len; i += 1) {
+      if (data.ef[i].ty === 5) {
+        effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem));
+      } else {
+        effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup));
+      }
+    }
+
+    if (data.mn === 'ADBE Color Control') {
+      Object.defineProperty(groupInterface, 'color', {
+        get: function () {
+          return effectElements[0]();
+        },
+      });
+    }
+    Object.defineProperties(groupInterface, {
+      numProperties: {
+        get: function () {
+          return data.np;
+        },
+      },
+      _name: { value: data.nm },
+      propertyGroup: { value: _propertyGroup },
+    });
+    groupInterface.enabled = data.en !== 0;
+    groupInterface.active = groupInterface.enabled;
+    return groupInterface;
+  }
+
+  function createValueInterface(element, type, elem, propertyGroup) {
+    var expressionProperty = ExpressionPropertyInterface(element.p);
+    function interfaceFunction() {
+      if (type === 10) {
+        return elem.comp.compInterface(element.p.v);
+      }
+      return expressionProperty();
+    }
+
+    if (element.p.setGroupProperty) {
+      element.p.setGroupProperty(PropertyInterface('', propertyGroup));
+    }
+
+    return interfaceFunction;
+  }
+
+  return ob;
+}());
+
+/* global createSizedArray */
+/* exported MaskManagerInterface */
+
+var MaskManagerInterface = (function () {
+  function MaskInterface(mask, data) {
+    this._mask = mask;
+    this._data = data;
+  }
+  Object.defineProperty(MaskInterface.prototype, 'maskPath', {
+    get: function () {
+      if (this._mask.prop.k) {
+        this._mask.prop.getValue();
+      }
+      return this._mask.prop;
+    },
+  });
+  Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
+    get: function () {
+      if (this._mask.op.k) {
+        this._mask.op.getValue();
+      }
+      return this._mask.op.v * 100;
+    },
+  });
+
+  var MaskManager = function (maskManager) {
+    var _masksInterfaces = createSizedArray(maskManager.viewData.length);
+    var i;
+    var len = maskManager.viewData.length;
+    for (i = 0; i < len; i += 1) {
+      _masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
+    }
+
+    var maskFunction = function (name) {
+      i = 0;
+      while (i < len) {
+        if (maskManager.masksProperties[i].nm === name) {
+          return _masksInterfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    };
+    return maskFunction;
+  };
+  return MaskManager;
+}());
+
+/* global createTypedArray */
+/* exported ExpressionPropertyInterface */
+
+var ExpressionPropertyInterface = (function () {
+  var defaultUnidimensionalValue = { pv: 0, v: 0, mult: 1 };
+  var defaultMultidimensionalValue = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 };
+
+  function completeProperty(expressionValue, property, type) {
+    Object.defineProperty(expressionValue, 'velocity', {
+      get: function () {
+        return property.getVelocityAtTime(property.comp.currentFrame);
+      },
+    });
+    expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
+    expressionValue.key = function (pos) {
+      if (!expressionValue.numKeys) {
+        return 0;
+      }
+      var value = '';
+      if ('s' in property.keyframes[pos - 1]) {
+        value = property.keyframes[pos - 1].s;
+      } else if ('e' in property.keyframes[pos - 2]) {
+        value = property.keyframes[pos - 2].e;
+      } else {
+        value = property.keyframes[pos - 2].s;
+      }
+      var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value); // eslint-disable-line no-new-wrappers
+      valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate;
+      valueProp.value = type === 'unidimensional' ? value[0] : value;
+      return valueProp;
+    };
+    expressionValue.valueAtTime = property.getValueAtTime;
+    expressionValue.speedAtTime = property.getSpeedAtTime;
+    expressionValue.velocityAtTime = property.getVelocityAtTime;
+    expressionValue.propertyGroup = property.propertyGroup;
+  }
+
+  function UnidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultUnidimensionalValue;
+    }
+    var mult = 1 / property.mult;
+    var val = property.pv * mult;
+    var expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
+    expressionValue.value = val;
+    completeProperty(expressionValue, property, 'unidimensional');
+
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      val = property.v * mult;
+      if (expressionValue.value !== val) {
+        expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
         expressionValue.value = val;
         completeProperty(expressionValue, property, 'unidimensional');
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            val = property.v * mult;
-            if(expressionValue.value !== val) {
-                expressionValue = new Number(val);
-                expressionValue.value = val;
-                completeProperty(expressionValue, property, 'unidimensional');
-            }
-            return expressionValue;
-        }
+  function MultidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultMultidimensionalValue;
     }
+    var mult = 1 / property.mult;
+    var len = (property.data && property.data.l) || property.pv.length;
+    var expressionValue = createTypedArray('float32', len);
+    var arrValue = createTypedArray('float32', len);
+    expressionValue.value = arrValue;
+    completeProperty(expressionValue, property, 'multidimensional');
 
-    function MultidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultMultidimensionalValue;
-        }
-        var mult = 1 / property.mult;
-        var len = (property.data && property.data.l) || property.pv.length;
-        var expressionValue = createTypedArray('float32', len);
-        var arrValue = createTypedArray('float32', len);
-        expressionValue.value = arrValue;
-        completeProperty(expressionValue, property, 'multidimensional');
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      for (var i = 0; i < len; i += 1) {
+        arrValue[i] = property.v[i] * mult;
+        expressionValue[i] = arrValue[i];
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            for (var i = 0; i < len; i += 1) {
-                expressionValue[i] = arrValue[i] = property.v[i] * mult;
-            }
-            return expressionValue;
-        }
-    }
+  // TODO: try to avoid using this getter
+  function defaultGetter() {
+    return defaultUnidimensionalValue;
+  }
 
-    //TODO: try to avoid using this getter
-    function defaultGetter() {
-        return defaultUnidimensionalValue;
+  return function (property) {
+    if (!property) {
+      return defaultGetter;
+    } if (property.propType === 'unidimensional') {
+      return UnidimensionalPropertyInterface(property);
     }
-    
-    return function(property) {
-        if(!property) {
-            return defaultGetter;
-        } else if (property.propType === 'unidimensional') {
-            return UnidimensionalPropertyInterface(property);
-        } else {
-            return MultidimensionalPropertyInterface(property);
-        }
-    }
+    return MultidimensionalPropertyInterface(property);
+  };
 }());
 
-(function(){
+/* global expressionHelpers, TextSelectorProp, ExpressionManager */
+/* exported TextExpressionSelectorProp */
 
-    var TextExpressionSelectorProp = (function(){
-
-        function getValueProxy(index,total){
-            this.textIndex = index+1;
-            this.textTotal = total;
-            this.v = this.getValue() * this.mult;
-            return this.v;
-        }
-
-        return function TextExpressionSelectorProp(elem,data){
-            this.pv = 1;
-            this.comp = elem.comp;
-            this.elem = elem;
-            this.mult = 0.01;
-            this.propType = 'textSelector';
-            this.textTotal = data.totalChars;
-            this.selectorValue = 100;
-            this.lastValue = [1,1,1];
-            this.k = true;
-            this.x = true;
-            this.getValue = ExpressionManager.initiateExpression.bind(this)(elem,data,this);
-            this.getMult = getValueProxy;
-            this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
-            if(this.kf){
-                this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
-            } else {
-                this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
-            }
-            this.setGroupProperty = expressionHelpers.setGroupProperty;
-        };
-    }());
-
-	var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
-	TextSelectorProp.getTextSelectorProp = function(elem, data,arr){
-	    if(data.t === 1){
-	        return new TextExpressionSelectorProp(elem, data,arr);
-	    } else {
-	        return propertyGetTextProp(elem,data,arr);
-	    }
-	};
-}());
-function SliderEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function AngleEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function ColorEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function PointEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function LayerIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function MaskIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function CheckboxEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function NoValueEffect(){
-    this.p = {};
-}
-function EffectsManager(data,element){
-    var effects = data.ef || [];
-    this.effectElements = [];
-    var i,len = effects.length;
-    var effectItem;
-    for(i=0;i<len;i++) {
-        effectItem = new GroupEffect(effects[i],element);
-        this.effectElements.push(effectItem);
+(function () {
+  var TextExpressionSelectorProp = (function () { // eslint-disable-line no-unused-vars
+    function getValueProxy(index, total) {
+      this.textIndex = index + 1;
+      this.textTotal = total;
+      this.v = this.getValue() * this.mult;
+      return this.v;
     }
+
+    return function TextExpressionSelectorPropFactory(elem, data) {
+      this.pv = 1;
+      this.comp = elem.comp;
+      this.elem = elem;
+      this.mult = 0.01;
+      this.propType = 'textSelector';
+      this.textTotal = data.totalChars;
+      this.selectorValue = 100;
+      this.lastValue = [1, 1, 1];
+      this.k = true;
+      this.x = true;
+      this.getValue = ExpressionManager.initiateExpression.bind(this)(elem, data, this);
+      this.getMult = getValueProxy;
+      this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
+      if (this.kf) {
+        this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
+      } else {
+        this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
+      }
+      this.setGroupProperty = expressionHelpers.setGroupProperty;
+    };
+  }());
+
+  var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
+  TextSelectorProp.getTextSelectorProp = function (elem, data, arr) {
+    if (data.t === 1) {
+      return new TextExpressionSelectorPropFactory(elem, data, arr); // eslint-disable-line no-undef
+    }
+    return propertyGetTextProp(elem, data, arr);
+  };
+}());
+
+/* global PropertyFactory */
+/* exported SliderEffect, AngleEffect, ColorEffect, PointEffect, LayerIndexEffect, MaskIndexEffect, CheckboxEffect, NoValueEffect */
+
+function SliderEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function AngleEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function ColorEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function PointEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function LayerIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function MaskIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function CheckboxEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function NoValueEffect() {
+  this.p = {};
 }
 
-function GroupEffect(data,element){
-    this.init(data,element);
+/* global extendPrototype, SliderEffect, AngleEffect, ColorEffect, PointEffect, CheckboxEffect, LayerIndexEffect,
+MaskIndexEffect, NoValueEffect, DynamicPropertyContainer */
+
+function EffectsManager(data, element) {
+  var effects = data.ef || [];
+  this.effectElements = [];
+  var i;
+  var len = effects.length;
+  var effectItem;
+  for (i = 0; i < len; i += 1) {
+    effectItem = new GroupEffect(effects[i], element);
+    this.effectElements.push(effectItem);
+  }
+}
+
+function GroupEffect(data, element) {
+  this.init(data, element);
 }
 
 extendPrototype([DynamicPropertyContainer], GroupEffect);
 
 GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
 
-GroupEffect.prototype.init = function(data,element){
-    this.data = data;
-    this.effectElements = [];
-    this.initDynamicPropertyContainer(element);
-    var i, len = this.data.ef.length;
-    var eff, effects = this.data.ef;
-    for(i=0;i<len;i+=1){
-        eff = null;
-        switch(effects[i].ty){
-            case 0:
-                eff = new SliderEffect(effects[i],element,this);
-                break;
-            case 1:
-                eff = new AngleEffect(effects[i],element,this);
-                break;
-            case 2:
-                eff = new ColorEffect(effects[i],element,this);
-                break;
-            case 3:
-                eff = new PointEffect(effects[i],element,this);
-                break;
-            case 4:
-            case 7:
-                eff = new CheckboxEffect(effects[i],element,this);
-                break;
-            case 10:
-                eff = new LayerIndexEffect(effects[i],element,this);
-                break;
-            case 11:
-                eff = new MaskIndexEffect(effects[i],element,this);
-                break;
-            case 5:
-                eff = new EffectsManager(effects[i],element,this);
-                break;
-            //case 6:
-            default:
-                eff = new NoValueEffect(effects[i],element,this);
-                break;
-        }
-        if(eff) {
-            this.effectElements.push(eff);
-        }
+GroupEffect.prototype.init = function (data, element) {
+  this.data = data;
+  this.effectElements = [];
+  this.initDynamicPropertyContainer(element);
+  var i;
+  var len = this.data.ef.length;
+  var eff;
+  var effects = this.data.ef;
+  for (i = 0; i < len; i += 1) {
+    eff = null;
+    switch (effects[i].ty) {
+      case 0:
+        eff = new SliderEffect(effects[i], element, this);
+        break;
+      case 1:
+        eff = new AngleEffect(effects[i], element, this);
+        break;
+      case 2:
+        eff = new ColorEffect(effects[i], element, this);
+        break;
+      case 3:
+        eff = new PointEffect(effects[i], element, this);
+        break;
+      case 4:
+      case 7:
+        eff = new CheckboxEffect(effects[i], element, this);
+        break;
+      case 10:
+        eff = new LayerIndexEffect(effects[i], element, this);
+        break;
+      case 11:
+        eff = new MaskIndexEffect(effects[i], element, this);
+        break;
+      case 5:
+        eff = new EffectsManager(effects[i], element, this);
+        break;
+        // case 6:
+      default:
+        eff = new NoValueEffect(effects[i], element, this);
+        break;
     }
+    if (eff) {
+      this.effectElements.push(eff);
+    }
+  }
 };
 
+
 var lottie = {};
 
-var _isFrozen = false;
-
-function setLocationHref (href) {
-    locationHref = href;
+function setLocationHref(href) {
+  locationHref = href;
 }
 
 function searchAnimations() {
-    if (standalone === true) {
-        animationManager.searchAnimations(animationData, standalone, renderer);
-    } else {
-        animationManager.searchAnimations();
-    }
+  if (standalone === true) {
+    animationManager.searchAnimations(animationData, standalone, renderer);
+  } else {
+    animationManager.searchAnimations();
+  }
 }
 
 function setSubframeRendering(flag) {
-    subframeEnabled = flag;
+  subframeEnabled = flag;
 }
 
 function loadAnimation(params) {
-    if (standalone === true) {
-        params.animationData = JSON.parse(animationData);
-    }
-    return animationManager.loadAnimation(params);
+  if (standalone === true) {
+    params.animationData = JSON.parse(animationData);
+  }
+  return animationManager.loadAnimation(params);
 }
 
 function setQuality(value) {
-    if (typeof value === 'string') {
-        switch (value) {
-            case 'high':
-                defaultCurveSegments = 200;
-                break;
-            case 'medium':
-                defaultCurveSegments = 50;
-                break;
-            case 'low':
-                defaultCurveSegments = 10;
-                break;
-        }
-    } else if (!isNaN(value) && value > 1) {
-        defaultCurveSegments = value;
+  if (typeof value === 'string') {
+    switch (value) {
+      case 'high':
+        defaultCurveSegments = 200;
+        break;
+      default:
+      case 'medium':
+        defaultCurveSegments = 50;
+        break;
+      case 'low':
+        defaultCurveSegments = 10;
+        break;
     }
-    if (defaultCurveSegments >= 50) {
-        roundValues(false);
-    } else {
-        roundValues(true);
-    }
+  } else if (!isNaN(value) && value > 1) {
+    defaultCurveSegments = value;
+  }
+  if (defaultCurveSegments >= 50) {
+    roundValues(false);
+  } else {
+    roundValues(true);
+  }
 }
 
 function inBrowser() {
-    return typeof navigator !== 'undefined';
+  return typeof navigator !== 'undefined';
 }
 
 function installPlugin(type, plugin) {
-    if (type === 'expressions') {
-        expressionsPlugin = plugin;
-    }
+  if (type === 'expressions') {
+    expressionsPlugin = plugin;
+  }
 }
 
 function getFactory(name) {
-    switch (name) {
-        case "propertyFactory":
-            return PropertyFactory;
-        case "shapePropertyFactory":
-            return ShapePropertyFactory;
-        case "matrix":
-            return Matrix;
-    }
+  switch (name) {
+    case 'propertyFactory':
+      return PropertyFactory;
+    case 'shapePropertyFactory':
+      return ShapePropertyFactory;
+    case 'matrix':
+      return Matrix;
+    default:
+      return null;
+  }
 }
 
 lottie.play = animationManager.play;
@@ -13722,7 +14538,7 @@
 lottie.loadAnimation = loadAnimation;
 lottie.setSubframeRendering = setSubframeRendering;
 lottie.resize = animationManager.resize;
-//lottie.start = start;
+// lottie.start = start;
 lottie.goToAndStop = animationManager.goToAndStop;
 lottie.destroy = animationManager.destroy;
 lottie.setQuality = setQuality;
@@ -13735,35 +14551,37 @@
 lottie.unmute = animationManager.unmute;
 lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
 lottie.__getFactory = getFactory;
-lottie.version = '5.7.5';
+lottie.version = '5.7.6';
 
 function checkReady() {
-    if (document.readyState === "complete") {
-        clearInterval(readyStateCheckInterval);
-        searchAnimations();
-    }
+  if (document.readyState === 'complete') {
+    clearInterval(readyStateCheckInterval);
+    searchAnimations();
+  }
 }
 
 function getQueryVariable(variable) {
-    var vars = queryString.split('&');
-    for (var i = 0; i < vars.length; i++) {
-        var pair = vars[i].split('=');
-        if (decodeURIComponent(pair[0]) == variable) {
-            return decodeURIComponent(pair[1]);
-        }
+  var vars = queryString.split('&');
+  for (var i = 0; i < vars.length; i += 1) {
+    var pair = vars[i].split('=');
+    if (decodeURIComponent(pair[0]) == variable) { // eslint-disable-line eqeqeq
+      return decodeURIComponent(pair[1]);
     }
+  }
+  return null;
 }
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
+var queryString;
 if (standalone) {
-    var scripts = document.getElementsByTagName('script');
-    var index = scripts.length - 1;
-    var myScript = scripts[index] || {
-        src: ''
-    };
-    var queryString = myScript.src.replace(/^[^\?]+\??/, '');
-    renderer = getQueryVariable('renderer');
+  var scripts = document.getElementsByTagName('script');
+  var index = scripts.length - 1;
+  var myScript = scripts[index] || {
+    src: '',
+  };
+  queryString = myScript.src.replace(/^[^\?]+\??/, ''); // eslint-disable-line no-useless-escape
+  renderer = getQueryVariable('renderer');
 }
 var readyStateCheckInterval = setInterval(checkReady, 100);
 
diff --git a/build/player/lottie_html.min.js b/build/player/lottie_html.min.js
index d0fc0e9..1f502ec 100644
--- a/build/player/lottie_html.min.js
+++ b/build/player/lottie_html.min.js
@@ -10,6 +10,6 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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"],i=e.length;for(t=0;t<i;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,i=createSizedArray(t.length),r=t.length;for(e=0;e<r;e+=1)i[e]=Math.abs(t[e]);return i}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,i,r){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=r<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,i,r){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=r<0?-1:1}function BMSegmentStartEvent(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e,this.currentTime=currentTime}roundValues(!1);var createElementID=(G=0,function(){return"__lottie_element_"+ ++G}),G;function HSVtoRGB(t,e,i){var r,s,a,n,o,h,l,p;switch(h=i*(1-e),l=i*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=i*(1-(1-o)*e),n%6){case 0:r=i,s=p,a=h;break;case 1:r=l,s=i,a=h;break;case 2:r=h,s=i,a=p;break;case 3:r=h,s=l,a=i;break;case 4:r=p,s=h,a=i;break;case 5:r=i,s=h,a=l}return[r,s,a]}function RGBtoHSV(t,e,i){var r,s=Math.max(t,e,i),a=Math.min(t,e,i),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:r=0;break;case t:r=e-i+n*(e<i?6:0),r/=6*n;break;case e:r=i-t+2*n,r/=6*n;break;case i:r=t-e+4*n,r/=6*n}return[r,o,h]}function addSaturationToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[1]+=e,1<i[1]?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[2]+=e,1<i[2]?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,1<i[0]?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t,e,r=[];for(t=0;t<256;t+=1)e=t.toString(16),r[t]=1==e.length?"0"+e:e;return function(t,e,i){return t<0&&(t=0),e<0&&(e=0),i<0&&(i=0),"#"+r[t]+r[e]+r[i]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t].length,r=0;r<i;r++)this._cbs[t][r](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var i=0,r=this._cbs[t].length;i<r;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,r-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var i,r=0,s=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(r=0;r<e;r+=1)s.push(i);return s};function createSizedArray(t){return Array.apply(null,{length:t})}function createNS(t){return document.createElementNS(svgNS,t)}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Pa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Pa[t]||""}),Pa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,r=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),i=a(t);return this._t(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1)}function i(t){if(0===t)return this;var e=s(t),i=a(t);return this._t(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),i=a(t);return this._t(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),i=a(t);return this._t(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var i=s(e),r=a(e);return this._t(i,r,0,0,-r,i,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(i,-r,0,0,r,i,0,0,0,0,1,0,0,0,0,1)}function m(t,e,i){return i||0===i||(i=1),1===t&&1===e&&1===i?this:this._t(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)}function c(t,e,i,r,s,a,n,o,h,l,p,f,m,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=i,this.props[3]=r,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,i){return i=i||0,0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}function u(t,e,i,r,s,a,n,o,h,l,p,f,m,c,d,u){var y=this.props;if(1===t&&0===e&&0===i&&0===r&&0===s&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===f)return y[12]=y[12]*t+y[15]*m,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*p+y[15]*d,y[15]=y[15]*u,this._identityCalculated=!1,this;var g=y[0],v=y[1],b=y[2],P=y[3],E=y[4],x=y[5],S=y[6],_=y[7],A=y[8],T=y[9],k=y[10],M=y[11],C=y[12],D=y[13],F=y[14],I=y[15];return y[0]=g*t+v*s+b*h+P*m,y[1]=g*e+v*a+b*l+P*c,y[2]=g*i+v*n+b*p+P*d,y[3]=g*r+v*o+b*f+P*u,y[4]=E*t+x*s+S*h+_*m,y[5]=E*e+x*a+S*l+_*c,y[6]=E*i+x*n+S*p+_*d,y[7]=E*r+x*o+S*f+_*u,y[8]=A*t+T*s+k*h+M*m,y[9]=A*e+T*a+k*l+M*c,y[10]=A*i+T*n+k*p+M*d,y[11]=A*r+T*o+k*f+M*u,y[12]=C*t+D*s+F*h+I*m,y[13]=C*e+D*a+F*l+I*c,y[14]=C*i+D*n+F*p+I*d,y[15]=C*r+D*o+F*f+I*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function P(t,e,i){return{x:t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}}function E(t,e,i){return t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12]}function x(t,e,i){return t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13]}function S(t,e,i){return t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}function _(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,i=-this.props[1]/t,r=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=i,o.props[4]=r,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function A(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function T(t){var e,i=t.length,r=[];for(e=0;e<i;e+=1)r[e]=A(t[e]);return r}function k(t,e,i){var r=createTypedArray("float32",6);if(this.isIdentity())r[0]=t[0],r[1]=t[1],r[2]=e[0],r[3]=e[1],r[4]=i[0],r[5]=i[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];r[0]=t[0]*s+t[1]*n+h,r[1]=t[0]*a+t[1]*o+l,r[2]=e[0]*s+e[1]*n+h,r[3]=e[0]*a+e[1]*o+l,r[4]=i[0]*s+i[1]*n+h,r[5]=i[0]*a+i[1]*o+l}return r}function M(t,e,i){return this.isIdentity()?[t,e,i]:[t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]]}function C(t,e){if(this.isIdentity())return t+","+e;var i=this.props;return Math.round(100*(t*i[0]+e*i[4]+i[12]))/100+","+Math.round(100*(t*i[1]+e*i[5]+i[13]))/100}function D(){for(var t=0,e=this.props,i="matrix3d(";t<16;)i+=r(1e4*e[t])/1e4,i+=15===t?")":",",t+=1;return i}function F(t){return t<1e-6&&0<t||-1e-6<t&&t<0?r(1e4*t)/1e4:t}function I(){var t=this.props;return"matrix("+F(t[0])+","+F(t[1])+","+F(t[4])+","+F(t[5])+","+F(t[12])+","+F(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=i,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=P,this.applyToX=E,this.applyToY=x,this.applyToZ=S,this.applyToPointArray=M,this.applyToTriplePoints=k,this.applyToPointStringified=C,this.toCSS=D,this.to2dCSS=I,this.clone=v,this.cloneFromProps=b,this.equals=g,this.inversePoints=T,this.inversePoint=A,this.getInverseMatrix=_,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var l,p=this,f=256,m=6,c="random",d=h.pow(f,m),u=h.pow(2,52),y=2*u,g=f-1;function v(t){var e,i=t.length,n=this,r=0,s=n.i=n.j=0,a=n.S=[];for(i||(t=[i++]);r<f;)a[r]=r++;for(r=0;r<f;r++)a[r]=a[s=g&s+t[r%i]+(e=a[r])],a[s]=e;n.g=function(t){for(var e,i=0,r=n.i,s=n.j,a=n.S;t--;)e=a[r=g&r+1],i=i*f+a[g&(a[r]=a[s=g&s+e])+(a[s]=e)];return n.i=r,n.j=s,i}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function P(t,e){for(var i,r=t+"",s=0;s<r.length;)e[g&s]=g&(i^=19*e[g&s])+r.charCodeAt(s++);return E(e)}function E(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,i){var r=[],s=P(function t(e,i){var r,s=[],a=typeof e;if(i&&"object"==a)for(r in e)try{s.push(t(e[r],i-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,E(o)]:null===t?function(){try{if(l)return E(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),E(t)}catch(t){var e=p.navigator,i=e&&e.plugins;return[+new Date,p,i,p.screen,E(o)]}}():t,3),r),a=new v(r),n=function(){for(var t=a.g(m),e=d,i=0;t<u;)t=(t+i)*f,e*=f,i=a.g(1);for(;y<=t;)t/=2,e/=2,i>>>=1;return(t+i)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,P(E(a.S),o),(e.pass||i||function(t,e,i,r){return r&&(r.S&&b(r,a),t.state=function(){return b(a,{})}),i?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},P(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,i,r,s){var a=s||("bez_"+t+"_"+e+"_"+i+"_"+r).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,i,r]);return o[a]=n}},o={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function r(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function f(t,e,i){return((r(e,i)*t+s(e,i))*t+a(e))*t}function m(t,e,i){return 3*r(e,i)*t*t+2*s(e,i)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],i=this._p[1],r=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===i&&r===s?t:0===t?0:1===t?1:f(this._getTForX(t),i,s)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],r=this._p[3];this._precomputed=!0,t===e&&i===r||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],i=0;i<l;++i)this._mSampleValues[i]=f(i*p,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],r=this._mSampleValues,s=0,a=1,n=l-1;a!==n&&r[a]<=t;++a)s+=p;var o=s+(t-r[--a])/(r[a+1]-r[a])*p,h=m(o,e,i);return.001<=h?function(t,e,i,r){for(var s=0;s<4;++s){var a=m(e,i,r);if(0===a)return e;e-=(f(e,i,r)-t)/a}return e}(t,o,e,i):0===h?o:function(t,e,i,r,s){for(var a,n,o=0;0<(a=f(n=e+(i-e)/2,r,s)-t)?i=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+p,e,i)}},t}();function extendPrototype(t,e){var i,r,s=t.length;for(i=0;i<s;i+=1)for(var a in r=t[i].prototype)r.hasOwnProperty(a)&&(e.prototype[a]=r[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){Math;function y(t,e,i,r,s,a){var n=t*r+e*s+i*a-s*r-a*t-i*e;return-.001<n&&n<.001}var p=function(t,e,i,r){var s,a,n,o,h,l,p=defaultCurveSegments,f=0,m=[],c=[],d=bezier_length_pool.newElement();for(n=i.length,s=0;s<p;s+=1){for(h=s/(p-1),a=l=0;a<n;a+=1)o=bm_pow(1-h,3)*t[a]+3*bm_pow(1-h,2)*h*i[a]+3*(1-h)*bm_pow(h,2)*r[a]+bm_pow(h,3)*e[a],m[a]=o,null!==c[a]&&(l+=bm_pow(m[a]-c[a],2)),c[a]=m[a];l&&(f+=l=bm_sqrt(l)),d.percents[s]=h,d.lengths[s]=f}return d.addedLength=f,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,i,r){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+i[0]+"_"+i[1]+"_"+r[0]+"_"+r[1]).replace(/\./g,"p");if(!b[s]){var a,n,o,h,l,p,f,m=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&y(t[0],t[1],e[0],e[1],t[0]+i[0],t[1]+i[1])&&y(t[0],t[1],e[0],e[1],e[0]+r[0],e[1]+r[1])&&(m=2);var u=new g(m);for(o=i.length,a=0;a<m;a+=1){for(f=createSizedArray(o),l=a/(m-1),n=p=0;n<o;n+=1)h=bm_pow(1-l,3)*t[n]+3*bm_pow(1-l,2)*l*(t[n]+i[n])+3*(1-l)*bm_pow(l,2)*(e[n]+r[n])+bm_pow(l,3)*e[n],f[n]=h,null!==d&&(p+=bm_pow(f[n]-d[n],2));c+=p=bm_sqrt(p),u.points[a]=new v(p,f),d=f}u.segmentLength=c,b[s]=u}return b[s]});function C(t,e){var i=e.percents,r=e.lengths,s=i.length,a=bm_floor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===r[a])return i[a];for(var h=r[a]>n?-1:1,l=!0;l;)if(r[a]<=n&&r[a+1]>n?(o=(n-r[a])/(r[a+1]-r[a]),l=!1):a+=h,a<0||s-1<=a){if(a===s-1)return i[a];l=!1}return i[a]+(i[a+1]-i[a])*o}var D=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,i=segments_length_pool.newElement(),r=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=i.lengths,l=0;for(e=0;e<o-1;e+=1)h[e]=p(s[e],s[e+1],a[e],n[e+1]),l+=h[e].addedLength;return r&&o&&(h[e]=p(s[e],s[0],a[e],n[0]),l+=h[e].addedLength),i.totalLength=l,i},getNewSegment:function(t,e,i,r,s,a,n){var o,h=C(s=s<0?0:1<s?1:s,n),l=C(a=1<a?1:a,n),p=t.length,f=1-h,m=1-l,c=f*f*f,d=h*f*f*3,u=h*h*f*3,y=h*h*h,g=f*f*m,v=h*f*m+f*h*m+f*f*l,b=h*h*m+f*h*l+h*f*l,P=h*h*l,E=f*m*m,x=h*m*m+f*l*m+f*m*l,S=h*l*m+f*l*l+h*m*l,_=h*l*l,A=m*m*m,T=l*m*m+m*l*m+m*m*l,k=l*l*m+m*l*l+l*m*l,M=l*l*l;for(o=0;o<p;o+=1)D[4*o]=Math.round(1e3*(c*t[o]+d*i[o]+u*r[o]+y*e[o]))/1e3,D[4*o+1]=Math.round(1e3*(g*t[o]+v*i[o]+b*r[o]+P*e[o]))/1e3,D[4*o+2]=Math.round(1e3*(E*t[o]+x*i[o]+S*r[o]+_*e[o]))/1e3,D[4*o+3]=Math.round(1e3*(A*t[o]+T*i[o]+k*r[o]+M*e[o]))/1e3;return D},getPointInSegment:function(t,e,i,r,s,a){var n=C(s,a),o=1-n;return[Math.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*i[0]+(n*n*o+o*n*n+n*o*n)*r[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*i[1]+(n*n*o+o*n*n+n*o*n)*r[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,i,r,s,a,n,o,h){if(0===i&&0===a&&0===h)return y(t,e,r,s,n,o);var l,p=Math.sqrt(Math.pow(r-t,2)+Math.pow(s-e,2)+Math.pow(a-i,2)),f=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-i,2)),m=Math.sqrt(Math.pow(n-r,2)+Math.pow(o-s,2)+Math.pow(h-a,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var i=(new Date).getTime(),r=Math.max(0,16-(i-a)),s=setTimeout(function(){t(i+r)},r);return a=i+r,s}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function f(t,e,i){var r,s,a,n,o,h,l=t.length;for(s=0;s<l;s+=1)if("ks"in(r=t[s])&&!r.completed){if(r.completed=!0,r.tt&&(t[s-1].td=r.tt),[],-1,r.hasMask){var p=r.masksProperties;for(n=p.length,a=0;a<n;a+=1)if(p[a].pt.k.i)d(p[a].pt.k);else for(h=p[a].pt.k.length,o=0;o<h;o+=1)p[a].pt.k[o].s&&d(p[a].pt.k[o].s[0]),p[a].pt.k[o].e&&d(p[a].pt.k[o].e[0])}0===r.ty?(r.layers=m(r.refId,e),f(r.layers,e,i)):4===r.ty?c(r.shapes):5==r.ty&&u(r,i)}}function m(t,e){for(var i=0,r=e.length;i<r;){if(e[i].id===t)return e[i].layers.__used?JSON.parse(JSON.stringify(e[i].layers)):(e[i].layers.__used=!0,e[i].layers);i+=1}}function c(t){var e,i,r;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)d(t[e].ks.k);else for(r=t[e].ks.k.length,i=0;i<r;i+=1)t[e].ks.k[i].s&&d(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&d(t[e].ks.k[i].e[0]);!0}else"gr"==t[e].ty&&c(t[e].it)}function d(t){var e,i=t.i.length;for(e=0;e<i;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var i=e?e.split("."):[100,100,100];return t[0]>i[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&void 0))}var h,i=function(){var r=[4,4,14];function s(t){var e,i,r,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(i=t[e],void 0,r=i.t.d,i.t.d={k:[{s:r,t:0}]})}return function(t){if(o(r,t.v)&&(s(t.layers),t.assets)){var e,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),r=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,i,r,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(r=(a=t.chars[e].data.shapes[0].it).length,i=0;i<r;i+=1)(s=a[i].ks.k).__converted||(d(a[i].ks.k),s.__converted=!0)}}),s=function(){var r=[4,1,9];function a(t){var e,i,r,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(r=t[e].c.k.length,i=0;i<r;i+=1)t[e].c.k[i].s&&(t[e].c.k[i].s[0]/=255,t[e].c.k[i].s[1]/=255,t[e].c.k[i].s[2]/=255,t[e].c.k[i].s[3]/=255),t[e].c.k[i].e&&(t[e].c.k[i].e[0]/=255,t[e].c.k[i].e[1]/=255,t[e].c.k[i].e[2]/=255,t[e].c.k[i].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,i=t.length;for(e=0;e<i;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(r,t.v)&&(s(t.layers),t.assets)){var e,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var r=[4,4,18];function l(t){var e,i,r;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(r=t[e].ks.k.length,i=0;i<r;i+=1)t[e].ks.k[i].s&&(t[e].ks.k[i].s[0].c=t[e].closed),t[e].ks.k[i].e&&(t[e].ks.k[i].e[0].c=t[e].closed);!0}else"gr"==t[e].ty&&l(t[e].it)}function s(t){var e,i,r,s,a,n,o=t.length;for(i=0;i<o;i+=1){if((e=t[i]).hasMask){var h=e.masksProperties;for(s=h.length,r=0;r<s;r+=1)if(h[r].pt.k.i)h[r].pt.k.c=h[r].cl;else for(n=h[r].pt.k.length,a=0;a<n;a+=1)h[r].pt.k[a].s&&(h[r].pt.k[a].s[0].c=h[r].cl),h[r].pt.k[a].e&&(h[r].pt.k[a].e[0].c=h[r].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(o(r,t.v)&&(s(t.layers),t.assets)){var e,i=t.assets.length;for(e=0;e<i;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t,e){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),i(t),r(t),a(t),f(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=r,t.checkShapes=a,t.completeLayers=f,t}var dataManager=dataFunctionManager(),FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function u(t,e){var i=createTag("span");i.style.fontFamily=e;var r=createTag("span");r.innerText="giItT1WQy@!-/#",i.style.position="absolute",i.style.left="-10000px",i.style.top="-10000px",i.style.fontSize="300px",i.style.fontVariant="normal",i.style.fontStyle="normal",i.style.fontWeight="normal",i.style.letterSpacing="0",i.appendChild(r),document.body.appendChild(i);var s=r.offsetWidth;return r.style.fontFamily=function(t){var e,i=t.split(","),r=i.length,s=[];for(e=0;e<r;e+=1)"sans-serif"!==i[e]&&"monospace"!==i[e]&&s.push(i[e]);return s.join(",")}(t)+", "+e,{node:r,w:s,parent:i}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){this.chars||(this.chars=[]);var e,i,r,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(i=0,r=!1;i<a;)this.chars[i].style===t[e].style&&this.chars[i].fFamily===t[e].fFamily&&this.chars[i].ch===t[e].ch&&(r=!0),i+=1;r||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var i,r,s,a,n=t.list,o=n.length,h=o;for(i=0;i<o;i+=1){var l,p,f=!0;if(n[i].loaded=!1,n[i].monoCase=u(n[i].fFamily,"monospace"),n[i].sansCase=u(n[i].fFamily,"sans-serif"),n[i].fPath){if("p"===n[i].fOrigin||3===n[i].origin){if(0<(l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[i].fFamily+'"], style[f-origin="3"][f-family="'+n[i].fFamily+'"]')).length&&(f=!1),f){var m=createTag("style");m.setAttribute("f-forigin",n[i].fOrigin),m.setAttribute("f-origin",n[i].origin),m.setAttribute("f-family",n[i].fFamily),m.type="text/css",m.innerText="@font-face {font-family: "+n[i].fFamily+"; font-style: normal; src: url('"+n[i].fPath+"');}",e.appendChild(m)}}else if("g"===n[i].fOrigin||1===n[i].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),p=0;p<l.length;p++)-1!==l[p].href.indexOf(n[i].fPath)&&(f=!1);if(f){var c=createTag("link");c.setAttribute("f-forigin",n[i].fOrigin),c.setAttribute("f-origin",n[i].origin),c.type="text/css",c.rel="stylesheet",c.href=n[i].fPath,document.body.appendChild(c)}}else if("t"===n[i].fOrigin||2===n[i].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),p=0;p<l.length;p++)n[i].fPath===l[p].src&&(f=!1);if(f){var d=createTag("link");d.setAttribute("f-forigin",n[i].fOrigin),d.setAttribute("f-origin",n[i].origin),d.setAttribute("rel","stylesheet"),d.setAttribute("href",n[i].fPath),e.appendChild(d)}}}else n[i].loaded=!0,h-=1;n[i].helper=(r=e,s=n[i],a=void 0,(a=createNS("text")).style.fontSize="100px",a.setAttribute("font-family",s.fFamily),a.setAttribute("font-style",s.fStyle),a.setAttribute("font-weight",s.fWeight),a.textContent="1",s.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",s.fClass)):a.style.fontFamily=s.fFamily,r.appendChild(a),createTag("canvas").getContext("2d").font=s.fWeight+" "+s.fStyle+" 100px "+s.fFamily,a),n[i].cache={},this.fonts.push(n[i])}0===h?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,i){for(var r=0,s=this.chars.length;r<s;){if(this.chars[r].ch===t&&this.chars[r].style===e&&this.chars[r].fFamily===i)return this.chars[r];r+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,i)),a},getFontByName:function(t){for(var e=0,i=this.fonts.length;e<i;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,i){var r=this.getFontByName(e),s=t.charCodeAt(0);if(!r.cache[s+1]){var a=r.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();r.cache[s+1]=(n-o)/100}else a.textContent=t,r.cache[s+1]=a.getComputedTextLength()/100}return r.cache[s+1]*i},checkLoadedFonts:function(){var t,e,i,r=this.fonts.length,s=r;for(t=0;t<r;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,i=this.fonts[t].monoCase.w,e.offsetWidth!==i?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,i=this.fonts[t].sansCase.w,e.offsetWidth!==i&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),PropertyFactory=function(){var f=initialDefaultFrame,s=Math.abs;function m(t,e){var i,r=this.offsetTime;"multidimensional"===this.propType&&(i=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,l,p,f,m=e.lastIndex,c=m,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-r){s.h&&(s=a),m=0;break}if(a.t-r>t){m=c;break}c<d-1?c+=1:(m=0,u=!1)}var y,g,v,b,P,E,x,S,_,A,T=a.t-r,k=s.t-r;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var M=s.bezierData;if(T<=t||t<k){var C=T<=t?M.points.length-1:0;for(o=M.points[C].point.length,n=0;n<o;n+=1)i[n]=M.points[C].point[n]}else{s.__fnct?f=s.__fnct:(f=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=f),h=f((t-k)/(T-k));var D,F=M.segmentLength*h,I=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,l=M.points.length;u;){if(I+=M.points[p].partialLength,0===F||0===h||p===M.points.length-1){for(o=M.points[p].point.length,n=0;n<o;n+=1)i[n]=M.points[p].point[n];break}if(I<=F&&F<I+M.points[p+1].partialLength){for(D=(F-I)/M.points[p+1].partialLength,o=M.points[p].point.length,n=0;n<o;n+=1)i[n]=M.points[p].point[n]+(M.points[p+1].point[n]-M.points[p].point[n])*D;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=I-M.points[p].partialLength,e._lastKeyframeIndex=c}}else{var w,B,V,R,G;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(T<=t)i[0]=y[0],i[1]=y[1],i[2]=y[2];else if(t<=k)i[0]=s.s[0],i[1]=s.s[1],i[2]=s.s[2];else{var L=N(s.s),z=N(y);g=i,v=function(t,e,i){var r,s,a,n,o,h=[],l=t[0],p=t[1],f=t[2],m=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=l*c+p*d+f*u+m*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(r=Math.acos(s),a=Math.sin(r),n=Math.sin((1-i)*r)/a,Math.sin(i*r)/a):(n=1-i,i);return h[0]=n*l+o*c,h[1]=n*p+o*d,h[2]=n*f+o*u,h[3]=n*m+o*y,h}(L,z,(t-k)/(T-k)),b=v[0],P=v[1],E=v[2],x=v[3],S=Math.atan2(2*P*x-2*b*E,1-2*P*P-2*E*E),_=Math.asin(2*b*P+2*E*x),A=Math.atan2(2*b*x-2*P*E,1-2*b*b-2*E*E),g[0]=S/degToRads,g[1]=_/degToRads,g[2]=A/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=T<=t?1:t<k?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?f=s.__fnct[c]:(w=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],B=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],V=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],R=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],f=BezierFactory.getBezierEasing(w,B,V,R).get,s.__fnct[c]=f)):s.__fnct?f=s.__fnct:(w=s.o.x,B=s.o.y,V=s.i.x,R=s.i.y,f=BezierFactory.getBezierEasing(w,B,V,R).get,s.__fnct=f),f((t-k)/(T-k)))),y=a.s||s.e,G=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?i[c]=G:i=G}return e.lastIndex=m,i}function N(t){var e=t[0]*degToRads,i=t[1]*degToRads,r=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(r/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(r/2);return[o*h*n+s*a*l,o*a*n+s*h*l,s*h*n-o*a*l,s*a*n-o*h*l]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=i&&i<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(t,this._caching);this.pv=r}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var i=0,r=this.v.length;i<r;)e=t[i]*this.mult,1e-5<s(this.v[i]-e)&&(this.v[i]=e,this._mdf=!0),i+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,i,r){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,i,r){this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,a=e.k.length;this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a);createTypedArray("float32",a);for(this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,i,r){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=r,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=m,this.effectsSequence=[c.bind(this)],this.addEffect=y}function l(t,e,i,r){this.propType="multidimensional";var s,a,n,o,h,l=e.k.length;for(s=0;s<l-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=r,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=createTypedArray("float32",p),this.pv=createTypedArray("float32",p),s=0;s<p;s+=1)this.v[s]=f,this.pv[s]=f;this._caching={lastFrame:f,lastIndex:0,value:createTypedArray("float32",p)},this.addEffect=y}return{getProp:function(t,e,i,r,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,r,s);else switch(i){case 0:a=new h(t,e,r,s);break;case 1:a=new l(t,e,r,s)}else a=new n(t,e,r,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function r(t,e,i){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(i||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var r,s=e.or.k.length;for(r=0;r<s;r+=1)e.or.k[r].to=e.or.k[r].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return r.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,i,r=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/r,0),this.p.getValueAtTime(this.p.keyframes[0].t/r,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/r,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/r,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/r,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(e[0]=s.getValueAtTime((s.keyframes[0].t+.01)/r,0),e[1]=a.getValueAtTime((a.keyframes[0].t+.01)/r,0),i[0]=s.getValueAtTime(s.keyframes[0].t/r,0),i[1]=a.getValueAtTime(a.keyframes[0].t/r,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(e[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/r,0),e[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/r,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/r,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/r,0)):(e=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/r,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/r,a.offsetTime))}else e=i=n;this.v.rotate(-Math.atan2(e[1]-i[1],e[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],r),r.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},r.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,i){return new r(t,e,i)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=point_pool.newElement(),this.o[i]=point_pool.newElement(),this.i[i]=point_pool.newElement(),i+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,i,r,s){var a;switch(this._length=Math.max(this._length,r+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}(!a[r]||a[r]&&!s)&&(a[r]=point_pool.newElement()),a[r][0]=t,a[r][1]=e},ShapePath.prototype.setTripleAt=function(t,e,i,r,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(i,r,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,r=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],r[0][0],r[0][1],i[0][0],i[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],r[n][0],r[n][1],i[n][0],i[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,i){var r,s,a,n,o,h,l,p,f,m=i.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)r=c[0].s[0],a=!0,m=0;else if(t>=c[c.length-1].t-this.offsetTime)r=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=m,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(m=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<d.t-this.offsetTime)p=0;else{var b;d.__fnct?b=d.__fnct:(b=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=b),p=b((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}r=d.s[0]}for(h=e._length,l=r.i[0].length,i.lastIndex=m,n=0;n<h;n+=1)for(o=0;o<l;o+=1)f=a?r.i[n][o]:r.i[n][o]+(s.i[n][o]-r.i[n][o])*p,e.i[n][o]=f,f=a?r.o[n][o]:r.o[n][o]+(s.o[n][o]-r.o[n][o])*p,e.o[n][o]=f,f=a?r.v[n][o]:r.v[n][o]+(s.v[n][o]-r.v[n][o])*p,e.v[n][o]=f}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var i,r=t._length;for(i=0;i<r;i+=1)if(t.v[i][0]!==e.v[i][0]||t.v[i][1]!==e.v[i][1]||t.o[i][0]!==e.o[i][0]||t.o[i][1]!==e.o[i][1]||t.i[i][0]!==e.i[i][0]||t.i[i][1]!==e.i[i][1])return!1;return!0})(this.v,t)||(this.v=shape_pool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function i(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,i=this.effectsSequence.length;for(t=0;t<i;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,i){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var r=3===i?e.pt.k:e.ks.k;this.v=shape_pool.clone(r),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function r(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,i){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===i?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var r=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=shape_pool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,r),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime,r=this._caching.lastFrame;return r!==s&&(r<e&&t<e||i<r&&i<t)||(this._caching.lastIndex=r<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=i,n.prototype.setVValue=e,n.prototype.addEffect=r,o.prototype.getValue=i,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=r;var h=function(){var n=roundCorner;function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,r=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-r,a.v[1][0]=s?t+i:t-i,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+r,a.v[3][0]=s?t-i:t+i,a.v[3][1]=e,a.i[0][0]=s?t-i*n:t+i*n,a.i[0][1]=e-r,a.i[1][0]=s?t+i:t-i,a.i[1][1]=e-r*n,a.i[2][0]=s?t+i*n:t-i*n,a.i[2][1]=e+r,a.i[3][0]=s?t-i:t+i,a.i[3][1]=e+r*n,a.o[0][0]=s?t+i*n:t-i*n,a.o[0][1]=e-r,a.o[1][0]=s?t+i:t-i,a.o[1][1]=e+r*n,a.o[2][0]=s?t-i*n:t+i*n,a.o[2][1]=e+r,a.o[3][0]=s?t-i:t+i,a.o[3][1]=e-r*n}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,i,r,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*o/(2*s),m=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){i=n?l:p,r=n?f:m;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*r*i*d,y-v*r*i*d,u+g*r*i*d,y+v*r*i*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),i=2*Math.PI/e,r=this.or.v,s=this.os.v,a=2*Math.PI*r/(4*e),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=r*Math.cos(n),l=r*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),f=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*s*o,l-f*a*s*o,h+p*a*s*o,l+f*a*s*o,t,!0),n+=i*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,r=this.s.v[1]/2,s=bm_min(i,r,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+i,e-r+s,t+i,e-r+s,t+i,e-r+a,0,!0),this.v.setTripleAt(t+i,e+r-s,t+i,e+r-a,t+i,e+r-s,1,!0),0!==s?(this.v.setTripleAt(t+i-s,e+r,t+i-s,e+r,t+i-a,e+r,2,!0),this.v.setTripleAt(t-i+s,e+r,t-i+a,e+r,t-i+s,e+r,3,!0),this.v.setTripleAt(t-i,e+r-s,t-i,e+r-s,t-i,e+r-a,4,!0),this.v.setTripleAt(t-i,e-r+s,t-i,e-r+a,t-i,e-r+s,5,!0),this.v.setTripleAt(t-i+s,e-r,t-i+s,e-r,t-i+a,e-r,6,!0),this.v.setTripleAt(t+i-s,e-r,t+i-a,e-r,t+i-s,e-r,7,!0)):(this.v.setTripleAt(t-i,e+r,t-i+a,e+r,t-i,e+r,2),this.v.setTripleAt(t-i,e-r,t-i,e-r+a,t-i,e-r,3))):(this.v.setTripleAt(t+i,e-r+s,t+i,e-r+a,t+i,e-r+s,0,!0),0!==s?(this.v.setTripleAt(t+i-s,e-r,t+i-s,e-r,t+i-a,e-r,1,!0),this.v.setTripleAt(t-i+s,e-r,t-i+a,e-r,t-i+s,e-r,2,!0),this.v.setTripleAt(t-i,e-r+s,t-i,e-r+s,t-i,e-r+a,3,!0),this.v.setTripleAt(t-i,e+r-s,t-i,e+r-a,t-i,e+r-s,4,!0),this.v.setTripleAt(t-i+s,e+r,t-i+s,e+r,t-i+a,e+r,5,!0),this.v.setTripleAt(t+i-s,e+r,t+i-a,e+r,t+i-s,e+r,6,!0),this.v.setTripleAt(t+i,e+r-s,t+i,e+r-s,t+i,e+r-a,7,!0)):(this.v.setTripleAt(t-i,e-r,t-i+a,e-r,t-i,e-r,1,!0),this.v.setTripleAt(t-i,e+r,t-i,e+r-a,t-i,e+r,2,!0),this.v.setTripleAt(t+i,e+r,t+i-a,e+r,t+i,e+r,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var f={getShapeProp:function(t,e,i){var r;return 3===i||4===i?r=(3===i?e.pt:e.ks).k.length?new o(t,e,i):new n(t,e,i):5===i?r=new p(t,e):6===i?r=new h(t,e):7===i&&(r=new l(t,e)),r.k&&t.addDynamicProperty(r),r},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return f}(),ShapeModifiers=(fs={},gs={},fs.registerModifier=function(t,e){gs[t]||(gs[t]=e)},fs.getModifier=function(t,e,i){return new gs[t](e,i)},fs),fs,gs;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,i,r){this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=i,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(r);var s,a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,i){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var r=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",r),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=r,this.initDynamicPropertyContainer(i),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollection_pool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,r,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;n<l;n+=1){var p,f;if((o=a[n]).e*s<r||o.s*s>r+i);else p=o.s*s<=r?0:(o.s*s-r)/i,f=o.e*s>=r+i?1:(o.e*s-r)/i,h.push([p,f])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e<i;e+=1)segments_length_pool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,i,r;if(this._mdf||t){var s=this.o.v%360/360;if(s<0&&(s+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+s,(i=(1<this.e.v?1:this.e.v<0?0:this.e.v)+s)<e){var a=e;e=i,i=a}e=1e-4*Math.round(1e4*e),i=1e-4*Math.round(1e4*i),this.sValue=e,this.eValue=i}else e=this.sValue,i=this.eValue;var n,o,h,l,p,f,m=this.shapes.length,c=0;if(i===e)for(n=0;n<m;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===i&&0===e||0===i&&1===e){if(this._mdf)for(n=0;n<m;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var d,u,y=[];for(n=0;n<m;n+=1)if((d=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(h=(r=d.shape.paths)._length,f=0,!d.shape._mdf&&d.pathsData.length)f=d.totalShapeLength;else{for(l=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)p=bez.getSegmentsLength(r.shapes[o]),l.push(p),f+=p.totalLength;d.totalShapeLength=f,d.pathsData=l}c+=f,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,b=i,P=0;for(n=m-1;0<=n;n-=1)if((d=this.shapes[n]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<m?(g=this.calculateShapeEdges(e,i,d.totalShapeLength,P,c),P+=d.totalShapeLength):g=[[v,b]],h=g.length,o=0;o<h;o+=1){v=g[o][0],b=g[o][1],y.length=0,b<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*b}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(b-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(b-1)}));var E=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var x=E.pop();this.addPaths(E,u),E=this.addShapes(d,y[1],x)}else this.addPaths(E,u),E=this.addShapes(d,y[1]);this.addPaths(E,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)e.addShape(t[i])},TrimModifier.prototype.addSegment=function(t,e,i,r,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(i[0],i[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(r[0],r[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,i,r){e.setXYAt(t[1],t[5],"o",i),e.setXYAt(t[2],t[6],"i",i+1),r&&e.setXYAt(t[0],t[4],"v",i),e.setXYAt(t[3],t[7],"v",i+1)},TrimModifier.prototype.addShapes=function(t,e,i){var r,s,a,n,o,h,l,p,f=t.pathsData,m=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(p=i?(o=i._length,i._length):(i=shape_pool.newElement(),o=0),u.push(i),r=0;r<c;r+=1){for(h=f[r].lengths,i.c=m[r].c,a=m[r].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,i.c=!1;else{if(d>e.e){i.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(m[r].v[s-1],m[r].o[s-1],m[r].i[s],m[r].v[s],i,o,y),y=!1):(l=bez.getNewSegment(m[r].v[s-1],m[r].v[s],m[r].o[s-1],m[r].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,i,o,y),y=!1,i.c=!1),d+=n.addedLength,o+=1}if(m[r].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(m[r].v[s-1],m[r].o[s-1],m[r].i[0],m[r].v[0],i,o,y),y=!1):(l=bez.getNewSegment(m[r].v[s-1],m[r].v[0],m[r].o[s-1],m[r].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(l,i,o,y),y=!1,i.c=!1)}else i.c=!1;d+=n.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[p][0],i.v[p][1],"i",p),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),d>e.e)break;r<c-1&&(i=shape_pool.newElement(),y=!0,u.push(i),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var i=shape_pool.newElement();i.c=t.c;var r,s,a,n,o,h,l,p,f,m,c,d,u,y=t._length,g=0;for(r=0;r<y;r+=1)s=t.v[r],n=t.o[r],a=t.i[r],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==r&&r!==y-1||t.c?(o=0===r?t.v[y-1]:t.v[r-1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=d=s[0]+(o[0]-s[0])*l,f=u=s[1]-(s[1]-o[1])*l,m=p-(p-s[0])*roundCorner,c=f-(f-s[1])*roundCorner,i.setTripleAt(p,f,m,c,d,u,g),g+=1,o=r===y-1?t.v[0]:t.v[r+1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=m=s[0]+(o[0]-s[0])*l,f=c=s[1]+(o[1]-s[1])*l,d=p-(p-s[0])*roundCorner,u=f-(f-s[1])*roundCorner,i.setTripleAt(p,f,m,c,d,u,g)):i.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):i.setTripleAt(t.v[r][0],t.v[r][1],t.o[r][0],t.o[r][1],t.i[r][0],t.i[r][1],g),g+=1;return i},RoundCornersModifier.prototype.processShapes=function(t){var e,i,r,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(i=0;i<o;i+=1){if((a=this.shapes[i]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,r=0;r<s;r+=1)n.addShape(this.processPath(e[r],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var i=e/100,r=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)r[0]+=t.v[a][0],r[1]+=t.v[a][1];r[0]/=s,r[1]/=s;var n,o,h,l,p,f,m=shape_pool.newElement();for(m.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(r[0]-t.v[a][0])*i,o=t.v[a][1]+(r[1]-t.v[a][1])*i,h=t.o[a][0]+(r[0]-t.o[a][0])*-i,l=t.o[a][1]+(r[1]-t.o[a][1])*-i,p=t.i[a][0]+(r[0]-t.i[a][0])*-i,f=t.i[a][1]+(r[1]-t.i[a][1])*-i,m.setTripleAt(n,o,h,l,p,f,a);return m},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,i,r,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(i=0;i<o;i+=1){if((a=this.shapes[i]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,r=0;r<s;r+=1)n.addShape(this.processPath(e[r],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,i,r,s,a){var n=a?-1:1,o=r.s.v[0]+(1-r.s.v[0])*(1-s),h=r.s.v[1]+(1-r.s.v[1])*(1-s);t.translate(r.p.v[0]*n*s,r.p.v[1]*n*s,r.p.v[2]),e.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),e.rotate(-r.r.v*n*s),e.translate(r.a.v[0],r.a.v[1],r.a.v[2]),i.translate(-r.a.v[0],-r.a.v[1],r.a.v[2]),i.scale(a?1/o:o,a?1/h:h),i.translate(r.a.v[0],r.a.v[1],r.a.v[2])},RepeaterModifier.prototype.init=function(t,e,i,r){this.elem=t,this.arr=e,this.pos=i,this.elemsData=r,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[i]);for(;0<i;)i-=1,this._elements.unshift(e[i]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)t[i]._render=e,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,i,r,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(r=a=0;r<=this._groups.length-1;r+=1)n=a<o,this._groups[r]._render=n,this.changeGroupRender(this._groups[r].it,n),a+=1;this._currentCopies=o;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=(this.tr.v.props,this.pMatrix.props),c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<l){for(;g<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),g+=p)}else if(l<0){for(;f<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),g-=p)}for(r=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(i=(e=this.elemsData[r].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),0!==g){for((0!==r&&1===s||r!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),u=0;u<y;u+=1)i[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)i[u]=this.matrix.props[u];g+=1,a-=1,r+=s}}else for(a=this._currentCopies,r=0,s=1;a;)i=(e=this.elemsData[r].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,r+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shape_pool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,i=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<i;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var i=0,r=this.o.length/2;i<r;){if(.01<Math.abs(t[4*i]-t[4*e+2*i]))return!1;i+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,i,r,s=4*this.data.p;for(e=0;e<s;e+=1)i=e%4==0?100:255,r=Math.round(this.prop.v[e]*i),this.c[e]!==r&&(this.c[e]=r,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)i=e%2==0?100:1,r=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==r&&(this.o[e-4*this.data.p]=r,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,i,r){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+r.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+r.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+r.applyToPointStringified(n[s][0],n[s][1])+" "+r.applyToPointStringified(o[s][0],o[s][1]);return i&&e&&(h+=" C"+r.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+r.applyToPointStringified(n[0][0],n[0][1])+" "+r.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(t){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,i){var r="";if(t.e)r=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),r=e+s}else r=i,r+=t.u?t.u:"",r+=t.p;return r}function t(t){this._imageLoaded=e.bind(this),this.testImageLoaded=function(t){var e=0,i=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return t.prototype={loadAssets:function(t,e){this.imagesLoadedCb=e;var i,r=t.length;for(i=0;i<r;i+=1)t[i].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[i])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,i=this.images.length;e<i;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}},createImgData:function(t){var e=a(t,this.assetsPath,this.path),i=createTag("img");i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){r.img=s,this._imageLoaded()}.bind(this),!1),i.src=e;var r={img:i,assetData:t};return r},createImageData:function(t){var e=a(t,this.assetsPath,this.path),i=createNS("image");isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){r.img=s,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(i);var r={img:i,assetData:t};return r},imageLoaded:e,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},t}(),featureSupport=(Ax={maskType:!0},(/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))&&(Ax.maskType=!1),Ax),Ax,filtersFactory=(Bx={},Bx.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},Bx.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},Bx),Bx,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,i){var r,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)r=a(s),e(r);else try{r=a(s),e(r)}catch(t){i&&i(t)}}}}}();function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function TextAnimatorDataProperty(t,e,i){var r={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,i):r,rx:a.rx?s(t,a.rx,0,degToRads,i):r,ry:a.ry?s(t,a.ry,0,degToRads,i):r,sk:a.sk?s(t,a.sk,0,degToRads,i):r,sa:a.sa?s(t,a.sa,0,degToRads,i):r,s:a.s?s(t,a.s,1,.01,i):r,a:a.a?s(t,a.a,1,0,i):r,o:a.o?s(t,a.o,0,.01,i):r,p:a.p?s(t,a.p,1,0,i):r,sw:a.sw?s(t,a.sw,0,0,i):r,sc:a.sc?s(t,a.sc,1,0,i):r,fc:a.fc?s(t,a.fc,1,0,i):r,fh:a.fh?s(t,a.fh,0,0,i):r,fs:a.fs?s(t,a.fs,0,.01,i):r,fb:a.fb?s(t,a.fb,0,.01,i):r,t:a.t?s(t,a.t,0,0,i):r},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function LetterProps(t,e,i,r,s,a){this.o=t,this.sw=e,this.sc=i,this.fc=r,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!r,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,r=PropertyFactory.getProp;for(t=0;t<i;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:r(this._elem,this._textData.p.f,0,0,this),l:r(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=r(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var i,r,s,a,n,o,h,l,p,f,m,c,d,u,y,g,v,b,P,E=this._moreOptions.alignment.v,x=this._animatorsData,S=this._textData,_=this.mHelper,A=this._renderType,T=this.renderedLetters.length,k=(this.data,t.l);if(this._hasMaskedPath){if(P=this._pathData.m,!this._pathData.n||this._pathData._mdf){var M,C=P.v;for(this._pathData.r&&(C=C.reverse()),n={tLength:0,segments:[]},a=C._length-1,s=g=0;s<a;s+=1)M=bez.buildBezierData(C.v[s],C.v[s+1],[C.o[s][0]-C.v[s][0],C.o[s][1]-C.v[s][1]],[C.i[s+1][0]-C.v[s+1][0],C.i[s+1][1]-C.v[s+1][1]]),n.tLength+=M.segmentLength,n.segments.push(M),g+=M.segmentLength;s=a,P.v.c&&(M=bez.buildBezierData(C.v[s],C.v[0],[C.o[s][0]-C.v[s][0],C.o[s][1]-C.v[s][1]],[C.i[0][0]-C.v[0][0],C.i[0][1]-C.v[0][1]]),n.tLength+=M.segmentLength,n.segments.push(M),g+=M.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,f=1,p=!(l=m=0),u=n.segments,o<0&&P.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),f=(d=u[m=u.length-1].points).length-1;o<0;)o+=d[f].partialLength,(f-=1)<0&&(f=(d=u[m-=1].points).length-1);c=(d=u[m].points)[f-1],y=(h=d[f]).partialLength}a=k.length,r=i=0;var D,F,I,w,B=1.2*t.finalSize*.714,V=!0;I=x.length;var R,G,L,z,N,O,H,j,q,W,X,Y,$,K=-1,Z=o,U=m,J=f,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var it=0,rt=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(k[s].n){for(it&&(it+=rt);at<s;)k[at].animatorJustifyOffset=it,at+=1;nt=!(it=0)}else{for(F=0;F<I;F+=1)(D=x[F].a).t.propType&&(nt&&2===t.j&&(rt+=D.t.v*st),(R=x[F].s.getMult(k[s].anIndexes[F],S.a[F].s.totalChars)).length?it+=D.t.v*R[0]*st:it+=D.t.v*R*st);nt=!1}for(it&&(it+=rt);at<s;)k[at].animatorJustifyOffset=it,at+=1}for(s=0;s<a;s+=1){if(_.reset(),N=1,k[s].n)i=0,r+=t.yOffset,r+=V?1:0,o=Z,V=!1,0,this._hasMaskedPath&&(f=J,c=(d=u[m=U].points)[f-1],y=(h=d[f]).partialLength,l=0),$=W=Y=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==k[s].line){switch(t.j){case 1:o+=g-t.lineWidths[k[s].line];break;case 2:o+=(g-t.lineWidths[k[s].line])/2}Q=k[s].line}K!==k[s].ind&&(k[K]&&(o+=k[K].extra),o+=k[s].an/2,K=k[s].ind),o+=E[0]*k[s].an/200;var ot=0;for(F=0;F<I;F+=1)(D=x[F].a).p.propType&&((R=x[F].s.getMult(k[s].anIndexes[F],S.a[F].s.totalChars)).length?ot+=D.p.v[0]*R[0]:ot+=D.p.v[0]*R),D.a.propType&&((R=x[F].s.getMult(k[s].anIndexes[F],S.a[F].s.totalChars)).length?ot+=D.a.v[0]*R[0]:ot+=D.a.v[0]*R);for(p=!0;p;)o+ot<=l+y||!d?(v=(o+ot-l)/h.partialLength,L=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,_.translate(-E[0]*k[s].an/200,-E[1]*B/100),p=!1):d&&(l+=h.partialLength,(f+=1)>=d.length&&(f=0,d=u[m+=1]?u[m].points:P.v.c?u[m=f=0].points:(l-=h.partialLength,null)),d&&(c=h,y=(h=d[f]).partialLength));G=k[s].an/2-k[s].add,_.translate(-G,0,0)}else G=k[s].an/2-k[s].add,_.translate(-G,0,0),_.translate(-E[0]*k[s].an/200,-E[1]*B/100,0);for(k[s].l/2,F=0;F<I;F+=1)(D=x[F].a).t.propType&&(R=x[F].s.getMult(k[s].anIndexes[F],S.a[F].s.totalChars),0===i&&0===t.j||(this._hasMaskedPath?R.length?o+=D.t.v*R[0]:o+=D.t.v*R:R.length?i+=D.t.v*R[0]:i+=D.t.v*R));for(k[s].l/2,t.strokeWidthAnim&&(H=t.sw||0),t.strokeColorAnim&&(O=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(j=[t.fc[0],t.fc[1],t.fc[2]]),F=0;F<I;F+=1)(D=x[F].a).a.propType&&((R=x[F].s.getMult(k[s].anIndexes[F],S.a[F].s.totalChars)).length?_.translate(-D.a.v[0]*R[0],-D.a.v[1]*R[1],D.a.v[2]*R[2]):_.translate(-D.a.v[0]*R,-D.a.v[1]*R,D.a.v[2]*R));for(F=0;F<I;F+=1)(D=x[F].a).s.propType&&((R=x[F].s.getMult(k[s].anIndexes[F],S.a[F].s.totalChars)).length?_.scale(1+(D.s.v[0]-1)*R[0],1+(D.s.v[1]-1)*R[1],1):_.scale(1+(D.s.v[0]-1)*R,1+(D.s.v[1]-1)*R,1));for(F=0;F<I;F+=1){if(D=x[F].a,R=x[F].s.getMult(k[s].anIndexes[F],S.a[F].s.totalChars),D.sk.propType&&(R.length?_.skewFromAxis(-D.sk.v*R[0],D.sa.v*R[1]):_.skewFromAxis(-D.sk.v*R,D.sa.v*R)),D.r.propType&&(R.length?_.rotateZ(-D.r.v*R[2]):_.rotateZ(-D.r.v*R)),D.ry.propType&&(R.length?_.rotateY(D.ry.v*R[1]):_.rotateY(D.ry.v*R)),D.rx.propType&&(R.length?_.rotateX(D.rx.v*R[0]):_.rotateX(D.rx.v*R)),D.o.propType&&(R.length?N+=(D.o.v*R[0]-N)*R[0]:N+=(D.o.v*R-N)*R),t.strokeWidthAnim&&D.sw.propType&&(R.length?H+=D.sw.v*R[0]:H+=D.sw.v*R),t.strokeColorAnim&&D.sc.propType)for(q=0;q<3;q+=1)R.length?O[q]=O[q]+(D.sc.v[q]-O[q])*R[0]:O[q]=O[q]+(D.sc.v[q]-O[q])*R;if(t.fillColorAnim&&t.fc){if(D.fc.propType)for(q=0;q<3;q+=1)R.length?j[q]=j[q]+(D.fc.v[q]-j[q])*R[0]:j[q]=j[q]+(D.fc.v[q]-j[q])*R;D.fh.propType&&(j=R.length?addHueToRGB(j,D.fh.v*R[0]):addHueToRGB(j,D.fh.v*R)),D.fs.propType&&(j=R.length?addSaturationToRGB(j,D.fs.v*R[0]):addSaturationToRGB(j,D.fs.v*R)),D.fb.propType&&(j=R.length?addBrightnessToRGB(j,D.fb.v*R[0]):addBrightnessToRGB(j,D.fb.v*R))}}for(F=0;F<I;F+=1)(D=x[F].a).p.propType&&(R=x[F].s.getMult(k[s].anIndexes[F],S.a[F].s.totalChars),this._hasMaskedPath?R.length?_.translate(0,D.p.v[1]*R[0],-D.p.v[2]*R[1]):_.translate(0,D.p.v[1]*R,-D.p.v[2]*R):R.length?_.translate(D.p.v[0]*R[0],D.p.v[1]*R[1],-D.p.v[2]*R[2]):_.translate(D.p.v[0]*R,D.p.v[1]*R,-D.p.v[2]*R));if(t.strokeWidthAnim&&(W=H<0?0:H),t.strokeColorAnim&&(X="rgb("+Math.round(255*O[0])+","+Math.round(255*O[1])+","+Math.round(255*O[2])+")"),t.fillColorAnim&&t.fc&&(Y="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),this._hasMaskedPath){if(_.translate(0,-t.ls),_.translate(0,E[1]*B/100+r,0),S.p.p){b=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(b)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),_.rotate(-ht*Math.PI/180)}_.translate(L,z,0),o-=E[0]*k[s].an/200,k[s+1]&&K!==k[s+1].ind&&(o+=k[s].an/2,o+=t.tr/1e3*t.finalSize)}else{switch(_.translate(i,r,0),t.ps&&_.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:_.translate(k[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[k[s].line]),0,0);break;case 2:_.translate(k[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[k[s].line])/2,0,0)}_.translate(0,-t.ls),_.translate(G,0,0),_.translate(E[0]*k[s].an/200,E[1]*B/100,0),i+=k[s].l+t.tr/1e3*t.finalSize}"html"===A?tt=_.toCSS():"svg"===A?tt=_.to2dCSS():et=[_.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]],$=N}this.lettersChangedFlag=T<=s?(w=new LetterProps($,W,X,Y,tt,et),this.renderedLetters.push(w),T+=1,!0):(w=this.renderedLetters[s]).update($,W,X,Y,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,i,r,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==i&&(this.sc=i,n=this._mdf.sc=!0),this.fc!==r&&(this.fc=r,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var r,s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(r=0;r<s;r+=1)a=i!==this.keysIndex?this.effectsSequence[r](a,a.t):this.effectsSequence[r](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,i=0,r=t.length;i<=r-1&&(t[i].s,!(i===r-1||t[i+1].t>e));)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,i=FontManager.getCombinedCharacterCodes(),r=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==i.indexOf(e)?r[r.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(r.push(t.substr(s,2)),++s):r.push(t.charAt(s)),s+=1;return r},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,i,r,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,c=0,d=0,u=0,y=[],g=0,v=0,b=h.getFontByName(t.f),P=0,E=b.fStyle?b.fStyle.split(" "):[],x="normal",S="normal";for(i=E.length,e=0;e<i;e+=1)switch(E[e].toLowerCase()){case"italic":S="italic";break;case"bold":x="700";break;case"black":x="900";break;case"medium":x="500";break;case"regular":case"normal":x="400";break;case"light":case"thin":x="200"}t.fWeight=b.fWeight||x,t.fStyle=S,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),i=t.finalText.length,t.finalLineHeight=t.lh;var _,A=t.tr/1e3*t.finalSize;if(t.sz)for(var T,k,M=!0,C=t.sz[0],D=t.sz[1];M;){g=T=0,i=(k=this.buildFinalText(t.t)).length,A=t.tr/1e3*t.finalSize;var F=-1;for(e=0;e<i;e+=1)_=k[e].charCodeAt(0),r=!1," "===k[e]?F=e:13!==_&&3!==_||(r=!(g=0),T+=t.finalLineHeight||1.2*t.finalSize),C<g+(P=h.chars?(o=h.getCharData(k[e],b.fStyle,b.fFamily),r?0:o.w*t.finalSize/100):h.measureText(k[e],t.f,t.finalSize))&&" "!==k[e]?(-1===F?i+=1:e=F,T+=t.finalLineHeight||1.2*t.finalSize,k.splice(e,F===e?1:0,"\r"),F=-1,g=0):(g+=P,g+=A);T+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&D<T?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=k,i=t.finalText.length,M=!1)}g=-A;var I,w=P=0;for(e=0;e<i;e+=1)if(r=!1,13===(_=(I=t.finalText[e]).charCodeAt(0))||3===_?(w=0,y.push(g),v=v<g?g:v,g=-2*A,r=!(s=""),u+=1):s=I,P=h.chars?(o=h.getCharData(I,b.fStyle,h.getFontByName(t.f).fFamily),r?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===I?w+=P+A:(g+=P+A+w,w=0),p.push({l:P,an:P,add:c,n:r,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==m){if(c+=P,""===s||" "===s||e===i-1){for(""!==s&&" "!==s||(c-=P);d<=e;)p[d].an=c,p[d].ind=f,p[d].extra=P,d+=1;f+=1,c=0}}else if(3==m){if(c+=P,""===s||e===i-1){for(""===s&&(c-=P);d<=e;)p[d].an=c,p[d].ind=f,p[d].extra=P,d+=1;c=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var B,V,R=l.a;n=R.length;var G,L,z=[];for(a=0;a<n;a+=1){for((B=R[a]).a.sc&&(t.strokeColorAnim=!0),B.a.sw&&(t.strokeWidthAnim=!0),(B.a.fc||B.a.fh||B.a.fs||B.a.fb)&&(t.fillColorAnim=!0),L=0,G=B.s.b,e=0;e<i;e+=1)(V=p[e]).anIndexes[a]=L,(1==G&&""!==V.val||2==G&&""!==V.val&&" "!==V.val||3==G&&(V.n||" "==V.val||e==i-1)||4==G&&(V.n||e==i-1))&&(1===B.s.rn&&z.push(L),L+=1);l.a[a].s.totalChars=L;var N,O=-1;if(1===B.s.rn)for(e=0;e<i;e+=1)O!=(V=p[e]).anIndexes[a]&&(O=V.anIndexes[a],N=z.splice(Math.floor(Math.random()*z.length),1)[0]),V.anIndexes[a]=N}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var i=this.copyData({},this.data.d.k[e].s);i=this.copyData(i,t),this.data.d.k[e].s=i,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function r(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return r.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,i=0,r=1,s=1;0<this.ne.v?e=this.ne.v/100:i=-this.ne.v/100,0<this.xe.v?r=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,i,r,s).get,n=0,o=this.finalS,h=this.finalE,l=this.data.sh;if(2===l)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===l)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===l)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===l){if(h===o)n=0;else{var p=h-o,f=-p/2+(t=d(c(0,t+.5-o),h-o)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=a(n)}else n=6===l?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/e,r=this.s.v/e+i,s=this.e.v/e+i;if(s<r){var a=r;r=s,s=a}this.finalS=r,this.finalE=s}},extendPrototype([DynamicPropertyContainer],r),{getTextSelectorProp:function(t,e,i){return new r(t,e,i)}}}(),pool_factory=function(t,e,i,r){var s=0,a=t,n=createSizedArray(a);function o(){return s?n[s-=1]:e()}return{newElement:o,release:function(t){s===a&&(n=pooling.double(n),a*=2),i&&i(t),n[s]=t,s+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},point_pool=pool_factory(8,function(){return createTypedArray("float32",2)}),shape_pool=(SB=pool_factory(4,function(){return new ShapePath},function(t){var e,i=t._length;for(e=0;e<i;e+=1)point_pool.release(t.v[e]),point_pool.release(t.i[e]),point_pool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),SB.clone=function(t){var e,i=SB.newElement(),r=void 0===t._length?t.v.length:t._length;for(i.setLength(r),i.c=t.c,e=0;e<r;e+=1)i.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return i},SB),SB,shapeCollection_pool=(_B={newShapeCollection:function(){var t;t=aC?cC[aC-=1]:new ShapeCollection;return t},release:function(t){var e,i=t._length;for(e=0;e<i;e+=1)shape_pool.release(t.shapes[e]);t._length=0,aC===bC&&(cC=pooling.double(cC),bC*=2);cC[aC]=t,aC+=1}},aC=0,bC=4,cC=createSizedArray(bC),_B),_B,aC,bC,cC,segments_length_pool=pool_factory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)bezier_length_pool.release(t.lengths[e]);t.lengths.length=0}),bezier_length_pool=pool_factory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var i="";if(e&&e.title){var r=createNS("title"),s=createElementID();r.setAttribute("id",s),r.textContent=e.title,this.svgElement.appendChild(r),i+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),i+=" "+n}i&&this.svgElement.setAttribute("aria-labelledby",i);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function HybridRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!e||!1!==e.hideOnTransparent,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function MaskElement(t,e,i){this.data=t,this.element=e,this.globalData=i,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var r,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var n,o,h,l,p,f,m,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(r=0;r<a;r++)if(("a"!==c[r].mode&&"n"!==c[r].mode||c[r].inv||100!==c[r].o.k||c[r].o.x)&&(v=g="mask"),"s"!=c[r].mode&&"i"!=c[r].mode||0!==d?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),n=createNS("path"),"n"!=c[r].mode){var b;if(d+=1,n.setAttribute("fill","s"===c[r].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==c[r].x.k?(v=g="mask",m=PropertyFactory.getProp(this.element,c[r].x,0,null,this.element),b=createElementID(),(p=createNS("filter")).setAttribute("id",b),(f=createNS("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),s.appendChild(p),n.setAttribute("stroke","s"===c[r].mode?"#000000":"#ffffff")):m=f=null,this.storedData[r]={elem:n,x:m,expan:f,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==c[r].mode){h=u.length;var P=createNS("g");for(o=0;o<h;o+=1)P.appendChild(u[o]);var E=createNS("mask");E.setAttribute("mask-type","alpha"),E.setAttribute("id",y+"_"+d),E.appendChild(n),s.appendChild(E),P.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(P)}else u.push(n);c[r].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[r]={elem:n,lastPath:"",op:PropertyFactory.getProp(this.element,c[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[r],3),invRect:l},this.viewData[r].prop.k||this.drawPath(c[r],this.viewData[r].prop.v,this.viewData[r])}else this.viewData[r]={op:PropertyFactory.getProp(this.element,c[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[r],3),elem:n,lastPath:""},s.appendChild(n);for(this.maskElement=createNS(g),a=u.length,r=0;r<a;r+=1)this.maskElement.appendChild(u[r]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,i){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=i,this.lvl=e,this._isAnimated=!!i.k;for(var r=0,s=t.length;r<s;){if(t[r].mProps.dynamicProperties.length){this._isAnimated=!0;break}r+=1}}function SVGTransformData(t,e,i){this.transform={mProps:t,op:e,container:i},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function SVGStrokeStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=i,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=i}function SVGGradientFillStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,i)}function SVGGradientStrokeStyleData(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,i),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}BaseRenderer.prototype.checkLayers=function(t){var e,i,r=this.layers.length;for(this.completeLayers=!0,e=r-1;0<=e;e--)this.elements[e]||(i=this.layers[e]).ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t)}return this.createNull(t)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){this.completeLayers=!1;var e,i,r=t.length,s=this.layers.length;for(e=0;e<r;e+=1)for(i=0;i<s;){if(this.layers[i].id==t[e].id){this.layers[i]=t[e];break}i+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,i){for(var r=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(r[a]&&!0!==r[a]?(i.push(r[a]),r[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,i):t.setHierarchy(i)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,i=t.length;for(e=0;e<i;e+=1)if(t[e].xt){var r=this.createComp(t[e]);r.initExpressions(),this.globalData.projectInterface.registerComposition(r)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var i=createNS("clipPath"),r=createNS("rect");r.setAttribute("width",t.w),r.setAttribute("height",t.h),r.setAttribute("x",0),r.setAttribute("y",0);var s=createElementID();i.setAttribute("id",s),i.appendChild(r),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(i),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var i=this.createItem(this.layers[t]);e[t]=i,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(i),i.initExpressions()),this.appendElementInPos(i,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?i.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(i)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,i=this.elements.length;e<i;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=i-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<i;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){for(var r,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(r=this.elements[s].getBaseElement()),s+=1;r?this.layerElement.insertBefore(i,r):this.layerElement.appendChild(i)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},HybridRenderer.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){var r=this.layers[e];if(r.ddd&&this.supports3d)this.addTo3dContainer(i,e);else if(this.threeDElements)this.addTo3dContainer(i,e);else{for(var s,a,n=0;n<e;)this.elements[n]&&!0!==this.elements[n]&&this.elements[n].getBaseElement&&(a=this.elements[n],s=(this.layers[n].ddd?this.getThreeDContainerByPos(n):a.getBaseElement())||s),n+=1;s?r.ddd&&this.supports3d||this.layerElement.insertBefore(i,s):r.ddd&&this.supports3d||this.layerElement.appendChild(i)}}},HybridRenderer.prototype.createShape=function(t){return this.supports3d?new HShapeElement(t,this.globalData,this):new SVGShapeElement(t,this.globalData,this)},HybridRenderer.prototype.createText=function(t){return this.supports3d?new HTextElement(t,this.globalData,this):new SVGTextElement(t,this.globalData,this)},HybridRenderer.prototype.createCamera=function(t){return this.camera=new HCameraElement(t,this.globalData,this),this.camera},HybridRenderer.prototype.createImage=function(t){return this.supports3d?new HImageElement(t,this.globalData,this):new IImageElement(t,this.globalData,this)},HybridRenderer.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.globalData,this):new SVGCompElement(t,this.globalData,this)},HybridRenderer.prototype.createSolid=function(t){return this.supports3d?new HSolidElement(t,this.globalData,this):new ISolidElement(t,this.globalData,this)},HybridRenderer.prototype.createNull=SVGRenderer.prototype.createNull,HybridRenderer.prototype.getThreeDContainerByPos=function(t){for(var e=0,i=this.threeDElements.length;e<i;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}},HybridRenderer.prototype.createThreeDContainer=function(t,e){var i=createTag("div");styleDiv(i);var r=createTag("div");styleDiv(r),"3d"===e&&(i.style.width=this.globalData.compSize.w+"px",i.style.height=this.globalData.compSize.h+"px",i.style.transformOrigin=i.style.mozTransformOrigin=i.style.webkitTransformOrigin="50% 50%",r.style.transform=r.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"),i.appendChild(r);var s={container:r,perspectiveElem:i,startPos:t,endPos:t,type:e};return this.threeDElements.push(s),s},HybridRenderer.prototype.build3dContainers=function(){var t,e,i=this.layers.length,r="";for(t=0;t<i;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?"3d"!==r&&(r="3d",e=this.createThreeDContainer(t,"3d")):"2d"!==r&&(r="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t);for(t=(i=this.threeDElements.length)-1;0<=t;t--)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRenderer.prototype.addTo3dContainer=function(t,e){for(var i=0,r=this.threeDElements.length;i<r;){if(e<=this.threeDElements[i].endPos){for(var s,a=this.threeDElements[i].startPos;a<e;)this.elements[a]&&this.elements[a].getBaseElement&&(s=this.elements[a].getBaseElement()),a+=1;s?this.threeDElements[i].container.insertBefore(t,s):this.threeDElements[i].container.appendChild(t);break}i+=1}},HybridRenderer.prototype.configAnimation=function(t){var e=createTag("div"),i=this.animationItem.wrapper;e.style.width=t.w+"px",e.style.height=t.h+"px",styleDiv(this.resizerElem=e),e.style.transformStyle=e.style.webkitTransformStyle=e.style.mozTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),i.appendChild(e),e.style.overflow="hidden";var r=createNS("svg");r.setAttribute("width","1"),r.setAttribute("height","1"),styleDiv(r),this.resizerElem.appendChild(r);var s=createNS("defs");r.appendChild(s),this.data=t,this.setupGlobalData(t,r),this.globalData.defs=s,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRenderer.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRenderer.prototype.updateContainerSize=function(){var t,e,i,r,s=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight;r=s/a<this.globalData.compSize.w/this.globalData.compSize.h?(t=s/this.globalData.compSize.w,e=s/this.globalData.compSize.w,i=0,(a-this.globalData.compSize.h*(s/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,i=(s-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,0),this.resizerElem.style.transform=this.resizerElem.style.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+i+","+r+",0,1)"},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,i=this.globalData.compSize.h,r=this.threeDElements.length;for(t=0;t<r;t+=1)this.threeDElements[t].perspectiveElem.style.perspective=this.threeDElements[t].perspectiveElem.style.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(i,2))+"px"}},HybridRenderer.prototype.searchExtraCompositions=function(t){var e,i=t.length,r=createTag("div");for(e=0;e<i;e+=1)if(t[e].xt){var s=this.createComp(t[e],r,this.globalData.comp,null);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,i=this.element.finalTransform.mat,r=this.masksProperties.length;for(e=0;e<r;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",i.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,i){var r,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,r=1;r<s;r+=1)a+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[r][0]+","+e.i[r][1]+" "+e.v[r][0]+","+e.v[r][1];if(e.c&&1<s&&(a+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==a){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),i.elem.setAttribute("d",n)),i.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var i,r=this.dynamicProperties.length;for(i=0;i<r;i+=1)(e||this._isParent&&"transform"===this.dynamicProperties[i].propType)&&(this.dynamicProperties[i].getValue(),this.dynamicProperties[i]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,i=0,r=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i<r;){if(this.hierarchy[i].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}i+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),i=0;i<r;i+=1)t=this.hierarchy[i].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var i=!0,r=this.comp;i;)r.finalTransform?(r.data.hasMask&&e.splice(0,0,r.finalTransform),r=r.comp):i=!1;var s,a,n=e.length;for(s=0;s<n;s+=1)a=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,i){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=i,this.stops=[],this.setGradientData(i.pElem,e),this.setGradientOpacity(e,i),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var i=createElementID(),r=createNS(1===e.t?"linearGradient":"radialGradient");r.setAttribute("id",i),r.setAttribute("spreadMethod","pad"),r.setAttribute("gradientUnits","userSpaceOnUse");var s,a,n,o=[];for(n=4*e.g.p,a=0;a<n;a+=4)s=createNS("stop"),r.appendChild(s),o.push(s);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+locationHref+"#"+i+")"),this.gf=r,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var i,r,s,a=createNS("mask"),n=createNS("path");a.appendChild(n);var o=createElementID(),h=createElementID();a.setAttribute("id",h);var l=createNS(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",o),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),s=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(r=4*t.g.p;r<s;r+=2)(i=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(i),p.push(i);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+locationHref+"#"+o+")"),this.of=l,this.ms=a,this.ost=p,this.maskId=h,e.msElem=n}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var SVGElementsRenderer=function(){var y=new Matrix,g=new Matrix;function e(t,e,i){(i||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(i||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function i(t,e,i){var r,s,a,n,o,h,l,p,f,m,c,d=e.styles.length,u=e.lvl;for(h=0;h<d;h+=1){if(n=e.sh._mdf||i,e.styles[h].lvl<u){for(p=g.reset(),m=u-e.styles[h].lvl,c=e.transformers.length-1;!n&&0<m;)n=e.transformers[c].mProps._mdf||n,m--,c--;if(n)for(m=u-e.styles[h].lvl,c=e.transformers.length-1;0<m;)f=e.transformers[c].mProps.v.props,p.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),m--,c--}else p=y;if(s=(l=e.sh.paths)._length,n){for(a="",r=0;r<s;r+=1)(o=l.shapes[r])&&o._length&&(a+=buildShapeString(o,o._length,o.c,p));e.caches[h]=a}else a=e.caches[h];e.styles[h].d+=!0===t.hd?"":a,e.styles[h]._mdf=n||e.styles[h]._mdf}}function r(t,e,i){var r=e.style;(e.c._mdf||i)&&r.pElem.setAttribute("fill","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i)&&r.pElem.setAttribute("fill-opacity",e.o.v)}function s(t,e,i){a(t,e,i),n(t,e,i)}function a(t,e,i){var r,s,a,n,o,h=e.gf,l=e.g._hasOpacity,p=e.s.v,f=e.e.v;if(e.o._mdf||i){var m="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(m,e.o.v)}if(e.s._mdf||i){var c=1===t.t?"x1":"cx",d="x1"===c?"y1":"cy";h.setAttribute(c,p[0]),h.setAttribute(d,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(c,p[0]),e.of.setAttribute(d,p[1]))}if(e.g._cmdf||i){r=e.cst;var u=e.g.c;for(a=r.length,s=0;s<a;s+=1)(n=r[s]).setAttribute("offset",u[4*s]+"%"),n.setAttribute("stop-color","rgb("+u[4*s+1]+","+u[4*s+2]+","+u[4*s+3]+")")}if(l&&(e.g._omdf||i)){var y=e.g.o;for(a=(r=e.g._collapsable?e.cst:e.ost).length,s=0;s<a;s+=1)n=r[s],e.g._collapsable||n.setAttribute("offset",y[2*s]+"%"),n.setAttribute("stop-opacity",y[2*s+1])}if(1===t.t)(e.e._mdf||i)&&(h.setAttribute("x2",f[0]),h.setAttribute("y2",f[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",f[0]),e.of.setAttribute("y2",f[1])));else if((e.s._mdf||e.e._mdf||i)&&(o=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)),h.setAttribute("r",o),l&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.e._mdf||e.h._mdf||e.a._mdf||i){o||(o=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)));var g=Math.atan2(f[1]-p[1],f[0]-p[0]),v=o*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),b=Math.cos(g+e.a.v)*v+p[0],P=Math.sin(g+e.a.v)*v+p[1];h.setAttribute("fx",b),h.setAttribute("fy",P),l&&!e.g._collapsable&&(e.of.setAttribute("fx",b),e.of.setAttribute("fy",P))}}function n(t,e,i){var r=e.style,s=e.d;s&&(s._mdf||i)&&s.dashStr&&(r.pElem.setAttribute("stroke-dasharray",s.dashStr),r.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||i)&&r.pElem.setAttribute("stroke","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||i)&&r.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(r.pElem.setAttribute("stroke-width",e.w.v),r.msElem&&r.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){t.ty;switch(t.ty){case"fl":return r;case"gf":return a;case"gs":return s;case"st":return n;case"sh":case"el":case"rc":case"sr":return i;case"tr":return e}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function BaseElement(){}function NullElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initFrame(),this.initTransform(t,e,i),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,i),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,i){this.initElement(t,e,i)}function AudioElement(t,e,i){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,i),this._isPlaying=!1,this._canPlay=!1;var r=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(r),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGCompElement(t,e,i){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGTextElement(t,e,i){this.textSpans=[],this.renderType="svg",this.initElement(t,e,i)}function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[]}function SVGTintFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");if(i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.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"),i.setAttribute("result","f1"),t.appendChild(i),(i=createNS("feColorMatrix")).setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),i.setAttribute("result","f2"),t.appendChild(i),this.matrixFilter=i,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var r,s=createNS("feMerge");t.appendChild(s),(r=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),s.appendChild(r),(r=createNS("feMergeNode")).setAttribute("in","f2"),s.appendChild(r)}}function SVGFillFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(i),this.matrixFilter=i}function SVGGaussianBlurEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var i=createNS("feGaussianBlur");t.appendChild(i),this.feGaussianBlur=i}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.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"),i.setAttribute("result","f1"),t.appendChild(i);var r=createNS("feComponentTransfer");r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),this.matrixFilter=r;var s=createNS("feFuncR");s.setAttribute("type","table"),r.appendChild(s),this.feFuncR=s;var a=createNS("feFuncG");a.setAttribute("type","table"),r.appendChild(a),this.feFuncG=a;var n=createNS("feFuncB");n.setAttribute("type","table"),r.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var i=this.filterManager.effectElements,r=createNS("feComponentTransfer");(i[10].p.k||0!==i[10].p.v||i[11].p.k||1!==i[11].p.v||i[12].p.k||1!==i[12].p.v||i[13].p.k||0!==i[13].p.v||i[14].p.k||1!==i[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",r)),(i[17].p.k||0!==i[17].p.v||i[18].p.k||1!==i[18].p.v||i[19].p.k||1!==i[19].p.v||i[20].p.k||0!==i[20].p.v||i[21].p.k||1!==i[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",r)),(i[24].p.k||0!==i[24].p.v||i[25].p.k||1!==i[25].p.v||i[26].p.k||1!==i[26].p.v||i[27].p.k||0!==i[27].p.v||i[28].p.k||1!==i[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",r)),(i[31].p.k||0!==i[31].p.v||i[32].p.k||1!==i[32].p.v||i[33].p.k||1!==i[33].p.v||i[34].p.k||0!==i[34].p.v||i[35].p.k||1!==i[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",r)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),r=createNS("feComponentTransfer")),(i[3].p.k||0!==i[3].p.v||i[4].p.k||1!==i[4].p.v||i[5].p.k||1!==i[5].p.v||i[6].p.k||0!==i[6].p.v||i[7].p.k||1!==i[7].p.v)&&(r.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(r),this.feFuncRComposed=this.createFeFunc("feFuncR",r),this.feFuncGComposed=this.createFeFunc("feFuncG",r),this.feFuncBComposed=this.createFeFunc("feFuncB",r))}function SVGDropShadowEffect(t,e){var i=e.container.globalData.renderConfig.filterSize;t.setAttribute("x",i.x),t.setAttribute("y",i.y),t.setAttribute("width",i.width),t.setAttribute("height",i.height),this.filterManager=e;var r=createNS("feGaussianBlur");r.setAttribute("in","SourceAlpha"),r.setAttribute("result","drop_shadow_1"),r.setAttribute("stdDeviation","0"),this.feGaussianBlur=r,t.appendChild(r);var s=createNS("feOffset");s.setAttribute("dx","25"),s.setAttribute("dy","0"),s.setAttribute("in","drop_shadow_1"),s.setAttribute("result","drop_shadow_2"),this.feOffset=s,t.appendChild(s);var a=createNS("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var n=createNS("feComposite");n.setAttribute("in","drop_shadow_3"),n.setAttribute("in2","drop_shadow_2"),n.setAttribute("operator","in"),n.setAttribute("result","drop_shadow_4"),t.appendChild(n);var o,h=createNS("feMerge");t.appendChild(h),o=createNS("feMergeNode"),h.appendChild(o),(o=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=h,this.originalNodeAdded=!1,h.appendChild(o)}ShapeTransformManager.prototype={addTransformSequence:function(t){var e,i=t.length,r="_";for(e=0;e<i;e+=1)r+=t[e].transform.key+"_";var s=this.sequences[r];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[r]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var i,r=0,s=t.transforms.length,a=e;r<s&&!e;){if(t.transforms[r].transform.mProps._mdf){a=!0;break}r+=1}if(a)for(t.finalTransform.reset(),r=s-1;0<=r;r-=1)i=t.transforms[r].transform.mProps.v.props,t.finalTransform.transform(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15]);t._mdf=a},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e<i;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return"_"+this.transform_key_count++}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,i){this.globalData=e,this.comp=i,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,i,r=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),r=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(i=createNS("g")).appendChild(this.layerElement),r=i,s.appendChild(i),i.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),r=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),n.appendChild(l),i.appendChild(this.layerElement),r=i,n.appendChild(i)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),r=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),f=createNS("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=createElementID();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+m+")"),c.appendChild(this.layerElement),this.transformedElement=c,r?r.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,i=this.shapeModifiers.length;for(e=0;e<i;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,r=e.length;i<r;){if(e[i].elem===t)return e[i].pos;i+=1}return 0},addProcessedElement:function(t,e){for(var i=this.processedElements,r=i.length;r;)if(i[r-=1].elem===t)return void(i[r].pos=e);i.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,i){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,i),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var i,r,s=e.length,a="";for(i=0;i<s;i+=1)r=e[i].ks.k,a+=buildShapeString(r,r.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,i,r,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i])/2,0,0)}e.translate(r,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var i,r=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),i=r-1;0<=i;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextElement),SVGTextElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextElement.prototype.buildTextContents=function(t){for(var e=0,i=t.length,r=[],s="";e<i;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(r.push(s),s=""):s+=t[e],e+=1;return r.push(s),r},SVGTextElement.prototype.buildNewText=function(){var t,e,i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i?i.l.length:0),i.fc?this.layerElement.setAttribute("fill",this.buildColor(i.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),i.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(i.sc)),this.layerElement.setAttribute("stroke-width",i.sw)),this.layerElement.setAttribute("font-size",i.finalSize);var r=this.globalData.fontManager.getFontByName(i.f);if(r.fClass)this.layerElement.setAttribute("class",r.fClass);else{this.layerElement.setAttribute("font-family",r.fFamily);var s=i.fWeight,a=i.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",s)}this.layerElement.setAttribute("aria-label",i.t);var n,o=i.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var l,p=this.mHelper,f="",m=this.data.singleShape,c=0,d=0,u=!0,y=i.tr/1e3*i.finalSize;if(!m||h||i.sz){var g,v,b=this.textSpans.length;for(t=0;t<e;t+=1)h&&m&&0!==t||(n=t<b?this.textSpans[t]:createNS(h?"path":"text"),b<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(i.finalSize/100,i.finalSize/100),m&&(o[t].n&&(c=-y,d+=i.yOffset,d+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(i,p,o[t].line,c,d),c+=o[t].l||0,c+=y),h?(l=(g=(v=this.globalData.fontManager.getCharData(i.finalText[t],r.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily))&&v.data||{}).shapes?g.shapes[0].it:[],m?f+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(m&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&n&&n.setAttribute("d",f)}else{var P=this.textContainer,E="start";switch(i.j){case 1:E="end";break;case 2:E="middle"}P.setAttribute("text-anchor",E),P.setAttribute("letter-spacing",y);var x=this.buildTextContents(i.finalText);for(e=x.length,d=i.ps?i.ps[1]+i.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||createNS("tspan")).textContent=x[t],n.setAttribute("x",0),n.setAttribute("y",d),n.style.display="inherit",P.appendChild(n),this.textSpans[t]=n,d+=i.finalLineHeight;this.layerElement.appendChild(P)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},SVGTextElement.prototype.sourceRectAtTime=function(t){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextElement.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var i,r,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(i=s[t],r=this.textSpans[t],i._mdf.m&&r.setAttribute("transform",i.m),i._mdf.o&&r.setAttribute("opacity",i.o),i._mdf.sw&&r.setAttribute("stroke-width",i.sw),i._mdf.sc&&r.setAttribute("stroke",i.sc),i._mdf.fc&&r.setAttribute("fill",i.fc))}},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,i,r,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(i=0;i<a;i+=1){for(r=this.stylesList[i],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(r)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var i,r=new SVGStyleData(t,e),s=r.pElem;if("st"===t.ty)i=new SVGStrokeStyleData(this,t,r);else if("fl"===t.ty)i=new SVGFillStyleData(this,t,r);else if("gf"===t.ty||"gs"===t.ty){i=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,r),this.globalData.defs.appendChild(i.gf),i.maskId&&(this.globalData.defs.appendChild(i.ms),this.globalData.defs.appendChild(i.of),s.setAttribute("mask","url("+locationHref+"#"+i.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(r),this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var i=TransformPropertyFactory.getTransformProperty(this,t,this),r=new SVGTransformData(i,i.o,e);return this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createShapeElement=function(t,e,i){var r=4;"rc"===t.ty?r=5:"el"===t.ty?r=6:"sr"===t.ty&&(r=7);var s=new SVGShapeData(e,i,ShapePropertyFactory.getShapeProp(this,t,r,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var i=0,r=this.animatedContents.length;i<r;){if(this.animatedContents[i].element===e)return;i+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,i=t.styles,r=this.stylesList.length;for(e=0;e<r;e+=1)this.stylesList[e].closed||i.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,i,r,s,a,n){var o,h,l,p,f,m,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((m=this.searchProcessedElement(t[o]))?e[o]=i[m-1]:t[o]._render=n,"fl"==t[o].ty||"st"==t[o].ty||"gf"==t[o].ty||"gs"==t[o].ty)m?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&r.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"==t[o].ty){if(m)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&r.appendChild(e[o].gr)}else"tr"==t[o].ty?(m||(e[o]=this.createTransformElement(t[o],r)),p=e[o].transform,c.push(p)):"sh"==t[o].ty||"rc"==t[o].ty||"el"==t[o].ty||"sr"==t[o].ty?(m||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"==t[o].ty||"rd"==t[o].ty||"ms"==t[o].ty||"pb"==t[o].ty?(m?(f=e[o]).closed=!1:((f=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=f,this.shapeModifiers.push(f)),y.push(f)):"rp"==t[o].ty&&(m?(f=e[o]).closed=!0:(f=ShapeModifiers.getModifier(t[o].ty),(e[o]=f).init(this,t,o,e),this.shapeModifiers.push(f),n=!1),y.push(f));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,i=this.animatedContents.length;for(t=0;t<i;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,r=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",i[0]-e[0]+" 0 0 0 "+e[0]+" "+(i[1]-e[1])+" 0 0 0 "+e[1]+" "+(i[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,i=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGGaussianBlurEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=.3*this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,r=3==i?0:e,s=2==i?0:e;this.feGaussianBlur.setAttribute("stdDeviation",r+" "+s);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},SVGStrokeEffect.prototype.initialize=function(){var t,e,i,r,s=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(r=this.elem.maskManager.masksProperties.length,i=0):r=(i=this.filterManager.effectElements[0].p.v-1)+1,(e=createNS("g")).setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1);i<r;i+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:i});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),n=createElementID();a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+locationHref+"#"+n+")");s[0];)o.appendChild(s[0]);this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(s=this.elem.layerElement.children||this.elem.layerElement.childNodes;s.length;)this.elem.layerElement.removeChild(s[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){this.initialized||this.initialize();var e,i,r,s=this.paths.length;for(e=0;e<s;e+=1)if(-1!==this.paths[e].m&&(i=this.elem.maskManager.viewData[this.paths[e].m],r=this.paths[e].p,(t||this.filterManager._mdf||i.prop._mdf)&&r.setAttribute("d",i.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||i.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,o=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,h=r.getTotalLength();a="0 0 0 "+h*n+" ";var l,p=h*(o-n),f=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100,m=Math.floor(p/f);for(l=0;l<m;l+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100;r.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bm_floor(255*c[0])+","+bm_floor(255*c[1])+","+bm_floor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,i=this.filterManager.effectElements[1].p.v,r=this.filterManager.effectElements[2].p.v,s=r[0]+" "+i[0]+" "+e[0],a=r[1]+" "+i[1]+" "+e[1],n=r[2]+" "+i[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",s),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var i=createNS(t);return i.setAttribute("type","table"),e.appendChild(i),i},SVGProLevelsFilter.prototype.getTableValue=function(t,e,i,r,s){for(var a,n,o=0,h=Math.min(t,e),l=Math.max(t,e),p=Array.call(null,{length:256}),f=0,m=s-r,c=e-t;o<=256;)n=(a=o/256)<=h?c<0?s:r:l<=a?c<0?r:s:r+m*Math.pow((a-t)/c,1/i),p[f++]=n,o+=256/255;return p.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,r=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=i*Math.cos(r),a=i*Math.sin(r);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,(this.elem=i).matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement}function SVGEffects(t){var e,i,r=t.data.ef?t.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s),n=0;for(this.filters=[],e=0;e<r;e+=1)i=null,20===t.data.ef[e].ty?(n+=1,i=new SVGTintFilter(a,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(n+=1,i=new SVGFillFilter(a,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?i=new SVGStrokeEffect(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(n+=1,i=new SVGTritoneFilter(a,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(n+=1,i=new SVGProLevelsFilter(a,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(n+=1,i=new SVGDropShadowEffect(a,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty?i=new SVGMatte3Effect(a,t.effectsManager.effectElements[e],t):29===t.data.ef[e].ty&&(n+=1,i=new SVGGaussianBlurEffect(a,t.effectsManager.effectElements[e])),i&&this.filters.push(i);n&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+locationHref+"#"+s+")")),this.filters.length&&t.addRenderableComponent(this)}function CVEffects(){}function HBaseElement(t,e,i){}function HSolidElement(t,e,i){this.initElement(t,e,i)}function HCompElement(t,e,i){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function HShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,i),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(t,e,i){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,i)}function HImageElement(t,e,i){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,i)}function HCameraElement(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initHierarchy();var r=PropertyFactory.getProp;if(this.pe=r(this,t.pe,0,0,this),t.ks.p.s?(this.px=r(this,t.ks.p.x,1,0,this),this.py=r(this,t.ks.p.y,1,0,this),this.pz=r(this,t.ks.p.z,1,0,this)):this.p=r(this,t.ks.p,1,0,this),t.ks.a&&(this.a=r(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var s,a=t.ks.or.k.length;for(s=0;s<a;s+=1)t.ks.or.k[s].to=null,t.ks.or.k[s].ti=null}this.or=r(this,t.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=r(this,t.ks.rx,0,degToRads,this),this.ry=r(this,t.ks.ry,0,degToRads,this),this.rz=r(this,t.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HEffects(){}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;e<i;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var i=t.layerElement.parentNode;if(i){for(var r,s=i.children,a=0,n=s.length;a<n&&s[a]!==t.layerElement;)a+=1;a<=n-2&&(r=s[a+1]);var o=createNS("use");o.setAttribute("href","#"+e),r?i.insertBefore(o,r):i.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var i=createElementID(),r=createNS("mask");r.setAttribute("id",e.layerId),r.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var s=t.globalData.defs;s.appendChild(r);var a=createNS("symbol");a.setAttribute("id",i),this.replaceInParent(e,i),a.appendChild(e.layerElement),s.appendChild(a);var n=createNS("use");n.setAttribute("href","#"+i),r.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,i=0,r=e.length;i<r;)e[i]&&e[i].data.ind===t&&this.setElementAsMask(this.elem,e[i]),i+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGEffects.prototype.renderFrame=function(t){var e,i=this.filters.length;for(e=0;e<i;e+=1)this.filters[e].renderFrame(t)},CVEffects.prototype.renderFrame=function(){},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&(this.transformedElement.style.transform=this.transformedElement.style.webkitTransform=this.finalTransform.mat.toCSS()),this.finalTransform._opMdf&&(this.transformedElement.style.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=HybridRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([HybridRenderer,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(t,e){for(var i,r=0;r<e;)this.elements[r]&&this.elements[r].getBaseElement&&(i=this.elements[r].getBaseElement()),r+=1;i?this.layerElement.insertBefore(t,i):this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)e=t[i].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(t,e){var i,r,s,a,n,o=t.sh.v,h=t.transformers,l=o._length;if(!(l<=1)){for(i=0;i<l-1;i+=1)r=this.getTransformedPoint(h,o.v[i]),s=this.getTransformedPoint(h,o.o[i]),a=this.getTransformedPoint(h,o.i[i+1]),n=this.getTransformedPoint(h,o.v[i+1]),this.checkBounds(r,s,a,n,e);o.c&&(r=this.getTransformedPoint(h,o.v[i]),s=this.getTransformedPoint(h,o.o[i]),a=this.getTransformedPoint(h,o.i[0]),n=this.getTransformedPoint(h,o.v[0]),this.checkBounds(r,s,a,n,e))}},HShapeElement.prototype.checkBounds=function(t,e,i,r,s){this.getBoundsOfCurve(t,e,i,r);var a=this.shapeBoundingBox;s.x=bm_min(a.left,s.x),s.xMax=bm_max(a.right,s.xMax),s.y=bm_min(a.top,s.y),s.yMax=bm_max(a.bottom,s.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(t,e,i,r){for(var s,a,n,o,h,l,p,f=[[t[0],r[0]],[t[1],r[1]]],m=0;m<2;++m)if(a=6*t[m]-12*e[m]+6*i[m],s=-3*t[m]+9*e[m]-9*i[m]+3*r[m],n=3*e[m]-3*t[m],a|=0,n|=0,0!==(s|=0))(h=a*a-4*n*s)<0||(0<(l=(-a+bm_sqrt(h))/(2*s))&&l<1&&f[m].push(this.calculateF(l,t,e,i,r,m)),0<(p=(-a-bm_sqrt(h))/(2*s))&&p<1&&f[m].push(this.calculateF(p,t,e,i,r,m)));else{if(0===a)continue;0<(o=-n/a)&&o<1&&f[m].push(this.calculateF(o,t,e,i,r,m))}this.shapeBoundingBox.left=bm_min.apply(null,f[0]),this.shapeBoundingBox.top=bm_min.apply(null,f[1]),this.shapeBoundingBox.right=bm_max.apply(null,f[0]),this.shapeBoundingBox.bottom=bm_max.apply(null,f[1])},HShapeElement.prototype.calculateF=function(t,e,i,r,s,a){return bm_pow(1-t,3)*e[a]+3*bm_pow(1-t,2)*t*i[a]+3*(1-t)*bm_pow(t,2)*r[a]+bm_pow(t,3)*s[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,r=t.length;for(i=0;i<r;i+=1)t[i]&&t[i].sh?this.calculateShapeBoundingBox(t[i],e):t[i]&&t[i].it&&this.calculateBoundingBox(t[i].it,e)},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var i=!1;this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),i=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),i=!0),(i||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y)&&(this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.shapeCont.style.transform=this.shapeCont.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=createNS("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=this.innerElem.style;e.color=e.fill=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)",t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var i,r,s=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",s.fClass)this.innerElem.className=s.fClass;else{e.fontFamily=s.fFamily;var a=t.fWeight,n=t.fStyle;e.fontStyle=n,e.fontWeight=a}var o,h,l,p=t.l;r=p.length;var f,m=this.mHelper,c="",d=0;for(i=0;i<r;i+=1){if(this.globalData.fontManager.chars?(this.textPaths[d]?o=this.textPaths[d]:((o=createNS("path")).setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[d]?l=(h=this.textSpans[d]).children[0]:((h=createTag("div")).style.lineHeight=0,(l=createNS("svg")).appendChild(o),styleDiv(h)))):this.isMasked?o=this.textPaths[d]?this.textPaths[d]:createNS("text"):this.textSpans[d]?(h=this.textSpans[d],o=this.textPaths[d]):(styleDiv(h=createTag("span")),styleDiv(o=createTag("span")),h.appendChild(o)),this.globalData.fontManager.chars){var u,y=this.globalData.fontManager.getCharData(t.finalText[i],s.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(u=y?y.data:null,m.reset(),u&&u.shapes&&(f=u.shapes[0].it,m.scale(t.finalSize/100,t.finalSize/100),c=this.createPathShape(m,f),o.setAttribute("d",c)),this.isMasked)this.innerElem.appendChild(o);else{if(this.innerElem.appendChild(h),u&&u.shapes){document.body.appendChild(l);var g=l.getBBox();l.setAttribute("width",g.width+2),l.setAttribute("height",g.height+2),l.setAttribute("viewBox",g.x-1+" "+(g.y-1)+" "+(g.width+2)+" "+(g.height+2)),l.style.transform=l.style.webkitTransform="translate("+(g.x-1)+"px,"+(g.y-1)+"px)",p[i].yOffset=g.y-1}else l.setAttribute("width",1),l.setAttribute("height",1);h.appendChild(l)}}else o.textContent=p[i].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked?this.innerElem.appendChild(o):(this.innerElem.appendChild(h),o.style.transform=o.style.webkitTransform="translate3d(0,"+-t.finalSize/1.2+"px,0)");this.isMasked?this.textSpans[d]=o:this.textSpans[d]=h,this.textSpans[d].style.display="block",this.textPaths[d]=o,d+=1}for(;d<this.textSpans.length;)this.textSpans[d].style.display="none",d+=1},HTextElement.prototype.renderInnerContent=function(){if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;this.isMasked&&this.finalTransform._matMdf&&(this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)")}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var t,e,i,r,s,a=0,n=this.textAnimator.renderedLetters,o=this.textProperty.currentData.l;for(e=o.length,t=0;t<e;t+=1)o[t].n?a+=1:(r=this.textSpans[t],s=this.textPaths[t],i=n[a],a+=1,i._mdf.m&&(this.isMasked?r.setAttribute("transform",i.m):r.style.transform=r.style.webkitTransform=i.m),r.style.opacity=i.o,i.sw&&i._mdf.sw&&s.setAttribute("stroke-width",i.sw),i.sc&&i._mdf.sc&&s.setAttribute("stroke",i.sc),i.fc&&i._mdf.fc&&(s.setAttribute("fill",i.fc),s.style.color=i.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var h=this.innerElem.getBBox();this.currentBBox.w!==h.width&&(this.currentBBox.w=h.width,this.svgElement.setAttribute("width",h.width)),this.currentBBox.h!==h.height&&(this.currentBBox.h=h.height,this.svgElement.setAttribute("height",h.height));this.currentBBox.w===h.width+2&&this.currentBBox.h===h.height+2&&this.currentBBox.x===h.x-1&&this.currentBBox.y===h.y-1||(this.currentBBox.w=h.width+2,this.currentBBox.h=h.height+2,this.currentBBox.x=h.x-1,this.currentBBox.y=h.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var t,e,i=this.comp.threeDElements.length;for(t=0;t<i;t+=1)"3d"===(e=this.comp.threeDElements[t]).type&&(e.perspectiveElem.style.perspective=e.perspectiveElem.style.webkitPerspective=this.pe.v+"px",e.container.style.transformOrigin=e.container.style.mozTransformOrigin=e.container.style.webkitTransformOrigin="0px 0px 0px",e.perspectiveElem.style.transform=e.perspectiveElem.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)")},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var t,e,i=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)i=this.hierarchy[t].finalTransform.mProp._mdf||i;if(i||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){if(this.mat.reset(),this.hierarchy)for(t=e=this.hierarchy.length-1;0<=t;t-=1){var r=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-r.p.v[0],-r.p.v[1],r.p.v[2]),this.mat.rotateX(-r.or.v[0]).rotateY(-r.or.v[1]).rotateZ(r.or.v[2]),this.mat.rotateX(-r.rx.v).rotateY(-r.ry.v).rotateZ(r.rz.v),this.mat.scale(1/r.s.v[0],1/r.s.v[1],1/r.s.v[2]),this.mat.translate(r.a.v[0],r.a.v[1],r.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s;s=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),n=[s[0]/a,s[1]/a,s[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],o),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-h)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var f;for(e=this.comp.threeDElements.length,t=0;t<e;t+=1)"3d"===(f=this.comp.threeDElements[t]).type&&(p&&(f.container.style.transform=f.container.style.webkitTransform=this.mat.toCSS()),this.pe._mdf&&(f.perspectiveElem.style.perspective=f.perspectiveElem.style.webkitPerspective=this.pe.v+"px"));this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},HEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],r=0,a=0,n=0,o=!0,h=!1;function i(t){for(var e=0,i=t.target;e<a;)s[e].animation===i&&(s.splice(e,1),e-=1,a-=1,i.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var i=0;i<a;){if(s[i].elem==t&&null!==s[i].elem)return s[i].animation;i+=1}var r=new AnimationItem;return m(r,t),r.setData(t,e),r}function p(){n+=1,d()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",i),t.addEventListener("_active",p),t.addEventListener("_idle",f),s.push({elem:e,animation:t}),a+=1}function c(t){var e,i=t-r;for(e=0;e<a;e+=1)s[e].animation.advanceTime(i);r=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){r=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new AnimationItem;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var i;for(i=0;i<a;i+=1)s[i].animation.setSpeed(t,e)},t.setDirection=function(t,e){var i;for(i=0;i<a;i+=1)s[i].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,i){var r,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(r=0;r<a;r+=1)i&&s[r].setAttribute("data-bm-type",i),l(s[r],t);if(e&&0===a){i||(i="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),n.appendChild(o),l(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,i){var r;for(r=0;r<a;r+=1)s[r].animation.goToAndStop(t,e,i)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){var i;for(i=0;i<a;i+=1)s[i].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,i=[];for(t=0;t<e;t+=1)i.push(s[t].animation);return i},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){var i={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},r=t.attributes;i.path=r.getNamedItem("data-animation-path")?r.getNamedItem("data-animation-path").value:r.getNamedItem("data-bm-path")?r.getNamedItem("data-bm-path").value:r.getNamedItem("bm-path")?r.getNamedItem("bm-path").value:"",i.animType=r.getNamedItem("data-anim-type")?r.getNamedItem("data-anim-type").value:r.getNamedItem("data-bm-type")?r.getNamedItem("data-bm-type").value:r.getNamedItem("bm-type")?r.getNamedItem("bm-type").value:r.getNamedItem("data-bm-renderer")?r.getNamedItem("data-bm-renderer").value:r.getNamedItem("bm-renderer")?r.getNamedItem("bm-renderer").value:"canvas";var s=r.getNamedItem("data-anim-loop")?r.getNamedItem("data-anim-loop").value:r.getNamedItem("data-bm-loop")?r.getNamedItem("data-bm-loop").value:r.getNamedItem("bm-loop")?r.getNamedItem("bm-loop").value:"";""===s||(i.loop="false"!==s&&("true"===s||parseInt(s)));var a=r.getNamedItem("data-anim-autoplay")?r.getNamedItem("data-anim-autoplay").value:r.getNamedItem("data-bm-autoplay")?r.getNamedItem("data-bm-autoplay").value:!r.getNamedItem("bm-autoplay")||r.getNamedItem("bm-autoplay").value;i.autoplay="false"!==a,i.name=r.getNamedItem("data-name")?r.getNamedItem("data-name").value:r.getNamedItem("data-bm-name")?r.getNamedItem("data-bm-name").value:r.getNamedItem("bm-name")?r.getNamedItem("bm-name").value:"","false"===(r.getNamedItem("data-anim-prerender")?r.getNamedItem("data-anim-prerender").value:r.getNamedItem("data-bm-prerender")?r.getNamedItem("data-bm-prerender").value:r.getNamedItem("bm-prerender")?r.getNamedItem("bm-prerender").value:"")&&(i.prerender=!1),this.setParams(i)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,r=this.animationData.layers,s=r.length,a=t.layers,n=a.length;for(i=0;i<n;i+=1)for(e=0;e<s;){if(r[e].id==a[i].id){r[e]=a[i];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,i){i&&this.name!=i||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,i){this.goToAndStop(t,e,i),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?i=t:this.currentRawFrame+this.firstFrame>e&&(i=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==i&&this.goToAndStop(i,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var i,r=t.length;for(i=0;i<r;i+=1)this.segments.push(t[i])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,i=this.assets.length;e<i;){if(t==this.assets[e].id)return this.assets[e];e+=1}},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(NT={},NT.initExpressions=function(t){var e=0,i=[];function r(){var t,e=i.length;for(t=0;t<e;t+=1)i[t].release();i.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&r()},t.renderer.globalData.registerExpressionProperty=function(t){-1===i.indexOf(t)&&i.push(t)}},NT),NT;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var i,r=t.length,s=[];for(i=0;i<r;i+=1)s[i]=-t[i];return s}return t.propType?t.v:void 0}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var i=typeof t,r=typeof e;if("string"===i||"string"===r)return t+e;if(isNumerable(i,t)&&isNumerable(r,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(r,e))return(t=t.slice(0))[0]=t[0]+e,t;if(isNumerable(i,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var i=typeof t,r=typeof e;if(isNumerable(i,t)&&isNumerable(r,e))return"string"===i&&(t=parseInt(t)),"string"===r&&(e=parseInt(e)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(r,e))return(t=t.slice(0))[0]=t[0]-e,t;if(isNumerable(i,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var i,r,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,i=createTypedArray("float32",s),r=0;r<s;r+=1)i[r]=t[r]*e;return i}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,i=createTypedArray("float32",s),r=0;r<s;r+=1)i[r]=t*e[r];return i}return 0}function div(t,e){var i,r,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,i=createTypedArray("float32",s),r=0;r<s;r+=1)i[r]=t[r]/e;return i}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,i=createTypedArray("float32",s),r=0;r<s;r+=1)i[r]=t/e[r];return i}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t)),"string"==typeof e&&(e=parseInt(e)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,i){if(i<e){var r=i;i=e,e=r}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,r=Math.min(t.length,e.length),s=0;for(i=0;i<r;i+=1)s+=Math.pow(e[i]-t[i],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,i,r=t[0],s=t[1],a=t[2],n=Math.max(r,s,a),o=Math.min(r,s,a),h=(n+o)/2;if(n==o)e=i=0;else{var l=n-o;switch(i=.5<h?l/(2-n-o):l/(n+o),n){case r:e=(s-a)/l+(s<a?6:0);break;case s:e=(a-r)/l+2;break;case a:e=(r-s)/l+4}e/=6}return[e,i,h,t[3]]}function hue2rgb(t,e,i){return i<0&&(i+=1),1<i&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e,i,r,s=t[0],a=t[1],n=t[2];if(0===a)e=i=r=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),i=hue2rgb(h,o,s),r=hue2rgb(h,o,s-1/3)}return[e,i,r,t[3]]}function linear(t,e,i,r,s){if(void 0!==r&&void 0!==s||(r=e,s=i,e=0,i=1),i<e){var a=i;i=e,e=a}if(t<=e)return r;if(i<=t)return s;var n=i===e?0:(t-e)/(i-e);if(!r.length)return r+(s-r)*n;var o,h=r.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=r[o]+(s[o]-r[o])*n;return l}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var i,r=e.length;t||(t=createTypedArray("float32",r));var s=createTypedArray("float32",r),a=BMMath.random();for(i=0;i<r;i+=1)s[i]=t[i]+a*(e[i]-t[i]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,i,r){var s,a=t.length,n=shape_pool.newElement();n.setPathData(!!r,a);var o,h,l=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:l,h=i&&i[s]?i[s]:l,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,__expression_functions=[],scoped_bm_rt;if(data.xf){var i,len=data.xf.length;for(i=0;i<len;i+=1)__expression_functions[i]=eval("(function(){ return "+data.xf[i]+"}())")}var expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var i,r,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(r=i=0;i<n;){for(r=0;r<s;r+=1)a[r]+=-e+2*e*BMMath.random();i+=1}var o=5*time,h=o-Math.floor(o),l=createTypedArray("float32",s);if(1<s){for(r=0;r<s;r+=1)l[r]=this.pv[r]+a[r]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var i=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],r=Math.atan2(i[0],Math.sqrt(i[1]*i[1]+i[2]*i[2]))/degToRads;return[-Math.atan2(i[1],i[2])/degToRads,r,0]}function easeOut(t,e,i,r,s){return applyEase(easeOutBez,t,e,i,r,s)}function easeIn(t,e,i,r,s){return applyEase(easeInBez,t,e,i,r,s)}function ease(t,e,i,r,s){return applyEase(easeInOutBez,t,e,i,r,s)}function applyEase(t,e,i,r,s,a){void 0===s?(s=i,a=r):e=(e-i)/(r-i);var n=t(e=1<e?1:e<0?0:e);if($bm_isInstanceOfArray(s)){var o,h=s.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=(a[o]-s[o])*n+s[o];return l}return(a-s)*n+s}function nearestKey(t){var e,i,r,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(i=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)i=1,r=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){i=e+1,r=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){r=t-data.k[e].t>data.k[e+1].t-t?(i=e+2,data.k[e+1].t):(i=e+1,data.k[e].t);break}}-1===i&&(i=e+1,r=data.k[e].t)}else r=i=0;var a={};return a.index=i,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,r;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=data.k[t].hasOwnProperty("s")?data.k[t].s:data.k[t-1].e;for(r=s.length,i=0;i<r;i+=1)e[i]=s[i],e.value[i]=s[i];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,i){e.x&&(i.k=!0,i.x=!0,i.initiateExpression=ExpressionManager.initiateExpression,i.effectsSequence.push(i.initiateExpression(t,e,i).bind(i)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),i=this.getValueAtTime(t+-.01),r=0;if(e.length){var s;for(s=0;s<e.length;s+=1)r+=Math.pow(i[s]-e[s],2);r=100*Math.sqrt(r)}else r=0;return r},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,i,r=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(r.length)for(e=createTypedArray("float32",r.length),i=0;i<r.length;i+=1)e[i]=(s[i]-r[i])/-.001;else e=(s-r)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,i){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var r,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[l.length-1].t;if(h<=p)return this.pv;if(i?s=p-(r=e?Math.abs(p-elem.comp.globalData.frameRate*e):Math.max(0,p-this.elem.data.ip)):((!e||e>l.length-1)&&(e=l.length-1),r=p-(s=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/r)%2!=0)return this.getValueAtTime((r-(h-s)%r+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),m=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%r+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/r);if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a<n;a+=1)o[a]=(m[a]-f[a])*d+c[a];return o}return(m-f)*d+c}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-p)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-p)/.001*(u-y)}}return this.getValueAtTime(((h-s)%r+s)/this.comp.globalData.frameRate,0)}function h(t,e,i){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var r,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[0].t;if(p<=h)return this.pv;if(i?s=p+(r=e?Math.abs(elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>l.length-1)&&(e=l.length-1),r=(s=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/r)%2==0)return this.getValueAtTime(((p-h)%r+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((r-(p-h)%r+p)/this.comp.globalData.frameRate,0),d=Math.floor((p-h)/r)+1;if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(m[a]-f[a])*d;return o}return c-(m-f)*d}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(p-h)/.001;return o}return u+(u-y)*(p-h)/.001}}return this.getValueAtTime((r-(p-h)%r+p)/this.comp.globalData.frameRate,0)}function l(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var i,r,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(i=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(r=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)i[h]+=r[h];else i+=r;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)i[h]/=e;else i/=e;return i}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,i){var r=s(t,e,i);return r.dynamicProperties.length?r.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var i=this.a.getValueAtTime(t);e.translate(-i[0]*this.a.mult,-i[1]*this.a.mult,i[2]*this.a.mult)}if(this.appliedTransformations<2){var r=this.s.getValueAtTime(t);e.scale(r[0]*this.s.mult,r[1]*this.s.mult,r[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),l=this.rx.getValueAtTime(t),p=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(l*this.rx.mult).rotateZ(-p[2]*this.or.mult).rotateY(p[1]*this.or.mult).rotateX(p[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var f=this.px.getValueAtTime(t),m=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(f*this.px.mult,m*this.py.mult,-c*this.pz.mult)}else e.translate(f*this.px.mult,m*this.py.mult,0)}else{var d=this.p.getValueAtTime(t);e.translate(d[0]*this.p.mult,d[1]*this.p.mult,-d[2]*this.p.mult)}return e}.bind(r):r.getValueAtTime=function(t){return this.v.clone(new Matrix)}.bind(r),r.setGroupProperty=expressionHelpers.setGroupProperty,r};var p=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,i,r,s){var a=p(t,e,i,r,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=l,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==i&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function i(){}i.prototype={vertices:function(t,e){this.k&&this.getValue();var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var r,s=i._length,a=i[t],n=i.v,o=createSizedArray(s);for(r=0;r<s;r+=1)o[r]="i"===t||"o"===t?[a[r][0]-n[r][0],a[r][1]-n[r][1]]:[a[r][0],a[r][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(i));for(var r,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,l=0;o<h;){if(l+a[o].addedLength>n){var p=o,f=i.c&&o===h-1?0:o+1,m=(n-l)/a[o].addedLength;r=bez.getPointInSegment(i.v[p],i.v[f],i.o[p],i.i[f],m,a[o]);break}l+=a[o].addedLength,o+=1}return r||(r=i.c?[i.v[0][0],i.v[0][1]]:[i.v[i._length-1][0],i.v[i._length-1][1]]),r},vectorOnPath:function(t,e,i){t=1==t?this.v.c?0:.999:t;var r=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-r[0],n=s[1]-r[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===i?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([i],t),extendPrototype([i],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,i,r,s){var a=n(t,e,i,r,s);return a.propertyIndex=e.ix,a.lock=!1,3===i?expressionHelpers.searchExpressions(t,e.pt,a):4===i&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var i=this.calculateExpression(e);if(t.t===i)return t;var r={};return this.copyData(r,t),r.t=i.toString(),r.__complete=!1,r},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){if(this.data.d.x)return this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0};var ShapePathInterface=function(t,e,i){var r=e.sh;function s(t){if("Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t)return s.path}var a=propertyGroupFactory(s,i);return r.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return r.k&&r.getValue(),r}},shape:{get:function(){return r.k&&r.getValue(),r}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:i}}),s},propertyGroupFactory=function(e,i){return function(t){return(t=void 0===t?1:t)<=0?e:i(t-1)}},PropertyInterface=function(t,e){var i={_name:t};return function(t){return(t=void 0===t?1:t)<=0?i:e(--t)}},ShapeExpressionInterface=function(){function n(t,e,i){var r,s=[],a=t?t.length:0;for(r=0;r<a;r+=1)"gr"==t[r].ty?s.push(o(t[r],e[r],i)):"fl"==t[r].ty?s.push(h(t[r],e[r],i)):"st"==t[r].ty?s.push(l(t[r],e[r],i)):"tm"==t[r].ty?s.push(p(t[r],e[r],i)):"tr"==t[r].ty||("el"==t[r].ty?s.push(m(t[r],e[r],i)):"sr"==t[r].ty?s.push(c(t[r],e[r],i)):"sh"==t[r].ty?s.push(ShapePathInterface(t[r],e[r],i)):"rc"==t[r].ty?s.push(d(t[r],e[r],i)):"rd"==t[r].ty?s.push(u(t[r],e[r],i)):"rp"==t[r].ty&&s.push(y(t[r],e[r],i)));return s}function o(t,e,i){var r=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return r.content;default:return r.transform}};r.propertyGroup=propertyGroupFactory(r,i);var s=function(t,e,i){var r,s=function(t){for(var e=0,i=r.length;e<i;){if(r[e]._name===t||r[e].mn===t||r[e].propertyIndex===t||r[e].ix===t||r[e].ind===t)return r[e];e+=1}if("number"==typeof t)return r[t-1]};s.propertyGroup=propertyGroupFactory(s,i),r=n(t.it,e.it,s.propertyGroup),s.numProperties=r.length;var a=f(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,r.propertyGroup),a=f(t.it[t.it.length-1],e.it[e.it.length-1],r.propertyGroup);return r.content=s,r.transform=a,Object.defineProperty(r,"_name",{get:function(){return t.nm}}),r.numProperties=t.np,r.propertyIndex=t.ix,r.nm=t.nm,r.mn=t.mn,r}function h(t,e,i){function r(t){return"Color"===t||"color"===t?r.color:"Opacity"===t||"opacity"===t?r.opacity:void 0}return Object.defineProperties(r,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",i)),e.o.setGroupProperty(PropertyInterface("Opacity",i)),r}function l(t,e,i){var r=propertyGroupFactory(l,i),s=propertyGroupFactory(h,r);var a,n,o=t.d?t.d.length:0,h={};for(a=0;a<o;a+=1)n=a,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[a].p.setGroupProperty(s);function l(t){return"Color"===t||"color"===t?l.color:"Opacity"===t||"opacity"===t?l.opacity:"Stroke Width"===t||"stroke width"===t?l.strokeWidth:void 0}return Object.defineProperties(l,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),e.w.setGroupProperty(PropertyInterface("Stroke Width",r)),l}function p(e,t,i){function r(t){return t===e.e.ix||"End"===t||"end"===t?r.end:t===e.s.ix?r.start:t===e.o.ix?r.offset:void 0}var s=propertyGroupFactory(r,i);return r.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),r.propertyIndex=e.ix,r.propertyGroup=i,Object.defineProperties(r,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),r.mn=e.mn,r}function f(e,t,i){function r(t){return e.a.ix===t||"Anchor Point"===t?r.anchorPoint:e.o.ix===t||"Opacity"===t?r.opacity:e.p.ix===t||"Position"===t?r.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?r.rotation:e.s.ix===t||"Scale"===t?r.scale:e.sk&&e.sk.ix===t||"Skew"===t?r.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?r.skewAxis:void 0}var s=propertyGroupFactory(r,i);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(r,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),r.ty="tr",r.mn=e.mn,r.propertyGroup=i,r}function m(e,t,i){function r(t){return e.p.ix===t?r.position:e.s.ix===t?r.size:void 0}var s=propertyGroupFactory(r,i);r.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(r,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),r.mn=e.mn,r}function c(e,t,i){function r(t){return e.p.ix===t?r.position:e.r.ix===t?r.rotation:e.pt.ix===t?r.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?r.outerRadius:e.os.ix===t?r.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?r.innerRoundness:void 0:r.innerRadius}var s=propertyGroupFactory(r,i),a="tm"===t.sh.ty?t.sh.prop:t.sh;return r.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(r,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),r.mn=e.mn,r}function d(e,t,i){function r(t){return e.p.ix===t?r.position:e.r.ix===t?r.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?r.size:void 0}var s=propertyGroupFactory(r,i),a="tm"===t.sh.ty?t.sh.prop:t.sh;return r.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(r,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),r.mn=e.mn,r}function u(e,t,i){function r(t){if(e.r.ix===t||"Round Corners 1"===t)return r.radius}var s=propertyGroupFactory(r,i),a=t;return r.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(r,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),r.mn=e.mn,r}function y(e,t,i){function r(t){return e.c.ix===t||"Copies"===t?r.copies:e.o.ix===t||"Offset"===t?r.offset:void 0}var s=propertyGroupFactory(r,i),a=t;return r.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(r,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),r.mn=e.mn,r}return function(t,e,r){var s;function i(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?r:s[t-1];for(var e=0,i=s.length;e<i;){if(s[e]._name===t)return s[e];e+=1}}return i.propertyGroup=propertyGroupFactory(i,function(){return r}),s=n(t,e,i.propertyGroup),i.numProperties=s.length,i._name="Contents",i}}(),TextExpressionInterface=function(e){var i;function r(t){switch(t){case"ADBE Text Document":return r.sourceText}}return Object.defineProperty(r,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(i=new String(t)).value=t||new String(t)),i}}),r},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var i=this.getMatrix(e);return i.props[12]=i.props[13]=i.props[14]=0,this.applyPoint(i,t)}function n(t,e){var i=this.getMatrix(e);return this.applyPoint(i,t)}function o(t,e){var i=this.getMatrix(e);return i.props[12]=i.props[13]=i.props[14]=0,this.invertPoint(i,t)}function h(t,e){var i=this.getMatrix(e);return this.invertPoint(i,t)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var i,r=this._elem.hierarchy.length;for(i=0;i<r;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var i,r=this._elem.hierarchy.length;for(i=0;i<r;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function f(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var i,r=this._elem.hierarchy.length;for(i=0;i<r;i+=1)this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function m(){return[1,1,1,1]}return function(e){var i;function r(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return r.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return i;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return r.effect;case"ADBE Text Properties":return r.textInterface}}r.getMatrix=s,r.invertPoint=p,r.applyPoint=l,r.toWorld=n,r.toWorldVec=a,r.fromWorld=h,r.fromWorldVec=o,r.toComp=n,r.fromComp=f,r.sampleImage=m,r.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(i=TransformExpressionInterface((r._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(r,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(i,"rotation"),scale:getDescriptor(i,"scale"),position:getDescriptor(i,"position"),opacity:getDescriptor(i,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return i}},active:{get:function(){return e.isInRange}}}),r.startTime=e.data.st,r.index=e.data.ind,r.source=e.data.refId,r.height=0===e.data.ty?e.data.h:100,r.width=0===e.data.ty?e.data.w:100,r.inPoint=e.data.ip/e.comp.globalData.frameRate,r.outPoint=e.data.op/e.comp.globalData.frameRate,r._name=e.data.nm,r.registerMaskInterface=function(t){r.mask=new MaskManagerInterface(t,e)},r.registerEffectsInterface=function(t){r.effect=t},r}}(),CompExpressionInterface=function(r){function t(t){for(var e=0,i=r.layers.length;e<i;){if(r.layers[e].nm===t||r.layers[e].ind===t)return r.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:r.data.nm}),(t.layer=t).pixelAspect=1,t.height=r.data.h||r.globalData.compSize.h,t.width=r.data.w||r.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/r.globalData.frameRate,t.displayStartTime=0,t.numLayers=r.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity}}if(Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p)var i=ExpressionPropertyInterface(t.p);else{var r,s=ExpressionPropertyInterface(t.px),a=ExpressionPropertyInterface(t.py);t.pz&&(r=ExpressionPropertyInterface(t.pz))}return Object.defineProperty(e,"position",{get:function(){return t.p?i():[s(),a(),r?r():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,i=this.compositions.length;e<i;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function l(s,t,e,i){function r(t){for(var e=s.ef,i=0,r=e.length;i<r;){if(t===e[i].nm||t===e[i].mn||t===e[i].ix)return 5===e[i].ty?o[i]:o[i]();i+=1}throw new Error}var a,n=propertyGroupFactory(r,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(l(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,i)):o.push(p(t.effectElements[a],s.ef[a].ty,i,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(r,"color",{get:function(){return o[0]()}}),Object.defineProperties(r,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),r.active=r.enabled=0!==s.en,r}function p(t,e,i,r){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",r)),function(){return 10===e?i.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var i,r=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(i=0;i<a;i+=1)r.push(l(s[i],t.effectsManager.effectElements[i],e,t));var n=t.data.ef||[],o=function(t){for(i=0,a=n.length;i<a;){if(t===n[i].nm||t===n[i].mn||t===n[i].ix)return r[i];i+=1}};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}}}}(),MaskManagerInterface=function(){function a(t,e){this._mask=t,this._data=e}Object.defineProperty(a.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(a.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e,t){var i,r=createSizedArray(e.viewData.length),s=e.viewData.length;for(i=0;i<s;i+=1)r[i]=new a(e.viewData[i],e.masksProperties[i]);return function(t){for(i=0;i<s;){if(e.masksProperties[i].nm===t)return r[i];i+=1}}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(r,s,a){Object.defineProperty(r,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),r.numKeys=s.keyframes?s.keyframes.length:0,r.key=function(t){if(r.numKeys){var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var i="unidimensional"===a?new Number(e):Object.assign({},e);return i.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,i.value="unidimensional"===a?e[0]:e,i}return 0},r.valueAtTime=s.getValueAtTime,r.speedAtTime=s.getSpeedAtTime,r.velocityAtTime=s.getVelocityAtTime,r.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,i=t.pv*e,r=new Number(i);return r.value=i,o(r,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*e,r.value!==i&&((r=new Number(i)).value=i,o(r,t,"unidimensional")),r}}(t):function(e){e&&"pv"in e||(e=n);var i=1/e.mult,r=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",r),a=createTypedArray("float32",r);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<r;t+=1)s[t]=a[t]=e.v[t]*i;return s}}(t):e}}(),_2,a3;function SliderEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function AngleEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function ColorEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,1,0,i)}function PointEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,1,0,i)}function LayerIndexEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function MaskIndexEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function CheckboxEffect(t,e,i){this.p=PropertyFactory.getProp(e,t.v,0,0,i)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var i=t.ef||[];this.effectElements=[];var r,s,a=i.length;for(r=0;r<a;r++)s=new GroupEffect(i[r],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}_2=function(){function i(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}return function(t,e){this.pv=1,this.comp=t.comp,this.elem=t,this.mult=.01,this.propType="textSelector",this.textTotal=e.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],this.k=!0,this.x=!0,this.getValue=ExpressionManager.initiateExpression.bind(this)(t,e,this),this.getMult=i,this.getVelocityAtTime=expressionHelpers.getVelocityAtTime,this.kf?this.getValueAtTime=expressionHelpers.getValueAtTime.bind(this):this.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(this),this.setGroupProperty=expressionHelpers.setGroupProperty}}(),a3=TextSelectorProp.getTextSelectorProp,TextSelectorProp.getTextSelectorProp=function(t,e,i){return 1===e.t?new _2(t,e,i):a3(t,e,i)},extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i,r,s=this.data.ef.length,a=this.data.ef;for(i=0;i<s;i+=1){switch(r=null,a[i].ty){case 0:r=new SliderEffect(a[i],e,this);break;case 1:r=new AngleEffect(a[i],e,this);break;case 2:r=new ColorEffect(a[i],e,this);break;case 3:r=new PointEffect(a[i],e,this);break;case 4:case 7:r=new CheckboxEffect(a[i],e,this);break;case 10:r=new LayerIndexEffect(a[i],e,this);break;case 11:r=new MaskIndexEffect(a[i],e,this);break;case 5:r=new EffectsManager(a[i],e,this);break;default:r=new NoValueEffect(a[i],e,this)}r&&this.effectElements.push(r)}};var lottie={},_isFrozen=!1;function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i<e.length;i++){var r=e[i].split("=");if(decodeURIComponent(r[0])==t)return decodeURIComponent(r[1])}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.7.5";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""},queryString=myScript.src.replace(/^[^\?]+\??/,"");renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
+	"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bmRnd,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bmRnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e}roundValues(!1);var createElementID=(F=0,function(){return"__lottie_element_"+(F+=1)}),F;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,l,p;switch(h=r*(1-e),l=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=r*(1-(1-o)*e),n%6){case 0:i=r,s=p,a=h;break;case 1:i=l,s=r,a=h;break;case 2:i=h,s=r,a=p;break;case 3:i=h,s=l,a=r;break;case 4:i=p,s=h,a=r;break;case 5:i=r,s=h,a=l}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i+=1)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray=function(){function r(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):r(t,e)}:r}();function createSizedArray(t){return Array.apply(null,{length:t})}function createNS(t){return document.createElementNS(svgNS,t)}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Oa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Oa[t]||""}),Oa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function m(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,l,p,f,m,c,d,u){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=c,this.props[14]=d,this.props[15]=u,this}function d(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function u(t,e,r,i,s,a,n,o,h,l,p,f,m,c,d,u){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===f)return y[12]=y[12]*t+y[15]*m,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*p+y[15]*d,y[15]*=u,this._identityCalculated=!1,this;var g=y[0],v=y[1],b=y[2],P=y[3],E=y[4],x=y[5],S=y[6],A=y[7],_=y[8],k=y[9],T=y[10],M=y[11],D=y[12],C=y[13],F=y[14],w=y[15];return y[0]=g*t+v*s+b*h+P*m,y[1]=g*e+v*a+b*l+P*c,y[2]=g*r+v*n+b*p+P*d,y[3]=g*i+v*o+b*f+P*u,y[4]=E*t+x*s+S*h+A*m,y[5]=E*e+x*a+S*l+A*c,y[6]=E*r+x*n+S*p+A*d,y[7]=E*i+x*o+S*f+A*u,y[8]=_*t+k*s+T*h+M*m,y[9]=_*e+k*a+T*l+M*c,y[10]=_*r+k*n+T*p+M*d,y[11]=_*i+k*o+T*f+M*u,y[12]=D*t+C*s+F*h+w*m,y[13]=D*e+C*a+F*l+w*c,y[14]=D*r+C*n+F*p+w*d,y[15]=D*i+C*o+F*f+w*u,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function P(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function E(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function x(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function S(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function A(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function _(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function k(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=_(t[e]);return i}function T(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+l,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+l,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+l}return i}function M(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function D(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function C(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function F(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function w(){var t=this.props;return"matrix("+F(t[0])+","+F(t[1])+","+F(t[4])+","+F(t[5])+","+F(t[12])+","+F(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=c,this.translate=d,this.transform=u,this.applyToPoint=P,this.applyToX=E,this.applyToY=x,this.applyToZ=S,this.applyToPointArray=M,this.applyToTriplePoints=T,this.applyToPointStringified=D,this.toCSS=C,this.to2dCSS=w,this.clone=v,this.cloneFromProps=b,this.equals=g,this.inversePoints=k,this.inversePoint=_,this.getInverseMatrix=A,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var l,p=this,f=256,m=6,c="random",d=h.pow(f,m),u=h.pow(2,52),y=2*u,g=f-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<f;)a[i]=i++;for(i=0;i<f;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*f+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function P(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return E(e)}function E(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=P(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,E(o)]:null===t?function(){try{if(l)return E(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),E(t)}catch(t){var e=p.navigator,r=e&&e.plugins;return[+new Date,p,r,p.screen,E(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(m),e=d,r=0;t<u;)t=(t+r)*f,e*=f,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,P(E(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&b(i,a),t.state=function(){return b(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},P(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function f(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function m(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:f(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<l;++r)this._mSampleValues[r]=f(r*p,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=l-1;a!==n&&i[a]<=t;++a)s+=p;var o=s+(t-i[--a])/(i[a+1]-i[a])*p,h=m(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=m(e,r,i);if(0===a)return e;e-=(f(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=f(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+p,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)Object.prototype.hasOwnProperty.call(i,a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){var D=Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var p=function(t,e,r,i){var s,a,n,o,h,l,p=defaultCurveSegments,f=0,m=[],c=[],d=bezierLengthPool.newElement();for(n=r.length,s=0;s<p;s+=1){for(h=s/(p-1),a=l=0;a<n;a+=1)o=bmPow(1-h,3)*t[a]+3*bmPow(1-h,2)*h*r[a]+3*(1-h)*bmPow(h,2)*i[a]+bmPow(h,3)*e[a],m[a]=o,null!==c[a]&&(l+=bmPow(m[a]-c[a],2)),c[a]=m[a];l&&(f+=l=bmSqrt(l)),d.percents[s]=h,d.lengths[s]=f}return d.addedLength=f,d};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!b[s]){var a,n,o,h,l,p,f,m=defaultCurveSegments,c=0,d=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var u=new g(m);for(o=r.length,a=0;a<m;a+=1){for(f=createSizedArray(o),l=a/(m-1),n=p=0;n<o;n+=1)h=bmPow(1-l,3)*t[n]+3*bmPow(1-l,2)*l*(t[n]+r[n])+3*(1-l)*bmPow(l,2)*(e[n]+i[n])+bmPow(l,3)*e[n],f[n]=h,null!==d&&(p+=bmPow(f[n]-d[n],2));c+=p=bmSqrt(p),u.points[a]=new v(p,f),d=f}u.segmentLength=c,b[s]=u}return b[s]});function C(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bmFloor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,l=!0;l;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),l=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];l=!1}return r[a]+(r[a+1]-r[a])*o}var F=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segmentsLengthPool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,l=0;for(e=0;e<o-1;e+=1)h[e]=p(s[e],s[e+1],a[e],n[e+1]),l+=h[e].addedLength;return i&&o&&(h[e]=p(s[e],s[0],a[e],n[0]),l+=h[e].addedLength),r.totalLength=l,r},getNewSegment:function(t,e,r,i,s,a,n){s<0?s=0:1<s&&(s=1);var o,h=C(s,n),l=C(a=1<a?1:a,n),p=t.length,f=1-h,m=1-l,c=f*f*f,d=h*f*f*3,u=h*h*f*3,y=h*h*h,g=f*f*m,v=h*f*m+f*h*m+f*f*l,b=h*h*m+f*h*l+h*f*l,P=h*h*l,E=f*m*m,x=h*m*m+f*l*m+f*m*l,S=h*l*m+f*l*l+h*m*l,A=h*l*l,_=m*m*m,k=l*m*m+m*l*m+m*m*l,T=l*l*m+m*l*l+l*m*l,M=l*l*l;for(o=0;o<p;o+=1)F[4*o]=D.round(1e3*(c*t[o]+d*r[o]+u*i[o]+y*e[o]))/1e3,F[4*o+1]=D.round(1e3*(g*t[o]+v*r[o]+b*i[o]+P*e[o]))/1e3,F[4*o+2]=D.round(1e3*(E*t[o]+x*r[o]+S*i[o]+A*e[o]))/1e3,F[4*o+3]=D.round(1e3*(_*t[o]+k*r[o]+T*i[o]+M*e[o]))/1e3;return F},getPointInSegment:function(t,e,r,i,s,a){var n=C(s,a),o=1-n;return[D.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,D.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var l,p=D.sqrt(D.pow(i-t,2)+D.pow(s-e,2)+D.pow(a-r,2)),f=D.sqrt(D.pow(n-t,2)+D.pow(o-e,2)+D.pow(h-r,2)),m=D.sqrt(D.pow(n-i,2)+D.pow(o-s,2)+D.pow(h-a,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}!function(){for(var s=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),r=Math.max(0,16-(e-s)),i=setTimeout(function(){t(e+r)},r);return s=e+r,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function f(t,e,r){var i,s,a,n,o,h,l=t.length;for(s=0;s<l;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),i.hasMask){var p=i.masksProperties;for(n=p.length,a=0;a<n;a+=1)if(p[a].pt.k.i)d(p[a].pt.k);else for(h=p[a].pt.k.length,o=0;o<h;o+=1)p[a].pt.k[o].s&&d(p[a].pt.k[o].s[0]),p[a].pt.k[o].e&&d(p[a].pt.k[o].e[0])}0===i.ty?(i.layers=m(i.refId,e),f(i.layers,e,r)):4===i.ty?c(i.shapes):5===i.ty&&u(i)}}function m(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}return null}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)d(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&d(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&d(t[e].ks.k[r].e[0]);else"gr"===t[e].ty&&c(t[e].it)}function d(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&null))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(d(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function l(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);else"gr"===t[e].ty&&l(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function u(t){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),f(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=f,t}var dataManager=dataFunctionManager();function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],r="normal",i="normal",s=e.length,a=0;a<s;a+=1)switch(e[a].toLowerCase()){case"italic":i="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:i,weight:t.fWeight||r}}var FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function m(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=function(t){var e,r=t.split(","),i=r.length,s=[];for(e=0;e<i;e+=1)"sans-serif"!==r[e]&&"monospace"!==r[e]&&s.push(r[e]);return s.join(",")}(t)+", "+e,{node:i,w:s,parent:r}}function c(t,e){var r=createNS("text");r.style.fontSize="100px";var i=getFontProperties(e);return r.setAttribute("font-family",e.fFamily),r.setAttribute("font-style",i.style),r.setAttribute("font-weight",i.weight),r.textContent="1",e.fClass?(r.style.fontFamily="inherit",r.setAttribute("class",e.fClass)):r.style.fontFamily=e.fFamily,t.appendChild(r),createTag("canvas").getContext("2d").font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,r}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i=t.list,s=i.length,a=s;for(r=0;r<s;r+=1){var n,o,h=!0;if(i[r].loaded=!1,i[r].monoCase=m(i[r].fFamily,"monospace"),i[r].sansCase=m(i[r].fFamily,"sans-serif"),i[r].fPath){if("p"===i[r].fOrigin||3===i[r].origin){if(0<(n=document.querySelectorAll('style[f-forigin="p"][f-family="'+i[r].fFamily+'"], style[f-origin="3"][f-family="'+i[r].fFamily+'"]')).length&&(h=!1),h){var l=createTag("style");l.setAttribute("f-forigin",i[r].fOrigin),l.setAttribute("f-origin",i[r].origin),l.setAttribute("f-family",i[r].fFamily),l.type="text/css",l.innerText="@font-face {font-family: "+i[r].fFamily+"; font-style: normal; src: url('"+i[r].fPath+"');}",e.appendChild(l)}}else if("g"===i[r].fOrigin||1===i[r].origin){for(n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),o=0;o<n.length;o+=1)-1!==n[o].href.indexOf(i[r].fPath)&&(h=!1);if(h){var p=createTag("link");p.setAttribute("f-forigin",i[r].fOrigin),p.setAttribute("f-origin",i[r].origin),p.type="text/css",p.rel="stylesheet",p.href=i[r].fPath,document.body.appendChild(p)}}else if("t"===i[r].fOrigin||2===i[r].origin){for(n=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),o=0;o<n.length;o+=1)i[r].fPath===n[o].src&&(h=!1);if(h){var f=createTag("link");f.setAttribute("f-forigin",i[r].fOrigin),f.setAttribute("f-origin",i[r].origin),f.setAttribute("rel","stylesheet"),f.setAttribute("href",i[r].fPath),e.appendChild(f)}}}else i[r].loaded=!0,a-=1;i[r].helper=c(e,i[r]),i[r].cache={},this.fonts.push(i[r])}0===a?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,r)),a},getFontByName:function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},checkLoadedFonts:function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),PropertyFactory=function(){var f=initialDefaultFrame,s=Math.abs;function m(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,l,p,f,m=e.lastIndex,c=m,d=this.keyframes.length-1,u=!0;u;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===d-1&&t>=a.t-i){s.h&&(s=a),m=0;break}if(a.t-i>t){m=c;break}c<d-1?c+=1:(m=0,u=!1)}var y,g,v,b,P,E,x,S,A,_,k=a.t-i,T=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var M=s.bezierData;if(k<=t||t<T){var D=k<=t?M.points.length-1:0;for(o=M.points[D].point.length,n=0;n<o;n+=1)r[n]=M.points[D].point[n]}else{s.__fnct?f=s.__fnct:(f=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=f),h=f((t-T)/(k-T));var C,F=M.segmentLength*h,w=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,u=!0,l=M.points.length;u;){if(w+=M.points[p].partialLength,0===F||0===h||p===M.points.length-1){for(o=M.points[p].point.length,n=0;n<o;n+=1)r[n]=M.points[p].point[n];break}if(w<=F&&F<w+M.points[p+1].partialLength){for(C=(F-w)/M.points[p+1].partialLength,o=M.points[p].point.length,n=0;n<o;n+=1)r[n]=M.points[p].point[n]+(M.points[p+1].point[n]-M.points[p].point[n])*C;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=w-M.points[p].partialLength,e._lastKeyframeIndex=c}}else{var I,B,R,V,L;if(d=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(k<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=T)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var G=N(s.s),z=N(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],l=t[0],p=t[1],f=t[2],m=t[3],c=e[0],d=e[1],u=e[2],y=e[3];(s=l*c+p*d+f*u+m*y)<0&&(s=-s,c=-c,d=-d,u=-u,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*l+o*c,h[1]=n*p+o*d,h[2]=n*f+o*u,h[3]=n*m+o*y,h}(G,z,(t-T)/(k-T)),b=v[0],P=v[1],E=v[2],x=v[3],S=Math.atan2(2*P*x-2*b*E,1-2*P*P-2*E*E),A=Math.asin(2*b*P+2*E*x),_=Math.atan2(2*b*x-2*P*E,1-2*b*b-2*E*E),g[0]=S/degToRads,g[1]=A/degToRads,g[2]=_/degToRads}else for(c=0;c<d;c+=1)1!==s.h&&(h=k<=t?1:t<T?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?f=s.__fnct[c]:(I=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],B=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],R=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],V=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],f=BezierFactory.getBezierEasing(I,B,R,V).get,s.__fnct[c]=f)):s.__fnct?f=s.__fnct:(I=s.o.x,B=s.o.y,R=s.i.x,V=s.i.y,f=BezierFactory.getBezierEasing(I,B,R,V).get,s.__fnct=f),f((t-T)/(k-T)))),y=a.s||s.e,L=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=L:r=L}return e.lastIndex=m,r}function N(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),l=Math.sin(i/2);return[o*h*n+s*a*l,o*a*n+s*h*l,s*h*n-o*a*l,s*a*n-o*h*l]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function d(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.addEffect=y}function o(t,e,r,i){var s;this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=d,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=u,this.setVValue=d,this.interpolateValue=m,this.effectsSequence=[c.bind(this)],this.addEffect=y}function l(t,e,r,i){var s;this.propType="multidimensional";var a,n,o,h,l=e.k.length;for(s=0;s<l-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=d,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=createTypedArray("float32",p),this.pv=createTypedArray("float32",p),s=0;s<p;s+=1)this.v[s]=f,this.pv[s]=f;this._caching={lastFrame:f,lastIndex:0,value:createTypedArray("float32",p)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new l(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=null,e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var e;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var r,i;if(e=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(r=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(r=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(r[0]=s.getValueAtTime((s.keyframes[0].t+.01)/e,0),r[1]=a.getValueAtTime((a.keyframes[0].t+.01)/e,0),i[0]=s.getValueAtTime(s.keyframes[0].t/e,0),i[1]=a.getValueAtTime(a.keyframes[0].t/e,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(r[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/e,0),r[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/e,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/e,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/e,0)):(r=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/e,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/e,a.offsetTime))}else r=i=n;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[i]||a[i]&&!s)&&(a[i]=pointPool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,l,p,f,m=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,m=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=m,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(m=y,!(a=1===d.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<d.t-this.offsetTime)p=0;else{var b;d.__fnct?b=d.__fnct:(b=BezierFactory.getBezierEasing(d.o.x,d.o.y,d.i.x,d.i.y).get,d.__fnct=b),p=b((t-(d.t-this.offsetTime))/(u.t-this.offsetTime-(d.t-this.offsetTime)))}s=u.s?u.s[0]:d.e[0]}i=d.s[0]}for(h=e._length,l=i.i[0].length,r.lastIndex=m,n=0;n<h;n+=1)for(o=0;o<l;o+=1)f=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*p,e.i[n][o]=f,f=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*p,e.o[n][o]=f,f=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*p,e.v[n][o]=f}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shapePool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(e=0;e<r;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*o/(2*s),m=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var d=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?l:p,i=n?f:m;var u=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),v=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(u,y,u-g*i*r*d,y-v*i*r*d,u+g*i*r*d,y+v*i*r*d,t,!0),n=!n,c+=a*d}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=.5*-Math.PI,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),l=i*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),f=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*s*o,l-f*a*s*o,h+p*a*s*o,l+f*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bmMin(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var f={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new p(t,e):6===r?i=new h(t,e):7===r&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return f}(),ShapeModifiers=(Yr={},Zr={},Yr.registerModifier=function(t,e){Zr[t]||(Zr[t]=e)},Yr.getModifier=function(t,e,r){return new Zr[t](e,r)},Yr),Yr,Zr;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){var s;this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;n<l;n+=1){var p,f;if(!((o=a[n]).e*s<i||o.s*s>i+r))p=o.s*s<=i?0:(o.s*s-i)/r,f=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([p,f])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segmentsLengthPool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i,s;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),e=1<this.s.v?1+a:this.s.v<0?0+a:this.s.v+a,(r=1<this.e.v?1+a:this.e.v<0?0+a:this.e.v+a)<e){var n=e;e=r,r=n}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var o,h,l,p,f,m=this.shapes.length,c=0;if(r===e)for(s=0;s<m;s+=1)this.shapes[s].localShapeCollection.releaseShapes(),this.shapes[s].shape._mdf=!0,this.shapes[s].shape.paths=this.shapes[s].localShapeCollection,this._mdf&&(this.shapes[s].pathsData.length=0);else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(s=0;s<m;s+=1)this.shapes[s].pathsData.length=0,this.shapes[s].shape._mdf=!0}else{var d,u,y=[];for(s=0;s<m;s+=1)if((d=this.shapes[s]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=d.shape.paths)._length,f=0,!d.shape._mdf&&d.pathsData.length)f=d.totalShapeLength;else{for(l=this.releasePathsData(d.pathsData),o=0;o<h;o+=1)p=bez.getSegmentsLength(i.shapes[o]),l.push(p),f+=p.totalLength;d.totalShapeLength=f,d.pathsData=l}c+=f,d.shape._mdf=!0}else d.shape.paths=d.localShapeCollection;var g,v=e,b=r,P=0;for(s=m-1;0<=s;s-=1)if((d=this.shapes[s]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&1<m?(g=this.calculateShapeEdges(e,r,d.totalShapeLength,P,c),P+=d.totalShapeLength):g=[[v,b]],h=g.length,o=0;o<h;o+=1){v=g[o][0],b=g[o][1],y.length=0,b<=1?y.push({s:d.totalShapeLength*v,e:d.totalShapeLength*b}):1<=v?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(b-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(b-1)}));var E=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var x=E.pop();this.addPaths(E,u),E=this.addShapes(d,y[1],x)}else this.addPaths(E,u),E=this.addShapes(d,y[1]);this.addPaths(E,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,l,p,f=t.pathsData,m=t.shape.paths.shapes,c=t.shape.paths._length,d=0,u=[],y=!0;for(p=r?(o=r._length,r._length):(r=shapePool.newElement(),o=0),u.push(r),i=0;i<c;i+=1){for(h=f[i].lengths,r.c=m[i].c,a=m[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(d+(n=h[s-1]).addedLength<e.s)d+=n.addedLength,r.c=!1;else{if(d>e.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(m[i].v[s-1],m[i].o[s-1],m[i].i[s],m[i].v[s],r,o,y),y=!1):(l=bez.getNewSegment(m[i].v[s-1],m[i].v[s],m[i].o[s-1],m[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(m[i].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(m[i].v[s-1],m[i].o[s-1],m[i].i[0],m[i].v[0],r,o,y),y=!1):(l=bez.getNewSegment(m[i].v[s-1],m[i].v[0],m[i].o[s-1],m[i].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[p][0],r.v[p][1],"i",p),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;i<c-1&&(r=shapePool.newElement(),y=!0,u.push(r),o=0)}return u},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r,i=shapePool.newElement();i.c=t.c;var s,a,n,o,h,l,p,f,m,c,d,u,y=t._length,g=0;for(r=0;r<y;r+=1)s=t.v[r],n=t.o[r],a=t.i[r],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==r&&r!==y-1||t.c?(o=0===r?t.v[y-1]:t.v[r-1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=d=s[0]+(o[0]-s[0])*l,f=u=s[1]-(s[1]-o[1])*l,m=p-(p-s[0])*roundCorner,c=f-(f-s[1])*roundCorner,i.setTripleAt(p,f,m,c,d,u,g),g+=1,o=r===y-1?t.v[0]:t.v[r+1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=m=s[0]+(o[0]-s[0])*l,f=c=s[1]+(o[1]-s[1])*l,d=p-(p-s[0])*roundCorner,u=f-(f-s[1])*roundCorner,i.setTripleAt(p,f,m,c,d,u,g)):i.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):i.setTripleAt(t.v[r][0],t.v[r][1],t.o[r][0],t.o[r][1],t.i[r][0],t.i[r][1],g),g+=1;return i},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var r=e/100,i=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)i[0]+=t.v[a][0],i[1]+=t.v[a][1];i[0]/=s,i[1]/=s;var n,o,h,l,p,f,m=shapePool.newElement();for(m.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(i[0]-t.v[a][0])*r,o=t.v[a][1]+(i[1]-t.v[a][1])*r,h=t.o[a][0]+(i[0]-t.o[a][0])*-r,l=t.o[a][1]+(i[1]-t.o[a][1])*-r,p=t.i[a][0]+(i[0]-t.i[a][0])*-r,f=t.i[a][1]+(i[1]-t.i[a][1])*-r,m.setTripleAt(n,o,h,l,p,f,a);return m},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){for(this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);0<r;)r-=1,this._elements.unshift(e[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=this.pMatrix.props,c=this.rMatrix.props,d=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,y,g=0;if(0<l){for(;g<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),g+=p)}else if(l<0){for(;f<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),g-=p)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),u=0;u<y;u+=1)r[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<y;u+=1)r[u]=this.matrix.props[u];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shapePool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,r){var i="";if(t.e)i=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),i=e+s}else i=r,i+=t.u?t.u:"",i+=t.p;return i}function e(){this._imageLoaded=t.bind(this),this.testImageLoaded=function(t){var e=0,r=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(r)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return e.prototype={loadAssets:function(t,e){var r;this.imagesLoadedCb=e;var i=t.length;for(r=0;r<i;r+=1)t[r].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[r])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,r=this.images.length;e<r;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function(t){var e=a(t,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.src=e;var i={img:r,assetData:t};return i},createImageData:function(t){var e=a(t,this.assetsPath,this.path),r=createNS("image");isSafari?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(r);var i={img:r,assetData:t};return i},imageLoaded:t,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},e}(),featureSupport=(fx={maskType:!0},(/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))&&(fx.maskType=!1),fx),fx,filtersFactory=(gx={},gx.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},gx.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},gx),gx,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}();function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,l,p,f,m,c,d,u,y,g,v,b,P,E=this._moreOptions.alignment.v,x=this._animatorsData,S=this._textData,A=this.mHelper,_=this._renderType,k=this.renderedLetters.length,T=t.l;if(this._hasMaskedPath){if(P=this._pathData.m,!this._pathData.n||this._pathData._mdf){var M,D=P.v;for(this._pathData.r&&(D=D.reverse()),n={tLength:0,segments:[]},a=D._length-1,s=g=0;s<a;s+=1)M=bez.buildBezierData(D.v[s],D.v[s+1],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[s+1][0]-D.v[s+1][0],D.i[s+1][1]-D.v[s+1][1]]),n.tLength+=M.segmentLength,n.segments.push(M),g+=M.segmentLength;s=a,P.v.c&&(M=bez.buildBezierData(D.v[s],D.v[0],[D.o[s][0]-D.v[s][0],D.o[s][1]-D.v[s][1]],[D.i[0][0]-D.v[0][0],D.i[0][1]-D.v[0][1]]),n.tLength+=M.segmentLength,n.segments.push(M),g+=M.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,f=1,p=!(l=m=0),u=n.segments,o<0&&P.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),f=(d=u[m=u.length-1].points).length-1;o<0;)o+=d[f].partialLength,(f-=1)<0&&(f=(d=u[m-=1].points).length-1);c=(d=u[m].points)[f-1],y=(h=d[f]).partialLength}a=T.length,i=r=0;var C,F,w,I,B,R=1.2*t.finalSize*.714,V=!0;w=x.length;var L,G,z,N,O,H,j,q,W,Y,X,$,K=-1,Z=o,U=m,J=f,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(T[s].n){for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(F=0;F<w;F+=1)(C=x[F].a).t.propType&&(nt&&2===t.j&&(it+=C.t.v*st),(B=x[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?rt+=C.t.v*B[0]*st:rt+=C.t.v*B*st);nt=!1}for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(A.reset(),N=1,T[s].n)r=0,i+=t.yOffset,i+=V?1:0,o=Z,V=!1,this._hasMaskedPath&&(f=J,c=(d=u[m=U].points)[f-1],y=(h=d[f]).partialLength,l=0),$=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==T[s].line){switch(t.j){case 1:o+=g-t.lineWidths[T[s].line];break;case 2:o+=(g-t.lineWidths[T[s].line])/2}Q=T[s].line}K!==T[s].ind&&(T[K]&&(o+=T[K].extra),o+=T[s].an/2,K=T[s].ind),o+=E[0]*T[s].an*.005;var ot=0;for(F=0;F<w;F+=1)(C=x[F].a).p.propType&&((B=x[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?ot+=C.p.v[0]*B[0]:ot+=C.p.v[0]*B),C.a.propType&&((B=x[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?ot+=C.a.v[0]*B[0]:ot+=C.a.v[0]*B);for(p=!0;p;)o+ot<=l+y||!d?(v=(o+ot-l)/h.partialLength,G=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,A.translate(-E[0]*T[s].an*.005,-E[1]*R*.01),p=!1):d&&(l+=h.partialLength,(f+=1)>=d.length&&(f=0,d=u[m+=1]?u[m].points:P.v.c?u[m=f=0].points:(l-=h.partialLength,null)),d&&(c=h,y=(h=d[f]).partialLength));L=T[s].an/2-T[s].add,A.translate(-L,0,0)}else L=T[s].an/2-T[s].add,A.translate(-L,0,0),A.translate(-E[0]*T[s].an*.005,-E[1]*R*.01,0);for(F=0;F<w;F+=1)(C=x[F].a).t.propType&&(B=x[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?B.length?o+=C.t.v*B[0]:o+=C.t.v*B:B.length?r+=C.t.v*B[0]:r+=C.t.v*B));for(t.strokeWidthAnim&&(H=t.sw||0),t.strokeColorAnim&&(O=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(j=[t.fc[0],t.fc[1],t.fc[2]]),F=0;F<w;F+=1)(C=x[F].a).a.propType&&((B=x[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?A.translate(-C.a.v[0]*B[0],-C.a.v[1]*B[1],C.a.v[2]*B[2]):A.translate(-C.a.v[0]*B,-C.a.v[1]*B,C.a.v[2]*B));for(F=0;F<w;F+=1)(C=x[F].a).s.propType&&((B=x[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars)).length?A.scale(1+(C.s.v[0]-1)*B[0],1+(C.s.v[1]-1)*B[1],1):A.scale(1+(C.s.v[0]-1)*B,1+(C.s.v[1]-1)*B,1));for(F=0;F<w;F+=1){if(C=x[F].a,B=x[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars),C.sk.propType&&(B.length?A.skewFromAxis(-C.sk.v*B[0],C.sa.v*B[1]):A.skewFromAxis(-C.sk.v*B,C.sa.v*B)),C.r.propType&&(B.length?A.rotateZ(-C.r.v*B[2]):A.rotateZ(-C.r.v*B)),C.ry.propType&&(B.length?A.rotateY(C.ry.v*B[1]):A.rotateY(C.ry.v*B)),C.rx.propType&&(B.length?A.rotateX(C.rx.v*B[0]):A.rotateX(C.rx.v*B)),C.o.propType&&(B.length?N+=(C.o.v*B[0]-N)*B[0]:N+=(C.o.v*B-N)*B),t.strokeWidthAnim&&C.sw.propType&&(B.length?H+=C.sw.v*B[0]:H+=C.sw.v*B),t.strokeColorAnim&&C.sc.propType)for(q=0;q<3;q+=1)B.length?O[q]+=(C.sc.v[q]-O[q])*B[0]:O[q]+=(C.sc.v[q]-O[q])*B;if(t.fillColorAnim&&t.fc){if(C.fc.propType)for(q=0;q<3;q+=1)B.length?j[q]+=(C.fc.v[q]-j[q])*B[0]:j[q]+=(C.fc.v[q]-j[q])*B;C.fh.propType&&(j=B.length?addHueToRGB(j,C.fh.v*B[0]):addHueToRGB(j,C.fh.v*B)),C.fs.propType&&(j=B.length?addSaturationToRGB(j,C.fs.v*B[0]):addSaturationToRGB(j,C.fs.v*B)),C.fb.propType&&(j=B.length?addBrightnessToRGB(j,C.fb.v*B[0]):addBrightnessToRGB(j,C.fb.v*B))}}for(F=0;F<w;F+=1)(C=x[F].a).p.propType&&(B=x[F].s.getMult(T[s].anIndexes[F],S.a[F].s.totalChars),this._hasMaskedPath?B.length?A.translate(0,C.p.v[1]*B[0],-C.p.v[2]*B[1]):A.translate(0,C.p.v[1]*B,-C.p.v[2]*B):B.length?A.translate(C.p.v[0]*B[0],C.p.v[1]*B[1],-C.p.v[2]*B[2]):A.translate(C.p.v[0]*B,C.p.v[1]*B,-C.p.v[2]*B));if(t.strokeWidthAnim&&(W=H<0?0:H),t.strokeColorAnim&&(Y="rgb("+Math.round(255*O[0])+","+Math.round(255*O[1])+","+Math.round(255*O[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),this._hasMaskedPath){if(A.translate(0,-t.ls),A.translate(0,E[1]*R*.01+i,0),S.p.p){b=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(b)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),A.rotate(-ht*Math.PI/180)}A.translate(G,z,0),o-=E[0]*T[s].an*.005,T[s+1]&&K!==T[s+1].ind&&(o+=T[s].an/2,o+=.001*t.tr*t.finalSize)}else{switch(A.translate(r,i,0),t.ps&&A.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:A.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line]),0,0);break;case 2:A.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line])/2,0,0)}A.translate(0,-t.ls),A.translate(L,0,0),A.translate(E[0]*T[s].an*.005,E[1]*R*.01,0),r+=T[s].l+.001*t.tr*t.finalSize}"html"===_?tt=A.toCSS():"svg"===_?tt=A.to2dCSS():et=[A.props[0],A.props[1],A.props[2],A.props[3],A.props[4],A.props[5],A.props[6],A.props[7],A.props[8],A.props[9],A.props[10],A.props[11],A.props[12],A.props[13],A.props[14],A.props[15]],$=N}this.lettersChangedFlag=k<=s?(I=new LetterProps($,W,Y,X,tt,et),this.renderedLetters.push(I),k+=1,!0):(I=this.renderedLetters[s]).update($,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&!(r===i-1||t[r+1].t>e);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),s+=1):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,c=0,d=0,u=0,y=[],g=0,v=0,b=h.getFontByName(t.f),P=0,E=getFontProperties(b);t.fWeight=E.weight,t.fStyle=E.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var x,S=t.tr/1e3*t.finalSize;if(t.sz)for(var A,_,k=!0,T=t.sz[0],M=t.sz[1];k;){g=A=0,r=(_=this.buildFinalText(t.t)).length,S=t.tr/1e3*t.finalSize;var D=-1;for(e=0;e<r;e+=1)x=_[e].charCodeAt(0),i=!1," "===_[e]?D=e:13!==x&&3!==x||(i=!(g=0),A+=t.finalLineHeight||1.2*t.finalSize),T<g+(P=h.chars?(o=h.getCharData(_[e],b.fStyle,b.fFamily),i?0:o.w*t.finalSize/100):h.measureText(_[e],t.f,t.finalSize))&&" "!==_[e]?(-1===D?r+=1:e=D,A+=t.finalLineHeight||1.2*t.finalSize,_.splice(e,D===e?1:0,"\r"),D=-1,g=0):(g+=P,g+=S);A+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&M<A?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=_,r=t.finalText.length,k=!1)}g=-S;var C,F=P=0;for(e=0;e<r;e+=1)if(i=!1,13===(x=(C=t.finalText[e]).charCodeAt(0))||3===x?(F=0,y.push(g),v=v<g?g:v,g=-2*S,i=!(s=""),u+=1):s=C,P=h.chars?(o=h.getCharData(C,b.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===C?F+=P+S:(g+=P+S+F,F=0),p.push({l:P,an:P,add:c,n:i,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==m){if(c+=P,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=P);d<=e;)p[d].an=c,p[d].ind=f,p[d].extra=P,d+=1;f+=1,c=0}}else if(3==m){if(c+=P,""===s||e===r-1){for(""===s&&(c-=P);d<=e;)p[d].an=c,p[d].ind=f,p[d].extra=P,d+=1;c=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var w,I,B,R,V=l.a;n=V.length;var L=[];for(a=0;a<n;a+=1){for((w=V[a]).a.sc&&(t.strokeColorAnim=!0),w.a.sw&&(t.strokeWidthAnim=!0),(w.a.fc||w.a.fh||w.a.fs||w.a.fb)&&(t.fillColorAnim=!0),R=0,B=w.s.b,e=0;e<r;e+=1)(I=p[e]).anIndexes[a]=R,(1==B&&""!==I.val||2==B&&""!==I.val&&" "!==I.val||3==B&&(I.n||" "==I.val||e==r-1)||4==B&&(I.n||e==r-1))&&(1===w.s.rn&&L.push(R),R+=1);l.a[a].s.totalChars=R;var G,z=-1;if(1===w.s.rn)for(e=0;e<r;e+=1)z!=(I=p[e]).anIndexes[a]&&(z=I.anIndexes[a],G=L.splice(Math.floor(Math.random()*L.length),1)[0]),I.anIndexes[a]=G}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,d=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,l=this.data.sh;if(2===l)n=a(n=h===o?h<=t?1:0:c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(3===l)n=a(n=h===o?h<=t?0:1:1-c(0,d(.5/(h-o)+(t-o)/(h-o),1)));else if(4===l)h===o?n=0:(n=c(0,d(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===l){if(h===o)n=0;else{var p=h-o,f=-p/2+(t=d(c(0,t+.5-o),h-o)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=a(n)}else n=6===l?a(n=h===o?0:(t=d(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),poolFactory=function(t,e,r){var i=0,s=t,a=createSizedArray(s);return{newElement:function(){return i?a[i-=1]:e()},release:function(t){i===s&&(a=pooling.double(a),s*=2),r&&r(t),a[i]=t,i+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},pointPool=poolFactory(8,function(){return createTypedArray("float32",2)}),shapePool=(mB=poolFactory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)pointPool.release(t.v[e]),pointPool.release(t.i[e]),pointPool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),mB.clone=function(t){var e,r=mB.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},mB),mB,shapeCollectionPool=(uB={newShapeCollection:function(){var t;t=vB?xB[vB-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shapePool.release(t.shapes[e]);t._length=0,vB===wB&&(xB=pooling.double(xB),wB*=2);xB[vB]=t,vB+=1}},vB=0,wB=4,xB=createSizedArray(wB),uB),uB,vB,wB,xB,segmentsLengthPool=poolFactory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezierLengthPool.release(t.lengths[e]);t.lengths.length=0}),bezierLengthPool=poolFactory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function HybridRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&!1===e.hideOnTransparent),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s,a=this.globalData.defs,n=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(n),this.solidPath="";var o,h,l,p,f,m,c=this.masksProperties,d=0,u=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<n;i+=1)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!==c[i].mode&&"i"!==c[i].mode||0!==d?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),s=createNS("path"),"n"===c[i].mode)this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:s,lastPath:""},a.appendChild(s);else{var b;if(d+=1,s.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),s.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",m=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),b=createElementID(),(p=createNS("filter")).setAttribute("id",b),(f=createNS("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),a.appendChild(p),s.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:s,x:m,expan:f,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===c[i].mode){h=u.length;var P=createNS("g");for(o=0;o<h;o+=1)P.appendChild(u[o]);var E=createNS("mask");E.setAttribute("mask-type","alpha"),E.setAttribute("id",y+"_"+d),E.appendChild(s),a.appendChild(E),P.setAttribute("mask","url("+locationHref+"#"+y+"_"+d+")"),u.length=0,u.push(P)}else u.push(s);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:s,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}for(this.maskElement=createNS(g),n=u.length,i=0;i<n;i+=1)this.maskElement.appendChild(u[i]);0<d&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function SVGTransformData(t,e,r){this.transform={mProps:t,op:e,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function SVGStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r}function SVGGradientFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,r)}function SVGGradientStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e-=1)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id===t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextLottieElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseRenderer],HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},HybridRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){var i=this.layers[e];if(i.ddd&&this.supports3d)this.addTo3dContainer(r,e);else if(this.threeDElements)this.addTo3dContainer(r,e);else{for(var s,a,n=0;n<e;)this.elements[n]&&!0!==this.elements[n]&&this.elements[n].getBaseElement&&(a=this.elements[n],s=(this.layers[n].ddd?this.getThreeDContainerByPos(n):a.getBaseElement())||s),n+=1;s?i.ddd&&this.supports3d||this.layerElement.insertBefore(r,s):i.ddd&&this.supports3d||this.layerElement.appendChild(r)}}},HybridRenderer.prototype.createShape=function(t){return this.supports3d?new HShapeElement(t,this.globalData,this):new SVGShapeElement(t,this.globalData,this)},HybridRenderer.prototype.createText=function(t){return this.supports3d?new HTextElement(t,this.globalData,this):new SVGTextLottieElement(t,this.globalData,this)},HybridRenderer.prototype.createCamera=function(t){return this.camera=new HCameraElement(t,this.globalData,this),this.camera},HybridRenderer.prototype.createImage=function(t){return this.supports3d?new HImageElement(t,this.globalData,this):new IImageElement(t,this.globalData,this)},HybridRenderer.prototype.createComp=function(t){return this.supports3d?new HCompElement(t,this.globalData,this):new SVGCompElement(t,this.globalData,this)},HybridRenderer.prototype.createSolid=function(t){return this.supports3d?new HSolidElement(t,this.globalData,this):new ISolidElement(t,this.globalData,this)},HybridRenderer.prototype.createNull=SVGRenderer.prototype.createNull,HybridRenderer.prototype.getThreeDContainerByPos=function(t){for(var e=0,r=this.threeDElements.length;e<r;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRenderer.prototype.createThreeDContainer=function(t,e){var r,i,s=createTag("div");styleDiv(s);var a=createTag("div");if(styleDiv(a),"3d"===e){(r=s.style).width=this.globalData.compSize.w+"px",r.height=this.globalData.compSize.h+"px";var n="50% 50%";r.webkitTransformOrigin=n,r.mozTransformOrigin=n,r.transformOrigin=n;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(i=a.style).transform=o,i.webkitTransform=o}s.appendChild(a);var h={container:a,perspectiveElem:s,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRenderer.prototype.build3dContainers=function(){var t,e,r=this.layers.length,i="";for(t=0;t<r;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?"3d"!==i&&(i="3d",e=this.createThreeDContainer(t,"3d")):"2d"!==i&&(i="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t);for(t=(r=this.threeDElements.length)-1;0<=t;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRenderer.prototype.addTo3dContainer=function(t,e){for(var r=0,i=this.threeDElements.length;r<i;){if(e<=this.threeDElements[r].endPos){for(var s,a=this.threeDElements[r].startPos;a<e;)this.elements[a]&&this.elements[a].getBaseElement&&(s=this.elements[a].getBaseElement()),a+=1;s?this.threeDElements[r].container.insertBefore(t,s):this.threeDElements[r].container.appendChild(t);break}r+=1}},HybridRenderer.prototype.configAnimation=function(t){var e=createTag("div"),r=this.animationItem.wrapper,i=e.style;i.width=t.w+"px",i.height=t.h+"px",styleDiv(this.resizerElem=e),i.transformStyle="flat",i.mozTransformStyle="flat",i.webkitTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),r.appendChild(e),i.overflow="hidden";var s=createNS("svg");s.setAttribute("width","1"),s.setAttribute("height","1"),styleDiv(s),this.resizerElem.appendChild(s);var a=createNS("defs");s.appendChild(a),this.data=t,this.setupGlobalData(t,s),this.globalData.defs=a,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRenderer.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRenderer.prototype.updateContainerSize=function(){var t,e,r,i,s=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight;i=s/a<this.globalData.compSize.w/this.globalData.compSize.h?(t=s/this.globalData.compSize.w,e=s/this.globalData.compSize.w,r=0,(a-this.globalData.compSize.h*(s/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,r=(s-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,0);var n=this.resizerElem.style;n.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+r+","+i+",0,1)",n.transform=n.webkitTransform},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,r=this.globalData.compSize.h,i=this.threeDElements.length;for(t=0;t<i;t+=1){var s=this.threeDElements[t].perspectiveElem.style;s.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(r,2))+"px",s.perspective=s.webkitPerspective}}},HybridRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length,i=createTag("div");for(e=0;e<r;e+=1)if(t[e].xt){var s=this.createComp(t[e],i,this.globalData.comp,null);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r,i=!0,s=this.comp;i;)s.finalTransform?(s.data.hasMask&&e.splice(0,0,s.finalTransform),s=s.comp):i=!1;var a,n=e.length;for(r=0;r<n;r+=1)a=e[r].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,r){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,e),this.setGradientOpacity(e,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var r=createElementID(),i=createNS(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",r),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var s,a,n,o=[];for(n=4*e.g.p,a=0;a<n;a+=4)s=createNS("stop"),i.appendChild(s),o.push(s);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+locationHref+"#"+r+")"),this.gf=i,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var r,i,s,a=createNS("mask"),n=createNS("path");a.appendChild(n);var o=createElementID(),h=createElementID();a.setAttribute("id",h);var l=createNS(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",o),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),s=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(i=4*t.g.p;i<s;i+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(r),p.push(r);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+locationHref+"#"+o+")"),this.of=l,this.ms=a,this.ost=p,this.maskId=h,e.msElem=n}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var SVGElementsRenderer=function(){var y=new Matrix,g=new Matrix;function e(t,e,r){(r||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(r||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function r(t,e,r){var i,s,a,n,o,h,l,p,f,m,c,d=e.styles.length,u=e.lvl;for(h=0;h<d;h+=1){if(n=e.sh._mdf||r,e.styles[h].lvl<u){for(p=g.reset(),m=u-e.styles[h].lvl,c=e.transformers.length-1;!n&&0<m;)n=e.transformers[c].mProps._mdf||n,m-=1,c-=1;if(n)for(m=u-e.styles[h].lvl,c=e.transformers.length-1;0<m;)f=e.transformers[c].mProps.v.props,p.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),m-=1,c-=1}else p=y;if(s=(l=e.sh.paths)._length,n){for(a="",i=0;i<s;i+=1)(o=l.shapes[i])&&o._length&&(a+=buildShapeString(o,o._length,o.c,p));e.caches[h]=a}else a=e.caches[h];e.styles[h].d+=!0===t.hd?"":a,e.styles[h]._mdf=n||e.styles[h]._mdf}}function i(t,e,r){var i=e.style;(e.c._mdf||r)&&i.pElem.setAttribute("fill","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function s(t,e,r){a(t,e,r),n(t,e,r)}function a(t,e,r){var i,s,a,n,o,h=e.gf,l=e.g._hasOpacity,p=e.s.v,f=e.e.v;if(e.o._mdf||r){var m="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(m,e.o.v)}if(e.s._mdf||r){var c=1===t.t?"x1":"cx",d="x1"===c?"y1":"cy";h.setAttribute(c,p[0]),h.setAttribute(d,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(c,p[0]),e.of.setAttribute(d,p[1]))}if(e.g._cmdf||r){i=e.cst;var u=e.g.c;for(a=i.length,s=0;s<a;s+=1)(n=i[s]).setAttribute("offset",u[4*s]+"%"),n.setAttribute("stop-color","rgb("+u[4*s+1]+","+u[4*s+2]+","+u[4*s+3]+")")}if(l&&(e.g._omdf||r)){var y=e.g.o;for(a=(i=e.g._collapsable?e.cst:e.ost).length,s=0;s<a;s+=1)n=i[s],e.g._collapsable||n.setAttribute("offset",y[2*s]+"%"),n.setAttribute("stop-opacity",y[2*s+1])}if(1===t.t)(e.e._mdf||r)&&(h.setAttribute("x2",f[0]),h.setAttribute("y2",f[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",f[0]),e.of.setAttribute("y2",f[1])));else if((e.s._mdf||e.e._mdf||r)&&(o=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)),h.setAttribute("r",o),l&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.e._mdf||e.h._mdf||e.a._mdf||r){o||(o=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)));var g=Math.atan2(f[1]-p[1],f[0]-p[0]),v=e.h.v;1<=v?v=.99:v<=-1&&(v=-.99);var b=o*v,P=Math.cos(g+e.a.v)*b+p[0],E=Math.sin(g+e.a.v)*b+p[1];h.setAttribute("fx",P),h.setAttribute("fy",E),l&&!e.g._collapsable&&(e.of.setAttribute("fx",P),e.of.setAttribute("fy",E))}}function n(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||r)&&s.dashStr&&(i.pElem.setAttribute("stroke-dasharray",s.dashStr),i.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||r)&&i.pElem.setAttribute("stroke","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||r)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return i;case"gf":return a;case"gs":return s;case"st":return n;case"sh":case"el":case"rc":case"sr":return r;case"tr":return e;default:return null}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function AudioElement(t,e,r){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,r),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGCompElement(t,e,r){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGTextLottieElement(t,e,r){this.textSpans=[],this.renderType="svg",this.initElement(t,e,r)}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function SVGTintFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");if(r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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.setAttribute("result","f1"),t.appendChild(r),(r=createNS("feColorMatrix")).setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result","f2"),t.appendChild(r),this.matrixFilter=r,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var i,s=createNS("feMerge");t.appendChild(s),(i=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),s.appendChild(i),(i=createNS("feMergeNode")).setAttribute("in","f2"),s.appendChild(i)}}function SVGFillFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(r),this.matrixFilter=r}function SVGGaussianBlurEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var r=createNS("feGaussianBlur");t.appendChild(r),this.feGaussianBlur=r}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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.setAttribute("result","f1"),t.appendChild(r);var i=createNS("feComponentTransfer");i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.matrixFilter=i;var s=createNS("feFuncR");s.setAttribute("type","table"),i.appendChild(s),this.feFuncR=s;var a=createNS("feFuncG");a.setAttribute("type","table"),i.appendChild(a),this.feFuncG=a;var n=createNS("feFuncB");n.setAttribute("type","table"),i.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var r=this.filterManager.effectElements,i=createNS("feComponentTransfer");(r[10].p.k||0!==r[10].p.v||r[11].p.k||1!==r[11].p.v||r[12].p.k||1!==r[12].p.v||r[13].p.k||0!==r[13].p.v||r[14].p.k||1!==r[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",i)),(r[17].p.k||0!==r[17].p.v||r[18].p.k||1!==r[18].p.v||r[19].p.k||1!==r[19].p.v||r[20].p.k||0!==r[20].p.v||r[21].p.k||1!==r[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",i)),(r[24].p.k||0!==r[24].p.v||r[25].p.k||1!==r[25].p.v||r[26].p.k||1!==r[26].p.v||r[27].p.k||0!==r[27].p.v||r[28].p.k||1!==r[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",i)),(r[31].p.k||0!==r[31].p.v||r[32].p.k||1!==r[32].p.v||r[33].p.k||1!==r[33].p.v||r[34].p.k||0!==r[34].p.v||r[35].p.k||1!==r[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",i)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),i=createNS("feComponentTransfer")),(r[3].p.k||0!==r[3].p.v||r[4].p.k||1!==r[4].p.v||r[5].p.k||1!==r[5].p.v||r[6].p.k||0!==r[6].p.v||r[7].p.k||1!==r[7].p.v)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.feFuncRComposed=this.createFeFunc("feFuncR",i),this.feFuncGComposed=this.createFeFunc("feFuncG",i),this.feFuncBComposed=this.createFeFunc("feFuncB",i))}function SVGDropShadowEffect(t,e){var r=e.container.globalData.renderConfig.filterSize;t.setAttribute("x",r.x),t.setAttribute("y",r.y),t.setAttribute("width",r.width),t.setAttribute("height",r.height),this.filterManager=e;var i=createNS("feGaussianBlur");i.setAttribute("in","SourceAlpha"),i.setAttribute("result","drop_shadow_1"),i.setAttribute("stdDeviation","0"),this.feGaussianBlur=i,t.appendChild(i);var s=createNS("feOffset");s.setAttribute("dx","25"),s.setAttribute("dy","0"),s.setAttribute("in","drop_shadow_1"),s.setAttribute("result","drop_shadow_2"),this.feOffset=s,t.appendChild(s);var a=createNS("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var n=createNS("feComposite");n.setAttribute("in","drop_shadow_3"),n.setAttribute("in2","drop_shadow_2"),n.setAttribute("operator","in"),n.setAttribute("result","drop_shadow_4"),t.appendChild(n);var o,h=createNS("feMerge");t.appendChild(h),o=createNS("feMergeNode"),h.appendChild(o),(o=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=h,this.originalNodeAdded=!1,h.appendChild(o)}ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(l),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),f=createNS("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=createElementID();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+m+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(t){for(var e=0,r=t.length,i=[],s="";e<r;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(s),s=""):s+=t[e],e+=1;return i.push(s),i},SVGTextLottieElement.prototype.buildNewText=function(){var t,e,r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var i=this.globalData.fontManager.getFontByName(r.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var s=r.fWeight,a=r.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",s)}this.layerElement.setAttribute("aria-label",r.t);var n,o=r.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var l,p=this.mHelper,f="",m=this.data.singleShape,c=0,d=0,u=!0,y=.001*r.tr*r.finalSize;if(!m||h||r.sz){var g,v,b=this.textSpans.length;for(t=0;t<e;t+=1)h&&m&&0!==t||(n=t<b?this.textSpans[t]:createNS(h?"path":"text"),b<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(r.finalSize/100,r.finalSize/100),m&&(o[t].n&&(c=-y,d+=r.yOffset,d+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(r,p,o[t].line,c,d),c+=o[t].l||0,c+=y),h?(l=(g=(v=this.globalData.fontManager.getCharData(r.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily))&&v.data||{}).shapes?g.shapes[0].it:[],m?f+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(m&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&n&&n.setAttribute("d",f)}else{var P=this.textContainer,E="start";switch(r.j){case 1:E="end";break;case 2:E="middle";break;default:E="start"}P.setAttribute("text-anchor",E),P.setAttribute("letter-spacing",y);var x=this.buildTextContents(r.finalText);for(e=x.length,d=r.ps?r.ps[1]+r.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||createNS("tspan")).textContent=x[t],n.setAttribute("x",0),n.setAttribute("y",d),n.style.display="inherit",P.appendChild(n),this.textSpans[t]=n,d+=r.finalLineHeight;this.layerElement.appendChild(P)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var t=this.layerElement.getBBox();this.bbox={top:t.y,left:t.x,width:t.width,height:t.height}}return this.bbox},SVGTextLottieElement.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var r,i,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(r=s[t],i=this.textSpans[t],r._mdf.m&&i.setAttribute("transform",r.m),r._mdf.o&&i.setAttribute("opacity",r.o),r._mdf.sw&&i.setAttribute("stroke-width",r.sw),r._mdf.sc&&i.setAttribute("stroke",r.sc),r._mdf.fc&&i.setAttribute("fill",r.fc))}},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,l,p,f,m,c=[].concat(a),d=t.length-1,u=[],y=[];for(o=d;0<=o;o-=1){if((m=this.searchProcessedElement(t[o]))?e[o]=r[m-1]:t[o]._render=n,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty)m?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"===t[o].ty){if(m)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"===t[o].ty?(m||(e[o]=this.createTransformElement(t[o],i)),p=e[o].transform,c.push(p)):"sh"===t[o].ty||"rc"===t[o].ty||"el"===t[o].ty||"sr"===t[o].ty?(m||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"===t[o].ty||"rd"===t[o].ty||"ms"===t[o].ty||"pb"===t[o].ty?(m?(f=e[o]).closed=!1:((f=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=f,this.shapeModifiers.push(f)),y.push(f)):"rp"===t[o].ty&&(m?(f=e[o]).closed=!0:(f=ShapeModifiers.getModifier(t[o].ty),(e[o]=f).init(this,t,o,e),this.shapeModifiers.push(f),n=!1),y.push(f));this.addProcessedElement(t[o],o+1)}for(d=u.length,o=0;o<d;o+=1)u[o].closed=!0;for(d=y.length,o=0;o<d;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",r[0]-e[0]+" 0 0 0 "+e[0]+" "+(r[1]-e[1])+" 0 0 0 "+e[1]+" "+(r[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGGaussianBlurEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=3==r?0:e,s=2==r?0:e;this.feGaussianBlur.setAttribute("stdDeviation",i+" "+s);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},SVGStrokeEffect.prototype.initialize=function(){var t,e,r,i,s=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(i=this.elem.maskManager.masksProperties.length,r=0):i=(r=this.filterManager.effectElements[0].p.v-1)+1,(e=createNS("g")).setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1);r<i;r+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:r});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),n=createElementID();a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+locationHref+"#"+n+")");s[0];)o.appendChild(s[0]);this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(s=this.elem.layerElement.children||this.elem.layerElement.childNodes;s.length;)this.elem.layerElement.removeChild(s[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){var e;this.initialized||this.initialize();var r,i,s=this.paths.length;for(e=0;e<s;e+=1)if(-1!==this.paths[e].m&&(r=this.elem.maskManager.viewData[this.paths[e].m],i=this.paths[e].p,(t||this.filterManager._mdf||r.prop._mdf)&&i.setAttribute("d",r.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),o=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),h=i.getTotalLength();a="0 0 0 "+h*n+" ";var l,p=h*(o-n),f=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,m=Math.floor(p/f);for(l=0;l<m;l+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;i.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*c[0])+","+bmFloor(255*c[1])+","+bmFloor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v,s=i[0]+" "+r[0]+" "+e[0],a=i[1]+" "+r[1]+" "+e[1],n=i[2]+" "+r[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",s),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var r=createNS(t);return r.setAttribute("type","table"),e.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(t,e,r,i,s){for(var a,n,o=0,h=Math.min(t,e),l=Math.max(t,e),p=Array.call(null,{length:256}),f=0,m=s-i,c=e-t;o<=256;)n=(a=o/256)<=h?c<0?s:i:l<=a?c<0?i:s:i+m*Math.pow((a-t)/c,1/r),p[f]=n,f+=1,o+=256/255;return p.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(t||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(e=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(e=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(e=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(e=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(e=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=r*Math.cos(i),a=r*Math.sin(i);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,r){this.initialized=!1,this.filterManager=e,this.filterElem=t,(this.elem=r).matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGEffects(t){var e,r,i=t.data.ef?t.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s),n=0;for(this.filters=[],e=0;e<i;e+=1)r=null,20===t.data.ef[e].ty?(n+=1,r=new SVGTintFilter(a,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(n+=1,r=new SVGFillFilter(a,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?r=new SVGStrokeEffect(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(n+=1,r=new SVGTritoneFilter(a,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(n+=1,r=new SVGProLevelsFilter(a,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(n+=1,r=new SVGDropShadowEffect(a,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty?r=new SVGMatte3Effect(a,t.effectsManager.effectElements[e],t):29===t.data.ef[e].ty&&(n+=1,r=new SVGGaussianBlurEffect(a,t.effectsManager.effectElements[e])),r&&this.filters.push(r);n&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+locationHref+"#"+s+")")),this.filters.length&&t.addRenderableComponent(this)}function CVEffects(){}function HBaseElement(){}function HSolidElement(t,e,r){this.initElement(t,e,r)}function HCompElement(t,e,r){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function HShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(t,e,r){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,r)}function HImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r)}function HCameraElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initHierarchy();var i=PropertyFactory.getProp;if(this.pe=i(this,t.pe,0,0,this),t.ks.p.s?(this.px=i(this,t.ks.p.x,1,0,this),this.py=i(this,t.ks.p.y,1,0,this),this.pz=i(this,t.ks.p.z,1,0,this)):this.p=i(this,t.ks.p,1,0,this),t.ks.a&&(this.a=i(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var s,a=t.ks.or.k.length;for(s=0;s<a;s+=1)t.ks.or.k[s].to=null,t.ks.or.k[s].ti=null}this.or=i(this,t.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=i(this,t.ks.rx,0,degToRads,this),this.ry=i(this,t.ks.ry,0,degToRads,this),this.rz=i(this,t.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HEffects(){}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,r=_svgMatteSymbols.length;e<r;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var r=t.layerElement.parentNode;if(r){for(var i,s=r.children,a=0,n=s.length;a<n&&s[a]!==t.layerElement;)a+=1;a<=n-2&&(i=s[a+1]);var o=createNS("use");o.setAttribute("href","#"+e),i?r.insertBefore(o,i):r.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var r=createElementID(),i=createNS("mask");i.setAttribute("id",e.layerId),i.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var s=t.globalData.defs;s.appendChild(i);var a=createNS("symbol");a.setAttribute("id",r),this.replaceInParent(e,r),a.appendChild(e.layerElement),s.appendChild(a);var n=createNS("use");n.setAttribute("href","#"+r),i.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,r=0,i=e.length;r<i;)e[r]&&e[r].data.ind===t&&this.setElementAsMask(this.elem,e[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGEffects.prototype.renderFrame=function(t){var e,r=this.filters.length;for(e=0;e<r;e+=1)this.filters[e].renderFrame(t)},CVEffects.prototype.renderFrame=function(){},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=HybridRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([HybridRenderer,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(t,e){for(var r,i=0;i<e;)this.elements[i]&&this.elements[i].getBaseElement&&(r=this.elements[i].getBaseElement()),i+=1;r?this.layerElement.insertBefore(t,r):this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e=t[r].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(t,e){var r,i,s,a,n,o=t.sh.v,h=t.transformers,l=o._length;if(!(l<=1)){for(r=0;r<l-1;r+=1)i=this.getTransformedPoint(h,o.v[r]),s=this.getTransformedPoint(h,o.o[r]),a=this.getTransformedPoint(h,o.i[r+1]),n=this.getTransformedPoint(h,o.v[r+1]),this.checkBounds(i,s,a,n,e);o.c&&(i=this.getTransformedPoint(h,o.v[r]),s=this.getTransformedPoint(h,o.o[r]),a=this.getTransformedPoint(h,o.i[0]),n=this.getTransformedPoint(h,o.v[0]),this.checkBounds(i,s,a,n,e))}},HShapeElement.prototype.checkBounds=function(t,e,r,i,s){this.getBoundsOfCurve(t,e,r,i);var a=this.shapeBoundingBox;s.x=bmMin(a.left,s.x),s.xMax=bmMax(a.right,s.xMax),s.y=bmMin(a.top,s.y),s.yMax=bmMax(a.bottom,s.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(t,e,r,i){for(var s,a,n,o,h,l,p,f=[[t[0],i[0]],[t[1],i[1]]],m=0;m<2;++m)a=6*t[m]-12*e[m]+6*r[m],s=-3*t[m]+9*e[m]-9*r[m]+3*i[m],n=3*e[m]-3*t[m],a|=0,n|=0,0===(s|=0)&&0===a||(0===s?0<(o=-n/a)&&o<1&&f[m].push(this.calculateF(o,t,e,r,i,m)):0<=(h=a*a-4*n*s)&&(0<(l=(-a+bmSqrt(h))/(2*s))&&l<1&&f[m].push(this.calculateF(l,t,e,r,i,m)),0<(p=(-a-bmSqrt(h))/(2*s))&&p<1&&f[m].push(this.calculateF(p,t,e,r,i,m))));this.shapeBoundingBox.left=bmMin.apply(null,f[0]),this.shapeBoundingBox.top=bmMin.apply(null,f[1]),this.shapeBoundingBox.right=bmMax.apply(null,f[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,f[1])},HShapeElement.prototype.calculateF=function(t,e,r,i,s,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*r[a]+3*(1-t)*bmPow(t,2)*i[a]+bmPow(t,3)*s[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]&&t[r].sh?this.calculateShapeBoundingBox(t[r],e):t[r]&&t[r].it&&this.calculateBoundingBox(t[r].it,e)},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var r=!1;if(this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),r=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),r=!0),r||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y){this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var i=this.shapeCont.style,s="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";i.transform=s,i.webkitTransform=s}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=createNS("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t.l?t.l.length:0);var e=this.innerElem.style,r=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)";e.fill=r,e.color=r,t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var i,s,a=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",a.fClass)this.innerElem.className=a.fClass;else{e.fontFamily=a.fFamily;var n=t.fWeight,o=t.fStyle;e.fontStyle=o,e.fontWeight=n}var h,l,p,f=t.l;s=f.length;var m,c=this.mHelper,d="",u=0;for(i=0;i<s;i+=1){if(this.globalData.fontManager.chars?(this.textPaths[u]?h=this.textPaths[u]:((h=createNS("path")).setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[u]?p=(l=this.textSpans[u]).children[0]:((l=createTag("div")).style.lineHeight=0,(p=createNS("svg")).appendChild(h),styleDiv(l)))):this.isMasked?h=this.textPaths[u]?this.textPaths[u]:createNS("text"):this.textSpans[u]?(l=this.textSpans[u],h=this.textPaths[u]):(styleDiv(l=createTag("span")),styleDiv(h=createTag("span")),l.appendChild(h)),this.globalData.fontManager.chars){var y,g=this.globalData.fontManager.getCharData(t.finalText[i],a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(y=g?g.data:null,c.reset(),y&&y.shapes&&(m=y.shapes[0].it,c.scale(t.finalSize/100,t.finalSize/100),d=this.createPathShape(c,m),h.setAttribute("d",d)),this.isMasked)this.innerElem.appendChild(h);else{if(this.innerElem.appendChild(l),y&&y.shapes){document.body.appendChild(p);var v=p.getBBox();p.setAttribute("width",v.width+2),p.setAttribute("height",v.height+2),p.setAttribute("viewBox",v.x-1+" "+(v.y-1)+" "+(v.width+2)+" "+(v.height+2));var b=p.style,P="translate("+(v.x-1)+"px,"+(v.y-1)+"px)";b.transform=P,b.webkitTransform=P,f[i].yOffset=v.y-1}else p.setAttribute("width",1),p.setAttribute("height",1);l.appendChild(p)}}else if(h.textContent=f[i].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(h);else{this.innerElem.appendChild(l);var E=h.style,x="translate3d(0,"+-t.finalSize/1.2+"px,0)";E.transform=x,E.webkitTransform=x}this.isMasked?this.textSpans[u]=h:this.textSpans[u]=l,this.textSpans[u].style.display="block",this.textPaths[u]=h,u+=1}for(;u<this.textSpans.length;)this.textSpans[u].style.display="none",u+=1},HTextElement.prototype.renderInnerContent=function(){var t;if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),t=this.svgElement.style;var e="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";t.transform=e,t.webkitTransform=e}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var r,i,s,a,n,o=0,h=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;for(i=l.length,r=0;r<i;r+=1)l[r].n?o+=1:(a=this.textSpans[r],n=this.textPaths[r],s=h[o],o+=1,s._mdf.m&&(this.isMasked?a.setAttribute("transform",s.m):(a.style.webkitTransform=s.m,a.style.transform=s.m)),a.style.opacity=s.o,s.sw&&s._mdf.sw&&n.setAttribute("stroke-width",s.sw),s.sc&&s._mdf.sc&&n.setAttribute("stroke",s.sc),s.fc&&s._mdf.fc&&(n.setAttribute("fill",s.fc),n.style.color=s.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var p=this.innerElem.getBBox();this.currentBBox.w!==p.width&&(this.currentBBox.w=p.width,this.svgElement.setAttribute("width",p.width)),this.currentBBox.h!==p.height&&(this.currentBBox.h=p.height,this.svgElement.setAttribute("height",p.height));if(this.currentBBox.w!==p.width+2||this.currentBBox.h!==p.height+2||this.currentBBox.x!==p.x-1||this.currentBBox.y!==p.y-1){this.currentBBox.w=p.width+2,this.currentBBox.h=p.height+2,this.currentBBox.x=p.x-1,this.currentBBox.y=p.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),t=this.svgElement.style;var f="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";t.transform=f,t.webkitTransform=f}}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var t,e,r,i,s=this.comp.threeDElements.length;for(t=0;t<s;t+=1)if("3d"===(e=this.comp.threeDElements[t]).type){r=e.perspectiveElem.style,i=e.container.style;var a=this.pe.v+"px",n="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.perspective=a,r.webkitPerspective=a,i.transformOrigin=n,i.mozTransformOrigin=n,i.webkitTransformOrigin=n,r.transform=o,r.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var t,e,r=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)r=this.hierarchy[t].finalTransform.mProp._mdf||r;if(r||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){if(this.mat.reset(),this.hierarchy)for(t=e=this.hierarchy.length-1;0<=t;t-=1){var i=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-i.p.v[0],-i.p.v[1],i.p.v[2]),this.mat.rotateX(-i.or.v[0]).rotateY(-i.or.v[1]).rotateZ(i.or.v[2]),this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v),this.mat.scale(1/i.s.v[0],1/i.s.v[1],1/i.s.v[2]),this.mat.translate(i.a.v[0],i.a.v[1],i.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s;s=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),n=[s[0]/a,s[1]/a,s[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],o),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-h)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var f,m,c;for(e=this.comp.threeDElements.length,t=0;t<e;t+=1)if("3d"===(f=this.comp.threeDElements[t]).type){if(p){var d=this.mat.toCSS();(c=f.container.style).transform=d,c.webkitTransform=d}this.pe._mdf&&((m=f.perspectiveElem.style).perspective=this.pe.v+"px",m.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},HEffects.prototype.renderFrame=function(){};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem===t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return m(i,t),i.setData(t,e),i}function p(){n+=1,d()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",p),t.addEventListener("_idle",f),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new AnimationItem;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),l(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),l(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){e&&"object"!=typeof e&&(e=JSON.parse(e));var r={wrapper:t,animationData:e},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";"false"===s?r.loop=!1:"true"===s?r.loop=!0:""!==s&&(r.loop=parseInt(s,10));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id===a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!==r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(pT={},pT.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},pT),pT;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:-t}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]+=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t,10)),"string"===i&&(e=parseInt(e,10)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]-=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t,10)),"string"==typeof e&&(e=parseInt(e,10)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var r;e||(e=helperLengthArray);var i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n===o)r=e=0;else{var l=n-o;switch(r=.5<h?l/(2-n-o):l/(n+o),n){case i:e=(s-a)/l+(s<a?6:0);break;case s:e=(a-i)/l+2;break;case a:e=(i-s)/l+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)r=i=e=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n,o=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*o;var h=i.length,l=createTypedArray("float32",h);for(n=0;n<h;n+=1)l[n]=i[n]+(s[n]-i[n])*o;return l}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shapePool.newElement();n.setPathData(!!i,a);var o,h,l=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:l,h=r&&r[s]?r[s]:l,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),l=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)l[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r),1<e?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(s)){var o,h=s.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=(a[o]-s[o])*n+s[o];return l}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[l.length-1].t;if(h<=p)return this.pv;if(r?s=p-(i=e?Math.abs(p-this.elem.comp.globalData.frameRate*e):Math.max(0,p-this.elem.data.ip)):((!e||e>l.length-1)&&(e=l.length-1),i=p-(s=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),m=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a<n;a+=1)o[a]=(m[a]-f[a])*d+c[a];return o}return(m-f)*d+c}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*((h-p)/this.comp.globalData.frameRate)/5e-4;return o}return u+(h-p)/.001*(u-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[0].t;if(p<=h)return this.pv;if(r?s=p+(i=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>l.length-1)&&(e=l.length-1),i=(s=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/i)%2==0)return this.getValueAtTime(((p-h)%i+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(p-h)%i+p)/this.comp.globalData.frameRate,0),d=Math.floor((p-h)/i)+1;if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(m[a]-f[a])*d;return o}return c-(m-f)*d}if("continue"===t){var u=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(u.length)).length,a=0;a<n;a+=1)o[a]=u[a]+(u[a]-y[a])*(p-h)/.001;return o}return u+(u-y)*(p-h)/.001}}return this.getValueAtTime((i-((p-h)%i+p))/this.comp.globalData.frameRate,0)}function l(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(t);e.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var i=this.s.getValueAtTime(t);e.scale(i[0]*this.s.mult,i[1]*this.s.mult,i[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),l=this.rx.getValueAtTime(t),p=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(l*this.rx.mult).rotateZ(-p[2]*this.or.mult).rotateY(p[1]*this.or.mult).rotateX(p[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var f=this.px.getValueAtTime(t),m=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(f*this.px.mult,m*this.py.mult,-c*this.pz.mult)}else e.translate(f*this.px.mult,m*this.py.mult,0)}else{var d=this.p.getValueAtTime(t);e.translate(d[0]*this.p.mult,d[1]*this.p.mult,-d[2]*this.p.mult)}return e}.bind(i):i.getValueAtTime=function(){return this.v.clone(new Matrix)}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var p=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=p(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=l,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r,i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var s=i._length,a=i[t],n=i.v,o=createSizedArray(s);for(r=0;r<s;r+=1)o[r]="i"===t||"o"===t?[a[r][0]-n[r][0],a[r][1]-n[r][1]]:[a[r][0],a[r][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,l=0;o<h;){if(l+a[o].addedLength>n){var p=o,f=r.c&&o===h-1?0:o+1,m=(n-l)/a[o].addedLength;i=bez.getPointInSegment(r.v[p],r.v[f],r.o[p],r.i[f],m,a[o]);break}l+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){1==t?t=this.v.c:0==t&&(t=.999);var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null};var ShapePathInterface=function(t,e,r){var i=e.sh;function s(t){return"Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t?s.path:null}var a=propertyGroupFactory(s,r);return i.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:r}}),s},propertyGroupFactory=function(e,r){return function(t){return(t=void 0===t?1:t)<=0?e:r(t-1)}},PropertyInterface=function(t,e){var r={_name:t};return function(t){return(t=void 0===t?1:t)<=0?r:e(t-1)}},ShapeExpressionInterface=function(){function n(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"===t[i].ty?s.push(o(t[i],e[i],r)):"fl"===t[i].ty?s.push(h(t[i],e[i],r)):"st"===t[i].ty?s.push(l(t[i],e[i],r)):"tm"===t[i].ty?s.push(p(t[i],e[i],r)):"tr"===t[i].ty||("el"===t[i].ty?s.push(m(t[i],e[i],r)):"sr"===t[i].ty?s.push(c(t[i],e[i],r)):"sh"===t[i].ty?s.push(ShapePathInterface(t[i],e[i],r)):"rc"===t[i].ty?s.push(d(t[i],e[i],r)):"rd"===t[i].ty?s.push(u(t[i],e[i],r)):"rp"===t[i].ty&&s.push(y(t[i],e[i],r)));return s}function o(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,e,r){var i,s=function(t){for(var e=0,r=i.length;e<r;){if(i[e]._name===t||i[e].mn===t||i[e].propertyIndex===t||i[e].ix===t||i[e].ind===t)return i[e];e+=1}return"number"==typeof t?i[t-1]:null};s.propertyGroup=propertyGroupFactory(s,r),i=n(t.it,e.it,s.propertyGroup),s.numProperties=i.length;var a=f(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,i.propertyGroup),a=f(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function h(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:null}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),i}function l(t,e,r){var i,s=propertyGroupFactory(l,r),a=propertyGroupFactory(h,s);var n,o=t.d?t.d.length:0,h={};for(i=0;i<o;i+=1)n=i,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[i].p.setGroupProperty(a);function l(t){return"Color"===t||"color"===t?l.color:"Opacity"===t||"opacity"===t?l.opacity:"Stroke Width"===t||"stroke width"===t?l.strokeWidth:null}return Object.defineProperties(l,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",s)),e.o.setGroupProperty(PropertyInterface("Opacity",s)),e.w.setGroupProperty(PropertyInterface("Stroke Width",s)),l}function p(e,t,r){function i(t){return t===e.e.ix||"End"===t||"end"===t?i.end:t===e.s.ix?i.start:t===e.o.ix?i.offset:null}var s=propertyGroupFactory(i,r);return i.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),i.propertyIndex=e.ix,i.propertyGroup=r,Object.defineProperties(i,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),i.mn=e.mn,i}function f(e,t,r){function i(t){return e.a.ix===t||"Anchor Point"===t?i.anchorPoint:e.o.ix===t||"Opacity"===t?i.opacity:e.p.ix===t||"Position"===t?i.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?i.rotation:e.s.ix===t||"Scale"===t?i.scale:e.sk&&e.sk.ix===t||"Skew"===t?i.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?i.skewAxis:null}var s=propertyGroupFactory(i,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(i,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),i.ty="tr",i.mn=e.mn,i.propertyGroup=r,i}function m(e,t,r){function i(t){return e.p.ix===t?i.position:e.s.ix===t?i.size:null}var s=propertyGroupFactory(i,r);i.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(i,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),i.mn=e.mn,i}function c(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.rotation:e.pt.ix===t?i.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?i.outerRadius:e.os.ix===t?i.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?i.innerRoundness:null:i.innerRadius}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),i.mn=e.mn,i}function d(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?i.size:null}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),i.mn=e.mn,i}function u(e,t,r){function i(t){return e.r.ix===t||"Round Corners 1"===t?i.radius:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(i,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),i.mn=e.mn,i}function y(e,t,r){function i(t){return e.c.ix===t||"Copies"===t?i.copies:e.o.ix===t||"Offset"===t?i.offset:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(i,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),i.mn=e.mn,i}return function(t,e,i){var s;function r(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,r=s.length;e<r;){if(s[e]._name===t)return s[e];e+=1}return null}return r.propertyGroup=propertyGroupFactory(r,function(){return i}),s=n(t,e,r.propertyGroup),r.numProperties=s.length,r._name="Contents",r}}(),TextExpressionInterface=function(e){var r;function i(t){switch(t){case"ADBE Text Document":return i.sourceText;default:return null}}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),i},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,t)}function n(t,e){var r=this.getMatrix(e);return this.applyPoint(r,t)}function o(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,t)}function h(t,e){var r=this.getMatrix(e);return this.invertPoint(r,t)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function f(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function m(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect;case"ADBE Text Properties":return i.textInterface;default:return null}}i.getMatrix=s,i.invertPoint=p,i.applyPoint=l,i.toWorld=n,i.toWorldVec=a,i.fromWorld=h,i.fromWorldVec=o,i.toComp=n,i.fromComp=f,i.sampleImage=m,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity;default:return null}}var r,i,s,a;return Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p?a=ExpressionPropertyInterface(t.p):(r=ExpressionPropertyInterface(t.px),i=ExpressionPropertyInterface(t.py),t.pz&&(s=ExpressionPropertyInterface(t.pz))),Object.defineProperty(e,"position",{get:function(){return t.p?a():[r(),i(),s?s():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function l(s,t,e,r){function i(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?o[r]:o[r]();r+=1}throw new Error}var a,n=propertyGroupFactory(i,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(l(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,r)):o.push(p(t.effectElements[a],s.ef[a].ty,r,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(i,"color",{get:function(){return o[0]()}}),Object.defineProperties(i,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),i.enabled=0!==s.en,i.active=i.enabled,i}function p(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",i)),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(l(s[r],t.effectsManager.effectElements[r],e,t));var n=t.data.ef||[],o=function(t){for(r=0,a=n.length;r<a;){if(t===n[r].nm||t===n[r].mn||t===n[r].ix)return i[r];r+=1}return null};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}return null}}}(),MaskManagerInterface=function(){function t(t,e){this._mask=t,this._data=e}Object.defineProperty(t.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(t.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new t(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(!i.numKeys)return 0;var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r.value="unidimensional"===a?e[0]:e,r},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)a[t]=e.v[t]*r,s[t]=a[t];return s}}(t):e}}();function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var r,i=t.ef||[];this.effectElements=[];var s,a=i.length;for(r=0;r<a;r+=1)s=new GroupEffect(i[r],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}!function(){!function(){function t(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}}();var i=TextSelectorProp.getTextSelectorProp;TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new TextExpressionSelectorPropFactory(t,e,r):i(t,e,r)}}(),extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){var r;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottie={};function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;default:case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r<e.length;r+=1){var i=e[r].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.7.6";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="",queryString;if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src.replace(/^[^\?]+\??/,""),renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
 return lottie;
 }));
\ No newline at end of file
diff --git a/build/player/lottie_light.js b/build/player/lottie_light.js
index ee6fe45..90d8a27 100644
--- a/build/player/lottie_light.js
+++ b/build/player/lottie_light.js
@@ -10,364 +10,407 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";
-var svgNS = "http://www.w3.org/2000/svg";
+	/* global locationHref:writable, animationManager, subframeEnabled:writable, defaultCurveSegments:writable, roundValues,
+expressionsPlugin:writable, PropertyFactory, ShapePropertyFactory, Matrix */
+/* exported locationHref, subframeEnabled, expressionsPlugin */
+
+'use strict';
+
+/* exported svgNS, locationHref, initialDefaultFrame */
+
+var svgNS = 'http://www.w3.org/2000/svg';
 
 var locationHref = '';
 
 var initialDefaultFrame = -999999;
 
+/* global createSizedArray */
+/* exported subframeEnabled, expressionsPlugin, isSafari, cachedColors, bmPow, bmSqrt, bmFloor, bmMax, bmMin, ProjectInterface,
+defaultCurveSegments, degToRads, roundCorner, bmRnd, styleDiv, BMEnterFrameEvent, BMCompleteEvent, BMCompleteLoopEvent,
+BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, BMAnimationConfigErrorEvent, createElementID,
+addSaturationToRGB, addBrightnessToRGB, addHueToRGB, rgbToHex */
+
 var subframeEnabled = true;
 var expressionsPlugin;
 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
+var bmRnd;
+var bmPow = Math.pow;
+var bmSqrt = Math.sqrt;
+var bmFloor = Math.floor;
+var bmMax = Math.max;
+var bmMin = Math.min;
 
 var BMMath = {};
-(function(){
-    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"];
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
+(function () {
+  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'];
+  var i;
+  var len = propertyNames.length;
+  for (i = 0; i < len; i += 1) {
+    BMMath[propertyNames[i]] = Math[propertyNames[i]];
+  }
 }());
 
-function ProjectInterface(){return {};}
+function ProjectInterface() { return {}; }
 
 BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = createSizedArray(val.length);
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
+BMMath.abs = function (val) {
+  var tOfVal = typeof val;
+  if (tOfVal === 'object' && val.length) {
+    var absArr = createSizedArray(val.length);
+    var i;
+    var len = val.length;
+    for (i = 0; i < len; i += 1) {
+      absArr[i] = Math.abs(val[i]);
     }
-    return Math.abs(val);
-
+    return absArr;
+  }
+  return Math.abs(val);
 };
 var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
+var degToRads = Math.PI / 180;
 var roundCorner = 0.5519;
 
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
+function roundValues(flag) {
+  if (flag) {
+    bmRnd = Math.round;
+  } else {
+    bmRnd = function (val) {
+      return val;
+    };
+  }
 }
 roundValues(false);
 
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
+function styleDiv(element) {
+  element.style.position = 'absolute';
+  element.style.top = 0;
+  element.style.left = 0;
+  element.style.display = 'block';
+  element.style.transformOrigin = '0 0';
+  element.style.webkitTransformOrigin = '0 0';
+  element.style.backfaceVisibility = 'visible';
+  element.style.webkitBackfaceVisibility = 'visible';
+  element.style.transformStyle = 'preserve-3d';
+  element.style.webkitTransformStyle = 'preserve-3d';
+  element.style.mozTransformStyle = 'preserve-3d';
 }
 
-function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
-    this.type = type;
-    this.currentTime = currentTime;
-    this.totalTime = totalTime;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
+  this.type = type;
+  this.currentTime = currentTime;
+  this.totalTime = totalTime;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteEvent(type, frameMultiplier){
-    this.type = type;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteEvent(type, frameMultiplier) {
+  this.type = type;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
-    this.type = type;
-    this.currentLoop = currentLoop;
-    this.totalLoops = totalLoops;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
+  this.type = type;
+  this.currentLoop = currentLoop;
+  this.totalLoops = totalLoops;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMSegmentStartEvent(type, firstFrame, totalFrames){
-    this.type = type;
-    this.firstFrame = firstFrame;
-    this.totalFrames = totalFrames;
+function BMSegmentStartEvent(type, firstFrame, totalFrames) {
+  this.type = type;
+  this.firstFrame = firstFrame;
+  this.totalFrames = totalFrames;
 }
 
-function BMDestroyEvent(type, target){
-    this.type = type;
-    this.target = target;
+function BMDestroyEvent(type, target) {
+  this.type = type;
+  this.target = target;
 }
 
 function BMRenderFrameErrorEvent(nativeError, currentTime) {
-    this.type = 'renderFrameError';
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = 'renderFrameError';
+  this.nativeError = nativeError;
+  this.currentTime = currentTime;
 }
 
 function BMConfigErrorEvent(nativeError) {
-    this.type = 'configError';
-    this.nativeError = nativeError;
+  this.type = 'configError';
+  this.nativeError = nativeError;
 }
 
 function BMAnimationConfigErrorEvent(type, nativeError) {
-    this.type = type;
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = type;
+  this.nativeError = nativeError;
 }
 
-var createElementID = (function(){
-    var _count = 0;
-    return function createID() {
-        return '__lottie_element_' + ++_count
-    }
-}())
+var createElementID = (function () {
+  var _count = 0;
+  return function createID() {
+    _count += 1;
+    return '__lottie_element_' + _count;
+  };
+}());
 
 function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v; g = t; b = p; break;
-        case 1: r = q; g = v; b = p; break;
-        case 2: r = p; g = v; b = t; break;
-        case 3: r = p; g = q; b = v; break;
-        case 4: r = t; g = p; b = v; break;
-        case 5: r = v; g = p; b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
+  var r;
+  var g;
+  var b;
+  var i;
+  var f;
+  var p;
+  var q;
+  var t;
+  i = Math.floor(h * 6);
+  f = h * 6 - i;
+  p = v * (1 - s);
+  q = v * (1 - f * s);
+  t = v * (1 - (1 - f) * s);
+  switch (i % 6) {
+    case 0: r = v; g = t; b = p; break;
+    case 1: r = q; g = v; b = p; break;
+    case 2: r = p; g = v; b = t; break;
+    case 3: r = p; g = q; b = v; break;
+    case 4: r = t; g = p; b = v; break;
+    case 5: r = v; g = p; b = q; break;
+    default: break;
+  }
+  return [r,
+    g,
+    b];
 }
 
 function RGBtoHSV(r, g, b) {
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
+  var max = Math.max(r, g, b);
+  var min = Math.min(r, g, b);
+  var d = max - min;
+  var h;
+  var s = (max === 0 ? 0 : d / max);
+  var v = max / 255;
 
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
+  switch (max) {
+    case min: h = 0; break;
+    case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break;
+    case g: h = (b - r) + d * 2; h /= 6 * d; break;
+    case b: h = (r - g) + d * 4; h /= 6 * d; break;
+    default: break;
+  }
 
-    return [
-         h,
-         s,
-         v
-    ];
+  return [
+    h,
+    s,
+    v,
+  ];
 }
 
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addSaturationToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[1] += offset;
+  if (hsv[1] > 1) {
+    hsv[1] = 1;
+  } else if (hsv[1] <= 0) {
+    hsv[1] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addBrightnessToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[2] += offset;
+  if (hsv[2] > 1) {
+    hsv[2] = 1;
+  } else if (hsv[2] < 0) {
+    hsv[2] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addHueToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[0] += offset / 360;
+  if (hsv[0] > 1) {
+    hsv[0] -= 1;
+  } else if (hsv[0] < 0) {
+    hsv[0] += 1;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
+var rgbToHex = (function () {
+  var colorMap = [];
+  var i;
+  var hex;
+  for (i = 0; i < 256; i += 1) {
+    hex = i.toString(16);
+    colorMap[i] = hex.length === 1 ? '0' + hex : hex;
+  }
 
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
+  return function (r, g, b) {
+    if (r < 0) {
+      r = 0;
+    }
+    if (g < 0) {
+      g = 0;
+    }
+    if (b < 0) {
+      b = 0;
+    }
+    return '#' + colorMap[r] + colorMap[g] + colorMap[b];
+  };
 }());
-function BaseEvent(){}
-BaseEvent.prototype = {
-	triggerEvent: function (eventName, args) {
-	    if (this._cbs[eventName]) {
-	        var len = this._cbs[eventName].length;
-	        for (var i = 0; i < len; i++){
-	            this._cbs[eventName][i](args);
-	        }
-	    }
-	},
-	addEventListener: function (eventName, callback) {
-	    if (!this._cbs[eventName]){
-	        this._cbs[eventName] = [];
-	    }
-	    this._cbs[eventName].push(callback);
 
-		return function() {
-			this.removeEventListener(eventName, callback);
-		}.bind(this);
-	},
-	removeEventListener: function (eventName,callback){
-	    if (!callback){
-	        this._cbs[eventName] = null;
-	    }else if(this._cbs[eventName]){
-	        var i = 0, len = this._cbs[eventName].length;
-	        while(i<len){
-	            if(this._cbs[eventName][i] === callback){
-	                this._cbs[eventName].splice(i,1);
-	                i -=1;
-	                len -= 1;
-	            }
-	            i += 1;
-	        }
-	        if(!this._cbs[eventName].length){
-	            this._cbs[eventName] = null;
-	        }
-	    }
-	}
+function BaseEvent() {}
+BaseEvent.prototype = {
+  triggerEvent: function (eventName, args) {
+    if (this._cbs[eventName]) {
+      var len = this._cbs[eventName].length;
+      for (var i = 0; i < len; i += 1) {
+        this._cbs[eventName][i](args);
+      }
+    }
+  },
+  addEventListener: function (eventName, callback) {
+    if (!this._cbs[eventName]) {
+      this._cbs[eventName] = [];
+    }
+    this._cbs[eventName].push(callback);
+
+    return function () {
+      this.removeEventListener(eventName, callback);
+    }.bind(this);
+  },
+  removeEventListener: function (eventName, callback) {
+    if (!callback) {
+      this._cbs[eventName] = null;
+    } else if (this._cbs[eventName]) {
+      var i = 0;
+      var len = this._cbs[eventName].length;
+      while (i < len) {
+        if (this._cbs[eventName][i] === callback) {
+          this._cbs[eventName].splice(i, 1);
+          i -= 1;
+          len -= 1;
+        }
+        i += 1;
+      }
+      if (!this._cbs[eventName].length) {
+        this._cbs[eventName] = null;
+      }
+    }
+  },
 };
-var createTypedArray = (function(){
-	function createRegularArray(type, len){
-		var i = 0, arr = [], value;
-		switch(type) {
-			case 'int16':
-			case 'uint8c':
-				value = 1;
-				break;
-			default:
-				value = 1.1;
-				break;
-		}
-		for(i = 0; i < len; i += 1) {
-			arr.push(value);
-		}
-		return arr;
-	}
-	function createTypedArray(type, len){
-		if(type === 'float32') {
-			return new Float32Array(len);
-		} else if(type === 'int16') {
-			return new Int16Array(len);
-		} else if(type === 'uint8c') {
-			return new Uint8ClampedArray(len);
-		}
-	}
-	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
-		return createTypedArray;
-	} else {
-		return createRegularArray;
-	}
+
+/* exported createTypedArray, createSizedArray */
+
+var createTypedArray = (function () {
+  function createRegularArray(type, len) {
+    var i = 0;
+    var arr = [];
+    var value;
+    switch (type) {
+      case 'int16':
+      case 'uint8c':
+        value = 1;
+        break;
+      default:
+        value = 1.1;
+        break;
+    }
+    for (i = 0; i < len; i += 1) {
+      arr.push(value);
+    }
+    return arr;
+  }
+  function createTypedArrayFactory(type, len) {
+    if (type === 'float32') {
+      return new Float32Array(len);
+    } if (type === 'int16') {
+      return new Int16Array(len);
+    } if (type === 'uint8c') {
+      return new Uint8ClampedArray(len);
+    }
+    return createRegularArray(type, len);
+  }
+  if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+    return createTypedArrayFactory;
+  }
+  return createRegularArray;
 }());
 
 function createSizedArray(len) {
-	return Array.apply(null,{length:len});
+  return Array.apply(null, { length: len });
 }
+
+/* global svgNS */
+/* exported createNS */
+
 function createNS(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElementNS(svgNS, type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElementNS(svgNS, type);
 }
+
+/* exported createTag */
+
 function createTag(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElement(type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElement(type);
 }
-function DynamicPropertyContainer(){};
+
+function DynamicPropertyContainer() {}
 DynamicPropertyContainer.prototype = {
-	addDynamicProperty: function(prop) {
-		if(this.dynamicProperties.indexOf(prop) === -1) {
-	        this.dynamicProperties.push(prop);
-	        this.container.addDynamicProperty(this);
-	    	this._isAnimated = true;
-	    }
-	},
-	iterateDynamicProperties: function(){
-	    this._mdf = false;
-	    var i, len = this.dynamicProperties.length;
-	    for(i=0;i<len;i+=1){
-	        this.dynamicProperties[i].getValue();
-	        if(this.dynamicProperties[i]._mdf) {
-	            this._mdf = true;
-	        }
-	    }
-	},
-	initDynamicPropertyContainer: function(container){
-	    this.container = container;
-	    this.dynamicProperties = [];
-	    this._mdf = false;
-	    this._isAnimated = false;
-	}
-}
-var getBlendMode = (function() {
-
-	var blendModeEnums = {
-        0:'source-over',
-        1:'multiply',
-        2:'screen',
-        3:'overlay',
-        4:'darken',
-        5:'lighten',
-        6:'color-dodge',
-        7:'color-burn',
-        8:'hard-light',
-        9:'soft-light',
-        10:'difference',
-        11:'exclusion',
-        12:'hue',
-        13:'saturation',
-        14:'color',
-        15:'luminosity'
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+      this.container.addDynamicProperty(this);
+      this._isAnimated = true;
     }
+  },
+  iterateDynamicProperties: function () {
+    this._mdf = false;
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      this.dynamicProperties[i].getValue();
+      if (this.dynamicProperties[i]._mdf) {
+        this._mdf = true;
+      }
+    }
+  },
+  initDynamicPropertyContainer: function (container) {
+    this.container = container;
+    this.dynamicProperties = [];
+    this._mdf = false;
+    this._isAnimated = false;
+  },
+};
 
-	return function(mode) {
-		return blendModeEnums[mode] || '';
-	}
-}())
+/* exported getBlendMode */
+
+var getBlendMode = (function () {
+  var blendModeEnums = {
+    0: 'source-over',
+    1: 'multiply',
+    2: 'screen',
+    3: 'overlay',
+    4: 'darken',
+    5: 'lighten',
+    6: 'color-dodge',
+    7: 'color-burn',
+    8: 'hard-light',
+    9: 'soft-light',
+    10: 'difference',
+    11: 'exclusion',
+    12: 'hue',
+    13: 'saturation',
+    14: 'color',
+    15: 'luminosity',
+  };
+
+  return function (mode) {
+    return blendModeEnums[mode] || '';
+  };
+}());
+
+/* global createTypedArray */
+
 /*!
  Transformation Matrix v2.0
  (c) Epistemex 2014-2015
@@ -397,394 +440,399 @@
  * @constructor
  */
 
-var Matrix = (function(){
+var Matrix = (function () {
+  var _cos = Math.cos;
+  var _sin = Math.sin;
+  var _tan = Math.tan;
+  var _rnd = Math.round;
 
-    var _cos = Math.cos;
-    var _sin = Math.sin;
-    var _tan = Math.tan;
-    var _rnd = Math.round;
+  function reset() {
+    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;
+    return this;
+  }
 
-    function reset(){
-        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;
-        return this;
+  function rotate(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function rotateX(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateY(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateZ(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function shear(sx, sy) {
+    return this._t(1, sy, sx, 1, 0, 0);
+  }
+
+  function skew(ax, ay) {
+    return this.shear(_tan(ax), _tan(ay));
+  }
+
+  function skewFromAxis(ax, angle) {
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    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);
+  }
+
+  function scale(sx, sy, sz) {
+    if (!sz && sz !== 0) {
+      sz = 1;
+    }
+    if (sx === 1 && sy === 1 && sz === 1) {
+      return this;
+    }
+    return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
+  }
+
+  function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
+    this.props[0] = a;
+    this.props[1] = b;
+    this.props[2] = c;
+    this.props[3] = d;
+    this.props[4] = e;
+    this.props[5] = f;
+    this.props[6] = g;
+    this.props[7] = h;
+    this.props[8] = i;
+    this.props[9] = j;
+    this.props[10] = k;
+    this.props[11] = l;
+    this.props[12] = m;
+    this.props[13] = n;
+    this.props[14] = o;
+    this.props[15] = p;
+    return this;
+  }
+
+  function translate(tx, ty, tz) {
+    tz = tz || 0;
+    if (tx !== 0 || ty !== 0 || tz !== 0) {
+      return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
+    }
+    return this;
+  }
+
+  function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
+    var _p = this.props;
+
+    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) {
+      // NOTE: commenting this condition because TurboFan deoptimizes code when present
+      // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+      _p[12] = _p[12] * a2 + _p[15] * m2;
+      _p[13] = _p[13] * f2 + _p[15] * n2;
+      _p[14] = _p[14] * k2 + _p[15] * o2;
+      _p[15] *= p2;
+      // }
+      this._identityCalculated = false;
+      return this;
     }
 
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
+    var a1 = _p[0];
+    var b1 = _p[1];
+    var c1 = _p[2];
+    var d1 = _p[3];
+    var e1 = _p[4];
+    var f1 = _p[5];
+    var g1 = _p[6];
+    var h1 = _p[7];
+    var i1 = _p[8];
+    var j1 = _p[9];
+    var k1 = _p[10];
+    var l1 = _p[11];
+    var m1 = _p[12];
+    var n1 = _p[13];
+    var o1 = _p[14];
+    var p1 = _p[15];
 
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(_tan(ax), _tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        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);
-    }
-
-    function scale(sx, sy, sz) {
-        if(!sz && sz !== 0) {
-            sz = 1;
-        }
-        if(sx === 1 && sy === 1 && sz === 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        var _p = this.props;
-
-        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){
-            //NOTE: commenting this condition because TurboFan deoptimizes code when present
-            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-                _p[12] = _p[12] * a2 + _p[15] * m2;
-                _p[13] = _p[13] * f2 + _p[15] * n2;
-                _p[14] = _p[14] * k2 + _p[15] * o2;
-                _p[15] = _p[15] * p2;
-            //}
-            this._identityCalculated = false;
-            return this;
-        }
-
-        var a1 = _p[0];
-        var b1 = _p[1];
-        var c1 = _p[2];
-        var d1 = _p[3];
-        var e1 = _p[4];
-        var f1 = _p[5];
-        var g1 = _p[6];
-        var h1 = _p[7];
-        var i1 = _p[8];
-        var j1 = _p[9];
-        var k1 = _p[10];
-        var l1 = _p[11];
-        var m1 = _p[12];
-        var n1 = _p[13];
-        var o1 = _p[14];
-        var p1 = _p[15];
-
-        /* matrix order (canvas compatible):
+    /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+    _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+    _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
+    _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
+    _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
 
-        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+    _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
+    _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
+    _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
+    _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
 
-        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+    _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
+    _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
+    _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
+    _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
 
-        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+    _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
+    _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
+    _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
+    _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
 
-        this._identityCalculated = false;
-        return this;
+    this._identityCalculated = false;
+    return this;
+  }
+
+  function isIdentity() {
+    if (!this._identityCalculated) {
+      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);
+      this._identityCalculated = true;
     }
+    return this._identity;
+  }
 
-    function isIdentity() {
-        if(!this._identityCalculated){
-            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);
-            this._identityCalculated = true;
-        }
-        return this._identity;
+  function equals(matr) {
+    var i = 0;
+    while (i < 16) {
+      if (matr.props[i] !== this.props[i]) {
+        return false;
+      }
+      i += 1;
     }
+    return true;
+  }
 
-    function equals(matr){
-        var i = 0;
-        while (i < 16) {
-            if(matr.props[i] !== this.props[i]) {
-                return false;
-            }
-            i+=1;
-        }
-        return true;
+  function clone(matr) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      matr.props[i] = this.props[i];
     }
+    return matr;
+  }
 
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-        return matr;
+  function cloneFromProps(props) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      this.props[i] = props[i];
     }
+  }
 
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
+  function applyToPoint(x, y, z) {
+    return {
+      x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
+      y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
+      z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14],
+    };
+    /* return {
          x: x * me.a + y * me.c + me.e,
          y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
+         }; */
+  }
+  function applyToX(x, y, z) {
+    return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
+  }
+  function applyToY(x, y, z) {
+    return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
+  }
+  function applyToZ(x, y, z) {
+    return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
+  }
 
-    function getInverseMatrix() {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        var inverseMatrix = new Matrix();
-        inverseMatrix.props[0] = a;
-        inverseMatrix.props[1] = b;
-        inverseMatrix.props[4] = c;
-        inverseMatrix.props[5] = d;
-        inverseMatrix.props[12] = e;
-        inverseMatrix.props[13] = f;
-        return inverseMatrix;
-    }
+  function getInverseMatrix() {
+    var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
+    var a = this.props[5] / determinant;
+    var b = -this.props[1] / determinant;
+    var c = -this.props[4] / determinant;
+    var d = this.props[0] / determinant;
+    var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
+    var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
+    var inverseMatrix = new Matrix();
+    inverseMatrix.props[0] = a;
+    inverseMatrix.props[1] = b;
+    inverseMatrix.props[4] = c;
+    inverseMatrix.props[5] = d;
+    inverseMatrix.props[12] = e;
+    inverseMatrix.props[13] = f;
+    return inverseMatrix;
+  }
 
-    function inversePoint(pt) {
-        var inverseMatrix = this.getInverseMatrix();
-        return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
-    }
+  function inversePoint(pt) {
+    var inverseMatrix = this.getInverseMatrix();
+    return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
+  }
 
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
+  function inversePoints(pts) {
+    var i;
+    var len = pts.length;
+    var retPts = [];
+    for (i = 0; i < len; i += 1) {
+      retPts[i] = inversePoint(pts[i]);
     }
+    return retPts;
+  }
 
-    function applyToTriplePoints(pt1, pt2, pt3) {
-        var arr = createTypedArray('float32', 6);
-        if(this.isIdentity()) {
-            arr[0] = pt1[0];
-            arr[1] = pt1[1];
-            arr[2] = pt2[0];
-            arr[3] = pt2[1];
-            arr[4] = pt3[0];
-            arr[5] = pt3[1];
-        } else {
-            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
-            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
-            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
-            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
-            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
-            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
-            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
-        }
-        return arr;
+  function applyToTriplePoints(pt1, pt2, pt3) {
+    var arr = createTypedArray('float32', 6);
+    if (this.isIdentity()) {
+      arr[0] = pt1[0];
+      arr[1] = pt1[1];
+      arr[2] = pt2[0];
+      arr[3] = pt2[1];
+      arr[4] = pt3[0];
+      arr[5] = pt3[1];
+    } else {
+      var p0 = this.props[0];
+      var p1 = this.props[1];
+      var p4 = this.props[4];
+      var p5 = this.props[5];
+      var p12 = this.props[12];
+      var p13 = this.props[13];
+      arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+      arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+      arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+      arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+      arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+      arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
     }
+    return arr;
+  }
 
-    function applyToPointArray(x,y,z){
-        var arr;
-        if(this.isIdentity()) {
-            arr = [x,y,z];
-        } else {
-            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]
-            ];
-        }
-        return arr;
+  function applyToPointArray(x, y, z) {
+    var arr;
+    if (this.isIdentity()) {
+      arr = [x, y, z];
+    } else {
+      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],
+      ];
     }
+    return arr;
+  }
 
-    function applyToPointStringified(x, y) {
-        if(this.isIdentity()) {
-            return x + ',' + y;
-        }
-        var _p = this.props;
-        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;
+  function applyToPointStringified(x, y) {
+    if (this.isIdentity()) {
+      return x + ',' + y;
     }
+    var _p = this.props;
+    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;
+  }
 
-    function toCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function toCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var i = 0;
-        var props = this.props;
-        var cssValue = 'matrix3d(';
-        var v = 10000;
-        while(i<16){
-            cssValue += _rnd(props[i]*v)/v;
-            cssValue += i === 15 ? ')':',';
-            i += 1;
-        }
-        return cssValue;
+        } */
+    var i = 0;
+    var props = this.props;
+    var cssValue = 'matrix3d(';
+    var v = 10000;
+    while (i < 16) {
+      cssValue += _rnd(props[i] * v) / v;
+      cssValue += i === 15 ? ')' : ',';
+      i += 1;
     }
+    return cssValue;
+  }
 
-    function roundMatrixProperty(val) {
-        var v = 10000;
-        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
-            return _rnd(val * v) / v;
-        }
-        return val;
+  function roundMatrixProperty(val) {
+    var v = 10000;
+    if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+      return _rnd(val * v) / v;
     }
+    return val;
+  }
 
-    function to2dCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function to2dCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var props = this.props;
-        var _a = roundMatrixProperty(props[0]);
-        var _b = roundMatrixProperty(props[1]);
-        var _c = roundMatrixProperty(props[4]);
-        var _d = roundMatrixProperty(props[5]);
-        var _e = roundMatrixProperty(props[12]);
-        var _f = roundMatrixProperty(props[13]);
-        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
-    }
+        } */
+    var props = this.props;
+    var _a = roundMatrixProperty(props[0]);
+    var _b = roundMatrixProperty(props[1]);
+    var _c = roundMatrixProperty(props[4]);
+    var _d = roundMatrixProperty(props[5]);
+    var _e = roundMatrixProperty(props[12]);
+    var _f = roundMatrixProperty(props[13]);
+    return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
+  }
 
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToTriplePoints = applyToTriplePoints;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.equals = equals;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this.getInverseMatrix = getInverseMatrix;
-        this._t = this.transform;
-        this.isIdentity = isIdentity;
-        this._identity = true;
-        this._identityCalculated = false;
+  return function () {
+    this.reset = reset;
+    this.rotate = rotate;
+    this.rotateX = rotateX;
+    this.rotateY = rotateY;
+    this.rotateZ = rotateZ;
+    this.skew = skew;
+    this.skewFromAxis = skewFromAxis;
+    this.shear = shear;
+    this.scale = scale;
+    this.setTransform = setTransform;
+    this.translate = translate;
+    this.transform = transform;
+    this.applyToPoint = applyToPoint;
+    this.applyToX = applyToX;
+    this.applyToY = applyToY;
+    this.applyToZ = applyToZ;
+    this.applyToPointArray = applyToPointArray;
+    this.applyToTriplePoints = applyToTriplePoints;
+    this.applyToPointStringified = applyToPointStringified;
+    this.toCSS = toCSS;
+    this.to2dCSS = to2dCSS;
+    this.clone = clone;
+    this.cloneFromProps = cloneFromProps;
+    this.equals = equals;
+    this.inversePoints = inversePoints;
+    this.inversePoint = inversePoint;
+    this.getInverseMatrix = getInverseMatrix;
+    this._t = this.transform;
+    this.isIdentity = isIdentity;
+    this._identity = true;
+    this._identityCalculated = false;
 
-        this.props = createTypedArray('float32', 16);
-        this.reset();
-    };
+    this.props = createTypedArray('float32', 16);
+    this.reset();
+  };
 }());
 
+/* eslint-disable */
 /*
  Copyright 2014 David Bau.
 
@@ -1018,8 +1066,9 @@
     [],     // pool: entropy pool starts empty
     BMMath    // math: package containing random, pow, and seedrandom
 );
-var BezierFactory = (function(){
-    /**
+/* eslint-disable */
+var BezierFactory = (function () {
+  /**
      * BezierEasing - use bezier curve for transition easing function
      * by Gaëtan Renaudeau 2014 - 2015 – MIT License
      *
@@ -1030,6782 +1079,7190 @@
      *
      */
 
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
+  var ob = {};
+  ob.getBezierEasing = getBezierEasing;
+  var beziers = {};
 
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
+  function getBezierEasing(a, b, c, d, nm) {
+    var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
+    if (beziers[str]) {
+      return beziers[str];
     }
+    var bezEasing = new BezierEasing([a, b, c, d]);
+    beziers[str] = bezEasing;
+    return bezEasing;
+  }
 
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
+  // These values are established by empiricism with tests (tradeoff: performance VS precision)
+  var NEWTON_ITERATIONS = 4;
+  var NEWTON_MIN_SLOPE = 0.001;
+  var SUBDIVISION_PRECISION = 0.0000001;
+  var SUBDIVISION_MAX_ITERATIONS = 10;
 
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+  var kSplineTableSize = 11;
+  var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
 
-    var float32ArraySupported = typeof Float32Array === "function";
+  var float32ArraySupported = typeof Float32Array === 'function';
 
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
+  function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+  function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+  function C(aA1) { return 3.0 * aA1; }
 
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
+  // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+  function calcBezier(aT, aA1, aA2) {
+    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
+  }
+
+  // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+  function getSlope(aT, aA1, aA2) {
+    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
+  }
+
+  function binarySubdivide(aX, aA, aB, mX1, mX2) {
+    var currentX,
+      currentT,
+      i = 0;
+    do {
+      currentT = aA + (aB - aA) / 2.0;
+      currentX = calcBezier(currentT, mX1, mX2) - aX;
+      if (currentX > 0.0) {
+        aB = currentT;
+      } else {
+        aA = currentT;
+      }
+    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+    return currentT;
+  }
+
+  function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
+    for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+      var currentSlope = getSlope(aGuessT, mX1, mX2);
+      if (currentSlope === 0.0) return aGuessT;
+      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+      aGuessT -= currentX / currentSlope;
     }
+    return aGuessT;
+  }
 
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
+  /**
      * points is an array of [ mX1, mY1, mX2, mY2 ]
      */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
+  function BezierEasing(points) {
+    this._p = points;
+    this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+    this._precomputed = false;
 
-        this.get = this.get.bind(this);
-    }
+    this.get = this.get.bind(this);
+  }
 
-    BezierEasing.prototype = {
+  BezierEasing.prototype = {
 
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
+    get: function (x) {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      if (!this._precomputed) this._precompute();
+      if (mX1 === mY1 && mX2 === mY2) return x; // linear
+      // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+      if (x === 0) return 0;
+      if (x === 1) return 1;
+      return calcBezier(this._getTForX(x), mY1, mY2);
+    },
 
-        // Private part
+    // Private part
 
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
+    _precompute: function () {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      this._precomputed = true;
+      if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); }
+    },
 
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
+    _calcSampleValues: function () {
+      var mX1 = this._p[0],
+        mX2 = this._p[2];
+      for (var i = 0; i < kSplineTableSize; ++i) {
+        this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+      }
+    },
 
-        /**
+    /**
          * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
          */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
+    _getTForX: function (aX) {
+      var mX1 = this._p[0],
+        mX2 = this._p[2],
+        mSampleValues = this._mSampleValues;
 
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
+      var intervalStart = 0.0;
+      var currentSample = 1;
+      var lastSample = kSplineTableSize - 1;
 
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
+      for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
+        intervalStart += kSampleStepSize;
+      }
+      --currentSample;
 
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
+      // Interpolate to provide an initial guess for t
+      var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
+      var guessForT = intervalStart + dist * kSampleStepSize;
 
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
+      var initialSlope = getSlope(guessForT, mX1, mX2);
+      if (initialSlope >= NEWTON_MIN_SLOPE) {
+        return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+      } if (initialSlope === 0.0) {
+        return guessForT;
+      }
+      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+    },
+  };
 
-    return ob;
-
+  return ob;
 }());
+
 (function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
+  var lastTime = 0;
+  var vendors = ['ms', 'moz', 'webkit', 'o'];
+  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { // eslint-disable-line no-plusplus
+    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
+    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
+  }
+  if (!window.requestAnimationFrame) {
+    window.requestAnimationFrame = function (callback) {
+      var currTime = new Date().getTime();
+      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+      var id = setTimeout(function () {
+        callback(currTime + timeToCall);
+      },
+      timeToCall);
+      lastTime = currTime + timeToCall;
+      return id;
+    };
+  }
+  if (!window.cancelAnimationFrame) {
+    window.cancelAnimationFrame = function (id) {
+      clearTimeout(id);
+    };
+  }
 }());
 
-function extendPrototype(sources,destination){
-    var i, len = sources.length, sourcePrototype;
-    for (i = 0;i < len;i += 1) {
-        sourcePrototype = sources[i].prototype;
-        for (var attr in sourcePrototype) {
-            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
-        }
+/* exported extendPrototype, getDescriptor, createProxyFunction */
+
+function extendPrototype(sources, destination) {
+  var i;
+  var len = sources.length;
+  var sourcePrototype;
+  for (i = 0; i < len; i += 1) {
+    sourcePrototype = sources[i].prototype;
+    for (var attr in sourcePrototype) {
+      if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
     }
+  }
 }
 
 function getDescriptor(object, prop) {
-    return Object.getOwnPropertyDescriptor(object, prop);
+  return Object.getOwnPropertyDescriptor(object, prop);
 }
 
 function createProxyFunction(prototype) {
-	function ProxyFunction(){}
-	ProxyFunction.prototype = prototype;
-	return ProxyFunction;
+  function ProxyFunction() {}
+  ProxyFunction.prototype = prototype;
+  return ProxyFunction;
 }
-function bezFunction(){
 
-    var easingFunctions = [];
-    var math = Math;
+/* global segmentsLengthPool, defaultCurveSegments, createSizedArray, bmPow, bmSqrt, bmFloor, createTypedArray, bezierLengthPool */
+/* exported bez */
 
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.001 && det1 < 0.001;
+function bezFunction() {
+  var math = Math;
+
+  function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
+    var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1);
+    return det1 > -0.001 && det1 < 0.001;
+  }
+
+  function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
+    if (z1 === 0 && z2 === 0 && z3 === 0) {
+      return pointOnLine2D(x1, y1, x2, y2, x3, y3);
     }
+    var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
+    var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
+    var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
+    var diffDist;
+    if (dist1 > dist2) {
+      if (dist1 > dist3) {
+        diffDist = dist1 - dist2 - dist3;
+      } else {
+        diffDist = dist3 - dist2 - dist1;
+      }
+    } else if (dist3 > dist2) {
+      diffDist = dist3 - dist2 - dist1;
+    } else {
+      diffDist = dist2 - dist1 - dist3;
+    }
+    return diffDist > -0.0001 && diffDist < 0.0001;
+  }
 
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        if(z1 === 0 && z2 === 0 && z3 === 0) {
-            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+  var getBezierLength = (function () {
+    return function (pt1, pt2, pt3, pt4) {
+      var curveSegments = defaultCurveSegments;
+      var k;
+      var i;
+      var len;
+      var ptCoord;
+      var perc;
+      var addedLength = 0;
+      var ptDistance;
+      var point = [];
+      var lastPoint = [];
+      var lengthData = bezierLengthPool.newElement();
+      len = pt3.length;
+      for (k = 0; k < curveSegments; k += 1) {
+        perc = k / (curveSegments - 1);
+        ptDistance = 0;
+        for (i = 0; i < len; i += 1) {
+          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];
+          point[i] = ptCoord;
+          if (lastPoint[i] !== null) {
+            ptDistance += bmPow(point[i] - lastPoint[i], 2);
+          }
+          lastPoint[i] = point[i];
         }
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
+        if (ptDistance) {
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
         }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    var getBezierLength = (function(){
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = bezier_length_pool.newElement();
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.percents[k] = perc;
-                lengthData.lengths[k] = addedLength;
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function getSegmentsLength(shapeData) {
-        var segmentsLength = segments_length_pool.newElement();
-        var closed = shapeData.c;
-        var pathV = shapeData.v;
-        var pathO = shapeData.o;
-        var pathI = shapeData.i;
-        var i, len = shapeData._length;
-        var lengths = segmentsLength.lengths;
-        var totalLength = 0;
-        for(i=0;i<len-1;i+=1){
-            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-            totalLength += lengths[i].addedLength;
-        }
-        if(closed && len){
-            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-            totalLength += lengths[i].addedLength;
-        }
-        segmentsLength.totalLength = totalLength;
-        return segmentsLength;
-    }
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (pt1, pt2, pt3, pt4){
-            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
-            if(!storedData[bezierName]){
-                var curveSegments = defaultCurveSegments;
-                var k, i, len;
-                var ptCoord,perc,addedLength = 0;
-                var ptDistance;
-                var point,lastPoint = null;
-                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])){
-                    curveSegments = 2;
-                }
-                var bezierData = new BezierData(curveSegments);
-                len = pt3.length;
-                for (k = 0; k < curveSegments; k += 1) {
-                    point = createSizedArray(len);
-                    perc = k / (curveSegments - 1);
-                    ptDistance = 0;
-                    for (i = 0; i < len; i += 1){
-                        ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                        point[i] = ptCoord;
-                        if(lastPoint !== null){
-                            ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                        }
-                    }
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                    bezierData.points[k] = new PointData(ptDistance, point);
-                    lastPoint = point;
-                }
-                bezierData.segmentLength = addedLength;
-                storedData[bezierName] = bezierData;
-            }
-            return storedData[bezierName];
-        };
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var percents = bezierData.percents;
-        var lengths = bezierData.lengths;
-        var len = percents.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
-            return percents[initPos];
-        }else{
-            var dir = lengths[initPos] > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
-                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    //FIX for TypedArrays that don't store floating point values with enough accuracy
-                    if(initPos === len - 1) {
-                        return percents[initPos];
-                    }
-                    flag = false;
-                }
-            }
-            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
-        }
-    }
-
-    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
-        var t1 = getDistancePerc(percent,bezierData);
-        var u0 = 1;
-        var u1 = 1 - t1;
-        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;
-        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;
-        return [ptX, ptY];
-    }
-
-    function getSegmentArray() {
-
-    }
-
-    var bezier_segment_points = createTypedArray('float32', 8);
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        var u0u0u0 = u0*u0*u0;
-        var t0u0u0_3 = t0*u0*u0*3;
-        var t0t0u0_3 = t0*t0*u0*3;
-        var t0t0t0 = t0*t0*t0;
-        //
-        var u0u0u1 = u0*u0*u1;
-        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
-        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
-        var t0t0t1 = t0*t0*t1;
-        //
-        var u0u1u1 = u0*u1*u1;
-        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
-        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
-        var t0t1t1 = t0*t1*t1;
-        //
-        var u1u1u1 = u1*u1*u1;
-        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
-        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
-        var t1t1t1 = t1*t1*t1;
-        for(i=0;i<len;i+=1){
-            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
-        }
-
-        return bezier_segment_points;
-    }
-
-    return {
-        getSegmentsLength : getSegmentsLength,
-        getNewSegment : getNewSegment,
-        getPointInSegment : getPointInSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
+        lengthData.percents[k] = perc;
+        lengthData.lengths[k] = addedLength;
+      }
+      lengthData.addedLength = addedLength;
+      return lengthData;
     };
+  }());
+
+  function getSegmentsLength(shapeData) {
+    var segmentsLength = segmentsLengthPool.newElement();
+    var closed = shapeData.c;
+    var pathV = shapeData.v;
+    var pathO = shapeData.o;
+    var pathI = shapeData.i;
+    var i;
+    var len = shapeData._length;
+    var lengths = segmentsLength.lengths;
+    var totalLength = 0;
+    for (i = 0; i < len - 1; i += 1) {
+      lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
+      totalLength += lengths[i].addedLength;
+    }
+    if (closed && len) {
+      lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
+      totalLength += lengths[i].addedLength;
+    }
+    segmentsLength.totalLength = totalLength;
+    return segmentsLength;
+  }
+
+  function BezierData(length) {
+    this.segmentLength = 0;
+    this.points = new Array(length);
+  }
+
+  function PointData(partial, point) {
+    this.partialLength = partial;
+    this.point = point;
+  }
+
+  var buildBezierData = (function () {
+    var storedData = {};
+
+    return function (pt1, pt2, pt3, pt4) {
+      var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
+      if (!storedData[bezierName]) {
+        var curveSegments = defaultCurveSegments;
+        var k;
+        var i;
+        var len;
+        var ptCoord;
+        var perc;
+        var addedLength = 0;
+        var ptDistance;
+        var point;
+        var lastPoint = null;
+        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])) {
+          curveSegments = 2;
+        }
+        var bezierData = new BezierData(curveSegments);
+        len = pt3.length;
+        for (k = 0; k < curveSegments; k += 1) {
+          point = createSizedArray(len);
+          perc = k / (curveSegments - 1);
+          ptDistance = 0;
+          for (i = 0; i < len; i += 1) {
+            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];
+            point[i] = ptCoord;
+            if (lastPoint !== null) {
+              ptDistance += bmPow(point[i] - lastPoint[i], 2);
+            }
+          }
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
+          bezierData.points[k] = new PointData(ptDistance, point);
+          lastPoint = point;
+        }
+        bezierData.segmentLength = addedLength;
+        storedData[bezierName] = bezierData;
+      }
+      return storedData[bezierName];
+    };
+  }());
+
+  function getDistancePerc(perc, bezierData) {
+    var percents = bezierData.percents;
+    var lengths = bezierData.lengths;
+    var len = percents.length;
+    var initPos = bmFloor((len - 1) * perc);
+    var lengthPos = perc * bezierData.addedLength;
+    var lPerc = 0;
+    if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
+      return percents[initPos];
+    }
+    var dir = lengths[initPos] > lengthPos ? -1 : 1;
+    var flag = true;
+    while (flag) {
+      if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
+        lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
+        flag = false;
+      } else {
+        initPos += dir;
+      }
+      if (initPos < 0 || initPos >= len - 1) {
+        // FIX for TypedArrays that don't store floating point values with enough accuracy
+        if (initPos === len - 1) {
+          return percents[initPos];
+        }
+        flag = false;
+      }
+    }
+    return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
+  }
+
+  function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+    var t1 = getDistancePerc(percent, bezierData);
+    var u1 = 1 - t1;
+    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;
+    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;
+    return [ptX, ptY];
+  }
+
+  var bezierSegmentPoints = createTypedArray('float32', 8);
+
+  function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
+    if (startPerc < 0) {
+      startPerc = 0;
+    } else if (startPerc > 1) {
+      startPerc = 1;
+    }
+    var t0 = getDistancePerc(startPerc, bezierData);
+    endPerc = endPerc > 1 ? 1 : endPerc;
+    var t1 = getDistancePerc(endPerc, bezierData);
+    var i;
+    var len = pt1.length;
+    var u0 = 1 - t0;
+    var u1 = 1 - t1;
+    var u0u0u0 = u0 * u0 * u0;
+    var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0t0 = t0 * t0 * t0;
+    //
+    var u0u0u1 = u0 * u0 * u1;
+    var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0t1 = t0 * t0 * t1;
+    //
+    var u0u1u1 = u0 * u1 * u1;
+    var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1t1 = t0 * t1 * t1;
+    //
+    var u1u1u1 = u1 * u1 * u1;
+    var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1t1 = t1 * t1 * t1;
+    for (i = 0; i < len; i += 1) {
+      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
+      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
+      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
+      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
+    }
+
+    return bezierSegmentPoints;
+  }
+
+  return {
+    getSegmentsLength: getSegmentsLength,
+    getNewSegment: getNewSegment,
+    getPointInSegment: getPointInSegment,
+    buildBezierData: buildBezierData,
+    pointOnLine2D: pointOnLine2D,
+    pointOnLine3D: pointOnLine3D,
+  };
 }
 
 var bez = bezFunction();
-function dataFunctionManager(){
 
-    //var tCanvasHelper = createTag('canvas').getContext('2d');
+/* exported dataManager */
 
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
+function dataFunctionManager() {
+  // var tCanvasHelper = createTag('canvas').getContext('2d');
+
+  function completeLayers(layers, comps, fontManager) {
+    var layerData;
+    var i;
+    var len = layers.length;
+    var j;
+    var jLen;
+    var k;
+    var kLen;
+    for (i = 0; i < len; i += 1) {
+      layerData = layers[i];
+      if (('ks' in layerData) && !layerData.completed) {
+        layerData.completed = true;
+        if (layerData.tt) {
+          layers[i - 1].td = layerData.tt;
         }
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              convertPathsToAbsoluteValues(maskProps[j].pt.k);
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
+                }
+              }
+            }
+          }
+        }
+        if (layerData.ty === 0) {
+          layerData.layers = findCompLayers(layerData.refId, comps);
+          completeLayers(layerData.layers, comps, fontManager);
+        } else if (layerData.ty === 4) {
+          completeShapes(layerData.shapes);
+        } else if (layerData.ty === 5) {
+          completeText(layerData, fontManager);
+        }
+      }
+    }
+  }
+
+  function findCompLayers(id, comps) {
+    var i = 0;
+    var len = comps.length;
+    while (i < len) {
+      if (comps[i].id === id) {
+        if (!comps[i].layers.__used) {
+          comps[i].layers.__used = true;
+          return comps[i].layers;
+        }
+        return JSON.parse(JSON.stringify(comps[i].layers));
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function completeShapes(arr) {
+    var i;
+    var len = arr.length;
+    var j;
+    var jLen;
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (arr[i].ty === 'sh') {
+        if (arr[i].ks.k.i) {
+          convertPathsToAbsoluteValues(arr[i].ks.k);
+        } else {
+          jLen = arr[i].ks.k.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (arr[i].ks.k[j].s) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
+            }
+            if (arr[i].ks.k[j].e) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
+            }
+          }
+        }
+      } else if (arr[i].ty === 'gr') {
+        completeShapes(arr[i].it);
+      }
+    }
+  }
+
+  function convertPathsToAbsoluteValues(path) {
+    var i;
+    var len = path.i.length;
+    for (i = 0; i < len; i += 1) {
+      path.i[i][0] += path.v[i][0];
+      path.i[i][1] += path.v[i][1];
+      path.o[i][0] += path.v[i][0];
+      path.o[i][1] += path.v[i][1];
+    }
+  }
+
+  function checkVersion(minimum, animVersionString) {
+    var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
+    if (minimum[0] > animVersion[0]) {
+      return true;
+    } if (animVersion[0] > minimum[0]) {
+      return false;
+    }
+    if (minimum[1] > animVersion[1]) {
+      return true;
+    } if (animVersion[1] > minimum[1]) {
+      return false;
+    }
+    if (minimum[2] > animVersion[2]) {
+      return true;
+    } if (animVersion[2] > minimum[2]) {
+      return false;
+    }
+    return null;
+  }
+
+  var checkText = (function () {
+    var minimumVersion = [4, 4, 14];
+
+    function updateTextLayer(textLayer) {
+      var documentData = textLayer.t.d;
+      textLayer.t.d = {
+        k: [
+          {
+            s: documentData,
+            t: 0,
+          },
+        ],
+      };
     }
 
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                if(!comps[i].layers.__used) {
-                    comps[i].layers.__used = true;
-                    return comps[i].layers;
-                }
-                return JSON.parse(JSON.stringify(comps[i].layers));
-            }
-            i += 1;
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 5) {
+          updateTextLayer(layers[i]);
         }
+      }
     }
 
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
             }
+          }
         }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
+      }
+    };
+  }());
+
+  var checkChars = (function () {
+    var minimumVersion = [4, 7, 99];
+    return function (animationData) {
+      if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
+        var i;
+        var len = animationData.chars.length;
+        var j;
+        var jLen;
+        var pathData;
+        var paths;
+        for (i = 0; i < len; i += 1) {
+          if (animationData.chars[i].data && animationData.chars[i].data.shapes) {
+            paths = animationData.chars[i].data.shapes[0].it;
+            jLen = paths.length;
+
+            for (j = 0; j < jLen; j += 1) {
+              pathData = paths[j].ks.k;
+              if (!pathData.__converted) {
+                convertPathsToAbsoluteValues(paths[j].ks.k);
+                pathData.__converted = true;
+              }
+            }
+          }
+        }
+      }
+    };
+  }());
+
+  var checkColors = (function () {
+    var minimumVersion = [4, 1, 9];
+
+    function iterateShapes(shapes) {
+      var i;
+      var len = shapes.length;
+      var j;
+      var jLen;
+      for (i = 0; i < len; i += 1) {
+        if (shapes[i].ty === 'gr') {
+          iterateShapes(shapes[i].it);
+        } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
+          if (shapes[i].c.k && shapes[i].c.k[0].i) {
+            jLen = shapes[i].c.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (shapes[i].c.k[j].s) {
+                shapes[i].c.k[j].s[0] /= 255;
+                shapes[i].c.k[j].s[1] /= 255;
+                shapes[i].c.k[j].s[2] /= 255;
+                shapes[i].c.k[j].s[3] /= 255;
+              }
+              if (shapes[i].c.k[j].e) {
+                shapes[i].c.k[j].e[0] /= 255;
+                shapes[i].c.k[j].e[1] /= 255;
+                shapes[i].c.k[j].e[2] /= 255;
+                shapes[i].c.k[j].e[3] /= 255;
+              }
+            }
+          } else {
+            shapes[i].c.k[0] /= 255;
+            shapes[i].c.k[1] /= 255;
+            shapes[i].c.k[2] /= 255;
+            shapes[i].c.k[3] /= 255;
+          }
+        }
+      }
     }
 
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 4) {
+          iterateShapes(layers[i].shapes);
         }
+      }
     }
 
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
+      }
+    };
+  }());
+
+  var checkShapes = (function () {
+    var minimumVersion = [4, 4, 18];
+
+    function completeClosingShapes(arr) {
+      var i;
+      var len = arr.length;
+      var j;
+      var jLen;
+      for (i = len - 1; i >= 0; i -= 1) {
+        if (arr[i].ty === 'sh') {
+          if (arr[i].ks.k.i) {
+            arr[i].ks.k.c = arr[i].closed;
+          } else {
+            jLen = arr[i].ks.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (arr[i].ks.k[j].s) {
+                arr[i].ks.k[j].s[0].c = arr[i].closed;
+              }
+              if (arr[i].ks.k[j].e) {
+                arr[i].ks.k[j].e[0].c = arr[i].closed;
+              }
+            }
+          }
+        } else if (arr[i].ty === 'gr') {
+          completeClosingShapes(arr[i].it);
         }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
+      }
     }
 
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            };
+    function iterateLayers(layers) {
+      var layerData;
+      var i;
+      var len = layers.length;
+      var j;
+      var jLen;
+      var k;
+      var kLen;
+      for (i = 0; i < len; i += 1) {
+        layerData = layers[i];
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              maskProps[j].pt.k.c = maskProps[j].cl;
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
+                }
+              }
+            }
+          }
         }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
+        if (layerData.ty === 4) {
+          completeClosingShapes(layerData.shapes);
         }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkChars = (function() {
-        var minimumVersion = [4,7,99];
-        return function (animationData){
-            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
-                var i, len = animationData.chars.length, j, jLen, k, kLen;
-                var pathData, paths;
-                for(i = 0; i < len; i += 1) {
-                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
-                        paths = animationData.chars[i].data.shapes[0].it;
-                        jLen = paths.length;
-
-                        for(j = 0; j < jLen; j += 1) {
-                            pathData = paths[j].ks.k;
-                            if(!pathData.__converted) {
-                                convertPathsToAbsoluteValues(paths[j].ks.k);
-                                pathData.__converted = true;
-                            }
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkChars(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
+      }
     }
 
-    function completeText(data, fontManager){
-        if(data.t.a.length === 0 && !('m' in data.t.p)){
-            data.singleShape = true;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
+      }
+    };
+  }());
+
+  function completeData(animationData, fontManager) {
+    if (animationData.__complete) {
+      return;
     }
+    checkColors(animationData);
+    checkText(animationData);
+    checkChars(animationData);
+    checkShapes(animationData);
+    completeLayers(animationData.layers, animationData.assets, fontManager);
+    animationData.__complete = true;
+  }
 
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-    moduleOb.checkColors = checkColors;
-    moduleOb.checkChars = checkChars;
-    moduleOb.checkShapes = checkShapes;
-    moduleOb.completeLayers = completeLayers;
+  function completeText(data) {
+    if (data.t.a.length === 0 && !('m' in data.t.p)) {
+      data.singleShape = true;
+    }
+  }
 
-    return moduleOb;
+  var moduleOb = {};
+  moduleOb.completeData = completeData;
+  moduleOb.checkColors = checkColors;
+  moduleOb.checkChars = checkChars;
+  moduleOb.checkShapes = checkShapes;
+  moduleOb.completeLayers = completeLayers;
+
+  return moduleOb;
 }
 
 var dataManager = dataFunctionManager();
 
-var FontManager = (function(){
+/* exported getFontProperties */
 
-    var maxWaitingTime = 5000;
-    var emptyChar = {
-        w: 0,
-        size:0,
-        shapes:[]
-    };
-    var combinedCharacters = [];
-    //Hindi characters
-    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]);
+function getFontProperties(fontData) {
+  var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
 
-    function trimFontOptions(font) {
-        var familyArray = font.split(',');
-        var i, len = familyArray.length;
-        var enabledFamilies = [];
-        for (i = 0; i < len; i += 1) {
-            if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
-                enabledFamilies.push(familyArray[i]);
-            }
-        }
-        return enabledFamilies.join(',');
+  var fWeight = 'normal'; var
+    fStyle = 'normal';
+  var len = styles.length;
+  var styleName;
+  for (var i = 0; i < len; i += 1) {
+    styleName = styles[i].toLowerCase();
+    switch (styleName) {
+      case 'italic':
+        fStyle = 'italic';
+        break;
+      case 'bold':
+        fWeight = '700';
+        break;
+      case 'black':
+        fWeight = '900';
+        break;
+      case 'medium':
+        fWeight = '500';
+        break;
+      case 'regular':
+      case 'normal':
+        fWeight = '400';
+        break;
+      case 'light':
+      case 'thin':
+        fWeight = '200';
+        break;
+      default:
+        break;
     }
+  }
 
-    function setUpNode(font, family){
-        var parentNode = createTag('span');
-        parentNode.style.fontFamily    = family;
-        var node = createTag('span');
-        // Characters that vary significantly among different fonts
-        node.innerText = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = trimFontOptions(font) + ', ' + family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(this.checkLoadedFontsBinded, 20);
-        }else{
-            setTimeout(this.setIsLoadedBinded, 10);
-
-        }
-    }
-
-    function createHelper(def, fontData){
-        var tHelper = createNS('text');
-        tHelper.style.fontSize = '100px';
-        //tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.setAttribute('font-family', fontData.fFamily);
-        tHelper.setAttribute('font-style', fontData.fStyle);
-        tHelper.setAttribute('font-weight', fontData.fWeight);
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.setAttribute('class', fontData.fClass);
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = createTag('canvas').getContext('2d');
-        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
-        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.isLoaded = true;
-            return;
-        }
-        if(this.chars){
-            this.isLoaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        var _pendingFonts = len;
-        for(i=0; i<len; i+= 1){
-            var shouldLoadFont = true;
-            var loadedSelector;
-            var j;
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-                _pendingFonts -= 1;
-            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
-                loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
-
-                if (loadedSelector.length > 0) {
-                    shouldLoadFont = false;
-                }
-
-                if (shouldLoadFont) {
-                    var s = createTag('style');
-                    s.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    s.setAttribute('f-origin', fontArr[i].origin);
-                    s.setAttribute('f-family', fontArr[i].fFamily);
-                    s.type = "text/css";
-                    s.innerText = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                    defs.appendChild(s);
-                }
-            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
-                loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var l = createTag('link');
-                    l.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    l.setAttribute('f-origin', fontArr[i].origin);
-                    l.type = "text/css";
-                    l.rel = "stylesheet";
-                    l.href = fontArr[i].fPath;
-                    document.body.appendChild(l);
-                }
-            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
-                loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (fontArr[i].fPath === loadedSelector[j].src) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var sc = createTag('link');
-                    sc.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    sc.setAttribute('f-origin', fontArr[i].origin);
-                    sc.setAttribute('rel','stylesheet');
-                    sc.setAttribute('href',fontArr[i].fPath);
-                    defs.appendChild(sc);
-                }
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            fontArr[i].cache = {};
-            this.fonts.push(fontArr[i]);
-        }
-        if (_pendingFonts === 0) {
-            this.isLoaded = true;
-        } else {
-            //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
-            //Adding this timeout seems to fix it
-           setTimeout(this.checkLoadedFonts.bind(this), 100);
-        }
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-        if ((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char)
-            && console
-            && console.warn
-            && !this._warned
-           ) {
-            this._warned = true
-            console.warn('Missing character from exported characters list: ', char, style, font);
-        }
-        return emptyChar;
-    }
-
-    function measureText(char, fontName, size) {
-        var fontData = this.getFontByName(fontName);
-        var index = char.charCodeAt(0);
-        if(!fontData.cache[index + 1]) {
-            var tHelper = fontData.helper;
-            //Canvas version
-            //fontData.cache[index] = tHelper.measureText(char).width / 100;
-            //SVG version
-            //console.log(tHelper.getBBox().width)
-            if (char === ' ') {
-                tHelper.textContent = '|' + char + '|';
-                var doubleSize = tHelper.getComputedTextLength();
-                tHelper.textContent = '||';
-                var singleSize = tHelper.getComputedTextLength();
-                fontData.cache[index + 1] = (doubleSize - singleSize)/100;
-            } else {
-                tHelper.textContent = char;
-                fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
-            }
-        }
-        return fontData.cache[index + 1] * size;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return this.fonts[0];
-    }
-
-    function getCombinedCharacterCodes() {
-        return combinedCharacters;
-    }
-
-    function setIsLoaded() {
-        this.isLoaded = true
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this._warned = false;
-        this.initTime = Date.now();
-        this.setIsLoadedBinded = this.setIsLoaded.bind(this)
-        this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)
-    };
-    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
-    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
-
-    var fontPrototype = {
-        addChars: addChars,
-        addFonts: addFonts,
-        getCharData: getCharData,
-        getFontByName: getFontByName,
-        measureText: measureText,
-        checkLoadedFonts: checkLoadedFonts,
-        setIsLoaded: setIsLoaded,
-    }
-
-    Font.prototype = fontPrototype;
-
-    return Font;
-
-}());
-
-var PropertyFactory = (function(){
-
-    var initFrame = initialDefaultFrame;
-    var math_abs = Math.abs;
-
-    function interpolateValue(frameNum, caching) {
-        var offsetTime = this.offsetTime;
-        var newValue;
-        if (this.propType === 'multidimensional') {
-            newValue = createTypedArray('float32', this.pv.length);
-        }
-        var iterationIndex = caching.lastIndex;
-        var i = iterationIndex;
-        var len = this.keyframes.length - 1, flag = true;
-        var keyData, nextKeyData;
-
-        while (flag) {
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i + 1];
-            if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                iterationIndex = 0;
-                break;
-            }
-            if ((nextKeyData.t - offsetTime) > frameNum){
-                iterationIndex = i;
-                break;
-            }
-            if (i < len - 1){
-                i += 1;
-            } else {
-                iterationIndex = 0;
-                flag = false;
-            }
-        }
-
-        var k, kLen, perc, jLen, j, fnc;
-        var nextKeyTime = nextKeyData.t - offsetTime;
-        var keyTime = keyData.t - offsetTime;
-        var endValue;
-        if (keyData.to) {
-            if (!keyData.bezierData) {
-                keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyTime || frameNum < keyTime) {
-                var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for (k = 0; k < kLen; k += 1) {
-                    newValue[k] = bezierData.points[ind].point[k];
-                }
-                // caching._lastKeyframeIndex = -1;
-            } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
-                } else {
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
-                }
-                perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
-                var distanceInLine = bezierData.segmentLength*perc;
-
-                var segmentPerc;
-                var addedLength =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
-                j =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
-                flag = true;
-                jLen = bezierData.points.length;
-                while (flag) {
-                    addedLength += bezierData.points[j].partialLength;
-                    if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
-                        segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1){
-                        j += 1;
-                    } else {
-                        flag = false;
-                    }
-                }
-                caching._lastPoint = j;
-                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                caching._lastKeyframeIndex = i;
-            }
-        } else {
-            var outX, outY, inX, inY, keyValue;
-            len = keyData.s.length;
-            endValue = nextKeyData.s || keyData.e;
-            if (this.sh && keyData.h !== 1) {
-                if (frameNum >= nextKeyTime) {
-                    newValue[0] = endValue[0];
-                    newValue[1] = endValue[1];
-                    newValue[2] = endValue[2];
-                } else if (frameNum <= keyTime) {
-                    newValue[0] = keyData.s[0];
-                    newValue[1] = keyData.s[1];
-                    newValue[2] = keyData.s[2];
-                } else {
-                    var quatStart = createQuaternion(keyData.s);
-                    var quatEnd = createQuaternion(endValue);
-                    var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
-                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
-                }
-                
-            } else {
-                for(i = 0; i < len; i += 1) {
-                    if (keyData.h !== 1) {
-                        if (frameNum >= nextKeyTime) {
-                            perc = 1;
-                        } else if(frameNum < keyTime) {
-                            perc = 0;
-                        } else {
-                            if(keyData.o.x.constructor === Array) {
-                                if (!keyData.__fnct) {
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
-                                    outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
-                                    inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
-                                    inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct = fnc;
-                                } else {
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
-                        }
-                    }
-
-                    endValue = nextKeyData.s || keyData.e;
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
-
-                    if (this.propType === 'multidimensional') {
-                        newValue[i] = keyValue;
-                    } else {
-                        newValue = keyValue;
-                    }
-                }
-            }
-        }
-        caching.lastIndex = iterationIndex;
-        return newValue;
-    }
-
-    //based on @Toji's https://github.com/toji/gl-matrix/
-    function slerp(a, b, t) {
-        var out = [];
-        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
-        bx = b[0], by = b[1], bz = b[2], bw = b[3]
-
-        var omega, cosom, sinom, scale0, scale1;
-
-        cosom = ax * bx + ay * by + az * bz + aw * bw;
-        if (cosom < 0.0) {
-            cosom = -cosom;
-            bx = -bx;
-            by = -by;
-            bz = -bz;
-            bw = -bw;
-        }
-        if ((1.0 - cosom) > 0.000001) {
-            omega = Math.acos(cosom);
-            sinom = Math.sin(omega);
-            scale0 = Math.sin((1.0 - t) * omega) / sinom;
-            scale1 = Math.sin(t * omega) / sinom;
-        } else {
-            scale0 = 1.0 - t;
-            scale1 = t;
-        }
-        out[0] = scale0 * ax + scale1 * bx;
-        out[1] = scale0 * ay + scale1 * by;
-        out[2] = scale0 * az + scale1 * bz;
-        out[3] = scale0 * aw + scale1 * bw;
-
-        return out;
-    }
-
-    function quaternionToEuler(out, quat) {
-        var qx = quat[0];
-        var qy = quat[1];
-        var qz = quat[2];
-        var qw = quat[3];
-        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
-        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
-        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
-        out[0] = heading/degToRads;
-        out[1] = attitude/degToRads;
-        out[2] = bank/degToRads;
-    }
-
-    function createQuaternion(values) {
-        var heading = values[0] * degToRads;
-        var attitude = values[1] * degToRads;
-        var bank = values[2] * degToRads;
-        var c1 = Math.cos(heading / 2);
-        var c2 = Math.cos(attitude / 2);
-        var c3 = Math.cos(bank / 2);
-        var s1 = Math.sin(heading / 2);
-        var s2 = Math.sin(attitude / 2);
-        var s3 = Math.sin(bank / 2);
-        var w = c1 * c2 * c3 - s1 * s2 * s3;
-        var x = s1 * s2 * c3 + c1 * c2 * s3;
-        var y = s1 * c2 * c3 + c1 * s2 * s3;
-        var z = c1 * s2 * c3 - s1 * c2 * s3;
-
-        return [x,y,z,w];
-    }
-
-    function getValueAtCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
-        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
-            if(this._caching.lastFrame >= frameNum) {
-                this._caching._lastKeyframeIndex = -1;
-                this._caching.lastIndex = 0;
-            }
-
-            var renderResult = this.interpolateValue(frameNum, this._caching);
-            this.pv = renderResult;
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
-    }
-
-    function setVValue(val) {
-        var multipliedValue;
-        if(this.propType === 'unidimensional') {
-            multipliedValue = val * this.mult;
-            if(math_abs(this.v - multipliedValue) > 0.00001) {
-                this.v = multipliedValue;
-                this._mdf = true;
-            }
-        } else {
-            var i = 0, len = this.v.length;
-            while (i < len) {
-                multipliedValue = val[i] * this.mult;
-                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
-                    this.v[i] = multipliedValue;
-                    this._mdf = true;
-                }
-                i += 1;
-            }
-        }
-    }
-
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
-            return;
-        }
-        if(this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = this._isFirstFrame;
-        var multipliedValue;
-        var i, len = this.effectsSequence.length;
-        var finalValue = this.kf ? this.pv : this.data.k;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this._isFirstFrame = false;
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
-    }
-
-    function ValueProperty(elem, data, mult, container){
-        this.propType = 'unidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.effectsSequence = [];
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function MultiDimensionalProperty(elem, data, mult, container) {
-        this.propType = 'multidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        var i, len = data.k.length;
-        this.v = createTypedArray('float32', len);
-        this.pv = createTypedArray('float32', len);
-        var arr = createTypedArray('float32', len);
-        this.vel = createTypedArray('float32', len);
-        for (i = 0; i < len; i += 1) {
-            this.v[i] = data.k[i] * this.mult;
-            this.pv[i] = data.k[i];
-        }
-        this._isFirstFrame = true;
-        this.effectsSequence = [];
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedValueProperty(elem, data, mult, container) {
-        this.propType = 'unidimensional';
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.frameId = -1;
-        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.v = initFrame;
-        this.pv = initFrame;
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult, container){
-        this.propType = 'multidimensional';
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for (i = 0; i < len - 1; i += 1) {
-            if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
-                s = data.k[i].s;
-                e = data.k[i + 1].s;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                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]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
-                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
-                        data.k[i].to = null;
-                        data.k[i].ti = null;
-                    }
-                }
-            }
-        }
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.data = data;
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this._isFirstFrame = true;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.frameId = -1;
-        var arrLen = data.k[0].s.length;
-        this.v = createTypedArray('float32', arrLen);
-        this.pv = createTypedArray('float32', arrLen);
-        for (i = 0; i < arrLen; i += 1) {
-            this.v[i] = initFrame;
-            this.pv[i] = initFrame;
-        }
-        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
-        this.addEffect = addEffect;
-    }
-
-    function getProp(elem,data,type, mult, container) {
-        var p;
-        if(!data.k.length){
-            p = new ValueProperty(elem,data, mult, container);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult, container);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult, container);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
-                    break;
-            }
-        }
-        if(p.effectsSequence.length){
-            container.addDynamicProperty(p);
-        }
-        return p;
-    }
-
-    var ob = {
-        getProp: getProp
-    };
-    return ob;
-}());
-var TransformPropertyFactory = (function() {
-
-    var defaultVector = [0,0]
-
-    function applyToMatrix(mat) {
-        var _mdf = this._mdf;
-        this.iterateDynamicProperties();
-        this._mdf = this._mdf || _mdf;
-        if (this.a) {
-            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-        }
-        if (this.s) {
-            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-        }
-        if (this.sk) {
-            mat.skewFromAxis(-this.sk.v, this.sa.v);
-        }
-        if (this.r) {
-            mat.rotate(-this.r.v);
-        } else {
-            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]);
-        }
-        if (this.data.p.s) {
-            if (this.data.p.z) {
-                mat.translate(this.px.v, this.py.v, -this.pz.v);
-            } else {
-                mat.translate(this.px.v, this.py.v, 0);
-            }
-        } else {
-            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-        }
-    }
-    function processKeys(forceRender){
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        }
-        if(this._isDirty) {
-            this.precalculateMatrix();
-            this._isDirty = false;
-        }
-
-        this.iterateDynamicProperties();
-
-        if (this._mdf || forceRender) {
-            this.v.cloneFromProps(this.pre.props);
-            if (this.appliedTransformations < 1) {
-                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if(this.appliedTransformations < 2) {
-                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.sk && this.appliedTransformations < 3) {
-                this.v.skewFromAxis(-this.sk.v, this.sa.v);
-            }
-            if (this.r && this.appliedTransformations < 4) {
-                this.v.rotate(-this.r.v);
-            } else if (!this.r && this.appliedTransformations < 4){
-                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]);
-            }
-            if (this.autoOriented) {
-                var v1,v2, frameRate = this.elem.globalData.frameRate;
-                if(this.p && this.p.keyframes && this.p.getValueAtTime) {
-                    if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
-                    } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
-                    }
-                } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
-                    v1 = [];
-                    v2 = [];
-                    var px = this.px, py = this.py, frameRate;
-                    if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
-                        v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
-                        v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
-                    } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
-                        v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
-                        v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
-                    } else {
-                        v1 = [px.pv, py.pv];
-                        v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
-                        v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
-                    }
-                } else {
-                    v1 = v2 = defaultVector
-                }
-                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-            }
-            if(this.data.p && this.data.p.s){
-                if(this.data.p.z) {
-                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    this.v.translate(this.px.v, this.py.v, 0);
-                }
-            }else{
-                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-            }
-        }
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function precalculateMatrix() {
-        if(!this.a.k) {
-            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            this.appliedTransformations = 1;
-        } else {
-            return;
-        }
-        if(!this.s.effectsSequence.length) {
-            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            this.appliedTransformations = 2;
-        } else {
-            return;
-        }
-        if(this.sk) {
-            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
-                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
-            this.appliedTransformations = 3;
-            } else {
-                return;
-            }
-        }
-        if (this.r) {
-            if(!this.r.effectsSequence.length) {
-                this.pre.rotate(-this.r.v);
-                this.appliedTransformations = 4;
-            } else {
-                return;
-            }
-        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
-            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]);
-            this.appliedTransformations = 4;
-        }
-    }
-
-    function autoOrient(){
-        //
-        //var prevP = this.getValueAtTime();
-    }
-
-    function addDynamicProperty(prop) {
-        this._addDynamicProperty(prop);
-        this.elem.addDynamicProperty(prop);
-        this._isDirty = true;
-    }
-
-    function TransformProperty(elem,data,container){
-        this.elem = elem;
-        this.frameId = -1;
-        this.propType = 'transform';
-        this.data = data;
-        this.v = new Matrix();
-        //Precalculated matrix with non animated properties
-        this.pre = new Matrix();
-        this.appliedTransformations = 0;
-        this.initDynamicPropertyContainer(container || elem);
-        if(data.p && data.p.s){
-            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
-            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
-            if(data.p.z){
-                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
-            }
-        }else{
-            this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
-        }
-        if(data.rx) {
-            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
-            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
-            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
-            if(data.or.k[0].ti) {
-                var i, len = data.or.k.length;
-                for(i=0;i<len;i+=1) {
-                    data.or.k[i].to = data.or.k[i].ti = null;
-                }
-            }
-            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
-            //sh Indicates it needs to be capped between -180 and 180
-            this.or.sh = true;
-        } else {
-            this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
-        }
-        if(data.sk){
-            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
-            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
-        }
-        this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},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.
-        if(data.o){
-            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
-        } else {
-            this.o = {_mdf:false,v:1};
-        }
-        this._isDirty = true;
-        if(!this.dynamicProperties.length){
-            this.getValue(true);
-        }
-    }
-
-    TransformProperty.prototype = {
-        applyToMatrix: applyToMatrix,
-        getValue: processKeys,
-        precalculateMatrix: precalculateMatrix,
-        autoOrient: autoOrient
-    }
-
-    extendPrototype([DynamicPropertyContainer], TransformProperty);
-    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
-    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
-
-    function getTransformProperty(elem,data,container){
-        return new TransformProperty(elem,data,container);
-    }
-
-    return {
-        getTransformProperty: getTransformProperty
-    };
-
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = createSizedArray(this._maxLength);
-	this.o = createSizedArray(this._maxLength);
-	this.i = createSizedArray(this._maxLength);
+  return {
+    style: fStyle,
+    weight: fontData.fWeight || fWeight,
+  };
 }
 
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	this.setLength(len);
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newElement();
-		this.o[i] = point_pool.newElement();
-		this.i[i] = point_pool.newElement();
-		i += 1;
-	}
-};
+/* global createNS, createTag, getFontProperties */
+/* exported FontManager */
 
-ShapePath.prototype.setLength = function(len) {
-	while(this._maxLength < len) {
-		this.doubleArrayLength();
-	}
-	this._length = len;
-};
+var FontManager = (function () {
+  var maxWaitingTime = 5000;
+  var emptyChar = {
+    w: 0,
+    size: 0,
+    shapes: [],
+  };
+  var combinedCharacters = [];
+  // Hindi characters
+  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]);
 
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(createSizedArray(this._maxLength));
-	this.i = this.i.concat(createSizedArray(this._maxLength));
-	this.o = this.o.concat(createSizedArray(this._maxLength));
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newElement();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-
-ShapePath.prototype.reverse = function() {
-	var newPath = new ShapePath();
-	newPath.setPathData(this.c, this._length);
-	var vertices = this.v, outPoints = this.o, inPoints = this.i;
-	var init = 0;
-	if (this.c) {
-		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
-        init = 1;
-    }
-    var cnt = this._length - 1;
-    var len = this._length;
-
+  function trimFontOptions(font) {
+    var familyArray = font.split(',');
     var i;
-    for (i = init; i < len; i += 1) {
-    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
-        cnt -= 1;
+    var len = familyArray.length;
+    var enabledFamilies = [];
+    for (i = 0; i < len; i += 1) {
+      if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
+        enabledFamilies.push(familyArray[i]);
+      }
     }
-    return newPath;
+    return enabledFamilies.join(',');
+  }
+
+  function setUpNode(font, family) {
+    var parentNode = createTag('span');
+    parentNode.style.fontFamily = family;
+    var node = createTag('span');
+    // Characters that vary significantly among different fonts
+    node.innerText = 'giItT1WQy@!-/#';
+    // Visible - so we can measure it - but not on the screen
+    parentNode.style.position = 'absolute';
+    parentNode.style.left = '-10000px';
+    parentNode.style.top = '-10000px';
+    // Large font size makes even subtle changes obvious
+    parentNode.style.fontSize = '300px';
+    // Reset any font properties
+    parentNode.style.fontVariant = 'normal';
+    parentNode.style.fontStyle = 'normal';
+    parentNode.style.fontWeight = 'normal';
+    parentNode.style.letterSpacing = '0';
+    parentNode.appendChild(node);
+    document.body.appendChild(parentNode);
+
+    // Remember width with no applied web font
+    var width = node.offsetWidth;
+    node.style.fontFamily = trimFontOptions(font) + ', ' + family;
+    return { node: node, w: width, parent: parentNode };
+  }
+
+  function checkLoadedFonts() {
+    var i;
+    var len = this.fonts.length;
+    var node;
+    var w;
+    var loadedCount = len;
+    for (i = 0; i < len; i += 1) {
+      if (this.fonts[i].loaded) {
+        loadedCount -= 1;
+      } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
+        this.fonts[i].loaded = true;
+      } else {
+        node = this.fonts[i].monoCase.node;
+        w = this.fonts[i].monoCase.w;
+        if (node.offsetWidth !== w) {
+          loadedCount -= 1;
+          this.fonts[i].loaded = true;
+        } else {
+          node = this.fonts[i].sansCase.node;
+          w = this.fonts[i].sansCase.w;
+          if (node.offsetWidth !== w) {
+            loadedCount -= 1;
+            this.fonts[i].loaded = true;
+          }
+        }
+        if (this.fonts[i].loaded) {
+          this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
+          this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
+        }
+      }
+    }
+
+    if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
+      setTimeout(this.checkLoadedFontsBinded, 20);
+    } else {
+      setTimeout(this.setIsLoadedBinded, 10);
+    }
+  }
+
+  function createHelper(def, fontData) {
+    var tHelper = createNS('text');
+    tHelper.style.fontSize = '100px';
+    // tHelper.style.fontFamily = fontData.fFamily;
+
+    var fontProps = getFontProperties(fontData);
+    tHelper.setAttribute('font-family', fontData.fFamily);
+    tHelper.setAttribute('font-style', fontProps.style);
+    tHelper.setAttribute('font-weight', fontProps.weight);
+    tHelper.textContent = '1';
+    if (fontData.fClass) {
+      tHelper.style.fontFamily = 'inherit';
+      tHelper.setAttribute('class', fontData.fClass);
+    } else {
+      tHelper.style.fontFamily = fontData.fFamily;
+    }
+    def.appendChild(tHelper);
+    var tCanvasHelper = createTag('canvas').getContext('2d');
+    tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px ' + fontData.fFamily;
+    // tCanvasHelper.font = ' 100px '+ fontData.fFamily;
+    return tHelper;
+  }
+
+  function addFonts(fontData, defs) {
+    if (!fontData) {
+      this.isLoaded = true;
+      return;
+    }
+    if (this.chars) {
+      this.isLoaded = true;
+      this.fonts = fontData.list;
+      return;
+    }
+
+    var fontArr = fontData.list;
+    var i;
+    var len = fontArr.length;
+    var _pendingFonts = len;
+    for (i = 0; i < len; i += 1) {
+      var shouldLoadFont = true;
+      var loadedSelector;
+      var j;
+      fontArr[i].loaded = false;
+      fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
+      fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
+      if (!fontArr[i].fPath) {
+        fontArr[i].loaded = true;
+        _pendingFonts -= 1;
+      } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
+        loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
+
+        if (loadedSelector.length > 0) {
+          shouldLoadFont = false;
+        }
+
+        if (shouldLoadFont) {
+          var s = createTag('style');
+          s.setAttribute('f-forigin', fontArr[i].fOrigin);
+          s.setAttribute('f-origin', fontArr[i].origin);
+          s.setAttribute('f-family', fontArr[i].fFamily);
+          s.type = 'text/css';
+          s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
+          defs.appendChild(s);
+        }
+      } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
+        loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var l = createTag('link');
+          l.setAttribute('f-forigin', fontArr[i].fOrigin);
+          l.setAttribute('f-origin', fontArr[i].origin);
+          l.type = 'text/css';
+          l.rel = 'stylesheet';
+          l.href = fontArr[i].fPath;
+          document.body.appendChild(l);
+        }
+      } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
+        loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (fontArr[i].fPath === loadedSelector[j].src) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var sc = createTag('link');
+          sc.setAttribute('f-forigin', fontArr[i].fOrigin);
+          sc.setAttribute('f-origin', fontArr[i].origin);
+          sc.setAttribute('rel', 'stylesheet');
+          sc.setAttribute('href', fontArr[i].fPath);
+          defs.appendChild(sc);
+        }
+      }
+      fontArr[i].helper = createHelper(defs, fontArr[i]);
+      fontArr[i].cache = {};
+      this.fonts.push(fontArr[i]);
+    }
+    if (_pendingFonts === 0) {
+      this.isLoaded = true;
+    } else {
+      // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
+      // Adding this timeout seems to fix it
+      setTimeout(this.checkLoadedFonts.bind(this), 100);
+    }
+  }
+
+  function addChars(chars) {
+    if (!chars) {
+      return;
+    }
+    if (!this.chars) {
+      this.chars = [];
+    }
+    var i;
+    var len = chars.length;
+    var j;
+    var jLen = this.chars.length;
+    var found;
+    for (i = 0; i < len; i += 1) {
+      j = 0;
+      found = false;
+      while (j < jLen) {
+        if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
+          found = true;
+        }
+        j += 1;
+      }
+      if (!found) {
+        this.chars.push(chars[i]);
+        jLen += 1;
+      }
+    }
+  }
+
+  function getCharData(char, style, font) {
+    var i = 0;
+    var len = this.chars.length;
+    while (i < len) {
+      if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) {
+        return this.chars[i];
+      }
+      i += 1;
+    }
+    if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char)
+            && console
+            && console.warn // eslint-disable-line no-console
+            && !this._warned
+    ) {
+      this._warned = true;
+      console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console
+    }
+    return emptyChar;
+  }
+
+  function measureText(char, fontName, size) {
+    var fontData = this.getFontByName(fontName);
+    var index = char.charCodeAt(0);
+    if (!fontData.cache[index + 1]) {
+      var tHelper = fontData.helper;
+      // Canvas version
+      // fontData.cache[index] = tHelper.measureText(char).width / 100;
+      // SVG version
+      // console.log(tHelper.getBBox().width)
+      if (char === ' ') {
+        tHelper.textContent = '|' + char + '|';
+        var doubleSize = tHelper.getComputedTextLength();
+        tHelper.textContent = '||';
+        var singleSize = tHelper.getComputedTextLength();
+        fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
+      } else {
+        tHelper.textContent = char;
+        fontData.cache[index + 1] = (tHelper.getComputedTextLength()) / 100;
+      }
+    }
+    return fontData.cache[index + 1] * size;
+  }
+
+  function getFontByName(name) {
+    var i = 0;
+    var len = this.fonts.length;
+    while (i < len) {
+      if (this.fonts[i].fName === name) {
+        return this.fonts[i];
+      }
+      i += 1;
+    }
+    return this.fonts[0];
+  }
+
+  function getCombinedCharacterCodes() {
+    return combinedCharacters;
+  }
+
+  function setIsLoaded() {
+    this.isLoaded = true;
+  }
+
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this._warned = false;
+    this.initTime = Date.now();
+    this.setIsLoadedBinded = this.setIsLoaded.bind(this);
+    this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
+  };
+    // TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
+  Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
+  var fontPrototype = {
+    addChars: addChars,
+    addFonts: addFonts,
+    getCharData: getCharData,
+    getFontByName: getFontByName,
+    measureText: measureText,
+    checkLoadedFonts: checkLoadedFonts,
+    setIsLoaded: setIsLoaded,
+  };
+
+  Font.prototype = fontPrototype;
+
+  return Font;
+}());
+
+/* global initialDefaultFrame, BezierFactory, degToRads, bez, createTypedArray */
+/* exported PropertyFactory */
+
+var PropertyFactory = (function () {
+  var initFrame = initialDefaultFrame;
+  var mathAbs = Math.abs;
+
+  function interpolateValue(frameNum, caching) {
+    var offsetTime = this.offsetTime;
+    var newValue;
+    if (this.propType === 'multidimensional') {
+      newValue = createTypedArray('float32', this.pv.length);
+    }
+    var iterationIndex = caching.lastIndex;
+    var i = iterationIndex;
+    var len = this.keyframes.length - 1;
+    var flag = true;
+    var keyData;
+    var nextKeyData;
+
+    while (flag) {
+      keyData = this.keyframes[i];
+      nextKeyData = this.keyframes[i + 1];
+      if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
+        if (keyData.h) {
+          keyData = nextKeyData;
+        }
+        iterationIndex = 0;
+        break;
+      }
+      if ((nextKeyData.t - offsetTime) > frameNum) {
+        iterationIndex = i;
+        break;
+      }
+      if (i < len - 1) {
+        i += 1;
+      } else {
+        iterationIndex = 0;
+        flag = false;
+      }
+    }
+
+    var k;
+    var kLen;
+    var perc;
+    var jLen;
+    var j;
+    var fnc;
+    var nextKeyTime = nextKeyData.t - offsetTime;
+    var keyTime = keyData.t - offsetTime;
+    var endValue;
+    if (keyData.to) {
+      if (!keyData.bezierData) {
+        keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
+      }
+      var bezierData = keyData.bezierData;
+      if (frameNum >= nextKeyTime || frameNum < keyTime) {
+        var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
+        kLen = bezierData.points[ind].point.length;
+        for (k = 0; k < kLen; k += 1) {
+          newValue[k] = bezierData.points[ind].point[k];
+        }
+        // caching._lastKeyframeIndex = -1;
+      } else {
+        if (keyData.__fnct) {
+          fnc = keyData.__fnct;
+        } else {
+          fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
+          keyData.__fnct = fnc;
+        }
+        perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+        var distanceInLine = bezierData.segmentLength * perc;
+
+        var segmentPerc;
+        var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+        j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
+        flag = true;
+        jLen = bezierData.points.length;
+        while (flag) {
+          addedLength += bezierData.points[j].partialLength;
+          if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k];
+            }
+            break;
+          } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
+            segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
+            }
+            break;
+          }
+          if (j < jLen - 1) {
+            j += 1;
+          } else {
+            flag = false;
+          }
+        }
+        caching._lastPoint = j;
+        caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+        caching._lastKeyframeIndex = i;
+      }
+    } else {
+      var outX;
+      var outY;
+      var inX;
+      var inY;
+      var keyValue;
+      len = keyData.s.length;
+      endValue = nextKeyData.s || keyData.e;
+      if (this.sh && keyData.h !== 1) {
+        if (frameNum >= nextKeyTime) {
+          newValue[0] = endValue[0];
+          newValue[1] = endValue[1];
+          newValue[2] = endValue[2];
+        } else if (frameNum <= keyTime) {
+          newValue[0] = keyData.s[0];
+          newValue[1] = keyData.s[1];
+          newValue[2] = keyData.s[2];
+        } else {
+          var quatStart = createQuaternion(keyData.s);
+          var quatEnd = createQuaternion(endValue);
+          var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
+          quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+        }
+      } else {
+        for (i = 0; i < len; i += 1) {
+          if (keyData.h !== 1) {
+            if (frameNum >= nextKeyTime) {
+              perc = 1;
+            } else if (frameNum < keyTime) {
+              perc = 0;
+            } else {
+              if (keyData.o.x.constructor === Array) {
+                if (!keyData.__fnct) {
+                  keyData.__fnct = [];
+                }
+                if (!keyData.__fnct[i]) {
+                  outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+                  outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+                  inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+                  inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
+                  fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                  keyData.__fnct[i] = fnc;
+                } else {
+                  fnc = keyData.__fnct[i];
+                }
+              } else if (!keyData.__fnct) {
+                outX = keyData.o.x;
+                outY = keyData.o.y;
+                inX = keyData.i.x;
+                inY = keyData.i.y;
+                fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                keyData.__fnct = fnc;
+              } else {
+                fnc = keyData.__fnct;
+              }
+              perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+            }
+          }
+
+          endValue = nextKeyData.s || keyData.e;
+          keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
+
+          if (this.propType === 'multidimensional') {
+            newValue[i] = keyValue;
+          } else {
+            newValue = keyValue;
+          }
+        }
+      }
+    }
+    caching.lastIndex = iterationIndex;
+    return newValue;
+  }
+
+  // based on @Toji's https://github.com/toji/gl-matrix/
+  function slerp(a, b, t) {
+    var out = [];
+    var ax = a[0];
+    var ay = a[1];
+    var az = a[2];
+    var aw = a[3];
+    var bx = b[0];
+    var by = b[1];
+    var bz = b[2];
+    var bw = b[3];
+
+    var omega;
+    var cosom;
+    var sinom;
+    var scale0;
+    var scale1;
+
+    cosom = ax * bx + ay * by + az * bz + aw * bw;
+    if (cosom < 0.0) {
+      cosom = -cosom;
+      bx = -bx;
+      by = -by;
+      bz = -bz;
+      bw = -bw;
+    }
+    if ((1.0 - cosom) > 0.000001) {
+      omega = Math.acos(cosom);
+      sinom = Math.sin(omega);
+      scale0 = Math.sin((1.0 - t) * omega) / sinom;
+      scale1 = Math.sin(t * omega) / sinom;
+    } else {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+    out[0] = scale0 * ax + scale1 * bx;
+    out[1] = scale0 * ay + scale1 * by;
+    out[2] = scale0 * az + scale1 * bz;
+    out[3] = scale0 * aw + scale1 * bw;
+
+    return out;
+  }
+
+  function quaternionToEuler(out, quat) {
+    var qx = quat[0];
+    var qy = quat[1];
+    var qz = quat[2];
+    var qw = quat[3];
+    var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
+    var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
+    var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
+    out[0] = heading / degToRads;
+    out[1] = attitude / degToRads;
+    out[2] = bank / degToRads;
+  }
+
+  function createQuaternion(values) {
+    var heading = values[0] * degToRads;
+    var attitude = values[1] * degToRads;
+    var bank = values[2] * degToRads;
+    var c1 = Math.cos(heading / 2);
+    var c2 = Math.cos(attitude / 2);
+    var c3 = Math.cos(bank / 2);
+    var s1 = Math.sin(heading / 2);
+    var s2 = Math.sin(attitude / 2);
+    var s3 = Math.sin(bank / 2);
+    var w = c1 * c2 * c3 - s1 * s2 * s3;
+    var x = s1 * s2 * c3 + c1 * c2 * s3;
+    var y = s1 * c2 * c3 + c1 * s2 * s3;
+    var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+    return [x, y, z, w];
+  }
+
+  function getValueAtCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) {
+      if (this._caching.lastFrame >= frameNum) {
+        this._caching._lastKeyframeIndex = -1;
+        this._caching.lastIndex = 0;
+      }
+
+      var renderResult = this.interpolateValue(frameNum, this._caching);
+      this.pv = renderResult;
+    }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
+
+  function setVValue(val) {
+    var multipliedValue;
+    if (this.propType === 'unidimensional') {
+      multipliedValue = val * this.mult;
+      if (mathAbs(this.v - multipliedValue) > 0.00001) {
+        this.v = multipliedValue;
+        this._mdf = true;
+      }
+    } else {
+      var i = 0;
+      var len = this.v.length;
+      while (i < len) {
+        multipliedValue = val[i] * this.mult;
+        if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
+          this.v[i] = multipliedValue;
+          this._mdf = true;
+        }
+        i += 1;
+      }
+    }
+  }
+
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+      return;
+    }
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
+    }
+    this.lock = true;
+    this._mdf = this._isFirstFrame;
+    var i;
+    var len = this.effectsSequence.length;
+    var finalValue = this.kf ? this.pv : this.data.k;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this._isFirstFrame = false;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
+
+  function ValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this.v = mult ? data.k * mult : data.k;
+    this.pv = data.k;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.vel = 0;
+    this.effectsSequence = [];
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function MultiDimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.frameId = -1;
+    var i;
+    var len = data.k.length;
+    this.v = createTypedArray('float32', len);
+    this.pv = createTypedArray('float32', len);
+    this.vel = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      this.v[i] = data.k[i] * this.mult;
+      this.pv[i] = data.k[i];
+    }
+    this._isFirstFrame = true;
+    this.effectsSequence = [];
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.frameId = -1;
+    this._caching = {
+      lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1,
+    };
+    this.k = true;
+    this.kf = true;
+    this.data = data;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.v = initFrame;
+    this.pv = initFrame;
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedMultidimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    var i;
+    var len = data.k.length;
+    var s;
+    var e;
+    var to;
+    var ti;
+    for (i = 0; i < len - 1; i += 1) {
+      if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
+        s = data.k[i].s;
+        e = data.k[i + 1].s;
+        to = data.k[i].to;
+        ti = data.k[i].ti;
+        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]))) {
+          data.k[i].to = null;
+          data.k[i].ti = null;
+        }
+        if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+          if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+            data.k[i].to = null;
+            data.k[i].ti = null;
+          }
+        }
+      }
+    }
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.data = data;
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.k = true;
+    this.kf = true;
+    this._isFirstFrame = true;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.frameId = -1;
+    var arrLen = data.k[0].s.length;
+    this.v = createTypedArray('float32', arrLen);
+    this.pv = createTypedArray('float32', arrLen);
+    for (i = 0; i < arrLen; i += 1) {
+      this.v[i] = initFrame;
+      this.pv[i] = initFrame;
+    }
+    this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) };
+    this.addEffect = addEffect;
+  }
+
+  function getProp(elem, data, type, mult, container) {
+    var p;
+    if (!data.k.length) {
+      p = new ValueProperty(elem, data, mult, container);
+    } else if (typeof (data.k[0]) === 'number') {
+      p = new MultiDimensionalProperty(elem, data, mult, container);
+    } else {
+      switch (type) {
+        case 0:
+          p = new KeyframedValueProperty(elem, data, mult, container);
+          break;
+        case 1:
+          p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
+          break;
+        default:
+          break;
+      }
+    }
+    if (p.effectsSequence.length) {
+      container.addDynamicProperty(p);
+    }
+    return p;
+  }
+
+  var ob = {
+    getProp: getProp,
+  };
+  return ob;
+}());
+
+/* global Matrix, degToRads, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+/* exported TransformPropertyFactory */
+
+var TransformPropertyFactory = (function () {
+  var defaultVector = [0, 0];
+
+  function applyToMatrix(mat) {
+    var _mdf = this._mdf;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || _mdf;
+    if (this.a) {
+      mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+    }
+    if (this.s) {
+      mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+    }
+    if (this.sk) {
+      mat.skewFromAxis(-this.sk.v, this.sa.v);
+    }
+    if (this.r) {
+      mat.rotate(-this.r.v);
+    } else {
+      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]);
+    }
+    if (this.data.p.s) {
+      if (this.data.p.z) {
+        mat.translate(this.px.v, this.py.v, -this.pz.v);
+      } else {
+        mat.translate(this.px.v, this.py.v, 0);
+      }
+    } else {
+      mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+    }
+  }
+  function processKeys(forceRender) {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    }
+    if (this._isDirty) {
+      this.precalculateMatrix();
+      this._isDirty = false;
+    }
+
+    this.iterateDynamicProperties();
+
+    if (this._mdf || forceRender) {
+      var frameRate;
+      this.v.cloneFromProps(this.pre.props);
+      if (this.appliedTransformations < 1) {
+        this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      }
+      if (this.appliedTransformations < 2) {
+        this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      }
+      if (this.sk && this.appliedTransformations < 3) {
+        this.v.skewFromAxis(-this.sk.v, this.sa.v);
+      }
+      if (this.r && this.appliedTransformations < 4) {
+        this.v.rotate(-this.r.v);
+      } else if (!this.r && this.appliedTransformations < 4) {
+        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]);
+      }
+      if (this.autoOriented) {
+        var v1;
+        var v2;
+        frameRate = this.elem.globalData.frameRate;
+        if (this.p && this.p.keyframes && this.p.getValueAtTime) {
+          if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
+            v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
+          } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
+            v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
+          } else {
+            v1 = this.p.pv;
+            v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
+          }
+        } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
+          v1 = [];
+          v2 = [];
+          var px = this.px;
+          var py = this.py;
+          if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
+            v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
+            v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0);
+          } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0);
+            v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0);
+            v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
+          } else {
+            v1 = [px.pv, py.pv];
+            v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
+            v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
+          }
+        } else {
+          v2 = defaultVector;
+          v1 = v2;
+        }
+        this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+      }
+      if (this.data.p && this.data.p.s) {
+        if (this.data.p.z) {
+          this.v.translate(this.px.v, this.py.v, -this.pz.v);
+        } else {
+          this.v.translate(this.px.v, this.py.v, 0);
+        }
+      } else {
+        this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+      }
+    }
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function precalculateMatrix() {
+    if (!this.a.k) {
+      this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      this.appliedTransformations = 1;
+    } else {
+      return;
+    }
+    if (!this.s.effectsSequence.length) {
+      this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      this.appliedTransformations = 2;
+    } else {
+      return;
+    }
+    if (this.sk) {
+      if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+        this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+        this.appliedTransformations = 3;
+      } else {
+        return;
+      }
+    }
+    if (this.r) {
+      if (!this.r.effectsSequence.length) {
+        this.pre.rotate(-this.r.v);
+        this.appliedTransformations = 4;
+      }
+    } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+      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]);
+      this.appliedTransformations = 4;
+    }
+  }
+
+  function autoOrient() {
+    //
+    // var prevP = this.getValueAtTime();
+  }
+
+  function addDynamicProperty(prop) {
+    this._addDynamicProperty(prop);
+    this.elem.addDynamicProperty(prop);
+    this._isDirty = true;
+  }
+
+  function TransformProperty(elem, data, container) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.propType = 'transform';
+    this.data = data;
+    this.v = new Matrix();
+    // Precalculated matrix with non animated properties
+    this.pre = new Matrix();
+    this.appliedTransformations = 0;
+    this.initDynamicPropertyContainer(container || elem);
+    if (data.p && data.p.s) {
+      this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
+      this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
+      if (data.p.z) {
+        this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
+      }
+    } else {
+      this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this);
+    }
+    if (data.rx) {
+      this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+      this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+      this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+      if (data.or.k[0].ti) {
+        var i;
+        var len = data.or.k.length;
+        for (i = 0; i < len; i += 1) {
+          data.or.k[i].to = null;
+          data.or.k[i].ti = null;
+        }
+      }
+      this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+      // sh Indicates it needs to be capped between -180 and 180
+      this.or.sh = true;
+    } else {
+      this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this);
+    }
+    if (data.sk) {
+      this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+      this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+    }
+    this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 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.
+    if (data.o) {
+      this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
+    } else {
+      this.o = { _mdf: false, v: 1 };
+    }
+    this._isDirty = true;
+    if (!this.dynamicProperties.length) {
+      this.getValue(true);
+    }
+  }
+
+  TransformProperty.prototype = {
+    applyToMatrix: applyToMatrix,
+    getValue: processKeys,
+    precalculateMatrix: precalculateMatrix,
+    autoOrient: autoOrient,
+  };
+
+  extendPrototype([DynamicPropertyContainer], TransformProperty);
+  TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+  TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+  function getTransformProperty(elem, data, container) {
+    return new TransformProperty(elem, data, container);
+  }
+
+  return {
+    getTransformProperty: getTransformProperty,
+  };
+}());
+
+/* global createSizedArray, createSizedArray, pointPool */
+
+function ShapePath() {
+  this.c = false;
+  this._length = 0;
+  this._maxLength = 8;
+  this.v = createSizedArray(this._maxLength);
+  this.o = createSizedArray(this._maxLength);
+  this.i = createSizedArray(this._maxLength);
+}
+
+ShapePath.prototype.setPathData = function (closed, len) {
+  this.c = closed;
+  this.setLength(len);
+  var i = 0;
+  while (i < len) {
+    this.v[i] = pointPool.newElement();
+    this.o[i] = pointPool.newElement();
+    this.i[i] = pointPool.newElement();
+    i += 1;
+  }
 };
-var ShapePropertyFactory = (function(){
 
-    var initFrame = -999999;
+ShapePath.prototype.setLength = function (len) {
+  while (this._maxLength < len) {
+    this.doubleArrayLength();
+  }
+  this._length = len;
+};
 
-    function interpolateShape(frameNum, previousValue, caching) {
-        var iterationIndex = caching.lastIndex;
-        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
-        var kf = this.keyframes;
-        if(frameNum < kf[0].t-this.offsetTime){
-            keyPropS = kf[0].s[0];
-            isHold = true;
-            iterationIndex = 0;
-        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
-            keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
-            /*if(kf[kf.length - 1].s){
+ShapePath.prototype.doubleArrayLength = function () {
+  this.v = this.v.concat(createSizedArray(this._maxLength));
+  this.i = this.i.concat(createSizedArray(this._maxLength));
+  this.o = this.o.concat(createSizedArray(this._maxLength));
+  this._maxLength *= 2;
+};
+
+ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
+  var arr;
+  this._length = Math.max(this._length, pos + 1);
+  if (this._length >= this._maxLength) {
+    this.doubleArrayLength();
+  }
+  switch (type) {
+    case 'v':
+      arr = this.v;
+      break;
+    case 'i':
+      arr = this.i;
+      break;
+    case 'o':
+      arr = this.o;
+      break;
+    default:
+      arr = [];
+      break;
+  }
+  if (!arr[pos] || (arr[pos] && !replace)) {
+    arr[pos] = pointPool.newElement();
+  }
+  arr[pos][0] = x;
+  arr[pos][1] = y;
+};
+
+ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
+  this.setXYAt(vX, vY, 'v', pos, replace);
+  this.setXYAt(oX, oY, 'o', pos, replace);
+  this.setXYAt(iX, iY, 'i', pos, replace);
+};
+
+ShapePath.prototype.reverse = function () {
+  var newPath = new ShapePath();
+  newPath.setPathData(this.c, this._length);
+  var vertices = this.v;
+  var outPoints = this.o;
+  var inPoints = this.i;
+  var init = 0;
+  if (this.c) {
+    newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+    init = 1;
+  }
+  var cnt = this._length - 1;
+  var len = this._length;
+
+  var i;
+  for (i = init; i < len; i += 1) {
+    newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+    cnt -= 1;
+  }
+  return newPath;
+};
+
+/* global extendPrototype, roundCorner, BezierFactory, shapePool, degToRads,
+  shapeCollectionPool, PropertyFactory, bmMin, DynamicPropertyContainer */
+/* exported ShapePropertyFactory */
+
+var ShapePropertyFactory = (function () {
+  var initFrame = -999999;
+
+  function interpolateShape(frameNum, previousValue, caching) {
+    var iterationIndex = caching.lastIndex;
+    var keyPropS;
+    var keyPropE;
+    var isHold;
+    var j;
+    var k;
+    var jLen;
+    var kLen;
+    var perc;
+    var vertexValue;
+    var kf = this.keyframes;
+    if (frameNum < kf[0].t - this.offsetTime) {
+      keyPropS = kf[0].s[0];
+      isHold = true;
+      iterationIndex = 0;
+    } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
+      keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
+      /* if(kf[kf.length - 1].s){
                 keyPropS = kf[kf.length - 1].s[0];
             }else{
                 keyPropS = kf[kf.length - 2].e[0];
-            }*/
-            isHold = true;
-        }else{
-            var i = iterationIndex;
-            var len = kf.length- 1,flag = true,keyData,nextKeyData;
-            while(flag){
-                keyData = kf[i];
-                nextKeyData = kf[i+1];
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-            isHold = keyData.h === 1;
-            iterationIndex = i;
-            if(!isHold){
-                if(frameNum >= nextKeyData.t-this.offsetTime){
-                    perc = 1;
-                }else if(frameNum < keyData.t-this.offsetTime){
-                    perc = 0;
-                }else{
-                    var fnc;
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                }
-                keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
-            }
-            keyPropS = keyData.s[0];
+            } */
+      isHold = true;
+    } else {
+      var i = iterationIndex;
+      var len = kf.length - 1;
+      var flag = true;
+      var keyData;
+      var nextKeyData;
+      while (flag) {
+        keyData = kf[i];
+        nextKeyData = kf[i + 1];
+        if ((nextKeyData.t - this.offsetTime) > frameNum) {
+          break;
         }
-        jLen = previousValue._length;
-        kLen = keyPropS.i[0].length;
-        caching.lastIndex = iterationIndex;
-
-        for(j=0;j<jLen;j+=1){
-            for(k=0;k<kLen;k+=1){
-                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                previousValue.i[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                previousValue.o[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                previousValue.v[j][k] = vertexValue;
-            }
+        if (i < len - 1) {
+          i += 1;
+        } else {
+          flag = false;
         }
+      }
+      isHold = keyData.h === 1;
+      iterationIndex = i;
+      if (!isHold) {
+        if (frameNum >= nextKeyData.t - this.offsetTime) {
+          perc = 1;
+        } else if (frameNum < keyData.t - this.offsetTime) {
+          perc = 0;
+        } else {
+          var fnc;
+          if (keyData.__fnct) {
+            fnc = keyData.__fnct;
+          } else {
+            fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
+            keyData.__fnct = fnc;
+          }
+          perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime)));
+        }
+        keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
+      }
+      keyPropS = keyData.s[0];
     }
+    jLen = previousValue._length;
+    kLen = keyPropS.i[0].length;
+    caching.lastIndex = iterationIndex;
 
-    function interpolateShapeCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
-        var lastFrame = this._caching.lastFrame;
-        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
-            ////
-            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
-            this.interpolateShape(frameNum, this.pv, this._caching);
-            ////
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
+    for (j = 0; j < jLen; j += 1) {
+      for (k = 0; k < kLen; k += 1) {
+        vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
+        previousValue.i[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
+        previousValue.o[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
+        previousValue.v[j][k] = vertexValue;
+      }
     }
+  }
 
-    function resetShape(){
-        this.paths = this.localShapeCollection;
+  function interpolateShapeCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    var lastFrame = this._caching.lastFrame;
+    if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) {
+      /// /
+      this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+      this.interpolateShape(frameNum, this.pv, this._caching);
+      /// /
     }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            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] 
+  function resetShape() {
+    this.paths = this.localShapeCollection;
+  }
+
+  function shapesEqual(shape1, shape2) {
+    if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
+      return false;
+    }
+    var i;
+    var len = shape1._length;
+    for (i = 0; i < len; i += 1) {
+      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]) {
-                return false;
-            }
-        }
-        return true;
+        return false;
+      }
     }
+    return true;
+  }
 
-    function setVValue(newPath) {
-        if(!shapesEqual(this.v, newPath)) {
-            this.v = shape_pool.clone(newPath);
-            this.localShapeCollection.releaseShapes();
-            this.localShapeCollection.addShape(this.v);
-            this._mdf = true;
-            this.paths = this.localShapeCollection;
-        }
+  function setVValue(newPath) {
+    if (!shapesEqual(this.v, newPath)) {
+      this.v = shapePool.clone(newPath);
+      this.localShapeCollection.releaseShapes();
+      this.localShapeCollection.addShape(this.v);
+      this._mdf = true;
+      this.paths = this.localShapeCollection;
     }
+  }
 
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        } else if (!this.effectsSequence.length) {
-            this._mdf = false;
-            return;
-        }
-        if (this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = false;
-        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
-        var i, len = this.effectsSequence.length;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    };
-
-    function ShapeProperty(elem, data, type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.container = elem;
-        this.elem = elem;
-        this.data = data;
-        this.k = false;
-        this.kf = false;
-        this._mdf = false;
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v = shape_pool.clone(pathData);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-        this.effectsSequence = [];
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    } if (!this.effectsSequence.length) {
+      this._mdf = false;
+      return;
     }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
     }
-
-    ShapeProperty.prototype.interpolateShape = interpolateShape;
-    ShapeProperty.prototype.getValue = processEffectsSequence;
-    ShapeProperty.prototype.setVValue = setVValue;
-    ShapeProperty.prototype.addEffect = addEffect;
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.container = elem;
-        this.offsetTime = elem.data.st;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newElement();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-        this._caching = {lastFrame: initFrame, lastIndex: 0};
-        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+    this.lock = true;
+    this._mdf = false;
+    var finalValue;
+    if (this.kf) {
+      finalValue = this.pv;
+    } else if (this.data.ks) {
+      finalValue = this.data.ks.k;
+    } else {
+      finalValue = this.data.pt.k;
     }
-    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
-    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
-    KeyframedShapeProperty.prototype.setVValue = setVValue;
-    KeyframedShapeProperty.prototype.addEffect = addEffect;
+    var i;
+    var len = this.effectsSequence.length;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
 
-    var EllShapeProperty = (function(){
+  function ShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.container = elem;
+    this.elem = elem;
+    this.data = data;
+    this.k = false;
+    this.kf = false;
+    this._mdf = false;
+    var pathData = type === 3 ? data.pt.k : data.ks.k;
+    this.v = shapePool.clone(pathData);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.reset = resetShape;
+    this.effectsSequence = [];
+  }
 
-        var cPoint = roundCorner;
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
 
-        function EllShapeProperty(elem,data) {
-            /*this.v = {
+  ShapeProperty.prototype.interpolateShape = interpolateShape;
+  ShapeProperty.prototype.getValue = processEffectsSequence;
+  ShapeProperty.prototype.setVValue = setVValue;
+  ShapeProperty.prototype.addEffect = addEffect;
+
+  function KeyframedShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.elem = elem;
+    this.container = elem;
+    this.offsetTime = elem.data.st;
+    this.keyframes = type === 3 ? data.pt.k : data.ks.k;
+    this.k = true;
+    this.kf = true;
+    var len = this.keyframes[0].s[0].i.length;
+    this.v = shapePool.newElement();
+    this.v.setPathData(this.keyframes[0].s[0].c, len);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.lastFrame = initFrame;
+    this.reset = resetShape;
+    this._caching = { lastFrame: initFrame, lastIndex: 0 };
+    this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+  }
+  KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+  KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+  KeyframedShapeProperty.prototype.setVValue = setVValue;
+  KeyframedShapeProperty.prototype.addEffect = addEffect;
+
+  var EllShapeProperty = (function () {
+    var cPoint = roundCorner;
+
+    function EllShapePropertyFactory(elem, data) {
+      /* this.v = {
                 v: createSizedArray(4),
                 i: createSizedArray(4),
                 o: createSizedArray(4),
                 c: true
-            };*/
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertEllToPath();
-            }
-        };
+            }; */
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 4);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.paths = this.localShapeCollection;
+      this.localShapeCollection.addShape(this.v);
+      this.d = data.d;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertEllToPath();
+      }
+    }
 
-        EllShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function (){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-
-                if(this._mdf){
-                    this.convertEllToPath();
-                }
-            },
-            convertEllToPath: function() {
-                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-                var _cw = this.d !== 3;
-                var _v = this.v;
-                _v.v[0][0] = p0;
-                _v.v[0][1] = p1 - s1;
-                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.v[1][1] = p1;
-                _v.v[2][0] = p0;
-                _v.v[2][1] = p1 + s1;
-                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.v[3][1] = p1;
-                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.i[0][1] = p1 - s1;
-                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.i[1][1] = p1 - s1 * cPoint;
-                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.i[2][1] = p1 + s1;
-                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.i[3][1] = p1 + s1 * cPoint;
-                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.o[0][1] = p1 - s1;
-                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.o[1][1] = p1 + s1 * cPoint;
-                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.o[2][1] = p1 + s1;
-                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.o[3][1] = p1 - s1 * cPoint;
-            }
+    EllShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
         }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
 
-        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+        if (this._mdf) {
+          this.convertEllToPath();
+        }
+      },
+      convertEllToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var s0 = this.s.v[0] / 2;
+        var s1 = this.s.v[1] / 2;
+        var _cw = this.d !== 3;
+        var _v = this.v;
+        _v.v[0][0] = p0;
+        _v.v[0][1] = p1 - s1;
+        _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.v[1][1] = p1;
+        _v.v[2][0] = p0;
+        _v.v[2][1] = p1 + s1;
+        _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.v[3][1] = p1;
+        _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.i[0][1] = p1 - s1;
+        _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.i[1][1] = p1 - s1 * cPoint;
+        _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.i[2][1] = p1 + s1;
+        _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.i[3][1] = p1 + s1 * cPoint;
+        _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.o[0][1] = p1 - s1;
+        _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.o[1][1] = p1 + s1 * cPoint;
+        _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.o[2][1] = p1 + s1;
+        _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.o[3][1] = p1 - s1 * cPoint;
+      },
+    };
 
-        return EllShapeProperty;
-    }());
+    extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
 
-    var StarShapeProperty = (function() {
+    return EllShapePropertyFactory;
+  }());
 
-        function StarShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
-                this.convertToPath = this.convertStarToPath;
-            } else {
-                this.convertToPath = this.convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertToPath();
-            }
-        };
+  var StarShapeProperty = (function () {
+    function StarShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 0);
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.data = data;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      if (data.sy === 1) {
+        this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
+        this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
+        this.convertToPath = this.convertStarToPath;
+      } else {
+        this.convertToPath = this.convertPolygonToPath;
+      }
+      this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+      this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
+      this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertToPath();
+      }
+    }
 
-        StarShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function() {
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertToPath();
-                }
-            },
-            convertStarToPath: function() {
-                var numPts = Math.floor(this.pt.v)*2;
-                var angle = Math.PI*2/numPts;
-                /*this.v.v.length = numPts;
+    StarShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertToPath();
+        }
+      },
+      convertStarToPath: function () {
+        var numPts = Math.floor(this.pt.v) * 2;
+        var angle = (Math.PI * 2) / numPts;
+        /* this.v.v.length = numPts;
                 this.v.i.length = numPts;
-                this.v.o.length = numPts;*/
-                var longFlag = true;
-                var longRad = this.or.v;
-                var shortRad = this.ir.v;
-                var longRound = this.os.v;
-                var shortRound = this.is.v;
-                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-                currentAng += this.r.v;
-                var dir = this.data.d === 3 ? -1 : 1;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    rad = longFlag ? longRad : shortRad;
-                    roundness = longFlag ? longRound : shortRound;
-                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
+                this.v.o.length = numPts; */
+        var longFlag = true;
+        var longRad = this.or.v;
+        var shortRad = this.ir.v;
+        var longRound = this.os.v;
+        var shortRound = this.is.v;
+        var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2);
+        var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2);
+        var i;
+        var rad;
+        var roundness;
+        var perimSegment;
+        var currentAng = -Math.PI / 2;
+        currentAng += this.r.v;
+        var dir = this.data.d === 3 ? -1 : 1;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          rad = longFlag ? longRad : shortRad;
+          roundness = longFlag ? longRound : shortRound;
+          perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
 
-                    /*this.v.v[i] = [x,y];
+          /* this.v.v[i] = [x,y];
                     this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
                     this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                    this.v._length = numPts;*/
-                    longFlag = !longFlag;
-                    currentAng += angle*dir;
-                }
-            },
-            convertPolygonToPath: function() {
-                var numPts = Math.floor(this.pt.v);
-                var angle = Math.PI*2/numPts;
-                var rad = this.or.v;
-                var roundness = this.os.v;
-                var perimSegment = 2*Math.PI*rad/(numPts*4);
-                var i, currentAng = -Math.PI/ 2;
-                var dir = this.data.d === 3 ? -1 : 1;
-                currentAng += this.r.v;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
-                    currentAng += angle*dir;
-                }
-                this.paths.length = 0;
-                this.paths[0] = this.v;
-            }
-
+                    this.v._length = numPts; */
+          longFlag = !longFlag;
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
-
-        return StarShapeProperty;
-    }());
-
-    var RectShapeProperty = (function() {
-
-         function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertRectToPath();
-            }
-        };
-
-        RectShapeProperty.prototype = {
-            convertRectToPath: function (){
-                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-                var round = bm_min(v0,v1,this.r.v);
-                var cPoint = round*(1-roundCorner);
-                this.v._length = 0;
-
-                if(this.d === 2 || this.d === 1) {
-                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                    }
-                }else{
-                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                    }
-                }
-            },
-            getValue: function(frameNum){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertRectToPath();
-                }
-
-            },
-            reset: resetShape
+      },
+      convertPolygonToPath: function () {
+        var numPts = Math.floor(this.pt.v);
+        var angle = (Math.PI * 2) / numPts;
+        var rad = this.or.v;
+        var roundness = this.os.v;
+        var perimSegment = (2 * Math.PI * rad) / (numPts * 4);
+        var i;
+        var currentAng = -Math.PI * 0.5;
+        var dir = this.data.d === 3 ? -1 : 1;
+        currentAng += this.r.v;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+        this.paths.length = 0;
+        this.paths[0] = this.v;
+      },
 
-        return RectShapeProperty;
-    }());
+    };
+    extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
 
-    function getShapeProp(elem,data,type){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    }
+    return StarShapePropertyFactory;
+  }());
 
-    function getConstructorFunction() {
-        return ShapeProperty;
-    }
-
-    function getKeyframedConstructorFunction() {
-        return KeyframedShapeProperty;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    ob.getConstructorFunction = getConstructorFunction;
-    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data){
-        return new modifiers[nm](elem, data);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if (!this.closed) {
-        // 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.
-        data.sh.container.addDynamicProperty(data.sh);
-        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
-        this.shapes.push(shapeData);
-        this.addShapeToModifier(shapeData);
-        if (this._isAnimated) {
-            data.setAsAnimated();
-        }
-    }
-};
-ShapeModifier.prototype.init = function(elem,data){
-    this.shapes = [];
-    this.elem = elem;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,data);
-    this.frameId = initialDefaultFrame;
-    this.closed = false;
-    this.k = false;
-    if(this.dynamicProperties.length){
+  var RectShapeProperty = (function () {
+    function RectShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.c = true;
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
+      if (this.dynamicProperties.length) {
         this.k = true;
-    }else{
-        this.getValue(true);
+      } else {
+        this.k = false;
+        this.convertRectToPath();
+      }
     }
+
+    RectShapePropertyFactory.prototype = {
+      convertRectToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var v0 = this.s.v[0] / 2;
+        var v1 = this.s.v[1] / 2;
+        var round = bmMin(v0, v1, this.r.v);
+        var cPoint = round * (1 - roundCorner);
+        this.v._length = 0;
+
+        if (this.d === 2 || this.d === 1) {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
+          this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
+          }
+        } else {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
+          }
+        }
+      },
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertRectToPath();
+        }
+      },
+      reset: resetShape,
+    };
+    extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
+
+    return RectShapePropertyFactory;
+  }());
+
+  function getShapeProp(elem, data, type) {
+    var prop;
+    if (type === 3 || type === 4) {
+      var dataProp = type === 3 ? data.pt : data.ks;
+      var keys = dataProp.k;
+      if (keys.length) {
+        prop = new KeyframedShapeProperty(elem, data, type);
+      } else {
+        prop = new ShapeProperty(elem, data, type);
+      }
+    } else if (type === 5) {
+      prop = new RectShapeProperty(elem, data);
+    } else if (type === 6) {
+      prop = new EllShapeProperty(elem, data);
+    } else if (type === 7) {
+      prop = new StarShapeProperty(elem, data);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  }
+
+  function getConstructorFunction() {
+    return ShapeProperty;
+  }
+
+  function getKeyframedConstructorFunction() {
+    return KeyframedShapeProperty;
+  }
+
+  var ob = {};
+  ob.getShapeProp = getShapeProp;
+  ob.getConstructorFunction = getConstructorFunction;
+  ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
+  return ob;
+}());
+
+/* global shapeCollectionPool, initialDefaultFrame, extendPrototype, DynamicPropertyContainer */
+/* exported ShapeModifiers */
+
+var ShapeModifiers = (function () {
+  var ob = {};
+  var modifiers = {};
+  ob.registerModifier = registerModifier;
+  ob.getModifier = getModifier;
+
+  function registerModifier(nm, factory) {
+    if (!modifiers[nm]) {
+      modifiers[nm] = factory;
+    }
+  }
+
+  function getModifier(nm, elem, data) {
+    return new modifiers[nm](elem, data);
+  }
+
+  return ob;
+}());
+
+function ShapeModifier() {}
+ShapeModifier.prototype.initModifierProperties = function () {};
+ShapeModifier.prototype.addShapeToModifier = function () {};
+ShapeModifier.prototype.addShape = function (data) {
+  if (!this.closed) {
+    // 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.
+    data.sh.container.addDynamicProperty(data.sh);
+    var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() };
+    this.shapes.push(shapeData);
+    this.addShapeToModifier(shapeData);
+    if (this._isAnimated) {
+      data.setAsAnimated();
+    }
+  }
 };
-ShapeModifier.prototype.processKeys = function(){
-    if(this.elem.globalData.frameId === this.frameId){
-        return;
-    }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
+ShapeModifier.prototype.init = function (elem, data) {
+  this.shapes = [];
+  this.elem = elem;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, data);
+  this.frameId = initialDefaultFrame;
+  this.closed = false;
+  this.k = false;
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
+};
+ShapeModifier.prototype.processKeys = function () {
+  if (this.elem.globalData.frameId === this.frameId) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 extendPrototype([DynamicPropertyContainer], ShapeModifier);
-function TrimModifier(){
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, segmentsLengthPool, bez, shapePool, ShapeModifiers */
+
+function TrimModifier() {
 }
 extendPrototype([ShapeModifier], TrimModifier);
-TrimModifier.prototype.initModifierProperties = function(elem, data) {
-    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
-    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
-    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
-    this.sValue = 0;
-    this.eValue = 0;
-    this.getValue = this.processKeys;
-    this.m = data.m;
-    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
+TrimModifier.prototype.initModifierProperties = function (elem, data) {
+  this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
+  this.sValue = 0;
+  this.eValue = 0;
+  this.getValue = this.processKeys;
+  this.m = data.m;
+  this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.addShapeToModifier = function(shapeData){
-    shapeData.pathsData = [];
+TrimModifier.prototype.addShapeToModifier = function (shapeData) {
+  shapeData.pathsData = [];
 };
 
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
+TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
+  var segments = [];
+  if (e <= 1) {
+    segments.push({
+      s: s,
+      e: e,
+    });
+  } else if (s >= 1) {
+    segments.push({
+      s: s - 1,
+      e: e - 1,
+    });
+  } else {
+    segments.push({
+      s: s,
+      e: 1,
+    });
+    segments.push({
+      s: 0,
+      e: e - 1,
+    });
+  }
+  var shapeSegments = [];
+  var i;
+  var len = segments.length;
+  var segmentOb;
+  for (i = 0; i < len; i += 1) {
+    segmentOb = segments[i];
+    if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
+      var shapeS;
+      var shapeE;
+      if (segmentOb.s * totalModifierLength <= addedLength) {
+        shapeS = 0;
+      } else {
+        shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
+      }
+      if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
+        shapeE = 1;
+      } else {
+        shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
+      }
+      shapeSegments.push([shapeS, shapeE]);
+    }
+  }
+  if (!shapeSegments.length) {
+    shapeSegments.push([0, 0]);
+  }
+  return shapeSegments;
+};
+
+TrimModifier.prototype.releasePathsData = function (pathsData) {
+  var i;
+  var len = pathsData.length;
+  for (i = 0; i < len; i += 1) {
+    segmentsLengthPool.release(pathsData[i]);
+  }
+  pathsData.length = 0;
+  return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function (_isFirstFrame) {
+  var s;
+  var e;
+  if (this._mdf || _isFirstFrame) {
+    var o = (this.o.v % 360) / 360;
+    if (o < 0) {
+      o += 1;
+    }
+    if (this.s.v > 1) {
+      s = 1 + o;
+    } else if (this.s.v < 0) {
+      s = 0 + o;
+    } else {
+      s = this.s.v + o;
+    }
+    if (this.e.v > 1) {
+      e = 1 + o;
+    } else if (this.e.v < 0) {
+      e = 0 + o;
+    } else {
+      e = this.e.v + o;
+    }
+
+    if (s > e) {
+      var _s = s;
+      s = e;
+      e = _s;
+    }
+    s = Math.round(s * 10000) * 0.0001;
+    e = Math.round(e * 10000) * 0.0001;
+    this.sValue = s;
+    this.eValue = e;
+  } else {
+    s = this.sValue;
+    e = this.eValue;
+  }
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var pathsData;
+  var pathData;
+  var totalShapeLength;
+  var totalModifierLength = 0;
+
+  if (e === s) {
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].localShapeCollection.releaseShapes();
+      this.shapes[i].shape._mdf = true;
+      this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+      if (this._mdf) {
+        this.shapes[i].pathsData.length = 0;
+      }
+    }
+  } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) {
     var segments = [];
-    if (e <= 1) {
-        segments.push({
-            s: s,
-            e: e
-        });
-    } else if (s >= 1) {
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        });
-    } else {
-        segments.push({
-            s: s,
-            e: 1
-        });
-        segments.push({
-            s: 0,
-            e: e - 1
-        });
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
+    var shapeData;
+    var localShapeCollection;
     for (i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
+      shapeData = this.shapes[i];
+      // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+      if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
+        shapeData.shape.paths = shapeData.localShapeCollection;
+      } else {
+        shapePaths = shapeData.shape.paths;
+        jLen = shapePaths._length;
+        totalShapeLength = 0;
+        if (!shapeData.shape._mdf && shapeData.pathsData.length) {
+          totalShapeLength = shapeData.totalShapeLength;
         } else {
-            var shapeS, shapeE;
-            if (segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
+          pathsData = this.releasePathsData(shapeData.pathsData);
+          for (j = 0; j < jLen; j += 1) {
+            pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
+            pathsData.push(pathData);
+            totalShapeLength += pathData.totalLength;
+          }
+          shapeData.totalShapeLength = totalShapeLength;
+          shapeData.pathsData = pathsData;
         }
+
+        totalModifierLength += totalShapeLength;
+        shapeData.shape._mdf = true;
+      }
     }
-    if (!shapeSegments.length) {
-        shapeSegments.push([0, 0]);
-    }
-    return shapeSegments;
-};
-
-TrimModifier.prototype.releasePathsData = function(pathsData) {
-    var i, len = pathsData.length;
-    for (i = 0; i < len; i += 1) {
-        segments_length_pool.release(pathsData[i]);
-    }
-    pathsData.length = 0;
-    return pathsData;
-};
-
-TrimModifier.prototype.processShapes = function(_isFirstFrame) {
-    var s, e;
-    if (this._mdf || _isFirstFrame) {
-        var o = (this.o.v % 360) / 360;
-        if (o < 0) {
-            o += 1;
-        }
-        s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
-        e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
-        if (s === e) {
-
-        }
-        if (s > e) {
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        s = Math.round(s * 10000) * 0.0001;
-        e = Math.round(e * 10000) * 0.0001;
-        this.sValue = s;
-        this.eValue = e;
-    } else {
-        s = this.sValue;
-        e = this.eValue;
-    }
-    var shapePaths;
-    var i, len = this.shapes.length, j, jLen;
-    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
-
-    if (e === s) {
-        for (i = 0; i < len; i += 1) {
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape._mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-            if (this._mdf) {
-                this.shapes[i].pathsData.length = 0;
-            }
-        }
-    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for (i = 0; i < len; i += 1) {
-            shapeData = this.shapes[i];
-            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
-            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = this.releasePathsData(shapeData.pathsData);
-                    for (j = 0; j < jLen; j += 1) {
-                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape._mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0, edges;
-        for (i = len - 1; i >= 0; i -= 1) {
-            shapeData = this.shapes[i];
-            if (shapeData.shape._mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
-                if (this.m === 2 && len > 1) {
-                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]];
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if (shapeE <= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        });
-                    } else if (shapeS >= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    } else {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        });
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        if (segments.length > 1) {
-                            var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
-                            if (lastShapeInCollection.c) {
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if (this._mdf) {
-        for (i = 0; i < len; i += 1) {
-            //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
-            //Don't remove this even if it's losing cached info.
-            this.shapes[i].pathsData.length = 0;
-            this.shapes[i].shape._mdf = true;
-        }
-    }
-};
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for (i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i]);
-    }
-};
-
-TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
-    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
-    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
-    }
-    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
-    shapePath.setXYAt(points[1], points[5], 'o', pos);
-    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(points[0], points[4], 'v', pos);
-    }
-    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
+    var shapeS = s;
+    var shapeE = e;
     var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if (!shapePath) {
-        shapePath = shape_pool.newElement();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
+    var edges;
+    for (i = len - 1; i >= 0; i -= 1) {
+      shapeData = this.shapes[i];
+      if (shapeData.shape._mdf) {
+        localShapeCollection = shapeData.localShapeCollection;
+        localShapeCollection.releaseShapes();
+        // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+        if (this.m === 2 && len > 1) {
+          edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+          addedLength += shapeData.totalShapeLength;
+        } else {
+          edges = [[shapeS, shapeE]];
+        }
+        jLen = edges.length;
+        for (j = 0; j < jLen; j += 1) {
+          shapeS = edges[j][0];
+          shapeE = edges[j][1];
+          segments.length = 0;
+          if (shapeE <= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength * shapeE,
+            });
+          } else if (shapeS >= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * (shapeS - 1),
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          } else {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength,
+            });
+            segments.push({
+              s: 0,
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          }
+          var newShapesData = this.addShapes(shapeData, segments[0]);
+          if (segments[0].s !== segments[0].e) {
+            if (segments.length > 1) {
+              var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
+              if (lastShapeInCollection.c) {
+                var lastShape = newShapesData.pop();
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
+              } else {
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1]);
+              }
+            }
+            this.addPaths(newShapesData, localShapeCollection);
+          }
+        }
+        shapeData.shape.paths = localShapeCollection;
+      }
     }
-    shapes.push(shapePath);
+  } else if (this._mdf) {
     for (i = 0; i < len; i += 1) {
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for (j = 1; j < jLen; j +=1) {
-            currentLengthData = lengths[j-1];
-            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e) {
-                shapePath.c = false;
-                break;
-            } else {
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if (shapePaths[i].c && lengths.length) {
-            currentLengthData = lengths[j - 1];
-            if (addedLength <= shapeSegment.e) {
-                var segmentLength = lengths[j - 1].addedLength;
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if (shapePath._length) {
-            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
-        }
-        if (addedLength > shapeSegment.e) {
-            break;
-        }
-        if (i < len - 1) {
-            shapePath = shape_pool.newElement();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
+      // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
+      // Don't remove this even if it's losing cached info.
+      this.shapes[i].pathsData.length = 0;
+      this.shapes[i].shape._mdf = true;
     }
-    return shapes;
+  }
 };
 
+TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
+  var i;
+  var len = newPaths.length;
+  for (i = 0; i < len; i += 1) {
+    localShapeCollection.addShape(newPaths[i]);
+  }
+};
+
+TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+  shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+  shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
+  }
+  shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
+  shapePath.setXYAt(points[1], points[5], 'o', pos);
+  shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(points[0], points[4], 'v', pos);
+  }
+  shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
+  var pathsData = shapeData.pathsData;
+  var shapePaths = shapeData.shape.paths.shapes;
+  var i;
+  var len = shapeData.shape.paths._length;
+  var j;
+  var jLen;
+  var addedLength = 0;
+  var currentLengthData;
+  var segmentCount;
+  var lengths;
+  var segment;
+  var shapes = [];
+  var initPos;
+  var newShape = true;
+  if (!shapePath) {
+    shapePath = shapePool.newElement();
+    segmentCount = 0;
+    initPos = 0;
+  } else {
+    segmentCount = shapePath._length;
+    initPos = shapePath._length;
+  }
+  shapes.push(shapePath);
+  for (i = 0; i < len; i += 1) {
+    lengths = pathsData[i].lengths;
+    shapePath.c = shapePaths[i].c;
+    jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
+    for (j = 1; j < jLen; j += 1) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
+        addedLength += currentLengthData.addedLength;
+        shapePath.c = false;
+      } else if (addedLength > shapeSegment.e) {
+        shapePath.c = false;
+        break;
+      } else {
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+        addedLength += currentLengthData.addedLength;
+        segmentCount += 1;
+      }
+    }
+    if (shapePaths[i].c && lengths.length) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength <= shapeSegment.e) {
+        var segmentLength = lengths[j - 1].addedLength;
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+      } else {
+        shapePath.c = false;
+      }
+      addedLength += currentLengthData.addedLength;
+      segmentCount += 1;
+    }
+    if (shapePath._length) {
+      shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+      shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
+    }
+    if (addedLength > shapeSegment.e) {
+      break;
+    }
+    if (i < len - 1) {
+      shapePath = shapePool.newElement();
+      newShape = true;
+      shapes.push(shapePath);
+      segmentCount = 0;
+    }
+  }
+  return shapes;
+};
 
 ShapeModifiers.registerModifier('tm', TrimModifier);
-function RoundCornersModifier(){}
-extendPrototype([ShapeModifier],RoundCornersModifier);
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
-    this._isAnimated = !!this.rd.effectsSequence.length;
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, roundCorner, ShapeModifiers */
+
+function RoundCornersModifier() {}
+extendPrototype([ShapeModifier], RoundCornersModifier);
+RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
+  this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-            }
+RoundCornersModifier.prototype.processPath = function (path, round) {
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var i;
+  var len = path._length;
+  var currentV;
+  var currentI;
+  var currentO;
+  var closerV;
+  var distance;
+  var newPosPerc;
+  var index = 0;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < len; i += 1) {
+    currentV = path.v[i];
+    currentO = path.o[i];
+    currentI = path.i[i];
+    if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
+      if ((i === 0 || i === len - 1) && !path.c) {
+        clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
+        /* clonedPath.v[index] = currentV;
+                clonedPath.o[index] = currentO;
+                clonedPath.i[index] = currentI; */
+        index += 1;
+      } else {
+        if (i === 0) {
+          closerV = path.v[len - 1];
         } else {
-            cloned_path.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);
-            index += 1;
+          closerV = path.v[i - 1];
         }
-    }
-    return cloned_path;
-};
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = iX;
+        iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
+        vY = iY;
+        oX = vX - (vX - currentV[0]) * roundCorner;
+        oY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
 
-RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+        if (i === len - 1) {
+          closerV = path.v[0];
+        } else {
+          closerV = path.v[i + 1];
         }
-
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = oX;
+        oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
+        vY = oY;
+        iX = vX - (vX - currentV[0]) * roundCorner;
+        iY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
+      }
+    } else {
+      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);
+      index += 1;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  return clonedPath;
 };
 
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function PuckerAndBloatModifier(){}
-extendPrototype([ShapeModifier],PuckerAndBloatModifier);
-PuckerAndBloatModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.amount = PropertyFactory.getProp(elem,data.a,0,null,this);
-    this._isAnimated = !!this.amount.effectsSequence.length;
-};
+RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var rd = this.rd.v;
 
-PuckerAndBloatModifier.prototype.processPath = function(path, amount){
-    var percent = amount / 100;
-    var centerPoint = [0, 0];
-    var pathLength = path._length, i = 0;
-    for (i = 0; i < pathLength; i += 1) {
-        centerPoint[0] += path.v[i][0];
-        centerPoint[1] += path.v[i][1];
-    }
-    centerPoint[0] /= pathLength;
-    centerPoint[1] /= pathLength;
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var vX, vY, oX, oY, iX, iY;
-    for(i = 0; i < pathLength; i += 1) {
-        vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
-        vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
-        oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
-        oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
-        iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
-        iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
-        cloned_path.setTripleAt(vX, vY, oX, oY, iX, iY, i);
-    }
-    return cloned_path;
-};
-
-PuckerAndBloatModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var amount = this.amount.v;
-
-    if(amount !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+  if (rd !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
         }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
 };
-ShapeModifiers.registerModifier('pb',PuckerAndBloatModifier);
-function RepeaterModifier(){}
+
+ShapeModifiers.registerModifier('rd', RoundCornersModifier);
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, ShapeModifiers */
+
+function PuckerAndBloatModifier() {}
+extendPrototype([ShapeModifier], PuckerAndBloatModifier);
+PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
+  this._isAnimated = !!this.amount.effectsSequence.length;
+};
+
+PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
+  var percent = amount / 100;
+  var centerPoint = [0, 0];
+  var pathLength = path._length;
+  var i = 0;
+  for (i = 0; i < pathLength; i += 1) {
+    centerPoint[0] += path.v[i][0];
+    centerPoint[1] += path.v[i][1];
+  }
+  centerPoint[0] /= pathLength;
+  centerPoint[1] /= pathLength;
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < pathLength; i += 1) {
+    vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
+    vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
+    oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
+    oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
+    iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
+    iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
+    clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
+  }
+  return clonedPath;
+};
+
+PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var amount = this.amount.v;
+
+  if (amount !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
+        }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
+    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
+};
+ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
+
+/* global extendPrototype, ShapeModifier, TransformPropertyFactory, PropertyFactory, Matrix, ShapeModifiers */
+
+function RepeaterModifier() {}
 extendPrototype([ShapeModifier], RepeaterModifier);
 
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
-    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
-    this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
-    this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
-    this.data = data;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this._isAnimated = !!this.dynamicProperties.length;
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
+RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
+  this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
+  this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
+  this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
+  this.data = data;
+  if (!this.dynamicProperties.length) {
+    this.getValue(true);
+  }
+  this._isAnimated = !!this.dynamicProperties.length;
+  this.pMatrix = new Matrix();
+  this.rMatrix = new Matrix();
+  this.sMatrix = new Matrix();
+  this.tMatrix = new Matrix();
+  this.matrix = new Matrix();
 };
 
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
+  var dir = inv ? -1 : 1;
+  var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
+  var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
+  pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
+  rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  rMatrix.rotate(-transform.r.v * dir * perc);
+  rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+  sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
+  sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
 };
 
-RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
-    this.elem = elem;
-    this.arr = arr;
-    this.pos = pos;
-    this.elemsData = elemsData;
-    this._currentCopies = 0;
-    this._elements = [];
-    this._groups = [];
-    this.frameId = -1;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,arr[pos]);
-    var cont = 0;
-    while(pos>0){
-        pos -= 1;
-        //this._elements.unshift(arr.splice(pos,1)[0]);
-        this._elements.unshift(arr[pos]);
-        cont += 1;
-    }
-    if(this.dynamicProperties.length){
-        this.k = true;
-    }else{
-        this.getValue(true);
-    }
+RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
+  this.elem = elem;
+  this.arr = arr;
+  this.pos = pos;
+  this.elemsData = elemsData;
+  this._currentCopies = 0;
+  this._elements = [];
+  this._groups = [];
+  this.frameId = -1;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, arr[pos]);
+  while (pos > 0) {
+    pos -= 1;
+    // this._elements.unshift(arr.splice(pos,1)[0]);
+    this._elements.unshift(arr[pos]);
+  }
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
 };
 
-RepeaterModifier.prototype.resetElements = function(elements){
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._processed = false;
-        if(elements[i].ty === 'gr'){
-            this.resetElements(elements[i].it);
+RepeaterModifier.prototype.resetElements = function (elements) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._processed = false;
+    if (elements[i].ty === 'gr') {
+      this.resetElements(elements[i].it);
+    }
+  }
+};
+
+RepeaterModifier.prototype.cloneElements = function (elements) {
+  var newElements = JSON.parse(JSON.stringify(elements));
+  this.resetElements(newElements);
+  return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._render = renderFlag;
+    if (elements[i].ty === 'gr') {
+      this.changeGroupRender(elements[i].it, renderFlag);
+    }
+  }
+};
+
+RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
+  var items;
+  var itemsTransform;
+  var i;
+  var dir;
+  var cont;
+  if (this._mdf || _isFirstFrame) {
+    var copies = Math.ceil(this.c.v);
+    if (this._groups.length < copies) {
+      while (this._groups.length < copies) {
+        var group = {
+          it: this.cloneElements(this._elements),
+          ty: 'gr',
+        };
+        group.it.push({
+          a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr',
+        });
+
+        this.arr.splice(0, 0, group);
+        this._groups.splice(0, 0, group);
+        this._currentCopies += 1;
+      }
+      this.elem.reloadShapes();
+    }
+    cont = 0;
+    var renderFlag;
+    for (i = 0; i <= this._groups.length - 1; i += 1) {
+      renderFlag = cont < copies;
+      this._groups[i]._render = renderFlag;
+      this.changeGroupRender(this._groups[i].it, renderFlag);
+      cont += 1;
+    }
+
+    this._currentCopies = copies;
+    /// /
+
+    var offset = this.o.v;
+    var offsetModulo = offset % 1;
+    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+    var pProps = this.pMatrix.props;
+    var rProps = this.rMatrix.props;
+    var sProps = this.sMatrix.props;
+    this.pMatrix.reset();
+    this.rMatrix.reset();
+    this.sMatrix.reset();
+    this.tMatrix.reset();
+    this.matrix.reset();
+    var iteration = 0;
+
+    if (offset > 0) {
+      while (iteration < roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+        iteration += 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+        iteration += offsetModulo;
+      }
+    } else if (offset < 0) {
+      while (iteration > roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+        iteration -= 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
+        iteration -= offsetModulo;
+      }
+    }
+    i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+    dir = this.data.m === 1 ? 1 : -1;
+    cont = this._currentCopies;
+    var j;
+    var jLen;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      jLen = itemsTransform.length;
+      items[items.length - 1].transform.mProps._mdf = true;
+      items[items.length - 1].transform.op._mdf = true;
+      items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
+      if (iteration !== 0) {
+        if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
+          this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
         }
-    }
-};
+        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]);
+        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]);
+        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]);
 
-RepeaterModifier.prototype.cloneElements = function(elements){
-    var i, len = elements.length;
-    var newElements = JSON.parse(JSON.stringify(elements));
-    this.resetElements(newElements);
-    return newElements;
-};
-
-RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._render = renderFlag;
-        if(elements[i].ty === 'gr') {
-            this.changeGroupRender(elements[i].it, renderFlag);
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-    }
-};
-
-RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
-    var items, itemsTransform, i, dir, cont;
-    if(this._mdf || _isFirstFrame){
-        var copies = Math.ceil(this.c.v);
-        if(this._groups.length < copies){
-            while(this._groups.length < copies){
-                var group = {
-                    it:this.cloneElements(this._elements),
-                    ty:'gr'
-                };
-                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
-                
-                this.arr.splice(0,0,group);
-                this._groups.splice(0,0,group);
-                this._currentCopies += 1;
-            }
-            this.elem.reloadShapes();
-        }
-        cont = 0;
-        var renderFlag;
-        for(i = 0; i  <= this._groups.length - 1; i += 1){
-            renderFlag = cont < copies;
-            this._groups[i]._render = renderFlag;
-            this.changeGroupRender(this._groups[i].it, renderFlag);
-            cont += 1;
-        }
-        
-        this._currentCopies = copies;
-        ////
-
-        var offset = this.o.v;
-        var offsetModulo = offset%1;
-        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-        var k;
-        var tMat = this.tr.v.props;
-        var pProps = this.pMatrix.props;
-        var rProps = this.rMatrix.props;
-        var sProps = this.sMatrix.props;
-        this.pMatrix.reset();
-        this.rMatrix.reset();
-        this.sMatrix.reset();
-        this.tMatrix.reset();
         this.matrix.reset();
-        var iteration = 0;
-
-        if(offset > 0) {
-            while(iteration<roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                iteration += 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                iteration += offsetModulo;
-            }
-        } else if(offset < 0) {
-            while(iteration>roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                iteration -= 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                iteration -= offsetModulo;
-            }
+      } else {
+        this.matrix.reset();
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
-        dir = this.data.m === 1 ? 1 : -1;
-        cont = this._currentCopies;
-        var j, jLen;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            jLen = itemsTransform.length;
-            items[items.length - 1].transform.mProps._mdf = true;
-            items[items.length - 1].transform.op._mdf = true;
-            items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
-            if(iteration !== 0){
-                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                }
-                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]);
-                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]);
-                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]);
-                
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-                this.matrix.reset();
-            } else {
-                this.matrix.reset();
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-            }
-            iteration += 1;
-            cont -= 1;
-            i += dir;
-        }
-    } else {
-        cont = this._currentCopies;
-        i = 0;
-        dir = 1;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            items[items.length - 1].transform.mProps._mdf = false;
-            items[items.length - 1].transform.op._mdf = false;
-            cont -= 1;
-            i += dir;
-        }
+      }
+      iteration += 1;
+      cont -= 1;
+      i += dir;
     }
+  } else {
+    cont = this._currentCopies;
+    i = 0;
+    dir = 1;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      items[items.length - 1].transform.mProps._mdf = false;
+      items[items.length - 1].transform.op._mdf = false;
+      cont -= 1;
+      i += dir;
+    }
+  }
 };
 
-RepeaterModifier.prototype.addShape = function(){};
+RepeaterModifier.prototype.addShape = function () {};
 
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = createSizedArray(this._maxLength);
+ShapeModifiers.registerModifier('rp', RepeaterModifier);
+
+/* global createSizedArray, shapePool */
+
+function ShapeCollection() {
+  this._length = 0;
+  this._maxLength = 4;
+  this.shapes = createSizedArray(this._maxLength);
 }
 
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
+ShapeCollection.prototype.addShape = function (shapeData) {
+  if (this._length === this._maxLength) {
+    this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
+    this._maxLength *= 2;
+  }
+  this.shapes[this._length] = shapeData;
+  this._length += 1;
 };
 
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
+ShapeCollection.prototype.releaseShapes = function () {
+  var i;
+  for (i = 0; i < this._length; i += 1) {
+    shapePool.release(this.shapes[i]);
+  }
+  this._length = 0;
 };
+
+/* global createSizedArray, createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
 function DashProperty(elem, data, renderer, container) {
-    this.elem = elem;
-    this.frameId = -1;
-    this.dataProps = createSizedArray(data.length);
-    this.renderer = renderer;
-    this.k = false;
-    this.dashStr = '';
-    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
-    this.dashoffset = createTypedArray('float32',  1);
-    this.initDynamicPropertyContainer(container);
-    var i, len = data.length || 0, prop;
-    for(i = 0; i < len; i += 1) {
-        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
-        this.k = prop.k || this.k;
-        this.dataProps[i] = {n:data[i].n,p:prop};
-    }
-    if(!this.k){
-        this.getValue(true);
-    }
-    this._isAnimated = this.k;
+  this.elem = elem;
+  this.frameId = -1;
+  this.dataProps = createSizedArray(data.length);
+  this.renderer = renderer;
+  this.k = false;
+  this.dashStr = '';
+  this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
+  this.dashoffset = createTypedArray('float32', 1);
+  this.initDynamicPropertyContainer(container);
+  var i;
+  var len = data.length || 0;
+  var prop;
+  for (i = 0; i < len; i += 1) {
+    prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
+    this.k = prop.k || this.k;
+    this.dataProps[i] = { n: data[i].n, p: prop };
+  }
+  if (!this.k) {
+    this.getValue(true);
+  }
+  this._isAnimated = this.k;
 }
 
-DashProperty.prototype.getValue = function(forceRender) {
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
+DashProperty.prototype.getValue = function (forceRender) {
+  if (this.elem.globalData.frameId === this.frameId && !forceRender) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
+  this._mdf = this._mdf || forceRender;
+  if (this._mdf) {
+    var i = 0;
+    var len = this.dataProps.length;
+    if (this.renderer === 'svg') {
+      this.dashStr = '';
     }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
-    this._mdf = this._mdf || forceRender;
-    if (this._mdf) {
-        var i = 0, len = this.dataProps.length;
-        if(this.renderer === 'svg') {
-            this.dashStr = '';
+    for (i = 0; i < len; i += 1) {
+      if (this.dataProps[i].n !== 'o') {
+        if (this.renderer === 'svg') {
+          this.dashStr += ' ' + this.dataProps[i].p.v;
+        } else {
+          this.dashArray[i] = this.dataProps[i].p.v;
         }
-        for(i=0;i<len;i+=1){
-            if(this.dataProps[i].n != 'o'){
-                if(this.renderer === 'svg') {
-                    this.dashStr += ' ' + this.dataProps[i].p.v;
-                }else{
-                    this.dashArray[i] = this.dataProps[i].p.v;
-                }
-            }else{
-                this.dashoffset[0] = this.dataProps[i].p.v;
-            }
-        }
+      } else {
+        this.dashoffset[0] = this.dataProps[i].p.v;
+      }
     }
+  }
 };
 extendPrototype([DynamicPropertyContainer], DashProperty);
-function GradientProperty(elem,data,container){
-    this.data = data;
-    this.c = createTypedArray('uint8c', data.p*4);
-    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-    this.o = createTypedArray('float32', cLength);
-    this._cmdf = false;
-    this._omdf = false;
-    this._collapsable = this.checkCollapsable();
-    this._hasOpacity = cLength;
-    this.initDynamicPropertyContainer(container);
-    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
-    this.k = this.prop.k;
-    this.getValue(true);
+
+/* global createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+function GradientProperty(elem, data, container) {
+  this.data = data;
+  this.c = createTypedArray('uint8c', data.p * 4);
+  var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;
+  this.o = createTypedArray('float32', cLength);
+  this._cmdf = false;
+  this._omdf = false;
+  this._collapsable = this.checkCollapsable();
+  this._hasOpacity = cLength;
+  this.initDynamicPropertyContainer(container);
+  this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
+  this.k = this.prop.k;
+  this.getValue(true);
 }
 
-GradientProperty.prototype.comparePoints = function(values, points) {
-    var i = 0, len = this.o.length/2, diff;
-    while(i < len) {
-        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
-        if(diff > 0.01){
-            return false;
-        }
-        i += 1;
+GradientProperty.prototype.comparePoints = function (values, points) {
+  var i = 0;
+  var len = this.o.length / 2;
+  var diff;
+  while (i < len) {
+    diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
+    if (diff > 0.01) {
+      return false;
     }
-    return true;
+    i += 1;
+  }
+  return true;
 };
 
-GradientProperty.prototype.checkCollapsable = function() {
-    if (this.o.length/2 !== this.c.length/4) {
+GradientProperty.prototype.checkCollapsable = function () {
+  if (this.o.length / 2 !== this.c.length / 4) {
+    return false;
+  }
+  if (this.data.k.k[0].s) {
+    var i = 0;
+    var len = this.data.k.k.length;
+    while (i < len) {
+      if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
         return false;
+      }
+      i += 1;
     }
-    if (this.data.k.k[0].s) {
-        var i = 0, len = this.data.k.k.length;
-        while (i < len) {
-            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
-                return false;
-            }
-            i += 1;
-        }
-    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
-        return false;
-    }
-    return true;
+  } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
+    return false;
+  }
+  return true;
 };
 
-GradientProperty.prototype.getValue = function(forceRender){
-    this.prop.getValue();
-    this._mdf = false;
-    this._cmdf = false;
-    this._omdf = false;
-    if(this.prop._mdf || forceRender){
-        var i, len = this.data.p*4;
-        var mult, val;
-        for(i=0;i<len;i+=1){
-            mult = i%4 === 0 ? 100 : 255;
-            val = Math.round(this.prop.v[i]*mult);
-            if(this.c[i] !== val){
-                this.c[i] = val;
-                this._cmdf = !forceRender;
-            }
-        }
-        if(this.o.length){
-            len = this.prop.v.length;
-            for(i=this.data.p*4;i<len;i+=1){
-                mult = i%2 === 0 ? 100 : 1;
-                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                if(this.o[i-this.data.p*4] !== val){
-                    this.o[i-this.data.p*4] = val;
-                    this._omdf = !forceRender;
-                }
-            }
-        }
-        this._mdf = !forceRender;
+GradientProperty.prototype.getValue = function (forceRender) {
+  this.prop.getValue();
+  this._mdf = false;
+  this._cmdf = false;
+  this._omdf = false;
+  if (this.prop._mdf || forceRender) {
+    var i;
+    var len = this.data.p * 4;
+    var mult;
+    var val;
+    for (i = 0; i < len; i += 1) {
+      mult = i % 4 === 0 ? 100 : 255;
+      val = Math.round(this.prop.v[i] * mult);
+      if (this.c[i] !== val) {
+        this.c[i] = val;
+        this._cmdf = !forceRender;
+      }
     }
+    if (this.o.length) {
+      len = this.prop.v.length;
+      for (i = this.data.p * 4; i < len; i += 1) {
+        mult = i % 2 === 0 ? 100 : 1;
+        val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
+        if (this.o[i - this.data.p * 4] !== val) {
+          this.o[i - this.data.p * 4] = val;
+          this._omdf = !forceRender;
+        }
+      }
+    }
+    this._mdf = !forceRender;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], GradientProperty);
-var buildShapeString = function(pathNodes, length, closed, mat) {
-	if(length === 0) {
-            return '';
-        }
-        var _o = pathNodes.o;
-        var _i = pathNodes.i;
-        var _v = pathNodes.v;
-        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
-        for(i = 1; i < length; i += 1) {
-            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]);
-        }
-        if (closed && length) {
-            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]);
-            shapeString += 'z';
-        }
-        return shapeString;
-}
-var audioControllerFactory = (function() {
 
-	function AudioController(audioFactory) {
-		this.audios = [];
-		this.audioFactory = audioFactory;
-		this._volume = 1;
-		this._isMuted = false;
-	}
+/* exported buildShapeString */
 
-	AudioController.prototype = {
-		addAudio: function(audio) {
-			this.audios.push(audio);
-		},
-		pause: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].pause()
-			}
-		},
-		resume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].resume()
-			}
-		},
-		setRate: function(rateValue) {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].setRate(rateValue)
-			}
-		},
-		createAudio: function(assetPath) {
-			if (this.audioFactory) {
-				return this.audioFactory(assetPath);
-			} else if (Howl) {
-				return new Howl({
-					src: [assetPath]
-				})
-			} else {
-				return {
-					isPlaying: false,
-					play: function(){this.isPlaying = true},
-					seek: function(){this.isPlaying = false},
-					playing: function(){},
-					rate: function(){},
-					setVolume: function(){},
-				}
-			}
-		},
-		setAudioFactory: function(audioFactory) {
-			this.audioFactory = audioFactory;
-		},
-		setVolume: function(value) {
-			this._volume = value;
-			this._updateVolume();
-		},
-		mute: function() {
-			this._isMuted = true;
-			this._updateVolume();
-		},
-		unmute: function() {
-			this._isMuted = false;
-			this._updateVolume();
-		},
-		getVolume: function(value) {
-			return this._volume;
-		},
-		_updateVolume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1))
-			}
-		}
-	}
-
-	return function() {
-		return new AudioController()
-	}
-
-}())
-var ImagePreloader = (function(){
-
-    var proxyImage = (function(){
-        var canvas = createTag('canvas');
-        canvas.width = 1;
-        canvas.height = 1;
-        var ctx = canvas.getContext('2d');
-        ctx.fillStyle = 'rgba(0,0,0,0)';
-        ctx.fillRect(0, 0, 1, 1);
-        return canvas;
-    }())
-
-    function imageLoaded(){
-        this.loadedAssets += 1;
-        if(this.loadedAssets === this.totalImages){
-            if(this.imagesLoadedCb) {
-                this.imagesLoadedCb(null);
-            }
-        }
-    }
-
-    function getAssetsPath(assetData, assetsPath, original_path) {
-        var path = '';
-        if (assetData.e) {
-            path = assetData.p;
-        } else if(assetsPath) {
-            var imagePath = assetData.p;
-            if (imagePath.indexOf('images/') !== -1) {
-                imagePath = imagePath.split('/')[1];
-            }
-            path = assetsPath + imagePath;
-        } else {
-            path = original_path;
-            path += assetData.u ? assetData.u : '';
-            path += assetData.p;
-        }
-        return path;
-    }
-
-    function testImageLoaded(img) {
-        var _count = 0;
-        var intervalId = setInterval(function() {
-            var box = img.getBBox();
-            if (box.width || _count > 500) {
-                this._imageLoaded();
-                clearInterval(intervalId);
-            }
-            _count += 1;
-        }.bind(this), 50)
-    }
-
-    function createImageData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createNS('image');
-        if (isSafari) {
-            this.testImageLoaded(img)
-        } else {
-            img.addEventListener('load', this._imageLoaded, false);
-        }
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.setAttributeNS('http://www.w3.org/1999/xlink','href', path);
-        this._elementHelper.append(img);
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function createImgData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createTag('img');
-        img.crossOrigin = 'anonymous';
-        img.addEventListener('load', this._imageLoaded, false);
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.src = path;
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function loadAssets(assets, cb){
-        this.imagesLoadedCb = cb;
-        var i, len = assets.length;
-        for (i = 0; i < len; i += 1) {
-            if(!assets[i].layers){
-                this.totalImages += 1;
-                this.images.push(this._createImageData(assets[i]));
-            }
-        }
-    }
-
-    function setPath(path){
-        this.path = path || '';
-    }
-
-    function setAssetsPath(path){
-        this.assetsPath = path || '';
-    }
-
-    function getImage(assetData) {
-        var i = 0, len = this.images.length;
-        while (i < len) {
-            if (this.images[i].assetData === assetData) {
-                return this.images[i].img;
-            }
-            i += 1;
-        }
-    }
-
-    function destroy() {
-        this.imagesLoadedCb = null;
-        this.images.length = 0;
-    }
-
-    function loaded() {
-        return this.totalImages === this.loadedAssets;
-    }
-
-    function setCacheType(type, elementHelper) {
-        if (type === 'svg') {
-            this._elementHelper = elementHelper;
-            this._createImageData = this.createImageData.bind(this);
-        } else {
-            this._createImageData = this.createImgData.bind(this);
-        }
-    }
-
-    function ImagePreloader(type){
-        this._imageLoaded = imageLoaded.bind(this);
-        this.testImageLoaded = testImageLoaded.bind(this);
-        this.assetsPath = '';
-        this.path = '';
-        this.totalImages = 0;
-        this.loadedAssets = 0;
-        this.imagesLoadedCb = null;
-        this.images = [];
-    };
-
-    ImagePreloader.prototype = {
-        loadAssets: loadAssets,
-        setAssetsPath: setAssetsPath,
-        setPath: setPath,
-        loaded: loaded,
-        destroy: destroy,
-        getImage: getImage,
-        createImgData: createImgData,
-        createImageData: createImageData,
-        imageLoaded: imageLoaded,
-        setCacheType: setCacheType,
-    }
-
-    return ImagePreloader;
-}());
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	};
-	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)) {
-	   ob.maskType = false;
-	}
-	return ob;
-}());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
-
-	function createFilter(filId){
-        	var fil = createNS('filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
-
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = createNS('feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
-                return feColorMatrix;
-	}
-
-	return ob;
-}());
-var assetLoader = (function(){
-
-	function formatResponse(xhr) {
-		if(xhr.response && typeof xhr.response === 'object') {
-			return xhr.response;
-		} else if(xhr.response && typeof xhr.response === 'string') {
-			return JSON.parse(xhr.response);
-		} else if(xhr.responseText) {
-			return JSON.parse(xhr.responseText);
-		}
-	}
-
-	function loadAsset(path, callback, errorCallback) {
-		var response;
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', path, true);
-		// set responseType after calling open or IE will break.
-		try {
-		    // This crashes on Android WebView prior to KitKat
-		    xhr.responseType = "json";
-		} catch (err) {}
-	    xhr.send();
-	    xhr.onreadystatechange = function () {
-	        if (xhr.readyState == 4) {
-	            if(xhr.status == 200){
-	            	response = formatResponse(xhr);
-	            	callback(response);
-	            }else{
-	                try{
-	            		response = formatResponse(xhr);
-	            		callback(response);
-	                }catch(err){
-	                	if(errorCallback) {
-	                		errorCallback(err);
-	                	}
-	                }
-	            }
-	        }
-	    };
-	}
-	return {
-		load: loadAsset
-	}
-}())
-
-function TextAnimatorProperty(textData, renderType, elem){
-    this._isFirstFrame = true;
-	this._hasMaskedPath = false;
-	this._frameId = -1;
-	this._textData = textData;
-	this._renderType = renderType;
-    this._elem = elem;
-	this._animatorsData = createSizedArray(this._textData.a.length);
-	this._pathData = {};
-	this._moreOptions = {
-		alignment: {}
-	};
-	this.renderedLetters = [];
-    this.lettersChangedFlag = false;
-    this.initDynamicPropertyContainer(elem);
-
-}
-
-TextAnimatorProperty.prototype.searchProperties = function(){
-    var i, len = this._textData.a.length, animatorProps;
-    var getProp = PropertyFactory.getProp;
-    for(i=0;i<len;i+=1){
-        animatorProps = this._textData.a[i];
-        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
-    }
-    if(this._textData.p && 'm' in this._textData.p){
-        this._pathData = {
-            f: getProp(this._elem,this._textData.p.f,0,0,this),
-            l: getProp(this._elem,this._textData.p.l,0,0,this),
-            r: this._textData.p.r,
-            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
-        };
-        this._hasMaskedPath = true;
-    } else {
-        this._hasMaskedPath = false;
-    }
-    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+var buildShapeString = function (pathNodes, length, closed, mat) {
+  if (length === 0) {
+    return '';
+  }
+  var _o = pathNodes.o;
+  var _i = pathNodes.i;
+  var _v = pathNodes.v;
+  var i;
+  var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+  for (i = 1; i < length; i += 1) {
+    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]);
+  }
+  if (closed && length) {
+    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]);
+    shapeString += 'z';
+  }
+  return shapeString;
 };
 
-TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
-    this.lettersChangedFlag = lettersChangedFlag;
-    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
-        return;
+/* global Howl */
+/* exported audioControllerFactory */
+
+var audioControllerFactory = (function () {
+  function AudioController(audioFactory) {
+    this.audios = [];
+    this.audioFactory = audioFactory;
+    this._volume = 1;
+    this._isMuted = false;
+  }
+
+  AudioController.prototype = {
+    addAudio: function (audio) {
+      this.audios.push(audio);
+    },
+    pause: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].pause();
+      }
+    },
+    resume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].resume();
+      }
+    },
+    setRate: function (rateValue) {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].setRate(rateValue);
+      }
+    },
+    createAudio: function (assetPath) {
+      if (this.audioFactory) {
+        return this.audioFactory(assetPath);
+      } if (Howl) {
+        return new Howl({
+          src: [assetPath],
+        });
+      }
+      return {
+        isPlaying: false,
+        play: function () { this.isPlaying = true; },
+        seek: function () { this.isPlaying = false; },
+        playing: function () {},
+        rate: function () {},
+        setVolume: function () {},
+      };
+    },
+    setAudioFactory: function (audioFactory) {
+      this.audioFactory = audioFactory;
+    },
+    setVolume: function (value) {
+      this._volume = value;
+      this._updateVolume();
+    },
+    mute: function () {
+      this._isMuted = true;
+      this._updateVolume();
+    },
+    unmute: function () {
+      this._isMuted = false;
+      this._updateVolume();
+    },
+    getVolume: function () {
+      return this._volume;
+    },
+    _updateVolume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
+      }
+    },
+  };
+
+  return function () {
+    return new AudioController();
+  };
+}());
+
+/* global createTag, createNS, isSafari */
+/* exported ImagePreloader */
+
+var ImagePreloader = (function () {
+  var proxyImage = (function () {
+    var canvas = createTag('canvas');
+    canvas.width = 1;
+    canvas.height = 1;
+    var ctx = canvas.getContext('2d');
+    ctx.fillStyle = 'rgba(0,0,0,0)';
+    ctx.fillRect(0, 0, 1, 1);
+    return canvas;
+  }());
+
+  function imageLoaded() {
+    this.loadedAssets += 1;
+    if (this.loadedAssets === this.totalImages) {
+      if (this.imagesLoadedCb) {
+        this.imagesLoadedCb(null);
+      }
     }
-    this._isFirstFrame = false;
-    var alignment = this._moreOptions.alignment.v;
-    var animators = this._animatorsData;
-    var textData = this._textData;
-    var matrixHelper = this.mHelper;
-    var renderType = this._renderType;
-    var renderedLettersCount = this.renderedLetters.length;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
-    if(this._hasMaskedPath) {
-        mask = this._pathData.m;
-        if(!this._pathData.n || this._pathData._mdf){
-            var paths = mask.v;
-            if(this._pathData.r){
-                paths = paths.reverse();
-            }
-            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
-            pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths._length - 1;
-            var bezierData;
-            totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            this._pathData.pi = pathInfo;
-        }
-        pathInfo = this._pathData.pi;
+  }
 
-        currentLength = this._pathData.f.v;
-        segmentInd = 0;
-        pointInd = 1;
-        segmentLength = 0;
-        flag = true;
-        segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].points;
-                    pointInd = points.length - 1;
-                }
-            }
+  function getAssetsPath(assetData, assetsPath, originalPath) {
+    var path = '';
+    if (assetData.e) {
+      path = assetData.p;
+    } else if (assetsPath) {
+      var imagePath = assetData.p;
+      if (imagePath.indexOf('images/') !== -1) {
+        imagePath = imagePath.split('/')[1];
+      }
+      path = assetsPath + imagePath;
+    } else {
+      path = originalPath;
+      path += assetData.u ? assetData.u : '';
+      path += assetData.p;
+    }
+    return path;
+  }
 
+  function testImageLoaded(img) {
+    var _count = 0;
+    var intervalId = setInterval(function () {
+      var box = img.getBBox();
+      if (box.width || _count > 500) {
+        this._imageLoaded();
+        clearInterval(intervalId);
+      }
+      _count += 1;
+    }.bind(this), 50);
+  }
+
+  function createImageData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createNS('image');
+    if (isSafari) {
+      this.testImageLoaded(img);
+    } else {
+      img.addEventListener('load', this._imageLoaded, false);
+    }
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
+    this._elementHelper.append(img);
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function createImgData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createTag('img');
+    img.crossOrigin = 'anonymous';
+    img.addEventListener('load', this._imageLoaded, false);
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.src = path;
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function loadAssets(assets, cb) {
+    this.imagesLoadedCb = cb;
+    var i;
+    var len = assets.length;
+    for (i = 0; i < len; i += 1) {
+      if (!assets[i].layers) {
+        this.totalImages += 1;
+        this.images.push(this._createImageData(assets[i]));
+      }
+    }
+  }
+
+  function setPath(path) {
+    this.path = path || '';
+  }
+
+  function setAssetsPath(path) {
+    this.assetsPath = path || '';
+  }
+
+  function getImage(assetData) {
+    var i = 0;
+    var len = this.images.length;
+    while (i < len) {
+      if (this.images[i].assetData === assetData) {
+        return this.images[i].img;
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function destroy() {
+    this.imagesLoadedCb = null;
+    this.images.length = 0;
+  }
+
+  function loaded() {
+    return this.totalImages === this.loadedAssets;
+  }
+
+  function setCacheType(type, elementHelper) {
+    if (type === 'svg') {
+      this._elementHelper = elementHelper;
+      this._createImageData = this.createImageData.bind(this);
+    } else {
+      this._createImageData = this.createImgData.bind(this);
+    }
+  }
+
+  function ImagePreloaderFactory() {
+    this._imageLoaded = imageLoaded.bind(this);
+    this.testImageLoaded = testImageLoaded.bind(this);
+    this.assetsPath = '';
+    this.path = '';
+    this.totalImages = 0;
+    this.loadedAssets = 0;
+    this.imagesLoadedCb = null;
+    this.images = [];
+  }
+
+  ImagePreloaderFactory.prototype = {
+    loadAssets: loadAssets,
+    setAssetsPath: setAssetsPath,
+    setPath: setPath,
+    loaded: loaded,
+    destroy: destroy,
+    getImage: getImage,
+    createImgData: createImgData,
+    createImageData: createImageData,
+    imageLoaded: imageLoaded,
+    setCacheType: setCacheType,
+  };
+
+  return ImagePreloaderFactory;
+}());
+
+/* exported featureSupport */
+
+var featureSupport = (function () {
+  var ob = {
+    maskType: true,
+  };
+  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)) {
+    ob.maskType = false;
+  }
+  return ob;
+}());
+
+/* global createNS */
+/* exported filtersFactory */
+
+var filtersFactory = (function () {
+  var ob = {};
+  ob.createFilter = createFilter;
+  ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
+
+  function createFilter(filId) {
+    var fil = createNS('filter');
+    fil.setAttribute('id', filId);
+    fil.setAttribute('filterUnits', 'objectBoundingBox');
+    fil.setAttribute('x', '0%');
+    fil.setAttribute('y', '0%');
+    fil.setAttribute('width', '100%');
+    fil.setAttribute('height', '100%');
+    return fil;
+  }
+
+  function createAlphaToLuminanceFilter() {
+    var feColorMatrix = createNS('feColorMatrix');
+    feColorMatrix.setAttribute('type', 'matrix');
+    feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+    feColorMatrix.setAttribute('values', '0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
+    return feColorMatrix;
+  }
+
+  return ob;
+}());
+
+/* exported assetLoader */
+
+var assetLoader = (function () {
+  function formatResponse(xhr) {
+    if (xhr.response && typeof xhr.response === 'object') {
+      return xhr.response;
+    } if (xhr.response && typeof xhr.response === 'string') {
+      return JSON.parse(xhr.response);
+    } if (xhr.responseText) {
+      return JSON.parse(xhr.responseText);
+    }
+    return null;
+  }
+
+  function loadAsset(path, callback, errorCallback) {
+    var response;
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', path, true);
+    // set responseType after calling open or IE will break.
+    try {
+      // This crashes on Android WebView prior to KitKat
+      xhr.responseType = 'json';
+    } catch (err) {} // eslint-disable-line no-empty
+    xhr.send();
+    xhr.onreadystatechange = function () {
+      if (xhr.readyState === 4) {
+        if (xhr.status === 200) {
+          response = formatResponse(xhr);
+          callback(response);
+        } else {
+          try {
+            response = formatResponse(xhr);
+            callback(response);
+          } catch (err) {
+            if (errorCallback) {
+              errorCallback(err);
+            }
+          }
         }
+      }
+    };
+  }
+  return {
+    load: loadAsset,
+  };
+}());
+
+/* global createSizedArray, PropertyFactory, TextAnimatorDataProperty, bez, addHueToRGB,
+  addSaturationToRGB, addBrightnessToRGB, LetterProps, Matrix, extendPrototype, DynamicPropertyContainer */
+
+function TextAnimatorProperty(textData, renderType, elem) {
+  this._isFirstFrame = true;
+  this._hasMaskedPath = false;
+  this._frameId = -1;
+  this._textData = textData;
+  this._renderType = renderType;
+  this._elem = elem;
+  this._animatorsData = createSizedArray(this._textData.a.length);
+  this._pathData = {};
+  this._moreOptions = {
+    alignment: {},
+  };
+  this.renderedLetters = [];
+  this.lettersChangedFlag = false;
+  this.initDynamicPropertyContainer(elem);
+}
+
+TextAnimatorProperty.prototype.searchProperties = function () {
+  var i;
+  var len = this._textData.a.length;
+  var animatorProps;
+  var getProp = PropertyFactory.getProp;
+  for (i = 0; i < len; i += 1) {
+    animatorProps = this._textData.a[i];
+    this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+  }
+  if (this._textData.p && 'm' in this._textData.p) {
+    this._pathData = {
+      f: getProp(this._elem, this._textData.p.f, 0, 0, this),
+      l: getProp(this._elem, this._textData.p.l, 0, 0, this),
+      r: this._textData.p.r,
+      m: this._elem.maskManager.getMaskProperty(this._textData.p.m),
+    };
+    this._hasMaskedPath = true;
+  } else {
+    this._hasMaskedPath = false;
+  }
+  this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
+};
+
+TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
+  this.lettersChangedFlag = lettersChangedFlag;
+  if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+    return;
+  }
+  this._isFirstFrame = false;
+  var alignment = this._moreOptions.alignment.v;
+  var animators = this._animatorsData;
+  var textData = this._textData;
+  var matrixHelper = this.mHelper;
+  var renderType = this._renderType;
+  var renderedLettersCount = this.renderedLetters.length;
+  var xPos;
+  var yPos;
+  var i;
+  var len;
+  var letters = documentData.l;
+  var pathInfo;
+  var currentLength;
+  var currentPoint;
+  var segmentLength;
+  var flag;
+  var pointInd;
+  var segmentInd;
+  var prevPoint;
+  var points;
+  var segments;
+  var partialLength;
+  var totalLength;
+  var perc;
+  var tanAngle;
+  var mask;
+  if (this._hasMaskedPath) {
+    mask = this._pathData.m;
+    if (!this._pathData.n || this._pathData._mdf) {
+      var paths = mask.v;
+      if (this._pathData.r) {
+        paths = paths.reverse();
+      }
+      // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+      pathInfo = {
+        tLength: 0,
+        segments: [],
+      };
+      len = paths._length - 1;
+      var bezierData;
+      totalLength = 0;
+      for (i = 0; i < len; i += 1) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      i = len;
+      if (mask.v.c) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      this._pathData.pi = pathInfo;
+    }
+    pathInfo = this._pathData.pi;
+
+    currentLength = this._pathData.f.v;
+    segmentInd = 0;
+    pointInd = 1;
+    segmentLength = 0;
+    flag = true;
+    segments = pathInfo.segments;
+    if (currentLength < 0 && mask.v.c) {
+      if (pathInfo.tLength < Math.abs(currentLength)) {
+        currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+      }
+      segmentInd = segments.length - 1;
+      points = segments[segmentInd].points;
+      pointInd = points.length - 1;
+      while (currentLength < 0) {
+        currentLength += points[pointInd].partialLength;
+        pointInd -= 1;
+        if (pointInd < 0) {
+          segmentInd -= 1;
+          points = segments[segmentInd].points;
+          pointInd = points.length - 1;
+        }
+      }
+    }
+    points = segments[segmentInd].points;
+    prevPoint = points[pointInd - 1];
+    currentPoint = points[pointInd];
+    partialLength = currentPoint.partialLength;
+  }
+
+  len = letters.length;
+  xPos = 0;
+  yPos = 0;
+  var yOff = documentData.finalSize * 1.2 * 0.714;
+  var firstLine = true;
+  var animatorProps;
+  var animatorSelector;
+  var j;
+  var jLen;
+  var letterValue;
+
+  jLen = animators.length;
+
+  var mult;
+  var ind = -1;
+  var offf;
+  var xPathPos;
+  var yPathPos;
+  var initPathPos = currentLength;
+  var initSegmentInd = segmentInd;
+  var initPointInd = pointInd;
+  var currentLine = -1;
+  var elemOpacity;
+  var sc;
+  var sw;
+  var fc;
+  var k;
+  var letterSw;
+  var letterSc;
+  var letterFc;
+  var letterM = '';
+  var letterP = this.defaultPropsArray;
+  var letterO;
+
+  //
+  if (documentData.j === 2 || documentData.j === 1) {
+    var animatorJustifyOffset = 0;
+    var animatorFirstCharOffset = 0;
+    var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+    var lastIndex = 0;
+    var isNewLine = true;
+
+    for (i = 0; i < len; i += 1) {
+      if (letters[i].n) {
+        if (animatorJustifyOffset) {
+          animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while (lastIndex < i) {
+          letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+          lastIndex += 1;
+        }
+        animatorJustifyOffset = 0;
+        isNewLine = true;
+      } else {
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.t.propType) {
+            if (isNewLine && documentData.j === 2) {
+              animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+            }
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
+            } else {
+              animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
+            }
+          }
+        }
+        isNewLine = false;
+      }
+    }
+    if (animatorJustifyOffset) {
+      animatorJustifyOffset += animatorFirstCharOffset;
+    }
+    while (lastIndex < i) {
+      letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+      lastIndex += 1;
+    }
+  }
+  //
+
+  for (i = 0; i < len; i += 1) {
+    matrixHelper.reset();
+    elemOpacity = 1;
+    if (letters[i].n) {
+      xPos = 0;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      currentLength = initPathPos;
+      firstLine = false;
+      if (this._hasMaskedPath) {
+        segmentInd = initSegmentInd;
+        pointInd = initPointInd;
         points = segments[segmentInd].points;
         prevPoint = points[pointInd - 1];
         currentPoint = points[pointInd];
         partialLength = currentPoint.partialLength;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.finalSize * 1.2 * 0.714;
-    var firstLine = true;
-    var animatorProps, animatorSelector;
-    var j, jLen;
-    var letterValue;
-
-    jLen = animators.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
-
-    //
-    if(documentData.j === 2 || documentData.j === 1) {
-        var animatorJustifyOffset = 0;
-        var animatorFirstCharOffset = 0;
-        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
-        var lastIndex = 0;
-        var isNewLine = true;
-
-        for (i = 0; i < len; i += 1) {
-            if (letters[i].n) {
-                if(animatorJustifyOffset) {
-                    animatorJustifyOffset += animatorFirstCharOffset;
-                }
-                while (lastIndex < i) {
-                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-                    lastIndex += 1;
-                }
-                animatorJustifyOffset = 0;
-                isNewLine = true;
+        segmentLength = 0;
+      }
+      letterM = '';
+      letterFc = '';
+      letterSw = '';
+      letterO = '';
+      letterP = this.defaultPropsArray;
+    } else {
+      if (this._hasMaskedPath) {
+        if (currentLine !== letters[i].line) {
+          switch (documentData.j) {
+            case 1:
+              currentLength += totalLength - documentData.lineWidths[letters[i].line];
+              break;
+            case 2:
+              currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
+              break;
+            default:
+              break;
+          }
+          currentLine = letters[i].line;
+        }
+        if (ind !== letters[i].ind) {
+          if (letters[ind]) {
+            currentLength += letters[ind].extra;
+          }
+          currentLength += letters[i].an / 2;
+          ind = letters[i].ind;
+        }
+        currentLength += (alignment[0] * letters[i].an) * 0.005;
+        var animatorOffset = 0;
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.p.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.p.v[0] * mult[0];
             } else {
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.t.propType) {
-                        if (isNewLine && documentData.j === 2) {
-                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
-                        }
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
-                        if (mult.length) {
-                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
-                        } else {
-                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
-                        }
-                    }
-                }
-                isNewLine = false;
+              animatorOffset += animatorProps.p.v[0] * mult;
             }
+          }
+          if (animatorProps.a.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.a.v[0] * mult[0];
+            } else {
+              animatorOffset += animatorProps.a.v[0] * mult;
+            }
+          }
         }
-        if(animatorJustifyOffset) {
-            animatorJustifyOffset += animatorFirstCharOffset;
-        }
-        while(lastIndex < i) {
-            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-            lastIndex += 1;
-        }
-    }
-    //
-
-    for( i = 0; i < len; i += 1) {
-
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this._hasMaskedPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
+        flag = true;
+        while (flag) {
+          if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+            matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01);
+            flag = false;
+          } else if (points) {
+            segmentLength += currentPoint.partialLength;
+            pointInd += 1;
+            if (pointInd >= points.length) {
+              pointInd = 0;
+              segmentInd += 1;
+              if (!segments[segmentInd]) {
+                if (mask.v.c) {
+                  pointInd = 0;
+                  segmentInd = 0;
+                  points = segments[segmentInd].points;
+                } else {
+                  segmentLength -= currentPoint.partialLength;
+                  points = null;
+                }
+              } else {
                 points = segments[segmentInd].points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
+              }
             }
-            letterO = letterSw = letterFc = letterM = '';
-            letterP = this.defaultPropsArray;
-        }else{
-            if(this._hasMaskedPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += alignment[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.p.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
+            if (points) {
+              prevPoint = currentPoint;
+              currentPoint = points[pointInd];
+              partialLength = currentPoint.partialLength;
+            }
+          }
+        }
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
+      } else {
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
 
-                    }
-                    if (animatorProps.a.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
+        // Grouping alignment
+        matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0);
+      }
 
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.t.propType) {
+          animatorSelector = animators[j].s;
+          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"
+          if (xPos !== 0 || documentData.j !== 0) {
+            if (this._hasMaskedPath) {
+              if (mult.length) {
+                currentLength += animatorProps.t.v * mult[0];
+              } else {
+                currentLength += animatorProps.t.v * mult;
+              }
+            } else if (mult.length) {
+              xPos += animatorProps.t.v * mult[0];
             } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+              xPos += animatorProps.t.v * mult;
             }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.t.propType) {
-                    animatorSelector = animators[j].s;
-                    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"
-                    if(xPos !== 0 || documentData.j !== 0) {
-                        if(this._hasMaskedPath) {
-                            if(mult.length) {
-                                currentLength += animatorProps.t.v*mult[0];
-                            } else {
-                                currentLength += animatorProps.t.v*mult;
-                            }
-                        }else{
-                            if(mult.length) {
-                                xPos += animatorProps.t.v*mult[0];
-                            } else {
-                                xPos += animatorProps.t.v*mult;
-                            }
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim && documentData.fc) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.a.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.s.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = animators[j].a;
-                animatorSelector = animators[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                if (animatorProps.sk.propType) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if (animatorProps.r.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if (animatorProps.ry.propType) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if (animatorProps.rx.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if (animatorProps.o.propType) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
-                        } else {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim && documentData.fc) {
-                    if(animatorProps.fc.propType){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                            }
-                        }
-                    }
-                    if(animatorProps.fh.propType){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if(animatorProps.fs.propType){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if(animatorProps.fb.propType){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-
-                if (animatorProps.p.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(this._hasMaskedPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim && documentData.fc){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this._hasMaskedPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
-                if (textData.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= alignment[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.finalSize;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                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]];
-            }
-            letterO = elemOpacity;
+          }
         }
-
-        if(renderedLettersCount <= i) {
-            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            this.renderedLetters.push(letterValue);
-            renderedLettersCount += 1;
-            this.lettersChangedFlag = true;
+      }
+      if (documentData.strokeWidthAnim) {
+        sw = documentData.sw || 0;
+      }
+      if (documentData.strokeColorAnim) {
+        if (documentData.sc) {
+          sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
         } else {
-            letterValue = this.renderedLetters[i];
-            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+          sc = [0, 0, 0];
         }
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.a.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+
+          if (mult.length) {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.s.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (mult.length) {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1);
+          } else {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        animatorSelector = animators[j].s;
+        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+        if (animatorProps.sk.propType) {
+          if (mult.length) {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+          } else {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+          }
+        }
+        if (animatorProps.r.propType) {
+          if (mult.length) {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+          } else {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult);
+          }
+        }
+        if (animatorProps.ry.propType) {
+          if (mult.length) {
+            matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
+          } else {
+            matrixHelper.rotateY(animatorProps.ry.v * mult);
+          }
+        }
+        if (animatorProps.rx.propType) {
+          if (mult.length) {
+            matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
+          } else {
+            matrixHelper.rotateX(animatorProps.rx.v * mult);
+          }
+        }
+        if (animatorProps.o.propType) {
+          if (mult.length) {
+            elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0];
+          } else {
+            elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult;
+          }
+        }
+        if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+          if (mult.length) {
+            sw += animatorProps.sw.v * mult[0];
+          } else {
+            sw += animatorProps.sw.v * mult;
+          }
+        }
+        if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+          for (k = 0; k < 3; k += 1) {
+            if (mult.length) {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
+            } else {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
+            }
+          }
+        }
+        if (documentData.fillColorAnim && documentData.fc) {
+          if (animatorProps.fc.propType) {
+            for (k = 0; k < 3; k += 1) {
+              if (mult.length) {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
+              } else {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
+              }
+            }
+          }
+          if (animatorProps.fh.propType) {
+            if (mult.length) {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
+            } else {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult);
+            }
+          }
+          if (animatorProps.fs.propType) {
+            if (mult.length) {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
+            } else {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
+            }
+          }
+          if (animatorProps.fb.propType) {
+            if (mult.length) {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
+            } else {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
+            }
+          }
+        }
+      }
+
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+
+        if (animatorProps.p.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (this._hasMaskedPath) {
+            if (mult.length) {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+            } else {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+            }
+          } else if (mult.length) {
+            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+          }
+        }
+      }
+      if (documentData.strokeWidthAnim) {
+        letterSw = sw < 0 ? 0 : sw;
+      }
+      if (documentData.strokeColorAnim) {
+        letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
+      }
+
+      if (this._hasMaskedPath) {
+        matrixHelper.translate(0, -documentData.ls);
+
+        matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0);
+        if (textData.p.p) {
+          tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+          var rot = (Math.atan(tanAngle) * 180) / Math.PI;
+          if (currentPoint.point[0] < prevPoint.point[0]) {
+            rot += 180;
+          }
+          matrixHelper.rotate((-rot * Math.PI) / 180);
+        }
+        matrixHelper.translate(xPathPos, yPathPos, 0);
+        currentLength -= (alignment[0] * letters[i].an) * 0.005;
+        if (letters[i + 1] && ind !== letters[i + 1].ind) {
+          currentLength += letters[i].an / 2;
+          currentLength += (documentData.tr * 0.001) * documentData.finalSize;
+        }
+      } else {
+        matrixHelper.translate(xPos, yPos, 0);
+
+        if (documentData.ps) {
+          // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+          matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+        }
+        switch (documentData.j) {
+          case 1:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
+            break;
+          case 2:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
+            break;
+          default:
+            break;
+        }
+        matrixHelper.translate(0, -documentData.ls);
+        matrixHelper.translate(offf, 0, 0);
+        matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0);
+        xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize;
+      }
+      if (renderType === 'html') {
+        letterM = matrixHelper.toCSS();
+      } else if (renderType === 'svg') {
+        letterM = matrixHelper.to2dCSS();
+      } else {
+        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]];
+      }
+      letterO = elemOpacity;
     }
+
+    if (renderedLettersCount <= i) {
+      letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
+      this.renderedLetters.push(letterValue);
+      renderedLettersCount += 1;
+      this.lettersChangedFlag = true;
+    } else {
+      letterValue = this.renderedLetters[i];
+      this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+    }
+  }
 };
 
-TextAnimatorProperty.prototype.getValue = function(){
-	if(this._elem.globalData.frameId === this._frameId){
-        return;
-    }
-    this._frameId = this._elem.globalData.frameId;
-    this.iterateDynamicProperties();
+TextAnimatorProperty.prototype.getValue = function () {
+  if (this._elem.globalData.frameId === this._frameId) {
+    return;
+  }
+  this._frameId = this._elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 TextAnimatorProperty.prototype.mHelper = new Matrix();
 TextAnimatorProperty.prototype.defaultPropsArray = [];
 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
+
+/* global PropertyFactory, degToRads, TextSelectorProp */
+/* exported TextAnimatorDataProperty */
+
 function TextAnimatorDataProperty(elem, animatorProps, container) {
-	var defaultData = {propType:false};
-	var getProp = PropertyFactory.getProp;
-	var textAnimator_animatables = animatorProps.a;
-	this.a = {
-		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
-		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
-		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
-		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
-		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
-		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
-		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
-		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
-		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
-		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
-		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
-		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
-		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
-		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
-		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
-		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
-	};
+  var defaultData = { propType: false };
+  var getProp = PropertyFactory.getProp;
+  var textAnimatorAnimatables = animatorProps.a;
+  this.a = {
+    r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
+    rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
+    ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
+    sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
+    sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
+    s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
+    a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
+    o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
+    p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
+    sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
+    sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
+    fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
+    fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
+    fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
+    fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
+    t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData,
+  };
 
-	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
-    this.s.t = animatorProps.s.t;
+  this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
+  this.s.t = animatorProps.s.t;
 }
-function LetterProps(o, sw, sc, fc, m, p){
+
+function LetterProps(o, sw, sc, fc, m, p) {
+  this.o = o;
+  this.sw = sw;
+  this.sc = sc;
+  this.fc = fc;
+  this.m = m;
+  this.p = p;
+  this._mdf = {
+    o: true,
+    sw: !!sw,
+    sc: !!sc,
+    fc: !!fc,
+    m: true,
+    p: true,
+  };
+}
+
+LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
+  this._mdf.o = false;
+  this._mdf.sw = false;
+  this._mdf.sc = false;
+  this._mdf.fc = false;
+  this._mdf.m = false;
+  this._mdf.p = false;
+  var updated = false;
+
+  if (this.o !== o) {
     this.o = o;
+    this._mdf.o = true;
+    updated = true;
+  }
+  if (this.sw !== sw) {
     this.sw = sw;
+    this._mdf.sw = true;
+    updated = true;
+  }
+  if (this.sc !== sc) {
     this.sc = sc;
+    this._mdf.sc = true;
+    updated = true;
+  }
+  if (this.fc !== fc) {
     this.fc = fc;
+    this._mdf.fc = true;
+    updated = true;
+  }
+  if (this.m !== m) {
     this.m = m;
+    this._mdf.m = true;
+    updated = true;
+  }
+  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])) {
     this.p = p;
-    this._mdf = {
-    	o: true,
-    	sw: !!sw,
-    	sc: !!sc,
-    	fc: !!fc,
-    	m: true,
-    	p: true
-    };
-}
-
-LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
-	this._mdf.o = false;
-	this._mdf.sw = false;
-	this._mdf.sc = false;
-	this._mdf.fc = false;
-	this._mdf.m = false;
-	this._mdf.p = false;
-	var updated = false;
-
-	if(this.o !== o) {
-		this.o = o;
-		this._mdf.o = true;
-		updated = true;
-	}
-	if(this.sw !== sw) {
-		this.sw = sw;
-		this._mdf.sw = true;
-		updated = true;
-	}
-	if(this.sc !== sc) {
-		this.sc = sc;
-		this._mdf.sc = true;
-		updated = true;
-	}
-	if(this.fc !== fc) {
-		this.fc = fc;
-		this._mdf.fc = true;
-		updated = true;
-	}
-	if(this.m !== m) {
-		this.m = m;
-		this._mdf.m = true;
-		updated = true;
-	}
-	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])) {
-		this.p = p;
-		this._mdf.p = true;
-		updated = true;
-	}
-	return updated;
-};
-function TextProperty(elem, data){
-	this._frameId = initialDefaultFrame;
-	this.pv = '';
-	this.v = '';
-	this.kf = false;
-	this._isFirstFrame = true;
-	this._mdf = false;
-    this.data = data;
-	this.elem = elem;
-    this.comp = this.elem.comp;
-	this.keysIndex = 0;
-    this.canResize = false;
-    this.minimumFontSize = 1;
-    this.effectsSequence = [];
-	this.currentData = {
-		ascent: 0,
-        boxWidth: this.defaultBoxWidth,
-        f: '',
-        fStyle: '',
-        fWeight: '',
-        fc: '',
-        j: '',
-        justifyOffset: '',
-        l: [],
-        lh: 0,
-        lineWidths: [],
-        ls: '',
-        of: '',
-        s: '',
-        sc: '',
-        sw: 0,
-        t: 0,
-        tr: 0,
-        sz:0,
-        ps:null,
-        fillColorAnim: false,
-        strokeColorAnim: false,
-        strokeWidthAnim: false,
-        yOffset: 0,
-        finalSize:0,
-        finalText:[],
-        finalLineHeight: 0,
-        __complete: false
-
-	};
-    this.copyData(this.currentData, this.data.d.k[0].s);
-
-    if(!this.searchProperty()) {
-        this.completeTextData(this.currentData);
-    }
-}
-
-TextProperty.prototype.defaultBoxWidth = [0,0];
-
-TextProperty.prototype.copyData = function(obj, data) {
-    for(var s in data) {
-        if(data.hasOwnProperty(s)) {
-            obj[s] = data[s];
-        }
-    }
-    return obj;
-}
-
-TextProperty.prototype.setCurrentData = function(data){
-    if(!data.__complete) {
-        this.completeTextData(data);
-    }
-    this.currentData = data;
-    this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
-    this._mdf = true;
+    this._mdf.p = true;
+    updated = true;
+  }
+  return updated;
 };
 
-TextProperty.prototype.searchProperty = function() {
-    return this.searchKeyframes();
-};
+/* global FontManager, initialDefaultFrame, getFontProperties */
+/* exported TextProperty */
 
-TextProperty.prototype.searchKeyframes = function() {
-    this.kf = this.data.d.k.length > 1;
-    if(this.kf) {
-        this.addEffect(this.getKeyframeValue.bind(this));
-    }
-    return this.kf;
+function TextProperty(elem, data) {
+  this._frameId = initialDefaultFrame;
+  this.pv = '';
+  this.v = '';
+  this.kf = false;
+  this._isFirstFrame = true;
+  this._mdf = false;
+  this.data = data;
+  this.elem = elem;
+  this.comp = this.elem.comp;
+  this.keysIndex = 0;
+  this.canResize = false;
+  this.minimumFontSize = 1;
+  this.effectsSequence = [];
+  this.currentData = {
+    ascent: 0,
+    boxWidth: this.defaultBoxWidth,
+    f: '',
+    fStyle: '',
+    fWeight: '',
+    fc: '',
+    j: '',
+    justifyOffset: '',
+    l: [],
+    lh: 0,
+    lineWidths: [],
+    ls: '',
+    of: '',
+    s: '',
+    sc: '',
+    sw: 0,
+    t: 0,
+    tr: 0,
+    sz: 0,
+    ps: null,
+    fillColorAnim: false,
+    strokeColorAnim: false,
+    strokeWidthAnim: false,
+    yOffset: 0,
+    finalSize: 0,
+    finalText: [],
+    finalLineHeight: 0,
+    __complete: false,
+
+  };
+  this.copyData(this.currentData, this.data.d.k[0].s);
+
+  if (!this.searchProperty()) {
+    this.completeTextData(this.currentData);
+  }
 }
 
-TextProperty.prototype.addEffect = function(effectFunction) {
-	this.effectsSequence.push(effectFunction);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.defaultBoxWidth = [0, 0];
+
+TextProperty.prototype.copyData = function (obj, data) {
+  for (var s in data) {
+    if (Object.prototype.hasOwnProperty.call(data, s)) {
+      obj[s] = data[s];
+    }
+  }
+  return obj;
 };
 
-TextProperty.prototype.getValue = function(_finalValue) {
-    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
-        return;
-    }
-    this.currentData.t = this.data.d.k[this.keysIndex].s.t;
-    var currentValue = this.currentData;
-    var currentIndex = this.keysIndex;
-    if(this.lock) {
-        this.setCurrentData(this.currentData);
-        return;
-    }
-    this.lock = true;
-    this._mdf = false;
-    var multipliedValue;
-    var i, len = this.effectsSequence.length;
-    var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
-    for(i = 0; i < len; i += 1) {
-        //Checking if index changed to prevent creating a new object every time the expression updates.
-        if(currentIndex !== this.keysIndex) {
-            finalValue = this.effectsSequence[i](finalValue, finalValue.t);
-        } else {
-            finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
-        }
-    }
-    if(currentValue !== finalValue) {
-        this.setCurrentData(finalValue);
-    }
-    this.pv = this.v = this.currentData;
-    this.lock = false;
-    this.frameId = this.elem.globalData.frameId;
-}
+TextProperty.prototype.setCurrentData = function (data) {
+  if (!data.__complete) {
+    this.completeTextData(data);
+  }
+  this.currentData = data;
+  this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+  this._mdf = true;
+};
 
-TextProperty.prototype.getKeyframeValue = function() {
-    var textKeys = this.data.d.k, textDocumentData;
-    var frameNum = this.elem.comp.renderedFrame;
-    var i = 0, len = textKeys.length;
-    while(i <= len - 1) {
-        textDocumentData = textKeys[i].s;
-        if(i === len - 1 || textKeys[i+1].t > frameNum){
-            break;
-        }
+TextProperty.prototype.searchProperty = function () {
+  return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function () {
+  this.kf = this.data.d.k.length > 1;
+  if (this.kf) {
+    this.addEffect(this.getKeyframeValue.bind(this));
+  }
+  return this.kf;
+};
+
+TextProperty.prototype.addEffect = function (effectFunction) {
+  this.effectsSequence.push(effectFunction);
+  this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function (_finalValue) {
+  if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+    return;
+  }
+  this.currentData.t = this.data.d.k[this.keysIndex].s.t;
+  var currentValue = this.currentData;
+  var currentIndex = this.keysIndex;
+  if (this.lock) {
+    this.setCurrentData(this.currentData);
+    return;
+  }
+  this.lock = true;
+  this._mdf = false;
+  var i; var
+    len = this.effectsSequence.length;
+  var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
+  for (i = 0; i < len; i += 1) {
+    // Checking if index changed to prevent creating a new object every time the expression updates.
+    if (currentIndex !== this.keysIndex) {
+      finalValue = this.effectsSequence[i](finalValue, finalValue.t);
+    } else {
+      finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
+    }
+  }
+  if (currentValue !== finalValue) {
+    this.setCurrentData(finalValue);
+  }
+  this.v = this.currentData;
+  this.pv = this.v;
+  this.lock = false;
+  this.frameId = this.elem.globalData.frameId;
+};
+
+TextProperty.prototype.getKeyframeValue = function () {
+  var textKeys = this.data.d.k;
+  var frameNum = this.elem.comp.renderedFrame;
+  var i = 0; var
+    len = textKeys.length;
+  while (i <= len - 1) {
+    if (i === len - 1 || textKeys[i + 1].t > frameNum) {
+      break;
+    }
+    i += 1;
+  }
+  if (this.keysIndex !== i) {
+    this.keysIndex = i;
+  }
+  return this.data.d.k[this.keysIndex].s;
+};
+
+TextProperty.prototype.buildFinalText = function (text) {
+  var combinedCharacters = FontManager.getCombinedCharacterCodes();
+  var charactersArray = [];
+  var i = 0; var
+    len = text.length;
+  var charCode;
+  while (i < len) {
+    charCode = text.charCodeAt(i);
+    if (combinedCharacters.indexOf(charCode) !== -1) {
+      charactersArray[charactersArray.length - 1] += text.charAt(i);
+    } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      charCode = text.charCodeAt(i + 1);
+      if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
+        charactersArray.push(text.substr(i, 2));
         i += 1;
+      } else {
+        charactersArray.push(text.charAt(i));
+      }
+    } else {
+      charactersArray.push(text.charAt(i));
     }
-    if(this.keysIndex !== i) {
-        this.keysIndex = i;
-    }
-    return this.data.d.k[this.keysIndex].s;
+    i += 1;
+  }
+  return charactersArray;
 };
 
-TextProperty.prototype.buildFinalText = function(text) {
-    var combinedCharacters = FontManager.getCombinedCharacterCodes();
-    var charactersArray = [];
-    var i = 0, len = text.length;
-    var charCode;
-    while (i < len) {
-        charCode = text.charCodeAt(i);
-        if (combinedCharacters.indexOf(charCode) !== -1) {
-            charactersArray[charactersArray.length - 1] += text.charAt(i);
-        } else {
-            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
-                charCode = text.charCodeAt(i + 1);
-                if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
-                    charactersArray.push(text.substr(i, 2));
-                    ++i;
-                } else {
-                    charactersArray.push(text.charAt(i));
-                }
-            } else {
-                charactersArray.push(text.charAt(i));
-            }
-        }
-        i += 1;
-    }
-    return charactersArray;
-}
-
-TextProperty.prototype.completeTextData = function(documentData) {
-    documentData.__complete = true;
-    var fontManager = this.elem.globalData.fontManager;
-    var data = this.data;
-    var letters = [];
-    var i, len;
-    var newLineFlag, index = 0, val;
-    var anchorGrouping = data.m.g;
-    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-    var lineWidth = 0;
-    var maxLineWidth = 0;
-    var j, jLen;
-    var fontData = fontManager.getFontByName(documentData.f);
-    var charData, cLength = 0;
-    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
-
-    var fWeight = 'normal', fStyle = 'normal';
-    len = styles.length;
-    var styleName;
-    for(i=0;i<len;i+=1){
-        styleName = styles[i].toLowerCase();
-        switch(styleName) {
-            case 'italic':
-            fStyle = 'italic';
-            break;
-            case 'bold':
-            fWeight = '700';
-            break;
-            case 'black':
-            fWeight = '900';
-            break;
-            case 'medium':
-            fWeight = '500';
-            break;
-            case 'regular':
-            case 'normal':
-            fWeight = '400';
-            break;
-            case 'light':
-            case 'thin':
-            fWeight = '200';
-            break;
-        }
-    }
-    documentData.fWeight = fontData.fWeight || fWeight;
-    documentData.fStyle = fStyle;
-    documentData.finalSize = documentData.s;
-    documentData.finalText = this.buildFinalText(documentData.t);
-    len = documentData.finalText.length;
-    documentData.finalLineHeight = documentData.lh;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var charCode;
-    if(documentData.sz){
-        var flag = true;
-        var boxWidth = documentData.sz[0];
-        var boxHeight = documentData.sz[1];
-        var currentHeight, finalText;
-        while(flag) {
-            finalText = this.buildFinalText(documentData.t);
-            currentHeight = 0;
-            lineWidth = 0;
-            len = finalText.length;
-            trackingOffset = documentData.tr/1000*documentData.finalSize;
-            var lastSpaceIndex = -1;
-            for(i=0;i<len;i+=1){
-                charCode = finalText[i].charCodeAt(0);
-                newLineFlag = false;
-                if(finalText[i] === ' '){
-                    lastSpaceIndex = i;
-                }else if(charCode === 13 || charCode === 3){
-                    lineWidth = 0;
-                    newLineFlag = true;
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-                }else{
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
-                }
-                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
-                    if(lastSpaceIndex === -1){
-                        len += 1;
-                    } else {
-                        i = lastSpaceIndex;
-                    }
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
-                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
-                    lastSpaceIndex = -1;
-                    lineWidth = 0;
-                }else {
-                    lineWidth += cLength;
-                    lineWidth += trackingOffset;
-                }
-            }
-            currentHeight += fontData.ascent*documentData.finalSize/100;
-            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
-                documentData.finalSize -= 1;
-                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
-            } else {
-                documentData.finalText = finalText;
-                len = documentData.finalText.length;
-                flag = false;
-            }
-        }
-
-    }
-    lineWidth = - trackingOffset;
+TextProperty.prototype.completeTextData = function (documentData) {
+  documentData.__complete = true;
+  var fontManager = this.elem.globalData.fontManager;
+  var data = this.data;
+  var letters = [];
+  var i; var
+    len;
+  var newLineFlag; var index = 0; var
+    val;
+  var anchorGrouping = data.m.g;
+  var currentSize = 0; var currentPos = 0; var currentLine = 0; var
+    lineWidths = [];
+  var lineWidth = 0;
+  var maxLineWidth = 0;
+  var j; var
+    jLen;
+  var fontData = fontManager.getFontByName(documentData.f);
+  var charData; var
     cLength = 0;
-    var uncollapsedSpaces = 0;
-    var currentChar;
-    for (i = 0;i < len ;i += 1) {
+
+  var fontProps = getFontProperties(fontData);
+  documentData.fWeight = fontProps.weight;
+  documentData.fStyle = fontProps.style;
+  documentData.finalSize = documentData.s;
+  documentData.finalText = this.buildFinalText(documentData.t);
+  len = documentData.finalText.length;
+  documentData.finalLineHeight = documentData.lh;
+  var trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+  var charCode;
+  if (documentData.sz) {
+    var flag = true;
+    var boxWidth = documentData.sz[0];
+    var boxHeight = documentData.sz[1];
+    var currentHeight; var
+      finalText;
+    while (flag) {
+      finalText = this.buildFinalText(documentData.t);
+      currentHeight = 0;
+      lineWidth = 0;
+      len = finalText.length;
+      trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+      var lastSpaceIndex = -1;
+      for (i = 0; i < len; i += 1) {
+        charCode = finalText[i].charCodeAt(0);
         newLineFlag = false;
-        currentChar = documentData.finalText[i];
-        charCode = currentChar.charCodeAt(0);
-        if (charCode === 13 || charCode === 3) {
-            uncollapsedSpaces = 0;
-            lineWidths.push(lineWidth);
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidth = - 2 * trackingOffset;
-            val = '';
-            newLineFlag = true;
-            currentLine += 1;
-        }else{
-            val = currentChar;
+        if (finalText[i] === ' ') {
+          lastSpaceIndex = i;
+        } else if (charCode === 13 || charCode === 3) {
+          lineWidth = 0;
+          newLineFlag = true;
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
         }
-        if(fontManager.chars){
-            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-        }else{
-            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
-            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
-        }
-
-        //
-        if(currentChar === ' '){
-            uncollapsedSpaces += cLength + trackingOffset;
+        if (fontManager.chars) {
+          charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+          cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
         } else {
-            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
-            uncollapsedSpaces = 0;
+          // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+          cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
         }
-        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
-        if(anchorGrouping == 2){
-            currentSize += cLength;
-            if(val === '' || val === ' ' || i === len - 1){
-                if(val === '' || val === ' '){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                index += 1;
-                currentSize = 0;
-            }
-        }else if(anchorGrouping == 3){
-            currentSize += cLength;
-            if(val === '' || i === len - 1){
-                if(val === ''){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                currentSize = 0;
-                index += 1;
-            }
-        }else{
-            letters[index].ind = index;
-            letters[index].extra = 0;
-            index += 1;
+        if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
+          if (lastSpaceIndex === -1) {
+            len += 1;
+          } else {
+            i = lastSpaceIndex;
+          }
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
+          finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r');
+          // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+          lastSpaceIndex = -1;
+          lineWidth = 0;
+        } else {
+          lineWidth += cLength;
+          lineWidth += trackingOffset;
         }
+      }
+      currentHeight += (fontData.ascent * documentData.finalSize) / 100;
+      if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+        documentData.finalSize -= 1;
+        documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s;
+      } else {
+        documentData.finalText = finalText;
+        len = documentData.finalText.length;
+        flag = false;
+      }
     }
-    documentData.l = letters;
-    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-    lineWidths.push(lineWidth);
-    if(documentData.sz){
-        documentData.boxWidth = documentData.sz[0];
+  }
+  lineWidth = -trackingOffset;
+  cLength = 0;
+  var uncollapsedSpaces = 0;
+  var currentChar;
+  for (i = 0; i < len; i += 1) {
+    newLineFlag = false;
+    currentChar = documentData.finalText[i];
+    charCode = currentChar.charCodeAt(0);
+    if (charCode === 13 || charCode === 3) {
+      uncollapsedSpaces = 0;
+      lineWidths.push(lineWidth);
+      maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+      lineWidth = -2 * trackingOffset;
+      val = '';
+      newLineFlag = true;
+      currentLine += 1;
+    } else {
+      val = currentChar;
+    }
+    if (fontManager.chars) {
+      charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+      cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
+    } else {
+      // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+      // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+      cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+    }
+
+    //
+    if (currentChar === ' ') {
+      uncollapsedSpaces += cLength + trackingOffset;
+    } else {
+      lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+      uncollapsedSpaces = 0;
+    }
+    letters.push({
+      l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0,
+    });
+    if (anchorGrouping == 2) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || val === ' ' || i === len - 1) {
+        if (val === '' || val === ' ') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        index += 1;
+        currentSize = 0;
+      }
+    } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || i === len - 1) {
+        if (val === '') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        currentSize = 0;
+        index += 1;
+      }
+    } else {
+      letters[index].ind = index;
+      letters[index].extra = 0;
+      index += 1;
+    }
+  }
+  documentData.l = letters;
+  maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+  lineWidths.push(lineWidth);
+  if (documentData.sz) {
+    documentData.boxWidth = documentData.sz[0];
+    documentData.justifyOffset = 0;
+  } else {
+    documentData.boxWidth = maxLineWidth;
+    switch (documentData.j) {
+      case 1:
+        documentData.justifyOffset = -documentData.boxWidth;
+        break;
+      case 2:
+        documentData.justifyOffset = -documentData.boxWidth / 2;
+        break;
+      default:
         documentData.justifyOffset = 0;
-    }else{
-        documentData.boxWidth = maxLineWidth;
-        switch(documentData.j){
-            case 1:
-                documentData.justifyOffset = - documentData.boxWidth;
-                break;
-            case 2:
-                documentData.justifyOffset = - documentData.boxWidth/2;
-                break;
-            default:
-                documentData.justifyOffset = 0;
-        }
     }
-    documentData.lineWidths = lineWidths;
+  }
+  documentData.lineWidths = lineWidths;
 
-    var animators = data.a, animatorData, letterData;
-    jLen = animators.length;
-    var based, ind, indexes = [];
-    for(j=0;j<jLen;j+=1){
-        animatorData = animators[j];
-        if(animatorData.a.sc){
-            documentData.strokeColorAnim = true;
-        }
-        if(animatorData.a.sw){
-            documentData.strokeWidthAnim = true;
-        }
-        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
-            documentData.fillColorAnim = true;
-        }
-        ind = 0;
-        based = animatorData.s.b;
-        for(i=0;i<len;i+=1){
-            letterData = letters[i];
-            letterData.anIndexes[j] = ind;
-            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))){
-                if(animatorData.s.rn === 1){
-                    indexes.push(ind);
-                }
-                ind += 1;
-            }
-        }
-        data.a[j].s.totalChars = ind;
-        var currentInd = -1, newInd;
-        if(animatorData.s.rn === 1){
-            for(i = 0; i < len; i += 1){
-                letterData = letters[i];
-                if(currentInd != letterData.anIndexes[j]){
-                    currentInd = letterData.anIndexes[j];
-                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                }
-                letterData.anIndexes[j] = newInd;
-            }
-        }
+  var animators = data.a; var animatorData; var
+    letterData;
+  jLen = animators.length;
+  var based; var ind; var
+    indexes = [];
+  for (j = 0; j < jLen; j += 1) {
+    animatorData = animators[j];
+    if (animatorData.a.sc) {
+      documentData.strokeColorAnim = true;
     }
-    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
-    documentData.ls = documentData.ls || 0;
-    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+    if (animatorData.a.sw) {
+      documentData.strokeWidthAnim = true;
+    }
+    if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
+      documentData.fillColorAnim = true;
+    }
+    ind = 0;
+    based = animatorData.s.b;
+    for (i = 0; i < len; i += 1) {
+      letterData = letters[i];
+      letterData.anIndexes[j] = ind;
+      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))) { // eslint-disable-line eqeqeq
+        if (animatorData.s.rn === 1) {
+          indexes.push(ind);
+        }
+        ind += 1;
+      }
+    }
+    data.a[j].s.totalChars = ind;
+    var currentInd = -1; var
+      newInd;
+    if (animatorData.s.rn === 1) {
+      for (i = 0; i < len; i += 1) {
+        letterData = letters[i];
+        if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq
+          currentInd = letterData.anIndexes[j];
+          newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
+        }
+        letterData.anIndexes[j] = newInd;
+      }
+    }
+  }
+  documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
+  documentData.ls = documentData.ls || 0;
+  documentData.ascent = (fontData.ascent * documentData.finalSize) / 100;
 };
 
-TextProperty.prototype.updateDocumentData = function(newData, index) {
-	index = index === undefined ? this.keysIndex : index;
-    var dData = this.copyData({}, this.data.d.k[index].s);
-    dData = this.copyData(dData, newData);
-    this.data.d.k[index].s = dData;
-    this.recalculate(index);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.updateDocumentData = function (newData, index) {
+  index = index === undefined ? this.keysIndex : index;
+  var dData = this.copyData({}, this.data.d.k[index].s);
+  dData = this.copyData(dData, newData);
+  this.data.d.k[index].s = dData;
+  this.recalculate(index);
+  this.elem.addDynamicProperty(this);
 };
 
-TextProperty.prototype.recalculate = function(index) {
-    var dData = this.data.d.k[index].s;
-    dData.__complete = false;
-    this.keysIndex = 0;
-    this._isFirstFrame = true;
-    this.getValue(dData);
-}
-
-TextProperty.prototype.canResizeFont = function(_canResize) {
-    this.canResize = _canResize;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.recalculate = function (index) {
+  var dData = this.data.d.k[index].s;
+  dData.__complete = false;
+  this.keysIndex = 0;
+  this._isFirstFrame = true;
+  this.getValue(dData);
 };
 
-TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
-    this.minimumFontSize = Math.floor(_fontValue) || 1;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.canResizeFont = function (_canResize) {
+  this.canResize = _canResize;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
 };
 
-var TextSelectorProp = (function(){
-    var max = Math.max;
-    var min = Math.min;
-    var floor = Math.floor;
+TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
+  this.minimumFontSize = Math.floor(_fontValue) || 1;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
+};
 
-    function TextSelectorProp(elem,data){
-        this._currentTextLength = -1;
-        this.k = false;
-        this.data = data;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.finalS = 0;
-        this.finalE = 0;
-        this.initDynamicPropertyContainer(elem);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
-        if('e' in data){
-            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
-        }else{
-            this.e = {v:100};
+/* global extendPrototype, BezierFactory, PropertyFactory, DynamicPropertyContainer */
+/* exported TextSelectorProp */
+
+var TextSelectorProp = (function () {
+  var max = Math.max;
+  var min = Math.min;
+  var floor = Math.floor;
+
+  function TextSelectorPropFactory(elem, data) {
+    this._currentTextLength = -1;
+    this.k = false;
+    this.data = data;
+    this.elem = elem;
+    this.comp = elem.comp;
+    this.finalS = 0;
+    this.finalE = 0;
+    this.initDynamicPropertyContainer(elem);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this);
+    if ('e' in data) {
+      this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
+    } else {
+      this.e = { v: 100 };
+    }
+    this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this);
+    this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this);
+    this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this);
+    this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
+    if (!this.dynamicProperties.length) {
+      this.getValue();
+    }
+  }
+
+  TextSelectorPropFactory.prototype = {
+    getMult: function (ind) {
+      if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+        this.getValue();
+      }
+      // var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+      var x1 = 0;
+      var y1 = 0;
+      var x2 = 1;
+      var y2 = 1;
+      if (this.ne.v > 0) {
+        x1 = this.ne.v / 100.0;
+      } else {
+        y1 = -this.ne.v / 100.0;
+      }
+      if (this.xe.v > 0) {
+        x2 = 1.0 - this.xe.v / 100.0;
+      } else {
+        y2 = 1.0 + this.xe.v / 100.0;
+      }
+      var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
+
+      var mult = 0;
+      var s = this.finalS;
+      var e = this.finalE;
+      var type = this.data.sh;
+      if (type === 2) {
+        if (e === s) {
+          mult = ind >= e ? 1 : 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
-        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
-        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
-        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
-        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
-        if(!this.dynamicProperties.length){
-            this.getValue();
+        mult = easer(mult);
+      } else if (type === 3) {
+        if (e === s) {
+          mult = ind >= e ? 0 : 1;
+        } else {
+          mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
+
+        mult = easer(mult);
+      } else if (type === 4) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
+          if (mult < 0.5) {
+            mult *= 2;
+          } else {
+            mult = 1 - 2 * (mult - 0.5);
+          }
+        }
+        mult = easer(mult);
+      } else if (type === 5) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          var tot = e - s;
+          /* ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          var x = -tot / 2 + ind;
+          var a = tot / 2;
+          mult = Math.sqrt(1 - (x * x) / (a * a));
+        }
+        mult = easer(mult);
+      } else if (type === 6) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line
+        }
+        mult = easer(mult);
+      } else {
+        if (ind >= floor(s)) {
+          if (ind - s < 0) {
+            mult = max(0, min(min(e, 1) - (s - ind), 1));
+          } else {
+            mult = max(0, min(e - ind, 1));
+          }
+        }
+        mult = easer(mult);
+      }
+      return mult * this.a.v;
+    },
+    getValue: function (newCharsFlag) {
+      this.iterateDynamicProperties();
+      this._mdf = newCharsFlag || this._mdf;
+      this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+      if (newCharsFlag && this.data.r === 2) {
+        this.e.v = this._currentTextLength;
+      }
+      var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
+      var o = this.o.v / divisor;
+      var s = this.s.v / divisor + o;
+      var e = (this.e.v / divisor) + o;
+      if (s > e) {
+        var _s = s;
+        s = e;
+        e = _s;
+      }
+      this.finalS = s;
+      this.finalE = e;
+    },
+  };
+  extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
+
+  function getTextSelectorProp(elem, data, arr) {
+    return new TextSelectorPropFactory(elem, data, arr);
+  }
+
+  return {
+    getTextSelectorProp: getTextSelectorProp,
+  };
+}());
+
+/* global createSizedArray, pooling */
+/* exported poolFactory */
+
+var poolFactory = (function () {
+  return function (initialLength, _create, _release) {
+    var _length = 0;
+    var _maxLength = initialLength;
+    var pool = createSizedArray(_maxLength);
+
+    var ob = {
+      newElement: newElement,
+      release: release,
+    };
+
+    function newElement() {
+      var element;
+      if (_length) {
+        _length -= 1;
+        element = pool[_length];
+      } else {
+        element = _create();
+      }
+      return element;
     }
 
-    TextSelectorProp.prototype = {
-        getMult: function(ind) {
-            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
-                this.getValue();
-            }
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var x1 = 0;
-            var y1 = 0;
-            var x2 = 1;
-            var y2 = 1;
-            if(this.ne.v > 0) {
-                x1 = this.ne.v / 100.0;
-            }
-            else {
-                y1 = -this.ne.v / 100.0;
-            }
-            if(this.xe.v > 0) {
-                x2 = 1.0 - this.xe.v / 100.0;
-            }
-            else {
-                y2 = 1.0 + this.xe.v / 100.0;
-            }
-            var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
-
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if (type === 2){
-                if (e === s) {
-                    mult = ind >= e ? 1 : 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                }
-                mult = easer(mult);
-            } else if(type === 3) {
-                if (e === s) {
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
-                }
-
-                mult = easer(mult);
-            } else if (type === 4) {
-                if (e === s) {
-                    mult = 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                    if (mult < 0.5) {
-                        mult *= 2;
-                    } else {
-                        mult = 1 - 2 * (mult - 0.5);
-                    }
-                }
-                mult = easer(mult);
-            } else if (type === 5) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x * x) / (a * a));
-                }
-                mult = easer(mult);
-            } else if (type === 6) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
-                }
-                mult = easer(mult);
-            } else {
-                if (ind >= floor(s)) {
-                    if (ind - s < 0) {
-                        mult = max(0, min(min(e, 1) - (s - ind), 1));
-                    } else {
-                        mult = max(0, min(e - ind, 1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        },
-        getValue: function(newCharsFlag) {
-            this.iterateDynamicProperties();
-            this._mdf = newCharsFlag || this._mdf;
-            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
-            if(newCharsFlag && this.data.r === 2) {
-                this.e.v = this._currentTextLength;
-            }
-            var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-    }
-    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
+    function release(element) {
+      if (_length === _maxLength) {
+        pool = pooling.double(pool);
+        _maxLength *= 2;
+      }
+      if (_release) {
+        _release(element);
+      }
+      pool[_length] = element;
+      _length += 1;
     }
 
+    return ob;
+  };
+}());
+
+/* global createSizedArray */
+/* exported pooling */
+
+var pooling = (function () {
+  function double(arr) {
+    return arr.concat(createSizedArray(arr.length));
+  }
+
+  return {
+    double: double,
+  };
+}());
+
+/* global createTypedArray, poolFactory */
+/* exported pointPool */
+
+var pointPool = (function () {
+  function create() {
+    return createTypedArray('float32', 2);
+  }
+  return poolFactory(8, create);
+}());
+
+/* global ShapePath, pointPool, poolFactory */
+/* exported shapePool */
+
+var shapePool = (function () {
+  function create() {
+    return new ShapePath();
+  }
+
+  function release(shapePath) {
+    var len = shapePath._length;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      pointPool.release(shapePath.v[i]);
+      pointPool.release(shapePath.i[i]);
+      pointPool.release(shapePath.o[i]);
+      shapePath.v[i] = null;
+      shapePath.i[i] = null;
+      shapePath.o[i] = null;
+    }
+    shapePath._length = 0;
+    shapePath.c = false;
+  }
+
+  function clone(shape) {
+    var cloned = factory.newElement();
+    var i;
+    var len = shape._length === undefined ? shape.v.length : shape._length;
+    cloned.setLength(len);
+    cloned.c = shape.c;
+
+    for (i = 0; i < len; i += 1) {
+      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);
+    }
+    return cloned;
+  }
+
+  var factory = poolFactory(4, create, release);
+  factory.clone = clone;
+
+  return factory;
+}());
+
+/* global createSizedArray, ShapeCollection, shapePool, pooling */
+/* exported shapeCollectionPool */
+
+var shapeCollectionPool = (function () {
+  var ob = {
+    newShapeCollection: newShapeCollection,
+    release: release,
+  };
+
+  var _length = 0;
+  var _maxLength = 4;
+  var pool = createSizedArray(_maxLength);
+
+  function newShapeCollection() {
+    var shapeCollection;
+    if (_length) {
+      _length -= 1;
+      shapeCollection = pool[_length];
+    } else {
+      shapeCollection = new ShapeCollection();
+    }
+    return shapeCollection;
+  }
+
+  function release(shapeCollection) {
+    var i;
+    var len = shapeCollection._length;
+    for (i = 0; i < len; i += 1) {
+      shapePool.release(shapeCollection.shapes[i]);
+    }
+    shapeCollection._length = 0;
+
+    if (_length === _maxLength) {
+      pool = pooling.double(pool);
+      _maxLength *= 2;
+    }
+    pool[_length] = shapeCollection;
+    _length += 1;
+  }
+
+  return ob;
+}());
+
+/* global poolFactory, bezierLengthPool */
+/* exported segmentsLengthPool */
+
+var segmentsLengthPool = (function () {
+  function create() {
     return {
-        getTextSelectorProp: getTextSelectorProp
+      lengths: [],
+      totalLength: 0,
     };
-}());
+  }
 
-    
-var pool_factory = (function() {
-	return function(initialLength, _create, _release, _clone) {
-
-		var _length = 0;
-		var _maxLength = initialLength;
-		var pool = createSizedArray(_maxLength);
-
-		var ob = {
-			newElement: newElement,
-			release: release
-		};
-
-		function newElement(){
-			var element;
-			if(_length){
-				_length -= 1;
-				element = pool[_length];
-			} else {
-				element = _create();
-			}
-			return element;
-		}
-
-		function release(element) {
-			if(_length === _maxLength) {
-				pool = pooling.double(pool);
-				_maxLength = _maxLength*2;
-			}
-			if (_release) {
-				_release(element);
-			}
-			pool[_length] = element;
-			_length += 1;
-		}
-
-		function clone() {
-			var clonedElement = newElement();
-			return _clone(clonedElement);
-		}
-
-		return ob;
-	};
-}());
-
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(createSizedArray(arr.length));
-	}
-
-	return {
-		double: double
-	};
-}());
-var point_pool = (function(){
-
-	function create() {
-		return createTypedArray('float32', 2);
-	}
-	return pool_factory(8, create);
-}());
-var shape_pool = (function(){
-
-	function create() {
-		return new ShapePath();
-	}
-
-	function release(shapePath) {
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-	}
-
-	function clone(shape) {
-		var cloned = factory.newElement();
-		var i, len = shape._length === undefined ? shape.v.length : shape._length;
-		cloned.setLength(len);
-		cloned.c = shape.c;
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			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);
-		}
-		return cloned;
-	}
-
-	var factory = pool_factory(4, create, release);
-	factory.clone = clone;
-
-	return factory;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release
-	};
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = createSizedArray(_maxLength);
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	return ob;
-}());
-var segments_length_pool = (function(){
-
-	function create() {
-		return {
-			lengths: [],
-			totalLength: 0
-		};
-	}
-
-	function release(element) {
-		var i, len = element.lengths.length;
-		for(i=0;i<len;i+=1) {
-			bezier_length_pool.release(element.lengths[i]);
-		}
-		element.lengths.length = 0;
-	}
-
-	return pool_factory(8, create, release);
-}());
-var bezier_length_pool = (function(){
-
-	function create() {
-		return {
-            addedLength: 0,
-            percents: createTypedArray('float32', defaultCurveSegments),
-            lengths: createTypedArray('float32', defaultCurveSegments),
-        };
-	}
-	return pool_factory(8, create);
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
+  function release(element) {
+    var i;
+    var len = element.lengths.length;
+    for (i = 0; i < len; i += 1) {
+      bezierLengthPool.release(element.lengths[i]);
     }
-    this.checkPendingElements();
-};
+    element.lengths.length = 0;
+  }
 
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 3:
-            return this.createNull(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 6:
-            return this.createAudio(layer);
-        case 13:
-            return this.createCamera(layer);
-    }
-    return this.createNull(layer);
-};
+  return poolFactory(8, create, release);
+}());
 
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-};
+/* global createTypedArray, defaultCurveSegments, poolFactory */
+/* exported bezierLengthPool */
 
-BaseRenderer.prototype.createAudio = function(data){
-    return new AudioElement(data, this.globalData, this);
-};
+var bezierLengthPool = (function () {
+  function create() {
+    return {
+      addedLength: 0,
+      percents: createTypedArray('float32', defaultCurveSegments),
+      lengths: createTypedArray('float32', defaultCurveSegments),
+    };
+  }
+  return poolFactory(8, create);
+}());
 
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
+/* global AudioElement, FontManager */
+
+function BaseRenderer() {}
+BaseRenderer.prototype.checkLayers = function (num) {
+  var i;
+  var len = this.layers.length;
+  var data;
+  this.completeLayers = true;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (!this.elements[i]) {
+      data = this.layers[i];
+      if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) {
         this.buildItem(i);
+      }
     }
-    this.checkPendingElements();
+    this.completeLayers = this.elements[i] ? this.completeLayers : false;
+  }
+  this.checkPendingElements();
 };
 
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
+BaseRenderer.prototype.createItem = function (layer) {
+  switch (layer.ty) {
+    case 2:
+      return this.createImage(layer);
+    case 0:
+      return this.createComp(layer);
+    case 1:
+      return this.createSolid(layer);
+    case 3:
+      return this.createNull(layer);
+    case 4:
+      return this.createShape(layer);
+    case 5:
+      return this.createText(layer);
+    case 6:
+      return this.createAudio(layer);
+    case 13:
+      return this.createCamera(layer);
+    default:
+      return this.createNull(layer);
+  }
+};
+
+BaseRenderer.prototype.createCamera = function () {
+  throw new Error('You\'re using a 3d camera. Try the html renderer.');
+};
+
+BaseRenderer.prototype.createAudio = function (data) {
+  return new AudioElement(data, this.globalData, this);
+};
+
+BaseRenderer.prototype.buildAllItems = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    this.buildItem(i);
+  }
+  this.checkPendingElements();
+};
+
+BaseRenderer.prototype.includeLayers = function (newLayers) {
+  this.completeLayers = false;
+  var i;
+  var len = newLayers.length;
+  var j;
+  var jLen = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    j = 0;
+    while (j < jLen) {
+      if (this.layers[j].id === newLayers[i].id) {
+        this.layers[j] = newLayers[i];
+        break;
+      }
+      j += 1;
+    }
+  }
+};
+
+BaseRenderer.prototype.setProjectInterface = function (pInterface) {
+  this.globalData.projectInterface = pInterface;
+};
+
+BaseRenderer.prototype.initItems = function () {
+  if (!this.globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+};
+BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
+  var elements = this.elements;
+  var layers = this.layers;
+  var i = 0;
+  var len = layers.length;
+  while (i < len) {
+    if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq
+      if (!elements[i] || elements[i] === true) {
+        this.buildItem(i);
+        this.addPendingElement(element);
+      } else {
+        hierarchy.push(elements[i]);
+        elements[i].setAsParent();
+        if (layers[i].parent !== undefined) {
+          this.buildElementParenting(element, layers[i].parent, hierarchy);
+        } else {
+          element.setHierarchy(hierarchy);
         }
+      }
     }
+    i += 1;
+  }
 };
 
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
+BaseRenderer.prototype.addPendingElement = function (element) {
+  this.pendingElements.push(element);
 };
 
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
+BaseRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i]);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
     }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while (i < len) {
-        if (layers[i].ind == parentName) {
-            if (!elements[i] || elements[i] === true) {
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i].setAsParent();
-                if(layers[i].parent !== undefined) {
-                    this.buildElementParenting(element, layers[i].parent, hierarchy);
-                } else {
-                    element.setHierarchy(hierarchy);
-                }
-            }
-        }
-        i += 1;
-    }
+  }
 };
 
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
+BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
+  this.globalData.fontManager = new FontManager();
+  this.globalData.fontManager.addChars(animData.chars);
+  this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
+  this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+  this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
+  this.globalData.imageLoader = this.animationItem.imagePreloader;
+  this.globalData.audioController = this.animationItem.audioController;
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
 };
 
-BaseRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i]);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
+/* global createElementID, extendPrototype, BaseRenderer, NullElement, SVGShapeElement, SVGTextLottieElement,
+IImageElement, SVGCompElement, ISolidElement, createNS, locationHref, createSizedArray, expressionsPlugin */
 
-BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.imageLoader = this.animationItem.imagePreloader;
-    this.globalData.audioController = this.animationItem.audioController;
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-}
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.svgElement = createNS('svg');
-    var ariaLabel = '';
-    if (config && config.title) {
-        var titleElement = createNS('title');
-        var titleId = createElementID();
-        titleElement.setAttribute('id', titleId);
-        titleElement.textContent = config.title;
-        this.svgElement.appendChild(titleElement);
-        ariaLabel += titleId;
-    }
-    if (config && config.description) {
-        var descElement = createNS('desc');
-        var descId = createElementID();
-        descElement.setAttribute('id', descId);
-        descElement.textContent = config.description;
-        this.svgElement.appendChild(descElement);
-        ariaLabel += ' ' + descId;
-    }
-    if (ariaLabel) {
-        this.svgElement.setAttribute('aria-labelledby', ariaLabel)
-    }
-    var defs = createNS( 'defs');
-    this.svgElement.appendChild(defs);
-    var maskElement = createNS('g');
-    this.svgElement.appendChild(maskElement);
-    this.layerElement = maskElement;
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        viewBoxOnly: (config && config.viewBoxOnly) || false,
-        viewBoxSize: (config && config.viewBoxSize) || false,
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-        focusable: config && config.focusable,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '100%',
-            height: config && config.filterSize && config.filterSize.height || '100%',
-            x: config && config.filterSize && config.filterSize.x || '0%',
-            y: config && config.filterSize && config.filterSize.y || '0%',
-        }
-    };
+function SVGRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.svgElement = createNS('svg');
+  var ariaLabel = '';
+  if (config && config.title) {
+    var titleElement = createNS('title');
+    var titleId = createElementID();
+    titleElement.setAttribute('id', titleId);
+    titleElement.textContent = config.title;
+    this.svgElement.appendChild(titleElement);
+    ariaLabel += titleId;
+  }
+  if (config && config.description) {
+    var descElement = createNS('desc');
+    var descId = createElementID();
+    descElement.setAttribute('id', descId);
+    descElement.textContent = config.description;
+    this.svgElement.appendChild(descElement);
+    ariaLabel += ' ' + descId;
+  }
+  if (ariaLabel) {
+    this.svgElement.setAttribute('aria-labelledby', ariaLabel);
+  }
+  var defs = createNS('defs');
+  this.svgElement.appendChild(defs);
+  var maskElement = createNS('g');
+  this.svgElement.appendChild(maskElement);
+  this.layerElement = maskElement;
+  this.renderConfig = {
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    hideOnTransparent: !((config && config.hideOnTransparent === false)),
+    viewBoxOnly: (config && config.viewBoxOnly) || false,
+    viewBoxSize: (config && config.viewBoxSize) || false,
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+    focusable: config && config.focusable,
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '100%',
+      height: (config && config.filterSize && config.filterSize.height) || '100%',
+      x: (config && config.filterSize && config.filterSize.x) || '0%',
+      y: (config && config.filterSize && config.filterSize.y) || '0%',
+    },
+  };
 
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        defs: defs,
-        renderConfig: this.renderConfig
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-    this.rendererType = 'svg';
-
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    defs: defs,
+    renderConfig: this.renderConfig,
+  };
+  this.elements = [];
+  this.pendingElements = [];
+  this.destroyed = false;
+  this.rendererType = 'svg';
 }
 
-extendPrototype([BaseRenderer],SVGRenderer);
+extendPrototype([BaseRenderer], SVGRenderer);
 
 SVGRenderer.prototype.createNull = function (data) {
-    return new NullElement(data,this.globalData,this);
+  return new NullElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new SVGShapeElement(data,this.globalData,this);
+  return new SVGShapeElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data,this.globalData,this);
-
+  return new SVGTextLottieElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data,this.globalData,this);
+  return new IImageElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new SVGCompElement(data,this.globalData,this);
-
+  return new SVGCompElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data,this.globalData,this);
+  return new ISolidElement(data, this.globalData, this);
 };
 
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    if(this.renderConfig.viewBoxSize) {
-        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
-    } else {
-        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    }
+SVGRenderer.prototype.configAnimation = function (animData) {
+  this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+  if (this.renderConfig.viewBoxSize) {
+    this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
+  } else {
+    this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
+  }
 
-    if(!this.renderConfig.viewBoxOnly) {
-        this.svgElement.setAttribute('width',animData.w);
-        this.svgElement.setAttribute('height',animData.h);
-        this.svgElement.style.width = '100%';
-        this.svgElement.style.height = '100%';
-        this.svgElement.style.transform = 'translate3d(0,0,0)';
-    }
-    if (this.renderConfig.className) {
-        this.svgElement.setAttribute('class', this.renderConfig.className);
-    }
-    if (this.renderConfig.id) {
-        this.svgElement.setAttribute('id', this.renderConfig.id);
-    }
-    if (this.renderConfig.focusable !== undefined) {
-        this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
-    }
-    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.svgElement);
-    //Mask animation
-    var defs = this.globalData.defs;
+  if (!this.renderConfig.viewBoxOnly) {
+    this.svgElement.setAttribute('width', animData.w);
+    this.svgElement.setAttribute('height', animData.h);
+    this.svgElement.style.width = '100%';
+    this.svgElement.style.height = '100%';
+    this.svgElement.style.transform = 'translate3d(0,0,0)';
+  }
+  if (this.renderConfig.className) {
+    this.svgElement.setAttribute('class', this.renderConfig.className);
+  }
+  if (this.renderConfig.id) {
+    this.svgElement.setAttribute('id', this.renderConfig.id);
+  }
+  if (this.renderConfig.focusable !== undefined) {
+    this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
+  }
+  this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio);
+  // this.layerElement.style.transform = 'translate3d(0,0,0)';
+  // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
+  this.animationItem.wrapper.appendChild(this.svgElement);
+  // Mask animation
+  var defs = this.globalData.defs;
 
-    this.setupGlobalData(animData, defs);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.data = animData;
+  this.setupGlobalData(animData, defs);
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.data = animData;
 
-    var maskElement = createNS( 'clipPath');
-    var rect = createNS('rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = createElementID();
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+  var maskElement = createNS('clipPath');
+  var rect = createNS('rect');
+  rect.setAttribute('width', animData.w);
+  rect.setAttribute('height', animData.h);
+  rect.setAttribute('x', 0);
+  rect.setAttribute('y', 0);
+  var maskId = createElementID();
+  maskElement.setAttribute('id', maskId);
+  maskElement.appendChild(rect);
+  this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + maskId + ')');
 
-    defs.appendChild(maskElement);
-    this.layers = animData.layers;
-    this.elements = createSizedArray(animData.layers.length);
+  defs.appendChild(maskElement);
+  this.layers = animData.layers;
+  this.elements = createSizedArray(animData.layers.length);
 };
 
-
 SVGRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.layerElement = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 SVGRenderer.prototype.updateContainerSize = function () {
 };
 
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
+SVGRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  elements[pos] = true;
+  var element = this.createItem(this.layers[pos]);
 
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
+  elements[pos] = element;
+  if (expressionsPlugin) {
+    if (this.layers[pos].ty === 0) {
+      this.globalData.projectInterface.registerComposition(element);
     }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
+    element.initExpressions();
+  }
+  this.appendElementInPos(element, pos);
+  if (this.layers[pos].tt) {
+    if (!this.elements[pos - 1] || this.elements[pos - 1] === true) {
+      this.buildItem(pos - 1);
+      this.addPendingElement(element);
+    } else {
+      element.setMatte(elements[pos - 1].layerId);
     }
+  }
 };
 
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame === num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    // console.log('-------');
-    // console.log('FRAME ',num);
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    this.globalData._mdf = false;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    if(this.globalData._mdf) {
-        for (i = 0; i < len; i += 1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
+SVGRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+    if (element.data.tt) {
+      var i = 0;
+      var len = this.elements.length;
+      while (i < len) {
+        if (this.elements[i] === element) {
+          element.setMatte(this.elements[i - 1].layerId);
+          break;
         }
         i += 1;
+      }
     }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
+  }
+};
+
+SVGRenderer.prototype.renderFrame = function (num) {
+  if (this.renderedFrame === num || this.destroyed) {
+    return;
+  }
+  if (num === null) {
+    num = this.renderedFrame;
+  } else {
+    this.renderedFrame = num;
+  }
+  // console.log('-------');
+  // console.log('FRAME ',num);
+  this.globalData.frameNum = num;
+  this.globalData.frameId += 1;
+  this.globalData.projectInterface.currentFrame = num;
+  this.globalData._mdf = false;
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
+    }
+  }
+  if (this.globalData._mdf) {
+    for (i = 0; i < len; i += 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+  }
+};
+
+SVGRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newElement = element.getBaseElement();
+  if (!newElement) {
+    return;
+  }
+  var i = 0;
+  var nextElement;
+  while (i < pos) {
+    if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
+      nextElement = this.elements[i].getBaseElement();
+    }
+    i += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(newElement, nextElement);
+  } else {
+    this.layerElement.appendChild(newElement);
+  }
+};
+
+SVGRenderer.prototype.hide = function () {
+  this.layerElement.style.display = 'none';
+};
+
+SVGRenderer.prototype.show = function () {
+  this.layerElement.style.display = 'block';
+};
+
+/* global createSizedArray, createElementID, PropertyFactory, ShapePropertyFactory, createNS, locationHref */
+
+function MaskElement(data, element, globalData) {
+  this.data = data;
+  this.element = element;
+  this.globalData = globalData;
+  this.storedData = [];
+  this.masksProperties = this.data.masksProperties || [];
+  this.maskElement = null;
+  var defs = this.globalData.defs;
+  var i;
+  var len = this.masksProperties ? this.masksProperties.length : 0;
+  this.viewData = createSizedArray(len);
+  this.solidPath = '';
+
+  var path;
+  var properties = this.masksProperties;
+  var count = 0;
+  var currentMasks = [];
+  var j;
+  var jLen;
+  var layerId = createElementID();
+  var rect;
+  var expansor;
+  var feMorph;
+  var x;
+  var maskType = 'clipPath';
+  var maskRef = 'clip-path';
+  for (i = 0; i < len; i += 1) {
+    if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
+      maskType = 'mask';
+      maskRef = 'mask';
+    }
+
+    if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
+      rect = createNS('rect');
+      rect.setAttribute('fill', '#ffffff');
+      rect.setAttribute('width', this.element.comp.data.w || 0);
+      rect.setAttribute('height', this.element.comp.data.h || 0);
+      currentMasks.push(rect);
     } else {
-        this.layerElement.appendChild(newElement);
-    }
-};
-
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
-};
-
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
-};
-
-function MaskElement(data,element,globalData) {
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties || [];
-    this.maskElement = null;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties ? this.masksProperties.length : 0;
-    this.viewData = createSizedArray(len);
-    this.solidPath = '';
-
-
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = createElementID();
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
-            rect = createNS( 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w || 0);
-            rect.setAttribute('height', this.element.comp.data.h || 0);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = createNS( 'path');
-        if(properties[i].mode == 'n') {
-            // TODO move this to a factory or to a constructor
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-                elem: path,
-                lastPath: ''
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
-        path.setAttribute('clip-rule','nonzero');
-        var filterID;
-
-        if (properties[i].x.k !== 0) {
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
-            filterID = createElementID();
-            expansor = createNS('filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = createNS('feMorphology');
-            feMorph.setAttribute('operator','erode');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
-        } else {
-            feMorph = null;
-            x = null;
-        }
-
-        // TODO move this to a factory or to a constructor
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = createNS('g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = createNS('mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        // TODO move this to a factory or to a constructor
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-            invRect: rect
-        };
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
+      rect = null;
     }
 
-    this.maskElement = createNS( maskType);
+    path = createNS('path');
+    if (properties[i].mode === 'n') {
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        elem: path,
+        lastPath: '',
+      };
+      defs.appendChild(path);
+    } else {
+      count += 1;
 
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
-    }
+      path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      path.setAttribute('clip-rule', 'nonzero');
+      var filterID;
 
-    if(count > 0){
-        this.maskElement.setAttribute('id', layerId);
-        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
-        defs.appendChild(this.maskElement);
-    }
-    if (this.viewData.length) {
-        this.element.addRenderableComponent(this);
-    }
+      if (properties[i].x.k !== 0) {
+        maskType = 'mask';
+        maskRef = 'mask';
+        x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
+        filterID = createElementID();
+        expansor = createNS('filter');
+        expansor.setAttribute('id', filterID);
+        feMorph = createNS('feMorphology');
+        feMorph.setAttribute('operator', 'erode');
+        feMorph.setAttribute('in', 'SourceGraphic');
+        feMorph.setAttribute('radius', '0');
+        expansor.appendChild(feMorph);
+        defs.appendChild(expansor);
+        path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      } else {
+        feMorph = null;
+        x = null;
+      }
 
+      // TODO move this to a factory or to a constructor
+      this.storedData[i] = {
+        elem: path,
+        x: x,
+        expan: feMorph,
+        lastPath: '',
+        lastOperator: '',
+        filterId: filterID,
+        lastRadius: 0,
+      };
+      if (properties[i].mode === 'i') {
+        jLen = currentMasks.length;
+        var g = createNS('g');
+        for (j = 0; j < jLen; j += 1) {
+          g.appendChild(currentMasks[j]);
+        }
+        var mask = createNS('mask');
+        mask.setAttribute('mask-type', 'alpha');
+        mask.setAttribute('id', layerId + '_' + count);
+        mask.appendChild(path);
+        defs.appendChild(mask);
+        g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
+
+        currentMasks.length = 0;
+        currentMasks.push(g);
+      } else {
+        currentMasks.push(path);
+      }
+      if (properties[i].inv && !this.solidPath) {
+        this.solidPath = this.createLayerSolidPath();
+      }
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        elem: path,
+        lastPath: '',
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        invRect: rect,
+      };
+      if (!this.viewData[i].prop.k) {
+        this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
+      }
+    }
+  }
+
+  this.maskElement = createNS(maskType);
+
+  len = currentMasks.length;
+  for (i = 0; i < len; i += 1) {
+    this.maskElement.appendChild(currentMasks[i]);
+  }
+
+  if (count > 0) {
+    this.maskElement.setAttribute('id', layerId);
+    this.element.maskedElement.setAttribute(maskRef, 'url(' + locationHref + '#' + layerId + ')');
+    defs.appendChild(this.maskElement);
+  }
+  if (this.viewData.length) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
+MaskElement.prototype.getMaskProperty = function (pos) {
+  return this.viewData[pos].prop;
 };
 
 MaskElement.prototype.renderFrame = function (isFirstFrame) {
-    var finalMat = this.element.finalTransform.mat;
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop._mdf || isFirstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op._mdf || isFirstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
-                this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
-            }
-            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
+  var finalMat = this.element.finalTransform.mat;
+  var i;
+  var len = this.masksProperties.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.viewData[i].prop._mdf || isFirstFrame) {
+      this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
     }
+    if (this.viewData[i].op._mdf || isFirstFrame) {
+      this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
+    }
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
+        this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
+      }
+      if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
+        var feMorph = this.storedData[i].expan;
+        if (this.storedData[i].x.v < 0) {
+          if (this.storedData[i].lastOperator !== 'erode') {
+            this.storedData[i].lastOperator = 'erode';
+            this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
+          }
+          feMorph.setAttribute('radius', -this.storedData[i].x.v);
+        } else {
+          if (this.storedData[i].lastOperator !== 'dilate') {
+            this.storedData[i].lastOperator = 'dilate';
+            this.storedData[i].elem.setAttribute('filter', null);
+          }
+          this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
+        }
+      }
+    }
+  }
 };
 
 MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
+  return this.maskElement;
 };
 
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
+MaskElement.prototype.createLayerSolidPath = function () {
+  var path = 'M0,0 ';
+  path += ' h' + this.globalData.compSize.w;
+  path += ' v' + this.globalData.compSize.h;
+  path += ' h-' + this.globalData.compSize.w;
+  path += ' v-' + this.globalData.compSize.h + ' ';
+  return path;
 };
 
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //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];
-        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];
-    }
-        //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];
-    if(pathNodes.c && len > 1){
-        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];
-    }
-    //pathNodes.__renderedString = pathString;
+MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
+  var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
+  var i;
+  var len;
+  len = pathNodes._length;
+  for (i = 1; i < len; i += 1) {
+    // 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];
+    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];
+  }
+  // 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];
+  if (pathNodes.c && len > 1) {
+    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];
+  }
+  // pathNodes.__renderedString = pathString;
 
-    if(viewData.lastPath !== pathString){
-        var pathShapeValue = '';
-        if(viewData.elem){
-            if(pathNodes.c){
-                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
-            }
-            viewData.elem.setAttribute('d',pathShapeValue);
-        }
-        viewData.lastPath = pathString;
+  if (viewData.lastPath !== pathString) {
+    var pathShapeValue = '';
+    if (viewData.elem) {
+      if (pathNodes.c) {
+        pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
+      }
+      viewData.elem.setAttribute('d', pathShapeValue);
     }
+    viewData.lastPath = pathString;
+  }
 };
 
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.masksProperties = null;
+MaskElement.prototype.destroy = function () {
+  this.element = null;
+  this.globalData = null;
+  this.maskElement = null;
+  this.data = null;
+  this.masksProperties = null;
 };
 
 /**
- * @file 
+ * @file
  * Handles AE's layer parenting property.
  *
  */
 
-function HierarchyElement(){}
+function HierarchyElement() {}
 
 HierarchyElement.prototype = {
-	/**
-     * @function 
+  /**
+     * @function
      * Initializes hierarchy properties
      *
      */
-	initHierarchy: function() {
-		//element's parent list
-	    this.hierarchy = [];
-	    //if element is parent of another layer _isParent will be true
-	    this._isParent = false;
-	    this.checkParenting();
-	},
-	/**
-     * @function 
+  initHierarchy: function () {
+    // element's parent list
+    this.hierarchy = [];
+    // if element is parent of another layer _isParent will be true
+    this._isParent = false;
+    this.checkParenting();
+  },
+  /**
+     * @function
      * Sets layer's hierarchy.
      * @param {array} hierarch
      * layer's parent list
      *
-     */ 
-	setHierarchy: function(hierarchy){
-	    this.hierarchy = hierarchy;
-	},
-	/**
-     * @function 
+     */
+  setHierarchy: function (hierarchy) {
+    this.hierarchy = hierarchy;
+  },
+  /**
+     * @function
      * Sets layer as parent.
      *
-     */ 
-	setAsParent: function() {
-	    this._isParent = true;
-	},
-	/**
-     * @function 
+     */
+  setAsParent: function () {
+    this._isParent = true;
+  },
+  /**
+     * @function
      * Searches layer's parenting chain
      *
-     */ 
-	checkParenting: function(){
-	    if (this.data.parent !== undefined){
-	        this.comp.buildElementParenting(this, this.data.parent, []);
-	    }
-	}
+     */
+  checkParenting: function () {
+    if (this.data.parent !== undefined) {
+      this.comp.buildElementParenting(this, this.data.parent, []);
+    }
+  },
 };
+
 /**
- * @file 
+ * @file
  * Handles element's layer frame update.
  * Checks layer in point and out point
  *
  */
 
-function FrameElement(){}
+function FrameElement() {}
 
 FrameElement.prototype = {
-    /**
-     * @function 
+  /**
+     * @function
      * Initializes frame related properties.
      *
      */
-    initFrame: function(){
-        //set to true when inpoint is rendered
-        this._isFirstFrame = false;
-        //list of animated properties
-        this.dynamicProperties = [];
-        // If layer has been modified in current tick this will be true
-        this._mdf = false;
-    },
-    /**
-     * @function 
+  initFrame: function () {
+    // set to true when inpoint is rendered
+    this._isFirstFrame = false;
+    // list of animated properties
+    this.dynamicProperties = [];
+    // If layer has been modified in current tick this will be true
+    this._mdf = false;
+  },
+  /**
+     * @function
      * Calculates all dynamic values
      *
      * @param {number} num
      * current frame number in Layer's time
      * @param {boolean} isVisible
      * if layers is currently in range
-     * 
+     *
      */
-    prepareProperties: function(num, isVisible) {
-        var i, len = this.dynamicProperties.length;
-        for (i = 0;i < len; i += 1) {
-            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i]._mdf) {
-                    this.globalData._mdf = true;
-                    this._mdf = true;
-                }
-            }
+  prepareProperties: function (num, isVisible) {
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+        this.dynamicProperties[i].getValue();
+        if (this.dynamicProperties[i]._mdf) {
+          this.globalData._mdf = true;
+          this._mdf = true;
         }
-    },
-    addDynamicProperty: function(prop) {
-        if(this.dynamicProperties.indexOf(prop) === -1) {
-            this.dynamicProperties.push(prop);
-        }
+      }
     }
+  },
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+    }
+  },
 };
-function TransformElement(){}
+
+/* global TransformPropertyFactory, Matrix */
+
+function TransformElement() {}
 
 TransformElement.prototype = {
-    initTransform: function() {
-        this.finalTransform = {
-            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
-            _matMdf: false,
-            _opMdf: false,
-            mat: new Matrix()
-        };
-        if (this.data.ao) {
-            this.finalTransform.mProp.autoOriented = true;
-        }
+  initTransform: function () {
+    this.finalTransform = {
+      mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 },
+      _matMdf: false,
+      _opMdf: false,
+      mat: new Matrix(),
+    };
+    if (this.data.ao) {
+      this.finalTransform.mProp.autoOriented = true;
+    }
 
-        //TODO: check TYPE 11: Guided elements
-        if (this.data.ty !== 11) {
-            //this.createElements();
-        }
-    },
-    renderTransform: function() {
+    // TODO: check TYPE 11: Guided elements
+    if (this.data.ty !== 11) {
+      // this.createElements();
+    }
+  },
+  renderTransform: function () {
+    this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+    this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
 
-        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
-        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+    if (this.hierarchy) {
+      var mat;
+      var finalMat = this.finalTransform.mat;
+      var i = 0;
+      var len = this.hierarchy.length;
+      // Checking if any of the transformation matrices in the hierarchy chain has changed.
+      if (!this.finalTransform._matMdf) {
+        while (i < len) {
+          if (this.hierarchy[i].finalTransform.mProp._mdf) {
+            this.finalTransform._matMdf = true;
+            break;
+          }
+          i += 1;
+        }
+      }
 
-        if (this.hierarchy) {
-            var mat;
-            var finalMat = this.finalTransform.mat;
-            var i = 0, len = this.hierarchy.length;
-            //Checking if any of the transformation matrices in the hierarchy chain has changed.
-            if (!this.finalTransform._matMdf) {
-                while (i < len) {
-                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
-                        this.finalTransform._matMdf = true;
-                        break;
-                    }
-                    i += 1;
-                }
-            }
-            
-            if (this.finalTransform._matMdf) {
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-                for (i = 0; i < len; i += 1) {
-                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                    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]);
-                }
-            }
-        }
-    },
-    globalToLocal: function(pt) {
-        var transforms = [];
-        transforms.push(this.finalTransform);
-        var flag = true;
-        var comp = this.comp;
-        while (flag) {
-            if (comp.finalTransform) {
-                if (comp.data.hasMask) {
-                    transforms.splice(0, 0, comp.finalTransform);
-                }
-                comp = comp.comp;
-            } else {
-                flag = false;
-            }
-        }
-        var i, len = transforms.length,ptNew;
+      if (this.finalTransform._matMdf) {
+        mat = this.finalTransform.mProp.v.props;
+        finalMat.cloneFromProps(mat);
         for (i = 0; i < len; i += 1) {
-            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
-            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+          mat = this.hierarchy[i].finalTransform.mProp.v.props;
+          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]);
         }
-        return pt;
-    },
-    mHelper: new Matrix()
+      }
+    }
+  },
+  globalToLocal: function (pt) {
+    var transforms = [];
+    transforms.push(this.finalTransform);
+    var flag = true;
+    var comp = this.comp;
+    while (flag) {
+      if (comp.finalTransform) {
+        if (comp.data.hasMask) {
+          transforms.splice(0, 0, comp.finalTransform);
+        }
+        comp = comp.comp;
+      } else {
+        flag = false;
+      }
+    }
+    var i;
+    var len = transforms.length;
+    var ptNew;
+    for (i = 0; i < len; i += 1) {
+      ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+      // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+      pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+    }
+    return pt;
+  },
+  mHelper: new Matrix(),
 };
-function RenderableElement(){
+
+function RenderableElement() {
 
 }
 
 RenderableElement.prototype = {
-    initRenderable: function() {
-        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
-        this.isInRange = false;
-        //layer's display state
-        this.hidden = false;
-        // If layer's transparency equals 0, it can be hidden
-        this.isTransparent = false;
-        //list of animated components
-        this.renderableComponents = [];
-    },
-    addRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) === -1) {
-            this.renderableComponents.push(component);
-        }
-    },
-    removeRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) !== -1) {
-            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
-        }
-    },
-    prepareRenderableFrame: function(num) {
-        this.checkLayerLimits(num);
-    },
-    checkTransparency: function(){
-        if(this.finalTransform.mProp.o.v <= 0) {
-            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
-                this.isTransparent = true;
-                this.hide();
-            }
-        } else if(this.isTransparent) {
-            this.isTransparent = false;
-            this.show();
-        }
-    },
-    /**
-     * @function 
+  initRenderable: function () {
+    // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+    this.isInRange = false;
+    // layer's display state
+    this.hidden = false;
+    // If layer's transparency equals 0, it can be hidden
+    this.isTransparent = false;
+    // list of animated components
+    this.renderableComponents = [];
+  },
+  addRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) === -1) {
+      this.renderableComponents.push(component);
+    }
+  },
+  removeRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) !== -1) {
+      this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+    }
+  },
+  prepareRenderableFrame: function (num) {
+    this.checkLayerLimits(num);
+  },
+  checkTransparency: function () {
+    if (this.finalTransform.mProp.o.v <= 0) {
+      if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
+        this.isTransparent = true;
+        this.hide();
+      }
+    } else if (this.isTransparent) {
+      this.isTransparent = false;
+      this.show();
+    }
+  },
+  /**
+     * @function
      * Initializes frame related properties.
      *
      * @param {number} num
      * current frame number in Layer's time
-     * 
+     *
      */
-    checkLayerLimits: function(num) {
-        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-        {
-            if(this.isInRange !== true){
-                this.globalData._mdf = true;
-                this._mdf = true;
-                this.isInRange = true;
-                this.show();
-            }
-        } else {
-            if(this.isInRange !== false){
-                this.globalData._mdf = true;
-                this.isInRange = false;
-                this.hide();
-            }
-        }
-    },
-    renderRenderable: function() {
-        var i, len = this.renderableComponents.length;
-        for(i = 0; i < len; i += 1) {
-            this.renderableComponents[i].renderFrame(this._isFirstFrame);
-        }
-        /*this.maskManager.renderFrame(this.finalTransform.mat);
-        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
-    },
-    sourceRectAtTime: function(){
-        return {
-            top:0,
-            left:0,
-            width:100,
-            height:100
-        };
-    },
-    getLayerSize: function(){
-        if(this.data.ty === 5){
-            return {w:this.data.textData.width,h:this.data.textData.height};
-        }else{
-            return {w:this.data.width,h:this.data.height};
-        }
+  checkLayerLimits: function (num) {
+    if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
+      if (this.isInRange !== true) {
+        this.globalData._mdf = true;
+        this._mdf = true;
+        this.isInRange = true;
+        this.show();
+      }
+    } else if (this.isInRange !== false) {
+      this.globalData._mdf = true;
+      this.isInRange = false;
+      this.hide();
     }
+  },
+  renderRenderable: function () {
+    var i;
+    var len = this.renderableComponents.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderableComponents[i].renderFrame(this._isFirstFrame);
+    }
+    /* this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
+  },
+  sourceRectAtTime: function () {
+    return {
+      top: 0,
+      left: 0,
+      width: 100,
+      height: 100,
+    };
+  },
+  getLayerSize: function () {
+    if (this.data.ty === 5) {
+      return { w: this.data.textData.width, h: this.data.textData.height };
+    }
+    return { w: this.data.width, h: this.data.height };
+  },
 };
+
+/* global extendPrototype, RenderableElement, createProxyFunction */
+
 function RenderableDOMElement() {}
 
-(function(){
-    var _prototype = {
-        initElement: function(data,globalData,comp) {
-            this.initFrame();
-            this.initBaseData(data, globalData, comp);
-            this.initTransform(data, globalData, comp);
-            this.initHierarchy();
-            this.initRenderable();
-            this.initRendererElement();
-            this.createContainerElements();
-            this.createRenderableComponents();
-            this.createContent();
-            this.hide();
-        },
-        hide: function(){
-            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-                var elem = this.baseElement || this.layerElement;
-                elem.style.display = 'none';
-                this.hidden = true;
-            }
-        },
-        show: function(){
-            if (this.isInRange && !this.isTransparent){
-                if (!this.data.hd) {
-                    var elem = this.baseElement || this.layerElement;
-                    elem.style.display = 'block';
-                }
-                this.hidden = false;
-                this._isFirstFrame = true;
-            }
-        },
-        renderFrame: function() {
-            //If it is exported as hidden (data.hd === true) no need to render
-            //If it is not visible no need to render
-            if (this.data.hd || this.hidden) {
-                return;
-            }
-            this.renderTransform();
-            this.renderRenderable();
-            this.renderElement();
-            this.renderInnerContent();
-            if (this._isFirstFrame) {
-                this._isFirstFrame = false;
-            }
-        },
-        renderInnerContent: function() {},
-        prepareFrame: function(num) {
-            this._mdf = false;
-            this.prepareRenderableFrame(num);
-            this.prepareProperties(num, this.isInRange);
-            this.checkTransparency();
-        },
-        destroy: function(){
-            this.innerElem =  null;
-            this.destroyBaseElement();
+(function () {
+  var _prototype = {
+    initElement: function (data, globalData, comp) {
+      this.initFrame();
+      this.initBaseData(data, globalData, comp);
+      this.initTransform(data, globalData, comp);
+      this.initHierarchy();
+      this.initRenderable();
+      this.initRendererElement();
+      this.createContainerElements();
+      this.createRenderableComponents();
+      this.createContent();
+      this.hide();
+    },
+    hide: function () {
+      if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+        var elem = this.baseElement || this.layerElement;
+        elem.style.display = 'none';
+        this.hidden = true;
+      }
+    },
+    show: function () {
+      if (this.isInRange && !this.isTransparent) {
+        if (!this.data.hd) {
+          var elem = this.baseElement || this.layerElement;
+          elem.style.display = 'block';
         }
-    };
-    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+        this.hidden = false;
+        this._isFirstFrame = true;
+      }
+    },
+    renderFrame: function () {
+      // If it is exported as hidden (data.hd === true) no need to render
+      // If it is not visible no need to render
+      if (this.data.hd || this.hidden) {
+        return;
+      }
+      this.renderTransform();
+      this.renderRenderable();
+      this.renderElement();
+      this.renderInnerContent();
+      if (this._isFirstFrame) {
+        this._isFirstFrame = false;
+      }
+    },
+    renderInnerContent: function () {},
+    prepareFrame: function (num) {
+      this._mdf = false;
+      this.prepareRenderableFrame(num);
+      this.prepareProperties(num, this.isInRange);
+      this.checkTransparency();
+    },
+    destroy: function () {
+      this.innerElem = null;
+      this.destroyBaseElement();
+    },
+  };
+  extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
 }());
+
+/* exported ProcessedElement */
+
 function ProcessedElement(element, position) {
-	this.elem = element;
-	this.pos = position;
+  this.elem = element;
+  this.pos = position;
 }
+
+/* global createNS */
+
 function SVGStyleData(data, level) {
-	this.data = data;
-	this.type = data.ty;
-	this.d = '';
-	this.lvl = level;
-	this._mdf = false;
-	this.closed = data.hd === true;
-	this.pElem = createNS('path');
-	this.msElem = null;
+  this.data = data;
+  this.type = data.ty;
+  this.d = '';
+  this.lvl = level;
+  this._mdf = false;
+  this.closed = data.hd === true;
+  this.pElem = createNS('path');
+  this.msElem = null;
 }
 
-SVGStyleData.prototype.reset = function() {
-	this.d = '';
-	this._mdf = false;
+SVGStyleData.prototype.reset = function () {
+  this.d = '';
+  this._mdf = false;
 };
+
 function SVGShapeData(transformers, level, shape) {
-    this.caches = [];
-    this.styles = [];
-    this.transformers = transformers;
-    this.lStr = '';
-    this.sh = shape;
-    this.lvl = level;
-    //TODO find if there are some cases where _isAnimated can be false. 
-    // For now, since shapes add up with other shapes. They have to be calculated every time.
-    // One way of finding out is checking if all styles associated to this shape depend only of this shape
-    this._isAnimated = !!shape.k;
-    // TODO: commenting this for now since all shapes are animated
-    var i = 0, len = transformers.length;
-    while(i < len) {
-    	if(transformers[i].mProps.dynamicProperties.length) {
-    		this._isAnimated = true;
-    		break;
-    	}
-    	i += 1;
+  this.caches = [];
+  this.styles = [];
+  this.transformers = transformers;
+  this.lStr = '';
+  this.sh = shape;
+  this.lvl = level;
+  // TODO find if there are some cases where _isAnimated can be false.
+  // For now, since shapes add up with other shapes. They have to be calculated every time.
+  // One way of finding out is checking if all styles associated to this shape depend only of this shape
+  this._isAnimated = !!shape.k;
+  // TODO: commenting this for now since all shapes are animated
+  var i = 0;
+  var len = transformers.length;
+  while (i < len) {
+    if (transformers[i].mProps.dynamicProperties.length) {
+      this._isAnimated = true;
+      break;
     }
+    i += 1;
+  }
 }
 
-SVGShapeData.prototype.setAsAnimated = function() {
-    this._isAnimated = true;
-}
+SVGShapeData.prototype.setAsAnimated = function () {
+  this._isAnimated = true;
+};
+
+/* exported SVGTransformData */
+
 function SVGTransformData(mProps, op, container) {
-	this.transform = {
-		mProps: mProps,
-		op: op,
-		container: container
-	};
-	this.elements = [];
-    this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
+  this.transform = {
+    mProps: mProps,
+    op: op,
+    container: container,
+  };
+  this.elements = [];
+  this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
 }
-function SVGStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
-    this._isAnimated = !!this._isAnimated;
+
+/* global DashProperty, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
-function SVGFillStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
+
+/* global PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
-function SVGGradientFillStyleData(elem, data, styleOb){
-    this.initDynamicPropertyContainer(elem);
-    this.getValue = this.iterateDynamicProperties;
-    this.initGradientData(elem, data, styleOb);
+
+/* global PropertyFactory, degToRads, GradientProperty, createElementID, createNS, locationHref,
+extendPrototype, DynamicPropertyContainer */
+
+function SVGGradientFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.initGradientData(elem, data, styleOb);
 }
 
-SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){
-    this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-    this.s = PropertyFactory.getProp(elem,data.s,1,null,this);
-    this.e = PropertyFactory.getProp(elem,data.e,1,null,this);
-    this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this);
-    this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this);
-    this.g = new GradientProperty(elem,data.g,this);
-    this.style = styleOb;
-    this.stops = [];
-    this.setGradientData(styleOb.pElem, data);
-    this.setGradientOpacity(data, styleOb);
-    this._isAnimated = !!this._isAnimated;
-
+SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) {
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.s = PropertyFactory.getProp(elem, data.s, 1, null, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 1, null, this);
+  this.h = PropertyFactory.getProp(elem, data.h || { k: 0 }, 0, 0.01, this);
+  this.a = PropertyFactory.getProp(elem, data.a || { k: 0 }, 0, degToRads, this);
+  this.g = new GradientProperty(elem, data.g, this);
+  this.style = styleOb;
+  this.stops = [];
+  this.setGradientData(styleOb.pElem, data);
+  this.setGradientOpacity(data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 };
 
-SVGGradientFillStyleData.prototype.setGradientData = function(pathElement,data){
+SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) {
+  var gradientId = createElementID();
+  var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+  gfill.setAttribute('id', gradientId);
+  gfill.setAttribute('spreadMethod', 'pad');
+  gfill.setAttribute('gradientUnits', 'userSpaceOnUse');
+  var stops = [];
+  var stop;
+  var j;
+  var jLen;
+  jLen = data.g.p * 4;
+  for (j = 0; j < jLen; j += 4) {
+    stop = createNS('stop');
+    gfill.appendChild(stop);
+    stops.push(stop);
+  }
+  pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + gradientId + ')');
 
-    var gradientId = createElementID();
-    var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-    gfill.setAttribute('id',gradientId);
-    gfill.setAttribute('spreadMethod','pad');
-    gfill.setAttribute('gradientUnits','userSpaceOnUse');
-    var stops = [];
-    var stop, j, jLen;
-    jLen = data.g.p*4;
-    for(j=0;j<jLen;j+=4){
-        stop = createNS('stop');
-        gfill.appendChild(stop);
-        stops.push(stop);
-    }
-    pathElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+gradientId+')');
-    
-    this.gf = gfill;
-    this.cst = stops;
+  this.gf = gfill;
+  this.cst = stops;
 };
 
-SVGGradientFillStyleData.prototype.setGradientOpacity = function(data, styleOb){
-    if(this.g._hasOpacity && !this.g._collapsable){
-        var stop, j, jLen;
-        var mask = createNS("mask");
-        var maskElement = createNS( 'path');
-        mask.appendChild(maskElement);
-        var opacityId = createElementID();
-        var maskId = createElementID();
-        mask.setAttribute('id',maskId);
-        var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-        opFill.setAttribute('id',opacityId);
-        opFill.setAttribute('spreadMethod','pad');
-        opFill.setAttribute('gradientUnits','userSpaceOnUse');
-        jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
-        var stops = this.stops;
-        for(j=data.g.p*4;j<jLen;j+=2){
-            stop = createNS('stop');
-            stop.setAttribute('stop-color','rgb(255,255,255)');
-            opFill.appendChild(stop);
-            stops.push(stop);
-        }
-        maskElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+opacityId+')');
-        this.of = opFill;
-        this.ms = mask;
-        this.ost = stops;
-        this.maskId = maskId;
-        styleOb.msElem = maskElement;
+SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) {
+  if (this.g._hasOpacity && !this.g._collapsable) {
+    var stop;
+    var j;
+    var jLen;
+    var mask = createNS('mask');
+    var maskElement = createNS('path');
+    mask.appendChild(maskElement);
+    var opacityId = createElementID();
+    var maskId = createElementID();
+    mask.setAttribute('id', maskId);
+    var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+    opFill.setAttribute('id', opacityId);
+    opFill.setAttribute('spreadMethod', 'pad');
+    opFill.setAttribute('gradientUnits', 'userSpaceOnUse');
+    jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
+    var stops = this.stops;
+    for (j = data.g.p * 4; j < jLen; j += 2) {
+      stop = createNS('stop');
+      stop.setAttribute('stop-color', 'rgb(255,255,255)');
+      opFill.appendChild(stop);
+      stops.push(stop);
     }
+    maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + opacityId + ')');
+    this.of = opFill;
+    this.ms = mask;
+    this.ost = stops;
+    this.maskId = maskId;
+    styleOb.msElem = maskElement;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
-function SVGGradientStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-    this.initGradientData(elem, data, styleOb);
-    this._isAnimated = !!this._isAnimated;
+
+/* global PropertyFactory, DashProperty, extendPrototype, SVGGradientFillStyleData, DynamicPropertyContainer */
+
+function SVGGradientStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.initGradientData(elem, data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
+
+/* global createNS */
+/* exported ShapeGroupData */
+
 function ShapeGroupData() {
-	this.it = [];
-    this.prevViewData = [];
-    this.gr = createNS('g');
+  this.it = [];
+  this.prevViewData = [];
+  this.gr = createNS('g');
 }
-var SVGElementsRenderer = (function() {
-	var _identityMatrix = new Matrix();
-	var _matrixHelper = new Matrix();
 
-	var ob = {
-		createRenderFunction: createRenderFunction
-	}
+/* global Matrix, buildShapeString, bmFloor */
+/* exported SVGElementsRenderer */
 
-	function createRenderFunction(data) {
-	    var ty = data.ty;
-	    switch(data.ty) {
-	        case 'fl':
-	        return renderFill;
-	        case 'gf':
-	        return renderGradient;
-	        case 'gs':
-	        return renderGradientStroke;
-	        case 'st':
-	        return renderStroke;
-	        case 'sh':
-	        case 'el':
-	        case 'rc':
-	        case 'sr':
-	        return renderPath;
-	        case 'tr':
-	        return renderContentTransform;
-	    }
-	}
+var SVGElementsRenderer = (function () {
+  var _identityMatrix = new Matrix();
+  var _matrixHelper = new Matrix();
 
-	function renderContentTransform(styleData, itemData, isFirstFrame) {
-	    if(isFirstFrame || itemData.transform.op._mdf){
-	        itemData.transform.container.setAttribute('opacity',itemData.transform.op.v);
-	    }
-	    if(isFirstFrame || itemData.transform.mProps._mdf){
-	        itemData.transform.container.setAttribute('transform',itemData.transform.mProps.v.to2dCSS());
-	    }
-	}
+  var ob = {
+    createRenderFunction: createRenderFunction,
+  };
 
-	function renderPath(styleData, itemData, isFirstFrame) {
-	    var j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = itemData.styles.length;
-	    var lvl = itemData.lvl;
-	    var paths, mat, props, iterations, k;
-	    for(l=0;l<lLen;l+=1){
-	        redraw = itemData.sh._mdf || isFirstFrame;
-	        if(itemData.styles[l].lvl < lvl){
-	            mat = _matrixHelper.reset();
-	            iterations = lvl - itemData.styles[l].lvl;
-	            k = itemData.transformers.length-1;
-	            while(!redraw && iterations > 0) {
-	                redraw = itemData.transformers[k].mProps._mdf || redraw;
-	                iterations --;
-	                k --;
-	            }
-	            if(redraw) {
-	                iterations = lvl - itemData.styles[l].lvl;
-	                k = itemData.transformers.length-1;
-	                while(iterations > 0) {
-	                    props = itemData.transformers[k].mProps.v.props;
-	                    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]);
-	                    iterations --;
-	                    k --;
-	                }
-	            }
-	        } else {
-	            mat = _identityMatrix;
-	        }
-	        paths = itemData.sh.paths;
-	        jLen = paths._length;
-	        if(redraw){
-	            pathStringTransformed = '';
-	            for(j=0;j<jLen;j+=1){
-	                pathNodes = paths.shapes[j];
-	                if(pathNodes && pathNodes._length){
-	                    pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
-	                }
-	            }
-	            itemData.caches[l] = pathStringTransformed;
-	        } else {
-	            pathStringTransformed = itemData.caches[l];
-	        }
-	        itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
-	        itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
-	    }
-	}
+  function createRenderFunction(data) {
+    switch (data.ty) {
+      case 'fl':
+        return renderFill;
+      case 'gf':
+        return renderGradient;
+      case 'gs':
+        return renderGradientStroke;
+      case 'st':
+        return renderStroke;
+      case 'sh':
+      case 'el':
+      case 'rc':
+      case 'sr':
+        return renderPath;
+      case 'tr':
+        return renderContentTransform;
+      default:
+        return null;
+    }
+  }
 
-	function renderFill (styleData,itemData, isFirstFrame){
-	    var styleElem = itemData.style;
+  function renderContentTransform(styleData, itemData, isFirstFrame) {
+    if (isFirstFrame || itemData.transform.op._mdf) {
+      itemData.transform.container.setAttribute('opacity', itemData.transform.op.v);
+    }
+    if (isFirstFrame || itemData.transform.mProps._mdf) {
+      itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS());
+    }
+  }
 
-	    if(itemData.c._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill','rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill-opacity',itemData.o.v);
-	    }
-	};
+  function renderPath(styleData, itemData, isFirstFrame) {
+    var j;
+    var jLen;
+    var pathStringTransformed;
+    var redraw;
+    var pathNodes;
+    var l;
+    var lLen = itemData.styles.length;
+    var lvl = itemData.lvl;
+    var paths;
+    var mat;
+    var props;
+    var iterations;
+    var k;
+    for (l = 0; l < lLen; l += 1) {
+      redraw = itemData.sh._mdf || isFirstFrame;
+      if (itemData.styles[l].lvl < lvl) {
+        mat = _matrixHelper.reset();
+        iterations = lvl - itemData.styles[l].lvl;
+        k = itemData.transformers.length - 1;
+        while (!redraw && iterations > 0) {
+          redraw = itemData.transformers[k].mProps._mdf || redraw;
+          iterations -= 1;
+          k -= 1;
+        }
+        if (redraw) {
+          iterations = lvl - itemData.styles[l].lvl;
+          k = itemData.transformers.length - 1;
+          while (iterations > 0) {
+            props = itemData.transformers[k].mProps.v.props;
+            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]);
+            iterations -= 1;
+            k -= 1;
+          }
+        }
+      } else {
+        mat = _identityMatrix;
+      }
+      paths = itemData.sh.paths;
+      jLen = paths._length;
+      if (redraw) {
+        pathStringTransformed = '';
+        for (j = 0; j < jLen; j += 1) {
+          pathNodes = paths.shapes[j];
+          if (pathNodes && pathNodes._length) {
+            pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
+          }
+        }
+        itemData.caches[l] = pathStringTransformed;
+      } else {
+        pathStringTransformed = itemData.caches[l];
+      }
+      itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
+      itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
+    }
+  }
 
-	function renderGradientStroke (styleData, itemData, isFirstFrame) {
-	    renderGradient(styleData, itemData, isFirstFrame);
-	    renderStroke(styleData, itemData, isFirstFrame);
-	}
+  function renderFill(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
 
-	function renderGradient(styleData, itemData, isFirstFrame) {
-	    var gfill = itemData.gf;
-	    var hasOpacity = itemData.g._hasOpacity;
-	    var pt1 = itemData.s.v, pt2 = itemData.e.v;
+    if (itemData.c._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill-opacity', itemData.o.v);
+    }
+  }
 
-	    if (itemData.o._mdf || isFirstFrame) {
-	        var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
-	        itemData.style.pElem.setAttribute(attr, itemData.o.v);
-	    }
-	    if (itemData.s._mdf || isFirstFrame) {
-	        var attr1 = styleData.t === 1 ? 'x1' : 'cx';
-	        var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
-	        gfill.setAttribute(attr1, pt1[0]);
-	        gfill.setAttribute(attr2, pt1[1]);
-	        if (hasOpacity && !itemData.g._collapsable) {
-	            itemData.of.setAttribute(attr1, pt1[0]);
-	            itemData.of.setAttribute(attr2, pt1[1]);
-	        }
-	    }
-	    var stops, i, len, stop;
-	    if (itemData.g._cmdf || isFirstFrame) {
-	        stops = itemData.cst;
-	        var cValues = itemData.g.c;
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1){
-	            stop = stops[i];
-	            stop.setAttribute('offset', cValues[i * 4] + '%');
-	            stop.setAttribute('stop-color','rgb('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ')');
-	        }
-	    }
-	    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
-	        var oValues = itemData.g.o;
-	        if(itemData.g._collapsable) {
-	            stops = itemData.cst;
-	        } else {
-	            stops = itemData.ost;
-	        }
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1) {
-	            stop = stops[i];
-	            if(!itemData.g._collapsable) {
-	                stop.setAttribute('offset', oValues[i * 2] + '%');
-	            }
-	            stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
-	        }
-	    }
-	    if (styleData.t === 1) {
-	        if (itemData.e._mdf  || isFirstFrame) {
-	            gfill.setAttribute('x2', pt2[0]);
-	            gfill.setAttribute('y2', pt2[1]);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('x2', pt2[0]);
-	                itemData.of.setAttribute('y2', pt2[1]);
-	            }
-	        }
-	    } else {
-	        var rad;
-	        if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
-	            rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            gfill.setAttribute('r', rad);
-	            if(hasOpacity && !itemData.g._collapsable){
-	                itemData.of.setAttribute('r', rad);
-	            }
-	        }
-	        if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
-	            if (!rad) {
-	                rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            }
-	            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+  function renderGradientStroke(styleData, itemData, isFirstFrame) {
+    renderGradient(styleData, itemData, isFirstFrame);
+    renderStroke(styleData, itemData, isFirstFrame);
+  }
 
-	            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-	            var dist = rad * percent;
-	            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-	            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-	            gfill.setAttribute('fx', x);
-	            gfill.setAttribute('fy', y);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('fx', x);
-	                itemData.of.setAttribute('fy', y);
-	            }
-	        }
-	        //gfill.setAttribute('fy','200');
-	    }
-	};
+  function renderGradient(styleData, itemData, isFirstFrame) {
+    var gfill = itemData.gf;
+    var hasOpacity = itemData.g._hasOpacity;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
 
-	function renderStroke(styleData, itemData, isFirstFrame) {
-	    var styleElem = itemData.style;
-	    var d = itemData.d;
-	    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
-	        styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
-	        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
-	    }
-	    if(itemData.c && (itemData.c._mdf || isFirstFrame)){
-	        styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
-	    }
-	    if(itemData.w._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
-	        if(styleElem.msElem){
-	            styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
-	        }
-	    }
-	};
+    if (itemData.o._mdf || isFirstFrame) {
+      var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
+      itemData.style.pElem.setAttribute(attr, itemData.o.v);
+    }
+    if (itemData.s._mdf || isFirstFrame) {
+      var attr1 = styleData.t === 1 ? 'x1' : 'cx';
+      var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
+      gfill.setAttribute(attr1, pt1[0]);
+      gfill.setAttribute(attr2, pt1[1]);
+      if (hasOpacity && !itemData.g._collapsable) {
+        itemData.of.setAttribute(attr1, pt1[0]);
+        itemData.of.setAttribute(attr2, pt1[1]);
+      }
+    }
+    var stops;
+    var i;
+    var len;
+    var stop;
+    if (itemData.g._cmdf || isFirstFrame) {
+      stops = itemData.cst;
+      var cValues = itemData.g.c;
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        stop.setAttribute('offset', cValues[i * 4] + '%');
+        stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')');
+      }
+    }
+    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
+      var oValues = itemData.g.o;
+      if (itemData.g._collapsable) {
+        stops = itemData.cst;
+      } else {
+        stops = itemData.ost;
+      }
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        if (!itemData.g._collapsable) {
+          stop.setAttribute('offset', oValues[i * 2] + '%');
+        }
+        stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
+      }
+    }
+    if (styleData.t === 1) {
+      if (itemData.e._mdf || isFirstFrame) {
+        gfill.setAttribute('x2', pt2[0]);
+        gfill.setAttribute('y2', pt2[1]);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('x2', pt2[0]);
+          itemData.of.setAttribute('y2', pt2[1]);
+        }
+      }
+    } else {
+      var rad;
+      if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
+        rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        gfill.setAttribute('r', rad);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('r', rad);
+        }
+      }
+      if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
+        if (!rad) {
+          rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        }
+        var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
 
-	return ob;
-}())
+        var percent = itemData.h.v;
+        if (percent >= 1) {
+          percent = 0.99;
+        } else if (percent <= -1) {
+          percent = -0.99;
+        }
+        var dist = rad * percent;
+        var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+        var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+        gfill.setAttribute('fx', x);
+        gfill.setAttribute('fy', y);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('fx', x);
+          itemData.of.setAttribute('fy', y);
+        }
+      }
+      // gfill.setAttribute('fy','200');
+    }
+  }
+
+  function renderStroke(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
+    var d = itemData.d;
+    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
+      styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
+      styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
+    }
+    if (itemData.c && (itemData.c._mdf || isFirstFrame)) {
+      styleElem.pElem.setAttribute('stroke', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
+    }
+    if (itemData.w._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
+      if (styleElem.msElem) {
+        styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
+      }
+    }
+  }
+
+  return ob;
+}());
+
+/* global Matrix */
+
 function ShapeTransformManager() {
-	this.sequences = {};
-	this.sequenceList = [];
-    this.transform_key_count = 0;
+  this.sequences = {};
+  this.sequenceList = [];
+  this.transform_key_count = 0;
 }
 
 ShapeTransformManager.prototype = {
-	addTransformSequence: function(transforms) {
-		var i, len = transforms.length;
-		var key = '_';
-		for(i = 0; i < len; i += 1) {
-			key += transforms[i].transform.key + '_';
-		}
-		var sequence = this.sequences[key];
-		if(!sequence) {
-			sequence = {
-				transforms: [].concat(transforms),
-				finalTransform: new Matrix(),
-				_mdf: false
-			};
-			this.sequences[key] = sequence;
-			this.sequenceList.push(sequence);
-		}
-		return sequence;
-	},
-	processSequence: function(sequence, isFirstFrame) {
-		var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
-		while (i < len && !isFirstFrame) {
-			if (sequence.transforms[i].transform.mProps._mdf) {
-				_mdf = true;
-				break;
-			}
-			i += 1
-		}
-		if (_mdf) {
-			var props;
-			sequence.finalTransform.reset();
-			for (i = len - 1; i >= 0; i -= 1) {
-		        props = sequence.transforms[i].transform.mProps.v.props;
-		        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]);
-			}
-		}
-		sequence._mdf = _mdf;
-		
-	},
-	processSequences: function(isFirstFrame) {
-		var i, len = this.sequenceList.length;
-		for (i = 0; i < len; i += 1) {
-			this.processSequence(this.sequenceList[i], isFirstFrame);
-		}
+  addTransformSequence: function (transforms) {
+    var i;
+    var len = transforms.length;
+    var key = '_';
+    for (i = 0; i < len; i += 1) {
+      key += transforms[i].transform.key + '_';
+    }
+    var sequence = this.sequences[key];
+    if (!sequence) {
+      sequence = {
+        transforms: [].concat(transforms),
+        finalTransform: new Matrix(),
+        _mdf: false,
+      };
+      this.sequences[key] = sequence;
+      this.sequenceList.push(sequence);
+    }
+    return sequence;
+  },
+  processSequence: function (sequence, isFirstFrame) {
+    var i = 0;
+    var len = sequence.transforms.length;
+    var _mdf = isFirstFrame;
+    while (i < len && !isFirstFrame) {
+      if (sequence.transforms[i].transform.mProps._mdf) {
+        _mdf = true;
+        break;
+      }
+      i += 1;
+    }
+    if (_mdf) {
+      var props;
+      sequence.finalTransform.reset();
+      for (i = len - 1; i >= 0; i -= 1) {
+        props = sequence.transforms[i].transform.mProps.v.props;
+        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]);
+      }
+    }
+    sequence._mdf = _mdf;
+  },
+  processSequences: function (isFirstFrame) {
+    var i;
+    var len = this.sequenceList.length;
+    for (i = 0; i < len; i += 1) {
+      this.processSequence(this.sequenceList[i], isFirstFrame);
+    }
+  },
+  getNewKey: function () {
+    this.transform_key_count += 1;
+    return '_' + this.transform_key_count;
+  },
+};
 
-	},
-	getNewKey: function() {
-		return '_' + this.transform_key_count++;
-	}
-}
-function BaseElement(){
+/* global LayerExpressionInterface, EffectsExpressionInterface, CompExpressionInterface, ShapeExpressionInterface,
+TextExpressionInterface, getBlendMode,createElementID, EffectsManager */
+
+function BaseElement() {
 }
 
 BaseElement.prototype = {
-    checkMasks: function(){
-        if(!this.data.hasMask){
-            return false;
-        }
-        var i = 0, len = this.data.masksProperties.length;
-        while(i<len) {
-            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-                return true;
-            }
-            i += 1;
-        }
-        return false;
-    },
-    initExpressions: function(){
-        this.layerInterface = LayerExpressionInterface(this);
-        if(this.data.hasMask && this.maskManager) {
-            this.layerInterface.registerMaskInterface(this.maskManager);
-        }
-        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-        this.layerInterface.registerEffectsInterface(effectsInterface);
-
-        if(this.data.ty === 0 || this.data.xt){
-            this.compInterface = CompExpressionInterface(this);
-        } else if(this.data.ty === 4){
-            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
-            this.layerInterface.content = this.layerInterface.shapeInterface;
-        } else if(this.data.ty === 5){
-            this.layerInterface.textInterface = TextExpressionInterface(this);
-            this.layerInterface.text = this.layerInterface.textInterface;
-        }
-    },
-    setBlendMode: function(){
-        var blendModeValue = getBlendMode(this.data.bm);
-        var elem = this.baseElement || this.layerElement;
-
-        elem.style['mix-blend-mode'] = blendModeValue;
-    },
-    initBaseData: function(data, globalData, comp){
-        this.globalData = globalData;
-        this.comp = comp;
-        this.data = data;
-        this.layerId = createElementID();
-        
-        //Stretch factor for old animations missing this property.
-        if(!this.data.sr){
-            this.data.sr = 1;
-        }
-        // effects manager
-        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-        
-    },
-    getType: function(){
-        return this.type;
+  checkMasks: function () {
+    if (!this.data.hasMask) {
+      return false;
     }
-    ,sourceRectAtTime: function(){}
-}
-function NullElement(data,globalData,comp){
-    this.initFrame();
-	this.initBaseData(data, globalData, comp);
-    this.initFrame();
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
+    var i = 0;
+    var len = this.data.masksProperties.length;
+    while (i < len) {
+      if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+        return true;
+      }
+      i += 1;
+    }
+    return false;
+  },
+  initExpressions: function () {
+    this.layerInterface = LayerExpressionInterface(this);
+    if (this.data.hasMask && this.maskManager) {
+      this.layerInterface.registerMaskInterface(this.maskManager);
+    }
+    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
+    this.layerInterface.registerEffectsInterface(effectsInterface);
+
+    if (this.data.ty === 0 || this.data.xt) {
+      this.compInterface = CompExpressionInterface(this);
+    } else if (this.data.ty === 4) {
+      this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
+      this.layerInterface.content = this.layerInterface.shapeInterface;
+    } else if (this.data.ty === 5) {
+      this.layerInterface.textInterface = TextExpressionInterface(this);
+      this.layerInterface.text = this.layerInterface.textInterface;
+    }
+  },
+  setBlendMode: function () {
+    var blendModeValue = getBlendMode(this.data.bm);
+    var elem = this.baseElement || this.layerElement;
+
+    elem.style['mix-blend-mode'] = blendModeValue;
+  },
+  initBaseData: function (data, globalData, comp) {
+    this.globalData = globalData;
+    this.comp = comp;
+    this.data = data;
+    this.layerId = createElementID();
+
+    // Stretch factor for old animations missing this property.
+    if (!this.data.sr) {
+      this.data.sr = 1;
+    }
+    // effects manager
+    this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
+  },
+  getType: function () {
+    return this.type;
+  },
+  sourceRectAtTime: function () {},
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement */
+
+function NullElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initFrame();
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
 }
 
-NullElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
+NullElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-NullElement.prototype.renderFrame = function() {
+NullElement.prototype.renderFrame = function () {
 };
 
-NullElement.prototype.getBaseElement = function() {
-	return null;
+NullElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-NullElement.prototype.destroy = function() {
+NullElement.prototype.destroy = function () {
 };
 
-NullElement.prototype.sourceRectAtTime = function() {
+NullElement.prototype.sourceRectAtTime = function () {
 };
 
-NullElement.prototype.hide = function() {
+NullElement.prototype.hide = function () {
 };
 
-extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
 
-function SVGBaseElement(){
+/* global filtersFactory, featureSupport, filtersFactory, createElementID, createNS, MaskElement, SVGEffects, locationHref */
+
+function SVGBaseElement() {
 }
 
 SVGBaseElement.prototype = {
-    initRendererElement: function() {
-        this.layerElement = createNS('g');
-    },
-    createContainerElements: function(){
-        this.matteElement = createNS('g');
-        this.transformedElement = this.layerElement;
-        this.maskedElement = this.layerElement;
-        this._sizeChanged = false;
-        var layerElementParent = null;
-        //If this layer acts as a mask for the following layer
-        var filId, fil, gg;
-        if (this.data.td) {
-            if (this.data.td == 3 || this.data.td == 1) {
-                var masker = createNS('mask');
-                masker.setAttribute('id', this.layerId);
-                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
-                masker.appendChild(this.layerElement);
-                layerElementParent = masker;
-                this.globalData.defs.appendChild(masker);
-                // This is only for IE and Edge when mask if of type alpha
-                if (!featureSupport.maskType && this.data.td == 1) {
-                    masker.setAttribute('mask-type', 'luminance');
-                    filId = createElementID();
-                    fil = filtersFactory.createFilter(filId);
-                    this.globalData.defs.appendChild(fil);
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    masker.appendChild(gg);
-                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
-                }
-            } else if(this.data.td == 2) {
-                var maskGroup = createNS('mask');
-                maskGroup.setAttribute('id', this.layerId);
-                maskGroup.setAttribute('mask-type','alpha');
-                var maskGrouper = createNS('g');
-                maskGroup.appendChild(maskGrouper);
-                filId = createElementID();
-                fil = filtersFactory.createFilter(filId);
-                ////
+  initRendererElement: function () {
+    this.layerElement = createNS('g');
+  },
+  createContainerElements: function () {
+    this.matteElement = createNS('g');
+    this.transformedElement = this.layerElement;
+    this.maskedElement = this.layerElement;
+    this._sizeChanged = false;
+    var layerElementParent = null;
+    // If this layer acts as a mask for the following layer
+    var filId;
+    var fil;
+    var gg;
+    if (this.data.td) {
+      if (this.data.td == 3 || this.data.td == 1) { // eslint-disable-line eqeqeq
+        var masker = createNS('mask');
+        masker.setAttribute('id', this.layerId);
+        masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha'); // eslint-disable-line eqeqeq
+        masker.appendChild(this.layerElement);
+        layerElementParent = masker;
+        this.globalData.defs.appendChild(masker);
+        // This is only for IE and Edge when mask if of type alpha
+        if (!featureSupport.maskType && this.data.td == 1) { // eslint-disable-line eqeqeq
+          masker.setAttribute('mask-type', 'luminance');
+          filId = createElementID();
+          fil = filtersFactory.createFilter(filId);
+          this.globalData.defs.appendChild(fil);
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          masker.appendChild(gg);
+          gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        }
+      } else if (this.data.td == 2) { // eslint-disable-line eqeqeq
+        var maskGroup = createNS('mask');
+        maskGroup.setAttribute('id', this.layerId);
+        maskGroup.setAttribute('mask-type', 'alpha');
+        var maskGrouper = createNS('g');
+        maskGroup.appendChild(maskGrouper);
+        filId = createElementID();
+        fil = filtersFactory.createFilter(filId);
+        /// /
 
-                // This solution doesn't work on Android when meta tag with viewport attribute is set
-                /*var feColorMatrix = createNS('feColorMatrix');
+        // This solution doesn't work on Android when meta tag with viewport attribute is set
+        /* var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type', 'matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
                 feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-                fil.appendChild(feColorMatrix);*/
-                ////
-                var feCTr = createNS('feComponentTransfer');
-                feCTr.setAttribute('in','SourceGraphic');
-                fil.appendChild(feCTr);
-                var feFunc = createNS('feFuncA');
-                feFunc.setAttribute('type','table');
-                feFunc.setAttribute('tableValues','1.0 0.0');
-                feCTr.appendChild(feFunc);
-                ////
-                this.globalData.defs.appendChild(fil);
-                var alphaRect = createNS('rect');
-                alphaRect.setAttribute('width',  this.comp.data.w);
-                alphaRect.setAttribute('height', this.comp.data.h);
-                alphaRect.setAttribute('x','0');
-                alphaRect.setAttribute('y','0');
-                alphaRect.setAttribute('fill','#ffffff');
-                alphaRect.setAttribute('opacity','0');
-                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
-                maskGrouper.appendChild(alphaRect);
-                maskGrouper.appendChild(this.layerElement);
-                layerElementParent = maskGrouper;
-                if (!featureSupport.maskType) {
-                    maskGroup.setAttribute('mask-type', 'luminance');
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    maskGrouper.appendChild(alphaRect);
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    maskGrouper.appendChild(gg);
-                }
-                this.globalData.defs.appendChild(maskGroup);
-            }
-        } else if (this.data.tt) {
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        } else {
-            this.baseElement = this.layerElement;
+                fil.appendChild(feColorMatrix); */
+        /// /
+        var feCTr = createNS('feComponentTransfer');
+        feCTr.setAttribute('in', 'SourceGraphic');
+        fil.appendChild(feCTr);
+        var feFunc = createNS('feFuncA');
+        feFunc.setAttribute('type', 'table');
+        feFunc.setAttribute('tableValues', '1.0 0.0');
+        feCTr.appendChild(feFunc);
+        /// /
+        this.globalData.defs.appendChild(fil);
+        var alphaRect = createNS('rect');
+        alphaRect.setAttribute('width', this.comp.data.w);
+        alphaRect.setAttribute('height', this.comp.data.h);
+        alphaRect.setAttribute('x', '0');
+        alphaRect.setAttribute('y', '0');
+        alphaRect.setAttribute('fill', '#ffffff');
+        alphaRect.setAttribute('opacity', '0');
+        maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        maskGrouper.appendChild(alphaRect);
+        maskGrouper.appendChild(this.layerElement);
+        layerElementParent = maskGrouper;
+        if (!featureSupport.maskType) {
+          maskGroup.setAttribute('mask-type', 'luminance');
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          maskGrouper.appendChild(alphaRect);
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          maskGrouper.appendChild(gg);
         }
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id', this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
-        if (this.data.ty === 0 && !this.data.hd) {
-            var cp = createNS( 'clipPath');
-            var pt = createNS('path');
-            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
-            var clipId = createElementID();
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-
-            if (this.checkMasks()) {
-                var cpGroup = createNS('g');
-                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
-                cpGroup.appendChild(this.layerElement);
-                this.transformedElement = cpGroup;
-                if (layerElementParent) {
-                    layerElementParent.appendChild(this.transformedElement);
-                } else {
-                    this.baseElement = this.transformedElement;
-                }
-            } else {
-                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
-            }
-            
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-
-    },
-    renderElement: function() {
-        if (this.finalTransform._matMdf) {
-            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
-        }
-        if (this.finalTransform._opMdf) {
-            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
-        }
-    },
-    destroyBaseElement: function() {
-        this.layerElement = null;
-        this.matteElement = null;
-        this.maskManager.destroy();
-    },
-    getBaseElement: function() {
-        if (this.data.hd) {
-            return null;
-        }
-        return this.baseElement;
-    },
-    createRenderableComponents: function() {
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-        this.renderableEffectsManager = new SVGEffects(this);
-    },
-    setMatte: function(id) {
-        if (!this.matteElement) {
-            return;
-        }
-        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
+        this.globalData.defs.appendChild(maskGroup);
+      }
+    } else if (this.data.tt) {
+      this.matteElement.appendChild(this.layerElement);
+      layerElementParent = this.matteElement;
+      this.baseElement = this.matteElement;
+    } else {
+      this.baseElement = this.layerElement;
     }
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+    if (this.data.ty === 0 && !this.data.hd) {
+      var cp = createNS('clipPath');
+      var pt = createNS('path');
+      pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+      var clipId = createElementID();
+      cp.setAttribute('id', clipId);
+      cp.appendChild(pt);
+      this.globalData.defs.appendChild(cp);
+
+      if (this.checkMasks()) {
+        var cpGroup = createNS('g');
+        cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+        cpGroup.appendChild(this.layerElement);
+        this.transformedElement = cpGroup;
+        if (layerElementParent) {
+          layerElementParent.appendChild(this.transformedElement);
+        } else {
+          this.baseElement = this.transformedElement;
+        }
+      } else {
+        this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+      }
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    if (this.finalTransform._matMdf) {
+      this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+    }
+    if (this.finalTransform._opMdf) {
+      this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+    }
+  },
+  destroyBaseElement: function () {
+    this.layerElement = null;
+    this.matteElement = null;
+    this.maskManager.destroy();
+  },
+  getBaseElement: function () {
+    if (this.data.hd) {
+      return null;
+    }
+    return this.baseElement;
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+    this.renderableEffectsManager = new SVGEffects(this);
+  },
+  setMatte: function (id) {
+    if (!this.matteElement) {
+      return;
+    }
+    this.matteElement.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+  },
 };
-function IShapeElement(){
+
+/* global ProcessedElement */
+
+function IShapeElement() {
 }
 
 IShapeElement.prototype = {
-    addShapeToModifiers: function(data) {
-        var i, len = this.shapeModifiers.length;
-        for(i=0;i<len;i+=1){
-            this.shapeModifiers[i].addShape(data);
-        }
-    },
-    isShapeInAnimatedModifiers: function(data) {
-        var i = 0, len = this.shapeModifiers.length;
-        while(i < len) {
-            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
-                return true;
-            }
-        }
-        return false;
-    },
-    renderModifiers: function() {
-        if(!this.shapeModifiers.length){
-            return;
-        }
-        var i, len = this.shapes.length;
-        for(i=0;i<len;i+=1){
-            this.shapes[i].sh.reset();
-        }
-
-        len = this.shapeModifiers.length;
-        for(i=len-1;i>=0;i-=1){
-            this.shapeModifiers[i].processShapes(this._isFirstFrame);
-        }
-    },
-    lcEnum: {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'square'
-    },
-    ljEnum: {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    },
-    searchProcessedElement: function(elem){
-        var elements = this.processedElements;
-        var i = 0, len = elements.length;
-        while (i < len) {
-            if (elements[i].elem === elem) {
-                return elements[i].pos;
-            }
-            i += 1;
-        }
-        return 0;
-    },
-    addProcessedElement: function(elem, pos){
-        var elements = this.processedElements;
-        var i = elements.length;
-        while(i) {
-            i -= 1;
-            if (elements[i].elem === elem) {
-                elements[i].pos = pos;
-                return;
-            }
-        }
-        elements.push(new ProcessedElement(elem, pos));
-    },
-    prepareFrame: function(num) {
-        this.prepareRenderableFrame(num);
-        this.prepareProperties(num, this.isInRange);
+  addShapeToModifiers: function (data) {
+    var i;
+    var len = this.shapeModifiers.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapeModifiers[i].addShape(data);
     }
-};
-function ITextElement(){
-}
+  },
+  isShapeInAnimatedModifiers: function (data) {
+    var i = 0;
+    var len = this.shapeModifiers.length;
+    while (i < len) {
+      if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  renderModifiers: function () {
+    if (!this.shapeModifiers.length) {
+      return;
+    }
+    var i;
+    var len = this.shapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].sh.reset();
+    }
 
-ITextElement.prototype.initElement = function(data,globalData,comp){
-    this.lettersChangedFlag = true;
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
-    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
-    this.initRenderable();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    this.createContent();
-    this.hide();
-    this.textAnimator.searchProperties(this.dynamicProperties);
-};
-
-ITextElement.prototype.prepareFrame = function(num) {
-    this._mdf = false;
+    len = this.shapeModifiers.length;
+    for (i = len - 1; i >= 0; i -= 1) {
+      this.shapeModifiers[i].processShapes(this._isFirstFrame);
+    }
+  },
+  lcEnum: {
+    1: 'butt',
+    2: 'round',
+    3: 'square',
+  },
+  ljEnum: {
+    1: 'miter',
+    2: 'round',
+    3: 'bevel',
+  },
+  searchProcessedElement: function (elem) {
+    var elements = this.processedElements;
+    var i = 0;
+    var len = elements.length;
+    while (i < len) {
+      if (elements[i].elem === elem) {
+        return elements[i].pos;
+      }
+      i += 1;
+    }
+    return 0;
+  },
+  addProcessedElement: function (elem, pos) {
+    var elements = this.processedElements;
+    var i = elements.length;
+    while (i) {
+      i -= 1;
+      if (elements[i].elem === elem) {
+        elements[i].pos = pos;
+        return;
+      }
+    }
+    elements.push(new ProcessedElement(elem, pos));
+  },
+  prepareFrame: function (num) {
     this.prepareRenderableFrame(num);
     this.prepareProperties(num, this.isInRange);
-    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
-        this.buildNewText();
-        this.textProperty._isFirstFrame = false;
-        this.textProperty._mdf = false;
-    }
+  },
 };
 
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        pathNodes = shapes[j].ks.k;
-        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
-    }
-    return shapeStr;
+/* global TextProperty, TextAnimatorProperty, buildShapeString, LetterProps */
+
+function ITextElement() {
+}
+
+ITextElement.prototype.initElement = function (data, globalData, comp) {
+  this.lettersChangedFlag = true;
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+  this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
+  this.initRenderable();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  this.createContent();
+  this.hide();
+  this.textAnimator.searchProperties(this.dynamicProperties);
 };
 
-ITextElement.prototype.updateDocumentData = function(newData, index) {
-    this.textProperty.updateDocumentData(newData, index);
+ITextElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
+    this.buildNewText();
+    this.textProperty._isFirstFrame = false;
+    this.textProperty._mdf = false;
+  }
 };
 
-ITextElement.prototype.canResizeFont = function(_canResize) {
-    this.textProperty.canResizeFont(_canResize);
+ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
+  var j;
+  var jLen = shapes.length;
+  var pathNodes;
+  var shapeStr = '';
+  for (j = 0; j < jLen; j += 1) {
+    pathNodes = shapes[j].ks.k;
+    shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
+  }
+  return shapeStr;
 };
 
-ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
-    this.textProperty.setMinimumFontSize(_fontSize);
+ITextElement.prototype.updateDocumentData = function (newData, index) {
+  this.textProperty.updateDocumentData(newData, index);
 };
 
-ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
-    if(documentData.ps){
-        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-    }
-    matrixHelper.translate(0,-documentData.ls,0);
-    switch(documentData.j){
-        case 1:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
-            break;
-        case 2:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
-            break;
-    }
-    matrixHelper.translate(xPos, yPos, 0);
+ITextElement.prototype.canResizeFont = function (_canResize) {
+  this.textProperty.canResizeFont(_canResize);
 };
 
+ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
+  this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-ITextElement.prototype.buildColor = function(colorData) {
-    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
+ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
+  if (documentData.ps) {
+    matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+  }
+  matrixHelper.translate(0, -documentData.ls, 0);
+  switch (documentData.j) {
+    case 1:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
+      break;
+    case 2:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
+      break;
+    default:
+      break;
+  }
+  matrixHelper.translate(xPos, yPos, 0);
+};
+
+ITextElement.prototype.buildColor = function (colorData) {
+  return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
 
-ITextElement.prototype.destroy = function(){
-    
+ITextElement.prototype.destroy = function () {
+
 };
-function ICompElement(){}
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement */
+
+function ICompElement() {}
 
 extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
 
-ICompElement.prototype.initElement = function(data,globalData,comp) {
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.initTransform(data, globalData, comp);
-    this.initRenderable();
-    this.initHierarchy();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-    this.hide();
+ICompElement.prototype.initElement = function (data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initTransform(data, globalData, comp);
+  this.initRenderable();
+  this.initHierarchy();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  if (this.data.xt || !globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+  this.hide();
 };
 
-/*ICompElement.prototype.hide = function(){
+/* ICompElement.prototype.hide = function(){
     if(!this.hidden){
         this.hideElement();
         var i,len = this.elements.length;
@@ -7815,1141 +8272,1206 @@
             }
         }
     }
-};*/
+}; */
 
-ICompElement.prototype.prepareFrame = function(num){
-    this._mdf = false;
-    this.prepareRenderableFrame(num);
-    this.prepareProperties(num, this.isInRange);
-    if(!this.isInRange && !this.data.xt){
-        return;
-    }
+ICompElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (!this.isInRange && !this.data.xt) {
+    return;
+  }
 
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    if (timeRemapped === this.data.op) {
+      timeRemapped = this.data.op - 1;
     }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
+    this.renderedFrame = timeRemapped;
+  } else {
+    this.renderedFrame = num / this.data.sr;
+  }
+  var i;
+  var len = this.elements.length;
+  if (!this.completeLayers) {
+    this.checkLayers(this.renderedFrame);
+  }
+  // This iteration needs to be backwards because of how expressions connect between each other
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+      if (this.elements[i]._mdf) {
+        this._mdf = true;
+      }
     }
-    //This iteration needs to be backwards because of how expressions connect between each other
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-            if(this.elements[i]._mdf) {
-                this._mdf = true;
-            }
-        }
-    }
+  }
 };
 
-ICompElement.prototype.renderInnerContent = function() {
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i += 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+ICompElement.prototype.renderInnerContent = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
+ICompElement.prototype.setElements = function (elems) {
+  this.elements = elems;
 };
 
-ICompElement.prototype.getElements = function(){
-    return this.elements;
+ICompElement.prototype.getElements = function () {
+  return this.elements;
 };
 
-ICompElement.prototype.destroyElements = function(){
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
+ICompElement.prototype.destroyElements = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
+  }
 };
 
-ICompElement.prototype.destroy = function(){
-    this.destroyElements();
-    this.destroyBaseElement();
+ICompElement.prototype.destroy = function () {
+  this.destroyElements();
+  this.destroyBaseElement();
 };
 
-function IImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
-    this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, createNS */
+
+function IImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
+  this.sourceRect = {
+    top: 0, left: 0, width: this.assetData.w, height: this.assetData.h,
+  };
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
 
-IImageElement.prototype.createContent = function(){
+IImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.innerElem = createNS('image');
+  this.innerElem.setAttribute('width', this.assetData.w + 'px');
+  this.innerElem.setAttribute('height', this.assetData.h + 'px');
+  this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
+  this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
 
-    this.innerElem = createNS('image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    
-    this.layerElement.appendChild(this.innerElem);
+  this.layerElement.appendChild(this.innerElem);
 };
 
-IImageElement.prototype.sourceRectAtTime = function() {
-	return this.sourceRect;
-}
-function ISolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
+IImageElement.prototype.sourceRectAtTime = function () {
+  return this.sourceRect;
+};
+
+/* global extendPrototype, IImageElement, createNS */
+
+function ISolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createContent = function(){
-
-    var rect = createNS('rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
+ISolidElement.prototype.createContent = function () {
+  var rect = createNS('rect');
+  /// /rect.style.width = this.data.sw;
+  /// /rect.style.height = this.data.sh;
+  /// /rect.style.fill = this.data.sc;
+  rect.setAttribute('width', this.data.sw);
+  rect.setAttribute('height', this.data.sh);
+  rect.setAttribute('fill', this.data.sc);
+  this.layerElement.appendChild(rect);
 };
-function AudioElement(data,globalData,comp){
-    this.initFrame();
-    this.initRenderable();
-    this.assetData = globalData.getAssetData(data.refId);
-	this.initBaseData(data, globalData, comp);
-	this._isPlaying = false;
-	this._canPlay = false;
-	var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.audio = this.globalData.audioController.createAudio(assetPath);
-    this._currentTime = 0;
-    this.globalData.audioController.addAudio(this);
-    this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate,this) : {_placeholder:true};
+
+/* global PropertyFactory, extendPrototype, RenderableElement, BaseElement, FrameElement */
+
+function AudioElement(data, globalData, comp) {
+  this.initFrame();
+  this.initRenderable();
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initBaseData(data, globalData, comp);
+  this._isPlaying = false;
+  this._canPlay = false;
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.audio = this.globalData.audioController.createAudio(assetPath);
+  this._currentTime = 0;
+  this.globalData.audioController.addAudio(this);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
-AudioElement.prototype.prepareFrame = function(num) {
-    this.prepareRenderableFrame(num, true);
-    this.prepareProperties(num, true);
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        this._currentTime = timeRemapped;
-    } else {
-        this._currentTime = num / this.data.sr;
+AudioElement.prototype.prepareFrame = function (num) {
+  this.prepareRenderableFrame(num, true);
+  this.prepareProperties(num, true);
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    this._currentTime = timeRemapped;
+  } else {
+    this._currentTime = num / this.data.sr;
+  }
+};
+
+extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
+
+AudioElement.prototype.renderFrame = function () {
+  if (this.isInRange && this._canPlay) {
+    if (!this._isPlaying) {
+      this.audio.play();
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
+      this._isPlaying = true;
+    } else if (!this.audio.playing()
+      || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
+    ) {
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
     }
+  }
 };
 
-extendPrototype([RenderableElement,BaseElement,FrameElement], AudioElement);
-
-AudioElement.prototype.renderFrame = function() {
-	if (this.isInRange && this._canPlay) {
-		if (!this._isPlaying) {
-			this.audio.play();
-			this.audio.seek(this._currentTime / this.globalData.frameRate);
-			this._isPlaying = true;
-		} else if (!this.audio.playing()
-			|| Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
-		) {
-			this.audio.seek(this._currentTime / this.globalData.frameRate)
-		}
-	}
+AudioElement.prototype.show = function () {
+  // this.audio.play()
 };
 
-AudioElement.prototype.show = function() {
-	// this.audio.play()
+AudioElement.prototype.hide = function () {
+  this.audio.pause();
+  this._isPlaying = false;
 };
 
-AudioElement.prototype.hide = function() {
-	this.audio.pause();
-	this._isPlaying = false;
+AudioElement.prototype.pause = function () {
+  this.audio.pause();
+  this._isPlaying = false;
+  this._canPlay = false;
 };
 
-AudioElement.prototype.pause = function() {
-	this.audio.pause();
-	this._isPlaying = false;
-	this._canPlay = false;
+AudioElement.prototype.resume = function () {
+  this._canPlay = true;
 };
 
-AudioElement.prototype.resume = function() {
-	this._canPlay = true;
+AudioElement.prototype.setRate = function (rateValue) {
+  this.audio.rate(rateValue);
 };
 
-AudioElement.prototype.setRate = function(rateValue) {
-	this.audio.rate(rateValue);
+AudioElement.prototype.volume = function (volumeValue) {
+  this.audio.volume(volumeValue);
 };
 
-AudioElement.prototype.volume = function(volumeValue) {
-	this.audio.volume(volumeValue);
+AudioElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-AudioElement.prototype.getBaseElement = function() {
-	return null;
+AudioElement.prototype.destroy = function () {
 };
 
-AudioElement.prototype.destroy = function() {
+AudioElement.prototype.sourceRectAtTime = function () {
 };
 
-AudioElement.prototype.sourceRectAtTime = function() {
+AudioElement.prototype.initExpressions = function () {
 };
 
-AudioElement.prototype.initExpressions = function() {
-};
+/* global createSizedArray, PropertyFactory, extendPrototype, SVGRenderer, ICompElement, SVGBaseElement */
 
-
-function SVGCompElement(data,globalData,comp){
-    this.layers = data.layers;
-    this.supports3d = true;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
-    //this.layerElement = createNS('g');
-    this.initElement(data,globalData,comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+function SVGCompElement(data, globalData, comp) {
+  this.layers = data.layers;
+  this.supports3d = true;
+  this.completeLayers = false;
+  this.pendingElements = [];
+  this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+  // this.layerElement = createNS('g');
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement);
-function SVGTextElement(data,globalData,comp){
-    this.textSpans = [];
-    this.renderType = 'svg';
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, ITextElement, createSizedArray, createNS */
+
+function SVGTextLottieElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.renderType = 'svg';
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], SVGTextElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement);
 
-SVGTextElement.prototype.createContent = function(){
-
-    if (this.data.singleShape && !this.globalData.fontManager.chars) {
-        this.textContainer = createNS('text');
-    }
+SVGTextLottieElement.prototype.createContent = function () {
+  if (this.data.singleShape && !this.globalData.fontManager.chars) {
+    this.textContainer = createNS('text');
+  }
 };
 
-SVGTextElement.prototype.buildTextContents = function(textArray) {
-    var i = 0, len = textArray.length;
-    var textContents = [], currentTextContent = '';
-    while (i < len) {
-        if(textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
-            textContents.push(currentTextContent);
-            currentTextContent = '';
+SVGTextLottieElement.prototype.buildTextContents = function (textArray) {
+  var i = 0;
+  var len = textArray.length;
+  var textContents = [];
+  var currentTextContent = '';
+  while (i < len) {
+    if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
+      textContents.push(currentTextContent);
+      currentTextContent = '';
+    } else {
+      currentTextContent += textArray[i];
+    }
+    i += 1;
+  }
+  textContents.push(currentTextContent);
+  return textContents;
+};
+
+SVGTextLottieElement.prototype.buildNewText = function () {
+  var i;
+  var len;
+
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
+  if (documentData.fc) {
+    this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
+  } else {
+    this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
+  }
+  if (documentData.sc) {
+    this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
+    this.layerElement.setAttribute('stroke-width', documentData.sw);
+  }
+  this.layerElement.setAttribute('font-size', documentData.finalSize);
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  if (fontData.fClass) {
+    this.layerElement.setAttribute('class', fontData.fClass);
+  } else {
+    this.layerElement.setAttribute('font-family', fontData.fFamily);
+    var fWeight = documentData.fWeight;
+    var fStyle = documentData.fStyle;
+    this.layerElement.setAttribute('font-style', fStyle);
+    this.layerElement.setAttribute('font-weight', fWeight);
+  }
+  this.layerElement.setAttribute('aria-label', documentData.t);
+
+  var letters = documentData.l || [];
+  var usesGlyphs = !!this.globalData.fontManager.chars;
+  len = letters.length;
+
+  var tSpan;
+  var matrixHelper = this.mHelper;
+  var shapes;
+  var shapeStr = '';
+  var singleShape = this.data.singleShape;
+  var xPos = 0;
+  var yPos = 0;
+  var firstLine = true;
+  var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
+  if (singleShape && !usesGlyphs && !documentData.sz) {
+    var tElement = this.textContainer;
+    var justify = 'start';
+    switch (documentData.j) {
+      case 1:
+        justify = 'end';
+        break;
+      case 2:
+        justify = 'middle';
+        break;
+      default:
+        justify = 'start';
+        break;
+    }
+    tElement.setAttribute('text-anchor', justify);
+    tElement.setAttribute('letter-spacing', trackingOffset);
+    var textContent = this.buildTextContents(documentData.finalText);
+    len = textContent.length;
+    yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
+    for (i = 0; i < len; i += 1) {
+      tSpan = this.textSpans[i] || createNS('tspan');
+      tSpan.textContent = textContent[i];
+      tSpan.setAttribute('x', 0);
+      tSpan.setAttribute('y', yPos);
+      tSpan.style.display = 'inherit';
+      tElement.appendChild(tSpan);
+      this.textSpans[i] = tSpan;
+      yPos += documentData.finalLineHeight;
+    }
+
+    this.layerElement.appendChild(tElement);
+  } else {
+    var cachedSpansLength = this.textSpans.length;
+    var shapeData;
+    var charData;
+    for (i = 0; i < len; i += 1) {
+      if (!usesGlyphs || !singleShape || i === 0) {
+        tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs ? 'path' : 'text');
+        if (cachedSpansLength <= i) {
+          tSpan.setAttribute('stroke-linecap', 'butt');
+          tSpan.setAttribute('stroke-linejoin', 'round');
+          tSpan.setAttribute('stroke-miterlimit', '4');
+          this.textSpans[i] = tSpan;
+          this.layerElement.appendChild(tSpan);
+        }
+        tSpan.style.display = 'inherit';
+      }
+
+      matrixHelper.reset();
+      matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+      if (singleShape) {
+        if (letters[i].n) {
+          xPos = -trackingOffset;
+          yPos += documentData.yOffset;
+          yPos += firstLine ? 1 : 0;
+          firstLine = false;
+        }
+        this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
+        xPos += letters[i].l || 0;
+        // xPos += letters[i].val === ' ' ? 0 : trackingOffset;
+        xPos += trackingOffset;
+      }
+      if (usesGlyphs) {
+        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+        shapeData = (charData && charData.data) || {};
+        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+        if (!singleShape) {
+          tSpan.setAttribute('d', this.createPathShape(matrixHelper, shapes));
         } else {
-            currentTextContent += textArray[i];
+          shapeStr += this.createPathShape(matrixHelper, shapes);
         }
-        i += 1;
+      } else {
+        if (singleShape) {
+          tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')');
+        }
+        tSpan.textContent = letters[i].val;
+        tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
+      }
+      //
     }
-    textContents.push(currentTextContent);
-    return textContents;
+    if (singleShape && tSpan) {
+      tSpan.setAttribute('d', shapeStr);
+    }
+  }
+  while (i < this.textSpans.length) {
+    this.textSpans[i].style.display = 'none';
+    i += 1;
+  }
+
+  this._sizeChanged = true;
+};
+
+SVGTextLottieElement.prototype.sourceRectAtTime = function () {
+  this.prepareFrame(this.comp.renderedFrame - this.data.st);
+  this.renderInnerContent();
+  if (this._sizeChanged) {
+    this._sizeChanged = false;
+    var textBox = this.layerElement.getBBox();
+    this.bbox = {
+      top: textBox.y,
+      left: textBox.x,
+      width: textBox.width,
+      height: textBox.height,
+    };
+  }
+  return this.bbox;
+};
+
+SVGTextLottieElement.prototype.renderInnerContent = function () {
+  if (!this.data.singleShape) {
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+    if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
+      this._sizeChanged = true;
+      var i;
+      var len;
+      var renderedLetters = this.textAnimator.renderedLetters;
+
+      var letters = this.textProperty.currentData.l;
+
+      len = letters.length;
+      var renderedLetter;
+      var textSpan;
+      for (i = 0; i < len; i += 1) {
+        if (!letters[i].n) {
+          renderedLetter = renderedLetters[i];
+          textSpan = this.textSpans[i];
+          if (renderedLetter._mdf.m) {
+            textSpan.setAttribute('transform', renderedLetter.m);
+          }
+          if (renderedLetter._mdf.o) {
+            textSpan.setAttribute('opacity', renderedLetter.o);
+          }
+          if (renderedLetter._mdf.sw) {
+            textSpan.setAttribute('stroke-width', renderedLetter.sw);
+          }
+          if (renderedLetter._mdf.sc) {
+            textSpan.setAttribute('stroke', renderedLetter.sc);
+          }
+          if (renderedLetter._mdf.fc) {
+            textSpan.setAttribute('fill', renderedLetter.fc);
+          }
+        }
+      }
+    }
+  }
+};
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement,
+FrameElement, RenderableDOMElement, Matrix, SVGStyleData, SVGStrokeStyleData, SVGFillStyleData,
+SVGGradientFillStyleData, SVGGradientStrokeStyleData, locationHref, getBlendMode, ShapeGroupData,
+TransformPropertyFactory, SVGTransformData, ShapePropertyFactory, SVGShapeData, SVGElementsRenderer, ShapeModifiers */
+
+function SVGShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
 }
 
-SVGTextElement.prototype.buildNewText = function(){
-    var i, len;
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
 
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
-    if(documentData.fc) {
-        this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
-    }else{
-        this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
-    }
-    if(documentData.sc){
-        this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
-        this.layerElement.setAttribute('stroke-width', documentData.sw);
-    }
-    this.layerElement.setAttribute('font-size', documentData.finalSize);
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(fontData.fClass){
-        this.layerElement.setAttribute('class',fontData.fClass);
-    } else {
-        this.layerElement.setAttribute('font-family', fontData.fFamily);
-        var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-        this.layerElement.setAttribute('font-style', fStyle);
-        this.layerElement.setAttribute('font-weight', fWeight);
-    }
-    this.layerElement.setAttribute('aria-label', documentData.t);
-
-    var letters = documentData.l || [];
-    var usesGlyphs = !!this.globalData.fontManager.chars;
-    len = letters.length;
-
-    var tSpan;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '', singleShape = this.data.singleShape;
-    var xPos = 0, yPos = 0, firstLine = true;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    if(singleShape && !usesGlyphs && !documentData.sz) {
-        var tElement = this.textContainer;
-        var justify = 'start';
-        switch(documentData.j) {
-            case 1:
-                justify = 'end';
-                break;
-            case 2:
-                justify = 'middle';
-                break;
-        }
-        tElement.setAttribute('text-anchor',justify);
-        tElement.setAttribute('letter-spacing',trackingOffset);
-        var textContent = this.buildTextContents(documentData.finalText);
-        len = textContent.length;
-        yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
-        for ( i = 0; i < len; i += 1) {
-            tSpan = this.textSpans[i] || createNS('tspan');
-            tSpan.textContent = textContent[i];
-            tSpan.setAttribute('x', 0);
-            tSpan.setAttribute('y', yPos);
-            tSpan.style.display = 'inherit';
-            tElement.appendChild(tSpan);
-            this.textSpans[i] = tSpan;
-            yPos += documentData.finalLineHeight;
-        }
-        
-        this.layerElement.appendChild(tElement);
-    } else {
-        var cachedSpansLength = this.textSpans.length;
-        var shapeData, charData;
-        for (i = 0; i < len; i += 1) {
-            if(!usesGlyphs || !singleShape || i === 0){
-                tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs?'path':'text');
-                if (cachedSpansLength <= i) {
-                    tSpan.setAttribute('stroke-linecap', 'butt');
-                    tSpan.setAttribute('stroke-linejoin','round');
-                    tSpan.setAttribute('stroke-miterlimit','4');
-                    this.textSpans[i] = tSpan;
-                    this.layerElement.appendChild(tSpan);
-                }
-                tSpan.style.display = 'inherit';
-            }
-            
-            matrixHelper.reset();
-            matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
-            if (singleShape) {
-                if(letters[i].n) {
-                    xPos = -trackingOffset;
-                    yPos += documentData.yOffset;
-                    yPos += firstLine ? 1 : 0;
-                    firstLine = false;
-                }
-                this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
-                xPos += letters[i].l || 0;
-                //xPos += letters[i].val === ' ' ? 0 : trackingOffset;
-                xPos += trackingOffset;
-            }
-            if(usesGlyphs) {
-                charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-                shapeData = charData && charData.data || {};
-                shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
-                if(!singleShape){
-                    tSpan.setAttribute('d',this.createPathShape(matrixHelper,shapes));
-                } else {
-                    shapeStr += this.createPathShape(matrixHelper,shapes);
-                }
-            } else {
-                if(singleShape) {
-                    tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")");
-                }
-                tSpan.textContent = letters[i].val;
-                tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            }
-            //
-        }
-        if (singleShape && tSpan) {
-            tSpan.setAttribute('d',shapeStr);
-        }
-    }
-    while (i < this.textSpans.length){
-        this.textSpans[i].style.display = 'none';
-        i += 1;
-    }
-    
-    this._sizeChanged = true;
-};
-
-SVGTextElement.prototype.sourceRectAtTime = function(time){
-    this.prepareFrame(this.comp.renderedFrame - this.data.st);
-    this.renderInnerContent();
-    if(this._sizeChanged){
-        this._sizeChanged = false;
-        var textBox = this.layerElement.getBBox();
-        this.bbox = {
-            top: textBox.y,
-            left: textBox.x,
-            width: textBox.width,
-            height: textBox.height
-        };
-    }
-    return this.bbox;
-};
-
-SVGTextElement.prototype.renderInnerContent = function(){
-
-    if(!this.data.singleShape){
-        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
-        if(this.lettersChangedFlag || this.textAnimator.lettersChangedFlag){
-            this._sizeChanged = true;
-            var  i,len;
-            var renderedLetters = this.textAnimator.renderedLetters;
-
-            var letters = this.textProperty.currentData.l;
-
-            len = letters.length;
-            var renderedLetter, textSpan;
-            for(i=0;i<len;i+=1){
-                if(letters[i].n){
-                    continue;
-                }
-                renderedLetter = renderedLetters[i];
-                textSpan = this.textSpans[i];
-                if(renderedLetter._mdf.m) {
-                    textSpan.setAttribute('transform',renderedLetter.m);
-                }
-                if(renderedLetter._mdf.o) {
-                    textSpan.setAttribute('opacity',renderedLetter.o);
-                }
-                if(renderedLetter._mdf.sw){
-                    textSpan.setAttribute('stroke-width',renderedLetter.sw);
-                }
-                if(renderedLetter._mdf.sc){
-                    textSpan.setAttribute('stroke',renderedLetter.sc);
-                }
-                if(renderedLetter._mdf.fc){
-                    textSpan.setAttribute('fill',renderedLetter.fc);
-                }
-            }
-        }
-    }
-};
-
-function SVGShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
-}
-
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
-
-SVGShapeElement.prototype.initSecondaryElement = function() {
+SVGShapeElement.prototype.initSecondaryElement = function () {
 };
 
 SVGShapeElement.prototype.identityMatrix = new Matrix();
 
-SVGShapeElement.prototype.buildExpressionInterface = function(){};
+SVGShapeElement.prototype.buildExpressionInterface = function () {};
 
-SVGShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
+SVGShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
 };
 
 /*
 This method searches for multiple shapes that affect a single element and one of them is animated
 */
-SVGShapeElement.prototype.filterUniqueShapes = function(){
-    var i, len = this.shapes.length, shape;
-    var j, jLen = this.stylesList.length;
-    var style, count = 0;
-    var tempShapes = [];
-    var areAnimated = false;
-    for(j = 0; j < jLen; j += 1) {
-        style = this.stylesList[j];
-        areAnimated = false;
-        tempShapes.length = 0;
-        for(i = 0; i < len; i += 1) {
-            shape = this.shapes[i];
-            if(shape.styles.indexOf(style) !== -1) {
-                tempShapes.push(shape);
-                areAnimated = shape._isAnimated || areAnimated;
-            }
-        }
-        if(tempShapes.length > 1 && areAnimated) {
-            this.setShapesAsAnimated(tempShapes);
-        }
-    }
-}
-
-SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
-    var i, len = shapes.length;
-    for(i = 0; i < len; i += 1) {
-        shapes[i].setAsAnimated();
-    }
-}
-
-SVGShapeElement.prototype.createStyleElement = function(data, level){
-    //TODO: prevent drawing of hidden styles
-    var elementData;
-    var styleOb = new SVGStyleData(data, level);
-
-    var pathElement = styleOb.pElem;
-    if(data.ty === 'st') {
-        elementData = new SVGStrokeStyleData(this, data, styleOb);
-    } else if(data.ty === 'fl') {
-        elementData = new SVGFillStyleData(this, data, styleOb);
-    } else if(data.ty === 'gf' || data.ty === 'gs') {
-        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
-        elementData = new gradientConstructor(this, data, styleOb);
-        this.globalData.defs.appendChild(elementData.gf);
-        if (elementData.maskId) {
-            this.globalData.defs.appendChild(elementData.ms);
-            this.globalData.defs.appendChild(elementData.of);
-            pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
-        }
-    }
-    
-    if(data.ty === 'st' || data.ty === 'gs') {
-        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
-        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
-        pathElement.setAttribute('fill-opacity','0');
-        if(data.lj === 1) {
-            pathElement.setAttribute('stroke-miterlimit',data.ml);
-        }
-    }
-
-    if(data.r === 2) {
-        pathElement.setAttribute('fill-rule', 'evenodd');
-    }
-
-    if(data.ln){
-        pathElement.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        pathElement.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    this.stylesList.push(styleOb);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = new ShapeGroupData();
-    if(data.ln){
-        elementData.gr.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        elementData.gr.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    return elementData;
-};
-
-SVGShapeElement.prototype.createTransformElement = function(data, container) {
-    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
-    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
-    var ty = 4;
-    if(data.ty === 'rc'){
-        ty = 5;
-    }else if(data.ty === 'el'){
-        ty = 6;
-    }else if(data.ty === 'sr'){
-        ty = 7;
-    }
-    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
-    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
-    var i = 0, len = this.animatedContents.length;
-    while(i < len) {
-        if(this.animatedContents[i].element === element) {
-            return;
-        }
-        i += 1;
-    }
-    this.animatedContents.push({
-        fn: SVGElementsRenderer.createRenderFunction(data),
-        element: element,
-        data: data
-    });
-};
-
-SVGShapeElement.prototype.setElementStyles = function(elementData){
-    var arr = elementData.styles;
-    var j, jLen = this.stylesList.length;
-    for (j = 0; j < jLen; j += 1) {
-        if (!this.stylesList[j].closed) {
-            arr.push(this.stylesList[j]);
-        }
-    }
-};
-
-SVGShapeElement.prototype.reloadShapes = function(){
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for( i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
-    len = this.dynamicProperties.length;
-    for(i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-};
-
-SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._render = render;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], level);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].style.pElem);
-            }
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].gr);
-            }
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                itemsData[i] = this.createTransformElement(arr[i], container);
-            }
-            currentTransform = itemsData[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
-            }
-            this.setElementStyles(itemsData[i]);
-
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        }else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                render = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    len = ownStyles.length;
-    for(i=0;i<len;i+=1){
-        ownStyles[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-SVGShapeElement.prototype.renderInnerContent = function() {
-    this.renderModifiers();
-    var i, len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        this.stylesList[i].reset();
-    }
-    this.renderShape();
-
+SVGShapeElement.prototype.filterUniqueShapes = function () {
+  var i;
+  var len = this.shapes.length;
+  var shape;
+  var j;
+  var jLen = this.stylesList.length;
+  var style;
+  var tempShapes = [];
+  var areAnimated = false;
+  for (j = 0; j < jLen; j += 1) {
+    style = this.stylesList[j];
+    areAnimated = false;
+    tempShapes.length = 0;
     for (i = 0; i < len; i += 1) {
-        if (this.stylesList[i]._mdf || this._isFirstFrame) {
-            if(this.stylesList[i].msElem){
-                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                //Adding M0 0 fixes same mask bug on all browsers
-                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
-            }
-            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
-        }
+      shape = this.shapes[i];
+      if (shape.styles.indexOf(style) !== -1) {
+        tempShapes.push(shape);
+        areAnimated = shape._isAnimated || areAnimated;
+      }
     }
+    if (tempShapes.length > 1 && areAnimated) {
+      this.setShapesAsAnimated(tempShapes);
+    }
+  }
 };
 
-SVGShapeElement.prototype.renderShape = function() {
-    var i, len = this.animatedContents.length;
-    var animatedContent;
-    for(i = 0; i < len; i += 1) {
-        animatedContent = this.animatedContents[i];
-        if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
-            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
-        }
-    }
-}
-
-SVGShapeElement.prototype.destroy = function(){
-    this.destroyBaseElement();
-    this.shapesData = null;
-    this.itemsData = null;
+SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
+  var i;
+  var len = shapes.length;
+  for (i = 0; i < len; i += 1) {
+    shapes[i].setAsAnimated();
+  }
 };
 
-function SVGTintFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    feColorMatrix.setAttribute('result','f2');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-    if(filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k){
-        var feMerge = createNS('feMerge');
-        filter.appendChild(feMerge);
-        var feMergeNode;
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','SourceGraphic');
-        feMerge.appendChild(feMergeNode);
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','f2');
-        feMerge.appendChild(feMergeNode);
-    }
-}
+SVGShapeElement.prototype.createStyleElement = function (data, level) {
+  // TODO: prevent drawing of hidden styles
+  var elementData;
+  var styleOb = new SVGStyleData(data, level);
 
-SVGTintFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var colorBlack = this.filterManager.effectElements[0].p.v;
-        var colorWhite = this.filterManager.effectElements[1].p.v;
-        var opacity = this.filterManager.effectElements[2].p.v/100;
-        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 ' + opacity + ' 0');
+  var pathElement = styleOb.pElem;
+  if (data.ty === 'st') {
+    elementData = new SVGStrokeStyleData(this, data, styleOb);
+  } else if (data.ty === 'fl') {
+    elementData = new SVGFillStyleData(this, data, styleOb);
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+    elementData = new GradientConstructor(this, data, styleOb);
+    this.globalData.defs.appendChild(elementData.gf);
+    if (elementData.maskId) {
+      this.globalData.defs.appendChild(elementData.ms);
+      this.globalData.defs.appendChild(elementData.of);
+      pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
     }
+  }
+
+  if (data.ty === 'st' || data.ty === 'gs') {
+    pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+    pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
+    pathElement.setAttribute('fill-opacity', '0');
+    if (data.lj === 1) {
+      pathElement.setAttribute('stroke-miterlimit', data.ml);
+    }
+  }
+
+  if (data.r === 2) {
+    pathElement.setAttribute('fill-rule', 'evenodd');
+  }
+
+  if (data.ln) {
+    pathElement.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    pathElement.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  this.stylesList.push(styleOb);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
 };
-function SVGFillFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-}
-SVGFillFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color = this.filterManager.effectElements[2].p.v;
-        var opacity = this.filterManager.effectElements[6].p.v;
-        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');
-    }
+
+SVGShapeElement.prototype.createGroupElement = function (data) {
+  var elementData = new ShapeGroupData();
+  if (data.ln) {
+    elementData.gr.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    elementData.gr.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  return elementData;
 };
-function SVGGaussianBlurEffect(filter, filterManager){
-    // Outset the filter region by 100% on all sides to accommodate blur expansion.
-    filter.setAttribute('x','-100%');
-    filter.setAttribute('y','-100%');
-    filter.setAttribute('width','300%');
-    filter.setAttribute('height','300%');
 
-    this.filterManager = filterManager;
-    var feGaussianBlur = createNS('feGaussianBlur');
-    filter.appendChild(feGaussianBlur);
-    this.feGaussianBlur = feGaussianBlur;
-}
+SVGShapeElement.prototype.createTransformElement = function (data, container) {
+  var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
+  var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-SVGGaussianBlurEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        // Empirical value, matching AE's blur appearance.
-        var kBlurrinessToSigma = 0.3;
-        var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
+  var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-        // Dimensions mapping:
-        //
-        //   1 -> horizontal & vertical
-        //   2 -> horizontal only
-        //   3 -> vertical only
-        //
-        var dimensions = this.filterManager.effectElements[1].p.v;
-        var sigmaX = (dimensions == 3) ? 0 : sigma;
-        var sigmaY = (dimensions == 2) ? 0 : sigma;
-
-        this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + " " + sigmaY);
-
-        // Repeat edges mapping:
-        //
-        //   0 -> off -> duplicate
-        //   1 -> on  -> wrap
-        var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate';
-        this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
+  var i = 0;
+  var len = this.animatedContents.length;
+  while (i < len) {
+    if (this.animatedContents[i].element === element) {
+      return;
     }
-}
-function SVGStrokeEffect(elem, filterManager){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.elem = elem;
-    this.paths = [];
-}
+    i += 1;
+  }
+  this.animatedContents.push({
+    fn: SVGElementsRenderer.createRenderFunction(data),
+    element: element,
+    data: data,
+  });
+};
 
-SVGStrokeEffect.prototype.initialize = function(){
+SVGShapeElement.prototype.setElementStyles = function (elementData) {
+  var arr = elementData.styles;
+  var j;
+  var jLen = this.stylesList.length;
+  for (j = 0; j < jLen; j += 1) {
+    if (!this.stylesList[j].closed) {
+      arr.push(this.stylesList[j]);
+    }
+  }
+};
 
-    var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-    var path,groupPath, i, len;
-    if(this.filterManager.effectElements[1].p.v === 1){
-        len = this.elem.maskManager.masksProperties.length;
-        i = 0;
+SVGShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
+  var ownTransformers = [].concat(transformers);
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var currentTransform;
+  var modifier;
+  var processedPos;
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._render = render;
     } else {
-        i = this.filterManager.effectElements[0].p.v - 1;
-        len = i + 1;
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    groupPath = createNS('g'); 
-    groupPath.setAttribute('fill','none');
-    groupPath.setAttribute('stroke-linecap','round');
-    groupPath.setAttribute('stroke-dashoffset',1);
-    for(i;i<len;i+=1){
-        path = createNS('path');
-        groupPath.appendChild(path);
-        this.paths.push({p:path,m:i});
-    }
-    if(this.filterManager.effectElements[10].p.v === 3){
-        var mask = createNS('mask');
-        var id = createElementID();
-        mask.setAttribute('id',id);
-        mask.setAttribute('mask-type','alpha');
-        mask.appendChild(groupPath);
-        this.elem.globalData.defs.appendChild(mask);
-        var g = createNS('g');
-        g.setAttribute('mask','url(' + locationHref + '#'+id+')');
-        while (elemChildren[0]) {
-            g.appendChild(elemChildren[0]);
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], level);
+      } else {
+        itemsData[i].style.closed = false;
+      }
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].style.pElem);
+      }
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
+        for (j = 0; j < jLen; j += 1) {
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        this.elem.layerElement.appendChild(g);
-        this.masker = mask;
-        groupPath.setAttribute('stroke','#fff');
-    } else if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(this.filterManager.effectElements[10].p.v === 2){
-            elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-            while(elemChildren.length){
-                this.elem.layerElement.removeChild(elemChildren[0]);
-            }
-        }
-        this.elem.layerElement.appendChild(groupPath);
-        this.elem.layerElement.removeAttribute('mask');
-        groupPath.setAttribute('stroke','#fff');
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].gr);
+      }
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        itemsData[i] = this.createTransformElement(arr[i], container);
+      }
+      currentTransform = itemsData[i].transform;
+      ownTransformers.push(currentTransform);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+      }
+      this.setElementStyles(itemsData[i]);
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        render = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-    this.initialized = true;
-    this.pathMasker = groupPath;
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  len = ownStyles.length;
+  for (i = 0; i < len; i += 1) {
+    ownStyles[i].closed = true;
+  }
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
 };
 
-SVGStrokeEffect.prototype.renderFrame = function(forceRender){
-    if(!this.initialized){
-        this.initialize();
-    }
-    var i, len = this.paths.length;
-    var mask, path;
-    for(i=0;i<len;i+=1){
-        if(this.paths[i].m === -1) {
-            continue;
-        }
-        mask = this.elem.maskManager.viewData[this.paths[i].m];
-        path = this.paths[i].p;
-        if(forceRender || this.filterManager._mdf || mask.prop._mdf){
-            path.setAttribute('d',mask.lastPath);
-        }
-        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){
-            var dasharrayValue;
-            if(this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100){
-                var s = Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var e = Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var l = path.getTotalLength();
-                dasharrayValue = '0 0 0 ' + l*s + ' ';
-                var lineLength = l*(e-s);
-                var segment = 1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-                var units = Math.floor(lineLength/segment);
-                var j;
-                for(j=0;j<units;j+=1){
-                    dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100 + ' ';
-                }
-                dasharrayValue += '0 ' + l*10 + ' 0 0';
-            } else {
-                dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-            }
-            path.setAttribute('stroke-dasharray',dasharrayValue);
-        }
-    }
-    if(forceRender || this.filterManager.effectElements[4].p._mdf){
-        this.pathMasker.setAttribute('stroke-width',this.filterManager.effectElements[4].p.v*2);
-    }
-    
-    if(forceRender || this.filterManager.effectElements[6].p._mdf){
-        this.pathMasker.setAttribute('opacity',this.filterManager.effectElements[6].p.v);
-    }
-    if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(forceRender || this.filterManager.effectElements[3].p._mdf){
-            var color = this.filterManager.effectElements[3].p.v;
-            this.pathMasker.setAttribute('stroke','rgb('+bm_floor(color[0]*255)+','+bm_floor(color[1]*255)+','+bm_floor(color[2]*255)+')');
-        }
-    }
-};
-function SVGTritoneFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    var feComponentTransfer = createNS('feComponentTransfer');
-    feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-    filter.appendChild(feComponentTransfer);
-    this.matrixFilter = feComponentTransfer;
-    var feFuncR = createNS('feFuncR');
-    feFuncR.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncR);
-    this.feFuncR = feFuncR;
-    var feFuncG = createNS('feFuncG');
-    feFuncG.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncG);
-    this.feFuncG = feFuncG;
-    var feFuncB = createNS('feFuncB');
-    feFuncB.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncB);
-    this.feFuncB = feFuncB;
-}
+SVGShapeElement.prototype.renderInnerContent = function () {
+  this.renderModifiers();
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    this.stylesList[i].reset();
+  }
+  this.renderShape();
 
-SVGTritoneFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color1 = this.filterManager.effectElements[0].p.v;
-        var color2 = this.filterManager.effectElements[1].p.v;
-        var color3 = this.filterManager.effectElements[2].p.v;
-        var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
-        var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
-        var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
-        this.feFuncR.setAttribute('tableValues', tableR);
-        this.feFuncG.setAttribute('tableValues', tableG);
-        this.feFuncB.setAttribute('tableValues', tableB);
-        //var opacity = this.filterManager.effectElements[2].p.v/100;
-        //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 ' + opacity + ' 0');
+  for (i = 0; i < len; i += 1) {
+    if (this.stylesList[i]._mdf || this._isFirstFrame) {
+      if (this.stylesList[i].msElem) {
+        this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+        // Adding M0 0 fixes same mask bug on all browsers
+        this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+      }
+      this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
     }
-};
-function SVGProLevelsFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var effectElements = this.filterManager.effectElements;
-    var feComponentTransfer = createNS('feComponentTransfer');
-    var feFuncR, feFuncG, feFuncB;
-    
-    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){
-        this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
-    }
-    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){
-        this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
-    }
-    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){
-        this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-    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){
-        this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
-    }
-    
-    if(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA){
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        feComponentTransfer = createNS('feComponentTransfer');
-    }
-
-    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){
-
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
-        this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
-        this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-}
-
-SVGProLevelsFilter.prototype.createFeFunc = function(type, feComponentTransfer) {
-    var feFunc = createNS(type);
-    feFunc.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFunc);
-    return feFunc;
+  }
 };
 
-SVGProLevelsFilter.prototype.getTableValue = function(inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
-    var cnt = 0;
-    var segments = 256;
-    var perc;
-    var min = Math.min(inputBlack, inputWhite);
-    var max = Math.max(inputBlack, inputWhite);
-    var table = Array.call(null,{length:segments});
-    var colorValue;
-    var pos = 0;
-    var outputDelta = outputWhite - outputBlack; 
-    var inputDelta = inputWhite - inputBlack; 
-    while(cnt <= 256) {
-        perc = cnt/256;
-        if(perc <= min){
-            colorValue = inputDelta < 0 ? outputWhite : outputBlack;
-        } else if(perc >= max){
-            colorValue = inputDelta < 0 ? outputBlack : outputWhite;
-        } else {
-            colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
-        }
-        table[pos++] = colorValue;
-        cnt += 256/(segments-1);
+SVGShapeElement.prototype.renderShape = function () {
+  var i;
+  var len = this.animatedContents.length;
+  var animatedContent;
+  for (i = 0; i < len; i += 1) {
+    animatedContent = this.animatedContents[i];
+    if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
+      animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
     }
-    return table.join(' ');
+  }
 };
 
-SVGProLevelsFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var val, cnt, perc, bezier;
-        var effectElements = this.filterManager.effectElements;
-        if(this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)){
-            val = this.getTableValue(effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v,effectElements[7].p.v);
-            this.feFuncRComposed.setAttribute('tableValues',val);
-            this.feFuncGComposed.setAttribute('tableValues',val);
-            this.feFuncBComposed.setAttribute('tableValues',val);
-        }
-
-
-        if(this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)){
-            val = this.getTableValue(effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v,effectElements[14].p.v);
-            this.feFuncR.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)){
-            val = this.getTableValue(effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v,effectElements[21].p.v);
-            this.feFuncG.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)){
-            val = this.getTableValue(effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v,effectElements[28].p.v);
-            this.feFuncB.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)){
-            val = this.getTableValue(effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v,effectElements[35].p.v);
-            this.feFuncA.setAttribute('tableValues',val);
-        }
-        
-    }
+SVGShapeElement.prototype.destroy = function () {
+  this.destroyBaseElement();
+  this.shapesData = null;
+  this.itemsData = null;
 };
-function SVGDropShadowEffect(filter, filterManager) {
-    var filterSize = filterManager.container.globalData.renderConfig.filterSize
-    filter.setAttribute('x', filterSize.x);
-    filter.setAttribute('y', filterSize.y);
-    filter.setAttribute('width', filterSize.width);
-    filter.setAttribute('height', filterSize.height);
-    this.filterManager = filterManager;
 
-    var feGaussianBlur = createNS('feGaussianBlur');
-    feGaussianBlur.setAttribute('in','SourceAlpha');
-    feGaussianBlur.setAttribute('result','drop_shadow_1');
-    feGaussianBlur.setAttribute('stdDeviation','0');
-    this.feGaussianBlur = feGaussianBlur;
-    filter.appendChild(feGaussianBlur);
+/* global createNS */
 
-    var feOffset = createNS('feOffset');
-    feOffset.setAttribute('dx','25');
-    feOffset.setAttribute('dy','0');
-    feOffset.setAttribute('in','drop_shadow_1');
-    feOffset.setAttribute('result','drop_shadow_2');
-    this.feOffset = feOffset;
-    filter.appendChild(feOffset);
-    var feFlood = createNS('feFlood');
-    feFlood.setAttribute('flood-color','#00ff00');
-    feFlood.setAttribute('flood-opacity','1');
-    feFlood.setAttribute('result','drop_shadow_3');
-    this.feFlood = feFlood;
-    filter.appendChild(feFlood);
-
-    var feComposite = createNS('feComposite');
-    feComposite.setAttribute('in','drop_shadow_3');
-    feComposite.setAttribute('in2','drop_shadow_2');
-    feComposite.setAttribute('operator','in');
-    feComposite.setAttribute('result','drop_shadow_4');
-    filter.appendChild(feComposite);
-
-
+function SVGTintFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  feColorMatrix.setAttribute('result', 'f2');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+  if (filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k) {
     var feMerge = createNS('feMerge');
     filter.appendChild(feMerge);
     var feMergeNode;
     feMergeNode = createNS('feMergeNode');
+    feMergeNode.setAttribute('in', 'SourceGraphic');
     feMerge.appendChild(feMergeNode);
     feMergeNode = createNS('feMergeNode');
-    feMergeNode.setAttribute('in','SourceGraphic');
-    this.feMergeNode = feMergeNode;
-    this.feMerge = feMerge;
-    this.originalNodeAdded = false;
+    feMergeNode.setAttribute('in', 'f2');
     feMerge.appendChild(feMergeNode);
+  }
 }
 
-SVGDropShadowEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        if(forceRender || this.filterManager.effectElements[4].p._mdf){
-            this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+SVGTintFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var colorBlack = this.filterManager.effectElements[0].p.v;
+    var colorWhite = this.filterManager.effectElements[1].p.v;
+    var opacity = this.filterManager.effectElements[2].p.v / 100;
+    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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGFillFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+}
+SVGFillFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color = this.filterManager.effectElements[2].p.v;
+    var opacity = this.filterManager.effectElements[6].p.v;
+    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');
+  }
+};
+
+/* global createNS */
+
+function SVGGaussianBlurEffect(filter, filterManager) {
+  // Outset the filter region by 100% on all sides to accommodate blur expansion.
+  filter.setAttribute('x', '-100%');
+  filter.setAttribute('y', '-100%');
+  filter.setAttribute('width', '300%');
+  filter.setAttribute('height', '300%');
+
+  this.filterManager = filterManager;
+  var feGaussianBlur = createNS('feGaussianBlur');
+  filter.appendChild(feGaussianBlur);
+  this.feGaussianBlur = feGaussianBlur;
+}
+
+SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    // Empirical value, matching AE's blur appearance.
+    var kBlurrinessToSigma = 0.3;
+    var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+
+    // Dimensions mapping:
+    //
+    //   1 -> horizontal & vertical
+    //   2 -> horizontal only
+    //   3 -> vertical only
+    //
+    var dimensions = this.filterManager.effectElements[1].p.v;
+    var sigmaX = (dimensions == 3) ? 0 : sigma; // eslint-disable-line eqeqeq
+    var sigmaY = (dimensions == 2) ? 0 : sigma; // eslint-disable-line eqeqeq
+
+    this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + ' ' + sigmaY);
+
+    // Repeat edges mapping:
+    //
+    //   0 -> off -> duplicate
+    //   1 -> on  -> wrap
+    var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate'; // eslint-disable-line eqeqeq
+    this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+  }
+};
+
+/* global createNS, createElementID, locationHref, bmFloor */
+
+function SVGStrokeEffect(elem, filterManager) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.elem = elem;
+  this.paths = [];
+}
+
+SVGStrokeEffect.prototype.initialize = function () {
+  var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+  var path;
+  var groupPath;
+  var i;
+  var len;
+  if (this.filterManager.effectElements[1].p.v === 1) {
+    len = this.elem.maskManager.masksProperties.length;
+    i = 0;
+  } else {
+    i = this.filterManager.effectElements[0].p.v - 1;
+    len = i + 1;
+  }
+  groupPath = createNS('g');
+  groupPath.setAttribute('fill', 'none');
+  groupPath.setAttribute('stroke-linecap', 'round');
+  groupPath.setAttribute('stroke-dashoffset', 1);
+  for (i; i < len; i += 1) {
+    path = createNS('path');
+    groupPath.appendChild(path);
+    this.paths.push({ p: path, m: i });
+  }
+  if (this.filterManager.effectElements[10].p.v === 3) {
+    var mask = createNS('mask');
+    var id = createElementID();
+    mask.setAttribute('id', id);
+    mask.setAttribute('mask-type', 'alpha');
+    mask.appendChild(groupPath);
+    this.elem.globalData.defs.appendChild(mask);
+    var g = createNS('g');
+    g.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+    while (elemChildren[0]) {
+      g.appendChild(elemChildren[0]);
+    }
+    this.elem.layerElement.appendChild(g);
+    this.masker = mask;
+    groupPath.setAttribute('stroke', '#fff');
+  } else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (this.filterManager.effectElements[10].p.v === 2) {
+      elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+      while (elemChildren.length) {
+        this.elem.layerElement.removeChild(elemChildren[0]);
+      }
+    }
+    this.elem.layerElement.appendChild(groupPath);
+    this.elem.layerElement.removeAttribute('mask');
+    groupPath.setAttribute('stroke', '#fff');
+  }
+  this.initialized = true;
+  this.pathMasker = groupPath;
+};
+
+SVGStrokeEffect.prototype.renderFrame = function (forceRender) {
+  if (!this.initialized) {
+    this.initialize();
+  }
+  var i;
+  var len = this.paths.length;
+  var mask;
+  var path;
+  for (i = 0; i < len; i += 1) {
+    if (this.paths[i].m !== -1) {
+      mask = this.elem.maskManager.viewData[this.paths[i].m];
+      path = this.paths[i].p;
+      if (forceRender || this.filterManager._mdf || mask.prop._mdf) {
+        path.setAttribute('d', mask.lastPath);
+      }
+      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) {
+        var dasharrayValue;
+        if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) {
+          var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var l = path.getTotalLength();
+          dasharrayValue = '0 0 0 ' + l * s + ' ';
+          var lineLength = l * (e - s);
+          var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
+          var units = Math.floor(lineLength / segment);
+          var j;
+          for (j = 0; j < units; j += 1) {
+            dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' ';
+          }
+          dasharrayValue += '0 ' + l * 10 + ' 0 0';
+        } else {
+          dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
         }
-        if(forceRender || this.filterManager.effectElements[0].p._mdf){
-            var col = this.filterManager.effectElements[0].p.v;
-            this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255)));
-        }
-        if(forceRender || this.filterManager.effectElements[1].p._mdf){
-            this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255);
-        }
-        if(forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf){
-            var distance = this.filterManager.effectElements[3].p.v;
-            var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
-            var x = distance * Math.cos(angle);
-            var y = distance * Math.sin(angle);
-            this.feOffset.setAttribute('dx', x);
-            this.feOffset.setAttribute('dy', y);
-        }
-        /*if(forceRender || this.filterManager.effectElements[5].p._mdf){
+        path.setAttribute('stroke-dasharray', dasharrayValue);
+      }
+    }
+  }
+  if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+    this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2);
+  }
+
+  if (forceRender || this.filterManager.effectElements[6].p._mdf) {
+    this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v);
+  }
+  if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (forceRender || this.filterManager.effectElements[3].p._mdf) {
+      var color = this.filterManager.effectElements[3].p.v;
+      this.pathMasker.setAttribute('stroke', 'rgb(' + bmFloor(color[0] * 255) + ',' + bmFloor(color[1] * 255) + ',' + bmFloor(color[2] * 255) + ')');
+    }
+  }
+};
+
+/* global createNS */
+
+function SVGTritoneFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  var feComponentTransfer = createNS('feComponentTransfer');
+  feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+  filter.appendChild(feComponentTransfer);
+  this.matrixFilter = feComponentTransfer;
+  var feFuncR = createNS('feFuncR');
+  feFuncR.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncR);
+  this.feFuncR = feFuncR;
+  var feFuncG = createNS('feFuncG');
+  feFuncG.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncG);
+  this.feFuncG = feFuncG;
+  var feFuncB = createNS('feFuncB');
+  feFuncB.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncB);
+  this.feFuncB = feFuncB;
+}
+
+SVGTritoneFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color1 = this.filterManager.effectElements[0].p.v;
+    var color2 = this.filterManager.effectElements[1].p.v;
+    var color3 = this.filterManager.effectElements[2].p.v;
+    var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
+    var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
+    var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
+    this.feFuncR.setAttribute('tableValues', tableR);
+    this.feFuncG.setAttribute('tableValues', tableG);
+    this.feFuncB.setAttribute('tableValues', tableB);
+    // var opacity = this.filterManager.effectElements[2].p.v/100;
+    // 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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGProLevelsFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var effectElements = this.filterManager.effectElements;
+  var feComponentTransfer = createNS('feComponentTransfer');
+
+  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) {
+    this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
+  }
+  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) {
+    this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
+  }
+  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) {
+    this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+  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) {
+    this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
+  }
+
+  if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    feComponentTransfer = createNS('feComponentTransfer');
+  }
+
+  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) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
+    this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
+    this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+}
+
+SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) {
+  var feFunc = createNS(type);
+  feFunc.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFunc);
+  return feFunc;
+};
+
+SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
+  var cnt = 0;
+  var segments = 256;
+  var perc;
+  var min = Math.min(inputBlack, inputWhite);
+  var max = Math.max(inputBlack, inputWhite);
+  var table = Array.call(null, { length: segments });
+  var colorValue;
+  var pos = 0;
+  var outputDelta = outputWhite - outputBlack;
+  var inputDelta = inputWhite - inputBlack;
+  while (cnt <= 256) {
+    perc = cnt / 256;
+    if (perc <= min) {
+      colorValue = inputDelta < 0 ? outputWhite : outputBlack;
+    } else if (perc >= max) {
+      colorValue = inputDelta < 0 ? outputBlack : outputWhite;
+    } else {
+      colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
+    }
+    table[pos] = colorValue;
+    pos += 1;
+    cnt += 256 / (segments - 1);
+  }
+  return table.join(' ');
+};
+
+SVGProLevelsFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var val;
+    var effectElements = this.filterManager.effectElements;
+    if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) {
+      val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v);
+      this.feFuncRComposed.setAttribute('tableValues', val);
+      this.feFuncGComposed.setAttribute('tableValues', val);
+      this.feFuncBComposed.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) {
+      val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v);
+      this.feFuncR.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) {
+      val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v);
+      this.feFuncG.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) {
+      val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v);
+      this.feFuncB.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) {
+      val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v);
+      this.feFuncA.setAttribute('tableValues', val);
+    }
+  }
+};
+
+/* global createNS, rgbToHex, degToRads */
+
+function SVGDropShadowEffect(filter, filterManager) {
+  var filterSize = filterManager.container.globalData.renderConfig.filterSize;
+  filter.setAttribute('x', filterSize.x);
+  filter.setAttribute('y', filterSize.y);
+  filter.setAttribute('width', filterSize.width);
+  filter.setAttribute('height', filterSize.height);
+  this.filterManager = filterManager;
+
+  var feGaussianBlur = createNS('feGaussianBlur');
+  feGaussianBlur.setAttribute('in', 'SourceAlpha');
+  feGaussianBlur.setAttribute('result', 'drop_shadow_1');
+  feGaussianBlur.setAttribute('stdDeviation', '0');
+  this.feGaussianBlur = feGaussianBlur;
+  filter.appendChild(feGaussianBlur);
+
+  var feOffset = createNS('feOffset');
+  feOffset.setAttribute('dx', '25');
+  feOffset.setAttribute('dy', '0');
+  feOffset.setAttribute('in', 'drop_shadow_1');
+  feOffset.setAttribute('result', 'drop_shadow_2');
+  this.feOffset = feOffset;
+  filter.appendChild(feOffset);
+  var feFlood = createNS('feFlood');
+  feFlood.setAttribute('flood-color', '#00ff00');
+  feFlood.setAttribute('flood-opacity', '1');
+  feFlood.setAttribute('result', 'drop_shadow_3');
+  this.feFlood = feFlood;
+  filter.appendChild(feFlood);
+
+  var feComposite = createNS('feComposite');
+  feComposite.setAttribute('in', 'drop_shadow_3');
+  feComposite.setAttribute('in2', 'drop_shadow_2');
+  feComposite.setAttribute('operator', 'in');
+  feComposite.setAttribute('result', 'drop_shadow_4');
+  filter.appendChild(feComposite);
+
+  var feMerge = createNS('feMerge');
+  filter.appendChild(feMerge);
+  var feMergeNode;
+  feMergeNode = createNS('feMergeNode');
+  feMerge.appendChild(feMergeNode);
+  feMergeNode = createNS('feMergeNode');
+  feMergeNode.setAttribute('in', 'SourceGraphic');
+  this.feMergeNode = feMergeNode;
+  this.feMerge = feMerge;
+  this.originalNodeAdded = false;
+  feMerge.appendChild(feMergeNode);
+}
+
+SVGDropShadowEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+      this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+    }
+    if (forceRender || this.filterManager.effectElements[0].p._mdf) {
+      var col = this.filterManager.effectElements[0].p.v;
+      this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255)));
+    }
+    if (forceRender || this.filterManager.effectElements[1].p._mdf) {
+      this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255);
+    }
+    if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {
+      var distance = this.filterManager.effectElements[3].p.v;
+      var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
+      var x = distance * Math.cos(angle);
+      var y = distance * Math.sin(angle);
+      this.feOffset.setAttribute('dx', x);
+      this.feOffset.setAttribute('dy', y);
+    }
+    /* if(forceRender || this.filterManager.effectElements[5].p._mdf){
             if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
                 this.feMerge.removeChild(this.feMergeNode);
                 this.originalNodeAdded = false;
@@ -8957,1061 +9479,1144 @@
                 this.feMerge.appendChild(this.feMergeNode);
                 this.originalNodeAdded = true;
             }
-        }*/
-    }
+        } */
+  }
 };
+
+/* global createElementID, createNS */
+
 var _svgMatteSymbols = [];
 
-function SVGMatte3Effect(filterElem, filterManager, elem){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.filterElem = filterElem;
-    this.elem = elem;
-    elem.matteElement = createNS('g');
-    elem.matteElement.appendChild(elem.layerElement);
-    elem.matteElement.appendChild(elem.transformedElement);
-    elem.baseElement = elem.matteElement;
+function SVGMatte3Effect(filterElem, filterManager, elem) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.filterElem = filterElem;
+  this.elem = elem;
+  elem.matteElement = createNS('g');
+  elem.matteElement.appendChild(elem.layerElement);
+  elem.matteElement.appendChild(elem.transformedElement);
+  elem.baseElement = elem.matteElement;
 }
 
-SVGMatte3Effect.prototype.findSymbol = function(mask) {
-    var i = 0, len = _svgMatteSymbols.length;
-    while(i < len) {
-        if(_svgMatteSymbols[i] === mask) {
-            return _svgMatteSymbols[i];
-        }
-        i += 1;
+SVGMatte3Effect.prototype.findSymbol = function (mask) {
+  var i = 0;
+  var len = _svgMatteSymbols.length;
+  while (i < len) {
+    if (_svgMatteSymbols[i] === mask) {
+      return _svgMatteSymbols[i];
     }
-    return null;
+    i += 1;
+  }
+  return null;
 };
 
-SVGMatte3Effect.prototype.replaceInParent = function(mask, symbolId) {
-    var parentNode = mask.layerElement.parentNode;
-    if(!parentNode) {
-        return;
+SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) {
+  var parentNode = mask.layerElement.parentNode;
+  if (!parentNode) {
+    return;
+  }
+  var children = parentNode.children;
+  var i = 0;
+  var len = children.length;
+  while (i < len) {
+    if (children[i] === mask.layerElement) {
+      break;
     }
-    var children = parentNode.children;
-    var i = 0, len = children.length;
-    while (i < len) {
-        if (children[i] === mask.layerElement) {
-            break;
-        }
-        i += 1;
-    }
-    var nextChild;
-    if (i <= len - 2) {
-        nextChild = children[i + 1];
-    }
+    i += 1;
+  }
+  var nextChild;
+  if (i <= len - 2) {
+    nextChild = children[i + 1];
+  }
+  var useElem = createNS('use');
+  useElem.setAttribute('href', '#' + symbolId);
+  if (nextChild) {
+    parentNode.insertBefore(useElem, nextChild);
+  } else {
+    parentNode.appendChild(useElem);
+  }
+};
+
+SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) {
+  if (!this.findSymbol(mask)) {
+    var symbolId = createElementID();
+    var masker = createNS('mask');
+    masker.setAttribute('id', mask.layerId);
+    masker.setAttribute('mask-type', 'alpha');
+    _svgMatteSymbols.push(mask);
+    var defs = elem.globalData.defs;
+    defs.appendChild(masker);
+    var symbol = createNS('symbol');
+    symbol.setAttribute('id', symbolId);
+    this.replaceInParent(mask, symbolId);
+    symbol.appendChild(mask.layerElement);
+    defs.appendChild(symbol);
     var useElem = createNS('use');
     useElem.setAttribute('href', '#' + symbolId);
-    if(nextChild) {
-        parentNode.insertBefore(useElem, nextChild);
-    } else {
-        parentNode.appendChild(useElem);
-    }
+    masker.appendChild(useElem);
+    mask.data.hd = false;
+    mask.show();
+  }
+  elem.setMatte(mask.layerId);
 };
 
-SVGMatte3Effect.prototype.setElementAsMask = function(elem, mask) {
-    if(!this.findSymbol(mask)) {
-        var symbolId = createElementID();
-        var masker = createNS('mask');
-        masker.setAttribute('id', mask.layerId);
-        masker.setAttribute('mask-type', 'alpha');
-        _svgMatteSymbols.push(mask);
-        var defs = elem.globalData.defs;
-        defs.appendChild(masker);
-        var symbol = createNS('symbol');
-        symbol.setAttribute('id', symbolId);
-        this.replaceInParent(mask, symbolId);
-        symbol.appendChild(mask.layerElement);
-        defs.appendChild(symbol);
-        var useElem = createNS('use');
-        useElem.setAttribute('href', '#' + symbolId);
-        masker.appendChild(useElem);
-        mask.data.hd = false;
-        mask.show();
+SVGMatte3Effect.prototype.initialize = function () {
+  var ind = this.filterManager.effectElements[0].p.v;
+  var elements = this.elem.comp.elements;
+  var i = 0;
+  var len = elements.length;
+  while (i < len) {
+    if (elements[i] && elements[i].data.ind === ind) {
+      this.setElementAsMask(this.elem, elements[i]);
     }
-    elem.setMatte(mask.layerId);
+    i += 1;
+  }
+  this.initialized = true;
 };
 
-SVGMatte3Effect.prototype.initialize = function() {
-    var ind = this.filterManager.effectElements[0].p.v;
-    var elements = this.elem.comp.elements;
-    var i = 0, len = elements.length;
+SVGMatte3Effect.prototype.renderFrame = function () {
+  if (!this.initialized) {
+    this.initialize();
+  }
+};
+
+/* exported SVGEffects */
+
+function SVGEffects() {}
+
+/* global createTag, AnimationItem */
+/* exported animationManager */
+
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
     while (i < len) {
-    	if (elements[i] && elements[i].data.ind === ind) {
-    		this.setElementAsMask(this.elem, elements[i]);
-    	}
-    	i += 1;
-    }
-    this.initialized = true;
-};
-
-SVGMatte3Effect.prototype.renderFrame = function() {
-	if(!this.initialized) {
-		this.initialize();
-	}
-};
-function SVGEffects(){}
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
-
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      window.requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            window.requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    window.requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        window.requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations(animationData, standalone, renderer) {
+    var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+      [].slice.call(document.getElementsByClassName('bodymovin')));
+    var i;
+    var lenAnims = animElements.length;
+    for (i = 0; i < lenAnims; i += 1) {
+      if (renderer) {
+        animElements[i].setAttribute('data-bm-type', renderer);
+      }
+      registerAnimation(animElements[i], animationData);
     }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
-                  [].slice.call(document.getElementsByClassName('bodymovin')));
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerText = '';
-            var div = createTag('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
+    if (standalone && lenAnims === 0) {
+      if (!renderer) {
+        renderer = 'svg';
+      }
+      var body = document.getElementsByTagName('body')[0];
+      body.innerText = '';
+      var div = createTag('div');
+      div.style.width = '100%';
+      div.style.height = '100%';
+      div.setAttribute('data-bm-type', renderer);
+      body.appendChild(div);
+      registerAnimation(div, animationData);
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                window.requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        window.requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function freeze() {
-        _isFrozen = true;
+  function freeze() {
+    _isFrozen = true;
+  }
+
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
+
+  function setVolume(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setVolume(val, animation);
     }
+  }
 
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
+  function mute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.mute(animation);
     }
+  }
 
-    function setVolume(val,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setVolume(val, animation);
-        }
+  function unmute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.unmute(animation);
     }
+  }
 
-    function mute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.mute(animation);
-        }
-    }
-
-    function unmute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.unmute(animation);
-        }
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.setVolume = setVolume;
-    moduleOb.mute = mute;
-    moduleOb.unmute = unmute;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.setVolume = setVolume;
+  moduleOb.mute = mute;
+  moduleOb.unmute = unmute;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
+/* global createElementID, subframeEnabled, ProjectInterface, ImagePreloader, audioControllerFactory, extendPrototype, BaseEvent,
+CanvasRenderer, SVGRenderer, HybridRenderer, assetLoader, dataManager, expressionsPlugin, BMEnterFrameEvent, BMCompleteLoopEvent,
+BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent,
+BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent */
+
 var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.firstFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.playCount = 0;
-    this.animationData = {};
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = createElementID();
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.isSubframeEnabled = subframeEnabled;
-    this.segments = [];
-    this._idle = true;
-    this._completedLoop = false;
-    this.projectInterface = ProjectInterface();
-    this.imagePreloader = new ImagePreloader();
-    this.audioController = audioControllerFactory();
+  this._cbs = [];
+  this.name = '';
+  this.path = '';
+  this.isLoaded = false;
+  this.currentFrame = 0;
+  this.currentRawFrame = 0;
+  this.firstFrame = 0;
+  this.totalFrames = 0;
+  this.frameRate = 0;
+  this.frameMult = 0;
+  this.playSpeed = 1;
+  this.playDirection = 1;
+  this.playCount = 0;
+  this.animationData = {};
+  this.assets = [];
+  this.isPaused = true;
+  this.autoplay = false;
+  this.loop = true;
+  this.renderer = null;
+  this.animationID = createElementID();
+  this.assetsPath = '';
+  this.timeCompleted = 0;
+  this.segmentPos = 0;
+  this.isSubframeEnabled = subframeEnabled;
+  this.segments = [];
+  this._idle = true;
+  this._completedLoop = false;
+  this.projectInterface = ProjectInterface();
+  this.imagePreloader = new ImagePreloader();
+  this.audioController = audioControllerFactory();
 };
 
 extendPrototype([BaseEvent], AnimationItem);
 
-AnimationItem.prototype.setParams = function(params) {
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-    if (params.loop === ''
+AnimationItem.prototype.setParams = function (params) {
+  if (params.wrapper || params.container) {
+    this.wrapper = params.wrapper || params.container;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    case 'svg':
+      this.renderer = new SVGRenderer(this, params.rendererSettings);
+      break;
+    default:
+      this.renderer = new HybridRenderer(this, params.rendererSettings);
+      break;
+  }
+  this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+  if (params.loop === ''
         || params.loop === null
         || params.loop === undefined
-        || params.loop === true)
-    {
-        this.loop = true;
-    } else if (params.loop === false) {
-        this.loop = false;
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = params.assetsPath;
+  this.initialSegment = params.initialSegment;
+  if (params.audioFactory) {
+    this.audioController.setAudioFactory(params.audioFactory);
+  }
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    if (params.path.lastIndexOf('\\') !== -1) {
+      this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
     } else {
-        this.loop = parseInt(params.loop);
+      this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
     }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = params.assetsPath;
-    this.initialSegment = params.initialSegment;
-    if (params.audioFactory) {
-        this.audioController.setAudioFactory(params.audioFactory);
-    }
-    if (params.animationData) {
-        this.configAnimation(params.animationData);
-    } else if(params.path){
+    this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
+    this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
 
-        if( params.path.lastIndexOf('\\') !== -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        } else {
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-
-        assetLoader.load(params.path, this.configAnimation.bind(this), function() {
-            this.trigger('data_failed');
-        }.bind(this));
-    }
-
+    assetLoader.load(params.path, this.configAnimation.bind(this), function () {
+      this.trigger('data_failed');
+    }.bind(this));
+  }
 };
 
 AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
+  if (animationData) {
+    if (typeof animationData !== 'object') {
+      animationData = JSON.parse(animationData);
     }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
+  }
+  var params = {
+    wrapper: wrapper,
+    animationData: animationData,
+  };
+  var wrapperAttributes = wrapper.attributes;
 
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
+  params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-animation-path').value
+    : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-path').value
+      : wrapperAttributes.getNamedItem('bm-path')
+        ? wrapperAttributes.getNamedItem('bm-path').value
+        : '';
+  params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-type').value
+    : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-type').value
+      : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
+        ? wrapperAttributes.getNamedItem('bm-type').value
+        : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
+          ? wrapperAttributes.getNamedItem('data-bm-renderer').value
+          : wrapperAttributes.getNamedItem('bm-renderer')
+            ? wrapperAttributes.getNamedItem('bm-renderer').value
+            : 'canvas';
 
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
+  var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-loop').value
+    : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-loop').value
+      : wrapperAttributes.getNamedItem('bm-loop')
+        ? wrapperAttributes.getNamedItem('bm-loop').value
+        : '';
+  if (loop === 'false') {
+    params.loop = false;
+  } else if (loop === 'true') {
+    params.loop = true;
+  } else if (loop !== '') {
+    params.loop = parseInt(loop, 10);
+  }
+  var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-autoplay').value
+    : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-autoplay').value
+      : wrapperAttributes.getNamedItem('bm-autoplay')
+        ? wrapperAttributes.getNamedItem('bm-autoplay').value
+        : true;
+  params.autoplay = autoplay !== 'false';
+
+  params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-name').value
+    : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-name').value
+      : wrapperAttributes.getNamedItem('bm-name')
+        ? wrapperAttributes.getNamedItem('bm-name').value
+        : '';
+  var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-prerender').value
+    : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-prerender').value
+      : wrapperAttributes.getNamedItem('bm-prerender')
+        ? wrapperAttributes.getNamedItem('bm-prerender').value
+        : '';
+
+  if (prerender === 'false') {
+    params.prerender = false;
+  }
+  this.setParams(params);
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
+  }
+  if (data.chars || data.fonts) {
+    this.renderer.globalData.fontManager.addChars(data.chars);
+    this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
+  }
+  if (data.assets) {
+    len = data.assets.length;
+    for (i = 0; i < len; i += 1) {
+      this.animationData.assets.push(data.assets[i]);
     }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
-        this.trigger('data_failed');
-    }.bind(this));
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.trigger('data_ready');
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  var segment = segments.shift();
+  this.timeCompleted = segment.time * this.frameRate;
+  var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
+  this.segmentPos += 1;
+  assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
+    this.trigger('data_failed');
+  }.bind(this));
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
-    }
-    this.loadNextSegment();
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.imagesLoaded = function() {
-    this.trigger('loaded_images');
-    this.checkLoaded()
-}
+AnimationItem.prototype.imagesLoaded = function () {
+  this.trigger('loaded_images');
+  this.checkLoaded();
+};
 
-AnimationItem.prototype.preloadImages = function() {
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
-}
+AnimationItem.prototype.preloadImages = function () {
+  this.imagePreloader.setAssetsPath(this.assetsPath);
+  this.imagePreloader.setPath(this.path);
+  this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
+};
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    try {
-        this.animationData = animData;
+  if (!this.renderer) {
+    return;
+  }
+  try {
+    this.animationData = animData;
 
-        if (this.initialSegment) {
-            this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
-            this.firstFrame = Math.round(this.initialSegment[0]);
-        } else {
-            this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-            this.firstFrame = Math.round(this.animationData.ip);
-        }
-        this.renderer.configAnimation(animData);
-        if(!animData.assets){
-            animData.assets = [];
-        }
-
-        this.assets = this.animationData.assets;
-        this.frameRate = this.animationData.fr;
-        this.frameMult = this.animationData.fr / 1000;
-        this.renderer.searchExtraCompositions(animData.assets);
-        this.trigger('config_ready');
-        this.preloadImages();
-        this.loadSegments();
-        this.updaFrameModifier();
-        this.waitForFontsLoaded();
-        if (this.isPaused) {
-            this.audioController.pause();
-        }
-    } catch(error) {
-        this.triggerConfigError(error);
+    if (this.initialSegment) {
+      this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+      this.firstFrame = Math.round(this.initialSegment[0]);
+    } else {
+      this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+      this.firstFrame = Math.round(this.animationData.ip);
     }
+    this.renderer.configAnimation(animData);
+    if (!animData.assets) {
+      animData.assets = [];
+    }
+
+    this.assets = this.animationData.assets;
+    this.frameRate = this.animationData.fr;
+    this.frameMult = this.animationData.fr / 1000;
+    this.renderer.searchExtraCompositions(animData.assets);
+    this.trigger('config_ready');
+    this.preloadImages();
+    this.loadSegments();
+    this.updaFrameModifier();
+    this.waitForFontsLoaded();
+    if (this.isPaused) {
+      this.audioController.pause();
+    }
+  } catch (error) {
+    this.triggerConfigError(error);
+  }
 };
 
-AnimationItem.prototype.waitForFontsLoaded = function(){
-    if(!this.renderer) {
-        return;
-    }
-    if(this.renderer.globalData.fontManager.isLoaded){
-        this.checkLoaded();
-    }else{
-        setTimeout(this.waitForFontsLoaded.bind(this),20);
-    }
-}
+AnimationItem.prototype.waitForFontsLoaded = function () {
+  if (!this.renderer) {
+    return;
+  }
+  if (this.renderer.globalData.fontManager.isLoaded) {
+    this.checkLoaded();
+  } else {
+    setTimeout(this.waitForFontsLoaded.bind(this), 20);
+  }
+};
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded 
+  if (!this.isLoaded
         && this.renderer.globalData.fontManager.isLoaded
         && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')
-    ) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function() {
-            this.trigger('DOMLoaded');
-        }.bind(this), 0);
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
+  ) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    setTimeout(function () {
+      this.trigger('DOMLoaded');
+    }.bind(this), 0);
+    this.gotoFrame();
+    if (this.autoplay) {
+      this.play();
+    }
+  }
 };
 
 AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
+  this.renderer.updateContainerSize();
 };
 
-AnimationItem.prototype.setSubframe = function(flag){
-    this.isSubframeEnabled = !!flag;
+AnimationItem.prototype.setSubframe = function (flag) {
+  this.isSubframeEnabled = !!flag;
 };
 
 AnimationItem.prototype.gotoFrame = function () {
-    this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
+  this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
 
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
+  if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
+    this.currentFrame = this.timeCompleted;
+  }
+  this.trigger('enterFrame');
+  this.renderFrame();
 };
 
 AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    try {
-        this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-    } catch(error) {
-        this.triggerRenderFrameError(error);
-    }
+  if (this.isLoaded === false) {
+    return;
+  }
+  try {
+    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
+  } catch (error) {
+    this.triggerRenderFrameError(error);
+  }
 };
 
 AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.isPaused = false;
+    this.audioController.resume();
+    if (this._idle) {
+      this._idle = false;
+      this.trigger('_active');
     }
-    if (this.isPaused === true) {
-        this.isPaused = false;
-        this.audioController.resume();
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
+  }
 };
 
 AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        this._idle = true;
-        this.trigger('_idle');
-        this.audioController.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === false) {
+    this.isPaused = true;
+    this._idle = true;
+    this.trigger('_idle');
+    this.audioController.pause();
+  }
 };
 
 AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.play();
+  } else {
+    this.pause();
+  }
 };
 
 AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.playCount = 0;
-    this._completedLoop = false;
-    this.setCurrentRawFrameValue(0);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.pause();
+  this.playCount = 0;
+  this._completedLoop = false;
+  this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
+  if (name && this.name !== name) {
+    return;
+  }
+  if (isFrame) {
+    this.setCurrentRawFrameValue(value);
+  } else {
+    this.setCurrentRawFrameValue(value * this.frameModifier);
+  }
+  this.pause();
 };
 
 AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
+  this.goToAndStop(value, isFrame, name);
+  this.play();
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    var nextValue = this.currentRawFrame + value * this.frameModifier;
-    var _isComplete = false;
-    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
-    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
-    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
-        if (!this.loop || this.playCount === this.loop) {
-            if (!this.checkSegments(nextValue >  this.totalFrames ? nextValue % this.totalFrames : 0)) {
-                _isComplete = true;
-                nextValue = this.totalFrames - 1;
-            }
-        } else if (nextValue >= this.totalFrames) {
-            this.playCount += 1;
-            if (!this.checkSegments(nextValue % this.totalFrames)) {
-                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
-                this._completedLoop = true;
-                this.trigger('loopComplete');
-            }
-        } else {
-            this.setCurrentRawFrameValue(nextValue);
-        }
-    } else if(nextValue < 0) {
-        if (!this.checkSegments(nextValue % this.totalFrames)) {
-            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
-                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
-                if(!this._completedLoop) {
-                    this._completedLoop = true;
-                } else {
-                    this.trigger('loopComplete');
-                }
-            } else {
-                _isComplete = true;
-                nextValue = 0;
-            }
-        }
+  if (this.isPaused === true || this.isLoaded === false) {
+    return;
+  }
+  var nextValue = this.currentRawFrame + value * this.frameModifier;
+  var _isComplete = false;
+  // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+  // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+  if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+    if (!this.loop || this.playCount === this.loop) {
+      if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
+        _isComplete = true;
+        nextValue = this.totalFrames - 1;
+      }
+    } else if (nextValue >= this.totalFrames) {
+      this.playCount += 1;
+      if (!this.checkSegments(nextValue % this.totalFrames)) {
+        this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+        this._completedLoop = true;
+        this.trigger('loopComplete');
+      }
     } else {
-        this.setCurrentRawFrameValue(nextValue);
+      this.setCurrentRawFrameValue(nextValue);
     }
-    if (_isComplete) {
-        this.setCurrentRawFrameValue(nextValue);
-        this.pause();
-        this.trigger('complete');
+  } else if (nextValue < 0) {
+    if (!this.checkSegments(nextValue % this.totalFrames)) {
+      if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) { // eslint-disable-line no-plusplus
+        this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+        if (!this._completedLoop) {
+          this._completedLoop = true;
+        } else {
+          this.trigger('loopComplete');
+        }
+      } else {
+        _isComplete = true;
+        nextValue = 0;
+      }
     }
+  } else {
+    this.setCurrentRawFrameValue(nextValue);
+  }
+  if (_isComplete) {
+    this.setCurrentRawFrameValue(nextValue);
+    this.pause();
+    this.trigger('complete');
+  }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr, offset){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0.001 + offset);
+AnimationItem.prototype.adjustSegment = function (arr, offset) {
+  this.playCount = 0;
+  if (arr[1] < arr[0]) {
+    if (this.frameModifier > 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(-1);
+      }
     }
-    this.trigger('segmentStart');
+    this.totalFrames = arr[0] - arr[1];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[1];
+    this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
+  } else if (arr[1] > arr[0]) {
+    if (this.frameModifier < 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(1);
+      }
+    }
+    this.totalFrames = arr[1] - arr[0];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[0];
+    this.setCurrentRawFrameValue(0.001 + offset);
+  }
+  this.trigger('segmentStart');
 };
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init;
-        }
+AnimationItem.prototype.setSegment = function (init, end) {
+  var pendingFrame = -1;
+  if (this.isPaused) {
+    if (this.currentRawFrame + this.firstFrame < init) {
+      pendingFrame = init;
+    } else if (this.currentRawFrame + this.firstFrame > end) {
+      pendingFrame = end - init;
     }
+  }
 
-    this.firstFrame = init;
-    this.timeCompleted = this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
+  this.firstFrame = init;
+  this.totalFrames = end - init;
+  this.timeCompleted = this.totalFrames;
+  if (pendingFrame !== -1) {
+    this.goToAndStop(pendingFrame, true);
+  }
 };
 
 AnimationItem.prototype.playSegments = function (arr, forceFlag) {
-    if (forceFlag) {
-        this.segments.length = 0;
+  if (forceFlag) {
+    this.segments.length = 0;
+  }
+  if (typeof arr[0] === 'object') {
+    var i;
+    var len = arr.length;
+    for (i = 0; i < len; i += 1) {
+      this.segments.push(arr[i]);
     }
-    if (typeof arr[0] === 'object') {
-        var i, len = arr.length;
-        for (i = 0; i < len; i += 1) {
-            this.segments.push(arr[i]);
-        }
-    } else {
-        this.segments.push(arr);
-    }
-    if (this.segments.length && forceFlag) {
-        this.adjustSegment(this.segments.shift(), 0);
-    }
-    if (this.isPaused) {
-        this.play();
-    }
+  } else {
+    this.segments.push(arr);
+  }
+  if (this.segments.length && forceFlag) {
+    this.adjustSegment(this.segments.shift(), 0);
+  }
+  if (this.isPaused) {
+    this.play();
+  }
 };
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip,this.animationData.op]);
-    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if (forceFlag) {
-        this.checkSegments(0);
-    }
+  this.segments.length = 0;
+  this.segments.push([this.animationData.ip, this.animationData.op]);
+  // this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+  if (forceFlag) {
+    this.checkSegments(0);
+  }
 };
-AnimationItem.prototype.checkSegments = function(offset) {
-    if (this.segments.length) {
-        this.adjustSegment(this.segments.shift(), offset);
-        return true;
-    }
-    return false;
+AnimationItem.prototype.checkSegments = function (offset) {
+  if (this.segments.length) {
+    this.adjustSegment(this.segments.shift(), offset);
+    return true;
+  }
+  return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this.imagePreloader.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this.imagePreloader.destroy();
+  this.trigger('destroy');
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
+  this.renderer = null;
+  this.imagePreloader = null;
+  this.projectInterface = null;
 };
 
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    this.gotoFrame();
+AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
+  this.currentRawFrame = value;
+  this.gotoFrame();
 };
 
 AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
+  this.playSpeed = val;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
+  this.playDirection = val < 0 ? -1 : 1;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setVolume = function (val, name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.setVolume(val);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.setVolume(val);
 };
 
 AnimationItem.prototype.getVolume = function () {
-    return this.audioController.getVolume();
+  return this.audioController.getVolume();
 };
 
 AnimationItem.prototype.mute = function (name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.mute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.mute();
 };
 
 AnimationItem.prototype.unmute = function (name) {
-    if(name && this.name !== name){
-        return;
-    }
-    this.audioController.unmute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.unmute();
 };
 
 AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-    this.audioController.setRate(this.playSpeed * this.playDirection)
+  this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
+  this.audioController.setRate(this.playSpeed * this.playDirection);
 };
 
 AnimationItem.prototype.getPath = function () {
-    return this.path;
+  return this.path;
 };
 
 AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(assetData.e) {
-        path = assetData.p;
-    } else if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
+  var path = '';
+  if (assetData.e) {
+    path = assetData.p;
+  } else if (this.assetsPath) {
+    var imagePath = assetData.p;
+    if (imagePath.indexOf('images/') !== -1) {
+      imagePath = imagePath.split('/')[1];
     }
-    return path;
+    path = this.assetsPath + imagePath;
+  } else {
+    path = this.path;
+    path += assetData.u ? assetData.u : '';
+    path += assetData.p;
+  }
+  return path;
 };
 
 AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
+  var i = 0;
+  var len = this.assets.length;
+  while (i < len) {
+    if (id === this.assets[i].id) {
+      return this.assets[i];
     }
+    i += 1;
+  }
+  return null;
 };
 
 AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
+  this.renderer.hide();
 };
 
 AnimationItem.prototype.show = function () {
-    this.renderer.show();
+  this.renderer.show();
 };
 
 AnimationItem.prototype.getDuration = function (isFrame) {
-    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+  return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
 };
 
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
+AnimationItem.prototype.trigger = function (name) {
+  if (this._cbs && this._cbs[name]) {
+    switch (name) {
+      case 'enterFrame':
+        this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
+        break;
+      case 'loopComplete':
+        this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+        break;
+      case 'complete':
+        this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
+        break;
+      case 'segmentStart':
+        this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+        break;
+      case 'destroy':
+        this.triggerEvent(name, new BMDestroyEvent(name, this));
+        break;
+      default:
+        this.triggerEvent(name);
     }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
+  }
+  if (name === 'enterFrame' && this.onEnterFrame) {
+    this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
+  }
+  if (name === 'loopComplete' && this.onLoopComplete) {
+    this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+  }
+  if (name === 'complete' && this.onComplete) {
+    this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
+  }
+  if (name === 'segmentStart' && this.onSegmentStart) {
+    this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+  }
+  if (name === 'destroy' && this.onDestroy) {
+    this.onDestroy.call(this, new BMDestroyEvent(name, this));
+  }
 };
 
-AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
+AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
+  var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-    var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
 
-    if (this.onError) {
-        this.onError.call(this, error);
-    }
+AnimationItem.prototype.triggerConfigError = function (nativeError) {
+  var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
+
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
+
+/* exported EffectsManager */
+
+function EffectsManager() {
+  this.effectElements = [];
 }
 
-AnimationItem.prototype.triggerConfigError = function(nativeError) {
-
-    var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
-    }
-}
-function EffectsManager(){
-    this.effectElements = [];
-}
 
 var lottie = {};
 
-var _isFrozen = false;
-
-function setLocationHref (href) {
-    locationHref = href;
+function setLocationHref(href) {
+  locationHref = href;
 }
 
 function searchAnimations() {
-    if (standalone === true) {
-        animationManager.searchAnimations(animationData, standalone, renderer);
-    } else {
-        animationManager.searchAnimations();
-    }
+  if (standalone === true) {
+    animationManager.searchAnimations(animationData, standalone, renderer);
+  } else {
+    animationManager.searchAnimations();
+  }
 }
 
 function setSubframeRendering(flag) {
-    subframeEnabled = flag;
+  subframeEnabled = flag;
 }
 
 function loadAnimation(params) {
-    if (standalone === true) {
-        params.animationData = JSON.parse(animationData);
-    }
-    return animationManager.loadAnimation(params);
+  if (standalone === true) {
+    params.animationData = JSON.parse(animationData);
+  }
+  return animationManager.loadAnimation(params);
 }
 
 function setQuality(value) {
-    if (typeof value === 'string') {
-        switch (value) {
-            case 'high':
-                defaultCurveSegments = 200;
-                break;
-            case 'medium':
-                defaultCurveSegments = 50;
-                break;
-            case 'low':
-                defaultCurveSegments = 10;
-                break;
-        }
-    } else if (!isNaN(value) && value > 1) {
-        defaultCurveSegments = value;
+  if (typeof value === 'string') {
+    switch (value) {
+      case 'high':
+        defaultCurveSegments = 200;
+        break;
+      default:
+      case 'medium':
+        defaultCurveSegments = 50;
+        break;
+      case 'low':
+        defaultCurveSegments = 10;
+        break;
     }
-    if (defaultCurveSegments >= 50) {
-        roundValues(false);
-    } else {
-        roundValues(true);
-    }
+  } else if (!isNaN(value) && value > 1) {
+    defaultCurveSegments = value;
+  }
+  if (defaultCurveSegments >= 50) {
+    roundValues(false);
+  } else {
+    roundValues(true);
+  }
 }
 
 function inBrowser() {
-    return typeof navigator !== 'undefined';
+  return typeof navigator !== 'undefined';
 }
 
 function installPlugin(type, plugin) {
-    if (type === 'expressions') {
-        expressionsPlugin = plugin;
-    }
+  if (type === 'expressions') {
+    expressionsPlugin = plugin;
+  }
 }
 
 function getFactory(name) {
-    switch (name) {
-        case "propertyFactory":
-            return PropertyFactory;
-        case "shapePropertyFactory":
-            return ShapePropertyFactory;
-        case "matrix":
-            return Matrix;
-    }
+  switch (name) {
+    case 'propertyFactory':
+      return PropertyFactory;
+    case 'shapePropertyFactory':
+      return ShapePropertyFactory;
+    case 'matrix':
+      return Matrix;
+    default:
+      return null;
+  }
 }
 
 lottie.play = animationManager.play;
@@ -10026,7 +10631,7 @@
 lottie.loadAnimation = loadAnimation;
 lottie.setSubframeRendering = setSubframeRendering;
 lottie.resize = animationManager.resize;
-//lottie.start = start;
+// lottie.start = start;
 lottie.goToAndStop = animationManager.goToAndStop;
 lottie.destroy = animationManager.destroy;
 lottie.setQuality = setQuality;
@@ -10039,35 +10644,37 @@
 lottie.unmute = animationManager.unmute;
 lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
 lottie.__getFactory = getFactory;
-lottie.version = '5.7.5';
+lottie.version = '5.7.6';
 
 function checkReady() {
-    if (document.readyState === "complete") {
-        clearInterval(readyStateCheckInterval);
-        searchAnimations();
-    }
+  if (document.readyState === 'complete') {
+    clearInterval(readyStateCheckInterval);
+    searchAnimations();
+  }
 }
 
 function getQueryVariable(variable) {
-    var vars = queryString.split('&');
-    for (var i = 0; i < vars.length; i++) {
-        var pair = vars[i].split('=');
-        if (decodeURIComponent(pair[0]) == variable) {
-            return decodeURIComponent(pair[1]);
-        }
+  var vars = queryString.split('&');
+  for (var i = 0; i < vars.length; i += 1) {
+    var pair = vars[i].split('=');
+    if (decodeURIComponent(pair[0]) == variable) { // eslint-disable-line eqeqeq
+      return decodeURIComponent(pair[1]);
     }
+  }
+  return null;
 }
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
+var queryString;
 if (standalone) {
-    var scripts = document.getElementsByTagName('script');
-    var index = scripts.length - 1;
-    var myScript = scripts[index] || {
-        src: ''
-    };
-    var queryString = myScript.src.replace(/^[^\?]+\??/, '');
-    renderer = getQueryVariable('renderer');
+  var scripts = document.getElementsByTagName('script');
+  var index = scripts.length - 1;
+  var myScript = scripts[index] || {
+    src: '',
+  };
+  queryString = myScript.src.replace(/^[^\?]+\??/, ''); // eslint-disable-line no-useless-escape
+  renderer = getQueryVariable('renderer');
 }
 var readyStateCheckInterval = setInterval(checkReady, 100);
 
diff --git a/build/player/lottie_light.min.js b/build/player/lottie_light.min.js
index b2878bd..55115e5 100644
--- a/build/player/lottie_light.min.js
+++ b/build/player/lottie_light.min.js
@@ -10,6 +10,6 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";var h,e="http://www.w3.org/2000/svg",A="",s=-999999,i=!0,n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),b=(Math.round,Math.pow),k=Math.sqrt,f=(Math.abs,Math.floor),m=(Math.max,Math.min),a={};!function(){var t,e=["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"],s=e.length;for(t=0;t<s;t+=1)a[e[t]]=Math[e[t]]}(),a.random=Math.random,a.abs=function(t){if("object"===typeof t&&t.length){var e,s=C(t.length),i=t.length;for(e=0;e<i;e+=1)s[e]=Math.abs(t[e]);return s}return Math.abs(t)};var P=150,B=Math.PI/180,v=.5519;function r(t){t?Math.round:function(t){return t}}function o(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function l(t,e){this.type=t,this.direction=e<0?-1:1}function p(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}function d(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function c(t,e){this.type=t,this.target=e}function u(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function g(t){this.type="configError",this.nativeError=t}r(!1);var t,S=(t=0,function(){return"__lottie_element_"+ ++t});function y(t,e,s){var i,a,r,n,h,o,l,p;switch(o=s*(1-e),l=s*(1-(h=6*t-(n=Math.floor(6*t)))*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function _(t,e,s){var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function lt(t,e){var s=_(255*t[0],255*t[1],255*t[2]);return s[1]+=e,1<s[1]?s[1]=1:s[1]<=0&&(s[1]=0),y(s[0],s[1],s[2])}function pt(t,e){var s=_(255*t[0],255*t[1],255*t[2]);return s[2]+=e,1<s[2]?s[2]=1:s[2]<0&&(s[2]=0),y(s[0],s[1],s[2])}function ft(t,e){var s=_(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,1<s[0]?s[0]-=1:s[0]<0&&(s[0]+=1),y(s[0],s[1],s[2])}!function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1==e.length?"0"+e:e}();function x(){}x.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;i<s;i++)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s-=1,i-=1),s+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var j="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var s,i=0,a=[];switch(t){case"int16":case"uint8c":s=1;break;default:s=1.1}for(i=0;i<e;i+=1)a.push(s);return a};function C(t){return Array.apply(null,{length:t})}function D(t){return document.createElementNS(e,t)}function w(t){return document.createElement(t)}function T(){}T.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var M,F=(M={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return M[t]||""}),I=function(){var a=Math.cos,r=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function s(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var s=a(e),i=r(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}function m(t,e,s){return s||0===s||(s=1),1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}function d(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=a,this.props[5]=r,this.props[6]=n,this.props[7]=h,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=d,this.props[14]=c,this.props[15]=u,this}function c(t,e,s){return s=s||0,0!==t||0!==e||0!==s?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1):this}function u(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){var g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===a&&1===r&&0===n&&0===h&&0===o&&0===l&&1===p&&0===f)return g[12]=g[12]*t+g[15]*m,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*c,g[15]=g[15]*u,this._identityCalculated=!1,this;var y=g[0],v=g[1],_=g[2],b=g[3],k=g[4],A=g[5],P=g[6],S=g[7],x=g[8],C=g[9],D=g[10],w=g[11],T=g[12],M=g[13],F=g[14],E=g[15];return g[0]=y*t+v*a+_*o+b*m,g[1]=y*e+v*r+_*l+b*d,g[2]=y*s+v*n+_*p+b*c,g[3]=y*i+v*h+_*f+b*u,g[4]=k*t+A*a+P*o+S*m,g[5]=k*e+A*r+P*l+S*d,g[6]=k*s+A*n+P*p+S*c,g[7]=k*i+A*h+P*f+S*u,g[8]=x*t+C*a+D*o+w*m,g[9]=x*e+C*r+D*l+w*d,g[10]=x*s+C*n+D*p+w*c,g[11]=x*i+C*h+D*f+w*u,g[12]=T*t+M*a+F*o+E*m,g[13]=T*e+M*r+F*l+E*d,g[14]=T*s+M*n+F*p+E*c,g[15]=T*i+M*h+F*f+E*u,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function _(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function b(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}function k(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function A(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function P(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function S(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,a=this.props[0]/t,r=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,h=new I;return h.props[0]=e,h.props[1]=s,h.props[4]=i,h.props[5]=a,h.props[12]=r,h.props[13]=n,h}function x(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function C(t){var e,s=t.length,i=[];for(e=0;e<s;e+=1)i[e]=x(t[e]);return i}function D(t,e,s){var i=j("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=s[0],i[5]=s[1];else{var a=this.props[0],r=this.props[1],n=this.props[4],h=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*a+t[1]*n+o,i[1]=t[0]*r+t[1]*h+l,i[2]=e[0]*a+e[1]*n+o,i[3]=e[0]*r+e[1]*h+l,i[4]=s[0]*a+s[1]*n+o,i[5]=s[0]*r+s[1]*h+l}return i}function w(t,e,s){return this.isIdentity()?[t,e,s]:[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}function T(t,e){if(this.isIdentity())return t+","+e;var s=this.props;return Math.round(100*(t*s[0]+e*s[4]+s[12]))/100+","+Math.round(100*(t*s[1]+e*s[5]+s[13]))/100}function M(){for(var t=0,e=this.props,s="matrix3d(";t<16;)s+=i(1e4*e[t])/1e4,s+=15===t?")":",",t+=1;return s}function F(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function E(){var t=this.props;return"matrix("+F(t[0])+","+F(t[1])+","+F(t[4])+","+F(t[5])+","+F(t[12])+","+F(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=s,this.rotateY=h,this.rotateZ=o,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=d,this.translate=c,this.transform=u,this.applyToPoint=b,this.applyToX=k,this.applyToY=A,this.applyToZ=P,this.applyToPointArray=w,this.applyToTriplePoints=D,this.applyToPointStringified=T,this.toCSS=M,this.to2dCSS=E,this.clone=v,this.cloneFromProps=_,this.equals=y,this.inversePoints=C,this.inversePoint=x,this.getInverseMatrix=S,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=j("float32",16),this.reset()}}();!function(h,o){var l,p=this,f=256,m=6,d="random",c=o.pow(f,m),u=o.pow(2,52),g=2*u,y=f-1;function v(t){var e,s=t.length,n=this,i=0,a=n.i=n.j=0,r=n.S=[];for(s||(t=[s++]);i<f;)r[i]=i++;for(i=0;i<f;i++)r[i]=r[a=y&a+t[i%s]+(e=r[i])],r[a]=e;n.g=function(t){for(var e,s=0,i=n.i,a=n.j,r=n.S;t--;)e=r[i=y&i+1],s=s*f+r[y&(r[i]=r[a=y&a+e])+(r[a]=e)];return n.i=i,n.j=a,s}}function _(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function b(t,e){for(var s,i=t+"",a=0;a<i.length;)e[y&a]=y&(s^=19*e[y&a])+i.charCodeAt(a++);return k(e)}function k(t){return String.fromCharCode.apply(0,t)}o["seed"+d]=function(t,e,s){var i=[],a=b(function t(e,s){var i,a=[],r=typeof e;if(s&&"object"==r)for(i in e)try{a.push(t(e[i],s-1))}catch(t){}return a.length?a:"string"==r?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,k(h)]:null===t?function(){try{if(l)return k(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),k(t)}catch(t){var e=p.navigator,s=e&&e.plugins;return[+new Date,p,s,p.screen,k(h)]}}():t,3),i),r=new v(i),n=function(){for(var t=r.g(m),e=c,s=0;t<u;)t=(t+s)*f,e*=f,s=r.g(1);for(;g<=t;)t/=2,e/=2,s>>>=1;return(t+s)/e};return n.int32=function(){return 0|r.g(4)},n.quick=function(){return r.g(4)/4294967296},n.double=n,b(k(r.S),h),(e.pass||s||function(t,e,s,i){return i&&(i.S&&_(i,r),t.state=function(){return _(r,{})}),s?(o[d]=t,e):t})(n,a,"global"in e?e.global:this==o,e.state)},b(o.random(),h)}([],a);var W=function(){var t={getBezierEasing:function(t,e,s,i,a){var r=a||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");if(h[r])return h[r];var n=new o([t,e,s,i]);return h[r]=n}},h={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function a(t,e){return 3*e-6*t}function r(t){return 3*t}function f(t,e,s){return((i(e,s)*t+a(e,s))*t+r(e))*t}function m(t,e,s){return 3*i(e,s)*t*t+2*a(e,s)*t+r(e)}function o(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return o.prototype={get:function(t){var e=this._p[0],s=this._p[1],i=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===s&&i===a?t:0===t?0:1===t?1:f(this._getTForX(t),s,a)},_precompute:function(){var t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&s===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;s<l;++s)this._mSampleValues[s]=f(s*p,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,a=0,r=1,n=l-1;r!==n&&i[r]<=t;++r)a+=p;var h=a+(t-i[--r])/(i[r+1]-i[r])*p,o=m(h,e,s);return.001<=o?function(t,e,s,i){for(var a=0;a<4;++a){var r=m(e,s,i);if(0===r)return e;e-=(f(e,s,i)-t)/r}return e}(t,h,e,s):0===o?h:function(t,e,s,i,a){for(var r,n,h=0;0<(r=f(n=e+(s-e)/2,i,a)-t)?s=n:e=n,1e-7<Math.abs(r)&&++h<10;);return n}(t,a,a+p,e,s)}},t}();function E(t,e){var s,i,a=t.length;for(s=0;s<a;s+=1)for(var r in i=t[s].prototype)i.hasOwnProperty(r)&&(e.prototype[r]=i[r])}!function(){for(var r=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var s=(new Date).getTime(),i=Math.max(0,16-(s-r)),a=setTimeout(function(){t(s+i)},i);return r=s+i,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var mt=function(){function g(t,e,s,i,a,r){var n=t*i+e*a+s*r-a*i-r*t-s*e;return-.001<n&&n<.001}Math;var p=function(t,e,s,i){var a,r,n,h,o,l,p=P,f=0,m=[],d=[],c=wt.newElement();for(n=s.length,a=0;a<p;a+=1){for(o=a/(p-1),r=l=0;r<n;r+=1)h=b(1-o,3)*t[r]+3*b(1-o,2)*o*s[r]+3*(1-o)*b(o,2)*i[r]+b(o,3)*e[r],m[r]=h,null!==d[r]&&(l+=b(m[r]-d[r],2)),d[r]=m[r];l&&(f+=l=k(l)),c.percents[a]=o,c.lengths[a]=f}return c.addedLength=f,c};function y(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var _,t=(_={},function(t,e,s,i){var a=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+s[0]+"_"+s[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!_[a]){var r,n,h,o,l,p,f,m=P,d=0,c=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&g(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&g(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var u=new y(m);for(h=s.length,r=0;r<m;r+=1){for(f=C(h),l=r/(m-1),n=p=0;n<h;n+=1)o=b(1-l,3)*t[n]+3*b(1-l,2)*l*(t[n]+s[n])+3*(1-l)*b(l,2)*(e[n]+i[n])+b(l,3)*e[n],f[n]=o,null!==c&&(p+=b(f[n]-c[n],2));d+=p=k(p),u.points[r]=new v(p,f),c=f}u.segmentLength=d,_[a]=u}return _[a]});function T(t,e){var s=e.percents,i=e.lengths,a=s.length,r=f((a-1)*t),n=t*e.addedLength,h=0;if(r===a-1||0===r||n===i[r])return s[r];for(var o=i[r]>n?-1:1,l=!0;l;)if(i[r]<=n&&i[r+1]>n?(h=(n-i[r])/(i[r+1]-i[r]),l=!1):r+=o,r<0||a-1<=r){if(r===a-1)return s[r];l=!1}return s[r]+(s[r+1]-s[r])*h}var M=j("float32",8);return{getSegmentsLength:function(t){var e,s=Dt.newElement(),i=t.c,a=t.v,r=t.o,n=t.i,h=t._length,o=s.lengths,l=0;for(e=0;e<h-1;e+=1)o[e]=p(a[e],a[e+1],r[e],n[e+1]),l+=o[e].addedLength;return i&&h&&(o[e]=p(a[e],a[0],r[e],n[0]),l+=o[e].addedLength),s.totalLength=l,s},getNewSegment:function(t,e,s,i,a,r,n){var h,o=T(a=a<0?0:1<a?1:a,n),l=T(r=1<r?1:r,n),p=t.length,f=1-o,m=1-l,d=f*f*f,c=o*f*f*3,u=o*o*f*3,g=o*o*o,y=f*f*m,v=o*f*m+f*o*m+f*f*l,_=o*o*m+f*o*l+o*f*l,b=o*o*l,k=f*m*m,A=o*m*m+f*l*m+f*m*l,P=o*l*m+f*l*l+o*m*l,S=o*l*l,x=m*m*m,C=l*m*m+m*l*m+m*m*l,D=l*l*m+m*l*l+l*m*l,w=l*l*l;for(h=0;h<p;h+=1)M[4*h]=Math.round(1e3*(d*t[h]+c*s[h]+u*i[h]+g*e[h]))/1e3,M[4*h+1]=Math.round(1e3*(y*t[h]+v*s[h]+_*i[h]+b*e[h]))/1e3,M[4*h+2]=Math.round(1e3*(k*t[h]+A*s[h]+P*i[h]+S*e[h]))/1e3,M[4*h+3]=Math.round(1e3*(x*t[h]+C*s[h]+D*i[h]+w*e[h]))/1e3;return M},getPointInSegment:function(t,e,s,i,a,r){var n=T(a,r),h=1-n;return[Math.round(1e3*(h*h*h*t[0]+(n*h*h+h*n*h+h*h*n)*s[0]+(n*n*h+h*n*n+n*h*n)*i[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(h*h*h*t[1]+(n*h*h+h*n*h+h*h*n)*s[1]+(n*n*h+h*n*n+n*h*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:g,pointOnLine3D:function(t,e,s,i,a,r,n,h,o){if(0===s&&0===r&&0===o)return g(t,e,i,a,n,h);var l,p=Math.sqrt(Math.pow(i-t,2)+Math.pow(a-e,2)+Math.pow(r-s,2)),f=Math.sqrt(Math.pow(n-t,2)+Math.pow(h-e,2)+Math.pow(o-s,2)),m=Math.sqrt(Math.pow(n-i,2)+Math.pow(h-a,2)+Math.pow(o-r,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}();var L=function(){function m(t,e,s){var i,a,r,n,h,o,l,p=t.length;for(a=0;a<p;a+=1)if("ks"in(i=t[a])&&!i.completed){if(i.completed=!0,i.tt&&(t[a-1].td=i.tt),i.hasMask){var f=i.masksProperties;for(n=f.length,r=0;r<n;r+=1)if(f[r].pt.k.i)u(f[r].pt.k);else for(o=f[r].pt.k.length,h=0;h<o;h+=1)f[r].pt.k[h].s&&u(f[r].pt.k[h].s[0]),f[r].pt.k[h].e&&u(f[r].pt.k[h].e[0])}0===i.ty?(i.layers=d(i.refId,e),m(i.layers,e,s)):4===i.ty?c(i.shapes):5==i.ty&&(0!==(l=i).t.a.length||"m"in l.t.p||(l.singleShape=!0))}}function d(t,e){for(var s=0,i=e.length;s<i;){if(e[s].id===t)return e[s].layers.__used?JSON.parse(JSON.stringify(e[s].layers)):(e[s].layers.__used=!0,e[s].layers);s+=1}}function c(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)u(t[e].ks.k);else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&u(t[e].ks.k[s].s[0]),t[e].ks.k[s].e&&u(t[e].ks.k[s].e[0]);else"gr"==t[e].ty&&c(t[e].it)}function u(t){var e,s=t.i.length;for(e=0;e<s;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function h(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&void 0))}var o,s=function(){var i=[4,4,14];function a(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)5===t[e].ty&&(s=t[e],i=s.t.d,s.t.d={k:[{s:i,t:0}]})}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),i=(o=[4,7,99],function(t){if(t.chars&&!h(o,t.v)){var e,s,i,a,r,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(r=t.chars[e].data.shapes[0].it).length,s=0;s<i;s+=1)(a=r[s].ks.k).__converted||(u(r[s].ks.k),a.__converted=!0)}}),a=function(){var i=[4,1,9];function r(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)if("gr"===t[e].ty)r(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,s=0;s<i;s+=1)t[e].c.k[s].s&&(t[e].c.k[s].s[0]/=255,t[e].c.k[s].s[1]/=255,t[e].c.k[s].s[2]/=255,t[e].c.k[s].s[3]/=255),t[e].c.k[s].e&&(t[e].c.k[s].e[0]/=255,t[e].c.k[s].e[1]/=255,t[e].c.k[s].e[2]/=255,t[e].c.k[s].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function a(t){var e,s=t.length;for(e=0;e<s;e+=1)4===t[e].ty&&r(t[e].shapes)}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),r=function(){var i=[4,4,18];function l(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&(t[e].ks.k[s].s[0].c=t[e].closed),t[e].ks.k[s].e&&(t[e].ks.k[s].e[0].c=t[e].closed);else"gr"==t[e].ty&&l(t[e].it)}function a(t){var e,s,i,a,r,n,h=t.length;for(s=0;s<h;s+=1){if((e=t[s]).hasMask){var o=e.masksProperties;for(a=o.length,i=0;i<a;i+=1)if(o[i].pt.k.i)o[i].pt.k.c=o[i].cl;else for(n=o[i].pt.k.length,r=0;r<n;r+=1)o[i].pt.k[r].s&&(o[i].pt.k[r].s[0].c=o[i].cl),o[i].pt.k[r].e&&(o[i].pt.k[r].e[0].c=o[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}();var t={completeData:function(t,e){t.__complete||(a(t),s(t),i(t),r(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=a,t.checkChars=i,t.checkShapes=r,t.completeLayers=m,t}(),V=function(){var r={w:0,size:0,shapes:[]},t=[];function u(t,e){var s=w("span");s.style.fontFamily=e;var i=w("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);var a=i.offsetWidth;return i.style.fontFamily=function(t){var e,s=t.split(","),i=s.length,a=[];for(e=0;e<i;e+=1)"sans-serif"!==s[e]&&"monospace"!==s[e]&&a.push(s[e]);return a.join(",")}(t)+", "+e,{node:i,w:a,parent:s}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){this.chars||(this.chars=[]);var e,s,i,a=t.length,r=this.chars.length;for(e=0;e<a;e+=1){for(s=0,i=!1;s<r;)this.chars[s].style===t[e].style&&this.chars[s].fFamily===t[e].fFamily&&this.chars[s].ch===t[e].ch&&(i=!0),s+=1;i||(this.chars.push(t[e]),r+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var s,i,a,r,n=t.list,h=n.length,o=h;for(s=0;s<h;s+=1){var l,p,f=!0;if(n[s].loaded=!1,n[s].monoCase=u(n[s].fFamily,"monospace"),n[s].sansCase=u(n[s].fFamily,"sans-serif"),n[s].fPath){if("p"===n[s].fOrigin||3===n[s].origin){if(0<(l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[s].fFamily+'"], style[f-origin="3"][f-family="'+n[s].fFamily+'"]')).length&&(f=!1),f){var m=w("style");m.setAttribute("f-forigin",n[s].fOrigin),m.setAttribute("f-origin",n[s].origin),m.setAttribute("f-family",n[s].fFamily),m.type="text/css",m.innerText="@font-face {font-family: "+n[s].fFamily+"; font-style: normal; src: url('"+n[s].fPath+"');}",e.appendChild(m)}}else if("g"===n[s].fOrigin||1===n[s].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),p=0;p<l.length;p++)-1!==l[p].href.indexOf(n[s].fPath)&&(f=!1);if(f){var d=w("link");d.setAttribute("f-forigin",n[s].fOrigin),d.setAttribute("f-origin",n[s].origin),d.type="text/css",d.rel="stylesheet",d.href=n[s].fPath,document.body.appendChild(d)}}else if("t"===n[s].fOrigin||2===n[s].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),p=0;p<l.length;p++)n[s].fPath===l[p].src&&(f=!1);if(f){var c=w("link");c.setAttribute("f-forigin",n[s].fOrigin),c.setAttribute("f-origin",n[s].origin),c.setAttribute("rel","stylesheet"),c.setAttribute("href",n[s].fPath),e.appendChild(c)}}}else n[s].loaded=!0,o-=1;n[s].helper=(i=e,a=n[s],r=void 0,(r=D("text")).style.fontSize="100px",r.setAttribute("font-family",a.fFamily),r.setAttribute("font-style",a.fStyle),r.setAttribute("font-weight",a.fWeight),r.textContent="1",a.fClass?(r.style.fontFamily="inherit",r.setAttribute("class",a.fClass)):r.style.fontFamily=a.fFamily,i.appendChild(r),w("canvas").getContext("2d").font=a.fWeight+" "+a.fStyle+" 100px "+a.fFamily,r),n[s].cache={},this.fonts.push(n[s])}0===o?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,s){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),r},getFontByName:function(t){for(var e=0,s=this.fonts.length;e<s;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,s){var i=this.getFontByName(e),a=t.charCodeAt(0);if(!i.cache[a+1]){var r=i.helper;if(" "===t){r.textContent="|"+t+"|";var n=r.getComputedTextLength();r.textContent="||";var h=r.getComputedTextLength();i.cache[a+1]=(n-h)/100}else r.textContent=t,i.cache[a+1]=r.getComputedTextLength()/100}return i.cache[a+1]*s},checkLoadedFonts:function(){var t,e,s,i=this.fonts.length,a=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?a-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,s=this.fonts[t].monoCase.w,e.offsetWidth!==s?(a-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,s=this.fonts[t].sansCase.w,e.offsetWidth!==s&&(a-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==a&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),R=function(){var f=s,a=Math.abs;function m(t,e){var s,i=this.offsetTime;"multidimensional"===this.propType&&(s=j("float32",this.pv.length));for(var a,r,n,h,o,l,p,f,m=e.lastIndex,d=m,c=this.keyframes.length-1,u=!0;u;){if(a=this.keyframes[d],r=this.keyframes[d+1],d===c-1&&t>=r.t-i){a.h&&(a=r),m=0;break}if(r.t-i>t){m=d;break}d<c-1?d+=1:(m=0,u=!1)}var g,y,v,_,b,k,A,P,S,x,C=r.t-i,D=a.t-i;if(a.to){a.bezierData||(a.bezierData=mt.buildBezierData(a.s,r.s||a.e,a.to,a.ti));var w=a.bezierData;if(C<=t||t<D){var T=C<=t?w.points.length-1:0;for(h=w.points[T].point.length,n=0;n<h;n+=1)s[n]=w.points[T].point[n]}else{a.__fnct?f=a.__fnct:(f=W.getBezierEasing(a.o.x,a.o.y,a.i.x,a.i.y,a.n).get,a.__fnct=f),o=f((t-D)/(C-D));var M,F=w.segmentLength*o,E=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastPoint:0,u=!0,l=w.points.length;u;){if(E+=w.points[p].partialLength,0===F||0===o||p===w.points.length-1){for(h=w.points[p].point.length,n=0;n<h;n+=1)s[n]=w.points[p].point[n];break}if(E<=F&&F<E+w.points[p+1].partialLength){for(M=(F-E)/w.points[p+1].partialLength,h=w.points[p].point.length,n=0;n<h;n+=1)s[n]=w.points[p].point[n]+(w.points[p+1].point[n]-w.points[p].point[n])*M;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=E-w.points[p].partialLength,e._lastKeyframeIndex=d}}else{var I,L,V,R,z;if(c=a.s.length,g=r.s||a.e,this.sh&&1!==a.h)if(C<=t)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=D)s[0]=a.s[0],s[1]=a.s[1],s[2]=a.s[2];else{var N=q(a.s),O=q(g);y=s,v=function(t,e,s){var i,a,r,n,h,o=[],l=t[0],p=t[1],f=t[2],m=t[3],d=e[0],c=e[1],u=e[2],g=e[3];(a=l*d+p*c+f*u+m*g)<0&&(a=-a,d=-d,c=-c,u=-u,g=-g);h=1e-6<1-a?(i=Math.acos(a),r=Math.sin(i),n=Math.sin((1-s)*i)/r,Math.sin(s*i)/r):(n=1-s,s);return o[0]=n*l+h*d,o[1]=n*p+h*c,o[2]=n*f+h*u,o[3]=n*m+h*g,o}(N,O,(t-D)/(C-D)),_=v[0],b=v[1],k=v[2],A=v[3],P=Math.atan2(2*b*A-2*_*k,1-2*b*b-2*k*k),S=Math.asin(2*_*b+2*k*A),x=Math.atan2(2*_*A-2*b*k,1-2*_*_-2*k*k),y[0]=P/B,y[1]=S/B,y[2]=x/B}else for(d=0;d<c;d+=1)1!==a.h&&(o=C<=t?1:t<D?0:(a.o.x.constructor===Array?(a.__fnct||(a.__fnct=[]),a.__fnct[d]?f=a.__fnct[d]:(I=void 0===a.o.x[d]?a.o.x[0]:a.o.x[d],L=void 0===a.o.y[d]?a.o.y[0]:a.o.y[d],V=void 0===a.i.x[d]?a.i.x[0]:a.i.x[d],R=void 0===a.i.y[d]?a.i.y[0]:a.i.y[d],f=W.getBezierEasing(I,L,V,R).get,a.__fnct[d]=f)):a.__fnct?f=a.__fnct:(I=a.o.x,L=a.o.y,V=a.i.x,R=a.i.y,f=W.getBezierEasing(I,L,V,R).get,a.__fnct=f),f((t-D)/(C-D)))),g=r.s||a.e,z=1===a.h?a.s[d]:a.s[d]+(g[d]-a.s[d])*o,"multidimensional"===this.propType?s[d]=z:s=z}return e.lastIndex=m,s}function q(t){var e=t[0]*B,s=t[1]*B,i=t[2]*B,a=Math.cos(e/2),r=Math.cos(s/2),n=Math.cos(i/2),h=Math.sin(e/2),o=Math.sin(s/2),l=Math.sin(i/2);return[h*o*n+a*r*l,h*r*n+a*o*l,a*o*n-h*r*l,a*r*n-h*o*l]}function d(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=s&&s<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function c(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<a(this.v-e)&&(this.v=e,this._mdf=!0);else for(var s=0,i=this.v.length;s<i;)e=t[s]*this.mult,1e-5<a(this.v[s]-e)&&(this.v[s]=e,this._mdf=!0),s+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,s=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)s=this.effectsSequence[t](s);this.setVValue(s),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function g(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,s,i){this.propType="unidimensional",this.mult=s||1,this.data=e,this.v=s?e.k*s:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.addEffect=g}function h(t,e,s,i){this.propType="multidimensional",this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a,r=e.k.length;this.v=j("float32",r),this.pv=j("float32",r);j("float32",r);for(this.vel=j("float32",r),a=0;a<r;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=c,this.addEffect=g}function o(t,e,s,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.effectsSequence=[d.bind(this)],this.addEffect=g}function l(t,e,s,i){this.propType="multidimensional";var a,r,n,h,o,l=e.k.length;for(a=0;a<l-1;a+=1)e.k[a].to&&e.k[a].s&&e.k[a+1]&&e.k[a+1].s&&(r=e.k[a].s,n=e.k[a+1].s,h=e.k[a].to,o=e.k[a].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+h[0],r[1]+h[1],r[2]+h[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(e.k[a].to=null,e.k[a].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===h[0]&&0===h[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===n[2]&&0===h[2]&&0===o[2])&&(e.k[a].to=null,e.k[a].ti=null));this.effectsSequence=[d.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=j("float32",p),this.pv=j("float32",p),a=0;a<p;a+=1)this.v[a]=f,this.pv[a]=f;this._caching={lastFrame:f,lastIndex:0,value:j("float32",p)},this.addEffect=g}return{getProp:function(t,e,s,i,a){var r;if(e.k.length)if("number"==typeof e.k[0])r=new h(t,e,i,a);else switch(s){case 0:r=new o(t,e,i,a);break;case 1:r=new l(t,e,i,a)}else r=new n(t,e,i,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}}}(),z=function(){var n=[0,0];function i(t,e,s){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new I,this.pre=new I,this.appliedTransformations=0,this.initDynamicPropertyContainer(s||t),e.p&&e.p.s?(this.px=R.getProp(t,e.p.x,0,0,this),this.py=R.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=R.getProp(t,e.p.z,0,0,this))):this.p=R.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=R.getProp(t,e.rx,0,B,this),this.ry=R.getProp(t,e.ry,0,B,this),this.rz=R.getProp(t,e.rz,0,B,this),e.or.k[0].ti){var i,a=e.or.k.length;for(i=0;i<a;i+=1)e.or.k[i].to=e.or.k[i].ti=null}this.or=R.getProp(t,e.or,1,B,this),this.or.sh=!0}else this.r=R.getProp(t,e.r||{k:0},0,B,this);e.sk&&(this.sk=R.getProp(t,e.sk,0,B,this),this.sa=R.getProp(t,e.sa,0,B,this)),this.a=R.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=R.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=R.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,s,i=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)s=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],s=[];var a=this.px,r=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(e[0]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),e[1]=r.getValueAtTime((r.keyframes[0].t+.01)/i,0),s[0]=a.getValueAtTime(a.keyframes[0].t/i,0),s[1]=r.getValueAtTime(r.keyframes[0].t/i,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(e[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),e[1]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/i,0),s[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0),s[1]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/i,0)):(e=[a.pv,r.pv],s[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime),s[1]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/i,r.offsetTime))}else e=s=n;this.v.rotate(-Math.atan2(e[1]-s[1],e[0]-s[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},E([T],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=T.prototype.addDynamicProperty,{getTransformProperty:function(t,e,s){return new i(t,e,s)}}}();function N(){this.c=!1,this._length=0,this._maxLength=8,this.v=C(this._maxLength),this.o=C(this._maxLength),this.i=C(this._maxLength)}N.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var s=0;s<e;)this.v[s]=St.newElement(),this.o[s]=St.newElement(),this.i[s]=St.newElement(),s+=1},N.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},N.prototype.doubleArrayLength=function(){this.v=this.v.concat(C(this._maxLength)),this.i=this.i.concat(C(this._maxLength)),this.o=this.o.concat(C(this._maxLength)),this._maxLength*=2},N.prototype.setXYAt=function(t,e,s,i,a){var r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o}(!r[i]||r[i]&&!a)&&(r[i]=St.newElement()),r[i][0]=t,r[i][1]=e},N.prototype.setTripleAt=function(t,e,s,i,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(s,i,"o",n,h),this.setXYAt(a,r,"i",n,h)},N.prototype.reverse=function(){var t=new N;t.setPathData(this.c,this._length);var e=this.v,s=this.o,i=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],s[0][0],s[0][1],0,!1),a=1);var r,n=this._length-1,h=this._length;for(r=a;r<h;r+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],s[n][0],s[n][1],r,!1),n-=1;return t};var O,q,X=function(){var a=-999999;function t(t,e,s){var i,a,r,n,h,o,l,p,f,m=s.lastIndex,d=this.keyframes;if(t<d[0].t-this.offsetTime)i=d[0].s[0],r=!0,m=0;else if(t>=d[d.length-1].t-this.offsetTime)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var c,u,g=m,y=d.length-1,v=!0;v&&(c=d[g],!((u=d[g+1]).t-this.offsetTime>t));)g<y-1?g+=1:v=!1;if(m=g,!(r=1===c.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<c.t-this.offsetTime)p=0;else{var _;c.__fnct?_=c.__fnct:(_=W.getBezierEasing(c.o.x,c.o.y,c.i.x,c.i.y).get,c.__fnct=_),p=_((t-(c.t-this.offsetTime))/(u.t-this.offsetTime-(c.t-this.offsetTime)))}a=u.s?u.s[0]:c.e[0]}i=c.s[0]}for(o=e._length,l=i.i[0].length,s.lastIndex=m,n=0;n<o;n+=1)for(h=0;h<l;h+=1)f=r?i.i[n][h]:i.i[n][h]+(a.i[n][h]-i.i[n][h])*p,e.i[n][h]=f,f=r?i.o[n][h]:i.o[n][h]+(a.o[n][h]-i.o[n][h])*p,e.o[n][h]=f,f=r?i.v[n][h]:i.v[n][h]+(a.v[n][h]-i.v[n][h])*p,e.v[n][h]=f}function r(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var s,i=t._length;for(s=0;s<i;s+=1)if(t.v[s][0]!==e.v[s][0]||t.v[s][1]!==e.v[s][1]||t.o[s][0]!==e.o[s][0]||t.o[s][1]!==e.o[s][1]||t.i[s][0]!==e.i[s][0]||t.i[s][1]!==e.i[s][1])return!1;return!0})(this.v,t)||(this.v=xt.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,s=this.effectsSequence.length;for(t=0;t<s;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,s){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===s?e.pt.k:e.ks.k;this.v=xt.clone(i),this.pv=xt.clone(this.v),this.localShapeCollection=Ct.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function h(t,e,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=xt.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=xt.clone(this.v),this.localShapeCollection=Ct.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=a,this.reset=r,this._caching={lastFrame:a,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==a&&(i<e&&t<e||s<i&&s<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=s,n.prototype.setVValue=e,n.prototype.addEffect=i,h.prototype.getValue=s,h.prototype.interpolateShape=t,h.prototype.setVValue=e,h.prototype.addEffect=i;var o=function(){var n=v;function t(t,e){this.v=xt.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=Ct.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=R.getProp(t,e.p,1,0,this),this.s=R.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=3!==this.d,r=this.v;r.v[0][0]=t,r.v[0][1]=e-i,r.v[1][0]=a?t+s:t-s,r.v[1][1]=e,r.v[2][0]=t,r.v[2][1]=e+i,r.v[3][0]=a?t-s:t+s,r.v[3][1]=e,r.i[0][0]=a?t-s*n:t+s*n,r.i[0][1]=e-i,r.i[1][0]=a?t+s:t-s,r.i[1][1]=e-i*n,r.i[2][0]=a?t+s*n:t-s*n,r.i[2][1]=e+i,r.i[3][0]=a?t-s:t+s,r.i[3][1]=e+i*n,r.o[0][0]=a?t+s*n:t-s*n,r.o[0][1]=e-i,r.o[1][0]=a?t+s:t-s,r.o[1][1]=e+i*n,r.o[2][0]=a?t-s*n:t+s*n,r.o[2][1]=e+i,r.o[3][0]=a?t-s:t+s,r.o[3][1]=e-i*n}},E([T],t),t}(),l=function(){function t(t,e){this.v=xt.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=R.getProp(t,e.ir,0,0,this),this.is=R.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=R.getProp(t,e.pt,0,0,this),this.p=R.getProp(t,e.p,1,0,this),this.r=R.getProp(t,e.r,0,B,this),this.or=R.getProp(t,e.or,0,0,this),this.os=R.getProp(t,e.os,0,.01,this),this.localShapeCollection=Ct.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,s,i,a=2*Math.floor(this.pt.v),r=2*Math.PI/a,n=!0,h=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*h/(2*a),m=2*Math.PI*o/(2*a),d=-Math.PI/2;d+=this.r.v;var c=3===this.data.d?-1:1;for(t=this.v._length=0;t<a;t+=1){s=n?l:p,i=n?f:m;var u=(e=n?h:o)*Math.cos(d),g=e*Math.sin(d),y=0===u&&0===g?0:g/Math.sqrt(u*u+g*g),v=0===u&&0===g?0:-u/Math.sqrt(u*u+g*g);u+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(u,g,u-y*i*s*c,g-v*i*s*c,u+y*i*s*c,g+v*i*s*c,t,!0),n=!n,d+=r*c}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),s=2*Math.PI/e,i=this.or.v,a=this.os.v,r=2*Math.PI*i/(4*e),n=-Math.PI/2,h=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var o=i*Math.cos(n),l=i*Math.sin(n),p=0===o&&0===l?0:l/Math.sqrt(o*o+l*l),f=0===o&&0===l?0:-o/Math.sqrt(o*o+l*l);o+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(o,l,o-p*r*a*h,l-f*r*a*h,o+p*r*a*h,l+f*r*a*h,t,!0),n+=s*h}this.paths.length=0,this.paths[0]=this.v}},E([T],t),t}(),p=function(){function t(t,e){this.v=xt.newElement(),this.v.c=!0,this.localShapeCollection=Ct.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=R.getProp(t,e.p,1,0,this),this.s=R.getProp(t,e.s,1,0,this),this.r=R.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=m(s,i,this.r.v),r=a*(1-v);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+a,t+s,e-i+r,0,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-r,t+s,e+i-a,1,!0),0!==a?(this.v.setTripleAt(t+s-a,e+i,t+s-a,e+i,t+s-r,e+i,2,!0),this.v.setTripleAt(t-s+a,e+i,t-s+r,e+i,t-s+a,e+i,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-a,t-s,e+i-r,4,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+r,t-s,e-i+a,5,!0),this.v.setTripleAt(t-s+a,e-i,t-s+a,e-i,t-s+r,e-i,6,!0),this.v.setTripleAt(t+s-a,e-i,t+s-r,e-i,t+s-a,e-i,7,!0)):(this.v.setTripleAt(t-s,e+i,t-s+r,e+i,t-s,e+i,2),this.v.setTripleAt(t-s,e-i,t-s,e-i+r,t-s,e-i,3))):(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+r,t+s,e-i+a,0,!0),0!==a?(this.v.setTripleAt(t+s-a,e-i,t+s-a,e-i,t+s-r,e-i,1,!0),this.v.setTripleAt(t-s+a,e-i,t-s+r,e-i,t-s+a,e-i,2,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+a,t-s,e-i+r,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-r,t-s,e+i-a,4,!0),this.v.setTripleAt(t-s+a,e+i,t-s+a,e+i,t-s+r,e+i,5,!0),this.v.setTripleAt(t+s-a,e+i,t+s-r,e+i,t+s-a,e+i,6,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-a,t+s,e+i-r,7,!0)):(this.v.setTripleAt(t-s,e-i,t-s+r,e-i,t-s,e-i,1,!0),this.v.setTripleAt(t-s,e+i,t-s,e+i-r,t-s,e+i,2,!0),this.v.setTripleAt(t+s,e+i,t+s-r,e+i,t+s,e+i,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:r},E([T],t),t}();var f={getShapeProp:function(t,e,s){var i;return 3===s||4===s?i=(3===s?e.pt:e.ks).k.length?new h(t,e,s):new n(t,e,s):5===s?i=new p(t,e):6===s?i=new o(t,e):7===s&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return h}};return f}(),Y=(q={},(O={}).registerModifier=function(t,e){q[t]||(q[t]=e)},O.getModifier=function(t,e,s){return new q[t](e,s)},O);function H(){}function G(){}function K(){}function J(){}function U(){}function Z(){this._length=0,this._maxLength=4,this.shapes=C(this._maxLength)}function Q(t,e,s,i){this.elem=t,this.frameId=-1,this.dataProps=C(e.length),this.renderer=s,this.k=!1,this.dashStr="",this.dashArray=j("float32",e.length?e.length-1:0),this.dashoffset=j("float32",1),this.initDynamicPropertyContainer(i);var a,r,n=e.length||0;for(a=0;a<n;a+=1)r=R.getProp(t,e[a].v,0,0,this),this.k=r.k||this.k,this.dataProps[a]={n:e[a].n,p:r};this.k||this.getValue(!0),this._isAnimated=this.k}function $(t,e,s){this.data=e,this.c=j("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=j("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=R.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}H.prototype.initModifierProperties=function(){},H.prototype.addShapeToModifier=function(){},H.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:Ct.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},H.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=s,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},H.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},E([T],H),E([H],G),G.prototype.initModifierProperties=function(t,e){this.s=R.getProp(t,e.s,0,.01,this),this.e=R.getProp(t,e.e,0,.01,this),this.o=R.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},G.prototype.addShapeToModifier=function(t){t.pathsData=[]},G.prototype.calculateShapeEdges=function(t,e,s,i,a){var r=[];e<=1?r.push({s:t,e:e}):1<=t?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],l=r.length;for(n=0;n<l;n+=1){var p,f;if((h=r[n]).e*a<i||h.s*a>i+s);else p=h.s*a<=i?0:(h.s*a-i)/s,f=h.e*a>=i+s?1:(h.e*a-i)/s,o.push([p,f])}return o.length||o.push([0,0]),o},G.prototype.releasePathsData=function(t){var e,s=t.length;for(e=0;e<s;e+=1)Dt.release(t[e]);return t.length=0,t},G.prototype.processShapes=function(t){var e,s,i;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+a,(s=(1<this.e.v?1:this.e.v<0?0:this.e.v)+a)<e){var r=e;e=s,s=r}e=1e-4*Math.round(1e4*e),s=1e-4*Math.round(1e4*s),this.sValue=e,this.eValue=s}else e=this.sValue,s=this.eValue;var n,h,o,l,p,f,m=this.shapes.length,d=0;if(s===e)for(n=0;n<m;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===s&&0===e||0===s&&1===e){if(this._mdf)for(n=0;n<m;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var c,u,g=[];for(n=0;n<m;n+=1)if((c=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(o=(i=c.shape.paths)._length,f=0,!c.shape._mdf&&c.pathsData.length)f=c.totalShapeLength;else{for(l=this.releasePathsData(c.pathsData),h=0;h<o;h+=1)p=mt.getSegmentsLength(i.shapes[h]),l.push(p),f+=p.totalLength;c.totalShapeLength=f,c.pathsData=l}d+=f,c.shape._mdf=!0}else c.shape.paths=c.localShapeCollection;var y,v=e,_=s,b=0;for(n=m-1;0<=n;n-=1)if((c=this.shapes[n]).shape._mdf){for((u=c.localShapeCollection).releaseShapes(),2===this.m&&1<m?(y=this.calculateShapeEdges(e,s,c.totalShapeLength,b,d),b+=c.totalShapeLength):y=[[v,_]],o=y.length,h=0;h<o;h+=1){v=y[h][0],_=y[h][1],g.length=0,_<=1?g.push({s:c.totalShapeLength*v,e:c.totalShapeLength*_}):1<=v?g.push({s:c.totalShapeLength*(v-1),e:c.totalShapeLength*(_-1)}):(g.push({s:c.totalShapeLength*v,e:c.totalShapeLength}),g.push({s:0,e:c.totalShapeLength*(_-1)}));var k=this.addShapes(c,g[0]);if(g[0].s!==g[0].e){if(1<g.length)if(c.shape.paths.shapes[c.shape.paths._length-1].c){var A=k.pop();this.addPaths(k,u),k=this.addShapes(c,g[1],A)}else this.addPaths(k,u),k=this.addShapes(c,g[1]);this.addPaths(k,u)}}c.shape.paths=u}}},G.prototype.addPaths=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e.addShape(t[s])},G.prototype.addSegment=function(t,e,s,i,a,r,n){a.setXYAt(e[0],e[1],"o",r),a.setXYAt(s[0],s[1],"i",r+1),n&&a.setXYAt(t[0],t[1],"v",r),a.setXYAt(i[0],i[1],"v",r+1)},G.prototype.addSegmentFromArray=function(t,e,s,i){e.setXYAt(t[1],t[5],"o",s),e.setXYAt(t[2],t[6],"i",s+1),i&&e.setXYAt(t[0],t[4],"v",s),e.setXYAt(t[3],t[7],"v",s+1)},G.prototype.addShapes=function(t,e,s){var i,a,r,n,h,o,l,p,f=t.pathsData,m=t.shape.paths.shapes,d=t.shape.paths._length,c=0,u=[],g=!0;for(p=s?(h=s._length,s._length):(s=xt.newElement(),h=0),u.push(s),i=0;i<d;i+=1){for(o=f[i].lengths,s.c=m[i].c,r=m[i].c?o.length:o.length+1,a=1;a<r;a+=1)if(c+(n=o[a-1]).addedLength<e.s)c+=n.addedLength,s.c=!1;else{if(c>e.e){s.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[a],m[i].v[a],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[a],m[i].o[a-1],m[i].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1),c+=n.addedLength,h+=1}if(m[i].c&&o.length){if(n=o[a-1],c<=e.e){var y=o[a-1].addedLength;e.s<=c&&e.e>=c+y?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[0],m[i].v[0],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[0],m[i].o[a-1],m[i].i[0],(e.s-c)/y,(e.e-c)/y,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1)}else s.c=!1;c+=n.addedLength,h+=1}if(s._length&&(s.setXYAt(s.v[p][0],s.v[p][1],"i",p),s.setXYAt(s.v[s._length-1][0],s.v[s._length-1][1],"o",s._length-1)),c>e.e)break;i<d-1&&(s=xt.newElement(),g=!0,u.push(s),h=0)}return u},Y.registerModifier("tm",G),E([H],K),K.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=R.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},K.prototype.processPath=function(t,e){var s=xt.newElement();s.c=t.c;var i,a,r,n,h,o,l,p,f,m,d,c,u,g=t._length,y=0;for(i=0;i<g;i+=1)a=t.v[i],n=t.o[i],r=t.i[i],a[0]===n[0]&&a[1]===n[1]&&a[0]===r[0]&&a[1]===r[1]?0!==i&&i!==g-1||t.c?(h=0===i?t.v[g-1]:t.v[i-1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=c=a[0]+(h[0]-a[0])*l,f=u=a[1]-(a[1]-h[1])*l,m=p-(p-a[0])*v,d=f-(f-a[1])*v,s.setTripleAt(p,f,m,d,c,u,y),y+=1,h=i===g-1?t.v[0]:t.v[i+1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=m=a[0]+(h[0]-a[0])*l,f=d=a[1]+(h[1]-a[1])*l,c=p-(p-a[0])*v,u=f-(f-a[1])*v,s.setTripleAt(p,f,m,d,c,u,y)):s.setTripleAt(a[0],a[1],n[0],n[1],r[0],r[1],y):s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],y),y+=1;return s},K.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.rd.v;if(0!==o)for(s=0;s<h;s+=1){if((r=this.shapes[s]).shape.paths,n=r.localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},Y.registerModifier("rd",K),E([H],J),J.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=R.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},J.prototype.processPath=function(t,e){var s=e/100,i=[0,0],a=t._length,r=0;for(r=0;r<a;r+=1)i[0]+=t.v[r][0],i[1]+=t.v[r][1];i[0]/=a,i[1]/=a;var n,h,o,l,p,f,m=xt.newElement();for(m.c=t.c,r=0;r<a;r+=1)n=t.v[r][0]+(i[0]-t.v[r][0])*s,h=t.v[r][1]+(i[1]-t.v[r][1])*s,o=t.o[r][0]+(i[0]-t.o[r][0])*-s,l=t.o[r][1]+(i[1]-t.o[r][1])*-s,p=t.i[r][0]+(i[0]-t.i[r][0])*-s,f=t.i[r][1]+(i[1]-t.i[r][1])*-s,m.setTripleAt(n,h,o,l,p,f,r);return m},J.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.amount.v;if(0!==o)for(s=0;s<h;s+=1){if((r=this.shapes[s]).shape.paths,n=r.localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},Y.registerModifier("pb",J),E([H],U),U.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=R.getProp(t,e.c,0,null,this),this.o=R.getProp(t,e.o,0,null,this),this.tr=z.getTransformProperty(t,e.tr,this),this.so=R.getProp(t,e.tr.so,0,.01,this),this.eo=R.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new I,this.rMatrix=new I,this.sMatrix=new I,this.tMatrix=new I,this.matrix=new I},U.prototype.applyTransforms=function(t,e,s,i,a,r){var n=r?-1:1,h=i.s.v[0]+(1-i.s.v[0])*(1-a),o=i.s.v[1]+(1-i.s.v[1])*(1-a);t.translate(i.p.v[0]*n*a,i.p.v[1]*n*a,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*a),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.scale(r?1/h:h,r?1/o:o),s.translate(i.a.v[0],i.a.v[1],i.a.v[2])},U.prototype.init=function(t,e,s,i){this.elem=t,this.arr=e,this.pos=s,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[s]);for(;0<s;)s-=1,this._elements.unshift(e[s]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},U.prototype.resetElements=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},U.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},U.prototype.changeGroupRender=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]._render=e,"gr"===t[s].ty&&this.changeGroupRender(t[s].it,e)},U.prototype.processShapes=function(t){var e,s,i,a,r;if(this._mdf||t){var n,h=Math.ceil(this.c.v);if(this._groups.length<h){for(;this._groups.length<h;){var o={it:this.cloneElements(this._elements),ty:"gr"};o.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,o),this._groups.splice(0,0,o),this._currentCopies+=1}this.elem.reloadShapes()}for(i=r=0;i<=this._groups.length-1;i+=1)n=r<h,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),r+=1;this._currentCopies=h;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=(this.tr.v.props,this.pMatrix.props),d=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,g,y=0;if(0<l){for(;y<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),y+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),y+=p)}else if(l<0){for(;f<y;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),y-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),y-=p)}for(i=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,r=this._currentCopies;r;){if(g=(s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==y){for((0!==i&&1===a||i!==this._currentCopies-1&&-1===a)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),u=0;u<g;u+=1)s[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<g;u+=1)s[u]=this.matrix.props[u];y+=1,r-=1,i+=a}}else for(r=this._currentCopies,i=0,a=1;r;)s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,r-=1,i+=a},U.prototype.addShape=function(){},Y.registerModifier("rp",U),Z.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(C(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},Z.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)xt.release(this.shapes[t]);this._length=0},Q.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,s=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<s;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},E([T],Q),$.prototype.comparePoints=function(t,e){for(var s=0,i=this.o.length/2;s<i;){if(.01<Math.abs(t[4*s]-t[4*e+2*s]))return!1;s+=1}return!0},$.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},$.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,s,i,a=4*this.data.p;for(e=0;e<a;e+=1)s=e%4==0?100:255,i=Math.round(this.prop.v[e]*s),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(a=this.prop.v.length,e=4*this.data.p;e<a;e+=1)s=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},E([T],$);var tt,et,st=function(t,e,s,i){if(0===e)return"";var a,r=t.o,n=t.i,h=t.v,o=" M"+i.applyToPointStringified(h[0][0],h[0][1]);for(a=1;a<e;a+=1)o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[a][0],n[a][1])+" "+i.applyToPointStringified(h[a][0],h[a][1]);return s&&e&&(o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(h[0][0],h[0][1]),o+="z"),o},it=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,s=this.audios.length;for(e=0;e<s;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(t){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),at=function(){var a=function(){var t=w("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(t,e,s){var i="";if(t.e)i=t.p;else if(e){var a=t.p;-1!==a.indexOf("images/")&&(a=a.split("/")[1]),i=e+a}else i=s,i+=t.u?t.u:"",i+=t.p;return i}function t(t){this._imageLoaded=e.bind(this),this.testImageLoaded=function(t){var e=0,s=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(s)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return t.prototype={loadAssets:function(t,e){this.imagesLoadedCb=e;var s,i=t.length;for(s=0;s<i;s+=1)t[s].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[s])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,s=this.images.length;e<s;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}},createImgData:function(t){var e=r(t,this.assetsPath,this.path),s=w("img");s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.src=e;var i={img:s,assetData:t};return i},createImageData:function(t){var e=r(t,this.assetsPath,this.path),s=D("image");n?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(s);var i={img:s,assetData:t};return i},imageLoaded:e,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},t}(),rt=(tt={maskType:!0},(/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))&&(tt.maskType=!1),tt),nt=((et={}).createFilter=function(t){var e=D("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},et.createAlphaToLuminanceFilter=function(){var t=D("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},et),ht=function(){function r(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,s){var i,a=new XMLHttpRequest;a.open("GET",t,!0);try{a.responseType="json"}catch(t){}a.send(),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status)i=r(a),e(i);else try{i=r(a),e(i)}catch(t){s&&s(t)}}}}}();function ot(t,e,s){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=C(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(s)}function dt(t,e,s){var i={propType:!1},a=R.getProp,r=e.a;this.a={r:r.r?a(t,r.r,0,B,s):i,rx:r.rx?a(t,r.rx,0,B,s):i,ry:r.ry?a(t,r.ry,0,B,s):i,sk:r.sk?a(t,r.sk,0,B,s):i,sa:r.sa?a(t,r.sa,0,B,s):i,s:r.s?a(t,r.s,1,.01,s):i,a:r.a?a(t,r.a,1,0,s):i,o:r.o?a(t,r.o,0,.01,s):i,p:r.p?a(t,r.p,1,0,s):i,sw:r.sw?a(t,r.sw,0,0,s):i,sc:r.sc?a(t,r.sc,1,0,s):i,fc:r.fc?a(t,r.fc,1,0,s):i,fh:r.fh?a(t,r.fh,0,0,s):i,fs:r.fs?a(t,r.fs,0,.01,s):i,fb:r.fb?a(t,r.fb,0,.01,s):i,t:r.t?a(t,r.t,0,0,s):i},this.s=kt.getTextSelectorProp(t,e.s,s),this.s.t=e.s.t}function ct(t,e,s,i,a,r){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=a,this.p=r,this._mdf={o:!0,sw:!!e,sc:!!s,fc:!!i,m:!0,p:!0}}function ut(t,e){this._frameId=s,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}ot.prototype.searchProperties=function(){var t,e,s=this._textData.a.length,i=R.getProp;for(t=0;t<s;t+=1)e=this._textData.a[t],this._animatorsData[t]=new dt(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},ot.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var s,i,a,r,n,h,o,l,p,f,m,d,c,u,g,y,v,_,b,k=this._moreOptions.alignment.v,A=this._animatorsData,P=this._textData,S=this.mHelper,x=this._renderType,C=this.renderedLetters.length,D=(this.data,t.l);if(this._hasMaskedPath){if(b=this._pathData.m,!this._pathData.n||this._pathData._mdf){var w,T=b.v;for(this._pathData.r&&(T=T.reverse()),n={tLength:0,segments:[]},r=T._length-1,a=y=0;a<r;a+=1)w=mt.buildBezierData(T.v[a],T.v[a+1],[T.o[a][0]-T.v[a][0],T.o[a][1]-T.v[a][1]],[T.i[a+1][0]-T.v[a+1][0],T.i[a+1][1]-T.v[a+1][1]]),n.tLength+=w.segmentLength,n.segments.push(w),y+=w.segmentLength;a=r,b.v.c&&(w=mt.buildBezierData(T.v[a],T.v[0],[T.o[a][0]-T.v[a][0],T.o[a][1]-T.v[a][1]],[T.i[0][0]-T.v[0][0],T.i[0][1]-T.v[0][1]]),n.tLength+=w.segmentLength,n.segments.push(w),y+=w.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,h=this._pathData.f.v,f=1,p=!(l=m=0),u=n.segments,h<0&&b.v.c)for(n.tLength<Math.abs(h)&&(h=-Math.abs(h)%n.tLength),f=(c=u[m=u.length-1].points).length-1;h<0;)h+=c[f].partialLength,(f-=1)<0&&(f=(c=u[m-=1].points).length-1);d=(c=u[m].points)[f-1],g=(o=c[f]).partialLength}r=D.length,i=s=0;var M,F,E,I,L=1.2*t.finalSize*.714,V=!0;E=A.length;var R,z,N,O,q,B,j,W,X,Y,H,G,K,J=-1,U=h,Z=m,Q=f,$=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var st=0,it=0,at=2===t.j?-.5:-1,rt=0,nt=!0;for(a=0;a<r;a+=1)if(D[a].n){for(st&&(st+=it);rt<a;)D[rt].animatorJustifyOffset=st,rt+=1;nt=!(st=0)}else{for(F=0;F<E;F+=1)(M=A[F].a).t.propType&&(nt&&2===t.j&&(it+=M.t.v*at),(R=A[F].s.getMult(D[a].anIndexes[F],P.a[F].s.totalChars)).length?st+=M.t.v*R[0]*at:st+=M.t.v*R*at);nt=!1}for(st&&(st+=it);rt<a;)D[rt].animatorJustifyOffset=st,rt+=1}for(a=0;a<r;a+=1){if(S.reset(),q=1,D[a].n)s=0,i+=t.yOffset,i+=V?1:0,h=U,V=!1,0,this._hasMaskedPath&&(f=Q,d=(c=u[m=Z].points)[f-1],g=(o=c[f]).partialLength,l=0),K=Y=G=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if($!==D[a].line){switch(t.j){case 1:h+=y-t.lineWidths[D[a].line];break;case 2:h+=(y-t.lineWidths[D[a].line])/2}$=D[a].line}J!==D[a].ind&&(D[J]&&(h+=D[J].extra),h+=D[a].an/2,J=D[a].ind),h+=k[0]*D[a].an/200;var ht=0;for(F=0;F<E;F+=1)(M=A[F].a).p.propType&&((R=A[F].s.getMult(D[a].anIndexes[F],P.a[F].s.totalChars)).length?ht+=M.p.v[0]*R[0]:ht+=M.p.v[0]*R),M.a.propType&&((R=A[F].s.getMult(D[a].anIndexes[F],P.a[F].s.totalChars)).length?ht+=M.a.v[0]*R[0]:ht+=M.a.v[0]*R);for(p=!0;p;)h+ht<=l+g||!c?(v=(h+ht-l)/o.partialLength,N=d.point[0]+(o.point[0]-d.point[0])*v,O=d.point[1]+(o.point[1]-d.point[1])*v,S.translate(-k[0]*D[a].an/200,-k[1]*L/100),p=!1):c&&(l+=o.partialLength,(f+=1)>=c.length&&(f=0,c=u[m+=1]?u[m].points:b.v.c?u[m=f=0].points:(l-=o.partialLength,null)),c&&(d=o,g=(o=c[f]).partialLength));z=D[a].an/2-D[a].add,S.translate(-z,0,0)}else z=D[a].an/2-D[a].add,S.translate(-z,0,0),S.translate(-k[0]*D[a].an/200,-k[1]*L/100,0);for(D[a].l/2,F=0;F<E;F+=1)(M=A[F].a).t.propType&&(R=A[F].s.getMult(D[a].anIndexes[F],P.a[F].s.totalChars),0===s&&0===t.j||(this._hasMaskedPath?R.length?h+=M.t.v*R[0]:h+=M.t.v*R:R.length?s+=M.t.v*R[0]:s+=M.t.v*R));for(D[a].l/2,t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(B=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(W=[t.fc[0],t.fc[1],t.fc[2]]),F=0;F<E;F+=1)(M=A[F].a).a.propType&&((R=A[F].s.getMult(D[a].anIndexes[F],P.a[F].s.totalChars)).length?S.translate(-M.a.v[0]*R[0],-M.a.v[1]*R[1],M.a.v[2]*R[2]):S.translate(-M.a.v[0]*R,-M.a.v[1]*R,M.a.v[2]*R));for(F=0;F<E;F+=1)(M=A[F].a).s.propType&&((R=A[F].s.getMult(D[a].anIndexes[F],P.a[F].s.totalChars)).length?S.scale(1+(M.s.v[0]-1)*R[0],1+(M.s.v[1]-1)*R[1],1):S.scale(1+(M.s.v[0]-1)*R,1+(M.s.v[1]-1)*R,1));for(F=0;F<E;F+=1){if(M=A[F].a,R=A[F].s.getMult(D[a].anIndexes[F],P.a[F].s.totalChars),M.sk.propType&&(R.length?S.skewFromAxis(-M.sk.v*R[0],M.sa.v*R[1]):S.skewFromAxis(-M.sk.v*R,M.sa.v*R)),M.r.propType&&(R.length?S.rotateZ(-M.r.v*R[2]):S.rotateZ(-M.r.v*R)),M.ry.propType&&(R.length?S.rotateY(M.ry.v*R[1]):S.rotateY(M.ry.v*R)),M.rx.propType&&(R.length?S.rotateX(M.rx.v*R[0]):S.rotateX(M.rx.v*R)),M.o.propType&&(R.length?q+=(M.o.v*R[0]-q)*R[0]:q+=(M.o.v*R-q)*R),t.strokeWidthAnim&&M.sw.propType&&(R.length?j+=M.sw.v*R[0]:j+=M.sw.v*R),t.strokeColorAnim&&M.sc.propType)for(X=0;X<3;X+=1)R.length?B[X]=B[X]+(M.sc.v[X]-B[X])*R[0]:B[X]=B[X]+(M.sc.v[X]-B[X])*R;if(t.fillColorAnim&&t.fc){if(M.fc.propType)for(X=0;X<3;X+=1)R.length?W[X]=W[X]+(M.fc.v[X]-W[X])*R[0]:W[X]=W[X]+(M.fc.v[X]-W[X])*R;M.fh.propType&&(W=R.length?ft(W,M.fh.v*R[0]):ft(W,M.fh.v*R)),M.fs.propType&&(W=R.length?lt(W,M.fs.v*R[0]):lt(W,M.fs.v*R)),M.fb.propType&&(W=R.length?pt(W,M.fb.v*R[0]):pt(W,M.fb.v*R))}}for(F=0;F<E;F+=1)(M=A[F].a).p.propType&&(R=A[F].s.getMult(D[a].anIndexes[F],P.a[F].s.totalChars),this._hasMaskedPath?R.length?S.translate(0,M.p.v[1]*R[0],-M.p.v[2]*R[1]):S.translate(0,M.p.v[1]*R,-M.p.v[2]*R):R.length?S.translate(M.p.v[0]*R[0],M.p.v[1]*R[1],-M.p.v[2]*R[2]):S.translate(M.p.v[0]*R,M.p.v[1]*R,-M.p.v[2]*R));if(t.strokeWidthAnim&&(Y=j<0?0:j),t.strokeColorAnim&&(H="rgb("+Math.round(255*B[0])+","+Math.round(255*B[1])+","+Math.round(255*B[2])+")"),t.fillColorAnim&&t.fc&&(G="rgb("+Math.round(255*W[0])+","+Math.round(255*W[1])+","+Math.round(255*W[2])+")"),this._hasMaskedPath){if(S.translate(0,-t.ls),S.translate(0,k[1]*L/100+i,0),P.p.p){_=(o.point[1]-d.point[1])/(o.point[0]-d.point[0]);var ot=180*Math.atan(_)/Math.PI;o.point[0]<d.point[0]&&(ot+=180),S.rotate(-ot*Math.PI/180)}S.translate(N,O,0),h-=k[0]*D[a].an/200,D[a+1]&&J!==D[a+1].ind&&(h+=D[a].an/2,h+=t.tr/1e3*t.finalSize)}else{switch(S.translate(s,i,0),t.ps&&S.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:S.translate(D[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[a].line]),0,0);break;case 2:S.translate(D[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[a].line])/2,0,0)}S.translate(0,-t.ls),S.translate(z,0,0),S.translate(k[0]*D[a].an/200,k[1]*L/100,0),s+=D[a].l+t.tr/1e3*t.finalSize}"html"===x?tt=S.toCSS():"svg"===x?tt=S.to2dCSS():et=[S.props[0],S.props[1],S.props[2],S.props[3],S.props[4],S.props[5],S.props[6],S.props[7],S.props[8],S.props[9],S.props[10],S.props[11],S.props[12],S.props[13],S.props[14],S.props[15]],K=q}this.lettersChangedFlag=C<=a?(I=new ct(K,Y,H,G,tt,et),this.renderedLetters.push(I),C+=1,!0):(I=this.renderedLetters[a]).update(K,Y,H,G,tt,et)||this.lettersChangedFlag}}},ot.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},ot.prototype.mHelper=new I,ot.prototype.defaultPropsArray=[],E([T],ot),ct.prototype.update=function(t,e,s,i,a,r){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==s&&(this.sc=s,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==a&&(this.m=a,n=this._mdf.m=!0),!r.length||this.p[0]===r[0]&&this.p[1]===r[1]&&this.p[4]===r[4]&&this.p[5]===r[5]&&this.p[12]===r[12]&&this.p[13]===r[13]||(this.p=r,n=this._mdf.p=!0),n},ut.prototype.defaultBoxWidth=[0,0],ut.prototype.copyData=function(t,e){for(var s in e)e.hasOwnProperty(s)&&(t[s]=e[s]);return t},ut.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},ut.prototype.searchProperty=function(){return this.searchKeyframes()},ut.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},ut.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},ut.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,s=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var i,a=this.effectsSequence.length,r=t||this.data.d.k[this.keysIndex].s;for(i=0;i<a;i+=1)r=s!==this.keysIndex?this.effectsSequence[i](r,r.t):this.effectsSequence[i](this.currentData,r.t);e!==r&&this.setCurrentData(r),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},ut.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,s=0,i=t.length;s<=i-1&&(t[s].s,!(s===i-1||t[s+1].t>e));)s+=1;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d.k[this.keysIndex].s},ut.prototype.buildFinalText=function(t){for(var e,s=V.getCombinedCharacterCodes(),i=[],a=0,r=t.length;a<r;)e=t.charCodeAt(a),-1!==s.indexOf(e)?i[i.length-1]+=t.charAt(a):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(a+1))&&e<=57343?(i.push(t.substr(a,2)),++a):i.push(t.charAt(a)),a+=1;return i},ut.prototype.completeTextData=function(t){t.__complete=!0;var e,s,i,a,r,n,h,o=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,d=0,c=0,u=0,g=[],y=0,v=0,_=o.getFontByName(t.f),b=0,k=_.fStyle?_.fStyle.split(" "):[],A="normal",P="normal";for(s=k.length,e=0;e<s;e+=1)switch(k[e].toLowerCase()){case"italic":P="italic";break;case"bold":A="700";break;case"black":A="900";break;case"medium":A="500";break;case"regular":case"normal":A="400";break;case"light":case"thin":A="200"}t.fWeight=_.fWeight||A,t.fStyle=P,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),s=t.finalText.length,t.finalLineHeight=t.lh;var S,x=t.tr/1e3*t.finalSize;if(t.sz)for(var C,D,w=!0,T=t.sz[0],M=t.sz[1];w;){y=C=0,s=(D=this.buildFinalText(t.t)).length,x=t.tr/1e3*t.finalSize;var F=-1;for(e=0;e<s;e+=1)S=D[e].charCodeAt(0),i=!1," "===D[e]?F=e:13!==S&&3!==S||(i=!(y=0),C+=t.finalLineHeight||1.2*t.finalSize),T<y+(b=o.chars?(h=o.getCharData(D[e],_.fStyle,_.fFamily),i?0:h.w*t.finalSize/100):o.measureText(D[e],t.f,t.finalSize))&&" "!==D[e]?(-1===F?s+=1:e=F,C+=t.finalLineHeight||1.2*t.finalSize,D.splice(e,F===e?1:0,"\r"),F=-1,y=0):(y+=b,y+=x);C+=_.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&M<C?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=D,s=t.finalText.length,w=!1)}y=-x;var E,I=b=0;for(e=0;e<s;e+=1)if(i=!1,13===(S=(E=t.finalText[e]).charCodeAt(0))||3===S?(I=0,g.push(y),v=v<y?y:v,y=-2*x,i=!(a=""),u+=1):a=E,b=o.chars?(h=o.getCharData(E,_.fStyle,o.getFontByName(t.f).fFamily),i?0:h.w*t.finalSize/100):o.measureText(a,t.f,t.finalSize)," "===E?I+=b+x:(y+=b+x+I,I=0),p.push({l:b,an:b,add:d,n:i,anIndexes:[],val:a,line:u,animatorJustifyOffset:0}),2==m){if(d+=b,""===a||" "===a||e===s-1){for(""!==a&&" "!==a||(d-=b);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=b,c+=1;f+=1,d=0}}else if(3==m){if(d+=b,""===a||e===s-1){for(""===a&&(d-=b);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=b,c+=1;d=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<y?y:v,g.push(y),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var L,V,R=l.a;n=R.length;var z,N,O=[];for(r=0;r<n;r+=1){for((L=R[r]).a.sc&&(t.strokeColorAnim=!0),L.a.sw&&(t.strokeWidthAnim=!0),(L.a.fc||L.a.fh||L.a.fs||L.a.fb)&&(t.fillColorAnim=!0),N=0,z=L.s.b,e=0;e<s;e+=1)(V=p[e]).anIndexes[r]=N,(1==z&&""!==V.val||2==z&&""!==V.val&&" "!==V.val||3==z&&(V.n||" "==V.val||e==s-1)||4==z&&(V.n||e==s-1))&&(1===L.s.rn&&O.push(N),N+=1);l.a[r].s.totalChars=N;var q,B=-1;if(1===L.s.rn)for(e=0;e<s;e+=1)B!=(V=p[e]).anIndexes[r]&&(B=V.anIndexes[r],q=O.splice(Math.floor(Math.random()*O.length),1)[0]),V.anIndexes[r]=q}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=_.ascent*t.finalSize/100},ut.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var s=this.copyData({},this.data.d.k[e].s);s=this.copyData(s,t),this.data.d.k[e].s=s,this.recalculate(e),this.elem.addDynamicProperty(this)},ut.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},ut.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},ut.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var gt,yt,vt,_t,bt,kt=function(){var d=Math.max,c=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=R.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?R.getProp(t,e.e,0,0,this):{v:100},this.o=R.getProp(t,e.o||{k:0},0,0,this),this.xe=R.getProp(t,e.xe||{k:0},0,0,this),this.ne=R.getProp(t,e.ne||{k:0},0,0,this),this.a=R.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,s=0,i=1,a=1;0<this.ne.v?e=this.ne.v/100:s=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:a=1+this.xe.v/100;var r=W.getBezierEasing(e,s,i,a).get,n=0,h=this.finalS,o=this.finalE,l=this.data.sh;if(2===l)n=r(n=o===h?o<=t?1:0:d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(3===l)n=r(n=o===h?o<=t?0:1:1-d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(4===l)o===h?n=0:(n=d(0,c(.5/(o-h)+(t-h)/(o-h),1)))<.5?n*=2:n=1-2*(n-.5),n=r(n);else if(5===l){if(o===h)n=0;else{var p=o-h,f=-p/2+(t=c(d(0,t+.5-h),o-h)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=r(n)}else n=6===l?r(n=o===h?0:(t=c(d(0,t+.5-h),o-h),(1+Math.cos(Math.PI+2*Math.PI*t/(o-h)))/2)):(t>=u(h)&&(n=d(0,c(t-h<0?c(o,1)-(h-t):o-t,1))),r(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,s=this.o.v/e,i=this.s.v/e+s,a=this.e.v/e+s;if(a<i){var r=i;i=a,a=r}this.finalS=i,this.finalE=a}},E([T],i),{getTextSelectorProp:function(t,e,s){return new i(t,e,s)}}}(),At=function(t,e,s,i){var a=0,r=t,n=C(r);function h(){return a?n[a-=1]:e()}return{newElement:h,release:function(t){a===r&&(n=Pt.double(n),r*=2),s&&s(t),n[a]=t,a+=1}}},Pt={double:function(t){return t.concat(C(t.length))}},St=At(8,function(){return j("float32",2)}),xt=((gt=At(4,function(){return new N},function(t){var e,s=t._length;for(e=0;e<s;e+=1)St.release(t.v[e]),St.release(t.i[e]),St.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1})).clone=function(t){var e,s=gt.newElement(),i=void 0===t._length?t.v.length:t._length;for(s.setLength(i),s.c=t.c,e=0;e<i;e+=1)s.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return s},gt),Ct=(yt={newShapeCollection:function(){var t;t=vt?bt[vt-=1]:new Z;return t},release:function(t){var e,s=t._length;for(e=0;e<s;e+=1)xt.release(t.shapes[e]);t._length=0,vt===_t&&(bt=Pt.double(bt),_t*=2);bt[vt]=t,vt+=1}},vt=0,bt=C(_t=4),yt),Dt=At(8,function(){return{lengths:[],totalLength:0}},function(t){var e,s=t.lengths.length;for(e=0;e<s;e+=1)wt.release(t.lengths[e]);t.lengths.length=0}),wt=At(8,function(){return{addedLength:0,percents:j("float32",P),lengths:j("float32",P)}});function Tt(){}function Mt(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=D("svg");var s="";if(e&&e.title){var i=D("title"),a=S();i.setAttribute("id",a),i.textContent=e.title,this.svgElement.appendChild(i),s+=a}if(e&&e.description){var r=D("desc"),n=S();r.setAttribute("id",n),r.textContent=e.description,this.svgElement.appendChild(r),s+=" "+n}s&&this.svgElement.setAttribute("aria-labelledby",s);var h=D("defs");this.svgElement.appendChild(h);var o=D("g");this.svgElement.appendChild(o),this.layerElement=o,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:h,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function Ft(t,e,s){this.data=t,this.element=e,this.globalData=s,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,a=this.globalData.defs,r=this.masksProperties?this.masksProperties.length:0;this.viewData=C(r),this.solidPath="";var n,h,o,l,p,f,m,d=this.masksProperties,c=0,u=[],g=S(),y="clipPath",v="clip-path";for(i=0;i<r;i++)if(("a"!==d[i].mode&&"n"!==d[i].mode||d[i].inv||100!==d[i].o.k||d[i].o.x)&&(v=y="mask"),"s"!=d[i].mode&&"i"!=d[i].mode||0!==c?l=null:((l=D("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),n=D("path"),"n"!=d[i].mode){var _;if(c+=1,n.setAttribute("fill","s"===d[i].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==d[i].x.k?(v=y="mask",m=R.getProp(this.element,d[i].x,0,null,this.element),_=S(),(p=D("filter")).setAttribute("id",_),(f=D("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),a.appendChild(p),n.setAttribute("stroke","s"===d[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:n,x:m,expan:f,lastPath:"",lastOperator:"",filterId:_,lastRadius:0},"i"==d[i].mode){o=u.length;var b=D("g");for(h=0;h<o;h+=1)b.appendChild(u[h]);var k=D("mask");k.setAttribute("mask-type","alpha"),k.setAttribute("id",g+"_"+c),k.appendChild(n),a.appendChild(k),b.setAttribute("mask","url("+A+"#"+g+"_"+c+")"),u.length=0,u.push(b)}else u.push(n);d[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:n,lastPath:"",op:R.getProp(this.element,d[i].o,0,.01,this.element),prop:X.getShapeProp(this.element,d[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(d[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:R.getProp(this.element,d[i].o,0,.01,this.element),prop:X.getShapeProp(this.element,d[i],3),elem:n,lastPath:""},a.appendChild(n);for(this.maskElement=D(y),r=u.length,i=0;i<r;i+=1)this.maskElement.appendChild(u[i]);0<c&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+A+"#"+g+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function Et(){}function It(){}function Lt(){}function Vt(){}function Rt(){}function zt(t,e){this.elem=t,this.pos=e}function Nt(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=D("path"),this.msElem=null}function Ot(t,e,s){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;for(var i=0,a=t.length;i<a;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function qt(t,e,s){this.transform={mProps:t,op:e,container:s},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function Bt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=R.getProp(t,e.o,0,.01,this),this.w=R.getProp(t,e.w,0,null,this),this.d=new Q(t,e.d||{},"svg",this),this.c=R.getProp(t,e.c,1,255,this),this.style=s,this._isAnimated=!!this._isAnimated}function jt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=R.getProp(t,e.o,0,.01,this),this.c=R.getProp(t,e.c,1,255,this),this.style=s}function Wt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,s)}function Xt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=R.getProp(t,e.w,0,null,this),this.d=new Q(t,e.d||{},"svg",this),this.initGradientData(t,e,s),this._isAnimated=!!this._isAnimated}function Yt(){this.it=[],this.prevViewData=[],this.gr=D("g")}Tt.prototype.checkLayers=function(t){var e,s,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e--)this.elements[e]||(s=this.layers[e]).ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},Tt.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t)}return this.createNull(t)},Tt.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Tt.prototype.createAudio=function(t){return new ee(t,this.globalData,this)},Tt.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},Tt.prototype.includeLayers=function(t){this.completeLayers=!1;var e,s,i=t.length,a=this.layers.length;for(e=0;e<i;e+=1)for(s=0;s<a;){if(this.layers[s].id==t[e].id){this.layers[s]=t[e];break}s+=1}},Tt.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},Tt.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},Tt.prototype.buildElementParenting=function(t,e,s){for(var i=this.elements,a=this.layers,r=0,n=a.length;r<n;)a[r].ind==e&&(i[r]&&!0!==i[r]?(s.push(i[r]),i[r].setAsParent(),void 0!==a[r].parent?this.buildElementParenting(t,a[r].parent,s):t.setHierarchy(s)):(this.buildItem(r),this.addPendingElement(t))),r+=1},Tt.prototype.addPendingElement=function(t){this.pendingElements.push(t)},Tt.prototype.searchExtraCompositions=function(t){var e,s=t.length;for(e=0;e<s;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},Tt.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new V,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},E([Tt],Mt),Mt.prototype.createNull=function(t){return new Kt(t,this.globalData,this)},Mt.prototype.createShape=function(t){return new ae(t,this.globalData,this)},Mt.prototype.createText=function(t){return new ie(t,this.globalData,this)},Mt.prototype.createImage=function(t){return new $t(t,this.globalData,this)},Mt.prototype.createComp=function(t){return new se(t,this.globalData,this)},Mt.prototype.createSolid=function(t){return new te(t,this.globalData,this)},Mt.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var s=D("clipPath"),i=D("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var a=S();s.setAttribute("id",a),s.appendChild(i),this.layerElement.setAttribute("clip-path","url("+A+"#"+a+")"),e.appendChild(s),this.layers=t.layers,this.elements=C(t.layers.length)},Mt.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},Mt.prototype.updateContainerSize=function(){},Mt.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var s=this.createItem(this.layers[t]);e[t]=s,h&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(s),s.initExpressions()),this.appendElementInPos(s,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?s.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(s)))}},Mt.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,s=this.elements.length;e<s;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},Mt.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=s-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<s;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},Mt.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){for(var i,a=0;a<e;)this.elements[a]&&!0!==this.elements[a]&&this.elements[a].getBaseElement()&&(i=this.elements[a].getBaseElement()),a+=1;i?this.layerElement.insertBefore(s,i):this.layerElement.appendChild(s)}},Mt.prototype.hide=function(){this.layerElement.style.display="none"},Mt.prototype.show=function(){this.layerElement.style.display="block"},Ft.prototype.getMaskProperty=function(t){return this.viewData[t].prop},Ft.prototype.renderFrame=function(t){var e,s=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",s.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var a=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+A+"#"+this.storedData[e].filterId+")")),a.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},Ft.prototype.getMaskelement=function(){return this.maskElement},Ft.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},Ft.prototype.drawPath=function(t,e,s){var i,a,r=" M"+e.v[0][0]+","+e.v[0][1];for(a=e._length,i=1;i<a;i+=1)r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<a&&(r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),s.lastPath!==r){var n="";s.elem&&(e.c&&(n=t.inv?this.solidPath+r:r),s.elem.setAttribute("d",n)),s.lastPath=r}},Ft.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},Et.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},It.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var s,i=this.dynamicProperties.length;for(s=0;s<i;s+=1)(e||this._isParent&&"transform"===this.dynamicProperties[s].propType)&&(this.dynamicProperties[s].getValue(),this.dynamicProperties[s]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},Lt.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?z.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new I},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,s=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;s<i;){if(this.hierarchy[s].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}s+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),s=0;s<i;s+=1)t=this.hierarchy[s].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var s=!0,i=this.comp;s;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):s=!1;var a,r,n=e.length;for(a=0;a<n;a+=1)r=e[a].mat.applyToPointArray(0,0,0),t=[t[0]-r[0],t[1]-r[1],0];return t},mHelper:new I},Vt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},E([Vt,function(t){function e(){}return e.prototype=t,e}({initElement:function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],Rt),Nt.prototype.reset=function(){this.d="",this._mdf=!1},Ot.prototype.setAsAnimated=function(){this._isAnimated=!0},E([T],Bt),E([T],jt),Wt.prototype.initGradientData=function(t,e,s){this.o=R.getProp(t,e.o,0,.01,this),this.s=R.getProp(t,e.s,1,null,this),this.e=R.getProp(t,e.e,1,null,this),this.h=R.getProp(t,e.h||{k:0},0,.01,this),this.a=R.getProp(t,e.a||{k:0},0,B,this),this.g=new $(t,e.g,this),this.style=s,this.stops=[],this.setGradientData(s.pElem,e),this.setGradientOpacity(e,s),this._isAnimated=!!this._isAnimated},Wt.prototype.setGradientData=function(t,e){var s=S(),i=D(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",s),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var a,r,n,h=[];for(n=4*e.g.p,r=0;r<n;r+=4)a=D("stop"),i.appendChild(a),h.push(a);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+A+"#"+s+")"),this.gf=i,this.cst=h},Wt.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var s,i,a,r=D("mask"),n=D("path");r.appendChild(n);var h=S(),o=S();r.setAttribute("id",o);var l=D(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",h),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),a=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(i=4*t.g.p;i<a;i+=2)(s=D("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(s),p.push(s);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+A+"#"+h+")"),this.of=l,this.ms=r,this.ost=p,this.maskId=o,e.msElem=n}},E([T],Wt),E([Wt,T],Xt);var Ht=function(){var g=new I,y=new I;function e(t,e,s){(s||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(s||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function s(t,e,s){var i,a,r,n,h,o,l,p,f,m,d,c=e.styles.length,u=e.lvl;for(o=0;o<c;o+=1){if(n=e.sh._mdf||s,e.styles[o].lvl<u){for(p=y.reset(),m=u-e.styles[o].lvl,d=e.transformers.length-1;!n&&0<m;)n=e.transformers[d].mProps._mdf||n,m--,d--;if(n)for(m=u-e.styles[o].lvl,d=e.transformers.length-1;0<m;)f=e.transformers[d].mProps.v.props,p.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),m--,d--}else p=g;if(a=(l=e.sh.paths)._length,n){for(r="",i=0;i<a;i+=1)(h=l.shapes[i])&&h._length&&(r+=st(h,h._length,h.c,p));e.caches[o]=r}else r=e.caches[o];e.styles[o].d+=!0===t.hd?"":r,e.styles[o]._mdf=n||e.styles[o]._mdf}}function i(t,e,s){var i=e.style;(e.c._mdf||s)&&i.pElem.setAttribute("fill","rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function a(t,e,s){r(t,e,s),n(t,e,s)}function r(t,e,s){var i,a,r,n,h,o=e.gf,l=e.g._hasOpacity,p=e.s.v,f=e.e.v;if(e.o._mdf||s){var m="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(m,e.o.v)}if(e.s._mdf||s){var d=1===t.t?"x1":"cx",c="x1"===d?"y1":"cy";o.setAttribute(d,p[0]),o.setAttribute(c,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(d,p[0]),e.of.setAttribute(c,p[1]))}if(e.g._cmdf||s){i=e.cst;var u=e.g.c;for(r=i.length,a=0;a<r;a+=1)(n=i[a]).setAttribute("offset",u[4*a]+"%"),n.setAttribute("stop-color","rgb("+u[4*a+1]+","+u[4*a+2]+","+u[4*a+3]+")")}if(l&&(e.g._omdf||s)){var g=e.g.o;for(r=(i=e.g._collapsable?e.cst:e.ost).length,a=0;a<r;a+=1)n=i[a],e.g._collapsable||n.setAttribute("offset",g[2*a]+"%"),n.setAttribute("stop-opacity",g[2*a+1])}if(1===t.t)(e.e._mdf||s)&&(o.setAttribute("x2",f[0]),o.setAttribute("y2",f[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",f[0]),e.of.setAttribute("y2",f[1])));else if((e.s._mdf||e.e._mdf||s)&&(h=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)),o.setAttribute("r",h),l&&!e.g._collapsable&&e.of.setAttribute("r",h)),e.e._mdf||e.h._mdf||e.a._mdf||s){h||(h=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)));var y=Math.atan2(f[1]-p[1],f[0]-p[0]),v=h*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),_=Math.cos(y+e.a.v)*v+p[0],b=Math.sin(y+e.a.v)*v+p[1];o.setAttribute("fx",_),o.setAttribute("fy",b),l&&!e.g._collapsable&&(e.of.setAttribute("fx",_),e.of.setAttribute("fy",b))}}function n(t,e,s){var i=e.style,a=e.d;a&&(a._mdf||s)&&a.dashStr&&(i.pElem.setAttribute("stroke-dasharray",a.dashStr),i.pElem.setAttribute("stroke-dashoffset",a.dashoffset[0])),e.c&&(e.c._mdf||s)&&i.pElem.setAttribute("stroke","rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||s)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){t.ty;switch(t.ty){case"fl":return i;case"gf":return r;case"gs":return a;case"st":return n;case"sh":case"el":case"rc":case"sr":return s;case"tr":return e}}}}();function Gt(){}function Kt(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initFrame(),this.initTransform(t,e,s),this.initHierarchy()}function Jt(){}function Ut(){}function Zt(){}function Qt(){}function $t(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function te(t,e,s){this.initElement(t,e,s)}function ee(t,e,s){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,s),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function se(t,e,s){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?C(this.layers.length):[],this.initElement(t,e,s),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ie(t,e,s){this.textSpans=[],this.renderType="svg",this.initElement(t,e,s)}function ae(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,s),this.prevViewData=[]}Gt.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=F(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=S(),this.data.sr||(this.data.sr=1),this.effectsManager=new le(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},Kt.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},Kt.prototype.renderFrame=function(){},Kt.prototype.getBaseElement=function(){return null},Kt.prototype.destroy=function(){},Kt.prototype.sourceRectAtTime=function(){},Kt.prototype.hide=function(){},E([Gt,Lt,Et,It],Kt),Jt.prototype={initRendererElement:function(){this.layerElement=D("g")},createContainerElements:function(){this.matteElement=D("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,s,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var a=D("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),a.appendChild(this.layerElement),i=a,this.globalData.defs.appendChild(a),rt.maskType||1!=this.data.td||(a.setAttribute("mask-type","luminance"),t=S(),e=nt.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(nt.createAlphaToLuminanceFilter()),(s=D("g")).appendChild(this.layerElement),i=s,a.appendChild(s),s.setAttribute("filter","url("+A+"#"+t+")"))}else if(2==this.data.td){var r=D("mask");r.setAttribute("id",this.layerId),r.setAttribute("mask-type","alpha");var n=D("g");r.appendChild(n),t=S(),e=nt.createFilter(t);var h=D("feComponentTransfer");h.setAttribute("in","SourceGraphic"),e.appendChild(h);var o=D("feFuncA");o.setAttribute("type","table"),o.setAttribute("tableValues","1.0 0.0"),h.appendChild(o),this.globalData.defs.appendChild(e);var l=D("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+A+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,rt.maskType||(r.setAttribute("mask-type","luminance"),e.appendChild(nt.createAlphaToLuminanceFilter()),s=D("g"),n.appendChild(l),s.appendChild(this.layerElement),i=s,n.appendChild(s)),this.globalData.defs.appendChild(r)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=D("clipPath"),f=D("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=S();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var d=D("g");d.setAttribute("clip-path","url("+A+"#"+m+")"),d.appendChild(this.layerElement),this.transformedElement=d,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+A+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new Ft(this.data,this,this.globalData),this.renderableEffectsManager=new ne(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+A+"#"+t+")")}},Ut.prototype={addShapeToModifiers:function(t){var e,s=this.shapeModifiers.length;for(e=0;e<s;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,s=0,i=e.length;s<i;){if(e[s].elem===t)return e[s].pos;s+=1}return 0},addProcessedElement:function(t,e){for(var s=this.processedElements,i=s.length;i;)if(s[i-=1].elem===t)return void(s[i].pos=e);s.push(new zt(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},Zt.prototype.initElement=function(t,e,s){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new ut(this,t.t,this.dynamicProperties),this.textAnimator=new ot(t.t,this.renderType,this),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},Zt.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},Zt.prototype.createPathShape=function(t,e){var s,i,a=e.length,r="";for(s=0;s<a;s+=1)i=e[s].ks.k,r+=st(i,i.i.length,!0,t);return r},Zt.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},Zt.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},Zt.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},Zt.prototype.applyTextPropertiesToMatrix=function(t,e,s,i,a){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s])/2,0,0)}e.translate(i,a,0)},Zt.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},Zt.prototype.emptyProp=new ct,Zt.prototype.destroy=function(){},E([Gt,Lt,Et,It,Rt],Qt),Qt.prototype.initElement=function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},Qt.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var s,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),s=i-1;0<=s;s-=1)(this.completeLayers||this.elements[s])&&(this.elements[s].prepareFrame(this.renderedFrame-this.layers[s].st),this.elements[s]._mdf&&(this._mdf=!0))}},Qt.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Qt.prototype.setElements=function(t){this.elements=t},Qt.prototype.getElements=function(){return this.elements},Qt.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},Qt.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},E([Gt,Lt,Jt,Et,It,Rt],$t),$t.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=D("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},$t.prototype.sourceRectAtTime=function(){return this.sourceRect},E([$t],te),te.prototype.createContent=function(){var t=D("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},ee.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},E([Vt,Gt,It],ee),ee.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},ee.prototype.show=function(){},ee.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},ee.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},ee.prototype.resume=function(){this._canPlay=!0},ee.prototype.setRate=function(t){this.audio.rate(t)},ee.prototype.volume=function(t){this.audio.volume(t)},ee.prototype.getBaseElement=function(){return null},ee.prototype.destroy=function(){},ee.prototype.sourceRectAtTime=function(){},ee.prototype.initExpressions=function(){},E([Mt,Qt,Jt],se),E([Gt,Lt,Jt,Et,It,Rt,Zt],ie),ie.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=D("text"))},ie.prototype.buildTextContents=function(t){for(var e=0,s=t.length,i=[],a="";e<s;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(a),a=""):a+=t[e],e+=1;return i.push(a),i},ie.prototype.buildNewText=function(){var t,e,s=this.textProperty.currentData;this.renderedLetters=C(s?s.l.length:0),s.fc?this.layerElement.setAttribute("fill",this.buildColor(s.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(s.sc)),this.layerElement.setAttribute("stroke-width",s.sw)),this.layerElement.setAttribute("font-size",s.finalSize);var i=this.globalData.fontManager.getFontByName(s.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var a=s.fWeight,r=s.fStyle;this.layerElement.setAttribute("font-style",r),this.layerElement.setAttribute("font-weight",a)}this.layerElement.setAttribute("aria-label",s.t);var n,h=s.l||[],o=!!this.globalData.fontManager.chars;e=h.length;var l,p=this.mHelper,f="",m=this.data.singleShape,d=0,c=0,u=!0,g=s.tr/1e3*s.finalSize;if(!m||o||s.sz){var y,v,_=this.textSpans.length;for(t=0;t<e;t+=1)o&&m&&0!==t||(n=t<_?this.textSpans[t]:D(o?"path":"text"),_<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(s.finalSize/100,s.finalSize/100),m&&(h[t].n&&(d=-g,c+=s.yOffset,c+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(s,p,h[t].line,d,c),d+=h[t].l||0,d+=g),o?(l=(y=(v=this.globalData.fontManager.getCharData(s.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily))&&v.data||{}).shapes?y.shapes[0].it:[],m?f+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(m&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=h[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&n&&n.setAttribute("d",f)}else{var b=this.textContainer,k="start";switch(s.j){case 1:k="end";break;case 2:k="middle"}b.setAttribute("text-anchor",k),b.setAttribute("letter-spacing",g);var A=this.buildTextContents(s.finalText);for(e=A.length,c=s.ps?s.ps[1]+s.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||D("tspan")).textContent=A[t],n.setAttribute("x",0),n.setAttribute("y",c),n.style.display="inherit",b.appendChild(n),this.textSpans[t]=n,c+=s.finalLineHeight;this.layerElement.appendChild(b)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},ie.prototype.sourceRectAtTime=function(t){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},ie.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var s,i,a=this.textAnimator.renderedLetters,r=this.textProperty.currentData.l;for(e=r.length,t=0;t<e;t+=1)r[t].n||(s=a[t],i=this.textSpans[t],s._mdf.m&&i.setAttribute("transform",s.m),s._mdf.o&&i.setAttribute("opacity",s.o),s._mdf.sw&&i.setAttribute("stroke-width",s.sw),s._mdf.sc&&i.setAttribute("stroke",s.sc),s._mdf.fc&&i.setAttribute("fill",s.fc))}},E([Gt,Lt,Jt,Ut,Et,It,Rt],ae),ae.prototype.initSecondaryElement=function(){},ae.prototype.identityMatrix=new I,ae.prototype.buildExpressionInterface=function(){},ae.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},ae.prototype.filterUniqueShapes=function(){var t,e,s,i,a=this.shapes.length,r=this.stylesList.length,n=[],h=!1;for(s=0;s<r;s+=1){for(i=this.stylesList[s],h=!1,t=n.length=0;t<a;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),h=e._isAnimated||h);1<n.length&&h&&this.setShapesAsAnimated(n)}},ae.prototype.setShapesAsAnimated=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].setAsAnimated()},ae.prototype.createStyleElement=function(t,e){var s,i=new Nt(t,e),a=i.pElem;if("st"===t.ty)s=new Bt(this,t,i);else if("fl"===t.ty)s=new jt(this,t,i);else if("gf"===t.ty||"gs"===t.ty){s=new("gf"===t.ty?Wt:Xt)(this,t,i),this.globalData.defs.appendChild(s.gf),s.maskId&&(this.globalData.defs.appendChild(s.ms),this.globalData.defs.appendChild(s.of),a.setAttribute("mask","url("+A+"#"+s.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(a.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),a.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),a.setAttribute("fill-opacity","0"),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&a.setAttribute("fill-rule","evenodd"),t.ln&&a.setAttribute("id",t.ln),t.cl&&a.setAttribute("class",t.cl),t.bm&&(a.style["mix-blend-mode"]=F(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,s),s},ae.prototype.createGroupElement=function(t){var e=new Yt;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=F(t.bm)),e},ae.prototype.createTransformElement=function(t,e){var s=z.getTransformProperty(this,t,this),i=new qt(s,s.o,e);return this.addToAnimatedContents(t,i),i},ae.prototype.createShapeElement=function(t,e,s){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var a=new Ot(e,s,X.getShapeProp(this,t,i,this));return this.shapes.push(a),this.addShapeToModifiers(a),this.addToAnimatedContents(t,a),a},ae.prototype.addToAnimatedContents=function(t,e){for(var s=0,i=this.animatedContents.length;s<i;){if(this.animatedContents[s].element===e)return;s+=1}this.animatedContents.push({fn:Ht.createRenderFunction(t),element:e,data:t})},ae.prototype.setElementStyles=function(t){var e,s=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||s.push(this.stylesList[e])},ae.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},ae.prototype.searchShapes=function(t,e,s,i,a,r,n){var h,o,l,p,f,m,d=[].concat(r),c=t.length-1,u=[],g=[];for(h=c;0<=h;h-=1){if((m=this.searchProcessedElement(t[h]))?e[h]=s[m-1]:t[h]._render=n,"fl"==t[h].ty||"st"==t[h].ty||"gf"==t[h].ty||"gs"==t[h].ty)m?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],a),t[h]._render&&i.appendChild(e[h].style.pElem),u.push(e[h].style);else if("gr"==t[h].ty){if(m)for(l=e[h].it.length,o=0;o<l;o+=1)e[h].prevViewData[o]=e[h].it[o];else e[h]=this.createGroupElement(t[h]);this.searchShapes(t[h].it,e[h].it,e[h].prevViewData,e[h].gr,a+1,d,n),t[h]._render&&i.appendChild(e[h].gr)}else"tr"==t[h].ty?(m||(e[h]=this.createTransformElement(t[h],i)),p=e[h].transform,d.push(p)):"sh"==t[h].ty||"rc"==t[h].ty||"el"==t[h].ty||"sr"==t[h].ty?(m||(e[h]=this.createShapeElement(t[h],d,a)),this.setElementStyles(e[h])):"tm"==t[h].ty||"rd"==t[h].ty||"ms"==t[h].ty||"pb"==t[h].ty?(m?(f=e[h]).closed=!1:((f=Y.getModifier(t[h].ty)).init(this,t[h]),e[h]=f,this.shapeModifiers.push(f)),g.push(f)):"rp"==t[h].ty&&(m?(f=e[h]).closed=!0:(f=Y.getModifier(t[h].ty),(e[h]=f).init(this,t,h,e),this.shapeModifiers.push(f),n=!1),g.push(f));this.addProcessedElement(t[h],h+1)}for(c=u.length,h=0;h<c;h+=1)u[h].closed=!0;for(c=g.length,h=0;h<c;h+=1)g[h].closed=!0},ae.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},ae.prototype.renderShape=function(){var t,e,s=this.animatedContents.length;for(t=0;t<s;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},ae.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null};var re=[];function ne(){}var he=function(){var t={},a=[],i=0,r=0,n=0,h=!0,o=!1;function s(t){for(var e=0,s=t.target;e<r;)a[e].animation===s&&(a.splice(e,1),e-=1,r-=1,s.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var s=0;s<r;){if(a[s].elem==t&&null!==a[s].elem)return a[s].animation;s+=1}var i=new oe;return m(i,t),i.setData(t,e),i}function p(){n+=1,c()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",s),t.addEventListener("_active",p),t.addEventListener("_idle",f),a.push({elem:e,animation:t}),r+=1}function d(t){var e,s=t-i;for(e=0;e<r;e+=1)a[e].animation.advanceTime(s);i=t,n&&!o?window.requestAnimationFrame(d):h=!0}function e(t){i=t,window.requestAnimationFrame(d)}function c(){!o&&n&&h&&(window.requestAnimationFrame(e),h=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new oe;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setSpeed(t,e)},t.setDirection=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.togglePause(t)},t.searchAnimations=function(t,e,s){var i,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),r=a.length;for(i=0;i<r;i+=1)s&&a[i].setAttribute("data-bm-type",s),l(a[i],t);if(e&&0===r){s||(s="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var h=w("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",s),n.appendChild(h),l(h,t)}},t.resize=function(){var t;for(t=0;t<r;t+=1)a[t].animation.resize()},t.goToAndStop=function(t,e,s){var i;for(i=0;i<r;i+=1)a[i].animation.goToAndStop(t,e,s)},t.destroy=function(t){var e;for(e=r-1;0<=e;e-=1)a[e].animation.destroy(t)},t.freeze=function(){o=!0},t.unfreeze=function(){o=!1,c()},t.setVolume=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=a.length,s=[];for(t=0;t<e;t+=1)s.push(a[t].animation);return s},t}(),oe=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=S(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=i,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface={},this.imagePreloader=new at,this.audioController=it()};function le(){this.effectElements=[]}E([x],oe),oe.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new Mt(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),ht.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},oe.prototype.setData=function(t,e){var s={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;s.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",s.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===a||(s.loop="false"!==a&&("true"===a||parseInt(a)));var r=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;s.autoplay="false"!==r,s.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(s.prerender=!1),this.setParams(s)},oe.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,s,i=this.animationData.layers,a=i.length,r=t.layers,n=r.length;for(s=0;s<n;s+=1)for(e=0;e<a;){if(i[e].id==r[s].id){i[e]=r[s];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,L.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),h&&h.initExpressions(this),this.loadNextSegment()},oe.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,ht.load(s,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},oe.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},oe.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},oe.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},oe.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},oe.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},oe.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,L.completeData(this.animationData,this.renderer.globalData.fontManager),h&&h.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},oe.prototype.resize=function(){this.renderer.updateContainerSize()},oe.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},oe.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},oe.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},oe.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},oe.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},oe.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},oe.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},oe.prototype.goToAndStop=function(t,e,s){s&&this.name!=s||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},oe.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},oe.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(s=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},oe.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},oe.prototype.setSegment=function(t,e){var s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==s&&this.goToAndStop(s,!0)},oe.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var s,i=t.length;for(s=0;s<i;s+=1)this.segments.push(t[s])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},oe.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},oe.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},oe.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},oe.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},oe.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},oe.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},oe.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},oe.prototype.getVolume=function(){return this.audioController.getVolume()},oe.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},oe.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},oe.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},oe.prototype.getPath=function(){return this.path},oe.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},oe.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;e<s;){if(t==this.assets[e].id)return this.assets[e];e+=1}},oe.prototype.hide=function(){this.renderer.hide()},oe.prototype.show=function(){this.renderer.show()},oe.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},oe.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new o(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new p(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new l(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new d(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new c(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new o(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new p(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new l(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new d(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new c(t,this))},oe.prototype.triggerRenderFrameError=function(t){var e=new u(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var lottie={};oe.prototype.triggerConfigError=function(t){var e=new g(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};function pe(){!0===fe?he.searchAnimations(me,fe,de):he.searchAnimations()}lottie.play=he.play,lottie.pause=he.pause,lottie.setLocationHref=function(t){A=t},lottie.togglePause=he.togglePause,lottie.setSpeed=he.setSpeed,lottie.setDirection=he.setDirection,lottie.stop=he.stop,lottie.searchAnimations=pe,lottie.registerAnimation=he.registerAnimation,lottie.loadAnimation=function(t){return!0===fe&&(t.animationData=JSON.parse(me)),he.loadAnimation(t)},lottie.setSubframeRendering=function(t){i=t},lottie.resize=he.resize,lottie.goToAndStop=he.goToAndStop,lottie.destroy=he.destroy,lottie.setQuality=function(t){if("string"==typeof t)switch(t){case"high":P=200;break;case"medium":P=50;break;case"low":P=10}else!isNaN(t)&&1<t&&(P=t);r(!(50<=P))},lottie.inBrowser=function(){return"undefined"!=typeof navigator},lottie.installPlugin=function(t,e){"expressions"===t&&(h=e)},lottie.freeze=he.freeze,lottie.unfreeze=he.unfreeze,lottie.setVolume=he.setVolume,lottie.mute=he.mute,lottie.unmute=he.unmute,lottie.getRegisteredAnimations=he.getRegisteredAnimations,lottie.__getFactory=function(t){switch(t){case"propertyFactory":return R;case"shapePropertyFactory":return X;case"matrix":return I}},lottie.version="5.7.5";var fe="__[STANDALONE]__",me="__[ANIMATIONDATA]__",de="";if(fe){var ce=document.getElementsByTagName("script"),ue=(ce[ce.length-1]||{src:""}).src.replace(/^[^\?]+\??/,"");de=function(t){for(var e=ue.split("&"),s=0;s<e.length;s++){var i=e[s].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}}("renderer")}var ge=setInterval(function(){"complete"===document.readyState&&(clearInterval(ge),pe())},100);
+	"use strict";var h,e="http://www.w3.org/2000/svg",A="",s=-999999,i=!0,n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),b=Math.pow,k=Math.sqrt,f=Math.floor,m=(Math.max,Math.min),a={};!function(){var t,e=["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"],s=e.length;for(t=0;t<s;t+=1)a[e[t]]=Math[e[t]]}(),a.random=Math.random,a.abs=function(t){if("object"===typeof t&&t.length){var e,s=C(t.length),i=t.length;for(e=0;e<i;e+=1)s[e]=Math.abs(t[e]);return s}return Math.abs(t)};var P=150,B=Math.PI/180,v=.5519;function r(t){t?Math.round:function(t){return t}}function o(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function l(t,e){this.type=t,this.direction=e<0?-1:1}function p(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}function d(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function c(t,e){this.type=t,this.target=e}function u(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function g(t){this.type="configError",this.nativeError=t}r(!1);var t,S=(t=0,function(){return"__lottie_element_"+(t+=1)});function y(t,e,s){var i,a,r,n,h,o,l,p;switch(o=s*(1-e),l=s*(1-(h=6*t-(n=Math.floor(6*t)))*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function _(t,e,s){var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function lt(t,e){var s=_(255*t[0],255*t[1],255*t[2]);return s[1]+=e,1<s[1]?s[1]=1:s[1]<=0&&(s[1]=0),y(s[0],s[1],s[2])}function pt(t,e){var s=_(255*t[0],255*t[1],255*t[2]);return s[2]+=e,1<s[2]?s[2]=1:s[2]<0&&(s[2]=0),y(s[0],s[1],s[2])}function ft(t,e){var s=_(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,1<s[0]?s[0]-=1:s[0]<0&&(s[0]+=1),y(s[0],s[1],s[2])}!function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1===e.length?"0"+e:e}();function x(){}x.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;i<s;i+=1)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s-=1,i-=1),s+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var j=function(){function s(t,e){var s,i=0,a=[];switch(t){case"int16":case"uint8c":s=1;break;default:s=1.1}for(i=0;i<e;i+=1)a.push(s);return a}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):s(t,e)}:s}();function C(t){return Array.apply(null,{length:t})}function D(t){return document.createElementNS(e,t)}function w(t){return document.createElement(t)}function T(){}T.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var F,E=(F={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return F[t]||""}),I=function(){var a=Math.cos,r=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function s(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var s=a(e),i=r(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}function m(t,e,s){return s||0===s||(s=1),1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}function d(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=a,this.props[5]=r,this.props[6]=n,this.props[7]=h,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=d,this.props[14]=c,this.props[15]=u,this}function c(t,e,s){return s=s||0,0!==t||0!==e||0!==s?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1):this}function u(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){var g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===a&&1===r&&0===n&&0===h&&0===o&&0===l&&1===p&&0===f)return g[12]=g[12]*t+g[15]*m,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*c,g[15]*=u,this._identityCalculated=!1,this;var y=g[0],v=g[1],_=g[2],b=g[3],k=g[4],A=g[5],P=g[6],S=g[7],x=g[8],C=g[9],D=g[10],w=g[11],T=g[12],F=g[13],E=g[14],M=g[15];return g[0]=y*t+v*a+_*o+b*m,g[1]=y*e+v*r+_*l+b*d,g[2]=y*s+v*n+_*p+b*c,g[3]=y*i+v*h+_*f+b*u,g[4]=k*t+A*a+P*o+S*m,g[5]=k*e+A*r+P*l+S*d,g[6]=k*s+A*n+P*p+S*c,g[7]=k*i+A*h+P*f+S*u,g[8]=x*t+C*a+D*o+w*m,g[9]=x*e+C*r+D*l+w*d,g[10]=x*s+C*n+D*p+w*c,g[11]=x*i+C*h+D*f+w*u,g[12]=T*t+F*a+E*o+M*m,g[13]=T*e+F*r+E*l+M*d,g[14]=T*s+F*n+E*p+M*c,g[15]=T*i+F*h+E*f+M*u,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function _(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function b(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}function k(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function A(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function P(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function S(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,a=this.props[0]/t,r=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,h=new I;return h.props[0]=e,h.props[1]=s,h.props[4]=i,h.props[5]=a,h.props[12]=r,h.props[13]=n,h}function x(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function C(t){var e,s=t.length,i=[];for(e=0;e<s;e+=1)i[e]=x(t[e]);return i}function D(t,e,s){var i=j("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=s[0],i[5]=s[1];else{var a=this.props[0],r=this.props[1],n=this.props[4],h=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*a+t[1]*n+o,i[1]=t[0]*r+t[1]*h+l,i[2]=e[0]*a+e[1]*n+o,i[3]=e[0]*r+e[1]*h+l,i[4]=s[0]*a+s[1]*n+o,i[5]=s[0]*r+s[1]*h+l}return i}function w(t,e,s){return this.isIdentity()?[t,e,s]:[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}function T(t,e){if(this.isIdentity())return t+","+e;var s=this.props;return Math.round(100*(t*s[0]+e*s[4]+s[12]))/100+","+Math.round(100*(t*s[1]+e*s[5]+s[13]))/100}function F(){for(var t=0,e=this.props,s="matrix3d(";t<16;)s+=i(1e4*e[t])/1e4,s+=15===t?")":",",t+=1;return s}function E(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function M(){var t=this.props;return"matrix("+E(t[0])+","+E(t[1])+","+E(t[4])+","+E(t[5])+","+E(t[12])+","+E(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=s,this.rotateY=h,this.rotateZ=o,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=d,this.translate=c,this.transform=u,this.applyToPoint=b,this.applyToX=k,this.applyToY=A,this.applyToZ=P,this.applyToPointArray=w,this.applyToTriplePoints=D,this.applyToPointStringified=T,this.toCSS=F,this.to2dCSS=M,this.clone=v,this.cloneFromProps=_,this.equals=y,this.inversePoints=C,this.inversePoint=x,this.getInverseMatrix=S,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=j("float32",16),this.reset()}}();!function(h,o){var l,p=this,f=256,m=6,d="random",c=o.pow(f,m),u=o.pow(2,52),g=2*u,y=f-1;function v(t){var e,s=t.length,n=this,i=0,a=n.i=n.j=0,r=n.S=[];for(s||(t=[s++]);i<f;)r[i]=i++;for(i=0;i<f;i++)r[i]=r[a=y&a+t[i%s]+(e=r[i])],r[a]=e;n.g=function(t){for(var e,s=0,i=n.i,a=n.j,r=n.S;t--;)e=r[i=y&i+1],s=s*f+r[y&(r[i]=r[a=y&a+e])+(r[a]=e)];return n.i=i,n.j=a,s}}function _(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function b(t,e){for(var s,i=t+"",a=0;a<i.length;)e[y&a]=y&(s^=19*e[y&a])+i.charCodeAt(a++);return k(e)}function k(t){return String.fromCharCode.apply(0,t)}o["seed"+d]=function(t,e,s){var i=[],a=b(function t(e,s){var i,a=[],r=typeof e;if(s&&"object"==r)for(i in e)try{a.push(t(e[i],s-1))}catch(t){}return a.length?a:"string"==r?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,k(h)]:null===t?function(){try{if(l)return k(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),k(t)}catch(t){var e=p.navigator,s=e&&e.plugins;return[+new Date,p,s,p.screen,k(h)]}}():t,3),i),r=new v(i),n=function(){for(var t=r.g(m),e=c,s=0;t<u;)t=(t+s)*f,e*=f,s=r.g(1);for(;g<=t;)t/=2,e/=2,s>>>=1;return(t+s)/e};return n.int32=function(){return 0|r.g(4)},n.quick=function(){return r.g(4)/4294967296},n.double=n,b(k(r.S),h),(e.pass||s||function(t,e,s,i){return i&&(i.S&&_(i,r),t.state=function(){return _(r,{})}),s?(o[d]=t,e):t})(n,a,"global"in e?e.global:this==o,e.state)},b(o.random(),h)}([],a);var W=function(){var t={getBezierEasing:function(t,e,s,i,a){var r=a||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");if(h[r])return h[r];var n=new o([t,e,s,i]);return h[r]=n}},h={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function a(t,e){return 3*e-6*t}function r(t){return 3*t}function f(t,e,s){return((i(e,s)*t+a(e,s))*t+r(e))*t}function m(t,e,s){return 3*i(e,s)*t*t+2*a(e,s)*t+r(e)}function o(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return o.prototype={get:function(t){var e=this._p[0],s=this._p[1],i=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===s&&i===a?t:0===t?0:1===t?1:f(this._getTForX(t),s,a)},_precompute:function(){var t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&s===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;s<l;++s)this._mSampleValues[s]=f(s*p,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,a=0,r=1,n=l-1;r!==n&&i[r]<=t;++r)a+=p;var h=a+(t-i[--r])/(i[r+1]-i[r])*p,o=m(h,e,s);return.001<=o?function(t,e,s,i){for(var a=0;a<4;++a){var r=m(e,s,i);if(0===r)return e;e-=(f(e,s,i)-t)/r}return e}(t,h,e,s):0===o?h:function(t,e,s,i,a){for(var r,n,h=0;0<(r=f(n=e+(s-e)/2,i,a)-t)?s=n:e=n,1e-7<Math.abs(r)&&++h<10;);return n}(t,a,a+p,e,s)}},t}();function M(t,e){var s,i,a=t.length;for(s=0;s<a;s+=1)for(var r in i=t[s].prototype)Object.prototype.hasOwnProperty.call(i,r)&&(e.prototype[r]=i[r])}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),s=Math.max(0,16-(e-a)),i=setTimeout(function(){t(e+s)},s);return a=e+s,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var mt=function(){var T=Math;function g(t,e,s,i,a,r){var n=t*i+e*a+s*r-a*i-r*t-s*e;return-.001<n&&n<.001}var p=function(t,e,s,i){var a,r,n,h,o,l,p=P,f=0,m=[],d=[],c=Tt.newElement();for(n=s.length,a=0;a<p;a+=1){for(o=a/(p-1),r=l=0;r<n;r+=1)h=b(1-o,3)*t[r]+3*b(1-o,2)*o*s[r]+3*(1-o)*b(o,2)*i[r]+b(o,3)*e[r],m[r]=h,null!==d[r]&&(l+=b(m[r]-d[r],2)),d[r]=m[r];l&&(f+=l=k(l)),c.percents[a]=o,c.lengths[a]=f}return c.addedLength=f,c};function y(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var _,t=(_={},function(t,e,s,i){var a=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+s[0]+"_"+s[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!_[a]){var r,n,h,o,l,p,f,m=P,d=0,c=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&g(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&g(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var u=new y(m);for(h=s.length,r=0;r<m;r+=1){for(f=C(h),l=r/(m-1),n=p=0;n<h;n+=1)o=b(1-l,3)*t[n]+3*b(1-l,2)*l*(t[n]+s[n])+3*(1-l)*b(l,2)*(e[n]+i[n])+b(l,3)*e[n],f[n]=o,null!==c&&(p+=b(f[n]-c[n],2));d+=p=k(p),u.points[r]=new v(p,f),c=f}u.segmentLength=d,_[a]=u}return _[a]});function F(t,e){var s=e.percents,i=e.lengths,a=s.length,r=f((a-1)*t),n=t*e.addedLength,h=0;if(r===a-1||0===r||n===i[r])return s[r];for(var o=i[r]>n?-1:1,l=!0;l;)if(i[r]<=n&&i[r+1]>n?(h=(n-i[r])/(i[r+1]-i[r]),l=!1):r+=o,r<0||a-1<=r){if(r===a-1)return s[r];l=!1}return s[r]+(s[r+1]-s[r])*h}var E=j("float32",8);return{getSegmentsLength:function(t){var e,s=wt.newElement(),i=t.c,a=t.v,r=t.o,n=t.i,h=t._length,o=s.lengths,l=0;for(e=0;e<h-1;e+=1)o[e]=p(a[e],a[e+1],r[e],n[e+1]),l+=o[e].addedLength;return i&&h&&(o[e]=p(a[e],a[0],r[e],n[0]),l+=o[e].addedLength),s.totalLength=l,s},getNewSegment:function(t,e,s,i,a,r,n){a<0?a=0:1<a&&(a=1);var h,o=F(a,n),l=F(r=1<r?1:r,n),p=t.length,f=1-o,m=1-l,d=f*f*f,c=o*f*f*3,u=o*o*f*3,g=o*o*o,y=f*f*m,v=o*f*m+f*o*m+f*f*l,_=o*o*m+f*o*l+o*f*l,b=o*o*l,k=f*m*m,A=o*m*m+f*l*m+f*m*l,P=o*l*m+f*l*l+o*m*l,S=o*l*l,x=m*m*m,C=l*m*m+m*l*m+m*m*l,D=l*l*m+m*l*l+l*m*l,w=l*l*l;for(h=0;h<p;h+=1)E[4*h]=T.round(1e3*(d*t[h]+c*s[h]+u*i[h]+g*e[h]))/1e3,E[4*h+1]=T.round(1e3*(y*t[h]+v*s[h]+_*i[h]+b*e[h]))/1e3,E[4*h+2]=T.round(1e3*(k*t[h]+A*s[h]+P*i[h]+S*e[h]))/1e3,E[4*h+3]=T.round(1e3*(x*t[h]+C*s[h]+D*i[h]+w*e[h]))/1e3;return E},getPointInSegment:function(t,e,s,i,a,r){var n=F(a,r),h=1-n;return[T.round(1e3*(h*h*h*t[0]+(n*h*h+h*n*h+h*h*n)*s[0]+(n*n*h+h*n*n+n*h*n)*i[0]+n*n*n*e[0]))/1e3,T.round(1e3*(h*h*h*t[1]+(n*h*h+h*n*h+h*h*n)*s[1]+(n*n*h+h*n*n+n*h*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:g,pointOnLine3D:function(t,e,s,i,a,r,n,h,o){if(0===s&&0===r&&0===o)return g(t,e,i,a,n,h);var l,p=T.sqrt(T.pow(i-t,2)+T.pow(a-e,2)+T.pow(r-s,2)),f=T.sqrt(T.pow(n-t,2)+T.pow(h-e,2)+T.pow(o-s,2)),m=T.sqrt(T.pow(n-i,2)+T.pow(h-a,2)+T.pow(o-r,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}();var L=function(){function m(t,e,s){var i,a,r,n,h,o,l,p=t.length;for(a=0;a<p;a+=1)if("ks"in(i=t[a])&&!i.completed){if(i.completed=!0,i.tt&&(t[a-1].td=i.tt),i.hasMask){var f=i.masksProperties;for(n=f.length,r=0;r<n;r+=1)if(f[r].pt.k.i)u(f[r].pt.k);else for(o=f[r].pt.k.length,h=0;h<o;h+=1)f[r].pt.k[h].s&&u(f[r].pt.k[h].s[0]),f[r].pt.k[h].e&&u(f[r].pt.k[h].e[0])}0===i.ty?(i.layers=d(i.refId,e),m(i.layers,e,s)):4===i.ty?c(i.shapes):5===i.ty&&(0!==(l=i).t.a.length||"m"in l.t.p||(l.singleShape=!0))}}function d(t,e){for(var s=0,i=e.length;s<i;){if(e[s].id===t)return e[s].layers.__used?JSON.parse(JSON.stringify(e[s].layers)):(e[s].layers.__used=!0,e[s].layers);s+=1}return null}function c(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)u(t[e].ks.k);else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&u(t[e].ks.k[s].s[0]),t[e].ks.k[s].e&&u(t[e].ks.k[s].e[0]);else"gr"===t[e].ty&&c(t[e].it)}function u(t){var e,s=t.i.length;for(e=0;e<s;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function h(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&null))}var o,s=function(){var i=[4,4,14];function a(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)5===t[e].ty&&(s=t[e],i=s.t.d,s.t.d={k:[{s:i,t:0}]})}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),i=(o=[4,7,99],function(t){if(t.chars&&!h(o,t.v)){var e,s,i,a,r,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(r=t.chars[e].data.shapes[0].it).length,s=0;s<i;s+=1)(a=r[s].ks.k).__converted||(u(r[s].ks.k),a.__converted=!0)}}),a=function(){var i=[4,1,9];function r(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)if("gr"===t[e].ty)r(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,s=0;s<i;s+=1)t[e].c.k[s].s&&(t[e].c.k[s].s[0]/=255,t[e].c.k[s].s[1]/=255,t[e].c.k[s].s[2]/=255,t[e].c.k[s].s[3]/=255),t[e].c.k[s].e&&(t[e].c.k[s].e[0]/=255,t[e].c.k[s].e[1]/=255,t[e].c.k[s].e[2]/=255,t[e].c.k[s].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function a(t){var e,s=t.length;for(e=0;e<s;e+=1)4===t[e].ty&&r(t[e].shapes)}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),r=function(){var i=[4,4,18];function l(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&(t[e].ks.k[s].s[0].c=t[e].closed),t[e].ks.k[s].e&&(t[e].ks.k[s].e[0].c=t[e].closed);else"gr"===t[e].ty&&l(t[e].it)}function a(t){var e,s,i,a,r,n,h=t.length;for(s=0;s<h;s+=1){if((e=t[s]).hasMask){var o=e.masksProperties;for(a=o.length,i=0;i<a;i+=1)if(o[i].pt.k.i)o[i].pt.k.c=o[i].cl;else for(n=o[i].pt.k.length,r=0;r<n;r+=1)o[i].pt.k[r].s&&(o[i].pt.k[r].s[0].c=o[i].cl),o[i].pt.k[r].e&&(o[i].pt.k[r].e[0].c=o[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}();var t={completeData:function(t,e){t.__complete||(a(t),s(t),i(t),r(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=a,t.checkChars=i,t.checkShapes=r,t.completeLayers=m,t}();function q(t){for(var e=t.fStyle?t.fStyle.split(" "):[],s="normal",i="normal",a=e.length,r=0;r<a;r+=1)switch(e[r].toLowerCase()){case"italic":i="italic";break;case"bold":s="700";break;case"black":s="900";break;case"medium":s="500";break;case"regular":case"normal":s="400";break;case"light":case"thin":s="200"}return{style:i,weight:t.fWeight||s}}var V=function(){var r={w:0,size:0,shapes:[]},t=[];function m(t,e){var s=w("span");s.style.fontFamily=e;var i=w("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);var a=i.offsetWidth;return i.style.fontFamily=function(t){var e,s=t.split(","),i=s.length,a=[];for(e=0;e<i;e+=1)"sans-serif"!==s[e]&&"monospace"!==s[e]&&a.push(s[e]);return a.join(",")}(t)+", "+e,{node:i,w:a,parent:s}}function d(t,e){var s=D("text");s.style.fontSize="100px";var i=q(e);return s.setAttribute("font-family",e.fFamily),s.setAttribute("font-style",i.style),s.setAttribute("font-weight",i.weight),s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.setAttribute("class",e.fClass)):s.style.fontFamily=e.fFamily,t.appendChild(s),w("canvas").getContext("2d").font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,s}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var s,i,a=t.length,r=this.chars.length;for(e=0;e<a;e+=1){for(s=0,i=!1;s<r;)this.chars[s].style===t[e].style&&this.chars[s].fFamily===t[e].fFamily&&this.chars[s].ch===t[e].ch&&(i=!0),s+=1;i||(this.chars.push(t[e]),r+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var s,i=t.list,a=i.length,r=a;for(s=0;s<a;s+=1){var n,h,o=!0;if(i[s].loaded=!1,i[s].monoCase=m(i[s].fFamily,"monospace"),i[s].sansCase=m(i[s].fFamily,"sans-serif"),i[s].fPath){if("p"===i[s].fOrigin||3===i[s].origin){if(0<(n=document.querySelectorAll('style[f-forigin="p"][f-family="'+i[s].fFamily+'"], style[f-origin="3"][f-family="'+i[s].fFamily+'"]')).length&&(o=!1),o){var l=w("style");l.setAttribute("f-forigin",i[s].fOrigin),l.setAttribute("f-origin",i[s].origin),l.setAttribute("f-family",i[s].fFamily),l.type="text/css",l.innerText="@font-face {font-family: "+i[s].fFamily+"; font-style: normal; src: url('"+i[s].fPath+"');}",e.appendChild(l)}}else if("g"===i[s].fOrigin||1===i[s].origin){for(n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),h=0;h<n.length;h+=1)-1!==n[h].href.indexOf(i[s].fPath)&&(o=!1);if(o){var p=w("link");p.setAttribute("f-forigin",i[s].fOrigin),p.setAttribute("f-origin",i[s].origin),p.type="text/css",p.rel="stylesheet",p.href=i[s].fPath,document.body.appendChild(p)}}else if("t"===i[s].fOrigin||2===i[s].origin){for(n=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),h=0;h<n.length;h+=1)i[s].fPath===n[h].src&&(o=!1);if(o){var f=w("link");f.setAttribute("f-forigin",i[s].fOrigin),f.setAttribute("f-origin",i[s].origin),f.setAttribute("rel","stylesheet"),f.setAttribute("href",i[s].fPath),e.appendChild(f)}}}else i[s].loaded=!0,r-=1;i[s].helper=d(e,i[s]),i[s].cache={},this.fonts.push(i[s])}0===r?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,s){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),r},getFontByName:function(t){for(var e=0,s=this.fonts.length;e<s;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,s){var i=this.getFontByName(e),a=t.charCodeAt(0);if(!i.cache[a+1]){var r=i.helper;if(" "===t){r.textContent="|"+t+"|";var n=r.getComputedTextLength();r.textContent="||";var h=r.getComputedTextLength();i.cache[a+1]=(n-h)/100}else r.textContent=t,i.cache[a+1]=r.getComputedTextLength()/100}return i.cache[a+1]*s},checkLoadedFonts:function(){var t,e,s,i=this.fonts.length,a=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?a-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,s=this.fonts[t].monoCase.w,e.offsetWidth!==s?(a-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,s=this.fonts[t].sansCase.w,e.offsetWidth!==s&&(a-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==a&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),R=function(){var f=s,a=Math.abs;function m(t,e){var s,i=this.offsetTime;"multidimensional"===this.propType&&(s=j("float32",this.pv.length));for(var a,r,n,h,o,l,p,f,m=e.lastIndex,d=m,c=this.keyframes.length-1,u=!0;u;){if(a=this.keyframes[d],r=this.keyframes[d+1],d===c-1&&t>=r.t-i){a.h&&(a=r),m=0;break}if(r.t-i>t){m=d;break}d<c-1?d+=1:(m=0,u=!1)}var g,y,v,_,b,k,A,P,S,x,C=r.t-i,D=a.t-i;if(a.to){a.bezierData||(a.bezierData=mt.buildBezierData(a.s,r.s||a.e,a.to,a.ti));var w=a.bezierData;if(C<=t||t<D){var T=C<=t?w.points.length-1:0;for(h=w.points[T].point.length,n=0;n<h;n+=1)s[n]=w.points[T].point[n]}else{a.__fnct?f=a.__fnct:(f=W.getBezierEasing(a.o.x,a.o.y,a.i.x,a.i.y,a.n).get,a.__fnct=f),o=f((t-D)/(C-D));var F,E=w.segmentLength*o,M=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastPoint:0,u=!0,l=w.points.length;u;){if(M+=w.points[p].partialLength,0===E||0===o||p===w.points.length-1){for(h=w.points[p].point.length,n=0;n<h;n+=1)s[n]=w.points[p].point[n];break}if(M<=E&&E<M+w.points[p+1].partialLength){for(F=(E-M)/w.points[p+1].partialLength,h=w.points[p].point.length,n=0;n<h;n+=1)s[n]=w.points[p].point[n]+(w.points[p+1].point[n]-w.points[p].point[n])*F;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=M-w.points[p].partialLength,e._lastKeyframeIndex=d}}else{var I,L,V,R,z;if(c=a.s.length,g=r.s||a.e,this.sh&&1!==a.h)if(C<=t)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=D)s[0]=a.s[0],s[1]=a.s[1],s[2]=a.s[2];else{var N=q(a.s),O=q(g);y=s,v=function(t,e,s){var i,a,r,n,h,o=[],l=t[0],p=t[1],f=t[2],m=t[3],d=e[0],c=e[1],u=e[2],g=e[3];(a=l*d+p*c+f*u+m*g)<0&&(a=-a,d=-d,c=-c,u=-u,g=-g);h=1e-6<1-a?(i=Math.acos(a),r=Math.sin(i),n=Math.sin((1-s)*i)/r,Math.sin(s*i)/r):(n=1-s,s);return o[0]=n*l+h*d,o[1]=n*p+h*c,o[2]=n*f+h*u,o[3]=n*m+h*g,o}(N,O,(t-D)/(C-D)),_=v[0],b=v[1],k=v[2],A=v[3],P=Math.atan2(2*b*A-2*_*k,1-2*b*b-2*k*k),S=Math.asin(2*_*b+2*k*A),x=Math.atan2(2*_*A-2*b*k,1-2*_*_-2*k*k),y[0]=P/B,y[1]=S/B,y[2]=x/B}else for(d=0;d<c;d+=1)1!==a.h&&(o=C<=t?1:t<D?0:(a.o.x.constructor===Array?(a.__fnct||(a.__fnct=[]),a.__fnct[d]?f=a.__fnct[d]:(I=void 0===a.o.x[d]?a.o.x[0]:a.o.x[d],L=void 0===a.o.y[d]?a.o.y[0]:a.o.y[d],V=void 0===a.i.x[d]?a.i.x[0]:a.i.x[d],R=void 0===a.i.y[d]?a.i.y[0]:a.i.y[d],f=W.getBezierEasing(I,L,V,R).get,a.__fnct[d]=f)):a.__fnct?f=a.__fnct:(I=a.o.x,L=a.o.y,V=a.i.x,R=a.i.y,f=W.getBezierEasing(I,L,V,R).get,a.__fnct=f),f((t-D)/(C-D)))),g=r.s||a.e,z=1===a.h?a.s[d]:a.s[d]+(g[d]-a.s[d])*o,"multidimensional"===this.propType?s[d]=z:s=z}return e.lastIndex=m,s}function q(t){var e=t[0]*B,s=t[1]*B,i=t[2]*B,a=Math.cos(e/2),r=Math.cos(s/2),n=Math.cos(i/2),h=Math.sin(e/2),o=Math.sin(s/2),l=Math.sin(i/2);return[h*o*n+a*r*l,h*r*n+a*o*l,a*o*n-h*r*l,a*r*n-h*o*l]}function d(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=s&&s<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function c(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<a(this.v-e)&&(this.v=e,this._mdf=!0);else for(var s=0,i=this.v.length;s<i;)e=t[s]*this.mult,1e-5<a(this.v[s]-e)&&(this.v[s]=e,this._mdf=!0),s+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,s=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)s=this.effectsSequence[t](s);this.setVValue(s),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function g(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,s,i){this.propType="unidimensional",this.mult=s||1,this.data=e,this.v=s?e.k*s:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.addEffect=g}function h(t,e,s,i){var a;this.propType="multidimensional",this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var r=e.k.length;for(this.v=j("float32",r),this.pv=j("float32",r),this.vel=j("float32",r),a=0;a<r;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=c,this.addEffect=g}function o(t,e,s,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.effectsSequence=[d.bind(this)],this.addEffect=g}function l(t,e,s,i){var a;this.propType="multidimensional";var r,n,h,o,l=e.k.length;for(a=0;a<l-1;a+=1)e.k[a].to&&e.k[a].s&&e.k[a+1]&&e.k[a+1].s&&(r=e.k[a].s,n=e.k[a+1].s,h=e.k[a].to,o=e.k[a].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+h[0],r[1]+h[1],r[2]+h[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(e.k[a].to=null,e.k[a].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===h[0]&&0===h[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===n[2]&&0===h[2]&&0===o[2])&&(e.k[a].to=null,e.k[a].ti=null));this.effectsSequence=[d.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=j("float32",p),this.pv=j("float32",p),a=0;a<p;a+=1)this.v[a]=f,this.pv[a]=f;this._caching={lastFrame:f,lastIndex:0,value:j("float32",p)},this.addEffect=g}return{getProp:function(t,e,s,i,a){var r;if(e.k.length)if("number"==typeof e.k[0])r=new h(t,e,i,a);else switch(s){case 0:r=new o(t,e,i,a);break;case 1:r=new l(t,e,i,a)}else r=new n(t,e,i,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}}}(),z=function(){var n=[0,0];function i(t,e,s){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new I,this.pre=new I,this.appliedTransformations=0,this.initDynamicPropertyContainer(s||t),e.p&&e.p.s?(this.px=R.getProp(t,e.p.x,0,0,this),this.py=R.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=R.getProp(t,e.p.z,0,0,this))):this.p=R.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=R.getProp(t,e.rx,0,B,this),this.ry=R.getProp(t,e.ry,0,B,this),this.rz=R.getProp(t,e.rz,0,B,this),e.or.k[0].ti){var i,a=e.or.k.length;for(i=0;i<a;i+=1)e.or.k[i].to=null,e.or.k[i].ti=null}this.or=R.getProp(t,e.or,1,B,this),this.or.sh=!0}else this.r=R.getProp(t,e.r||{k:0},0,B,this);e.sk&&(this.sk=R.getProp(t,e.sk,0,B,this),this.sa=R.getProp(t,e.sa,0,B,this)),this.a=R.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=R.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=R.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var e;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var s,i;if(e=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(s=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(s=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){s=[],i=[];var a=this.px,r=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(s[0]=a.getValueAtTime((a.keyframes[0].t+.01)/e,0),s[1]=r.getValueAtTime((r.keyframes[0].t+.01)/e,0),i[0]=a.getValueAtTime(a.keyframes[0].t/e,0),i[1]=r.getValueAtTime(r.keyframes[0].t/e,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(s[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/e,0),s[1]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/e,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/e,0),i[1]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/e,0)):(s=[a.pv,r.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/e,a.offsetTime),i[1]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/e,r.offsetTime))}else s=i=n;this.v.rotate(-Math.atan2(s[1]-i[1],s[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},M([T],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=T.prototype.addDynamicProperty,{getTransformProperty:function(t,e,s){return new i(t,e,s)}}}();function N(){this.c=!1,this._length=0,this._maxLength=8,this.v=C(this._maxLength),this.o=C(this._maxLength),this.i=C(this._maxLength)}N.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var s=0;s<e;)this.v[s]=xt.newElement(),this.o[s]=xt.newElement(),this.i[s]=xt.newElement(),s+=1},N.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},N.prototype.doubleArrayLength=function(){this.v=this.v.concat(C(this._maxLength)),this.i=this.i.concat(C(this._maxLength)),this.o=this.o.concat(C(this._maxLength)),this._maxLength*=2},N.prototype.setXYAt=function(t,e,s,i,a){var r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o;break;default:r=[]}(!r[i]||r[i]&&!a)&&(r[i]=xt.newElement()),r[i][0]=t,r[i][1]=e},N.prototype.setTripleAt=function(t,e,s,i,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(s,i,"o",n,h),this.setXYAt(a,r,"i",n,h)},N.prototype.reverse=function(){var t=new N;t.setPathData(this.c,this._length);var e=this.v,s=this.o,i=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],s[0][0],s[0][1],0,!1),a=1);var r,n=this._length-1,h=this._length;for(r=a;r<h;r+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],s[n][0],s[n][1],r,!1),n-=1;return t};var O,X,Y=function(){var a=-999999;function t(t,e,s){var i,a,r,n,h,o,l,p,f,m=s.lastIndex,d=this.keyframes;if(t<d[0].t-this.offsetTime)i=d[0].s[0],r=!0,m=0;else if(t>=d[d.length-1].t-this.offsetTime)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var c,u,g=m,y=d.length-1,v=!0;v&&(c=d[g],!((u=d[g+1]).t-this.offsetTime>t));)g<y-1?g+=1:v=!1;if(m=g,!(r=1===c.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<c.t-this.offsetTime)p=0;else{var _;c.__fnct?_=c.__fnct:(_=W.getBezierEasing(c.o.x,c.o.y,c.i.x,c.i.y).get,c.__fnct=_),p=_((t-(c.t-this.offsetTime))/(u.t-this.offsetTime-(c.t-this.offsetTime)))}a=u.s?u.s[0]:c.e[0]}i=c.s[0]}for(o=e._length,l=i.i[0].length,s.lastIndex=m,n=0;n<o;n+=1)for(h=0;h<l;h+=1)f=r?i.i[n][h]:i.i[n][h]+(a.i[n][h]-i.i[n][h])*p,e.i[n][h]=f,f=r?i.o[n][h]:i.o[n][h]+(a.o[n][h]-i.o[n][h])*p,e.o[n][h]=f,f=r?i.v[n][h]:i.v[n][h]+(a.v[n][h]-i.v[n][h])*p,e.v[n][h]=f}function r(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var s,i=t._length;for(s=0;s<i;s+=1)if(t.v[s][0]!==e.v[s][0]||t.v[s][1]!==e.v[s][1]||t.o[s][0]!==e.o[s][0]||t.o[s][1]!==e.o[s][1]||t.i[s][0]!==e.i[s][0]||t.i[s][1]!==e.i[s][1])return!1;return!0})(this.v,t)||(this.v=Ct.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var s=this.effectsSequence.length;for(e=0;e<s;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,s){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===s?e.pt.k:e.ks.k;this.v=Ct.clone(i),this.pv=Ct.clone(this.v),this.localShapeCollection=Dt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function h(t,e,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.v=Ct.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=Ct.clone(this.v),this.localShapeCollection=Dt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=a,this.reset=r,this._caching={lastFrame:a,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==a&&(i<e&&t<e||s<i&&s<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=s,n.prototype.setVValue=e,n.prototype.addEffect=i,h.prototype.getValue=s,h.prototype.interpolateShape=t,h.prototype.setVValue=e,h.prototype.addEffect=i;var o=function(){var n=v;function t(t,e){this.v=Ct.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=Dt.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=R.getProp(t,e.p,1,0,this),this.s=R.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=3!==this.d,r=this.v;r.v[0][0]=t,r.v[0][1]=e-i,r.v[1][0]=a?t+s:t-s,r.v[1][1]=e,r.v[2][0]=t,r.v[2][1]=e+i,r.v[3][0]=a?t-s:t+s,r.v[3][1]=e,r.i[0][0]=a?t-s*n:t+s*n,r.i[0][1]=e-i,r.i[1][0]=a?t+s:t-s,r.i[1][1]=e-i*n,r.i[2][0]=a?t+s*n:t-s*n,r.i[2][1]=e+i,r.i[3][0]=a?t-s:t+s,r.i[3][1]=e+i*n,r.o[0][0]=a?t+s*n:t-s*n,r.o[0][1]=e-i,r.o[1][0]=a?t+s:t-s,r.o[1][1]=e+i*n,r.o[2][0]=a?t-s*n:t+s*n,r.o[2][1]=e+i,r.o[3][0]=a?t-s:t+s,r.o[3][1]=e-i*n}},M([T],t),t}(),l=function(){function t(t,e){this.v=Ct.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=R.getProp(t,e.ir,0,0,this),this.is=R.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=R.getProp(t,e.pt,0,0,this),this.p=R.getProp(t,e.p,1,0,this),this.r=R.getProp(t,e.r,0,B,this),this.or=R.getProp(t,e.or,0,0,this),this.os=R.getProp(t,e.os,0,.01,this),this.localShapeCollection=Dt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,s,i,a=2*Math.floor(this.pt.v),r=2*Math.PI/a,n=!0,h=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*h/(2*a),m=2*Math.PI*o/(2*a),d=-Math.PI/2;d+=this.r.v;var c=3===this.data.d?-1:1;for(t=this.v._length=0;t<a;t+=1){s=n?l:p,i=n?f:m;var u=(e=n?h:o)*Math.cos(d),g=e*Math.sin(d),y=0===u&&0===g?0:g/Math.sqrt(u*u+g*g),v=0===u&&0===g?0:-u/Math.sqrt(u*u+g*g);u+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(u,g,u-y*i*s*c,g-v*i*s*c,u+y*i*s*c,g+v*i*s*c,t,!0),n=!n,d+=r*c}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),s=2*Math.PI/e,i=this.or.v,a=this.os.v,r=2*Math.PI*i/(4*e),n=.5*-Math.PI,h=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var o=i*Math.cos(n),l=i*Math.sin(n),p=0===o&&0===l?0:l/Math.sqrt(o*o+l*l),f=0===o&&0===l?0:-o/Math.sqrt(o*o+l*l);o+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(o,l,o-p*r*a*h,l-f*r*a*h,o+p*r*a*h,l+f*r*a*h,t,!0),n+=s*h}this.paths.length=0,this.paths[0]=this.v}},M([T],t),t}(),p=function(){function t(t,e){this.v=Ct.newElement(),this.v.c=!0,this.localShapeCollection=Dt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=R.getProp(t,e.p,1,0,this),this.s=R.getProp(t,e.s,1,0,this),this.r=R.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=m(s,i,this.r.v),r=a*(1-v);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+a,t+s,e-i+r,0,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-r,t+s,e+i-a,1,!0),0!==a?(this.v.setTripleAt(t+s-a,e+i,t+s-a,e+i,t+s-r,e+i,2,!0),this.v.setTripleAt(t-s+a,e+i,t-s+r,e+i,t-s+a,e+i,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-a,t-s,e+i-r,4,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+r,t-s,e-i+a,5,!0),this.v.setTripleAt(t-s+a,e-i,t-s+a,e-i,t-s+r,e-i,6,!0),this.v.setTripleAt(t+s-a,e-i,t+s-r,e-i,t+s-a,e-i,7,!0)):(this.v.setTripleAt(t-s,e+i,t-s+r,e+i,t-s,e+i,2),this.v.setTripleAt(t-s,e-i,t-s,e-i+r,t-s,e-i,3))):(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+r,t+s,e-i+a,0,!0),0!==a?(this.v.setTripleAt(t+s-a,e-i,t+s-a,e-i,t+s-r,e-i,1,!0),this.v.setTripleAt(t-s+a,e-i,t-s+r,e-i,t-s+a,e-i,2,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+a,t-s,e-i+r,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-r,t-s,e+i-a,4,!0),this.v.setTripleAt(t-s+a,e+i,t-s+a,e+i,t-s+r,e+i,5,!0),this.v.setTripleAt(t+s-a,e+i,t+s-r,e+i,t+s-a,e+i,6,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-a,t+s,e+i-r,7,!0)):(this.v.setTripleAt(t-s,e-i,t-s+r,e-i,t-s,e-i,1,!0),this.v.setTripleAt(t-s,e+i,t-s,e+i-r,t-s,e+i,2,!0),this.v.setTripleAt(t+s,e+i,t+s-r,e+i,t+s,e+i,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:r},M([T],t),t}();var f={getShapeProp:function(t,e,s){var i;return 3===s||4===s?i=(3===s?e.pt:e.ks).k.length?new h(t,e,s):new n(t,e,s):5===s?i=new p(t,e):6===s?i=new o(t,e):7===s&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return h}};return f}(),H=(X={},(O={}).registerModifier=function(t,e){X[t]||(X[t]=e)},O.getModifier=function(t,e,s){return new X[t](e,s)},O);function G(){}function K(){}function J(){}function U(){}function Z(){}function Q(){this._length=0,this._maxLength=4,this.shapes=C(this._maxLength)}function $(t,e,s,i){var a;this.elem=t,this.frameId=-1,this.dataProps=C(e.length),this.renderer=s,this.k=!1,this.dashStr="",this.dashArray=j("float32",e.length?e.length-1:0),this.dashoffset=j("float32",1),this.initDynamicPropertyContainer(i);var r,n=e.length||0;for(a=0;a<n;a+=1)r=R.getProp(t,e[a].v,0,0,this),this.k=r.k||this.k,this.dataProps[a]={n:e[a].n,p:r};this.k||this.getValue(!0),this._isAnimated=this.k}function tt(t,e,s){this.data=e,this.c=j("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=j("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=R.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}G.prototype.initModifierProperties=function(){},G.prototype.addShapeToModifier=function(){},G.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:Dt.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},G.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=s,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},G.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},M([T],G),M([G],K),K.prototype.initModifierProperties=function(t,e){this.s=R.getProp(t,e.s,0,.01,this),this.e=R.getProp(t,e.e,0,.01,this),this.o=R.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},K.prototype.addShapeToModifier=function(t){t.pathsData=[]},K.prototype.calculateShapeEdges=function(t,e,s,i,a){var r=[];e<=1?r.push({s:t,e:e}):1<=t?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],l=r.length;for(n=0;n<l;n+=1){var p,f;if(!((h=r[n]).e*a<i||h.s*a>i+s))p=h.s*a<=i?0:(h.s*a-i)/s,f=h.e*a>=i+s?1:(h.e*a-i)/s,o.push([p,f])}return o.length||o.push([0,0]),o},K.prototype.releasePathsData=function(t){var e,s=t.length;for(e=0;e<s;e+=1)wt.release(t[e]);return t.length=0,t},K.prototype.processShapes=function(t){var e,s,i,a;if(this._mdf||t){var r=this.o.v%360/360;if(r<0&&(r+=1),e=1<this.s.v?1+r:this.s.v<0?0+r:this.s.v+r,(s=1<this.e.v?1+r:this.e.v<0?0+r:this.e.v+r)<e){var n=e;e=s,s=n}e=1e-4*Math.round(1e4*e),s=1e-4*Math.round(1e4*s),this.sValue=e,this.eValue=s}else e=this.sValue,s=this.eValue;var h,o,l,p,f,m=this.shapes.length,d=0;if(s===e)for(a=0;a<m;a+=1)this.shapes[a].localShapeCollection.releaseShapes(),this.shapes[a].shape._mdf=!0,this.shapes[a].shape.paths=this.shapes[a].localShapeCollection,this._mdf&&(this.shapes[a].pathsData.length=0);else if(1===s&&0===e||0===s&&1===e){if(this._mdf)for(a=0;a<m;a+=1)this.shapes[a].pathsData.length=0,this.shapes[a].shape._mdf=!0}else{var c,u,g=[];for(a=0;a<m;a+=1)if((c=this.shapes[a]).shape._mdf||this._mdf||t||2===this.m){if(o=(i=c.shape.paths)._length,f=0,!c.shape._mdf&&c.pathsData.length)f=c.totalShapeLength;else{for(l=this.releasePathsData(c.pathsData),h=0;h<o;h+=1)p=mt.getSegmentsLength(i.shapes[h]),l.push(p),f+=p.totalLength;c.totalShapeLength=f,c.pathsData=l}d+=f,c.shape._mdf=!0}else c.shape.paths=c.localShapeCollection;var y,v=e,_=s,b=0;for(a=m-1;0<=a;a-=1)if((c=this.shapes[a]).shape._mdf){for((u=c.localShapeCollection).releaseShapes(),2===this.m&&1<m?(y=this.calculateShapeEdges(e,s,c.totalShapeLength,b,d),b+=c.totalShapeLength):y=[[v,_]],o=y.length,h=0;h<o;h+=1){v=y[h][0],_=y[h][1],g.length=0,_<=1?g.push({s:c.totalShapeLength*v,e:c.totalShapeLength*_}):1<=v?g.push({s:c.totalShapeLength*(v-1),e:c.totalShapeLength*(_-1)}):(g.push({s:c.totalShapeLength*v,e:c.totalShapeLength}),g.push({s:0,e:c.totalShapeLength*(_-1)}));var k=this.addShapes(c,g[0]);if(g[0].s!==g[0].e){if(1<g.length)if(c.shape.paths.shapes[c.shape.paths._length-1].c){var A=k.pop();this.addPaths(k,u),k=this.addShapes(c,g[1],A)}else this.addPaths(k,u),k=this.addShapes(c,g[1]);this.addPaths(k,u)}}c.shape.paths=u}}},K.prototype.addPaths=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e.addShape(t[s])},K.prototype.addSegment=function(t,e,s,i,a,r,n){a.setXYAt(e[0],e[1],"o",r),a.setXYAt(s[0],s[1],"i",r+1),n&&a.setXYAt(t[0],t[1],"v",r),a.setXYAt(i[0],i[1],"v",r+1)},K.prototype.addSegmentFromArray=function(t,e,s,i){e.setXYAt(t[1],t[5],"o",s),e.setXYAt(t[2],t[6],"i",s+1),i&&e.setXYAt(t[0],t[4],"v",s),e.setXYAt(t[3],t[7],"v",s+1)},K.prototype.addShapes=function(t,e,s){var i,a,r,n,h,o,l,p,f=t.pathsData,m=t.shape.paths.shapes,d=t.shape.paths._length,c=0,u=[],g=!0;for(p=s?(h=s._length,s._length):(s=Ct.newElement(),h=0),u.push(s),i=0;i<d;i+=1){for(o=f[i].lengths,s.c=m[i].c,r=m[i].c?o.length:o.length+1,a=1;a<r;a+=1)if(c+(n=o[a-1]).addedLength<e.s)c+=n.addedLength,s.c=!1;else{if(c>e.e){s.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[a],m[i].v[a],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[a],m[i].o[a-1],m[i].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1),c+=n.addedLength,h+=1}if(m[i].c&&o.length){if(n=o[a-1],c<=e.e){var y=o[a-1].addedLength;e.s<=c&&e.e>=c+y?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[0],m[i].v[0],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[0],m[i].o[a-1],m[i].i[0],(e.s-c)/y,(e.e-c)/y,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1)}else s.c=!1;c+=n.addedLength,h+=1}if(s._length&&(s.setXYAt(s.v[p][0],s.v[p][1],"i",p),s.setXYAt(s.v[s._length-1][0],s.v[s._length-1][1],"o",s._length-1)),c>e.e)break;i<d-1&&(s=Ct.newElement(),g=!0,u.push(s),h=0)}return u},H.registerModifier("tm",K),M([G],J),J.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=R.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},J.prototype.processPath=function(t,e){var s,i=Ct.newElement();i.c=t.c;var a,r,n,h,o,l,p,f,m,d,c,u,g=t._length,y=0;for(s=0;s<g;s+=1)a=t.v[s],n=t.o[s],r=t.i[s],a[0]===n[0]&&a[1]===n[1]&&a[0]===r[0]&&a[1]===r[1]?0!==s&&s!==g-1||t.c?(h=0===s?t.v[g-1]:t.v[s-1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=c=a[0]+(h[0]-a[0])*l,f=u=a[1]-(a[1]-h[1])*l,m=p-(p-a[0])*v,d=f-(f-a[1])*v,i.setTripleAt(p,f,m,d,c,u,y),y+=1,h=s===g-1?t.v[0]:t.v[s+1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=m=a[0]+(h[0]-a[0])*l,f=d=a[1]+(h[1]-a[1])*l,c=p-(p-a[0])*v,u=f-(f-a[1])*v,i.setTripleAt(p,f,m,d,c,u,y)):i.setTripleAt(a[0],a[1],n[0],n[1],r[0],r[1],y):i.setTripleAt(t.v[s][0],t.v[s][1],t.o[s][0],t.o[s][1],t.i[s][0],t.i[s][1],y),y+=1;return i},J.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.rd.v;if(0!==o)for(s=0;s<h;s+=1){if(n=(r=this.shapes[s]).localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},H.registerModifier("rd",J),M([G],U),U.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=R.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},U.prototype.processPath=function(t,e){var s=e/100,i=[0,0],a=t._length,r=0;for(r=0;r<a;r+=1)i[0]+=t.v[r][0],i[1]+=t.v[r][1];i[0]/=a,i[1]/=a;var n,h,o,l,p,f,m=Ct.newElement();for(m.c=t.c,r=0;r<a;r+=1)n=t.v[r][0]+(i[0]-t.v[r][0])*s,h=t.v[r][1]+(i[1]-t.v[r][1])*s,o=t.o[r][0]+(i[0]-t.o[r][0])*-s,l=t.o[r][1]+(i[1]-t.o[r][1])*-s,p=t.i[r][0]+(i[0]-t.i[r][0])*-s,f=t.i[r][1]+(i[1]-t.i[r][1])*-s,m.setTripleAt(n,h,o,l,p,f,r);return m},U.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.amount.v;if(0!==o)for(s=0;s<h;s+=1){if(n=(r=this.shapes[s]).localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},H.registerModifier("pb",U),M([G],Z),Z.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=R.getProp(t,e.c,0,null,this),this.o=R.getProp(t,e.o,0,null,this),this.tr=z.getTransformProperty(t,e.tr,this),this.so=R.getProp(t,e.tr.so,0,.01,this),this.eo=R.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new I,this.rMatrix=new I,this.sMatrix=new I,this.tMatrix=new I,this.matrix=new I},Z.prototype.applyTransforms=function(t,e,s,i,a,r){var n=r?-1:1,h=i.s.v[0]+(1-i.s.v[0])*(1-a),o=i.s.v[1]+(1-i.s.v[1])*(1-a);t.translate(i.p.v[0]*n*a,i.p.v[1]*n*a,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*a),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.scale(r?1/h:h,r?1/o:o),s.translate(i.a.v[0],i.a.v[1],i.a.v[2])},Z.prototype.init=function(t,e,s,i){for(this.elem=t,this.arr=e,this.pos=s,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[s]);0<s;)s-=1,this._elements.unshift(e[s]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},Z.prototype.resetElements=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},Z.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},Z.prototype.changeGroupRender=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]._render=e,"gr"===t[s].ty&&this.changeGroupRender(t[s].it,e)},Z.prototype.processShapes=function(t){var e,s,i,a,r;if(this._mdf||t){var n,h=Math.ceil(this.c.v);if(this._groups.length<h){for(;this._groups.length<h;){var o={it:this.cloneElements(this._elements),ty:"gr"};o.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,o),this._groups.splice(0,0,o),this._currentCopies+=1}this.elem.reloadShapes()}for(i=r=0;i<=this._groups.length-1;i+=1)n=r<h,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),r+=1;this._currentCopies=h;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=this.pMatrix.props,d=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,g,y=0;if(0<l){for(;y<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),y+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),y+=p)}else if(l<0){for(;f<y;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),y-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),y-=p)}for(i=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,r=this._currentCopies;r;){if(g=(s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==y){for((0!==i&&1===a||i!==this._currentCopies-1&&-1===a)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),u=0;u<g;u+=1)s[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<g;u+=1)s[u]=this.matrix.props[u];y+=1,r-=1,i+=a}}else for(r=this._currentCopies,i=0,a=1;r;)s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,r-=1,i+=a},Z.prototype.addShape=function(){},H.registerModifier("rp",Z),Q.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(C(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},Q.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)Ct.release(this.shapes[t]);this._length=0},$.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,s=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<s;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},M([T],$),tt.prototype.comparePoints=function(t,e){for(var s=0,i=this.o.length/2;s<i;){if(.01<Math.abs(t[4*s]-t[4*e+2*s]))return!1;s+=1}return!0},tt.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},tt.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,s,i,a=4*this.data.p;for(e=0;e<a;e+=1)s=e%4==0?100:255,i=Math.round(this.prop.v[e]*s),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(a=this.prop.v.length,e=4*this.data.p;e<a;e+=1)s=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},M([T],tt);var et,st,it=function(t,e,s,i){if(0===e)return"";var a,r=t.o,n=t.i,h=t.v,o=" M"+i.applyToPointStringified(h[0][0],h[0][1]);for(a=1;a<e;a+=1)o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[a][0],n[a][1])+" "+i.applyToPointStringified(h[a][0],h[a][1]);return s&&e&&(o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(h[0][0],h[0][1]),o+="z"),o},at=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,s=this.audios.length;for(e=0;e<s;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),rt=function(){var a=function(){var t=w("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(t,e,s){var i="";if(t.e)i=t.p;else if(e){var a=t.p;-1!==a.indexOf("images/")&&(a=a.split("/")[1]),i=e+a}else i=s,i+=t.u?t.u:"",i+=t.p;return i}function e(){this._imageLoaded=t.bind(this),this.testImageLoaded=function(t){var e=0,s=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(s)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return e.prototype={loadAssets:function(t,e){var s;this.imagesLoadedCb=e;var i=t.length;for(s=0;s<i;s+=1)t[s].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[s])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,s=this.images.length;e<s;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function(t){var e=r(t,this.assetsPath,this.path),s=w("img");s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.src=e;var i={img:s,assetData:t};return i},createImageData:function(t){var e=r(t,this.assetsPath,this.path),s=D("image");n?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(s);var i={img:s,assetData:t};return i},imageLoaded:t,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},e}(),nt=(et={maskType:!0},(/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))&&(et.maskType=!1),et),ht=((st={}).createFilter=function(t){var e=D("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},st.createAlphaToLuminanceFilter=function(){var t=D("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},st),ot=function(){function r(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function(t,e,s){var i,a=new XMLHttpRequest;a.open("GET",t,!0);try{a.responseType="json"}catch(t){}a.send(),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)i=r(a),e(i);else try{i=r(a),e(i)}catch(t){s&&s(t)}}}}}();function dt(t,e,s){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=C(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(s)}function ct(t,e,s){var i={propType:!1},a=R.getProp,r=e.a;this.a={r:r.r?a(t,r.r,0,B,s):i,rx:r.rx?a(t,r.rx,0,B,s):i,ry:r.ry?a(t,r.ry,0,B,s):i,sk:r.sk?a(t,r.sk,0,B,s):i,sa:r.sa?a(t,r.sa,0,B,s):i,s:r.s?a(t,r.s,1,.01,s):i,a:r.a?a(t,r.a,1,0,s):i,o:r.o?a(t,r.o,0,.01,s):i,p:r.p?a(t,r.p,1,0,s):i,sw:r.sw?a(t,r.sw,0,0,s):i,sc:r.sc?a(t,r.sc,1,0,s):i,fc:r.fc?a(t,r.fc,1,0,s):i,fh:r.fh?a(t,r.fh,0,0,s):i,fs:r.fs?a(t,r.fs,0,.01,s):i,fb:r.fb?a(t,r.fb,0,.01,s):i,t:r.t?a(t,r.t,0,0,s):i},this.s=At.getTextSelectorProp(t,e.s,s),this.s.t=e.s.t}function ut(t,e,s,i,a,r){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=a,this.p=r,this._mdf={o:!0,sw:!!e,sc:!!s,fc:!!i,m:!0,p:!0}}function gt(t,e){this._frameId=s,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}dt.prototype.searchProperties=function(){var t,e,s=this._textData.a.length,i=R.getProp;for(t=0;t<s;t+=1)e=this._textData.a[t],this._animatorsData[t]=new ct(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},dt.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var s,i,a,r,n,h,o,l,p,f,m,d,c,u,g,y,v,_,b,k=this._moreOptions.alignment.v,A=this._animatorsData,P=this._textData,S=this.mHelper,x=this._renderType,C=this.renderedLetters.length,D=t.l;if(this._hasMaskedPath){if(b=this._pathData.m,!this._pathData.n||this._pathData._mdf){var w,T=b.v;for(this._pathData.r&&(T=T.reverse()),n={tLength:0,segments:[]},r=T._length-1,a=y=0;a<r;a+=1)w=mt.buildBezierData(T.v[a],T.v[a+1],[T.o[a][0]-T.v[a][0],T.o[a][1]-T.v[a][1]],[T.i[a+1][0]-T.v[a+1][0],T.i[a+1][1]-T.v[a+1][1]]),n.tLength+=w.segmentLength,n.segments.push(w),y+=w.segmentLength;a=r,b.v.c&&(w=mt.buildBezierData(T.v[a],T.v[0],[T.o[a][0]-T.v[a][0],T.o[a][1]-T.v[a][1]],[T.i[0][0]-T.v[0][0],T.i[0][1]-T.v[0][1]]),n.tLength+=w.segmentLength,n.segments.push(w),y+=w.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,h=this._pathData.f.v,f=1,p=!(l=m=0),u=n.segments,h<0&&b.v.c)for(n.tLength<Math.abs(h)&&(h=-Math.abs(h)%n.tLength),f=(c=u[m=u.length-1].points).length-1;h<0;)h+=c[f].partialLength,(f-=1)<0&&(f=(c=u[m-=1].points).length-1);d=(c=u[m].points)[f-1],g=(o=c[f]).partialLength}r=D.length,i=s=0;var F,E,M,I,L,V=1.2*t.finalSize*.714,R=!0;M=A.length;var z,N,O,q,B,j,W,X,Y,H,G,K,J=-1,U=h,Z=m,Q=f,$=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var st=0,it=0,at=2===t.j?-.5:-1,rt=0,nt=!0;for(a=0;a<r;a+=1)if(D[a].n){for(st&&(st+=it);rt<a;)D[rt].animatorJustifyOffset=st,rt+=1;nt=!(st=0)}else{for(E=0;E<M;E+=1)(F=A[E].a).t.propType&&(nt&&2===t.j&&(it+=F.t.v*at),(L=A[E].s.getMult(D[a].anIndexes[E],P.a[E].s.totalChars)).length?st+=F.t.v*L[0]*at:st+=F.t.v*L*at);nt=!1}for(st&&(st+=it);rt<a;)D[rt].animatorJustifyOffset=st,rt+=1}for(a=0;a<r;a+=1){if(S.reset(),q=1,D[a].n)s=0,i+=t.yOffset,i+=R?1:0,h=U,R=!1,this._hasMaskedPath&&(f=Q,d=(c=u[m=Z].points)[f-1],g=(o=c[f]).partialLength,l=0),K=Y=G=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if($!==D[a].line){switch(t.j){case 1:h+=y-t.lineWidths[D[a].line];break;case 2:h+=(y-t.lineWidths[D[a].line])/2}$=D[a].line}J!==D[a].ind&&(D[J]&&(h+=D[J].extra),h+=D[a].an/2,J=D[a].ind),h+=k[0]*D[a].an*.005;var ht=0;for(E=0;E<M;E+=1)(F=A[E].a).p.propType&&((L=A[E].s.getMult(D[a].anIndexes[E],P.a[E].s.totalChars)).length?ht+=F.p.v[0]*L[0]:ht+=F.p.v[0]*L),F.a.propType&&((L=A[E].s.getMult(D[a].anIndexes[E],P.a[E].s.totalChars)).length?ht+=F.a.v[0]*L[0]:ht+=F.a.v[0]*L);for(p=!0;p;)h+ht<=l+g||!c?(v=(h+ht-l)/o.partialLength,N=d.point[0]+(o.point[0]-d.point[0])*v,O=d.point[1]+(o.point[1]-d.point[1])*v,S.translate(-k[0]*D[a].an*.005,-k[1]*V*.01),p=!1):c&&(l+=o.partialLength,(f+=1)>=c.length&&(f=0,c=u[m+=1]?u[m].points:b.v.c?u[m=f=0].points:(l-=o.partialLength,null)),c&&(d=o,g=(o=c[f]).partialLength));z=D[a].an/2-D[a].add,S.translate(-z,0,0)}else z=D[a].an/2-D[a].add,S.translate(-z,0,0),S.translate(-k[0]*D[a].an*.005,-k[1]*V*.01,0);for(E=0;E<M;E+=1)(F=A[E].a).t.propType&&(L=A[E].s.getMult(D[a].anIndexes[E],P.a[E].s.totalChars),0===s&&0===t.j||(this._hasMaskedPath?L.length?h+=F.t.v*L[0]:h+=F.t.v*L:L.length?s+=F.t.v*L[0]:s+=F.t.v*L));for(t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(B=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(W=[t.fc[0],t.fc[1],t.fc[2]]),E=0;E<M;E+=1)(F=A[E].a).a.propType&&((L=A[E].s.getMult(D[a].anIndexes[E],P.a[E].s.totalChars)).length?S.translate(-F.a.v[0]*L[0],-F.a.v[1]*L[1],F.a.v[2]*L[2]):S.translate(-F.a.v[0]*L,-F.a.v[1]*L,F.a.v[2]*L));for(E=0;E<M;E+=1)(F=A[E].a).s.propType&&((L=A[E].s.getMult(D[a].anIndexes[E],P.a[E].s.totalChars)).length?S.scale(1+(F.s.v[0]-1)*L[0],1+(F.s.v[1]-1)*L[1],1):S.scale(1+(F.s.v[0]-1)*L,1+(F.s.v[1]-1)*L,1));for(E=0;E<M;E+=1){if(F=A[E].a,L=A[E].s.getMult(D[a].anIndexes[E],P.a[E].s.totalChars),F.sk.propType&&(L.length?S.skewFromAxis(-F.sk.v*L[0],F.sa.v*L[1]):S.skewFromAxis(-F.sk.v*L,F.sa.v*L)),F.r.propType&&(L.length?S.rotateZ(-F.r.v*L[2]):S.rotateZ(-F.r.v*L)),F.ry.propType&&(L.length?S.rotateY(F.ry.v*L[1]):S.rotateY(F.ry.v*L)),F.rx.propType&&(L.length?S.rotateX(F.rx.v*L[0]):S.rotateX(F.rx.v*L)),F.o.propType&&(L.length?q+=(F.o.v*L[0]-q)*L[0]:q+=(F.o.v*L-q)*L),t.strokeWidthAnim&&F.sw.propType&&(L.length?j+=F.sw.v*L[0]:j+=F.sw.v*L),t.strokeColorAnim&&F.sc.propType)for(X=0;X<3;X+=1)L.length?B[X]+=(F.sc.v[X]-B[X])*L[0]:B[X]+=(F.sc.v[X]-B[X])*L;if(t.fillColorAnim&&t.fc){if(F.fc.propType)for(X=0;X<3;X+=1)L.length?W[X]+=(F.fc.v[X]-W[X])*L[0]:W[X]+=(F.fc.v[X]-W[X])*L;F.fh.propType&&(W=L.length?ft(W,F.fh.v*L[0]):ft(W,F.fh.v*L)),F.fs.propType&&(W=L.length?lt(W,F.fs.v*L[0]):lt(W,F.fs.v*L)),F.fb.propType&&(W=L.length?pt(W,F.fb.v*L[0]):pt(W,F.fb.v*L))}}for(E=0;E<M;E+=1)(F=A[E].a).p.propType&&(L=A[E].s.getMult(D[a].anIndexes[E],P.a[E].s.totalChars),this._hasMaskedPath?L.length?S.translate(0,F.p.v[1]*L[0],-F.p.v[2]*L[1]):S.translate(0,F.p.v[1]*L,-F.p.v[2]*L):L.length?S.translate(F.p.v[0]*L[0],F.p.v[1]*L[1],-F.p.v[2]*L[2]):S.translate(F.p.v[0]*L,F.p.v[1]*L,-F.p.v[2]*L));if(t.strokeWidthAnim&&(Y=j<0?0:j),t.strokeColorAnim&&(H="rgb("+Math.round(255*B[0])+","+Math.round(255*B[1])+","+Math.round(255*B[2])+")"),t.fillColorAnim&&t.fc&&(G="rgb("+Math.round(255*W[0])+","+Math.round(255*W[1])+","+Math.round(255*W[2])+")"),this._hasMaskedPath){if(S.translate(0,-t.ls),S.translate(0,k[1]*V*.01+i,0),P.p.p){_=(o.point[1]-d.point[1])/(o.point[0]-d.point[0]);var ot=180*Math.atan(_)/Math.PI;o.point[0]<d.point[0]&&(ot+=180),S.rotate(-ot*Math.PI/180)}S.translate(N,O,0),h-=k[0]*D[a].an*.005,D[a+1]&&J!==D[a+1].ind&&(h+=D[a].an/2,h+=.001*t.tr*t.finalSize)}else{switch(S.translate(s,i,0),t.ps&&S.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:S.translate(D[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[a].line]),0,0);break;case 2:S.translate(D[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[a].line])/2,0,0)}S.translate(0,-t.ls),S.translate(z,0,0),S.translate(k[0]*D[a].an*.005,k[1]*V*.01,0),s+=D[a].l+.001*t.tr*t.finalSize}"html"===x?tt=S.toCSS():"svg"===x?tt=S.to2dCSS():et=[S.props[0],S.props[1],S.props[2],S.props[3],S.props[4],S.props[5],S.props[6],S.props[7],S.props[8],S.props[9],S.props[10],S.props[11],S.props[12],S.props[13],S.props[14],S.props[15]],K=q}this.lettersChangedFlag=C<=a?(I=new ut(K,Y,H,G,tt,et),this.renderedLetters.push(I),C+=1,!0):(I=this.renderedLetters[a]).update(K,Y,H,G,tt,et)||this.lettersChangedFlag}}},dt.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},dt.prototype.mHelper=new I,dt.prototype.defaultPropsArray=[],M([T],dt),ut.prototype.update=function(t,e,s,i,a,r){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==s&&(this.sc=s,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==a&&(this.m=a,n=this._mdf.m=!0),!r.length||this.p[0]===r[0]&&this.p[1]===r[1]&&this.p[4]===r[4]&&this.p[5]===r[5]&&this.p[12]===r[12]&&this.p[13]===r[13]||(this.p=r,n=this._mdf.p=!0),n},gt.prototype.defaultBoxWidth=[0,0],gt.prototype.copyData=function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},gt.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},gt.prototype.searchProperty=function(){return this.searchKeyframes()},gt.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},gt.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},gt.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,s=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var a=this.effectsSequence.length,r=t||this.data.d.k[this.keysIndex].s;for(i=0;i<a;i+=1)r=s!==this.keysIndex?this.effectsSequence[i](r,r.t):this.effectsSequence[i](this.currentData,r.t);e!==r&&this.setCurrentData(r),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},gt.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,s=0,i=t.length;s<=i-1&&!(s===i-1||t[s+1].t>e);)s+=1;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d.k[this.keysIndex].s},gt.prototype.buildFinalText=function(t){for(var e,s=V.getCombinedCharacterCodes(),i=[],a=0,r=t.length;a<r;)e=t.charCodeAt(a),-1!==s.indexOf(e)?i[i.length-1]+=t.charAt(a):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(a+1))&&e<=57343?(i.push(t.substr(a,2)),a+=1):i.push(t.charAt(a)),a+=1;return i},gt.prototype.completeTextData=function(t){t.__complete=!0;var e,s,i,a,r,n,h,o=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,d=0,c=0,u=0,g=[],y=0,v=0,_=o.getFontByName(t.f),b=0,k=q(_);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),s=t.finalText.length,t.finalLineHeight=t.lh;var A,P=t.tr/1e3*t.finalSize;if(t.sz)for(var S,x,C=!0,D=t.sz[0],w=t.sz[1];C;){y=S=0,s=(x=this.buildFinalText(t.t)).length,P=t.tr/1e3*t.finalSize;var T=-1;for(e=0;e<s;e+=1)A=x[e].charCodeAt(0),i=!1," "===x[e]?T=e:13!==A&&3!==A||(i=!(y=0),S+=t.finalLineHeight||1.2*t.finalSize),D<y+(b=o.chars?(h=o.getCharData(x[e],_.fStyle,_.fFamily),i?0:h.w*t.finalSize/100):o.measureText(x[e],t.f,t.finalSize))&&" "!==x[e]?(-1===T?s+=1:e=T,S+=t.finalLineHeight||1.2*t.finalSize,x.splice(e,T===e?1:0,"\r"),T=-1,y=0):(y+=b,y+=P);S+=_.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&w<S?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=x,s=t.finalText.length,C=!1)}y=-P;var F,E=b=0;for(e=0;e<s;e+=1)if(i=!1,13===(A=(F=t.finalText[e]).charCodeAt(0))||3===A?(E=0,g.push(y),v=v<y?y:v,y=-2*P,i=!(a=""),u+=1):a=F,b=o.chars?(h=o.getCharData(F,_.fStyle,o.getFontByName(t.f).fFamily),i?0:h.w*t.finalSize/100):o.measureText(a,t.f,t.finalSize)," "===F?E+=b+P:(y+=b+P+E,E=0),p.push({l:b,an:b,add:d,n:i,anIndexes:[],val:a,line:u,animatorJustifyOffset:0}),2==m){if(d+=b,""===a||" "===a||e===s-1){for(""!==a&&" "!==a||(d-=b);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=b,c+=1;f+=1,d=0}}else if(3==m){if(d+=b,""===a||e===s-1){for(""===a&&(d-=b);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=b,c+=1;d=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<y?y:v,g.push(y),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var M,I,L,V,R=l.a;n=R.length;var z=[];for(r=0;r<n;r+=1){for((M=R[r]).a.sc&&(t.strokeColorAnim=!0),M.a.sw&&(t.strokeWidthAnim=!0),(M.a.fc||M.a.fh||M.a.fs||M.a.fb)&&(t.fillColorAnim=!0),V=0,L=M.s.b,e=0;e<s;e+=1)(I=p[e]).anIndexes[r]=V,(1==L&&""!==I.val||2==L&&""!==I.val&&" "!==I.val||3==L&&(I.n||" "==I.val||e==s-1)||4==L&&(I.n||e==s-1))&&(1===M.s.rn&&z.push(V),V+=1);l.a[r].s.totalChars=V;var N,O=-1;if(1===M.s.rn)for(e=0;e<s;e+=1)O!=(I=p[e]).anIndexes[r]&&(O=I.anIndexes[r],N=z.splice(Math.floor(Math.random()*z.length),1)[0]),I.anIndexes[r]=N}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=_.ascent*t.finalSize/100},gt.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var s=this.copyData({},this.data.d.k[e].s);s=this.copyData(s,t),this.data.d.k[e].s=s,this.recalculate(e),this.elem.addDynamicProperty(this)},gt.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},gt.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},gt.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var yt,vt,_t,bt,kt,At=function(){var d=Math.max,c=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=R.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?R.getProp(t,e.e,0,0,this):{v:100},this.o=R.getProp(t,e.o||{k:0},0,0,this),this.xe=R.getProp(t,e.xe||{k:0},0,0,this),this.ne=R.getProp(t,e.ne||{k:0},0,0,this),this.a=R.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,s=0,i=1,a=1;0<this.ne.v?e=this.ne.v/100:s=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:a=1+this.xe.v/100;var r=W.getBezierEasing(e,s,i,a).get,n=0,h=this.finalS,o=this.finalE,l=this.data.sh;if(2===l)n=r(n=o===h?o<=t?1:0:d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(3===l)n=r(n=o===h?o<=t?0:1:1-d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(4===l)o===h?n=0:(n=d(0,c(.5/(o-h)+(t-h)/(o-h),1)))<.5?n*=2:n=1-2*(n-.5),n=r(n);else if(5===l){if(o===h)n=0;else{var p=o-h,f=-p/2+(t=c(d(0,t+.5-h),o-h)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=r(n)}else n=6===l?r(n=o===h?0:(t=c(d(0,t+.5-h),o-h),(1+Math.cos(Math.PI+2*Math.PI*t/(o-h)))/2)):(t>=u(h)&&(n=d(0,c(t-h<0?c(o,1)-(h-t):o-t,1))),r(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,s=this.o.v/e,i=this.s.v/e+s,a=this.e.v/e+s;if(a<i){var r=i;i=a,a=r}this.finalS=i,this.finalE=a}},M([T],i),{getTextSelectorProp:function(t,e,s){return new i(t,e,s)}}}(),Pt=function(t,e,s){var i=0,a=t,r=C(a);return{newElement:function(){return i?r[i-=1]:e()},release:function(t){i===a&&(r=St.double(r),a*=2),s&&s(t),r[i]=t,i+=1}}},St={double:function(t){return t.concat(C(t.length))}},xt=Pt(8,function(){return j("float32",2)}),Ct=((yt=Pt(4,function(){return new N},function(t){var e,s=t._length;for(e=0;e<s;e+=1)xt.release(t.v[e]),xt.release(t.i[e]),xt.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1})).clone=function(t){var e,s=yt.newElement(),i=void 0===t._length?t.v.length:t._length;for(s.setLength(i),s.c=t.c,e=0;e<i;e+=1)s.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return s},yt),Dt=(vt={newShapeCollection:function(){var t;t=_t?kt[_t-=1]:new Q;return t},release:function(t){var e,s=t._length;for(e=0;e<s;e+=1)Ct.release(t.shapes[e]);t._length=0,_t===bt&&(kt=St.double(kt),bt*=2);kt[_t]=t,_t+=1}},_t=0,kt=C(bt=4),vt),wt=Pt(8,function(){return{lengths:[],totalLength:0}},function(t){var e,s=t.lengths.length;for(e=0;e<s;e+=1)Tt.release(t.lengths[e]);t.lengths.length=0}),Tt=Pt(8,function(){return{addedLength:0,percents:j("float32",P),lengths:j("float32",P)}});function Ft(){}function Et(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=D("svg");var s="";if(e&&e.title){var i=D("title"),a=S();i.setAttribute("id",a),i.textContent=e.title,this.svgElement.appendChild(i),s+=a}if(e&&e.description){var r=D("desc"),n=S();r.setAttribute("id",n),r.textContent=e.description,this.svgElement.appendChild(r),s+=" "+n}s&&this.svgElement.setAttribute("aria-labelledby",s);var h=D("defs");this.svgElement.appendChild(h);var o=D("g");this.svgElement.appendChild(o),this.layerElement=o,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:h,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function Mt(t,e,s){this.data=t,this.element=e,this.globalData=s,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,a,r=this.globalData.defs,n=this.masksProperties?this.masksProperties.length:0;this.viewData=C(n),this.solidPath="";var h,o,l,p,f,m,d=this.masksProperties,c=0,u=[],g=S(),y="clipPath",v="clip-path";for(i=0;i<n;i+=1)if(("a"!==d[i].mode&&"n"!==d[i].mode||d[i].inv||100!==d[i].o.k||d[i].o.x)&&(v=y="mask"),"s"!==d[i].mode&&"i"!==d[i].mode||0!==c?l=null:((l=D("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),a=D("path"),"n"===d[i].mode)this.viewData[i]={op:R.getProp(this.element,d[i].o,0,.01,this.element),prop:Y.getShapeProp(this.element,d[i],3),elem:a,lastPath:""},r.appendChild(a);else{var _;if(c+=1,a.setAttribute("fill","s"===d[i].mode?"#000000":"#ffffff"),a.setAttribute("clip-rule","nonzero"),0!==d[i].x.k?(v=y="mask",m=R.getProp(this.element,d[i].x,0,null,this.element),_=S(),(p=D("filter")).setAttribute("id",_),(f=D("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),r.appendChild(p),a.setAttribute("stroke","s"===d[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:a,x:m,expan:f,lastPath:"",lastOperator:"",filterId:_,lastRadius:0},"i"===d[i].mode){o=u.length;var b=D("g");for(h=0;h<o;h+=1)b.appendChild(u[h]);var k=D("mask");k.setAttribute("mask-type","alpha"),k.setAttribute("id",g+"_"+c),k.appendChild(a),r.appendChild(k),b.setAttribute("mask","url("+A+"#"+g+"_"+c+")"),u.length=0,u.push(b)}else u.push(a);d[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:a,lastPath:"",op:R.getProp(this.element,d[i].o,0,.01,this.element),prop:Y.getShapeProp(this.element,d[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(d[i],this.viewData[i].prop.v,this.viewData[i])}for(this.maskElement=D(y),n=u.length,i=0;i<n;i+=1)this.maskElement.appendChild(u[i]);0<c&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+A+"#"+g+")"),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function It(){}function Lt(){}function Vt(){}function Rt(){}function zt(){}function Nt(t,e){this.elem=t,this.pos=e}function Ot(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=D("path"),this.msElem=null}function qt(t,e,s){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;for(var i=0,a=t.length;i<a;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function Bt(t,e,s){this.transform={mProps:t,op:e,container:s},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function jt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=R.getProp(t,e.o,0,.01,this),this.w=R.getProp(t,e.w,0,null,this),this.d=new $(t,e.d||{},"svg",this),this.c=R.getProp(t,e.c,1,255,this),this.style=s,this._isAnimated=!!this._isAnimated}function Wt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=R.getProp(t,e.o,0,.01,this),this.c=R.getProp(t,e.c,1,255,this),this.style=s}function Xt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,s)}function Yt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=R.getProp(t,e.w,0,null,this),this.d=new $(t,e.d||{},"svg",this),this.initGradientData(t,e,s),this._isAnimated=!!this._isAnimated}function Ht(){this.it=[],this.prevViewData=[],this.gr=D("g")}Ft.prototype.checkLayers=function(t){var e,s,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e-=1)this.elements[e]||(s=this.layers[e]).ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},Ft.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);default:return this.createNull(t)}},Ft.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Ft.prototype.createAudio=function(t){return new se(t,this.globalData,this)},Ft.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},Ft.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var s,i=t.length,a=this.layers.length;for(e=0;e<i;e+=1)for(s=0;s<a;){if(this.layers[s].id===t[e].id){this.layers[s]=t[e];break}s+=1}},Ft.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},Ft.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},Ft.prototype.buildElementParenting=function(t,e,s){for(var i=this.elements,a=this.layers,r=0,n=a.length;r<n;)a[r].ind==e&&(i[r]&&!0!==i[r]?(s.push(i[r]),i[r].setAsParent(),void 0!==a[r].parent?this.buildElementParenting(t,a[r].parent,s):t.setHierarchy(s)):(this.buildItem(r),this.addPendingElement(t))),r+=1},Ft.prototype.addPendingElement=function(t){this.pendingElements.push(t)},Ft.prototype.searchExtraCompositions=function(t){var e,s=t.length;for(e=0;e<s;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},Ft.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new V,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},M([Ft],Et),Et.prototype.createNull=function(t){return new Jt(t,this.globalData,this)},Et.prototype.createShape=function(t){return new re(t,this.globalData,this)},Et.prototype.createText=function(t){return new ae(t,this.globalData,this)},Et.prototype.createImage=function(t){return new te(t,this.globalData,this)},Et.prototype.createComp=function(t){return new ie(t,this.globalData,this)},Et.prototype.createSolid=function(t){return new ee(t,this.globalData,this)},Et.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var s=D("clipPath"),i=D("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var a=S();s.setAttribute("id",a),s.appendChild(i),this.layerElement.setAttribute("clip-path","url("+A+"#"+a+")"),e.appendChild(s),this.layers=t.layers,this.elements=C(t.layers.length)},Et.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},Et.prototype.updateContainerSize=function(){},Et.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var s=this.createItem(this.layers[t]);e[t]=s,h&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(s),s.initExpressions()),this.appendElementInPos(s,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?s.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(s)))}},Et.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,s=this.elements.length;e<s;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},Et.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var s=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=s-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<s;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},Et.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){for(var i,a=0;a<e;)this.elements[a]&&!0!==this.elements[a]&&this.elements[a].getBaseElement()&&(i=this.elements[a].getBaseElement()),a+=1;i?this.layerElement.insertBefore(s,i):this.layerElement.appendChild(s)}},Et.prototype.hide=function(){this.layerElement.style.display="none"},Et.prototype.show=function(){this.layerElement.style.display="block"},Mt.prototype.getMaskProperty=function(t){return this.viewData[t].prop},Mt.prototype.renderFrame=function(t){var e,s=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",s.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var a=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+A+"#"+this.storedData[e].filterId+")")),a.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},Mt.prototype.getMaskelement=function(){return this.maskElement},Mt.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},Mt.prototype.drawPath=function(t,e,s){var i,a,r=" M"+e.v[0][0]+","+e.v[0][1];for(a=e._length,i=1;i<a;i+=1)r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<a&&(r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),s.lastPath!==r){var n="";s.elem&&(e.c&&(n=t.inv?this.solidPath+r:r),s.elem.setAttribute("d",n)),s.lastPath=r}},Mt.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},It.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},Lt.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var s,i=this.dynamicProperties.length;for(s=0;s<i;s+=1)(e||this._isParent&&"transform"===this.dynamicProperties[s].propType)&&(this.dynamicProperties[s].getValue(),this.dynamicProperties[s]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},Vt.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?z.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new I},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,s=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;s<i;){if(this.hierarchy[s].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}s+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),s=0;s<i;s+=1)t=this.hierarchy[s].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var s,i=!0,a=this.comp;i;)a.finalTransform?(a.data.hasMask&&e.splice(0,0,a.finalTransform),a=a.comp):i=!1;var r,n=e.length;for(s=0;s<n;s+=1)r=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-r[0],t[1]-r[1],0];return t},mHelper:new I},Rt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},M([Rt,function(t){function e(){}return e.prototype=t,e}({initElement:function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],zt),Ot.prototype.reset=function(){this.d="",this._mdf=!1},qt.prototype.setAsAnimated=function(){this._isAnimated=!0},M([T],jt),M([T],Wt),Xt.prototype.initGradientData=function(t,e,s){this.o=R.getProp(t,e.o,0,.01,this),this.s=R.getProp(t,e.s,1,null,this),this.e=R.getProp(t,e.e,1,null,this),this.h=R.getProp(t,e.h||{k:0},0,.01,this),this.a=R.getProp(t,e.a||{k:0},0,B,this),this.g=new tt(t,e.g,this),this.style=s,this.stops=[],this.setGradientData(s.pElem,e),this.setGradientOpacity(e,s),this._isAnimated=!!this._isAnimated},Xt.prototype.setGradientData=function(t,e){var s=S(),i=D(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",s),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var a,r,n,h=[];for(n=4*e.g.p,r=0;r<n;r+=4)a=D("stop"),i.appendChild(a),h.push(a);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+A+"#"+s+")"),this.gf=i,this.cst=h},Xt.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var s,i,a,r=D("mask"),n=D("path");r.appendChild(n);var h=S(),o=S();r.setAttribute("id",o);var l=D(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",h),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),a=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(i=4*t.g.p;i<a;i+=2)(s=D("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(s),p.push(s);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+A+"#"+h+")"),this.of=l,this.ms=r,this.ost=p,this.maskId=o,e.msElem=n}},M([T],Xt),M([Xt,T],Yt);var Gt=function(){var g=new I,y=new I;function e(t,e,s){(s||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(s||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function s(t,e,s){var i,a,r,n,h,o,l,p,f,m,d,c=e.styles.length,u=e.lvl;for(o=0;o<c;o+=1){if(n=e.sh._mdf||s,e.styles[o].lvl<u){for(p=y.reset(),m=u-e.styles[o].lvl,d=e.transformers.length-1;!n&&0<m;)n=e.transformers[d].mProps._mdf||n,m-=1,d-=1;if(n)for(m=u-e.styles[o].lvl,d=e.transformers.length-1;0<m;)f=e.transformers[d].mProps.v.props,p.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),m-=1,d-=1}else p=g;if(a=(l=e.sh.paths)._length,n){for(r="",i=0;i<a;i+=1)(h=l.shapes[i])&&h._length&&(r+=it(h,h._length,h.c,p));e.caches[o]=r}else r=e.caches[o];e.styles[o].d+=!0===t.hd?"":r,e.styles[o]._mdf=n||e.styles[o]._mdf}}function i(t,e,s){var i=e.style;(e.c._mdf||s)&&i.pElem.setAttribute("fill","rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function a(t,e,s){r(t,e,s),n(t,e,s)}function r(t,e,s){var i,a,r,n,h,o=e.gf,l=e.g._hasOpacity,p=e.s.v,f=e.e.v;if(e.o._mdf||s){var m="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(m,e.o.v)}if(e.s._mdf||s){var d=1===t.t?"x1":"cx",c="x1"===d?"y1":"cy";o.setAttribute(d,p[0]),o.setAttribute(c,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(d,p[0]),e.of.setAttribute(c,p[1]))}if(e.g._cmdf||s){i=e.cst;var u=e.g.c;for(r=i.length,a=0;a<r;a+=1)(n=i[a]).setAttribute("offset",u[4*a]+"%"),n.setAttribute("stop-color","rgb("+u[4*a+1]+","+u[4*a+2]+","+u[4*a+3]+")")}if(l&&(e.g._omdf||s)){var g=e.g.o;for(r=(i=e.g._collapsable?e.cst:e.ost).length,a=0;a<r;a+=1)n=i[a],e.g._collapsable||n.setAttribute("offset",g[2*a]+"%"),n.setAttribute("stop-opacity",g[2*a+1])}if(1===t.t)(e.e._mdf||s)&&(o.setAttribute("x2",f[0]),o.setAttribute("y2",f[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",f[0]),e.of.setAttribute("y2",f[1])));else if((e.s._mdf||e.e._mdf||s)&&(h=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)),o.setAttribute("r",h),l&&!e.g._collapsable&&e.of.setAttribute("r",h)),e.e._mdf||e.h._mdf||e.a._mdf||s){h||(h=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)));var y=Math.atan2(f[1]-p[1],f[0]-p[0]),v=e.h.v;1<=v?v=.99:v<=-1&&(v=-.99);var _=h*v,b=Math.cos(y+e.a.v)*_+p[0],k=Math.sin(y+e.a.v)*_+p[1];o.setAttribute("fx",b),o.setAttribute("fy",k),l&&!e.g._collapsable&&(e.of.setAttribute("fx",b),e.of.setAttribute("fy",k))}}function n(t,e,s){var i=e.style,a=e.d;a&&(a._mdf||s)&&a.dashStr&&(i.pElem.setAttribute("stroke-dasharray",a.dashStr),i.pElem.setAttribute("stroke-dashoffset",a.dashoffset[0])),e.c&&(e.c._mdf||s)&&i.pElem.setAttribute("stroke","rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||s)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return i;case"gf":return r;case"gs":return a;case"st":return n;case"sh":case"el":case"rc":case"sr":return s;case"tr":return e;default:return null}}}}();function Kt(){}function Jt(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initFrame(),this.initTransform(t,e,s),this.initHierarchy()}function Ut(){}function Zt(){}function Qt(){}function $t(){}function te(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ee(t,e,s){this.initElement(t,e,s)}function se(t,e,s){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,s),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ie(t,e,s){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?C(this.layers.length):[],this.initElement(t,e,s),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ae(t,e,s){this.textSpans=[],this.renderType="svg",this.initElement(t,e,s)}function re(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,s),this.prevViewData=[]}Kt.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=E(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=S(),this.data.sr||(this.data.sr=1),this.effectsManager=new pe(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},Jt.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},Jt.prototype.renderFrame=function(){},Jt.prototype.getBaseElement=function(){return null},Jt.prototype.destroy=function(){},Jt.prototype.sourceRectAtTime=function(){},Jt.prototype.hide=function(){},M([Kt,Vt,It,Lt],Jt),Ut.prototype={initRendererElement:function(){this.layerElement=D("g")},createContainerElements:function(){this.matteElement=D("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,s,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var a=D("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),a.appendChild(this.layerElement),i=a,this.globalData.defs.appendChild(a),nt.maskType||1!=this.data.td||(a.setAttribute("mask-type","luminance"),t=S(),e=ht.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(ht.createAlphaToLuminanceFilter()),(s=D("g")).appendChild(this.layerElement),i=s,a.appendChild(s),s.setAttribute("filter","url("+A+"#"+t+")"))}else if(2==this.data.td){var r=D("mask");r.setAttribute("id",this.layerId),r.setAttribute("mask-type","alpha");var n=D("g");r.appendChild(n),t=S(),e=ht.createFilter(t);var h=D("feComponentTransfer");h.setAttribute("in","SourceGraphic"),e.appendChild(h);var o=D("feFuncA");o.setAttribute("type","table"),o.setAttribute("tableValues","1.0 0.0"),h.appendChild(o),this.globalData.defs.appendChild(e);var l=D("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+A+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,nt.maskType||(r.setAttribute("mask-type","luminance"),e.appendChild(ht.createAlphaToLuminanceFilter()),s=D("g"),n.appendChild(l),s.appendChild(this.layerElement),i=s,n.appendChild(s)),this.globalData.defs.appendChild(r)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=D("clipPath"),f=D("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=S();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var d=D("g");d.setAttribute("clip-path","url("+A+"#"+m+")"),d.appendChild(this.layerElement),this.transformedElement=d,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+A+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new Mt(this.data,this,this.globalData),this.renderableEffectsManager=new he(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+A+"#"+t+")")}},Zt.prototype={addShapeToModifiers:function(t){var e,s=this.shapeModifiers.length;for(e=0;e<s;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,s=0,i=e.length;s<i;){if(e[s].elem===t)return e[s].pos;s+=1}return 0},addProcessedElement:function(t,e){for(var s=this.processedElements,i=s.length;i;)if(s[i-=1].elem===t)return void(s[i].pos=e);s.push(new Nt(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},Qt.prototype.initElement=function(t,e,s){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new gt(this,t.t,this.dynamicProperties),this.textAnimator=new dt(t.t,this.renderType,this),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},Qt.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},Qt.prototype.createPathShape=function(t,e){var s,i,a=e.length,r="";for(s=0;s<a;s+=1)i=e[s].ks.k,r+=it(i,i.i.length,!0,t);return r},Qt.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},Qt.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},Qt.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},Qt.prototype.applyTextPropertiesToMatrix=function(t,e,s,i,a){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s])/2,0,0)}e.translate(i,a,0)},Qt.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},Qt.prototype.emptyProp=new ut,Qt.prototype.destroy=function(){},M([Kt,Vt,It,Lt,zt],$t),$t.prototype.initElement=function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},$t.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var s,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),s=i-1;0<=s;s-=1)(this.completeLayers||this.elements[s])&&(this.elements[s].prepareFrame(this.renderedFrame-this.layers[s].st),this.elements[s]._mdf&&(this._mdf=!0))}},$t.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},$t.prototype.setElements=function(t){this.elements=t},$t.prototype.getElements=function(){return this.elements},$t.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},$t.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},M([Kt,Vt,Ut,It,Lt,zt],te),te.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=D("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},te.prototype.sourceRectAtTime=function(){return this.sourceRect},M([te],ee),ee.prototype.createContent=function(){var t=D("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},se.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},M([Rt,Kt,Lt],se),se.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},se.prototype.show=function(){},se.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},se.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},se.prototype.resume=function(){this._canPlay=!0},se.prototype.setRate=function(t){this.audio.rate(t)},se.prototype.volume=function(t){this.audio.volume(t)},se.prototype.getBaseElement=function(){return null},se.prototype.destroy=function(){},se.prototype.sourceRectAtTime=function(){},se.prototype.initExpressions=function(){},M([Et,$t,Ut],ie),M([Kt,Vt,Ut,It,Lt,zt,Qt],ae),ae.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=D("text"))},ae.prototype.buildTextContents=function(t){for(var e=0,s=t.length,i=[],a="";e<s;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(a),a=""):a+=t[e],e+=1;return i.push(a),i},ae.prototype.buildNewText=function(){var t,e,s=this.textProperty.currentData;this.renderedLetters=C(s?s.l.length:0),s.fc?this.layerElement.setAttribute("fill",this.buildColor(s.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(s.sc)),this.layerElement.setAttribute("stroke-width",s.sw)),this.layerElement.setAttribute("font-size",s.finalSize);var i=this.globalData.fontManager.getFontByName(s.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var a=s.fWeight,r=s.fStyle;this.layerElement.setAttribute("font-style",r),this.layerElement.setAttribute("font-weight",a)}this.layerElement.setAttribute("aria-label",s.t);var n,h=s.l||[],o=!!this.globalData.fontManager.chars;e=h.length;var l,p=this.mHelper,f="",m=this.data.singleShape,d=0,c=0,u=!0,g=.001*s.tr*s.finalSize;if(!m||o||s.sz){var y,v,_=this.textSpans.length;for(t=0;t<e;t+=1)o&&m&&0!==t||(n=t<_?this.textSpans[t]:D(o?"path":"text"),_<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(s.finalSize/100,s.finalSize/100),m&&(h[t].n&&(d=-g,c+=s.yOffset,c+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(s,p,h[t].line,d,c),d+=h[t].l||0,d+=g),o?(l=(y=(v=this.globalData.fontManager.getCharData(s.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily))&&v.data||{}).shapes?y.shapes[0].it:[],m?f+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(m&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=h[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&n&&n.setAttribute("d",f)}else{var b=this.textContainer,k="start";switch(s.j){case 1:k="end";break;case 2:k="middle";break;default:k="start"}b.setAttribute("text-anchor",k),b.setAttribute("letter-spacing",g);var A=this.buildTextContents(s.finalText);for(e=A.length,c=s.ps?s.ps[1]+s.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||D("tspan")).textContent=A[t],n.setAttribute("x",0),n.setAttribute("y",c),n.style.display="inherit",b.appendChild(n),this.textSpans[t]=n,c+=s.finalLineHeight;this.layerElement.appendChild(b)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},ae.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var t=this.layerElement.getBBox();this.bbox={top:t.y,left:t.x,width:t.width,height:t.height}}return this.bbox},ae.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var s,i,a=this.textAnimator.renderedLetters,r=this.textProperty.currentData.l;for(e=r.length,t=0;t<e;t+=1)r[t].n||(s=a[t],i=this.textSpans[t],s._mdf.m&&i.setAttribute("transform",s.m),s._mdf.o&&i.setAttribute("opacity",s.o),s._mdf.sw&&i.setAttribute("stroke-width",s.sw),s._mdf.sc&&i.setAttribute("stroke",s.sc),s._mdf.fc&&i.setAttribute("fill",s.fc))}},M([Kt,Vt,Ut,Zt,It,Lt,zt],re),re.prototype.initSecondaryElement=function(){},re.prototype.identityMatrix=new I,re.prototype.buildExpressionInterface=function(){},re.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},re.prototype.filterUniqueShapes=function(){var t,e,s,i,a=this.shapes.length,r=this.stylesList.length,n=[],h=!1;for(s=0;s<r;s+=1){for(i=this.stylesList[s],h=!1,t=n.length=0;t<a;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),h=e._isAnimated||h);1<n.length&&h&&this.setShapesAsAnimated(n)}},re.prototype.setShapesAsAnimated=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].setAsAnimated()},re.prototype.createStyleElement=function(t,e){var s,i=new Ot(t,e),a=i.pElem;if("st"===t.ty)s=new jt(this,t,i);else if("fl"===t.ty)s=new Wt(this,t,i);else if("gf"===t.ty||"gs"===t.ty){s=new("gf"===t.ty?Xt:Yt)(this,t,i),this.globalData.defs.appendChild(s.gf),s.maskId&&(this.globalData.defs.appendChild(s.ms),this.globalData.defs.appendChild(s.of),a.setAttribute("mask","url("+A+"#"+s.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(a.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),a.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),a.setAttribute("fill-opacity","0"),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&a.setAttribute("fill-rule","evenodd"),t.ln&&a.setAttribute("id",t.ln),t.cl&&a.setAttribute("class",t.cl),t.bm&&(a.style["mix-blend-mode"]=E(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,s),s},re.prototype.createGroupElement=function(t){var e=new Ht;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=E(t.bm)),e},re.prototype.createTransformElement=function(t,e){var s=z.getTransformProperty(this,t,this),i=new Bt(s,s.o,e);return this.addToAnimatedContents(t,i),i},re.prototype.createShapeElement=function(t,e,s){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var a=new qt(e,s,Y.getShapeProp(this,t,i,this));return this.shapes.push(a),this.addShapeToModifiers(a),this.addToAnimatedContents(t,a),a},re.prototype.addToAnimatedContents=function(t,e){for(var s=0,i=this.animatedContents.length;s<i;){if(this.animatedContents[s].element===e)return;s+=1}this.animatedContents.push({fn:Gt.createRenderFunction(t),element:e,data:t})},re.prototype.setElementStyles=function(t){var e,s=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||s.push(this.stylesList[e])},re.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},re.prototype.searchShapes=function(t,e,s,i,a,r,n){var h,o,l,p,f,m,d=[].concat(r),c=t.length-1,u=[],g=[];for(h=c;0<=h;h-=1){if((m=this.searchProcessedElement(t[h]))?e[h]=s[m-1]:t[h]._render=n,"fl"===t[h].ty||"st"===t[h].ty||"gf"===t[h].ty||"gs"===t[h].ty)m?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],a),t[h]._render&&i.appendChild(e[h].style.pElem),u.push(e[h].style);else if("gr"===t[h].ty){if(m)for(l=e[h].it.length,o=0;o<l;o+=1)e[h].prevViewData[o]=e[h].it[o];else e[h]=this.createGroupElement(t[h]);this.searchShapes(t[h].it,e[h].it,e[h].prevViewData,e[h].gr,a+1,d,n),t[h]._render&&i.appendChild(e[h].gr)}else"tr"===t[h].ty?(m||(e[h]=this.createTransformElement(t[h],i)),p=e[h].transform,d.push(p)):"sh"===t[h].ty||"rc"===t[h].ty||"el"===t[h].ty||"sr"===t[h].ty?(m||(e[h]=this.createShapeElement(t[h],d,a)),this.setElementStyles(e[h])):"tm"===t[h].ty||"rd"===t[h].ty||"ms"===t[h].ty||"pb"===t[h].ty?(m?(f=e[h]).closed=!1:((f=H.getModifier(t[h].ty)).init(this,t[h]),e[h]=f,this.shapeModifiers.push(f)),g.push(f)):"rp"===t[h].ty&&(m?(f=e[h]).closed=!0:(f=H.getModifier(t[h].ty),(e[h]=f).init(this,t,h,e),this.shapeModifiers.push(f),n=!1),g.push(f));this.addProcessedElement(t[h],h+1)}for(c=u.length,h=0;h<c;h+=1)u[h].closed=!0;for(c=g.length,h=0;h<c;h+=1)g[h].closed=!0},re.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},re.prototype.renderShape=function(){var t,e,s=this.animatedContents.length;for(t=0;t<s;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},re.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null};var ne=[];function he(){}var oe=function(){var t={},a=[],i=0,r=0,n=0,h=!0,o=!1;function s(t){for(var e=0,s=t.target;e<r;)a[e].animation===s&&(a.splice(e,1),e-=1,r-=1,s.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var s=0;s<r;){if(a[s].elem===t&&null!==a[s].elem)return a[s].animation;s+=1}var i=new le;return m(i,t),i.setData(t,e),i}function p(){n+=1,c()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",s),t.addEventListener("_active",p),t.addEventListener("_idle",f),a.push({elem:e,animation:t}),r+=1}function d(t){var e,s=t-i;for(e=0;e<r;e+=1)a[e].animation.advanceTime(s);i=t,n&&!o?window.requestAnimationFrame(d):h=!0}function e(t){i=t,window.requestAnimationFrame(d)}function c(){!o&&n&&h&&(window.requestAnimationFrame(e),h=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new le;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setSpeed(t,e)},t.setDirection=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.togglePause(t)},t.searchAnimations=function(t,e,s){var i,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),r=a.length;for(i=0;i<r;i+=1)s&&a[i].setAttribute("data-bm-type",s),l(a[i],t);if(e&&0===r){s||(s="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var h=w("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",s),n.appendChild(h),l(h,t)}},t.resize=function(){var t;for(t=0;t<r;t+=1)a[t].animation.resize()},t.goToAndStop=function(t,e,s){var i;for(i=0;i<r;i+=1)a[i].animation.goToAndStop(t,e,s)},t.destroy=function(t){var e;for(e=r-1;0<=e;e-=1)a[e].animation.destroy(t)},t.freeze=function(){o=!0},t.unfreeze=function(){o=!1,c()},t.setVolume=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=a.length,s=[];for(t=0;t<e;t+=1)s.push(a[t].animation);return s},t}(),le=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=S(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=i,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface={},this.imagePreloader=new rt,this.audioController=at()};function pe(){this.effectElements=[]}M([x],le),le.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new Et(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),ot.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},le.prototype.setData=function(t,e){e&&"object"!=typeof e&&(e=JSON.parse(e));var s={wrapper:t,animationData:e},i=t.attributes;s.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",s.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";"false"===a?s.loop=!1:"true"===a?s.loop=!0:""!==a&&(s.loop=parseInt(a,10));var r=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;s.autoplay="false"!==r,s.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(s.prerender=!1),this.setParams(s)},le.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,s,i=this.animationData.layers,a=i.length,r=t.layers,n=r.length;for(s=0;s<n;s+=1)for(e=0;e<a;){if(i[e].id===r[s].id){i[e]=r[s];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,L.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),h&&h.initExpressions(this),this.loadNextSegment()},le.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,ot.load(s,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},le.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},le.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},le.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},le.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},le.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},le.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,L.completeData(this.animationData,this.renderer.globalData.fontManager),h&&h.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},le.prototype.resize=function(){this.renderer.updateContainerSize()},le.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},le.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},le.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},le.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},le.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},le.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},le.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},le.prototype.goToAndStop=function(t,e,s){s&&this.name!==s||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},le.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},le.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(s=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},le.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},le.prototype.setSegment=function(t,e){var s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==s&&this.goToAndStop(s,!0)},le.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var s,i=t.length;for(s=0;s<i;s+=1)this.segments.push(t[s])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},le.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},le.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},le.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},le.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},le.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},le.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},le.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},le.prototype.getVolume=function(){return this.audioController.getVolume()},le.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},le.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},le.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},le.prototype.getPath=function(){return this.path},le.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},le.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;e<s;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},le.prototype.hide=function(){this.renderer.hide()},le.prototype.show=function(){this.renderer.show()},le.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},le.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new o(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new p(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new l(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new d(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new c(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new o(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new p(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new l(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new d(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new c(t,this))},le.prototype.triggerRenderFrameError=function(t){var e=new u(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},le.prototype.triggerConfigError=function(t){var e=new g(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var lottie={};function fe(){!0===de?oe.searchAnimations(ce,de,ue):oe.searchAnimations()}lottie.play=oe.play,lottie.pause=oe.pause,lottie.setLocationHref=function(t){A=t},lottie.togglePause=oe.togglePause,lottie.setSpeed=oe.setSpeed,lottie.setDirection=oe.setDirection,lottie.stop=oe.stop,lottie.searchAnimations=fe,lottie.registerAnimation=oe.registerAnimation,lottie.loadAnimation=function(t){return!0===de&&(t.animationData=JSON.parse(ce)),oe.loadAnimation(t)},lottie.setSubframeRendering=function(t){i=t},lottie.resize=oe.resize,lottie.goToAndStop=oe.goToAndStop,lottie.destroy=oe.destroy,lottie.setQuality=function(t){if("string"==typeof t)switch(t){case"high":P=200;break;default:case"medium":P=50;break;case"low":P=10}else!isNaN(t)&&1<t&&(P=t);r(!(50<=P))},lottie.inBrowser=function(){return"undefined"!=typeof navigator},lottie.installPlugin=function(t,e){"expressions"===t&&(h=e)},lottie.freeze=oe.freeze,lottie.unfreeze=oe.unfreeze,lottie.setVolume=oe.setVolume,lottie.mute=oe.mute,lottie.unmute=oe.unmute,lottie.getRegisteredAnimations=oe.getRegisteredAnimations,lottie.__getFactory=function(t){switch(t){case"propertyFactory":return R;case"shapePropertyFactory":return Y;case"matrix":return I;default:return null}},lottie.version="5.7.6";var me,de="__[STANDALONE]__",ce="__[ANIMATIONDATA]__",ue="";if(de){var ge=document.getElementsByTagName("script"),ye=ge[ge.length-1]||{src:""};me=ye.src.replace(/^[^\?]+\??/,""),ue=function(t){for(var e=me.split("&"),s=0;s<e.length;s+=1){var i=e[s].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}return null}("renderer")}var ve=setInterval(function(){"complete"===document.readyState&&(clearInterval(ve),fe())},100);
 return lottie;
 }));
\ No newline at end of file
diff --git a/build/player/lottie_light_canvas.js b/build/player/lottie_light_canvas.js
index d5f57fe..d06abd3 100644
--- a/build/player/lottie_light_canvas.js
+++ b/build/player/lottie_light_canvas.js
@@ -10,360 +10,399 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";
-var svgNS = "http://www.w3.org/2000/svg";
+	/* global locationHref:writable, animationManager, subframeEnabled:writable, defaultCurveSegments:writable, roundValues,
+expressionsPlugin:writable, PropertyFactory, ShapePropertyFactory, Matrix */
+/* exported locationHref, subframeEnabled, expressionsPlugin */
+
+'use strict';
+
+/* exported svgNS, locationHref, initialDefaultFrame */
+
+var svgNS = 'http://www.w3.org/2000/svg';
 
 var locationHref = '';
 
 var initialDefaultFrame = -999999;
 
+/* global createSizedArray */
+/* exported subframeEnabled, expressionsPlugin, isSafari, cachedColors, bmPow, bmSqrt, bmFloor, bmMax, bmMin, ProjectInterface,
+defaultCurveSegments, degToRads, roundCorner, bmRnd, styleDiv, BMEnterFrameEvent, BMCompleteEvent, BMCompleteLoopEvent,
+BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, BMAnimationConfigErrorEvent, createElementID,
+addSaturationToRGB, addBrightnessToRGB, addHueToRGB, rgbToHex */
+
 var subframeEnabled = true;
 var expressionsPlugin;
 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
+var bmRnd;
+var bmPow = Math.pow;
+var bmSqrt = Math.sqrt;
+var bmFloor = Math.floor;
+var bmMax = Math.max;
+var bmMin = Math.min;
 
 var BMMath = {};
-(function(){
-    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"];
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
+(function () {
+  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'];
+  var i;
+  var len = propertyNames.length;
+  for (i = 0; i < len; i += 1) {
+    BMMath[propertyNames[i]] = Math[propertyNames[i]];
+  }
 }());
 
-function ProjectInterface(){return {};}
+function ProjectInterface() { return {}; }
 
 BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = createSizedArray(val.length);
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
+BMMath.abs = function (val) {
+  var tOfVal = typeof val;
+  if (tOfVal === 'object' && val.length) {
+    var absArr = createSizedArray(val.length);
+    var i;
+    var len = val.length;
+    for (i = 0; i < len; i += 1) {
+      absArr[i] = Math.abs(val[i]);
     }
-    return Math.abs(val);
-
+    return absArr;
+  }
+  return Math.abs(val);
 };
 var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
+var degToRads = Math.PI / 180;
 var roundCorner = 0.5519;
 
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
+function roundValues(flag) {
+  if (flag) {
+    bmRnd = Math.round;
+  } else {
+    bmRnd = function (val) {
+      return val;
+    };
+  }
 }
 roundValues(false);
 
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
+function styleDiv(element) {
+  element.style.position = 'absolute';
+  element.style.top = 0;
+  element.style.left = 0;
+  element.style.display = 'block';
+  element.style.transformOrigin = '0 0';
+  element.style.webkitTransformOrigin = '0 0';
+  element.style.backfaceVisibility = 'visible';
+  element.style.webkitBackfaceVisibility = 'visible';
+  element.style.transformStyle = 'preserve-3d';
+  element.style.webkitTransformStyle = 'preserve-3d';
+  element.style.mozTransformStyle = 'preserve-3d';
 }
 
-function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
-    this.type = type;
-    this.currentTime = currentTime;
-    this.totalTime = totalTime;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
+  this.type = type;
+  this.currentTime = currentTime;
+  this.totalTime = totalTime;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteEvent(type, frameMultiplier){
-    this.type = type;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteEvent(type, frameMultiplier) {
+  this.type = type;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
-    this.type = type;
-    this.currentLoop = currentLoop;
-    this.totalLoops = totalLoops;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
+  this.type = type;
+  this.currentLoop = currentLoop;
+  this.totalLoops = totalLoops;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMSegmentStartEvent(type, firstFrame, totalFrames){
-    this.type = type;
-    this.firstFrame = firstFrame;
-    this.totalFrames = totalFrames;
+function BMSegmentStartEvent(type, firstFrame, totalFrames) {
+  this.type = type;
+  this.firstFrame = firstFrame;
+  this.totalFrames = totalFrames;
 }
 
-function BMDestroyEvent(type, target){
-    this.type = type;
-    this.target = target;
+function BMDestroyEvent(type, target) {
+  this.type = type;
+  this.target = target;
 }
 
 function BMRenderFrameErrorEvent(nativeError, currentTime) {
-    this.type = 'renderFrameError';
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = 'renderFrameError';
+  this.nativeError = nativeError;
+  this.currentTime = currentTime;
 }
 
 function BMConfigErrorEvent(nativeError) {
-    this.type = 'configError';
-    this.nativeError = nativeError;
+  this.type = 'configError';
+  this.nativeError = nativeError;
 }
 
 function BMAnimationConfigErrorEvent(type, nativeError) {
-    this.type = type;
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = type;
+  this.nativeError = nativeError;
 }
 
-var createElementID = (function(){
-    var _count = 0;
-    return function createID() {
-        return '__lottie_element_' + ++_count
-    }
-}())
+var createElementID = (function () {
+  var _count = 0;
+  return function createID() {
+    _count += 1;
+    return '__lottie_element_' + _count;
+  };
+}());
 
 function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v; g = t; b = p; break;
-        case 1: r = q; g = v; b = p; break;
-        case 2: r = p; g = v; b = t; break;
-        case 3: r = p; g = q; b = v; break;
-        case 4: r = t; g = p; b = v; break;
-        case 5: r = v; g = p; b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
+  var r;
+  var g;
+  var b;
+  var i;
+  var f;
+  var p;
+  var q;
+  var t;
+  i = Math.floor(h * 6);
+  f = h * 6 - i;
+  p = v * (1 - s);
+  q = v * (1 - f * s);
+  t = v * (1 - (1 - f) * s);
+  switch (i % 6) {
+    case 0: r = v; g = t; b = p; break;
+    case 1: r = q; g = v; b = p; break;
+    case 2: r = p; g = v; b = t; break;
+    case 3: r = p; g = q; b = v; break;
+    case 4: r = t; g = p; b = v; break;
+    case 5: r = v; g = p; b = q; break;
+    default: break;
+  }
+  return [r,
+    g,
+    b];
 }
 
 function RGBtoHSV(r, g, b) {
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
+  var max = Math.max(r, g, b);
+  var min = Math.min(r, g, b);
+  var d = max - min;
+  var h;
+  var s = (max === 0 ? 0 : d / max);
+  var v = max / 255;
 
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
+  switch (max) {
+    case min: h = 0; break;
+    case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break;
+    case g: h = (b - r) + d * 2; h /= 6 * d; break;
+    case b: h = (r - g) + d * 4; h /= 6 * d; break;
+    default: break;
+  }
 
-    return [
-         h,
-         s,
-         v
-    ];
+  return [
+    h,
+    s,
+    v,
+  ];
 }
 
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addSaturationToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[1] += offset;
+  if (hsv[1] > 1) {
+    hsv[1] = 1;
+  } else if (hsv[1] <= 0) {
+    hsv[1] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addBrightnessToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[2] += offset;
+  if (hsv[2] > 1) {
+    hsv[2] = 1;
+  } else if (hsv[2] < 0) {
+    hsv[2] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addHueToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[0] += offset / 360;
+  if (hsv[0] > 1) {
+    hsv[0] -= 1;
+  } else if (hsv[0] < 0) {
+    hsv[0] += 1;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
+var rgbToHex = (function () {
+  var colorMap = [];
+  var i;
+  var hex;
+  for (i = 0; i < 256; i += 1) {
+    hex = i.toString(16);
+    colorMap[i] = hex.length === 1 ? '0' + hex : hex;
+  }
 
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
+  return function (r, g, b) {
+    if (r < 0) {
+      r = 0;
+    }
+    if (g < 0) {
+      g = 0;
+    }
+    if (b < 0) {
+      b = 0;
+    }
+    return '#' + colorMap[r] + colorMap[g] + colorMap[b];
+  };
 }());
-function BaseEvent(){}
-BaseEvent.prototype = {
-	triggerEvent: function (eventName, args) {
-	    if (this._cbs[eventName]) {
-	        var len = this._cbs[eventName].length;
-	        for (var i = 0; i < len; i++){
-	            this._cbs[eventName][i](args);
-	        }
-	    }
-	},
-	addEventListener: function (eventName, callback) {
-	    if (!this._cbs[eventName]){
-	        this._cbs[eventName] = [];
-	    }
-	    this._cbs[eventName].push(callback);
 
-		return function() {
-			this.removeEventListener(eventName, callback);
-		}.bind(this);
-	},
-	removeEventListener: function (eventName,callback){
-	    if (!callback){
-	        this._cbs[eventName] = null;
-	    }else if(this._cbs[eventName]){
-	        var i = 0, len = this._cbs[eventName].length;
-	        while(i<len){
-	            if(this._cbs[eventName][i] === callback){
-	                this._cbs[eventName].splice(i,1);
-	                i -=1;
-	                len -= 1;
-	            }
-	            i += 1;
-	        }
-	        if(!this._cbs[eventName].length){
-	            this._cbs[eventName] = null;
-	        }
-	    }
-	}
+function BaseEvent() {}
+BaseEvent.prototype = {
+  triggerEvent: function (eventName, args) {
+    if (this._cbs[eventName]) {
+      var len = this._cbs[eventName].length;
+      for (var i = 0; i < len; i += 1) {
+        this._cbs[eventName][i](args);
+      }
+    }
+  },
+  addEventListener: function (eventName, callback) {
+    if (!this._cbs[eventName]) {
+      this._cbs[eventName] = [];
+    }
+    this._cbs[eventName].push(callback);
+
+    return function () {
+      this.removeEventListener(eventName, callback);
+    }.bind(this);
+  },
+  removeEventListener: function (eventName, callback) {
+    if (!callback) {
+      this._cbs[eventName] = null;
+    } else if (this._cbs[eventName]) {
+      var i = 0;
+      var len = this._cbs[eventName].length;
+      while (i < len) {
+        if (this._cbs[eventName][i] === callback) {
+          this._cbs[eventName].splice(i, 1);
+          i -= 1;
+          len -= 1;
+        }
+        i += 1;
+      }
+      if (!this._cbs[eventName].length) {
+        this._cbs[eventName] = null;
+      }
+    }
+  },
 };
-var createTypedArray = (function(){
-	function createRegularArray(type, len){
-		var i = 0, arr = [], value;
-		switch(type) {
-			case 'int16':
-			case 'uint8c':
-				value = 1;
-				break;
-			default:
-				value = 1.1;
-				break;
-		}
-		for(i = 0; i < len; i += 1) {
-			arr.push(value);
-		}
-		return arr;
-	}
-	function createTypedArray(type, len){
-		if(type === 'float32') {
-			return new Float32Array(len);
-		} else if(type === 'int16') {
-			return new Int16Array(len);
-		} else if(type === 'uint8c') {
-			return new Uint8ClampedArray(len);
-		}
-	}
-	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
-		return createTypedArray;
-	} else {
-		return createRegularArray;
-	}
+
+/* exported createTypedArray, createSizedArray */
+
+var createTypedArray = (function () {
+  function createRegularArray(type, len) {
+    var i = 0;
+    var arr = [];
+    var value;
+    switch (type) {
+      case 'int16':
+      case 'uint8c':
+        value = 1;
+        break;
+      default:
+        value = 1.1;
+        break;
+    }
+    for (i = 0; i < len; i += 1) {
+      arr.push(value);
+    }
+    return arr;
+  }
+  function createTypedArrayFactory(type, len) {
+    if (type === 'float32') {
+      return new Float32Array(len);
+    } if (type === 'int16') {
+      return new Int16Array(len);
+    } if (type === 'uint8c') {
+      return new Uint8ClampedArray(len);
+    }
+    return createRegularArray(type, len);
+  }
+  if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+    return createTypedArrayFactory;
+  }
+  return createRegularArray;
 }());
 
 function createSizedArray(len) {
-	return Array.apply(null,{length:len});
+  return Array.apply(null, { length: len });
 }
+
+/* exported createTag */
+
 function createTag(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElement(type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElement(type);
 }
-function DynamicPropertyContainer(){};
+
+function DynamicPropertyContainer() {}
 DynamicPropertyContainer.prototype = {
-	addDynamicProperty: function(prop) {
-		if(this.dynamicProperties.indexOf(prop) === -1) {
-	        this.dynamicProperties.push(prop);
-	        this.container.addDynamicProperty(this);
-	    	this._isAnimated = true;
-	    }
-	},
-	iterateDynamicProperties: function(){
-	    this._mdf = false;
-	    var i, len = this.dynamicProperties.length;
-	    for(i=0;i<len;i+=1){
-	        this.dynamicProperties[i].getValue();
-	        if(this.dynamicProperties[i]._mdf) {
-	            this._mdf = true;
-	        }
-	    }
-	},
-	initDynamicPropertyContainer: function(container){
-	    this.container = container;
-	    this.dynamicProperties = [];
-	    this._mdf = false;
-	    this._isAnimated = false;
-	}
-}
-var getBlendMode = (function() {
-
-	var blendModeEnums = {
-        0:'source-over',
-        1:'multiply',
-        2:'screen',
-        3:'overlay',
-        4:'darken',
-        5:'lighten',
-        6:'color-dodge',
-        7:'color-burn',
-        8:'hard-light',
-        9:'soft-light',
-        10:'difference',
-        11:'exclusion',
-        12:'hue',
-        13:'saturation',
-        14:'color',
-        15:'luminosity'
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+      this.container.addDynamicProperty(this);
+      this._isAnimated = true;
     }
+  },
+  iterateDynamicProperties: function () {
+    this._mdf = false;
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      this.dynamicProperties[i].getValue();
+      if (this.dynamicProperties[i]._mdf) {
+        this._mdf = true;
+      }
+    }
+  },
+  initDynamicPropertyContainer: function (container) {
+    this.container = container;
+    this.dynamicProperties = [];
+    this._mdf = false;
+    this._isAnimated = false;
+  },
+};
 
-	return function(mode) {
-		return blendModeEnums[mode] || '';
-	}
-}())
+/* exported getBlendMode */
+
+var getBlendMode = (function () {
+  var blendModeEnums = {
+    0: 'source-over',
+    1: 'multiply',
+    2: 'screen',
+    3: 'overlay',
+    4: 'darken',
+    5: 'lighten',
+    6: 'color-dodge',
+    7: 'color-burn',
+    8: 'hard-light',
+    9: 'soft-light',
+    10: 'difference',
+    11: 'exclusion',
+    12: 'hue',
+    13: 'saturation',
+    14: 'color',
+    15: 'luminosity',
+  };
+
+  return function (mode) {
+    return blendModeEnums[mode] || '';
+  };
+}());
+
+/* global createTypedArray */
+
 /*!
  Transformation Matrix v2.0
  (c) Epistemex 2014-2015
@@ -393,394 +432,399 @@
  * @constructor
  */
 
-var Matrix = (function(){
+var Matrix = (function () {
+  var _cos = Math.cos;
+  var _sin = Math.sin;
+  var _tan = Math.tan;
+  var _rnd = Math.round;
 
-    var _cos = Math.cos;
-    var _sin = Math.sin;
-    var _tan = Math.tan;
-    var _rnd = Math.round;
+  function reset() {
+    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;
+    return this;
+  }
 
-    function reset(){
-        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;
-        return this;
+  function rotate(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function rotateX(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateY(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateZ(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function shear(sx, sy) {
+    return this._t(1, sy, sx, 1, 0, 0);
+  }
+
+  function skew(ax, ay) {
+    return this.shear(_tan(ax), _tan(ay));
+  }
+
+  function skewFromAxis(ax, angle) {
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    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);
+  }
+
+  function scale(sx, sy, sz) {
+    if (!sz && sz !== 0) {
+      sz = 1;
+    }
+    if (sx === 1 && sy === 1 && sz === 1) {
+      return this;
+    }
+    return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
+  }
+
+  function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
+    this.props[0] = a;
+    this.props[1] = b;
+    this.props[2] = c;
+    this.props[3] = d;
+    this.props[4] = e;
+    this.props[5] = f;
+    this.props[6] = g;
+    this.props[7] = h;
+    this.props[8] = i;
+    this.props[9] = j;
+    this.props[10] = k;
+    this.props[11] = l;
+    this.props[12] = m;
+    this.props[13] = n;
+    this.props[14] = o;
+    this.props[15] = p;
+    return this;
+  }
+
+  function translate(tx, ty, tz) {
+    tz = tz || 0;
+    if (tx !== 0 || ty !== 0 || tz !== 0) {
+      return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
+    }
+    return this;
+  }
+
+  function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
+    var _p = this.props;
+
+    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) {
+      // NOTE: commenting this condition because TurboFan deoptimizes code when present
+      // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+      _p[12] = _p[12] * a2 + _p[15] * m2;
+      _p[13] = _p[13] * f2 + _p[15] * n2;
+      _p[14] = _p[14] * k2 + _p[15] * o2;
+      _p[15] *= p2;
+      // }
+      this._identityCalculated = false;
+      return this;
     }
 
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
+    var a1 = _p[0];
+    var b1 = _p[1];
+    var c1 = _p[2];
+    var d1 = _p[3];
+    var e1 = _p[4];
+    var f1 = _p[5];
+    var g1 = _p[6];
+    var h1 = _p[7];
+    var i1 = _p[8];
+    var j1 = _p[9];
+    var k1 = _p[10];
+    var l1 = _p[11];
+    var m1 = _p[12];
+    var n1 = _p[13];
+    var o1 = _p[14];
+    var p1 = _p[15];
 
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(_tan(ax), _tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        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);
-    }
-
-    function scale(sx, sy, sz) {
-        if(!sz && sz !== 0) {
-            sz = 1;
-        }
-        if(sx === 1 && sy === 1 && sz === 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        var _p = this.props;
-
-        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){
-            //NOTE: commenting this condition because TurboFan deoptimizes code when present
-            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-                _p[12] = _p[12] * a2 + _p[15] * m2;
-                _p[13] = _p[13] * f2 + _p[15] * n2;
-                _p[14] = _p[14] * k2 + _p[15] * o2;
-                _p[15] = _p[15] * p2;
-            //}
-            this._identityCalculated = false;
-            return this;
-        }
-
-        var a1 = _p[0];
-        var b1 = _p[1];
-        var c1 = _p[2];
-        var d1 = _p[3];
-        var e1 = _p[4];
-        var f1 = _p[5];
-        var g1 = _p[6];
-        var h1 = _p[7];
-        var i1 = _p[8];
-        var j1 = _p[9];
-        var k1 = _p[10];
-        var l1 = _p[11];
-        var m1 = _p[12];
-        var n1 = _p[13];
-        var o1 = _p[14];
-        var p1 = _p[15];
-
-        /* matrix order (canvas compatible):
+    /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+    _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+    _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
+    _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
+    _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
 
-        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+    _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
+    _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
+    _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
+    _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
 
-        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+    _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
+    _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
+    _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
+    _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
 
-        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+    _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
+    _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
+    _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
+    _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
 
-        this._identityCalculated = false;
-        return this;
+    this._identityCalculated = false;
+    return this;
+  }
+
+  function isIdentity() {
+    if (!this._identityCalculated) {
+      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);
+      this._identityCalculated = true;
     }
+    return this._identity;
+  }
 
-    function isIdentity() {
-        if(!this._identityCalculated){
-            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);
-            this._identityCalculated = true;
-        }
-        return this._identity;
+  function equals(matr) {
+    var i = 0;
+    while (i < 16) {
+      if (matr.props[i] !== this.props[i]) {
+        return false;
+      }
+      i += 1;
     }
+    return true;
+  }
 
-    function equals(matr){
-        var i = 0;
-        while (i < 16) {
-            if(matr.props[i] !== this.props[i]) {
-                return false;
-            }
-            i+=1;
-        }
-        return true;
+  function clone(matr) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      matr.props[i] = this.props[i];
     }
+    return matr;
+  }
 
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-        return matr;
+  function cloneFromProps(props) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      this.props[i] = props[i];
     }
+  }
 
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
+  function applyToPoint(x, y, z) {
+    return {
+      x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
+      y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
+      z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14],
+    };
+    /* return {
          x: x * me.a + y * me.c + me.e,
          y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
+         }; */
+  }
+  function applyToX(x, y, z) {
+    return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
+  }
+  function applyToY(x, y, z) {
+    return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
+  }
+  function applyToZ(x, y, z) {
+    return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
+  }
 
-    function getInverseMatrix() {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        var inverseMatrix = new Matrix();
-        inverseMatrix.props[0] = a;
-        inverseMatrix.props[1] = b;
-        inverseMatrix.props[4] = c;
-        inverseMatrix.props[5] = d;
-        inverseMatrix.props[12] = e;
-        inverseMatrix.props[13] = f;
-        return inverseMatrix;
-    }
+  function getInverseMatrix() {
+    var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
+    var a = this.props[5] / determinant;
+    var b = -this.props[1] / determinant;
+    var c = -this.props[4] / determinant;
+    var d = this.props[0] / determinant;
+    var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
+    var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
+    var inverseMatrix = new Matrix();
+    inverseMatrix.props[0] = a;
+    inverseMatrix.props[1] = b;
+    inverseMatrix.props[4] = c;
+    inverseMatrix.props[5] = d;
+    inverseMatrix.props[12] = e;
+    inverseMatrix.props[13] = f;
+    return inverseMatrix;
+  }
 
-    function inversePoint(pt) {
-        var inverseMatrix = this.getInverseMatrix();
-        return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
-    }
+  function inversePoint(pt) {
+    var inverseMatrix = this.getInverseMatrix();
+    return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
+  }
 
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
+  function inversePoints(pts) {
+    var i;
+    var len = pts.length;
+    var retPts = [];
+    for (i = 0; i < len; i += 1) {
+      retPts[i] = inversePoint(pts[i]);
     }
+    return retPts;
+  }
 
-    function applyToTriplePoints(pt1, pt2, pt3) {
-        var arr = createTypedArray('float32', 6);
-        if(this.isIdentity()) {
-            arr[0] = pt1[0];
-            arr[1] = pt1[1];
-            arr[2] = pt2[0];
-            arr[3] = pt2[1];
-            arr[4] = pt3[0];
-            arr[5] = pt3[1];
-        } else {
-            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
-            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
-            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
-            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
-            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
-            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
-            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
-        }
-        return arr;
+  function applyToTriplePoints(pt1, pt2, pt3) {
+    var arr = createTypedArray('float32', 6);
+    if (this.isIdentity()) {
+      arr[0] = pt1[0];
+      arr[1] = pt1[1];
+      arr[2] = pt2[0];
+      arr[3] = pt2[1];
+      arr[4] = pt3[0];
+      arr[5] = pt3[1];
+    } else {
+      var p0 = this.props[0];
+      var p1 = this.props[1];
+      var p4 = this.props[4];
+      var p5 = this.props[5];
+      var p12 = this.props[12];
+      var p13 = this.props[13];
+      arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+      arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+      arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+      arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+      arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+      arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
     }
+    return arr;
+  }
 
-    function applyToPointArray(x,y,z){
-        var arr;
-        if(this.isIdentity()) {
-            arr = [x,y,z];
-        } else {
-            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]
-            ];
-        }
-        return arr;
+  function applyToPointArray(x, y, z) {
+    var arr;
+    if (this.isIdentity()) {
+      arr = [x, y, z];
+    } else {
+      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],
+      ];
     }
+    return arr;
+  }
 
-    function applyToPointStringified(x, y) {
-        if(this.isIdentity()) {
-            return x + ',' + y;
-        }
-        var _p = this.props;
-        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;
+  function applyToPointStringified(x, y) {
+    if (this.isIdentity()) {
+      return x + ',' + y;
     }
+    var _p = this.props;
+    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;
+  }
 
-    function toCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function toCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var i = 0;
-        var props = this.props;
-        var cssValue = 'matrix3d(';
-        var v = 10000;
-        while(i<16){
-            cssValue += _rnd(props[i]*v)/v;
-            cssValue += i === 15 ? ')':',';
-            i += 1;
-        }
-        return cssValue;
+        } */
+    var i = 0;
+    var props = this.props;
+    var cssValue = 'matrix3d(';
+    var v = 10000;
+    while (i < 16) {
+      cssValue += _rnd(props[i] * v) / v;
+      cssValue += i === 15 ? ')' : ',';
+      i += 1;
     }
+    return cssValue;
+  }
 
-    function roundMatrixProperty(val) {
-        var v = 10000;
-        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
-            return _rnd(val * v) / v;
-        }
-        return val;
+  function roundMatrixProperty(val) {
+    var v = 10000;
+    if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+      return _rnd(val * v) / v;
     }
+    return val;
+  }
 
-    function to2dCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function to2dCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var props = this.props;
-        var _a = roundMatrixProperty(props[0]);
-        var _b = roundMatrixProperty(props[1]);
-        var _c = roundMatrixProperty(props[4]);
-        var _d = roundMatrixProperty(props[5]);
-        var _e = roundMatrixProperty(props[12]);
-        var _f = roundMatrixProperty(props[13]);
-        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
-    }
+        } */
+    var props = this.props;
+    var _a = roundMatrixProperty(props[0]);
+    var _b = roundMatrixProperty(props[1]);
+    var _c = roundMatrixProperty(props[4]);
+    var _d = roundMatrixProperty(props[5]);
+    var _e = roundMatrixProperty(props[12]);
+    var _f = roundMatrixProperty(props[13]);
+    return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
+  }
 
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToTriplePoints = applyToTriplePoints;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.equals = equals;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this.getInverseMatrix = getInverseMatrix;
-        this._t = this.transform;
-        this.isIdentity = isIdentity;
-        this._identity = true;
-        this._identityCalculated = false;
+  return function () {
+    this.reset = reset;
+    this.rotate = rotate;
+    this.rotateX = rotateX;
+    this.rotateY = rotateY;
+    this.rotateZ = rotateZ;
+    this.skew = skew;
+    this.skewFromAxis = skewFromAxis;
+    this.shear = shear;
+    this.scale = scale;
+    this.setTransform = setTransform;
+    this.translate = translate;
+    this.transform = transform;
+    this.applyToPoint = applyToPoint;
+    this.applyToX = applyToX;
+    this.applyToY = applyToY;
+    this.applyToZ = applyToZ;
+    this.applyToPointArray = applyToPointArray;
+    this.applyToTriplePoints = applyToTriplePoints;
+    this.applyToPointStringified = applyToPointStringified;
+    this.toCSS = toCSS;
+    this.to2dCSS = to2dCSS;
+    this.clone = clone;
+    this.cloneFromProps = cloneFromProps;
+    this.equals = equals;
+    this.inversePoints = inversePoints;
+    this.inversePoint = inversePoint;
+    this.getInverseMatrix = getInverseMatrix;
+    this._t = this.transform;
+    this.isIdentity = isIdentity;
+    this._identity = true;
+    this._identityCalculated = false;
 
-        this.props = createTypedArray('float32', 16);
-        this.reset();
-    };
+    this.props = createTypedArray('float32', 16);
+    this.reset();
+  };
 }());
 
+/* eslint-disable */
 /*
  Copyright 2014 David Bau.
 
@@ -1014,8 +1058,9 @@
     [],     // pool: entropy pool starts empty
     BMMath    // math: package containing random, pow, and seedrandom
 );
-var BezierFactory = (function(){
-    /**
+/* eslint-disable */
+var BezierFactory = (function () {
+  /**
      * BezierEasing - use bezier curve for transition easing function
      * by Gaëtan Renaudeau 2014 - 2015 – MIT License
      *
@@ -1026,6803 +1071,7182 @@
      *
      */
 
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
+  var ob = {};
+  ob.getBezierEasing = getBezierEasing;
+  var beziers = {};
 
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
+  function getBezierEasing(a, b, c, d, nm) {
+    var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
+    if (beziers[str]) {
+      return beziers[str];
     }
+    var bezEasing = new BezierEasing([a, b, c, d]);
+    beziers[str] = bezEasing;
+    return bezEasing;
+  }
 
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
+  // These values are established by empiricism with tests (tradeoff: performance VS precision)
+  var NEWTON_ITERATIONS = 4;
+  var NEWTON_MIN_SLOPE = 0.001;
+  var SUBDIVISION_PRECISION = 0.0000001;
+  var SUBDIVISION_MAX_ITERATIONS = 10;
 
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+  var kSplineTableSize = 11;
+  var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
 
-    var float32ArraySupported = typeof Float32Array === "function";
+  var float32ArraySupported = typeof Float32Array === 'function';
 
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
+  function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+  function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+  function C(aA1) { return 3.0 * aA1; }
 
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
+  // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+  function calcBezier(aT, aA1, aA2) {
+    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
+  }
+
+  // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+  function getSlope(aT, aA1, aA2) {
+    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
+  }
+
+  function binarySubdivide(aX, aA, aB, mX1, mX2) {
+    var currentX,
+      currentT,
+      i = 0;
+    do {
+      currentT = aA + (aB - aA) / 2.0;
+      currentX = calcBezier(currentT, mX1, mX2) - aX;
+      if (currentX > 0.0) {
+        aB = currentT;
+      } else {
+        aA = currentT;
+      }
+    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+    return currentT;
+  }
+
+  function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
+    for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+      var currentSlope = getSlope(aGuessT, mX1, mX2);
+      if (currentSlope === 0.0) return aGuessT;
+      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+      aGuessT -= currentX / currentSlope;
     }
+    return aGuessT;
+  }
 
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
+  /**
      * points is an array of [ mX1, mY1, mX2, mY2 ]
      */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
+  function BezierEasing(points) {
+    this._p = points;
+    this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+    this._precomputed = false;
 
-        this.get = this.get.bind(this);
-    }
+    this.get = this.get.bind(this);
+  }
 
-    BezierEasing.prototype = {
+  BezierEasing.prototype = {
 
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
+    get: function (x) {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      if (!this._precomputed) this._precompute();
+      if (mX1 === mY1 && mX2 === mY2) return x; // linear
+      // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+      if (x === 0) return 0;
+      if (x === 1) return 1;
+      return calcBezier(this._getTForX(x), mY1, mY2);
+    },
 
-        // Private part
+    // Private part
 
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
+    _precompute: function () {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      this._precomputed = true;
+      if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); }
+    },
 
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
+    _calcSampleValues: function () {
+      var mX1 = this._p[0],
+        mX2 = this._p[2];
+      for (var i = 0; i < kSplineTableSize; ++i) {
+        this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+      }
+    },
 
-        /**
+    /**
          * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
          */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
+    _getTForX: function (aX) {
+      var mX1 = this._p[0],
+        mX2 = this._p[2],
+        mSampleValues = this._mSampleValues;
 
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
+      var intervalStart = 0.0;
+      var currentSample = 1;
+      var lastSample = kSplineTableSize - 1;
 
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
+      for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
+        intervalStart += kSampleStepSize;
+      }
+      --currentSample;
 
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
+      // Interpolate to provide an initial guess for t
+      var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
+      var guessForT = intervalStart + dist * kSampleStepSize;
 
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
+      var initialSlope = getSlope(guessForT, mX1, mX2);
+      if (initialSlope >= NEWTON_MIN_SLOPE) {
+        return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+      } if (initialSlope === 0.0) {
+        return guessForT;
+      }
+      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+    },
+  };
 
-    return ob;
-
+  return ob;
 }());
+
 (function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
+  var lastTime = 0;
+  var vendors = ['ms', 'moz', 'webkit', 'o'];
+  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { // eslint-disable-line no-plusplus
+    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
+    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
+  }
+  if (!window.requestAnimationFrame) {
+    window.requestAnimationFrame = function (callback) {
+      var currTime = new Date().getTime();
+      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+      var id = setTimeout(function () {
+        callback(currTime + timeToCall);
+      },
+      timeToCall);
+      lastTime = currTime + timeToCall;
+      return id;
+    };
+  }
+  if (!window.cancelAnimationFrame) {
+    window.cancelAnimationFrame = function (id) {
+      clearTimeout(id);
+    };
+  }
 }());
 
-function extendPrototype(sources,destination){
-    var i, len = sources.length, sourcePrototype;
-    for (i = 0;i < len;i += 1) {
-        sourcePrototype = sources[i].prototype;
-        for (var attr in sourcePrototype) {
-            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
-        }
+/* exported extendPrototype, getDescriptor, createProxyFunction */
+
+function extendPrototype(sources, destination) {
+  var i;
+  var len = sources.length;
+  var sourcePrototype;
+  for (i = 0; i < len; i += 1) {
+    sourcePrototype = sources[i].prototype;
+    for (var attr in sourcePrototype) {
+      if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
     }
+  }
 }
 
 function getDescriptor(object, prop) {
-    return Object.getOwnPropertyDescriptor(object, prop);
+  return Object.getOwnPropertyDescriptor(object, prop);
 }
 
 function createProxyFunction(prototype) {
-	function ProxyFunction(){}
-	ProxyFunction.prototype = prototype;
-	return ProxyFunction;
+  function ProxyFunction() {}
+  ProxyFunction.prototype = prototype;
+  return ProxyFunction;
 }
-function bezFunction(){
 
-    var easingFunctions = [];
-    var math = Math;
+/* global segmentsLengthPool, defaultCurveSegments, createSizedArray, bmPow, bmSqrt, bmFloor, createTypedArray, bezierLengthPool */
+/* exported bez */
 
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.001 && det1 < 0.001;
+function bezFunction() {
+  var math = Math;
+
+  function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
+    var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1);
+    return det1 > -0.001 && det1 < 0.001;
+  }
+
+  function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
+    if (z1 === 0 && z2 === 0 && z3 === 0) {
+      return pointOnLine2D(x1, y1, x2, y2, x3, y3);
     }
+    var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
+    var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
+    var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
+    var diffDist;
+    if (dist1 > dist2) {
+      if (dist1 > dist3) {
+        diffDist = dist1 - dist2 - dist3;
+      } else {
+        diffDist = dist3 - dist2 - dist1;
+      }
+    } else if (dist3 > dist2) {
+      diffDist = dist3 - dist2 - dist1;
+    } else {
+      diffDist = dist2 - dist1 - dist3;
+    }
+    return diffDist > -0.0001 && diffDist < 0.0001;
+  }
 
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        if(z1 === 0 && z2 === 0 && z3 === 0) {
-            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+  var getBezierLength = (function () {
+    return function (pt1, pt2, pt3, pt4) {
+      var curveSegments = defaultCurveSegments;
+      var k;
+      var i;
+      var len;
+      var ptCoord;
+      var perc;
+      var addedLength = 0;
+      var ptDistance;
+      var point = [];
+      var lastPoint = [];
+      var lengthData = bezierLengthPool.newElement();
+      len = pt3.length;
+      for (k = 0; k < curveSegments; k += 1) {
+        perc = k / (curveSegments - 1);
+        ptDistance = 0;
+        for (i = 0; i < len; i += 1) {
+          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];
+          point[i] = ptCoord;
+          if (lastPoint[i] !== null) {
+            ptDistance += bmPow(point[i] - lastPoint[i], 2);
+          }
+          lastPoint[i] = point[i];
         }
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
+        if (ptDistance) {
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
         }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    var getBezierLength = (function(){
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = bezier_length_pool.newElement();
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.percents[k] = perc;
-                lengthData.lengths[k] = addedLength;
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function getSegmentsLength(shapeData) {
-        var segmentsLength = segments_length_pool.newElement();
-        var closed = shapeData.c;
-        var pathV = shapeData.v;
-        var pathO = shapeData.o;
-        var pathI = shapeData.i;
-        var i, len = shapeData._length;
-        var lengths = segmentsLength.lengths;
-        var totalLength = 0;
-        for(i=0;i<len-1;i+=1){
-            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-            totalLength += lengths[i].addedLength;
-        }
-        if(closed && len){
-            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-            totalLength += lengths[i].addedLength;
-        }
-        segmentsLength.totalLength = totalLength;
-        return segmentsLength;
-    }
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (pt1, pt2, pt3, pt4){
-            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
-            if(!storedData[bezierName]){
-                var curveSegments = defaultCurveSegments;
-                var k, i, len;
-                var ptCoord,perc,addedLength = 0;
-                var ptDistance;
-                var point,lastPoint = null;
-                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])){
-                    curveSegments = 2;
-                }
-                var bezierData = new BezierData(curveSegments);
-                len = pt3.length;
-                for (k = 0; k < curveSegments; k += 1) {
-                    point = createSizedArray(len);
-                    perc = k / (curveSegments - 1);
-                    ptDistance = 0;
-                    for (i = 0; i < len; i += 1){
-                        ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                        point[i] = ptCoord;
-                        if(lastPoint !== null){
-                            ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                        }
-                    }
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                    bezierData.points[k] = new PointData(ptDistance, point);
-                    lastPoint = point;
-                }
-                bezierData.segmentLength = addedLength;
-                storedData[bezierName] = bezierData;
-            }
-            return storedData[bezierName];
-        };
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var percents = bezierData.percents;
-        var lengths = bezierData.lengths;
-        var len = percents.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
-            return percents[initPos];
-        }else{
-            var dir = lengths[initPos] > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
-                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    //FIX for TypedArrays that don't store floating point values with enough accuracy
-                    if(initPos === len - 1) {
-                        return percents[initPos];
-                    }
-                    flag = false;
-                }
-            }
-            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
-        }
-    }
-
-    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
-        var t1 = getDistancePerc(percent,bezierData);
-        var u0 = 1;
-        var u1 = 1 - t1;
-        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;
-        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;
-        return [ptX, ptY];
-    }
-
-    function getSegmentArray() {
-
-    }
-
-    var bezier_segment_points = createTypedArray('float32', 8);
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        var u0u0u0 = u0*u0*u0;
-        var t0u0u0_3 = t0*u0*u0*3;
-        var t0t0u0_3 = t0*t0*u0*3;
-        var t0t0t0 = t0*t0*t0;
-        //
-        var u0u0u1 = u0*u0*u1;
-        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
-        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
-        var t0t0t1 = t0*t0*t1;
-        //
-        var u0u1u1 = u0*u1*u1;
-        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
-        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
-        var t0t1t1 = t0*t1*t1;
-        //
-        var u1u1u1 = u1*u1*u1;
-        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
-        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
-        var t1t1t1 = t1*t1*t1;
-        for(i=0;i<len;i+=1){
-            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
-        }
-
-        return bezier_segment_points;
-    }
-
-    return {
-        getSegmentsLength : getSegmentsLength,
-        getNewSegment : getNewSegment,
-        getPointInSegment : getPointInSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
+        lengthData.percents[k] = perc;
+        lengthData.lengths[k] = addedLength;
+      }
+      lengthData.addedLength = addedLength;
+      return lengthData;
     };
+  }());
+
+  function getSegmentsLength(shapeData) {
+    var segmentsLength = segmentsLengthPool.newElement();
+    var closed = shapeData.c;
+    var pathV = shapeData.v;
+    var pathO = shapeData.o;
+    var pathI = shapeData.i;
+    var i;
+    var len = shapeData._length;
+    var lengths = segmentsLength.lengths;
+    var totalLength = 0;
+    for (i = 0; i < len - 1; i += 1) {
+      lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
+      totalLength += lengths[i].addedLength;
+    }
+    if (closed && len) {
+      lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
+      totalLength += lengths[i].addedLength;
+    }
+    segmentsLength.totalLength = totalLength;
+    return segmentsLength;
+  }
+
+  function BezierData(length) {
+    this.segmentLength = 0;
+    this.points = new Array(length);
+  }
+
+  function PointData(partial, point) {
+    this.partialLength = partial;
+    this.point = point;
+  }
+
+  var buildBezierData = (function () {
+    var storedData = {};
+
+    return function (pt1, pt2, pt3, pt4) {
+      var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
+      if (!storedData[bezierName]) {
+        var curveSegments = defaultCurveSegments;
+        var k;
+        var i;
+        var len;
+        var ptCoord;
+        var perc;
+        var addedLength = 0;
+        var ptDistance;
+        var point;
+        var lastPoint = null;
+        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])) {
+          curveSegments = 2;
+        }
+        var bezierData = new BezierData(curveSegments);
+        len = pt3.length;
+        for (k = 0; k < curveSegments; k += 1) {
+          point = createSizedArray(len);
+          perc = k / (curveSegments - 1);
+          ptDistance = 0;
+          for (i = 0; i < len; i += 1) {
+            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];
+            point[i] = ptCoord;
+            if (lastPoint !== null) {
+              ptDistance += bmPow(point[i] - lastPoint[i], 2);
+            }
+          }
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
+          bezierData.points[k] = new PointData(ptDistance, point);
+          lastPoint = point;
+        }
+        bezierData.segmentLength = addedLength;
+        storedData[bezierName] = bezierData;
+      }
+      return storedData[bezierName];
+    };
+  }());
+
+  function getDistancePerc(perc, bezierData) {
+    var percents = bezierData.percents;
+    var lengths = bezierData.lengths;
+    var len = percents.length;
+    var initPos = bmFloor((len - 1) * perc);
+    var lengthPos = perc * bezierData.addedLength;
+    var lPerc = 0;
+    if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
+      return percents[initPos];
+    }
+    var dir = lengths[initPos] > lengthPos ? -1 : 1;
+    var flag = true;
+    while (flag) {
+      if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
+        lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
+        flag = false;
+      } else {
+        initPos += dir;
+      }
+      if (initPos < 0 || initPos >= len - 1) {
+        // FIX for TypedArrays that don't store floating point values with enough accuracy
+        if (initPos === len - 1) {
+          return percents[initPos];
+        }
+        flag = false;
+      }
+    }
+    return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
+  }
+
+  function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+    var t1 = getDistancePerc(percent, bezierData);
+    var u1 = 1 - t1;
+    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;
+    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;
+    return [ptX, ptY];
+  }
+
+  var bezierSegmentPoints = createTypedArray('float32', 8);
+
+  function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
+    if (startPerc < 0) {
+      startPerc = 0;
+    } else if (startPerc > 1) {
+      startPerc = 1;
+    }
+    var t0 = getDistancePerc(startPerc, bezierData);
+    endPerc = endPerc > 1 ? 1 : endPerc;
+    var t1 = getDistancePerc(endPerc, bezierData);
+    var i;
+    var len = pt1.length;
+    var u0 = 1 - t0;
+    var u1 = 1 - t1;
+    var u0u0u0 = u0 * u0 * u0;
+    var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0t0 = t0 * t0 * t0;
+    //
+    var u0u0u1 = u0 * u0 * u1;
+    var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0t1 = t0 * t0 * t1;
+    //
+    var u0u1u1 = u0 * u1 * u1;
+    var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1t1 = t0 * t1 * t1;
+    //
+    var u1u1u1 = u1 * u1 * u1;
+    var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1t1 = t1 * t1 * t1;
+    for (i = 0; i < len; i += 1) {
+      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
+      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
+      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
+      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
+    }
+
+    return bezierSegmentPoints;
+  }
+
+  return {
+    getSegmentsLength: getSegmentsLength,
+    getNewSegment: getNewSegment,
+    getPointInSegment: getPointInSegment,
+    buildBezierData: buildBezierData,
+    pointOnLine2D: pointOnLine2D,
+    pointOnLine3D: pointOnLine3D,
+  };
 }
 
 var bez = bezFunction();
-function dataFunctionManager(){
 
-    //var tCanvasHelper = createTag('canvas').getContext('2d');
+/* exported dataManager */
 
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
+function dataFunctionManager() {
+  // var tCanvasHelper = createTag('canvas').getContext('2d');
+
+  function completeLayers(layers, comps, fontManager) {
+    var layerData;
+    var i;
+    var len = layers.length;
+    var j;
+    var jLen;
+    var k;
+    var kLen;
+    for (i = 0; i < len; i += 1) {
+      layerData = layers[i];
+      if (('ks' in layerData) && !layerData.completed) {
+        layerData.completed = true;
+        if (layerData.tt) {
+          layers[i - 1].td = layerData.tt;
         }
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              convertPathsToAbsoluteValues(maskProps[j].pt.k);
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
+                }
+              }
+            }
+          }
+        }
+        if (layerData.ty === 0) {
+          layerData.layers = findCompLayers(layerData.refId, comps);
+          completeLayers(layerData.layers, comps, fontManager);
+        } else if (layerData.ty === 4) {
+          completeShapes(layerData.shapes);
+        } else if (layerData.ty === 5) {
+          completeText(layerData, fontManager);
+        }
+      }
+    }
+  }
+
+  function findCompLayers(id, comps) {
+    var i = 0;
+    var len = comps.length;
+    while (i < len) {
+      if (comps[i].id === id) {
+        if (!comps[i].layers.__used) {
+          comps[i].layers.__used = true;
+          return comps[i].layers;
+        }
+        return JSON.parse(JSON.stringify(comps[i].layers));
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function completeShapes(arr) {
+    var i;
+    var len = arr.length;
+    var j;
+    var jLen;
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (arr[i].ty === 'sh') {
+        if (arr[i].ks.k.i) {
+          convertPathsToAbsoluteValues(arr[i].ks.k);
+        } else {
+          jLen = arr[i].ks.k.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (arr[i].ks.k[j].s) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
+            }
+            if (arr[i].ks.k[j].e) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
+            }
+          }
+        }
+      } else if (arr[i].ty === 'gr') {
+        completeShapes(arr[i].it);
+      }
+    }
+  }
+
+  function convertPathsToAbsoluteValues(path) {
+    var i;
+    var len = path.i.length;
+    for (i = 0; i < len; i += 1) {
+      path.i[i][0] += path.v[i][0];
+      path.i[i][1] += path.v[i][1];
+      path.o[i][0] += path.v[i][0];
+      path.o[i][1] += path.v[i][1];
+    }
+  }
+
+  function checkVersion(minimum, animVersionString) {
+    var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
+    if (minimum[0] > animVersion[0]) {
+      return true;
+    } if (animVersion[0] > minimum[0]) {
+      return false;
+    }
+    if (minimum[1] > animVersion[1]) {
+      return true;
+    } if (animVersion[1] > minimum[1]) {
+      return false;
+    }
+    if (minimum[2] > animVersion[2]) {
+      return true;
+    } if (animVersion[2] > minimum[2]) {
+      return false;
+    }
+    return null;
+  }
+
+  var checkText = (function () {
+    var minimumVersion = [4, 4, 14];
+
+    function updateTextLayer(textLayer) {
+      var documentData = textLayer.t.d;
+      textLayer.t.d = {
+        k: [
+          {
+            s: documentData,
+            t: 0,
+          },
+        ],
+      };
     }
 
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                if(!comps[i].layers.__used) {
-                    comps[i].layers.__used = true;
-                    return comps[i].layers;
-                }
-                return JSON.parse(JSON.stringify(comps[i].layers));
-            }
-            i += 1;
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 5) {
+          updateTextLayer(layers[i]);
         }
+      }
     }
 
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
             }
+          }
         }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
+      }
+    };
+  }());
+
+  var checkChars = (function () {
+    var minimumVersion = [4, 7, 99];
+    return function (animationData) {
+      if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
+        var i;
+        var len = animationData.chars.length;
+        var j;
+        var jLen;
+        var pathData;
+        var paths;
+        for (i = 0; i < len; i += 1) {
+          if (animationData.chars[i].data && animationData.chars[i].data.shapes) {
+            paths = animationData.chars[i].data.shapes[0].it;
+            jLen = paths.length;
+
+            for (j = 0; j < jLen; j += 1) {
+              pathData = paths[j].ks.k;
+              if (!pathData.__converted) {
+                convertPathsToAbsoluteValues(paths[j].ks.k);
+                pathData.__converted = true;
+              }
+            }
+          }
+        }
+      }
+    };
+  }());
+
+  var checkColors = (function () {
+    var minimumVersion = [4, 1, 9];
+
+    function iterateShapes(shapes) {
+      var i;
+      var len = shapes.length;
+      var j;
+      var jLen;
+      for (i = 0; i < len; i += 1) {
+        if (shapes[i].ty === 'gr') {
+          iterateShapes(shapes[i].it);
+        } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
+          if (shapes[i].c.k && shapes[i].c.k[0].i) {
+            jLen = shapes[i].c.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (shapes[i].c.k[j].s) {
+                shapes[i].c.k[j].s[0] /= 255;
+                shapes[i].c.k[j].s[1] /= 255;
+                shapes[i].c.k[j].s[2] /= 255;
+                shapes[i].c.k[j].s[3] /= 255;
+              }
+              if (shapes[i].c.k[j].e) {
+                shapes[i].c.k[j].e[0] /= 255;
+                shapes[i].c.k[j].e[1] /= 255;
+                shapes[i].c.k[j].e[2] /= 255;
+                shapes[i].c.k[j].e[3] /= 255;
+              }
+            }
+          } else {
+            shapes[i].c.k[0] /= 255;
+            shapes[i].c.k[1] /= 255;
+            shapes[i].c.k[2] /= 255;
+            shapes[i].c.k[3] /= 255;
+          }
+        }
+      }
     }
 
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 4) {
+          iterateShapes(layers[i].shapes);
         }
+      }
     }
 
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
+      }
+    };
+  }());
+
+  var checkShapes = (function () {
+    var minimumVersion = [4, 4, 18];
+
+    function completeClosingShapes(arr) {
+      var i;
+      var len = arr.length;
+      var j;
+      var jLen;
+      for (i = len - 1; i >= 0; i -= 1) {
+        if (arr[i].ty === 'sh') {
+          if (arr[i].ks.k.i) {
+            arr[i].ks.k.c = arr[i].closed;
+          } else {
+            jLen = arr[i].ks.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (arr[i].ks.k[j].s) {
+                arr[i].ks.k[j].s[0].c = arr[i].closed;
+              }
+              if (arr[i].ks.k[j].e) {
+                arr[i].ks.k[j].e[0].c = arr[i].closed;
+              }
+            }
+          }
+        } else if (arr[i].ty === 'gr') {
+          completeClosingShapes(arr[i].it);
         }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
+      }
     }
 
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            };
+    function iterateLayers(layers) {
+      var layerData;
+      var i;
+      var len = layers.length;
+      var j;
+      var jLen;
+      var k;
+      var kLen;
+      for (i = 0; i < len; i += 1) {
+        layerData = layers[i];
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              maskProps[j].pt.k.c = maskProps[j].cl;
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
+                }
+              }
+            }
+          }
         }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
+        if (layerData.ty === 4) {
+          completeClosingShapes(layerData.shapes);
         }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkChars = (function() {
-        var minimumVersion = [4,7,99];
-        return function (animationData){
-            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
-                var i, len = animationData.chars.length, j, jLen, k, kLen;
-                var pathData, paths;
-                for(i = 0; i < len; i += 1) {
-                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
-                        paths = animationData.chars[i].data.shapes[0].it;
-                        jLen = paths.length;
-
-                        for(j = 0; j < jLen; j += 1) {
-                            pathData = paths[j].ks.k;
-                            if(!pathData.__converted) {
-                                convertPathsToAbsoluteValues(paths[j].ks.k);
-                                pathData.__converted = true;
-                            }
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkChars(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
+      }
     }
 
-    function completeText(data, fontManager){
-        if(data.t.a.length === 0 && !('m' in data.t.p)){
-            data.singleShape = true;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
+      }
+    };
+  }());
+
+  function completeData(animationData, fontManager) {
+    if (animationData.__complete) {
+      return;
     }
+    checkColors(animationData);
+    checkText(animationData);
+    checkChars(animationData);
+    checkShapes(animationData);
+    completeLayers(animationData.layers, animationData.assets, fontManager);
+    animationData.__complete = true;
+  }
 
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-    moduleOb.checkColors = checkColors;
-    moduleOb.checkChars = checkChars;
-    moduleOb.checkShapes = checkShapes;
-    moduleOb.completeLayers = completeLayers;
+  function completeText(data) {
+    if (data.t.a.length === 0 && !('m' in data.t.p)) {
+      data.singleShape = true;
+    }
+  }
 
-    return moduleOb;
+  var moduleOb = {};
+  moduleOb.completeData = completeData;
+  moduleOb.checkColors = checkColors;
+  moduleOb.checkChars = checkChars;
+  moduleOb.checkShapes = checkShapes;
+  moduleOb.completeLayers = completeLayers;
+
+  return moduleOb;
 }
 
 var dataManager = dataFunctionManager();
 
-var FontManager = (function(){
+/* exported getFontProperties */
 
-    var maxWaitingTime = 5000;
-    var emptyChar = {
-        w: 0,
-        size:0,
-        shapes:[]
-    };
-    var combinedCharacters = [];
-    //Hindi characters
-    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]);
+function getFontProperties(fontData) {
+  var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
 
-    function trimFontOptions(font) {
-        var familyArray = font.split(',');
-        var i, len = familyArray.length;
-        var enabledFamilies = [];
-        for (i = 0; i < len; i += 1) {
-            if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
-                enabledFamilies.push(familyArray[i]);
-            }
-        }
-        return enabledFamilies.join(',');
+  var fWeight = 'normal'; var
+    fStyle = 'normal';
+  var len = styles.length;
+  var styleName;
+  for (var i = 0; i < len; i += 1) {
+    styleName = styles[i].toLowerCase();
+    switch (styleName) {
+      case 'italic':
+        fStyle = 'italic';
+        break;
+      case 'bold':
+        fWeight = '700';
+        break;
+      case 'black':
+        fWeight = '900';
+        break;
+      case 'medium':
+        fWeight = '500';
+        break;
+      case 'regular':
+      case 'normal':
+        fWeight = '400';
+        break;
+      case 'light':
+      case 'thin':
+        fWeight = '200';
+        break;
+      default:
+        break;
     }
+  }
 
-    function setUpNode(font, family){
-        var parentNode = createTag('span');
-        parentNode.style.fontFamily    = family;
-        var node = createTag('span');
-        // Characters that vary significantly among different fonts
-        node.innerText = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = trimFontOptions(font) + ', ' + family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(this.checkLoadedFontsBinded, 20);
-        }else{
-            setTimeout(this.setIsLoadedBinded, 10);
-
-        }
-    }
-
-    function createHelper(def, fontData){
-        var tHelper = createNS('text');
-        tHelper.style.fontSize = '100px';
-        //tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.setAttribute('font-family', fontData.fFamily);
-        tHelper.setAttribute('font-style', fontData.fStyle);
-        tHelper.setAttribute('font-weight', fontData.fWeight);
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.setAttribute('class', fontData.fClass);
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = createTag('canvas').getContext('2d');
-        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
-        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.isLoaded = true;
-            return;
-        }
-        if(this.chars){
-            this.isLoaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        var _pendingFonts = len;
-        for(i=0; i<len; i+= 1){
-            var shouldLoadFont = true;
-            var loadedSelector;
-            var j;
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-                _pendingFonts -= 1;
-            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
-                loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
-
-                if (loadedSelector.length > 0) {
-                    shouldLoadFont = false;
-                }
-
-                if (shouldLoadFont) {
-                    var s = createTag('style');
-                    s.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    s.setAttribute('f-origin', fontArr[i].origin);
-                    s.setAttribute('f-family', fontArr[i].fFamily);
-                    s.type = "text/css";
-                    s.innerText = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                    defs.appendChild(s);
-                }
-            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
-                loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var l = createTag('link');
-                    l.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    l.setAttribute('f-origin', fontArr[i].origin);
-                    l.type = "text/css";
-                    l.rel = "stylesheet";
-                    l.href = fontArr[i].fPath;
-                    document.body.appendChild(l);
-                }
-            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
-                loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (fontArr[i].fPath === loadedSelector[j].src) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var sc = createTag('link');
-                    sc.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    sc.setAttribute('f-origin', fontArr[i].origin);
-                    sc.setAttribute('rel','stylesheet');
-                    sc.setAttribute('href',fontArr[i].fPath);
-                    defs.appendChild(sc);
-                }
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            fontArr[i].cache = {};
-            this.fonts.push(fontArr[i]);
-        }
-        if (_pendingFonts === 0) {
-            this.isLoaded = true;
-        } else {
-            //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
-            //Adding this timeout seems to fix it
-           setTimeout(this.checkLoadedFonts.bind(this), 100);
-        }
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-        if ((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char)
-            && console
-            && console.warn
-            && !this._warned
-           ) {
-            this._warned = true
-            console.warn('Missing character from exported characters list: ', char, style, font);
-        }
-        return emptyChar;
-    }
-
-    function measureText(char, fontName, size) {
-        var fontData = this.getFontByName(fontName);
-        var index = char.charCodeAt(0);
-        if(!fontData.cache[index + 1]) {
-            var tHelper = fontData.helper;
-            //Canvas version
-            //fontData.cache[index] = tHelper.measureText(char).width / 100;
-            //SVG version
-            //console.log(tHelper.getBBox().width)
-            if (char === ' ') {
-                tHelper.textContent = '|' + char + '|';
-                var doubleSize = tHelper.getComputedTextLength();
-                tHelper.textContent = '||';
-                var singleSize = tHelper.getComputedTextLength();
-                fontData.cache[index + 1] = (doubleSize - singleSize)/100;
-            } else {
-                tHelper.textContent = char;
-                fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
-            }
-        }
-        return fontData.cache[index + 1] * size;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return this.fonts[0];
-    }
-
-    function getCombinedCharacterCodes() {
-        return combinedCharacters;
-    }
-
-    function setIsLoaded() {
-        this.isLoaded = true
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this._warned = false;
-        this.initTime = Date.now();
-        this.setIsLoadedBinded = this.setIsLoaded.bind(this)
-        this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)
-    };
-    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
-    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
-
-    var fontPrototype = {
-        addChars: addChars,
-        addFonts: addFonts,
-        getCharData: getCharData,
-        getFontByName: getFontByName,
-        measureText: measureText,
-        checkLoadedFonts: checkLoadedFonts,
-        setIsLoaded: setIsLoaded,
-    }
-
-    Font.prototype = fontPrototype;
-
-    return Font;
-
-}());
-
-var PropertyFactory = (function(){
-
-    var initFrame = initialDefaultFrame;
-    var math_abs = Math.abs;
-
-    function interpolateValue(frameNum, caching) {
-        var offsetTime = this.offsetTime;
-        var newValue;
-        if (this.propType === 'multidimensional') {
-            newValue = createTypedArray('float32', this.pv.length);
-        }
-        var iterationIndex = caching.lastIndex;
-        var i = iterationIndex;
-        var len = this.keyframes.length - 1, flag = true;
-        var keyData, nextKeyData;
-
-        while (flag) {
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i + 1];
-            if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                iterationIndex = 0;
-                break;
-            }
-            if ((nextKeyData.t - offsetTime) > frameNum){
-                iterationIndex = i;
-                break;
-            }
-            if (i < len - 1){
-                i += 1;
-            } else {
-                iterationIndex = 0;
-                flag = false;
-            }
-        }
-
-        var k, kLen, perc, jLen, j, fnc;
-        var nextKeyTime = nextKeyData.t - offsetTime;
-        var keyTime = keyData.t - offsetTime;
-        var endValue;
-        if (keyData.to) {
-            if (!keyData.bezierData) {
-                keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyTime || frameNum < keyTime) {
-                var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for (k = 0; k < kLen; k += 1) {
-                    newValue[k] = bezierData.points[ind].point[k];
-                }
-                // caching._lastKeyframeIndex = -1;
-            } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
-                } else {
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
-                }
-                perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
-                var distanceInLine = bezierData.segmentLength*perc;
-
-                var segmentPerc;
-                var addedLength =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
-                j =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
-                flag = true;
-                jLen = bezierData.points.length;
-                while (flag) {
-                    addedLength += bezierData.points[j].partialLength;
-                    if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
-                        segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1){
-                        j += 1;
-                    } else {
-                        flag = false;
-                    }
-                }
-                caching._lastPoint = j;
-                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                caching._lastKeyframeIndex = i;
-            }
-        } else {
-            var outX, outY, inX, inY, keyValue;
-            len = keyData.s.length;
-            endValue = nextKeyData.s || keyData.e;
-            if (this.sh && keyData.h !== 1) {
-                if (frameNum >= nextKeyTime) {
-                    newValue[0] = endValue[0];
-                    newValue[1] = endValue[1];
-                    newValue[2] = endValue[2];
-                } else if (frameNum <= keyTime) {
-                    newValue[0] = keyData.s[0];
-                    newValue[1] = keyData.s[1];
-                    newValue[2] = keyData.s[2];
-                } else {
-                    var quatStart = createQuaternion(keyData.s);
-                    var quatEnd = createQuaternion(endValue);
-                    var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
-                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
-                }
-                
-            } else {
-                for(i = 0; i < len; i += 1) {
-                    if (keyData.h !== 1) {
-                        if (frameNum >= nextKeyTime) {
-                            perc = 1;
-                        } else if(frameNum < keyTime) {
-                            perc = 0;
-                        } else {
-                            if(keyData.o.x.constructor === Array) {
-                                if (!keyData.__fnct) {
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
-                                    outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
-                                    inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
-                                    inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct = fnc;
-                                } else {
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
-                        }
-                    }
-
-                    endValue = nextKeyData.s || keyData.e;
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
-
-                    if (this.propType === 'multidimensional') {
-                        newValue[i] = keyValue;
-                    } else {
-                        newValue = keyValue;
-                    }
-                }
-            }
-        }
-        caching.lastIndex = iterationIndex;
-        return newValue;
-    }
-
-    //based on @Toji's https://github.com/toji/gl-matrix/
-    function slerp(a, b, t) {
-        var out = [];
-        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
-        bx = b[0], by = b[1], bz = b[2], bw = b[3]
-
-        var omega, cosom, sinom, scale0, scale1;
-
-        cosom = ax * bx + ay * by + az * bz + aw * bw;
-        if (cosom < 0.0) {
-            cosom = -cosom;
-            bx = -bx;
-            by = -by;
-            bz = -bz;
-            bw = -bw;
-        }
-        if ((1.0 - cosom) > 0.000001) {
-            omega = Math.acos(cosom);
-            sinom = Math.sin(omega);
-            scale0 = Math.sin((1.0 - t) * omega) / sinom;
-            scale1 = Math.sin(t * omega) / sinom;
-        } else {
-            scale0 = 1.0 - t;
-            scale1 = t;
-        }
-        out[0] = scale0 * ax + scale1 * bx;
-        out[1] = scale0 * ay + scale1 * by;
-        out[2] = scale0 * az + scale1 * bz;
-        out[3] = scale0 * aw + scale1 * bw;
-
-        return out;
-    }
-
-    function quaternionToEuler(out, quat) {
-        var qx = quat[0];
-        var qy = quat[1];
-        var qz = quat[2];
-        var qw = quat[3];
-        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
-        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
-        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
-        out[0] = heading/degToRads;
-        out[1] = attitude/degToRads;
-        out[2] = bank/degToRads;
-    }
-
-    function createQuaternion(values) {
-        var heading = values[0] * degToRads;
-        var attitude = values[1] * degToRads;
-        var bank = values[2] * degToRads;
-        var c1 = Math.cos(heading / 2);
-        var c2 = Math.cos(attitude / 2);
-        var c3 = Math.cos(bank / 2);
-        var s1 = Math.sin(heading / 2);
-        var s2 = Math.sin(attitude / 2);
-        var s3 = Math.sin(bank / 2);
-        var w = c1 * c2 * c3 - s1 * s2 * s3;
-        var x = s1 * s2 * c3 + c1 * c2 * s3;
-        var y = s1 * c2 * c3 + c1 * s2 * s3;
-        var z = c1 * s2 * c3 - s1 * c2 * s3;
-
-        return [x,y,z,w];
-    }
-
-    function getValueAtCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
-        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
-            if(this._caching.lastFrame >= frameNum) {
-                this._caching._lastKeyframeIndex = -1;
-                this._caching.lastIndex = 0;
-            }
-
-            var renderResult = this.interpolateValue(frameNum, this._caching);
-            this.pv = renderResult;
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
-    }
-
-    function setVValue(val) {
-        var multipliedValue;
-        if(this.propType === 'unidimensional') {
-            multipliedValue = val * this.mult;
-            if(math_abs(this.v - multipliedValue) > 0.00001) {
-                this.v = multipliedValue;
-                this._mdf = true;
-            }
-        } else {
-            var i = 0, len = this.v.length;
-            while (i < len) {
-                multipliedValue = val[i] * this.mult;
-                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
-                    this.v[i] = multipliedValue;
-                    this._mdf = true;
-                }
-                i += 1;
-            }
-        }
-    }
-
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
-            return;
-        }
-        if(this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = this._isFirstFrame;
-        var multipliedValue;
-        var i, len = this.effectsSequence.length;
-        var finalValue = this.kf ? this.pv : this.data.k;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this._isFirstFrame = false;
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
-    }
-
-    function ValueProperty(elem, data, mult, container){
-        this.propType = 'unidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.effectsSequence = [];
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function MultiDimensionalProperty(elem, data, mult, container) {
-        this.propType = 'multidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        var i, len = data.k.length;
-        this.v = createTypedArray('float32', len);
-        this.pv = createTypedArray('float32', len);
-        var arr = createTypedArray('float32', len);
-        this.vel = createTypedArray('float32', len);
-        for (i = 0; i < len; i += 1) {
-            this.v[i] = data.k[i] * this.mult;
-            this.pv[i] = data.k[i];
-        }
-        this._isFirstFrame = true;
-        this.effectsSequence = [];
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedValueProperty(elem, data, mult, container) {
-        this.propType = 'unidimensional';
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.frameId = -1;
-        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.v = initFrame;
-        this.pv = initFrame;
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult, container){
-        this.propType = 'multidimensional';
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for (i = 0; i < len - 1; i += 1) {
-            if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
-                s = data.k[i].s;
-                e = data.k[i + 1].s;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                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]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
-                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
-                        data.k[i].to = null;
-                        data.k[i].ti = null;
-                    }
-                }
-            }
-        }
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.data = data;
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this._isFirstFrame = true;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.frameId = -1;
-        var arrLen = data.k[0].s.length;
-        this.v = createTypedArray('float32', arrLen);
-        this.pv = createTypedArray('float32', arrLen);
-        for (i = 0; i < arrLen; i += 1) {
-            this.v[i] = initFrame;
-            this.pv[i] = initFrame;
-        }
-        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
-        this.addEffect = addEffect;
-    }
-
-    function getProp(elem,data,type, mult, container) {
-        var p;
-        if(!data.k.length){
-            p = new ValueProperty(elem,data, mult, container);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult, container);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult, container);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
-                    break;
-            }
-        }
-        if(p.effectsSequence.length){
-            container.addDynamicProperty(p);
-        }
-        return p;
-    }
-
-    var ob = {
-        getProp: getProp
-    };
-    return ob;
-}());
-var TransformPropertyFactory = (function() {
-
-    var defaultVector = [0,0]
-
-    function applyToMatrix(mat) {
-        var _mdf = this._mdf;
-        this.iterateDynamicProperties();
-        this._mdf = this._mdf || _mdf;
-        if (this.a) {
-            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-        }
-        if (this.s) {
-            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-        }
-        if (this.sk) {
-            mat.skewFromAxis(-this.sk.v, this.sa.v);
-        }
-        if (this.r) {
-            mat.rotate(-this.r.v);
-        } else {
-            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]);
-        }
-        if (this.data.p.s) {
-            if (this.data.p.z) {
-                mat.translate(this.px.v, this.py.v, -this.pz.v);
-            } else {
-                mat.translate(this.px.v, this.py.v, 0);
-            }
-        } else {
-            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-        }
-    }
-    function processKeys(forceRender){
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        }
-        if(this._isDirty) {
-            this.precalculateMatrix();
-            this._isDirty = false;
-        }
-
-        this.iterateDynamicProperties();
-
-        if (this._mdf || forceRender) {
-            this.v.cloneFromProps(this.pre.props);
-            if (this.appliedTransformations < 1) {
-                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if(this.appliedTransformations < 2) {
-                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.sk && this.appliedTransformations < 3) {
-                this.v.skewFromAxis(-this.sk.v, this.sa.v);
-            }
-            if (this.r && this.appliedTransformations < 4) {
-                this.v.rotate(-this.r.v);
-            } else if (!this.r && this.appliedTransformations < 4){
-                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]);
-            }
-            if (this.autoOriented) {
-                var v1,v2, frameRate = this.elem.globalData.frameRate;
-                if(this.p && this.p.keyframes && this.p.getValueAtTime) {
-                    if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
-                    } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
-                    }
-                } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
-                    v1 = [];
-                    v2 = [];
-                    var px = this.px, py = this.py, frameRate;
-                    if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
-                        v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
-                        v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
-                    } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
-                        v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
-                        v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
-                    } else {
-                        v1 = [px.pv, py.pv];
-                        v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
-                        v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
-                    }
-                } else {
-                    v1 = v2 = defaultVector
-                }
-                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-            }
-            if(this.data.p && this.data.p.s){
-                if(this.data.p.z) {
-                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    this.v.translate(this.px.v, this.py.v, 0);
-                }
-            }else{
-                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-            }
-        }
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function precalculateMatrix() {
-        if(!this.a.k) {
-            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            this.appliedTransformations = 1;
-        } else {
-            return;
-        }
-        if(!this.s.effectsSequence.length) {
-            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            this.appliedTransformations = 2;
-        } else {
-            return;
-        }
-        if(this.sk) {
-            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
-                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
-            this.appliedTransformations = 3;
-            } else {
-                return;
-            }
-        }
-        if (this.r) {
-            if(!this.r.effectsSequence.length) {
-                this.pre.rotate(-this.r.v);
-                this.appliedTransformations = 4;
-            } else {
-                return;
-            }
-        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
-            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]);
-            this.appliedTransformations = 4;
-        }
-    }
-
-    function autoOrient(){
-        //
-        //var prevP = this.getValueAtTime();
-    }
-
-    function addDynamicProperty(prop) {
-        this._addDynamicProperty(prop);
-        this.elem.addDynamicProperty(prop);
-        this._isDirty = true;
-    }
-
-    function TransformProperty(elem,data,container){
-        this.elem = elem;
-        this.frameId = -1;
-        this.propType = 'transform';
-        this.data = data;
-        this.v = new Matrix();
-        //Precalculated matrix with non animated properties
-        this.pre = new Matrix();
-        this.appliedTransformations = 0;
-        this.initDynamicPropertyContainer(container || elem);
-        if(data.p && data.p.s){
-            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
-            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
-            if(data.p.z){
-                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
-            }
-        }else{
-            this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
-        }
-        if(data.rx) {
-            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
-            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
-            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
-            if(data.or.k[0].ti) {
-                var i, len = data.or.k.length;
-                for(i=0;i<len;i+=1) {
-                    data.or.k[i].to = data.or.k[i].ti = null;
-                }
-            }
-            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
-            //sh Indicates it needs to be capped between -180 and 180
-            this.or.sh = true;
-        } else {
-            this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
-        }
-        if(data.sk){
-            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
-            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
-        }
-        this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},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.
-        if(data.o){
-            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
-        } else {
-            this.o = {_mdf:false,v:1};
-        }
-        this._isDirty = true;
-        if(!this.dynamicProperties.length){
-            this.getValue(true);
-        }
-    }
-
-    TransformProperty.prototype = {
-        applyToMatrix: applyToMatrix,
-        getValue: processKeys,
-        precalculateMatrix: precalculateMatrix,
-        autoOrient: autoOrient
-    }
-
-    extendPrototype([DynamicPropertyContainer], TransformProperty);
-    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
-    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
-
-    function getTransformProperty(elem,data,container){
-        return new TransformProperty(elem,data,container);
-    }
-
-    return {
-        getTransformProperty: getTransformProperty
-    };
-
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = createSizedArray(this._maxLength);
-	this.o = createSizedArray(this._maxLength);
-	this.i = createSizedArray(this._maxLength);
+  return {
+    style: fStyle,
+    weight: fontData.fWeight || fWeight,
+  };
 }
 
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	this.setLength(len);
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newElement();
-		this.o[i] = point_pool.newElement();
-		this.i[i] = point_pool.newElement();
-		i += 1;
-	}
-};
+/* global createNS, createTag, getFontProperties */
+/* exported FontManager */
 
-ShapePath.prototype.setLength = function(len) {
-	while(this._maxLength < len) {
-		this.doubleArrayLength();
-	}
-	this._length = len;
-};
+var FontManager = (function () {
+  var maxWaitingTime = 5000;
+  var emptyChar = {
+    w: 0,
+    size: 0,
+    shapes: [],
+  };
+  var combinedCharacters = [];
+  // Hindi characters
+  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]);
 
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(createSizedArray(this._maxLength));
-	this.i = this.i.concat(createSizedArray(this._maxLength));
-	this.o = this.o.concat(createSizedArray(this._maxLength));
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newElement();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-
-ShapePath.prototype.reverse = function() {
-	var newPath = new ShapePath();
-	newPath.setPathData(this.c, this._length);
-	var vertices = this.v, outPoints = this.o, inPoints = this.i;
-	var init = 0;
-	if (this.c) {
-		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
-        init = 1;
-    }
-    var cnt = this._length - 1;
-    var len = this._length;
-
+  function trimFontOptions(font) {
+    var familyArray = font.split(',');
     var i;
-    for (i = init; i < len; i += 1) {
-    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
-        cnt -= 1;
+    var len = familyArray.length;
+    var enabledFamilies = [];
+    for (i = 0; i < len; i += 1) {
+      if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
+        enabledFamilies.push(familyArray[i]);
+      }
     }
-    return newPath;
+    return enabledFamilies.join(',');
+  }
+
+  function setUpNode(font, family) {
+    var parentNode = createTag('span');
+    parentNode.style.fontFamily = family;
+    var node = createTag('span');
+    // Characters that vary significantly among different fonts
+    node.innerText = 'giItT1WQy@!-/#';
+    // Visible - so we can measure it - but not on the screen
+    parentNode.style.position = 'absolute';
+    parentNode.style.left = '-10000px';
+    parentNode.style.top = '-10000px';
+    // Large font size makes even subtle changes obvious
+    parentNode.style.fontSize = '300px';
+    // Reset any font properties
+    parentNode.style.fontVariant = 'normal';
+    parentNode.style.fontStyle = 'normal';
+    parentNode.style.fontWeight = 'normal';
+    parentNode.style.letterSpacing = '0';
+    parentNode.appendChild(node);
+    document.body.appendChild(parentNode);
+
+    // Remember width with no applied web font
+    var width = node.offsetWidth;
+    node.style.fontFamily = trimFontOptions(font) + ', ' + family;
+    return { node: node, w: width, parent: parentNode };
+  }
+
+  function checkLoadedFonts() {
+    var i;
+    var len = this.fonts.length;
+    var node;
+    var w;
+    var loadedCount = len;
+    for (i = 0; i < len; i += 1) {
+      if (this.fonts[i].loaded) {
+        loadedCount -= 1;
+      } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
+        this.fonts[i].loaded = true;
+      } else {
+        node = this.fonts[i].monoCase.node;
+        w = this.fonts[i].monoCase.w;
+        if (node.offsetWidth !== w) {
+          loadedCount -= 1;
+          this.fonts[i].loaded = true;
+        } else {
+          node = this.fonts[i].sansCase.node;
+          w = this.fonts[i].sansCase.w;
+          if (node.offsetWidth !== w) {
+            loadedCount -= 1;
+            this.fonts[i].loaded = true;
+          }
+        }
+        if (this.fonts[i].loaded) {
+          this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
+          this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
+        }
+      }
+    }
+
+    if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
+      setTimeout(this.checkLoadedFontsBinded, 20);
+    } else {
+      setTimeout(this.setIsLoadedBinded, 10);
+    }
+  }
+
+  function createHelper(def, fontData) {
+    var tHelper = createNS('text');
+    tHelper.style.fontSize = '100px';
+    // tHelper.style.fontFamily = fontData.fFamily;
+
+    var fontProps = getFontProperties(fontData);
+    tHelper.setAttribute('font-family', fontData.fFamily);
+    tHelper.setAttribute('font-style', fontProps.style);
+    tHelper.setAttribute('font-weight', fontProps.weight);
+    tHelper.textContent = '1';
+    if (fontData.fClass) {
+      tHelper.style.fontFamily = 'inherit';
+      tHelper.setAttribute('class', fontData.fClass);
+    } else {
+      tHelper.style.fontFamily = fontData.fFamily;
+    }
+    def.appendChild(tHelper);
+    var tCanvasHelper = createTag('canvas').getContext('2d');
+    tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px ' + fontData.fFamily;
+    // tCanvasHelper.font = ' 100px '+ fontData.fFamily;
+    return tHelper;
+  }
+
+  function addFonts(fontData, defs) {
+    if (!fontData) {
+      this.isLoaded = true;
+      return;
+    }
+    if (this.chars) {
+      this.isLoaded = true;
+      this.fonts = fontData.list;
+      return;
+    }
+
+    var fontArr = fontData.list;
+    var i;
+    var len = fontArr.length;
+    var _pendingFonts = len;
+    for (i = 0; i < len; i += 1) {
+      var shouldLoadFont = true;
+      var loadedSelector;
+      var j;
+      fontArr[i].loaded = false;
+      fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
+      fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
+      if (!fontArr[i].fPath) {
+        fontArr[i].loaded = true;
+        _pendingFonts -= 1;
+      } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
+        loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
+
+        if (loadedSelector.length > 0) {
+          shouldLoadFont = false;
+        }
+
+        if (shouldLoadFont) {
+          var s = createTag('style');
+          s.setAttribute('f-forigin', fontArr[i].fOrigin);
+          s.setAttribute('f-origin', fontArr[i].origin);
+          s.setAttribute('f-family', fontArr[i].fFamily);
+          s.type = 'text/css';
+          s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
+          defs.appendChild(s);
+        }
+      } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
+        loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var l = createTag('link');
+          l.setAttribute('f-forigin', fontArr[i].fOrigin);
+          l.setAttribute('f-origin', fontArr[i].origin);
+          l.type = 'text/css';
+          l.rel = 'stylesheet';
+          l.href = fontArr[i].fPath;
+          document.body.appendChild(l);
+        }
+      } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
+        loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (fontArr[i].fPath === loadedSelector[j].src) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var sc = createTag('link');
+          sc.setAttribute('f-forigin', fontArr[i].fOrigin);
+          sc.setAttribute('f-origin', fontArr[i].origin);
+          sc.setAttribute('rel', 'stylesheet');
+          sc.setAttribute('href', fontArr[i].fPath);
+          defs.appendChild(sc);
+        }
+      }
+      fontArr[i].helper = createHelper(defs, fontArr[i]);
+      fontArr[i].cache = {};
+      this.fonts.push(fontArr[i]);
+    }
+    if (_pendingFonts === 0) {
+      this.isLoaded = true;
+    } else {
+      // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
+      // Adding this timeout seems to fix it
+      setTimeout(this.checkLoadedFonts.bind(this), 100);
+    }
+  }
+
+  function addChars(chars) {
+    if (!chars) {
+      return;
+    }
+    if (!this.chars) {
+      this.chars = [];
+    }
+    var i;
+    var len = chars.length;
+    var j;
+    var jLen = this.chars.length;
+    var found;
+    for (i = 0; i < len; i += 1) {
+      j = 0;
+      found = false;
+      while (j < jLen) {
+        if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
+          found = true;
+        }
+        j += 1;
+      }
+      if (!found) {
+        this.chars.push(chars[i]);
+        jLen += 1;
+      }
+    }
+  }
+
+  function getCharData(char, style, font) {
+    var i = 0;
+    var len = this.chars.length;
+    while (i < len) {
+      if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) {
+        return this.chars[i];
+      }
+      i += 1;
+    }
+    if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char)
+            && console
+            && console.warn // eslint-disable-line no-console
+            && !this._warned
+    ) {
+      this._warned = true;
+      console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console
+    }
+    return emptyChar;
+  }
+
+  function measureText(char, fontName, size) {
+    var fontData = this.getFontByName(fontName);
+    var index = char.charCodeAt(0);
+    if (!fontData.cache[index + 1]) {
+      var tHelper = fontData.helper;
+      // Canvas version
+      // fontData.cache[index] = tHelper.measureText(char).width / 100;
+      // SVG version
+      // console.log(tHelper.getBBox().width)
+      if (char === ' ') {
+        tHelper.textContent = '|' + char + '|';
+        var doubleSize = tHelper.getComputedTextLength();
+        tHelper.textContent = '||';
+        var singleSize = tHelper.getComputedTextLength();
+        fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
+      } else {
+        tHelper.textContent = char;
+        fontData.cache[index + 1] = (tHelper.getComputedTextLength()) / 100;
+      }
+    }
+    return fontData.cache[index + 1] * size;
+  }
+
+  function getFontByName(name) {
+    var i = 0;
+    var len = this.fonts.length;
+    while (i < len) {
+      if (this.fonts[i].fName === name) {
+        return this.fonts[i];
+      }
+      i += 1;
+    }
+    return this.fonts[0];
+  }
+
+  function getCombinedCharacterCodes() {
+    return combinedCharacters;
+  }
+
+  function setIsLoaded() {
+    this.isLoaded = true;
+  }
+
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this._warned = false;
+    this.initTime = Date.now();
+    this.setIsLoadedBinded = this.setIsLoaded.bind(this);
+    this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
+  };
+    // TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
+  Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
+  var fontPrototype = {
+    addChars: addChars,
+    addFonts: addFonts,
+    getCharData: getCharData,
+    getFontByName: getFontByName,
+    measureText: measureText,
+    checkLoadedFonts: checkLoadedFonts,
+    setIsLoaded: setIsLoaded,
+  };
+
+  Font.prototype = fontPrototype;
+
+  return Font;
+}());
+
+/* global initialDefaultFrame, BezierFactory, degToRads, bez, createTypedArray */
+/* exported PropertyFactory */
+
+var PropertyFactory = (function () {
+  var initFrame = initialDefaultFrame;
+  var mathAbs = Math.abs;
+
+  function interpolateValue(frameNum, caching) {
+    var offsetTime = this.offsetTime;
+    var newValue;
+    if (this.propType === 'multidimensional') {
+      newValue = createTypedArray('float32', this.pv.length);
+    }
+    var iterationIndex = caching.lastIndex;
+    var i = iterationIndex;
+    var len = this.keyframes.length - 1;
+    var flag = true;
+    var keyData;
+    var nextKeyData;
+
+    while (flag) {
+      keyData = this.keyframes[i];
+      nextKeyData = this.keyframes[i + 1];
+      if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
+        if (keyData.h) {
+          keyData = nextKeyData;
+        }
+        iterationIndex = 0;
+        break;
+      }
+      if ((nextKeyData.t - offsetTime) > frameNum) {
+        iterationIndex = i;
+        break;
+      }
+      if (i < len - 1) {
+        i += 1;
+      } else {
+        iterationIndex = 0;
+        flag = false;
+      }
+    }
+
+    var k;
+    var kLen;
+    var perc;
+    var jLen;
+    var j;
+    var fnc;
+    var nextKeyTime = nextKeyData.t - offsetTime;
+    var keyTime = keyData.t - offsetTime;
+    var endValue;
+    if (keyData.to) {
+      if (!keyData.bezierData) {
+        keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
+      }
+      var bezierData = keyData.bezierData;
+      if (frameNum >= nextKeyTime || frameNum < keyTime) {
+        var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
+        kLen = bezierData.points[ind].point.length;
+        for (k = 0; k < kLen; k += 1) {
+          newValue[k] = bezierData.points[ind].point[k];
+        }
+        // caching._lastKeyframeIndex = -1;
+      } else {
+        if (keyData.__fnct) {
+          fnc = keyData.__fnct;
+        } else {
+          fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
+          keyData.__fnct = fnc;
+        }
+        perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+        var distanceInLine = bezierData.segmentLength * perc;
+
+        var segmentPerc;
+        var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+        j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
+        flag = true;
+        jLen = bezierData.points.length;
+        while (flag) {
+          addedLength += bezierData.points[j].partialLength;
+          if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k];
+            }
+            break;
+          } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
+            segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
+            }
+            break;
+          }
+          if (j < jLen - 1) {
+            j += 1;
+          } else {
+            flag = false;
+          }
+        }
+        caching._lastPoint = j;
+        caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+        caching._lastKeyframeIndex = i;
+      }
+    } else {
+      var outX;
+      var outY;
+      var inX;
+      var inY;
+      var keyValue;
+      len = keyData.s.length;
+      endValue = nextKeyData.s || keyData.e;
+      if (this.sh && keyData.h !== 1) {
+        if (frameNum >= nextKeyTime) {
+          newValue[0] = endValue[0];
+          newValue[1] = endValue[1];
+          newValue[2] = endValue[2];
+        } else if (frameNum <= keyTime) {
+          newValue[0] = keyData.s[0];
+          newValue[1] = keyData.s[1];
+          newValue[2] = keyData.s[2];
+        } else {
+          var quatStart = createQuaternion(keyData.s);
+          var quatEnd = createQuaternion(endValue);
+          var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
+          quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+        }
+      } else {
+        for (i = 0; i < len; i += 1) {
+          if (keyData.h !== 1) {
+            if (frameNum >= nextKeyTime) {
+              perc = 1;
+            } else if (frameNum < keyTime) {
+              perc = 0;
+            } else {
+              if (keyData.o.x.constructor === Array) {
+                if (!keyData.__fnct) {
+                  keyData.__fnct = [];
+                }
+                if (!keyData.__fnct[i]) {
+                  outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+                  outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+                  inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+                  inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
+                  fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                  keyData.__fnct[i] = fnc;
+                } else {
+                  fnc = keyData.__fnct[i];
+                }
+              } else if (!keyData.__fnct) {
+                outX = keyData.o.x;
+                outY = keyData.o.y;
+                inX = keyData.i.x;
+                inY = keyData.i.y;
+                fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                keyData.__fnct = fnc;
+              } else {
+                fnc = keyData.__fnct;
+              }
+              perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+            }
+          }
+
+          endValue = nextKeyData.s || keyData.e;
+          keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
+
+          if (this.propType === 'multidimensional') {
+            newValue[i] = keyValue;
+          } else {
+            newValue = keyValue;
+          }
+        }
+      }
+    }
+    caching.lastIndex = iterationIndex;
+    return newValue;
+  }
+
+  // based on @Toji's https://github.com/toji/gl-matrix/
+  function slerp(a, b, t) {
+    var out = [];
+    var ax = a[0];
+    var ay = a[1];
+    var az = a[2];
+    var aw = a[3];
+    var bx = b[0];
+    var by = b[1];
+    var bz = b[2];
+    var bw = b[3];
+
+    var omega;
+    var cosom;
+    var sinom;
+    var scale0;
+    var scale1;
+
+    cosom = ax * bx + ay * by + az * bz + aw * bw;
+    if (cosom < 0.0) {
+      cosom = -cosom;
+      bx = -bx;
+      by = -by;
+      bz = -bz;
+      bw = -bw;
+    }
+    if ((1.0 - cosom) > 0.000001) {
+      omega = Math.acos(cosom);
+      sinom = Math.sin(omega);
+      scale0 = Math.sin((1.0 - t) * omega) / sinom;
+      scale1 = Math.sin(t * omega) / sinom;
+    } else {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+    out[0] = scale0 * ax + scale1 * bx;
+    out[1] = scale0 * ay + scale1 * by;
+    out[2] = scale0 * az + scale1 * bz;
+    out[3] = scale0 * aw + scale1 * bw;
+
+    return out;
+  }
+
+  function quaternionToEuler(out, quat) {
+    var qx = quat[0];
+    var qy = quat[1];
+    var qz = quat[2];
+    var qw = quat[3];
+    var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
+    var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
+    var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
+    out[0] = heading / degToRads;
+    out[1] = attitude / degToRads;
+    out[2] = bank / degToRads;
+  }
+
+  function createQuaternion(values) {
+    var heading = values[0] * degToRads;
+    var attitude = values[1] * degToRads;
+    var bank = values[2] * degToRads;
+    var c1 = Math.cos(heading / 2);
+    var c2 = Math.cos(attitude / 2);
+    var c3 = Math.cos(bank / 2);
+    var s1 = Math.sin(heading / 2);
+    var s2 = Math.sin(attitude / 2);
+    var s3 = Math.sin(bank / 2);
+    var w = c1 * c2 * c3 - s1 * s2 * s3;
+    var x = s1 * s2 * c3 + c1 * c2 * s3;
+    var y = s1 * c2 * c3 + c1 * s2 * s3;
+    var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+    return [x, y, z, w];
+  }
+
+  function getValueAtCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) {
+      if (this._caching.lastFrame >= frameNum) {
+        this._caching._lastKeyframeIndex = -1;
+        this._caching.lastIndex = 0;
+      }
+
+      var renderResult = this.interpolateValue(frameNum, this._caching);
+      this.pv = renderResult;
+    }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
+
+  function setVValue(val) {
+    var multipliedValue;
+    if (this.propType === 'unidimensional') {
+      multipliedValue = val * this.mult;
+      if (mathAbs(this.v - multipliedValue) > 0.00001) {
+        this.v = multipliedValue;
+        this._mdf = true;
+      }
+    } else {
+      var i = 0;
+      var len = this.v.length;
+      while (i < len) {
+        multipliedValue = val[i] * this.mult;
+        if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
+          this.v[i] = multipliedValue;
+          this._mdf = true;
+        }
+        i += 1;
+      }
+    }
+  }
+
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+      return;
+    }
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
+    }
+    this.lock = true;
+    this._mdf = this._isFirstFrame;
+    var i;
+    var len = this.effectsSequence.length;
+    var finalValue = this.kf ? this.pv : this.data.k;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this._isFirstFrame = false;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
+
+  function ValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this.v = mult ? data.k * mult : data.k;
+    this.pv = data.k;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.vel = 0;
+    this.effectsSequence = [];
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function MultiDimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.frameId = -1;
+    var i;
+    var len = data.k.length;
+    this.v = createTypedArray('float32', len);
+    this.pv = createTypedArray('float32', len);
+    this.vel = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      this.v[i] = data.k[i] * this.mult;
+      this.pv[i] = data.k[i];
+    }
+    this._isFirstFrame = true;
+    this.effectsSequence = [];
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.frameId = -1;
+    this._caching = {
+      lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1,
+    };
+    this.k = true;
+    this.kf = true;
+    this.data = data;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.v = initFrame;
+    this.pv = initFrame;
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedMultidimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    var i;
+    var len = data.k.length;
+    var s;
+    var e;
+    var to;
+    var ti;
+    for (i = 0; i < len - 1; i += 1) {
+      if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
+        s = data.k[i].s;
+        e = data.k[i + 1].s;
+        to = data.k[i].to;
+        ti = data.k[i].ti;
+        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]))) {
+          data.k[i].to = null;
+          data.k[i].ti = null;
+        }
+        if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+          if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+            data.k[i].to = null;
+            data.k[i].ti = null;
+          }
+        }
+      }
+    }
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.data = data;
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.k = true;
+    this.kf = true;
+    this._isFirstFrame = true;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.frameId = -1;
+    var arrLen = data.k[0].s.length;
+    this.v = createTypedArray('float32', arrLen);
+    this.pv = createTypedArray('float32', arrLen);
+    for (i = 0; i < arrLen; i += 1) {
+      this.v[i] = initFrame;
+      this.pv[i] = initFrame;
+    }
+    this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) };
+    this.addEffect = addEffect;
+  }
+
+  function getProp(elem, data, type, mult, container) {
+    var p;
+    if (!data.k.length) {
+      p = new ValueProperty(elem, data, mult, container);
+    } else if (typeof (data.k[0]) === 'number') {
+      p = new MultiDimensionalProperty(elem, data, mult, container);
+    } else {
+      switch (type) {
+        case 0:
+          p = new KeyframedValueProperty(elem, data, mult, container);
+          break;
+        case 1:
+          p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
+          break;
+        default:
+          break;
+      }
+    }
+    if (p.effectsSequence.length) {
+      container.addDynamicProperty(p);
+    }
+    return p;
+  }
+
+  var ob = {
+    getProp: getProp,
+  };
+  return ob;
+}());
+
+/* global Matrix, degToRads, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+/* exported TransformPropertyFactory */
+
+var TransformPropertyFactory = (function () {
+  var defaultVector = [0, 0];
+
+  function applyToMatrix(mat) {
+    var _mdf = this._mdf;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || _mdf;
+    if (this.a) {
+      mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+    }
+    if (this.s) {
+      mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+    }
+    if (this.sk) {
+      mat.skewFromAxis(-this.sk.v, this.sa.v);
+    }
+    if (this.r) {
+      mat.rotate(-this.r.v);
+    } else {
+      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]);
+    }
+    if (this.data.p.s) {
+      if (this.data.p.z) {
+        mat.translate(this.px.v, this.py.v, -this.pz.v);
+      } else {
+        mat.translate(this.px.v, this.py.v, 0);
+      }
+    } else {
+      mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+    }
+  }
+  function processKeys(forceRender) {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    }
+    if (this._isDirty) {
+      this.precalculateMatrix();
+      this._isDirty = false;
+    }
+
+    this.iterateDynamicProperties();
+
+    if (this._mdf || forceRender) {
+      var frameRate;
+      this.v.cloneFromProps(this.pre.props);
+      if (this.appliedTransformations < 1) {
+        this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      }
+      if (this.appliedTransformations < 2) {
+        this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      }
+      if (this.sk && this.appliedTransformations < 3) {
+        this.v.skewFromAxis(-this.sk.v, this.sa.v);
+      }
+      if (this.r && this.appliedTransformations < 4) {
+        this.v.rotate(-this.r.v);
+      } else if (!this.r && this.appliedTransformations < 4) {
+        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]);
+      }
+      if (this.autoOriented) {
+        var v1;
+        var v2;
+        frameRate = this.elem.globalData.frameRate;
+        if (this.p && this.p.keyframes && this.p.getValueAtTime) {
+          if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
+            v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
+          } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
+            v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
+          } else {
+            v1 = this.p.pv;
+            v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
+          }
+        } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
+          v1 = [];
+          v2 = [];
+          var px = this.px;
+          var py = this.py;
+          if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
+            v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
+            v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0);
+          } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0);
+            v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0);
+            v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
+          } else {
+            v1 = [px.pv, py.pv];
+            v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
+            v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
+          }
+        } else {
+          v2 = defaultVector;
+          v1 = v2;
+        }
+        this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+      }
+      if (this.data.p && this.data.p.s) {
+        if (this.data.p.z) {
+          this.v.translate(this.px.v, this.py.v, -this.pz.v);
+        } else {
+          this.v.translate(this.px.v, this.py.v, 0);
+        }
+      } else {
+        this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+      }
+    }
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function precalculateMatrix() {
+    if (!this.a.k) {
+      this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      this.appliedTransformations = 1;
+    } else {
+      return;
+    }
+    if (!this.s.effectsSequence.length) {
+      this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      this.appliedTransformations = 2;
+    } else {
+      return;
+    }
+    if (this.sk) {
+      if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+        this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+        this.appliedTransformations = 3;
+      } else {
+        return;
+      }
+    }
+    if (this.r) {
+      if (!this.r.effectsSequence.length) {
+        this.pre.rotate(-this.r.v);
+        this.appliedTransformations = 4;
+      }
+    } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+      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]);
+      this.appliedTransformations = 4;
+    }
+  }
+
+  function autoOrient() {
+    //
+    // var prevP = this.getValueAtTime();
+  }
+
+  function addDynamicProperty(prop) {
+    this._addDynamicProperty(prop);
+    this.elem.addDynamicProperty(prop);
+    this._isDirty = true;
+  }
+
+  function TransformProperty(elem, data, container) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.propType = 'transform';
+    this.data = data;
+    this.v = new Matrix();
+    // Precalculated matrix with non animated properties
+    this.pre = new Matrix();
+    this.appliedTransformations = 0;
+    this.initDynamicPropertyContainer(container || elem);
+    if (data.p && data.p.s) {
+      this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
+      this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
+      if (data.p.z) {
+        this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
+      }
+    } else {
+      this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this);
+    }
+    if (data.rx) {
+      this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+      this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+      this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+      if (data.or.k[0].ti) {
+        var i;
+        var len = data.or.k.length;
+        for (i = 0; i < len; i += 1) {
+          data.or.k[i].to = null;
+          data.or.k[i].ti = null;
+        }
+      }
+      this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+      // sh Indicates it needs to be capped between -180 and 180
+      this.or.sh = true;
+    } else {
+      this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this);
+    }
+    if (data.sk) {
+      this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+      this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+    }
+    this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 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.
+    if (data.o) {
+      this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
+    } else {
+      this.o = { _mdf: false, v: 1 };
+    }
+    this._isDirty = true;
+    if (!this.dynamicProperties.length) {
+      this.getValue(true);
+    }
+  }
+
+  TransformProperty.prototype = {
+    applyToMatrix: applyToMatrix,
+    getValue: processKeys,
+    precalculateMatrix: precalculateMatrix,
+    autoOrient: autoOrient,
+  };
+
+  extendPrototype([DynamicPropertyContainer], TransformProperty);
+  TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+  TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+  function getTransformProperty(elem, data, container) {
+    return new TransformProperty(elem, data, container);
+  }
+
+  return {
+    getTransformProperty: getTransformProperty,
+  };
+}());
+
+/* global createSizedArray, createSizedArray, pointPool */
+
+function ShapePath() {
+  this.c = false;
+  this._length = 0;
+  this._maxLength = 8;
+  this.v = createSizedArray(this._maxLength);
+  this.o = createSizedArray(this._maxLength);
+  this.i = createSizedArray(this._maxLength);
+}
+
+ShapePath.prototype.setPathData = function (closed, len) {
+  this.c = closed;
+  this.setLength(len);
+  var i = 0;
+  while (i < len) {
+    this.v[i] = pointPool.newElement();
+    this.o[i] = pointPool.newElement();
+    this.i[i] = pointPool.newElement();
+    i += 1;
+  }
 };
-var ShapePropertyFactory = (function(){
 
-    var initFrame = -999999;
+ShapePath.prototype.setLength = function (len) {
+  while (this._maxLength < len) {
+    this.doubleArrayLength();
+  }
+  this._length = len;
+};
 
-    function interpolateShape(frameNum, previousValue, caching) {
-        var iterationIndex = caching.lastIndex;
-        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
-        var kf = this.keyframes;
-        if(frameNum < kf[0].t-this.offsetTime){
-            keyPropS = kf[0].s[0];
-            isHold = true;
-            iterationIndex = 0;
-        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
-            keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
-            /*if(kf[kf.length - 1].s){
+ShapePath.prototype.doubleArrayLength = function () {
+  this.v = this.v.concat(createSizedArray(this._maxLength));
+  this.i = this.i.concat(createSizedArray(this._maxLength));
+  this.o = this.o.concat(createSizedArray(this._maxLength));
+  this._maxLength *= 2;
+};
+
+ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
+  var arr;
+  this._length = Math.max(this._length, pos + 1);
+  if (this._length >= this._maxLength) {
+    this.doubleArrayLength();
+  }
+  switch (type) {
+    case 'v':
+      arr = this.v;
+      break;
+    case 'i':
+      arr = this.i;
+      break;
+    case 'o':
+      arr = this.o;
+      break;
+    default:
+      arr = [];
+      break;
+  }
+  if (!arr[pos] || (arr[pos] && !replace)) {
+    arr[pos] = pointPool.newElement();
+  }
+  arr[pos][0] = x;
+  arr[pos][1] = y;
+};
+
+ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
+  this.setXYAt(vX, vY, 'v', pos, replace);
+  this.setXYAt(oX, oY, 'o', pos, replace);
+  this.setXYAt(iX, iY, 'i', pos, replace);
+};
+
+ShapePath.prototype.reverse = function () {
+  var newPath = new ShapePath();
+  newPath.setPathData(this.c, this._length);
+  var vertices = this.v;
+  var outPoints = this.o;
+  var inPoints = this.i;
+  var init = 0;
+  if (this.c) {
+    newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+    init = 1;
+  }
+  var cnt = this._length - 1;
+  var len = this._length;
+
+  var i;
+  for (i = init; i < len; i += 1) {
+    newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+    cnt -= 1;
+  }
+  return newPath;
+};
+
+/* global extendPrototype, roundCorner, BezierFactory, shapePool, degToRads,
+  shapeCollectionPool, PropertyFactory, bmMin, DynamicPropertyContainer */
+/* exported ShapePropertyFactory */
+
+var ShapePropertyFactory = (function () {
+  var initFrame = -999999;
+
+  function interpolateShape(frameNum, previousValue, caching) {
+    var iterationIndex = caching.lastIndex;
+    var keyPropS;
+    var keyPropE;
+    var isHold;
+    var j;
+    var k;
+    var jLen;
+    var kLen;
+    var perc;
+    var vertexValue;
+    var kf = this.keyframes;
+    if (frameNum < kf[0].t - this.offsetTime) {
+      keyPropS = kf[0].s[0];
+      isHold = true;
+      iterationIndex = 0;
+    } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
+      keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
+      /* if(kf[kf.length - 1].s){
                 keyPropS = kf[kf.length - 1].s[0];
             }else{
                 keyPropS = kf[kf.length - 2].e[0];
-            }*/
-            isHold = true;
-        }else{
-            var i = iterationIndex;
-            var len = kf.length- 1,flag = true,keyData,nextKeyData;
-            while(flag){
-                keyData = kf[i];
-                nextKeyData = kf[i+1];
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-            isHold = keyData.h === 1;
-            iterationIndex = i;
-            if(!isHold){
-                if(frameNum >= nextKeyData.t-this.offsetTime){
-                    perc = 1;
-                }else if(frameNum < keyData.t-this.offsetTime){
-                    perc = 0;
-                }else{
-                    var fnc;
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                }
-                keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
-            }
-            keyPropS = keyData.s[0];
+            } */
+      isHold = true;
+    } else {
+      var i = iterationIndex;
+      var len = kf.length - 1;
+      var flag = true;
+      var keyData;
+      var nextKeyData;
+      while (flag) {
+        keyData = kf[i];
+        nextKeyData = kf[i + 1];
+        if ((nextKeyData.t - this.offsetTime) > frameNum) {
+          break;
         }
-        jLen = previousValue._length;
-        kLen = keyPropS.i[0].length;
-        caching.lastIndex = iterationIndex;
-
-        for(j=0;j<jLen;j+=1){
-            for(k=0;k<kLen;k+=1){
-                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                previousValue.i[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                previousValue.o[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                previousValue.v[j][k] = vertexValue;
-            }
+        if (i < len - 1) {
+          i += 1;
+        } else {
+          flag = false;
         }
+      }
+      isHold = keyData.h === 1;
+      iterationIndex = i;
+      if (!isHold) {
+        if (frameNum >= nextKeyData.t - this.offsetTime) {
+          perc = 1;
+        } else if (frameNum < keyData.t - this.offsetTime) {
+          perc = 0;
+        } else {
+          var fnc;
+          if (keyData.__fnct) {
+            fnc = keyData.__fnct;
+          } else {
+            fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
+            keyData.__fnct = fnc;
+          }
+          perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime)));
+        }
+        keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
+      }
+      keyPropS = keyData.s[0];
     }
+    jLen = previousValue._length;
+    kLen = keyPropS.i[0].length;
+    caching.lastIndex = iterationIndex;
 
-    function interpolateShapeCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
-        var lastFrame = this._caching.lastFrame;
-        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
-            ////
-            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
-            this.interpolateShape(frameNum, this.pv, this._caching);
-            ////
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
+    for (j = 0; j < jLen; j += 1) {
+      for (k = 0; k < kLen; k += 1) {
+        vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
+        previousValue.i[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
+        previousValue.o[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
+        previousValue.v[j][k] = vertexValue;
+      }
     }
+  }
 
-    function resetShape(){
-        this.paths = this.localShapeCollection;
+  function interpolateShapeCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    var lastFrame = this._caching.lastFrame;
+    if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) {
+      /// /
+      this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+      this.interpolateShape(frameNum, this.pv, this._caching);
+      /// /
     }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            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] 
+  function resetShape() {
+    this.paths = this.localShapeCollection;
+  }
+
+  function shapesEqual(shape1, shape2) {
+    if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
+      return false;
+    }
+    var i;
+    var len = shape1._length;
+    for (i = 0; i < len; i += 1) {
+      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]) {
-                return false;
-            }
-        }
-        return true;
+        return false;
+      }
     }
+    return true;
+  }
 
-    function setVValue(newPath) {
-        if(!shapesEqual(this.v, newPath)) {
-            this.v = shape_pool.clone(newPath);
-            this.localShapeCollection.releaseShapes();
-            this.localShapeCollection.addShape(this.v);
-            this._mdf = true;
-            this.paths = this.localShapeCollection;
-        }
+  function setVValue(newPath) {
+    if (!shapesEqual(this.v, newPath)) {
+      this.v = shapePool.clone(newPath);
+      this.localShapeCollection.releaseShapes();
+      this.localShapeCollection.addShape(this.v);
+      this._mdf = true;
+      this.paths = this.localShapeCollection;
     }
+  }
 
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        } else if (!this.effectsSequence.length) {
-            this._mdf = false;
-            return;
-        }
-        if (this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = false;
-        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
-        var i, len = this.effectsSequence.length;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    };
-
-    function ShapeProperty(elem, data, type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.container = elem;
-        this.elem = elem;
-        this.data = data;
-        this.k = false;
-        this.kf = false;
-        this._mdf = false;
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v = shape_pool.clone(pathData);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-        this.effectsSequence = [];
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    } if (!this.effectsSequence.length) {
+      this._mdf = false;
+      return;
     }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
     }
-
-    ShapeProperty.prototype.interpolateShape = interpolateShape;
-    ShapeProperty.prototype.getValue = processEffectsSequence;
-    ShapeProperty.prototype.setVValue = setVValue;
-    ShapeProperty.prototype.addEffect = addEffect;
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.container = elem;
-        this.offsetTime = elem.data.st;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newElement();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-        this._caching = {lastFrame: initFrame, lastIndex: 0};
-        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+    this.lock = true;
+    this._mdf = false;
+    var finalValue;
+    if (this.kf) {
+      finalValue = this.pv;
+    } else if (this.data.ks) {
+      finalValue = this.data.ks.k;
+    } else {
+      finalValue = this.data.pt.k;
     }
-    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
-    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
-    KeyframedShapeProperty.prototype.setVValue = setVValue;
-    KeyframedShapeProperty.prototype.addEffect = addEffect;
+    var i;
+    var len = this.effectsSequence.length;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
 
-    var EllShapeProperty = (function(){
+  function ShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.container = elem;
+    this.elem = elem;
+    this.data = data;
+    this.k = false;
+    this.kf = false;
+    this._mdf = false;
+    var pathData = type === 3 ? data.pt.k : data.ks.k;
+    this.v = shapePool.clone(pathData);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.reset = resetShape;
+    this.effectsSequence = [];
+  }
 
-        var cPoint = roundCorner;
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
 
-        function EllShapeProperty(elem,data) {
-            /*this.v = {
+  ShapeProperty.prototype.interpolateShape = interpolateShape;
+  ShapeProperty.prototype.getValue = processEffectsSequence;
+  ShapeProperty.prototype.setVValue = setVValue;
+  ShapeProperty.prototype.addEffect = addEffect;
+
+  function KeyframedShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.elem = elem;
+    this.container = elem;
+    this.offsetTime = elem.data.st;
+    this.keyframes = type === 3 ? data.pt.k : data.ks.k;
+    this.k = true;
+    this.kf = true;
+    var len = this.keyframes[0].s[0].i.length;
+    this.v = shapePool.newElement();
+    this.v.setPathData(this.keyframes[0].s[0].c, len);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.lastFrame = initFrame;
+    this.reset = resetShape;
+    this._caching = { lastFrame: initFrame, lastIndex: 0 };
+    this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+  }
+  KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+  KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+  KeyframedShapeProperty.prototype.setVValue = setVValue;
+  KeyframedShapeProperty.prototype.addEffect = addEffect;
+
+  var EllShapeProperty = (function () {
+    var cPoint = roundCorner;
+
+    function EllShapePropertyFactory(elem, data) {
+      /* this.v = {
                 v: createSizedArray(4),
                 i: createSizedArray(4),
                 o: createSizedArray(4),
                 c: true
-            };*/
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertEllToPath();
-            }
-        };
+            }; */
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 4);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.paths = this.localShapeCollection;
+      this.localShapeCollection.addShape(this.v);
+      this.d = data.d;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertEllToPath();
+      }
+    }
 
-        EllShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function (){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-
-                if(this._mdf){
-                    this.convertEllToPath();
-                }
-            },
-            convertEllToPath: function() {
-                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-                var _cw = this.d !== 3;
-                var _v = this.v;
-                _v.v[0][0] = p0;
-                _v.v[0][1] = p1 - s1;
-                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.v[1][1] = p1;
-                _v.v[2][0] = p0;
-                _v.v[2][1] = p1 + s1;
-                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.v[3][1] = p1;
-                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.i[0][1] = p1 - s1;
-                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.i[1][1] = p1 - s1 * cPoint;
-                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.i[2][1] = p1 + s1;
-                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.i[3][1] = p1 + s1 * cPoint;
-                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.o[0][1] = p1 - s1;
-                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.o[1][1] = p1 + s1 * cPoint;
-                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.o[2][1] = p1 + s1;
-                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.o[3][1] = p1 - s1 * cPoint;
-            }
+    EllShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
         }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
 
-        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+        if (this._mdf) {
+          this.convertEllToPath();
+        }
+      },
+      convertEllToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var s0 = this.s.v[0] / 2;
+        var s1 = this.s.v[1] / 2;
+        var _cw = this.d !== 3;
+        var _v = this.v;
+        _v.v[0][0] = p0;
+        _v.v[0][1] = p1 - s1;
+        _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.v[1][1] = p1;
+        _v.v[2][0] = p0;
+        _v.v[2][1] = p1 + s1;
+        _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.v[3][1] = p1;
+        _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.i[0][1] = p1 - s1;
+        _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.i[1][1] = p1 - s1 * cPoint;
+        _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.i[2][1] = p1 + s1;
+        _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.i[3][1] = p1 + s1 * cPoint;
+        _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.o[0][1] = p1 - s1;
+        _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.o[1][1] = p1 + s1 * cPoint;
+        _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.o[2][1] = p1 + s1;
+        _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.o[3][1] = p1 - s1 * cPoint;
+      },
+    };
 
-        return EllShapeProperty;
-    }());
+    extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
 
-    var StarShapeProperty = (function() {
+    return EllShapePropertyFactory;
+  }());
 
-        function StarShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
-                this.convertToPath = this.convertStarToPath;
-            } else {
-                this.convertToPath = this.convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertToPath();
-            }
-        };
+  var StarShapeProperty = (function () {
+    function StarShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 0);
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.data = data;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      if (data.sy === 1) {
+        this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
+        this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
+        this.convertToPath = this.convertStarToPath;
+      } else {
+        this.convertToPath = this.convertPolygonToPath;
+      }
+      this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+      this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
+      this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertToPath();
+      }
+    }
 
-        StarShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function() {
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertToPath();
-                }
-            },
-            convertStarToPath: function() {
-                var numPts = Math.floor(this.pt.v)*2;
-                var angle = Math.PI*2/numPts;
-                /*this.v.v.length = numPts;
+    StarShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertToPath();
+        }
+      },
+      convertStarToPath: function () {
+        var numPts = Math.floor(this.pt.v) * 2;
+        var angle = (Math.PI * 2) / numPts;
+        /* this.v.v.length = numPts;
                 this.v.i.length = numPts;
-                this.v.o.length = numPts;*/
-                var longFlag = true;
-                var longRad = this.or.v;
-                var shortRad = this.ir.v;
-                var longRound = this.os.v;
-                var shortRound = this.is.v;
-                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-                currentAng += this.r.v;
-                var dir = this.data.d === 3 ? -1 : 1;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    rad = longFlag ? longRad : shortRad;
-                    roundness = longFlag ? longRound : shortRound;
-                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
+                this.v.o.length = numPts; */
+        var longFlag = true;
+        var longRad = this.or.v;
+        var shortRad = this.ir.v;
+        var longRound = this.os.v;
+        var shortRound = this.is.v;
+        var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2);
+        var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2);
+        var i;
+        var rad;
+        var roundness;
+        var perimSegment;
+        var currentAng = -Math.PI / 2;
+        currentAng += this.r.v;
+        var dir = this.data.d === 3 ? -1 : 1;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          rad = longFlag ? longRad : shortRad;
+          roundness = longFlag ? longRound : shortRound;
+          perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
 
-                    /*this.v.v[i] = [x,y];
+          /* this.v.v[i] = [x,y];
                     this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
                     this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                    this.v._length = numPts;*/
-                    longFlag = !longFlag;
-                    currentAng += angle*dir;
-                }
-            },
-            convertPolygonToPath: function() {
-                var numPts = Math.floor(this.pt.v);
-                var angle = Math.PI*2/numPts;
-                var rad = this.or.v;
-                var roundness = this.os.v;
-                var perimSegment = 2*Math.PI*rad/(numPts*4);
-                var i, currentAng = -Math.PI/ 2;
-                var dir = this.data.d === 3 ? -1 : 1;
-                currentAng += this.r.v;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
-                    currentAng += angle*dir;
-                }
-                this.paths.length = 0;
-                this.paths[0] = this.v;
-            }
-
+                    this.v._length = numPts; */
+          longFlag = !longFlag;
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
-
-        return StarShapeProperty;
-    }());
-
-    var RectShapeProperty = (function() {
-
-         function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertRectToPath();
-            }
-        };
-
-        RectShapeProperty.prototype = {
-            convertRectToPath: function (){
-                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-                var round = bm_min(v0,v1,this.r.v);
-                var cPoint = round*(1-roundCorner);
-                this.v._length = 0;
-
-                if(this.d === 2 || this.d === 1) {
-                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                    }
-                }else{
-                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                    }
-                }
-            },
-            getValue: function(frameNum){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertRectToPath();
-                }
-
-            },
-            reset: resetShape
+      },
+      convertPolygonToPath: function () {
+        var numPts = Math.floor(this.pt.v);
+        var angle = (Math.PI * 2) / numPts;
+        var rad = this.or.v;
+        var roundness = this.os.v;
+        var perimSegment = (2 * Math.PI * rad) / (numPts * 4);
+        var i;
+        var currentAng = -Math.PI * 0.5;
+        var dir = this.data.d === 3 ? -1 : 1;
+        currentAng += this.r.v;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+        this.paths.length = 0;
+        this.paths[0] = this.v;
+      },
 
-        return RectShapeProperty;
-    }());
+    };
+    extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
 
-    function getShapeProp(elem,data,type){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    }
+    return StarShapePropertyFactory;
+  }());
 
-    function getConstructorFunction() {
-        return ShapeProperty;
-    }
-
-    function getKeyframedConstructorFunction() {
-        return KeyframedShapeProperty;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    ob.getConstructorFunction = getConstructorFunction;
-    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data){
-        return new modifiers[nm](elem, data);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if (!this.closed) {
-        // 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.
-        data.sh.container.addDynamicProperty(data.sh);
-        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
-        this.shapes.push(shapeData);
-        this.addShapeToModifier(shapeData);
-        if (this._isAnimated) {
-            data.setAsAnimated();
-        }
-    }
-};
-ShapeModifier.prototype.init = function(elem,data){
-    this.shapes = [];
-    this.elem = elem;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,data);
-    this.frameId = initialDefaultFrame;
-    this.closed = false;
-    this.k = false;
-    if(this.dynamicProperties.length){
+  var RectShapeProperty = (function () {
+    function RectShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.c = true;
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
+      if (this.dynamicProperties.length) {
         this.k = true;
-    }else{
-        this.getValue(true);
+      } else {
+        this.k = false;
+        this.convertRectToPath();
+      }
     }
+
+    RectShapePropertyFactory.prototype = {
+      convertRectToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var v0 = this.s.v[0] / 2;
+        var v1 = this.s.v[1] / 2;
+        var round = bmMin(v0, v1, this.r.v);
+        var cPoint = round * (1 - roundCorner);
+        this.v._length = 0;
+
+        if (this.d === 2 || this.d === 1) {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
+          this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
+          }
+        } else {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
+          }
+        }
+      },
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertRectToPath();
+        }
+      },
+      reset: resetShape,
+    };
+    extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
+
+    return RectShapePropertyFactory;
+  }());
+
+  function getShapeProp(elem, data, type) {
+    var prop;
+    if (type === 3 || type === 4) {
+      var dataProp = type === 3 ? data.pt : data.ks;
+      var keys = dataProp.k;
+      if (keys.length) {
+        prop = new KeyframedShapeProperty(elem, data, type);
+      } else {
+        prop = new ShapeProperty(elem, data, type);
+      }
+    } else if (type === 5) {
+      prop = new RectShapeProperty(elem, data);
+    } else if (type === 6) {
+      prop = new EllShapeProperty(elem, data);
+    } else if (type === 7) {
+      prop = new StarShapeProperty(elem, data);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  }
+
+  function getConstructorFunction() {
+    return ShapeProperty;
+  }
+
+  function getKeyframedConstructorFunction() {
+    return KeyframedShapeProperty;
+  }
+
+  var ob = {};
+  ob.getShapeProp = getShapeProp;
+  ob.getConstructorFunction = getConstructorFunction;
+  ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
+  return ob;
+}());
+
+/* global shapeCollectionPool, initialDefaultFrame, extendPrototype, DynamicPropertyContainer */
+/* exported ShapeModifiers */
+
+var ShapeModifiers = (function () {
+  var ob = {};
+  var modifiers = {};
+  ob.registerModifier = registerModifier;
+  ob.getModifier = getModifier;
+
+  function registerModifier(nm, factory) {
+    if (!modifiers[nm]) {
+      modifiers[nm] = factory;
+    }
+  }
+
+  function getModifier(nm, elem, data) {
+    return new modifiers[nm](elem, data);
+  }
+
+  return ob;
+}());
+
+function ShapeModifier() {}
+ShapeModifier.prototype.initModifierProperties = function () {};
+ShapeModifier.prototype.addShapeToModifier = function () {};
+ShapeModifier.prototype.addShape = function (data) {
+  if (!this.closed) {
+    // 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.
+    data.sh.container.addDynamicProperty(data.sh);
+    var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() };
+    this.shapes.push(shapeData);
+    this.addShapeToModifier(shapeData);
+    if (this._isAnimated) {
+      data.setAsAnimated();
+    }
+  }
 };
-ShapeModifier.prototype.processKeys = function(){
-    if(this.elem.globalData.frameId === this.frameId){
-        return;
-    }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
+ShapeModifier.prototype.init = function (elem, data) {
+  this.shapes = [];
+  this.elem = elem;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, data);
+  this.frameId = initialDefaultFrame;
+  this.closed = false;
+  this.k = false;
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
+};
+ShapeModifier.prototype.processKeys = function () {
+  if (this.elem.globalData.frameId === this.frameId) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 extendPrototype([DynamicPropertyContainer], ShapeModifier);
-function TrimModifier(){
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, segmentsLengthPool, bez, shapePool, ShapeModifiers */
+
+function TrimModifier() {
 }
 extendPrototype([ShapeModifier], TrimModifier);
-TrimModifier.prototype.initModifierProperties = function(elem, data) {
-    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
-    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
-    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
-    this.sValue = 0;
-    this.eValue = 0;
-    this.getValue = this.processKeys;
-    this.m = data.m;
-    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
+TrimModifier.prototype.initModifierProperties = function (elem, data) {
+  this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
+  this.sValue = 0;
+  this.eValue = 0;
+  this.getValue = this.processKeys;
+  this.m = data.m;
+  this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.addShapeToModifier = function(shapeData){
-    shapeData.pathsData = [];
+TrimModifier.prototype.addShapeToModifier = function (shapeData) {
+  shapeData.pathsData = [];
 };
 
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
+TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
+  var segments = [];
+  if (e <= 1) {
+    segments.push({
+      s: s,
+      e: e,
+    });
+  } else if (s >= 1) {
+    segments.push({
+      s: s - 1,
+      e: e - 1,
+    });
+  } else {
+    segments.push({
+      s: s,
+      e: 1,
+    });
+    segments.push({
+      s: 0,
+      e: e - 1,
+    });
+  }
+  var shapeSegments = [];
+  var i;
+  var len = segments.length;
+  var segmentOb;
+  for (i = 0; i < len; i += 1) {
+    segmentOb = segments[i];
+    if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
+      var shapeS;
+      var shapeE;
+      if (segmentOb.s * totalModifierLength <= addedLength) {
+        shapeS = 0;
+      } else {
+        shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
+      }
+      if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
+        shapeE = 1;
+      } else {
+        shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
+      }
+      shapeSegments.push([shapeS, shapeE]);
+    }
+  }
+  if (!shapeSegments.length) {
+    shapeSegments.push([0, 0]);
+  }
+  return shapeSegments;
+};
+
+TrimModifier.prototype.releasePathsData = function (pathsData) {
+  var i;
+  var len = pathsData.length;
+  for (i = 0; i < len; i += 1) {
+    segmentsLengthPool.release(pathsData[i]);
+  }
+  pathsData.length = 0;
+  return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function (_isFirstFrame) {
+  var s;
+  var e;
+  if (this._mdf || _isFirstFrame) {
+    var o = (this.o.v % 360) / 360;
+    if (o < 0) {
+      o += 1;
+    }
+    if (this.s.v > 1) {
+      s = 1 + o;
+    } else if (this.s.v < 0) {
+      s = 0 + o;
+    } else {
+      s = this.s.v + o;
+    }
+    if (this.e.v > 1) {
+      e = 1 + o;
+    } else if (this.e.v < 0) {
+      e = 0 + o;
+    } else {
+      e = this.e.v + o;
+    }
+
+    if (s > e) {
+      var _s = s;
+      s = e;
+      e = _s;
+    }
+    s = Math.round(s * 10000) * 0.0001;
+    e = Math.round(e * 10000) * 0.0001;
+    this.sValue = s;
+    this.eValue = e;
+  } else {
+    s = this.sValue;
+    e = this.eValue;
+  }
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var pathsData;
+  var pathData;
+  var totalShapeLength;
+  var totalModifierLength = 0;
+
+  if (e === s) {
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].localShapeCollection.releaseShapes();
+      this.shapes[i].shape._mdf = true;
+      this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+      if (this._mdf) {
+        this.shapes[i].pathsData.length = 0;
+      }
+    }
+  } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) {
     var segments = [];
-    if (e <= 1) {
-        segments.push({
-            s: s,
-            e: e
-        });
-    } else if (s >= 1) {
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        });
-    } else {
-        segments.push({
-            s: s,
-            e: 1
-        });
-        segments.push({
-            s: 0,
-            e: e - 1
-        });
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
+    var shapeData;
+    var localShapeCollection;
     for (i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
+      shapeData = this.shapes[i];
+      // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+      if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
+        shapeData.shape.paths = shapeData.localShapeCollection;
+      } else {
+        shapePaths = shapeData.shape.paths;
+        jLen = shapePaths._length;
+        totalShapeLength = 0;
+        if (!shapeData.shape._mdf && shapeData.pathsData.length) {
+          totalShapeLength = shapeData.totalShapeLength;
         } else {
-            var shapeS, shapeE;
-            if (segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
+          pathsData = this.releasePathsData(shapeData.pathsData);
+          for (j = 0; j < jLen; j += 1) {
+            pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
+            pathsData.push(pathData);
+            totalShapeLength += pathData.totalLength;
+          }
+          shapeData.totalShapeLength = totalShapeLength;
+          shapeData.pathsData = pathsData;
         }
+
+        totalModifierLength += totalShapeLength;
+        shapeData.shape._mdf = true;
+      }
     }
-    if (!shapeSegments.length) {
-        shapeSegments.push([0, 0]);
-    }
-    return shapeSegments;
-};
-
-TrimModifier.prototype.releasePathsData = function(pathsData) {
-    var i, len = pathsData.length;
-    for (i = 0; i < len; i += 1) {
-        segments_length_pool.release(pathsData[i]);
-    }
-    pathsData.length = 0;
-    return pathsData;
-};
-
-TrimModifier.prototype.processShapes = function(_isFirstFrame) {
-    var s, e;
-    if (this._mdf || _isFirstFrame) {
-        var o = (this.o.v % 360) / 360;
-        if (o < 0) {
-            o += 1;
-        }
-        s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
-        e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
-        if (s === e) {
-
-        }
-        if (s > e) {
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        s = Math.round(s * 10000) * 0.0001;
-        e = Math.round(e * 10000) * 0.0001;
-        this.sValue = s;
-        this.eValue = e;
-    } else {
-        s = this.sValue;
-        e = this.eValue;
-    }
-    var shapePaths;
-    var i, len = this.shapes.length, j, jLen;
-    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
-
-    if (e === s) {
-        for (i = 0; i < len; i += 1) {
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape._mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-            if (this._mdf) {
-                this.shapes[i].pathsData.length = 0;
-            }
-        }
-    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for (i = 0; i < len; i += 1) {
-            shapeData = this.shapes[i];
-            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
-            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = this.releasePathsData(shapeData.pathsData);
-                    for (j = 0; j < jLen; j += 1) {
-                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape._mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0, edges;
-        for (i = len - 1; i >= 0; i -= 1) {
-            shapeData = this.shapes[i];
-            if (shapeData.shape._mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
-                if (this.m === 2 && len > 1) {
-                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]];
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if (shapeE <= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        });
-                    } else if (shapeS >= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    } else {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        });
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        if (segments.length > 1) {
-                            var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
-                            if (lastShapeInCollection.c) {
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if (this._mdf) {
-        for (i = 0; i < len; i += 1) {
-            //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
-            //Don't remove this even if it's losing cached info.
-            this.shapes[i].pathsData.length = 0;
-            this.shapes[i].shape._mdf = true;
-        }
-    }
-};
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for (i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i]);
-    }
-};
-
-TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
-    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
-    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
-    }
-    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
-    shapePath.setXYAt(points[1], points[5], 'o', pos);
-    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(points[0], points[4], 'v', pos);
-    }
-    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
+    var shapeS = s;
+    var shapeE = e;
     var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if (!shapePath) {
-        shapePath = shape_pool.newElement();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
+    var edges;
+    for (i = len - 1; i >= 0; i -= 1) {
+      shapeData = this.shapes[i];
+      if (shapeData.shape._mdf) {
+        localShapeCollection = shapeData.localShapeCollection;
+        localShapeCollection.releaseShapes();
+        // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+        if (this.m === 2 && len > 1) {
+          edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+          addedLength += shapeData.totalShapeLength;
+        } else {
+          edges = [[shapeS, shapeE]];
+        }
+        jLen = edges.length;
+        for (j = 0; j < jLen; j += 1) {
+          shapeS = edges[j][0];
+          shapeE = edges[j][1];
+          segments.length = 0;
+          if (shapeE <= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength * shapeE,
+            });
+          } else if (shapeS >= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * (shapeS - 1),
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          } else {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength,
+            });
+            segments.push({
+              s: 0,
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          }
+          var newShapesData = this.addShapes(shapeData, segments[0]);
+          if (segments[0].s !== segments[0].e) {
+            if (segments.length > 1) {
+              var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
+              if (lastShapeInCollection.c) {
+                var lastShape = newShapesData.pop();
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
+              } else {
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1]);
+              }
+            }
+            this.addPaths(newShapesData, localShapeCollection);
+          }
+        }
+        shapeData.shape.paths = localShapeCollection;
+      }
     }
-    shapes.push(shapePath);
+  } else if (this._mdf) {
     for (i = 0; i < len; i += 1) {
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for (j = 1; j < jLen; j +=1) {
-            currentLengthData = lengths[j-1];
-            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e) {
-                shapePath.c = false;
-                break;
-            } else {
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if (shapePaths[i].c && lengths.length) {
-            currentLengthData = lengths[j - 1];
-            if (addedLength <= shapeSegment.e) {
-                var segmentLength = lengths[j - 1].addedLength;
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if (shapePath._length) {
-            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
-        }
-        if (addedLength > shapeSegment.e) {
-            break;
-        }
-        if (i < len - 1) {
-            shapePath = shape_pool.newElement();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
+      // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
+      // Don't remove this even if it's losing cached info.
+      this.shapes[i].pathsData.length = 0;
+      this.shapes[i].shape._mdf = true;
     }
-    return shapes;
+  }
 };
 
+TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
+  var i;
+  var len = newPaths.length;
+  for (i = 0; i < len; i += 1) {
+    localShapeCollection.addShape(newPaths[i]);
+  }
+};
+
+TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+  shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+  shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
+  }
+  shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
+  shapePath.setXYAt(points[1], points[5], 'o', pos);
+  shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(points[0], points[4], 'v', pos);
+  }
+  shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
+  var pathsData = shapeData.pathsData;
+  var shapePaths = shapeData.shape.paths.shapes;
+  var i;
+  var len = shapeData.shape.paths._length;
+  var j;
+  var jLen;
+  var addedLength = 0;
+  var currentLengthData;
+  var segmentCount;
+  var lengths;
+  var segment;
+  var shapes = [];
+  var initPos;
+  var newShape = true;
+  if (!shapePath) {
+    shapePath = shapePool.newElement();
+    segmentCount = 0;
+    initPos = 0;
+  } else {
+    segmentCount = shapePath._length;
+    initPos = shapePath._length;
+  }
+  shapes.push(shapePath);
+  for (i = 0; i < len; i += 1) {
+    lengths = pathsData[i].lengths;
+    shapePath.c = shapePaths[i].c;
+    jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
+    for (j = 1; j < jLen; j += 1) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
+        addedLength += currentLengthData.addedLength;
+        shapePath.c = false;
+      } else if (addedLength > shapeSegment.e) {
+        shapePath.c = false;
+        break;
+      } else {
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+        addedLength += currentLengthData.addedLength;
+        segmentCount += 1;
+      }
+    }
+    if (shapePaths[i].c && lengths.length) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength <= shapeSegment.e) {
+        var segmentLength = lengths[j - 1].addedLength;
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+      } else {
+        shapePath.c = false;
+      }
+      addedLength += currentLengthData.addedLength;
+      segmentCount += 1;
+    }
+    if (shapePath._length) {
+      shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+      shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
+    }
+    if (addedLength > shapeSegment.e) {
+      break;
+    }
+    if (i < len - 1) {
+      shapePath = shapePool.newElement();
+      newShape = true;
+      shapes.push(shapePath);
+      segmentCount = 0;
+    }
+  }
+  return shapes;
+};
 
 ShapeModifiers.registerModifier('tm', TrimModifier);
-function RoundCornersModifier(){}
-extendPrototype([ShapeModifier],RoundCornersModifier);
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
-    this._isAnimated = !!this.rd.effectsSequence.length;
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, roundCorner, ShapeModifiers */
+
+function RoundCornersModifier() {}
+extendPrototype([ShapeModifier], RoundCornersModifier);
+RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
+  this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-            }
+RoundCornersModifier.prototype.processPath = function (path, round) {
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var i;
+  var len = path._length;
+  var currentV;
+  var currentI;
+  var currentO;
+  var closerV;
+  var distance;
+  var newPosPerc;
+  var index = 0;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < len; i += 1) {
+    currentV = path.v[i];
+    currentO = path.o[i];
+    currentI = path.i[i];
+    if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
+      if ((i === 0 || i === len - 1) && !path.c) {
+        clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
+        /* clonedPath.v[index] = currentV;
+                clonedPath.o[index] = currentO;
+                clonedPath.i[index] = currentI; */
+        index += 1;
+      } else {
+        if (i === 0) {
+          closerV = path.v[len - 1];
         } else {
-            cloned_path.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);
-            index += 1;
+          closerV = path.v[i - 1];
         }
-    }
-    return cloned_path;
-};
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = iX;
+        iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
+        vY = iY;
+        oX = vX - (vX - currentV[0]) * roundCorner;
+        oY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
 
-RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+        if (i === len - 1) {
+          closerV = path.v[0];
+        } else {
+          closerV = path.v[i + 1];
         }
-
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = oX;
+        oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
+        vY = oY;
+        iX = vX - (vX - currentV[0]) * roundCorner;
+        iY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
+      }
+    } else {
+      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);
+      index += 1;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  return clonedPath;
 };
 
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function PuckerAndBloatModifier(){}
-extendPrototype([ShapeModifier],PuckerAndBloatModifier);
-PuckerAndBloatModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.amount = PropertyFactory.getProp(elem,data.a,0,null,this);
-    this._isAnimated = !!this.amount.effectsSequence.length;
-};
+RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var rd = this.rd.v;
 
-PuckerAndBloatModifier.prototype.processPath = function(path, amount){
-    var percent = amount / 100;
-    var centerPoint = [0, 0];
-    var pathLength = path._length, i = 0;
-    for (i = 0; i < pathLength; i += 1) {
-        centerPoint[0] += path.v[i][0];
-        centerPoint[1] += path.v[i][1];
-    }
-    centerPoint[0] /= pathLength;
-    centerPoint[1] /= pathLength;
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var vX, vY, oX, oY, iX, iY;
-    for(i = 0; i < pathLength; i += 1) {
-        vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
-        vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
-        oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
-        oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
-        iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
-        iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
-        cloned_path.setTripleAt(vX, vY, oX, oY, iX, iY, i);
-    }
-    return cloned_path;
-};
-
-PuckerAndBloatModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var amount = this.amount.v;
-
-    if(amount !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+  if (rd !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
         }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
 };
-ShapeModifiers.registerModifier('pb',PuckerAndBloatModifier);
-function RepeaterModifier(){}
+
+ShapeModifiers.registerModifier('rd', RoundCornersModifier);
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, ShapeModifiers */
+
+function PuckerAndBloatModifier() {}
+extendPrototype([ShapeModifier], PuckerAndBloatModifier);
+PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
+  this._isAnimated = !!this.amount.effectsSequence.length;
+};
+
+PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
+  var percent = amount / 100;
+  var centerPoint = [0, 0];
+  var pathLength = path._length;
+  var i = 0;
+  for (i = 0; i < pathLength; i += 1) {
+    centerPoint[0] += path.v[i][0];
+    centerPoint[1] += path.v[i][1];
+  }
+  centerPoint[0] /= pathLength;
+  centerPoint[1] /= pathLength;
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < pathLength; i += 1) {
+    vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
+    vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
+    oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
+    oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
+    iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
+    iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
+    clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
+  }
+  return clonedPath;
+};
+
+PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var amount = this.amount.v;
+
+  if (amount !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
+        }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
+    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
+};
+ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
+
+/* global extendPrototype, ShapeModifier, TransformPropertyFactory, PropertyFactory, Matrix, ShapeModifiers */
+
+function RepeaterModifier() {}
 extendPrototype([ShapeModifier], RepeaterModifier);
 
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
-    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
-    this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
-    this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
-    this.data = data;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this._isAnimated = !!this.dynamicProperties.length;
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
+RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
+  this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
+  this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
+  this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
+  this.data = data;
+  if (!this.dynamicProperties.length) {
+    this.getValue(true);
+  }
+  this._isAnimated = !!this.dynamicProperties.length;
+  this.pMatrix = new Matrix();
+  this.rMatrix = new Matrix();
+  this.sMatrix = new Matrix();
+  this.tMatrix = new Matrix();
+  this.matrix = new Matrix();
 };
 
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
+  var dir = inv ? -1 : 1;
+  var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
+  var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
+  pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
+  rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  rMatrix.rotate(-transform.r.v * dir * perc);
+  rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+  sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
+  sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
 };
 
-RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
-    this.elem = elem;
-    this.arr = arr;
-    this.pos = pos;
-    this.elemsData = elemsData;
-    this._currentCopies = 0;
-    this._elements = [];
-    this._groups = [];
-    this.frameId = -1;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,arr[pos]);
-    var cont = 0;
-    while(pos>0){
-        pos -= 1;
-        //this._elements.unshift(arr.splice(pos,1)[0]);
-        this._elements.unshift(arr[pos]);
-        cont += 1;
-    }
-    if(this.dynamicProperties.length){
-        this.k = true;
-    }else{
-        this.getValue(true);
-    }
+RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
+  this.elem = elem;
+  this.arr = arr;
+  this.pos = pos;
+  this.elemsData = elemsData;
+  this._currentCopies = 0;
+  this._elements = [];
+  this._groups = [];
+  this.frameId = -1;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, arr[pos]);
+  while (pos > 0) {
+    pos -= 1;
+    // this._elements.unshift(arr.splice(pos,1)[0]);
+    this._elements.unshift(arr[pos]);
+  }
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
 };
 
-RepeaterModifier.prototype.resetElements = function(elements){
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._processed = false;
-        if(elements[i].ty === 'gr'){
-            this.resetElements(elements[i].it);
+RepeaterModifier.prototype.resetElements = function (elements) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._processed = false;
+    if (elements[i].ty === 'gr') {
+      this.resetElements(elements[i].it);
+    }
+  }
+};
+
+RepeaterModifier.prototype.cloneElements = function (elements) {
+  var newElements = JSON.parse(JSON.stringify(elements));
+  this.resetElements(newElements);
+  return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._render = renderFlag;
+    if (elements[i].ty === 'gr') {
+      this.changeGroupRender(elements[i].it, renderFlag);
+    }
+  }
+};
+
+RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
+  var items;
+  var itemsTransform;
+  var i;
+  var dir;
+  var cont;
+  if (this._mdf || _isFirstFrame) {
+    var copies = Math.ceil(this.c.v);
+    if (this._groups.length < copies) {
+      while (this._groups.length < copies) {
+        var group = {
+          it: this.cloneElements(this._elements),
+          ty: 'gr',
+        };
+        group.it.push({
+          a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr',
+        });
+
+        this.arr.splice(0, 0, group);
+        this._groups.splice(0, 0, group);
+        this._currentCopies += 1;
+      }
+      this.elem.reloadShapes();
+    }
+    cont = 0;
+    var renderFlag;
+    for (i = 0; i <= this._groups.length - 1; i += 1) {
+      renderFlag = cont < copies;
+      this._groups[i]._render = renderFlag;
+      this.changeGroupRender(this._groups[i].it, renderFlag);
+      cont += 1;
+    }
+
+    this._currentCopies = copies;
+    /// /
+
+    var offset = this.o.v;
+    var offsetModulo = offset % 1;
+    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+    var pProps = this.pMatrix.props;
+    var rProps = this.rMatrix.props;
+    var sProps = this.sMatrix.props;
+    this.pMatrix.reset();
+    this.rMatrix.reset();
+    this.sMatrix.reset();
+    this.tMatrix.reset();
+    this.matrix.reset();
+    var iteration = 0;
+
+    if (offset > 0) {
+      while (iteration < roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+        iteration += 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+        iteration += offsetModulo;
+      }
+    } else if (offset < 0) {
+      while (iteration > roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+        iteration -= 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
+        iteration -= offsetModulo;
+      }
+    }
+    i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+    dir = this.data.m === 1 ? 1 : -1;
+    cont = this._currentCopies;
+    var j;
+    var jLen;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      jLen = itemsTransform.length;
+      items[items.length - 1].transform.mProps._mdf = true;
+      items[items.length - 1].transform.op._mdf = true;
+      items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
+      if (iteration !== 0) {
+        if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
+          this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
         }
-    }
-};
+        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]);
+        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]);
+        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]);
 
-RepeaterModifier.prototype.cloneElements = function(elements){
-    var i, len = elements.length;
-    var newElements = JSON.parse(JSON.stringify(elements));
-    this.resetElements(newElements);
-    return newElements;
-};
-
-RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._render = renderFlag;
-        if(elements[i].ty === 'gr') {
-            this.changeGroupRender(elements[i].it, renderFlag);
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-    }
-};
-
-RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
-    var items, itemsTransform, i, dir, cont;
-    if(this._mdf || _isFirstFrame){
-        var copies = Math.ceil(this.c.v);
-        if(this._groups.length < copies){
-            while(this._groups.length < copies){
-                var group = {
-                    it:this.cloneElements(this._elements),
-                    ty:'gr'
-                };
-                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
-                
-                this.arr.splice(0,0,group);
-                this._groups.splice(0,0,group);
-                this._currentCopies += 1;
-            }
-            this.elem.reloadShapes();
-        }
-        cont = 0;
-        var renderFlag;
-        for(i = 0; i  <= this._groups.length - 1; i += 1){
-            renderFlag = cont < copies;
-            this._groups[i]._render = renderFlag;
-            this.changeGroupRender(this._groups[i].it, renderFlag);
-            cont += 1;
-        }
-        
-        this._currentCopies = copies;
-        ////
-
-        var offset = this.o.v;
-        var offsetModulo = offset%1;
-        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-        var k;
-        var tMat = this.tr.v.props;
-        var pProps = this.pMatrix.props;
-        var rProps = this.rMatrix.props;
-        var sProps = this.sMatrix.props;
-        this.pMatrix.reset();
-        this.rMatrix.reset();
-        this.sMatrix.reset();
-        this.tMatrix.reset();
         this.matrix.reset();
-        var iteration = 0;
-
-        if(offset > 0) {
-            while(iteration<roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                iteration += 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                iteration += offsetModulo;
-            }
-        } else if(offset < 0) {
-            while(iteration>roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                iteration -= 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                iteration -= offsetModulo;
-            }
+      } else {
+        this.matrix.reset();
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
-        dir = this.data.m === 1 ? 1 : -1;
-        cont = this._currentCopies;
-        var j, jLen;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            jLen = itemsTransform.length;
-            items[items.length - 1].transform.mProps._mdf = true;
-            items[items.length - 1].transform.op._mdf = true;
-            items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
-            if(iteration !== 0){
-                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                }
-                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]);
-                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]);
-                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]);
-                
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-                this.matrix.reset();
-            } else {
-                this.matrix.reset();
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-            }
-            iteration += 1;
-            cont -= 1;
-            i += dir;
-        }
-    } else {
-        cont = this._currentCopies;
-        i = 0;
-        dir = 1;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            items[items.length - 1].transform.mProps._mdf = false;
-            items[items.length - 1].transform.op._mdf = false;
-            cont -= 1;
-            i += dir;
-        }
+      }
+      iteration += 1;
+      cont -= 1;
+      i += dir;
     }
+  } else {
+    cont = this._currentCopies;
+    i = 0;
+    dir = 1;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      items[items.length - 1].transform.mProps._mdf = false;
+      items[items.length - 1].transform.op._mdf = false;
+      cont -= 1;
+      i += dir;
+    }
+  }
 };
 
-RepeaterModifier.prototype.addShape = function(){};
+RepeaterModifier.prototype.addShape = function () {};
 
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = createSizedArray(this._maxLength);
+ShapeModifiers.registerModifier('rp', RepeaterModifier);
+
+/* global createSizedArray, shapePool */
+
+function ShapeCollection() {
+  this._length = 0;
+  this._maxLength = 4;
+  this.shapes = createSizedArray(this._maxLength);
 }
 
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
+ShapeCollection.prototype.addShape = function (shapeData) {
+  if (this._length === this._maxLength) {
+    this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
+    this._maxLength *= 2;
+  }
+  this.shapes[this._length] = shapeData;
+  this._length += 1;
 };
 
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
+ShapeCollection.prototype.releaseShapes = function () {
+  var i;
+  for (i = 0; i < this._length; i += 1) {
+    shapePool.release(this.shapes[i]);
+  }
+  this._length = 0;
 };
+
+/* global createSizedArray, createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
 function DashProperty(elem, data, renderer, container) {
-    this.elem = elem;
-    this.frameId = -1;
-    this.dataProps = createSizedArray(data.length);
-    this.renderer = renderer;
-    this.k = false;
-    this.dashStr = '';
-    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
-    this.dashoffset = createTypedArray('float32',  1);
-    this.initDynamicPropertyContainer(container);
-    var i, len = data.length || 0, prop;
-    for(i = 0; i < len; i += 1) {
-        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
-        this.k = prop.k || this.k;
-        this.dataProps[i] = {n:data[i].n,p:prop};
-    }
-    if(!this.k){
-        this.getValue(true);
-    }
-    this._isAnimated = this.k;
+  this.elem = elem;
+  this.frameId = -1;
+  this.dataProps = createSizedArray(data.length);
+  this.renderer = renderer;
+  this.k = false;
+  this.dashStr = '';
+  this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
+  this.dashoffset = createTypedArray('float32', 1);
+  this.initDynamicPropertyContainer(container);
+  var i;
+  var len = data.length || 0;
+  var prop;
+  for (i = 0; i < len; i += 1) {
+    prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
+    this.k = prop.k || this.k;
+    this.dataProps[i] = { n: data[i].n, p: prop };
+  }
+  if (!this.k) {
+    this.getValue(true);
+  }
+  this._isAnimated = this.k;
 }
 
-DashProperty.prototype.getValue = function(forceRender) {
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
+DashProperty.prototype.getValue = function (forceRender) {
+  if (this.elem.globalData.frameId === this.frameId && !forceRender) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
+  this._mdf = this._mdf || forceRender;
+  if (this._mdf) {
+    var i = 0;
+    var len = this.dataProps.length;
+    if (this.renderer === 'svg') {
+      this.dashStr = '';
     }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
-    this._mdf = this._mdf || forceRender;
-    if (this._mdf) {
-        var i = 0, len = this.dataProps.length;
-        if(this.renderer === 'svg') {
-            this.dashStr = '';
+    for (i = 0; i < len; i += 1) {
+      if (this.dataProps[i].n !== 'o') {
+        if (this.renderer === 'svg') {
+          this.dashStr += ' ' + this.dataProps[i].p.v;
+        } else {
+          this.dashArray[i] = this.dataProps[i].p.v;
         }
-        for(i=0;i<len;i+=1){
-            if(this.dataProps[i].n != 'o'){
-                if(this.renderer === 'svg') {
-                    this.dashStr += ' ' + this.dataProps[i].p.v;
-                }else{
-                    this.dashArray[i] = this.dataProps[i].p.v;
-                }
-            }else{
-                this.dashoffset[0] = this.dataProps[i].p.v;
-            }
-        }
+      } else {
+        this.dashoffset[0] = this.dataProps[i].p.v;
+      }
     }
+  }
 };
 extendPrototype([DynamicPropertyContainer], DashProperty);
-function GradientProperty(elem,data,container){
-    this.data = data;
-    this.c = createTypedArray('uint8c', data.p*4);
-    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-    this.o = createTypedArray('float32', cLength);
-    this._cmdf = false;
-    this._omdf = false;
-    this._collapsable = this.checkCollapsable();
-    this._hasOpacity = cLength;
-    this.initDynamicPropertyContainer(container);
-    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
-    this.k = this.prop.k;
-    this.getValue(true);
+
+/* global createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+function GradientProperty(elem, data, container) {
+  this.data = data;
+  this.c = createTypedArray('uint8c', data.p * 4);
+  var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;
+  this.o = createTypedArray('float32', cLength);
+  this._cmdf = false;
+  this._omdf = false;
+  this._collapsable = this.checkCollapsable();
+  this._hasOpacity = cLength;
+  this.initDynamicPropertyContainer(container);
+  this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
+  this.k = this.prop.k;
+  this.getValue(true);
 }
 
-GradientProperty.prototype.comparePoints = function(values, points) {
-    var i = 0, len = this.o.length/2, diff;
-    while(i < len) {
-        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
-        if(diff > 0.01){
-            return false;
-        }
-        i += 1;
+GradientProperty.prototype.comparePoints = function (values, points) {
+  var i = 0;
+  var len = this.o.length / 2;
+  var diff;
+  while (i < len) {
+    diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
+    if (diff > 0.01) {
+      return false;
     }
-    return true;
+    i += 1;
+  }
+  return true;
 };
 
-GradientProperty.prototype.checkCollapsable = function() {
-    if (this.o.length/2 !== this.c.length/4) {
+GradientProperty.prototype.checkCollapsable = function () {
+  if (this.o.length / 2 !== this.c.length / 4) {
+    return false;
+  }
+  if (this.data.k.k[0].s) {
+    var i = 0;
+    var len = this.data.k.k.length;
+    while (i < len) {
+      if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
         return false;
+      }
+      i += 1;
     }
-    if (this.data.k.k[0].s) {
-        var i = 0, len = this.data.k.k.length;
-        while (i < len) {
-            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
-                return false;
-            }
-            i += 1;
-        }
-    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
-        return false;
-    }
-    return true;
+  } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
+    return false;
+  }
+  return true;
 };
 
-GradientProperty.prototype.getValue = function(forceRender){
-    this.prop.getValue();
-    this._mdf = false;
-    this._cmdf = false;
-    this._omdf = false;
-    if(this.prop._mdf || forceRender){
-        var i, len = this.data.p*4;
-        var mult, val;
-        for(i=0;i<len;i+=1){
-            mult = i%4 === 0 ? 100 : 255;
-            val = Math.round(this.prop.v[i]*mult);
-            if(this.c[i] !== val){
-                this.c[i] = val;
-                this._cmdf = !forceRender;
-            }
-        }
-        if(this.o.length){
-            len = this.prop.v.length;
-            for(i=this.data.p*4;i<len;i+=1){
-                mult = i%2 === 0 ? 100 : 1;
-                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                if(this.o[i-this.data.p*4] !== val){
-                    this.o[i-this.data.p*4] = val;
-                    this._omdf = !forceRender;
-                }
-            }
-        }
-        this._mdf = !forceRender;
+GradientProperty.prototype.getValue = function (forceRender) {
+  this.prop.getValue();
+  this._mdf = false;
+  this._cmdf = false;
+  this._omdf = false;
+  if (this.prop._mdf || forceRender) {
+    var i;
+    var len = this.data.p * 4;
+    var mult;
+    var val;
+    for (i = 0; i < len; i += 1) {
+      mult = i % 4 === 0 ? 100 : 255;
+      val = Math.round(this.prop.v[i] * mult);
+      if (this.c[i] !== val) {
+        this.c[i] = val;
+        this._cmdf = !forceRender;
+      }
     }
+    if (this.o.length) {
+      len = this.prop.v.length;
+      for (i = this.data.p * 4; i < len; i += 1) {
+        mult = i % 2 === 0 ? 100 : 1;
+        val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
+        if (this.o[i - this.data.p * 4] !== val) {
+          this.o[i - this.data.p * 4] = val;
+          this._omdf = !forceRender;
+        }
+      }
+    }
+    this._mdf = !forceRender;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], GradientProperty);
-var buildShapeString = function(pathNodes, length, closed, mat) {
-	if(length === 0) {
-            return '';
-        }
-        var _o = pathNodes.o;
-        var _i = pathNodes.i;
-        var _v = pathNodes.v;
-        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
-        for(i = 1; i < length; i += 1) {
-            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]);
-        }
-        if (closed && length) {
-            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]);
-            shapeString += 'z';
-        }
-        return shapeString;
-}
-var audioControllerFactory = (function() {
 
-	function AudioController(audioFactory) {
-		this.audios = [];
-		this.audioFactory = audioFactory;
-		this._volume = 1;
-		this._isMuted = false;
-	}
+/* exported buildShapeString */
 
-	AudioController.prototype = {
-		addAudio: function(audio) {
-			this.audios.push(audio);
-		},
-		pause: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].pause()
-			}
-		},
-		resume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].resume()
-			}
-		},
-		setRate: function(rateValue) {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].setRate(rateValue)
-			}
-		},
-		createAudio: function(assetPath) {
-			if (this.audioFactory) {
-				return this.audioFactory(assetPath);
-			} else if (Howl) {
-				return new Howl({
-					src: [assetPath]
-				})
-			} else {
-				return {
-					isPlaying: false,
-					play: function(){this.isPlaying = true},
-					seek: function(){this.isPlaying = false},
-					playing: function(){},
-					rate: function(){},
-					setVolume: function(){},
-				}
-			}
-		},
-		setAudioFactory: function(audioFactory) {
-			this.audioFactory = audioFactory;
-		},
-		setVolume: function(value) {
-			this._volume = value;
-			this._updateVolume();
-		},
-		mute: function() {
-			this._isMuted = true;
-			this._updateVolume();
-		},
-		unmute: function() {
-			this._isMuted = false;
-			this._updateVolume();
-		},
-		getVolume: function(value) {
-			return this._volume;
-		},
-		_updateVolume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1))
-			}
-		}
-	}
-
-	return function() {
-		return new AudioController()
-	}
-
-}())
-var ImagePreloader = (function(){
-
-    var proxyImage = (function(){
-        var canvas = createTag('canvas');
-        canvas.width = 1;
-        canvas.height = 1;
-        var ctx = canvas.getContext('2d');
-        ctx.fillStyle = 'rgba(0,0,0,0)';
-        ctx.fillRect(0, 0, 1, 1);
-        return canvas;
-    }())
-
-    function imageLoaded(){
-        this.loadedAssets += 1;
-        if(this.loadedAssets === this.totalImages){
-            if(this.imagesLoadedCb) {
-                this.imagesLoadedCb(null);
-            }
-        }
-    }
-
-    function getAssetsPath(assetData, assetsPath, original_path) {
-        var path = '';
-        if (assetData.e) {
-            path = assetData.p;
-        } else if(assetsPath) {
-            var imagePath = assetData.p;
-            if (imagePath.indexOf('images/') !== -1) {
-                imagePath = imagePath.split('/')[1];
-            }
-            path = assetsPath + imagePath;
-        } else {
-            path = original_path;
-            path += assetData.u ? assetData.u : '';
-            path += assetData.p;
-        }
-        return path;
-    }
-
-    function testImageLoaded(img) {
-        var _count = 0;
-        var intervalId = setInterval(function() {
-            var box = img.getBBox();
-            if (box.width || _count > 500) {
-                this._imageLoaded();
-                clearInterval(intervalId);
-            }
-            _count += 1;
-        }.bind(this), 50)
-    }
-
-    function createImageData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createNS('image');
-        if (isSafari) {
-            this.testImageLoaded(img)
-        } else {
-            img.addEventListener('load', this._imageLoaded, false);
-        }
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.setAttributeNS('http://www.w3.org/1999/xlink','href', path);
-        this._elementHelper.append(img);
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function createImgData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createTag('img');
-        img.crossOrigin = 'anonymous';
-        img.addEventListener('load', this._imageLoaded, false);
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.src = path;
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function loadAssets(assets, cb){
-        this.imagesLoadedCb = cb;
-        var i, len = assets.length;
-        for (i = 0; i < len; i += 1) {
-            if(!assets[i].layers){
-                this.totalImages += 1;
-                this.images.push(this._createImageData(assets[i]));
-            }
-        }
-    }
-
-    function setPath(path){
-        this.path = path || '';
-    }
-
-    function setAssetsPath(path){
-        this.assetsPath = path || '';
-    }
-
-    function getImage(assetData) {
-        var i = 0, len = this.images.length;
-        while (i < len) {
-            if (this.images[i].assetData === assetData) {
-                return this.images[i].img;
-            }
-            i += 1;
-        }
-    }
-
-    function destroy() {
-        this.imagesLoadedCb = null;
-        this.images.length = 0;
-    }
-
-    function loaded() {
-        return this.totalImages === this.loadedAssets;
-    }
-
-    function setCacheType(type, elementHelper) {
-        if (type === 'svg') {
-            this._elementHelper = elementHelper;
-            this._createImageData = this.createImageData.bind(this);
-        } else {
-            this._createImageData = this.createImgData.bind(this);
-        }
-    }
-
-    function ImagePreloader(type){
-        this._imageLoaded = imageLoaded.bind(this);
-        this.testImageLoaded = testImageLoaded.bind(this);
-        this.assetsPath = '';
-        this.path = '';
-        this.totalImages = 0;
-        this.loadedAssets = 0;
-        this.imagesLoadedCb = null;
-        this.images = [];
-    };
-
-    ImagePreloader.prototype = {
-        loadAssets: loadAssets,
-        setAssetsPath: setAssetsPath,
-        setPath: setPath,
-        loaded: loaded,
-        destroy: destroy,
-        getImage: getImage,
-        createImgData: createImgData,
-        createImageData: createImageData,
-        imageLoaded: imageLoaded,
-        setCacheType: setCacheType,
-    }
-
-    return ImagePreloader;
-}());
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	};
-	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)) {
-	   ob.maskType = false;
-	}
-	return ob;
-}());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
-
-	function createFilter(filId){
-        	var fil = createNS('filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
-
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = createNS('feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
-                return feColorMatrix;
-	}
-
-	return ob;
-}());
-var assetLoader = (function(){
-
-	function formatResponse(xhr) {
-		if(xhr.response && typeof xhr.response === 'object') {
-			return xhr.response;
-		} else if(xhr.response && typeof xhr.response === 'string') {
-			return JSON.parse(xhr.response);
-		} else if(xhr.responseText) {
-			return JSON.parse(xhr.responseText);
-		}
-	}
-
-	function loadAsset(path, callback, errorCallback) {
-		var response;
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', path, true);
-		// set responseType after calling open or IE will break.
-		try {
-		    // This crashes on Android WebView prior to KitKat
-		    xhr.responseType = "json";
-		} catch (err) {}
-	    xhr.send();
-	    xhr.onreadystatechange = function () {
-	        if (xhr.readyState == 4) {
-	            if(xhr.status == 200){
-	            	response = formatResponse(xhr);
-	            	callback(response);
-	            }else{
-	                try{
-	            		response = formatResponse(xhr);
-	            		callback(response);
-	                }catch(err){
-	                	if(errorCallback) {
-	                		errorCallback(err);
-	                	}
-	                }
-	            }
-	        }
-	    };
-	}
-	return {
-		load: loadAsset
-	}
-}())
-
-function TextAnimatorProperty(textData, renderType, elem){
-    this._isFirstFrame = true;
-	this._hasMaskedPath = false;
-	this._frameId = -1;
-	this._textData = textData;
-	this._renderType = renderType;
-    this._elem = elem;
-	this._animatorsData = createSizedArray(this._textData.a.length);
-	this._pathData = {};
-	this._moreOptions = {
-		alignment: {}
-	};
-	this.renderedLetters = [];
-    this.lettersChangedFlag = false;
-    this.initDynamicPropertyContainer(elem);
-
-}
-
-TextAnimatorProperty.prototype.searchProperties = function(){
-    var i, len = this._textData.a.length, animatorProps;
-    var getProp = PropertyFactory.getProp;
-    for(i=0;i<len;i+=1){
-        animatorProps = this._textData.a[i];
-        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
-    }
-    if(this._textData.p && 'm' in this._textData.p){
-        this._pathData = {
-            f: getProp(this._elem,this._textData.p.f,0,0,this),
-            l: getProp(this._elem,this._textData.p.l,0,0,this),
-            r: this._textData.p.r,
-            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
-        };
-        this._hasMaskedPath = true;
-    } else {
-        this._hasMaskedPath = false;
-    }
-    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+var buildShapeString = function (pathNodes, length, closed, mat) {
+  if (length === 0) {
+    return '';
+  }
+  var _o = pathNodes.o;
+  var _i = pathNodes.i;
+  var _v = pathNodes.v;
+  var i;
+  var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+  for (i = 1; i < length; i += 1) {
+    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]);
+  }
+  if (closed && length) {
+    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]);
+    shapeString += 'z';
+  }
+  return shapeString;
 };
 
-TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
-    this.lettersChangedFlag = lettersChangedFlag;
-    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
-        return;
+/* global Howl */
+/* exported audioControllerFactory */
+
+var audioControllerFactory = (function () {
+  function AudioController(audioFactory) {
+    this.audios = [];
+    this.audioFactory = audioFactory;
+    this._volume = 1;
+    this._isMuted = false;
+  }
+
+  AudioController.prototype = {
+    addAudio: function (audio) {
+      this.audios.push(audio);
+    },
+    pause: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].pause();
+      }
+    },
+    resume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].resume();
+      }
+    },
+    setRate: function (rateValue) {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].setRate(rateValue);
+      }
+    },
+    createAudio: function (assetPath) {
+      if (this.audioFactory) {
+        return this.audioFactory(assetPath);
+      } if (Howl) {
+        return new Howl({
+          src: [assetPath],
+        });
+      }
+      return {
+        isPlaying: false,
+        play: function () { this.isPlaying = true; },
+        seek: function () { this.isPlaying = false; },
+        playing: function () {},
+        rate: function () {},
+        setVolume: function () {},
+      };
+    },
+    setAudioFactory: function (audioFactory) {
+      this.audioFactory = audioFactory;
+    },
+    setVolume: function (value) {
+      this._volume = value;
+      this._updateVolume();
+    },
+    mute: function () {
+      this._isMuted = true;
+      this._updateVolume();
+    },
+    unmute: function () {
+      this._isMuted = false;
+      this._updateVolume();
+    },
+    getVolume: function () {
+      return this._volume;
+    },
+    _updateVolume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
+      }
+    },
+  };
+
+  return function () {
+    return new AudioController();
+  };
+}());
+
+/* global createTag, createNS, isSafari */
+/* exported ImagePreloader */
+
+var ImagePreloader = (function () {
+  var proxyImage = (function () {
+    var canvas = createTag('canvas');
+    canvas.width = 1;
+    canvas.height = 1;
+    var ctx = canvas.getContext('2d');
+    ctx.fillStyle = 'rgba(0,0,0,0)';
+    ctx.fillRect(0, 0, 1, 1);
+    return canvas;
+  }());
+
+  function imageLoaded() {
+    this.loadedAssets += 1;
+    if (this.loadedAssets === this.totalImages) {
+      if (this.imagesLoadedCb) {
+        this.imagesLoadedCb(null);
+      }
     }
-    this._isFirstFrame = false;
-    var alignment = this._moreOptions.alignment.v;
-    var animators = this._animatorsData;
-    var textData = this._textData;
-    var matrixHelper = this.mHelper;
-    var renderType = this._renderType;
-    var renderedLettersCount = this.renderedLetters.length;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
-    if(this._hasMaskedPath) {
-        mask = this._pathData.m;
-        if(!this._pathData.n || this._pathData._mdf){
-            var paths = mask.v;
-            if(this._pathData.r){
-                paths = paths.reverse();
-            }
-            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
-            pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths._length - 1;
-            var bezierData;
-            totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            this._pathData.pi = pathInfo;
-        }
-        pathInfo = this._pathData.pi;
+  }
 
-        currentLength = this._pathData.f.v;
-        segmentInd = 0;
-        pointInd = 1;
-        segmentLength = 0;
-        flag = true;
-        segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].points;
-                    pointInd = points.length - 1;
-                }
-            }
+  function getAssetsPath(assetData, assetsPath, originalPath) {
+    var path = '';
+    if (assetData.e) {
+      path = assetData.p;
+    } else if (assetsPath) {
+      var imagePath = assetData.p;
+      if (imagePath.indexOf('images/') !== -1) {
+        imagePath = imagePath.split('/')[1];
+      }
+      path = assetsPath + imagePath;
+    } else {
+      path = originalPath;
+      path += assetData.u ? assetData.u : '';
+      path += assetData.p;
+    }
+    return path;
+  }
 
+  function testImageLoaded(img) {
+    var _count = 0;
+    var intervalId = setInterval(function () {
+      var box = img.getBBox();
+      if (box.width || _count > 500) {
+        this._imageLoaded();
+        clearInterval(intervalId);
+      }
+      _count += 1;
+    }.bind(this), 50);
+  }
+
+  function createImageData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createNS('image');
+    if (isSafari) {
+      this.testImageLoaded(img);
+    } else {
+      img.addEventListener('load', this._imageLoaded, false);
+    }
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
+    this._elementHelper.append(img);
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function createImgData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createTag('img');
+    img.crossOrigin = 'anonymous';
+    img.addEventListener('load', this._imageLoaded, false);
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.src = path;
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function loadAssets(assets, cb) {
+    this.imagesLoadedCb = cb;
+    var i;
+    var len = assets.length;
+    for (i = 0; i < len; i += 1) {
+      if (!assets[i].layers) {
+        this.totalImages += 1;
+        this.images.push(this._createImageData(assets[i]));
+      }
+    }
+  }
+
+  function setPath(path) {
+    this.path = path || '';
+  }
+
+  function setAssetsPath(path) {
+    this.assetsPath = path || '';
+  }
+
+  function getImage(assetData) {
+    var i = 0;
+    var len = this.images.length;
+    while (i < len) {
+      if (this.images[i].assetData === assetData) {
+        return this.images[i].img;
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function destroy() {
+    this.imagesLoadedCb = null;
+    this.images.length = 0;
+  }
+
+  function loaded() {
+    return this.totalImages === this.loadedAssets;
+  }
+
+  function setCacheType(type, elementHelper) {
+    if (type === 'svg') {
+      this._elementHelper = elementHelper;
+      this._createImageData = this.createImageData.bind(this);
+    } else {
+      this._createImageData = this.createImgData.bind(this);
+    }
+  }
+
+  function ImagePreloaderFactory() {
+    this._imageLoaded = imageLoaded.bind(this);
+    this.testImageLoaded = testImageLoaded.bind(this);
+    this.assetsPath = '';
+    this.path = '';
+    this.totalImages = 0;
+    this.loadedAssets = 0;
+    this.imagesLoadedCb = null;
+    this.images = [];
+  }
+
+  ImagePreloaderFactory.prototype = {
+    loadAssets: loadAssets,
+    setAssetsPath: setAssetsPath,
+    setPath: setPath,
+    loaded: loaded,
+    destroy: destroy,
+    getImage: getImage,
+    createImgData: createImgData,
+    createImageData: createImageData,
+    imageLoaded: imageLoaded,
+    setCacheType: setCacheType,
+  };
+
+  return ImagePreloaderFactory;
+}());
+
+/* exported featureSupport */
+
+var featureSupport = (function () {
+  var ob = {
+    maskType: true,
+  };
+  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)) {
+    ob.maskType = false;
+  }
+  return ob;
+}());
+
+/* global createNS */
+/* exported filtersFactory */
+
+var filtersFactory = (function () {
+  var ob = {};
+  ob.createFilter = createFilter;
+  ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
+
+  function createFilter(filId) {
+    var fil = createNS('filter');
+    fil.setAttribute('id', filId);
+    fil.setAttribute('filterUnits', 'objectBoundingBox');
+    fil.setAttribute('x', '0%');
+    fil.setAttribute('y', '0%');
+    fil.setAttribute('width', '100%');
+    fil.setAttribute('height', '100%');
+    return fil;
+  }
+
+  function createAlphaToLuminanceFilter() {
+    var feColorMatrix = createNS('feColorMatrix');
+    feColorMatrix.setAttribute('type', 'matrix');
+    feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+    feColorMatrix.setAttribute('values', '0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
+    return feColorMatrix;
+  }
+
+  return ob;
+}());
+
+/* exported assetLoader */
+
+var assetLoader = (function () {
+  function formatResponse(xhr) {
+    if (xhr.response && typeof xhr.response === 'object') {
+      return xhr.response;
+    } if (xhr.response && typeof xhr.response === 'string') {
+      return JSON.parse(xhr.response);
+    } if (xhr.responseText) {
+      return JSON.parse(xhr.responseText);
+    }
+    return null;
+  }
+
+  function loadAsset(path, callback, errorCallback) {
+    var response;
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', path, true);
+    // set responseType after calling open or IE will break.
+    try {
+      // This crashes on Android WebView prior to KitKat
+      xhr.responseType = 'json';
+    } catch (err) {} // eslint-disable-line no-empty
+    xhr.send();
+    xhr.onreadystatechange = function () {
+      if (xhr.readyState === 4) {
+        if (xhr.status === 200) {
+          response = formatResponse(xhr);
+          callback(response);
+        } else {
+          try {
+            response = formatResponse(xhr);
+            callback(response);
+          } catch (err) {
+            if (errorCallback) {
+              errorCallback(err);
+            }
+          }
         }
+      }
+    };
+  }
+  return {
+    load: loadAsset,
+  };
+}());
+
+/* global createSizedArray, PropertyFactory, TextAnimatorDataProperty, bez, addHueToRGB,
+  addSaturationToRGB, addBrightnessToRGB, LetterProps, Matrix, extendPrototype, DynamicPropertyContainer */
+
+function TextAnimatorProperty(textData, renderType, elem) {
+  this._isFirstFrame = true;
+  this._hasMaskedPath = false;
+  this._frameId = -1;
+  this._textData = textData;
+  this._renderType = renderType;
+  this._elem = elem;
+  this._animatorsData = createSizedArray(this._textData.a.length);
+  this._pathData = {};
+  this._moreOptions = {
+    alignment: {},
+  };
+  this.renderedLetters = [];
+  this.lettersChangedFlag = false;
+  this.initDynamicPropertyContainer(elem);
+}
+
+TextAnimatorProperty.prototype.searchProperties = function () {
+  var i;
+  var len = this._textData.a.length;
+  var animatorProps;
+  var getProp = PropertyFactory.getProp;
+  for (i = 0; i < len; i += 1) {
+    animatorProps = this._textData.a[i];
+    this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+  }
+  if (this._textData.p && 'm' in this._textData.p) {
+    this._pathData = {
+      f: getProp(this._elem, this._textData.p.f, 0, 0, this),
+      l: getProp(this._elem, this._textData.p.l, 0, 0, this),
+      r: this._textData.p.r,
+      m: this._elem.maskManager.getMaskProperty(this._textData.p.m),
+    };
+    this._hasMaskedPath = true;
+  } else {
+    this._hasMaskedPath = false;
+  }
+  this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
+};
+
+TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
+  this.lettersChangedFlag = lettersChangedFlag;
+  if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+    return;
+  }
+  this._isFirstFrame = false;
+  var alignment = this._moreOptions.alignment.v;
+  var animators = this._animatorsData;
+  var textData = this._textData;
+  var matrixHelper = this.mHelper;
+  var renderType = this._renderType;
+  var renderedLettersCount = this.renderedLetters.length;
+  var xPos;
+  var yPos;
+  var i;
+  var len;
+  var letters = documentData.l;
+  var pathInfo;
+  var currentLength;
+  var currentPoint;
+  var segmentLength;
+  var flag;
+  var pointInd;
+  var segmentInd;
+  var prevPoint;
+  var points;
+  var segments;
+  var partialLength;
+  var totalLength;
+  var perc;
+  var tanAngle;
+  var mask;
+  if (this._hasMaskedPath) {
+    mask = this._pathData.m;
+    if (!this._pathData.n || this._pathData._mdf) {
+      var paths = mask.v;
+      if (this._pathData.r) {
+        paths = paths.reverse();
+      }
+      // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+      pathInfo = {
+        tLength: 0,
+        segments: [],
+      };
+      len = paths._length - 1;
+      var bezierData;
+      totalLength = 0;
+      for (i = 0; i < len; i += 1) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      i = len;
+      if (mask.v.c) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      this._pathData.pi = pathInfo;
+    }
+    pathInfo = this._pathData.pi;
+
+    currentLength = this._pathData.f.v;
+    segmentInd = 0;
+    pointInd = 1;
+    segmentLength = 0;
+    flag = true;
+    segments = pathInfo.segments;
+    if (currentLength < 0 && mask.v.c) {
+      if (pathInfo.tLength < Math.abs(currentLength)) {
+        currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+      }
+      segmentInd = segments.length - 1;
+      points = segments[segmentInd].points;
+      pointInd = points.length - 1;
+      while (currentLength < 0) {
+        currentLength += points[pointInd].partialLength;
+        pointInd -= 1;
+        if (pointInd < 0) {
+          segmentInd -= 1;
+          points = segments[segmentInd].points;
+          pointInd = points.length - 1;
+        }
+      }
+    }
+    points = segments[segmentInd].points;
+    prevPoint = points[pointInd - 1];
+    currentPoint = points[pointInd];
+    partialLength = currentPoint.partialLength;
+  }
+
+  len = letters.length;
+  xPos = 0;
+  yPos = 0;
+  var yOff = documentData.finalSize * 1.2 * 0.714;
+  var firstLine = true;
+  var animatorProps;
+  var animatorSelector;
+  var j;
+  var jLen;
+  var letterValue;
+
+  jLen = animators.length;
+
+  var mult;
+  var ind = -1;
+  var offf;
+  var xPathPos;
+  var yPathPos;
+  var initPathPos = currentLength;
+  var initSegmentInd = segmentInd;
+  var initPointInd = pointInd;
+  var currentLine = -1;
+  var elemOpacity;
+  var sc;
+  var sw;
+  var fc;
+  var k;
+  var letterSw;
+  var letterSc;
+  var letterFc;
+  var letterM = '';
+  var letterP = this.defaultPropsArray;
+  var letterO;
+
+  //
+  if (documentData.j === 2 || documentData.j === 1) {
+    var animatorJustifyOffset = 0;
+    var animatorFirstCharOffset = 0;
+    var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+    var lastIndex = 0;
+    var isNewLine = true;
+
+    for (i = 0; i < len; i += 1) {
+      if (letters[i].n) {
+        if (animatorJustifyOffset) {
+          animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while (lastIndex < i) {
+          letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+          lastIndex += 1;
+        }
+        animatorJustifyOffset = 0;
+        isNewLine = true;
+      } else {
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.t.propType) {
+            if (isNewLine && documentData.j === 2) {
+              animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+            }
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
+            } else {
+              animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
+            }
+          }
+        }
+        isNewLine = false;
+      }
+    }
+    if (animatorJustifyOffset) {
+      animatorJustifyOffset += animatorFirstCharOffset;
+    }
+    while (lastIndex < i) {
+      letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+      lastIndex += 1;
+    }
+  }
+  //
+
+  for (i = 0; i < len; i += 1) {
+    matrixHelper.reset();
+    elemOpacity = 1;
+    if (letters[i].n) {
+      xPos = 0;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      currentLength = initPathPos;
+      firstLine = false;
+      if (this._hasMaskedPath) {
+        segmentInd = initSegmentInd;
+        pointInd = initPointInd;
         points = segments[segmentInd].points;
         prevPoint = points[pointInd - 1];
         currentPoint = points[pointInd];
         partialLength = currentPoint.partialLength;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.finalSize * 1.2 * 0.714;
-    var firstLine = true;
-    var animatorProps, animatorSelector;
-    var j, jLen;
-    var letterValue;
-
-    jLen = animators.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
-
-    //
-    if(documentData.j === 2 || documentData.j === 1) {
-        var animatorJustifyOffset = 0;
-        var animatorFirstCharOffset = 0;
-        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
-        var lastIndex = 0;
-        var isNewLine = true;
-
-        for (i = 0; i < len; i += 1) {
-            if (letters[i].n) {
-                if(animatorJustifyOffset) {
-                    animatorJustifyOffset += animatorFirstCharOffset;
-                }
-                while (lastIndex < i) {
-                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-                    lastIndex += 1;
-                }
-                animatorJustifyOffset = 0;
-                isNewLine = true;
+        segmentLength = 0;
+      }
+      letterM = '';
+      letterFc = '';
+      letterSw = '';
+      letterO = '';
+      letterP = this.defaultPropsArray;
+    } else {
+      if (this._hasMaskedPath) {
+        if (currentLine !== letters[i].line) {
+          switch (documentData.j) {
+            case 1:
+              currentLength += totalLength - documentData.lineWidths[letters[i].line];
+              break;
+            case 2:
+              currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
+              break;
+            default:
+              break;
+          }
+          currentLine = letters[i].line;
+        }
+        if (ind !== letters[i].ind) {
+          if (letters[ind]) {
+            currentLength += letters[ind].extra;
+          }
+          currentLength += letters[i].an / 2;
+          ind = letters[i].ind;
+        }
+        currentLength += (alignment[0] * letters[i].an) * 0.005;
+        var animatorOffset = 0;
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.p.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.p.v[0] * mult[0];
             } else {
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.t.propType) {
-                        if (isNewLine && documentData.j === 2) {
-                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
-                        }
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
-                        if (mult.length) {
-                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
-                        } else {
-                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
-                        }
-                    }
-                }
-                isNewLine = false;
+              animatorOffset += animatorProps.p.v[0] * mult;
             }
+          }
+          if (animatorProps.a.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.a.v[0] * mult[0];
+            } else {
+              animatorOffset += animatorProps.a.v[0] * mult;
+            }
+          }
         }
-        if(animatorJustifyOffset) {
-            animatorJustifyOffset += animatorFirstCharOffset;
-        }
-        while(lastIndex < i) {
-            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-            lastIndex += 1;
-        }
-    }
-    //
-
-    for( i = 0; i < len; i += 1) {
-
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this._hasMaskedPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
+        flag = true;
+        while (flag) {
+          if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+            matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01);
+            flag = false;
+          } else if (points) {
+            segmentLength += currentPoint.partialLength;
+            pointInd += 1;
+            if (pointInd >= points.length) {
+              pointInd = 0;
+              segmentInd += 1;
+              if (!segments[segmentInd]) {
+                if (mask.v.c) {
+                  pointInd = 0;
+                  segmentInd = 0;
+                  points = segments[segmentInd].points;
+                } else {
+                  segmentLength -= currentPoint.partialLength;
+                  points = null;
+                }
+              } else {
                 points = segments[segmentInd].points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
+              }
             }
-            letterO = letterSw = letterFc = letterM = '';
-            letterP = this.defaultPropsArray;
-        }else{
-            if(this._hasMaskedPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += alignment[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.p.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
+            if (points) {
+              prevPoint = currentPoint;
+              currentPoint = points[pointInd];
+              partialLength = currentPoint.partialLength;
+            }
+          }
+        }
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
+      } else {
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
 
-                    }
-                    if (animatorProps.a.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
+        // Grouping alignment
+        matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0);
+      }
 
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.t.propType) {
+          animatorSelector = animators[j].s;
+          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"
+          if (xPos !== 0 || documentData.j !== 0) {
+            if (this._hasMaskedPath) {
+              if (mult.length) {
+                currentLength += animatorProps.t.v * mult[0];
+              } else {
+                currentLength += animatorProps.t.v * mult;
+              }
+            } else if (mult.length) {
+              xPos += animatorProps.t.v * mult[0];
             } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+              xPos += animatorProps.t.v * mult;
             }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.t.propType) {
-                    animatorSelector = animators[j].s;
-                    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"
-                    if(xPos !== 0 || documentData.j !== 0) {
-                        if(this._hasMaskedPath) {
-                            if(mult.length) {
-                                currentLength += animatorProps.t.v*mult[0];
-                            } else {
-                                currentLength += animatorProps.t.v*mult;
-                            }
-                        }else{
-                            if(mult.length) {
-                                xPos += animatorProps.t.v*mult[0];
-                            } else {
-                                xPos += animatorProps.t.v*mult;
-                            }
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim && documentData.fc) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.a.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.s.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = animators[j].a;
-                animatorSelector = animators[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                if (animatorProps.sk.propType) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if (animatorProps.r.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if (animatorProps.ry.propType) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if (animatorProps.rx.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if (animatorProps.o.propType) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
-                        } else {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim && documentData.fc) {
-                    if(animatorProps.fc.propType){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                            }
-                        }
-                    }
-                    if(animatorProps.fh.propType){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if(animatorProps.fs.propType){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if(animatorProps.fb.propType){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-
-                if (animatorProps.p.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(this._hasMaskedPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim && documentData.fc){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this._hasMaskedPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
-                if (textData.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= alignment[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.finalSize;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                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]];
-            }
-            letterO = elemOpacity;
+          }
         }
-
-        if(renderedLettersCount <= i) {
-            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            this.renderedLetters.push(letterValue);
-            renderedLettersCount += 1;
-            this.lettersChangedFlag = true;
+      }
+      if (documentData.strokeWidthAnim) {
+        sw = documentData.sw || 0;
+      }
+      if (documentData.strokeColorAnim) {
+        if (documentData.sc) {
+          sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
         } else {
-            letterValue = this.renderedLetters[i];
-            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+          sc = [0, 0, 0];
         }
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.a.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+
+          if (mult.length) {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.s.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (mult.length) {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1);
+          } else {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        animatorSelector = animators[j].s;
+        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+        if (animatorProps.sk.propType) {
+          if (mult.length) {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+          } else {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+          }
+        }
+        if (animatorProps.r.propType) {
+          if (mult.length) {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+          } else {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult);
+          }
+        }
+        if (animatorProps.ry.propType) {
+          if (mult.length) {
+            matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
+          } else {
+            matrixHelper.rotateY(animatorProps.ry.v * mult);
+          }
+        }
+        if (animatorProps.rx.propType) {
+          if (mult.length) {
+            matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
+          } else {
+            matrixHelper.rotateX(animatorProps.rx.v * mult);
+          }
+        }
+        if (animatorProps.o.propType) {
+          if (mult.length) {
+            elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0];
+          } else {
+            elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult;
+          }
+        }
+        if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+          if (mult.length) {
+            sw += animatorProps.sw.v * mult[0];
+          } else {
+            sw += animatorProps.sw.v * mult;
+          }
+        }
+        if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+          for (k = 0; k < 3; k += 1) {
+            if (mult.length) {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
+            } else {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
+            }
+          }
+        }
+        if (documentData.fillColorAnim && documentData.fc) {
+          if (animatorProps.fc.propType) {
+            for (k = 0; k < 3; k += 1) {
+              if (mult.length) {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
+              } else {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
+              }
+            }
+          }
+          if (animatorProps.fh.propType) {
+            if (mult.length) {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
+            } else {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult);
+            }
+          }
+          if (animatorProps.fs.propType) {
+            if (mult.length) {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
+            } else {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
+            }
+          }
+          if (animatorProps.fb.propType) {
+            if (mult.length) {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
+            } else {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
+            }
+          }
+        }
+      }
+
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+
+        if (animatorProps.p.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (this._hasMaskedPath) {
+            if (mult.length) {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+            } else {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+            }
+          } else if (mult.length) {
+            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+          }
+        }
+      }
+      if (documentData.strokeWidthAnim) {
+        letterSw = sw < 0 ? 0 : sw;
+      }
+      if (documentData.strokeColorAnim) {
+        letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
+      }
+
+      if (this._hasMaskedPath) {
+        matrixHelper.translate(0, -documentData.ls);
+
+        matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0);
+        if (textData.p.p) {
+          tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+          var rot = (Math.atan(tanAngle) * 180) / Math.PI;
+          if (currentPoint.point[0] < prevPoint.point[0]) {
+            rot += 180;
+          }
+          matrixHelper.rotate((-rot * Math.PI) / 180);
+        }
+        matrixHelper.translate(xPathPos, yPathPos, 0);
+        currentLength -= (alignment[0] * letters[i].an) * 0.005;
+        if (letters[i + 1] && ind !== letters[i + 1].ind) {
+          currentLength += letters[i].an / 2;
+          currentLength += (documentData.tr * 0.001) * documentData.finalSize;
+        }
+      } else {
+        matrixHelper.translate(xPos, yPos, 0);
+
+        if (documentData.ps) {
+          // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+          matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+        }
+        switch (documentData.j) {
+          case 1:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
+            break;
+          case 2:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
+            break;
+          default:
+            break;
+        }
+        matrixHelper.translate(0, -documentData.ls);
+        matrixHelper.translate(offf, 0, 0);
+        matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0);
+        xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize;
+      }
+      if (renderType === 'html') {
+        letterM = matrixHelper.toCSS();
+      } else if (renderType === 'svg') {
+        letterM = matrixHelper.to2dCSS();
+      } else {
+        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]];
+      }
+      letterO = elemOpacity;
     }
+
+    if (renderedLettersCount <= i) {
+      letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
+      this.renderedLetters.push(letterValue);
+      renderedLettersCount += 1;
+      this.lettersChangedFlag = true;
+    } else {
+      letterValue = this.renderedLetters[i];
+      this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+    }
+  }
 };
 
-TextAnimatorProperty.prototype.getValue = function(){
-	if(this._elem.globalData.frameId === this._frameId){
-        return;
-    }
-    this._frameId = this._elem.globalData.frameId;
-    this.iterateDynamicProperties();
+TextAnimatorProperty.prototype.getValue = function () {
+  if (this._elem.globalData.frameId === this._frameId) {
+    return;
+  }
+  this._frameId = this._elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 TextAnimatorProperty.prototype.mHelper = new Matrix();
 TextAnimatorProperty.prototype.defaultPropsArray = [];
 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
+
+/* global PropertyFactory, degToRads, TextSelectorProp */
+/* exported TextAnimatorDataProperty */
+
 function TextAnimatorDataProperty(elem, animatorProps, container) {
-	var defaultData = {propType:false};
-	var getProp = PropertyFactory.getProp;
-	var textAnimator_animatables = animatorProps.a;
-	this.a = {
-		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
-		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
-		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
-		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
-		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
-		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
-		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
-		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
-		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
-		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
-		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
-		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
-		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
-		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
-		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
-		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
-	};
+  var defaultData = { propType: false };
+  var getProp = PropertyFactory.getProp;
+  var textAnimatorAnimatables = animatorProps.a;
+  this.a = {
+    r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
+    rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
+    ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
+    sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
+    sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
+    s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
+    a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
+    o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
+    p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
+    sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
+    sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
+    fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
+    fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
+    fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
+    fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
+    t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData,
+  };
 
-	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
-    this.s.t = animatorProps.s.t;
+  this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
+  this.s.t = animatorProps.s.t;
 }
-function LetterProps(o, sw, sc, fc, m, p){
+
+function LetterProps(o, sw, sc, fc, m, p) {
+  this.o = o;
+  this.sw = sw;
+  this.sc = sc;
+  this.fc = fc;
+  this.m = m;
+  this.p = p;
+  this._mdf = {
+    o: true,
+    sw: !!sw,
+    sc: !!sc,
+    fc: !!fc,
+    m: true,
+    p: true,
+  };
+}
+
+LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
+  this._mdf.o = false;
+  this._mdf.sw = false;
+  this._mdf.sc = false;
+  this._mdf.fc = false;
+  this._mdf.m = false;
+  this._mdf.p = false;
+  var updated = false;
+
+  if (this.o !== o) {
     this.o = o;
+    this._mdf.o = true;
+    updated = true;
+  }
+  if (this.sw !== sw) {
     this.sw = sw;
+    this._mdf.sw = true;
+    updated = true;
+  }
+  if (this.sc !== sc) {
     this.sc = sc;
+    this._mdf.sc = true;
+    updated = true;
+  }
+  if (this.fc !== fc) {
     this.fc = fc;
+    this._mdf.fc = true;
+    updated = true;
+  }
+  if (this.m !== m) {
     this.m = m;
+    this._mdf.m = true;
+    updated = true;
+  }
+  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])) {
     this.p = p;
-    this._mdf = {
-    	o: true,
-    	sw: !!sw,
-    	sc: !!sc,
-    	fc: !!fc,
-    	m: true,
-    	p: true
-    };
-}
-
-LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
-	this._mdf.o = false;
-	this._mdf.sw = false;
-	this._mdf.sc = false;
-	this._mdf.fc = false;
-	this._mdf.m = false;
-	this._mdf.p = false;
-	var updated = false;
-
-	if(this.o !== o) {
-		this.o = o;
-		this._mdf.o = true;
-		updated = true;
-	}
-	if(this.sw !== sw) {
-		this.sw = sw;
-		this._mdf.sw = true;
-		updated = true;
-	}
-	if(this.sc !== sc) {
-		this.sc = sc;
-		this._mdf.sc = true;
-		updated = true;
-	}
-	if(this.fc !== fc) {
-		this.fc = fc;
-		this._mdf.fc = true;
-		updated = true;
-	}
-	if(this.m !== m) {
-		this.m = m;
-		this._mdf.m = true;
-		updated = true;
-	}
-	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])) {
-		this.p = p;
-		this._mdf.p = true;
-		updated = true;
-	}
-	return updated;
-};
-function TextProperty(elem, data){
-	this._frameId = initialDefaultFrame;
-	this.pv = '';
-	this.v = '';
-	this.kf = false;
-	this._isFirstFrame = true;
-	this._mdf = false;
-    this.data = data;
-	this.elem = elem;
-    this.comp = this.elem.comp;
-	this.keysIndex = 0;
-    this.canResize = false;
-    this.minimumFontSize = 1;
-    this.effectsSequence = [];
-	this.currentData = {
-		ascent: 0,
-        boxWidth: this.defaultBoxWidth,
-        f: '',
-        fStyle: '',
-        fWeight: '',
-        fc: '',
-        j: '',
-        justifyOffset: '',
-        l: [],
-        lh: 0,
-        lineWidths: [],
-        ls: '',
-        of: '',
-        s: '',
-        sc: '',
-        sw: 0,
-        t: 0,
-        tr: 0,
-        sz:0,
-        ps:null,
-        fillColorAnim: false,
-        strokeColorAnim: false,
-        strokeWidthAnim: false,
-        yOffset: 0,
-        finalSize:0,
-        finalText:[],
-        finalLineHeight: 0,
-        __complete: false
-
-	};
-    this.copyData(this.currentData, this.data.d.k[0].s);
-
-    if(!this.searchProperty()) {
-        this.completeTextData(this.currentData);
-    }
-}
-
-TextProperty.prototype.defaultBoxWidth = [0,0];
-
-TextProperty.prototype.copyData = function(obj, data) {
-    for(var s in data) {
-        if(data.hasOwnProperty(s)) {
-            obj[s] = data[s];
-        }
-    }
-    return obj;
-}
-
-TextProperty.prototype.setCurrentData = function(data){
-    if(!data.__complete) {
-        this.completeTextData(data);
-    }
-    this.currentData = data;
-    this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
-    this._mdf = true;
+    this._mdf.p = true;
+    updated = true;
+  }
+  return updated;
 };
 
-TextProperty.prototype.searchProperty = function() {
-    return this.searchKeyframes();
-};
+/* global FontManager, initialDefaultFrame, getFontProperties */
+/* exported TextProperty */
 
-TextProperty.prototype.searchKeyframes = function() {
-    this.kf = this.data.d.k.length > 1;
-    if(this.kf) {
-        this.addEffect(this.getKeyframeValue.bind(this));
-    }
-    return this.kf;
+function TextProperty(elem, data) {
+  this._frameId = initialDefaultFrame;
+  this.pv = '';
+  this.v = '';
+  this.kf = false;
+  this._isFirstFrame = true;
+  this._mdf = false;
+  this.data = data;
+  this.elem = elem;
+  this.comp = this.elem.comp;
+  this.keysIndex = 0;
+  this.canResize = false;
+  this.minimumFontSize = 1;
+  this.effectsSequence = [];
+  this.currentData = {
+    ascent: 0,
+    boxWidth: this.defaultBoxWidth,
+    f: '',
+    fStyle: '',
+    fWeight: '',
+    fc: '',
+    j: '',
+    justifyOffset: '',
+    l: [],
+    lh: 0,
+    lineWidths: [],
+    ls: '',
+    of: '',
+    s: '',
+    sc: '',
+    sw: 0,
+    t: 0,
+    tr: 0,
+    sz: 0,
+    ps: null,
+    fillColorAnim: false,
+    strokeColorAnim: false,
+    strokeWidthAnim: false,
+    yOffset: 0,
+    finalSize: 0,
+    finalText: [],
+    finalLineHeight: 0,
+    __complete: false,
+
+  };
+  this.copyData(this.currentData, this.data.d.k[0].s);
+
+  if (!this.searchProperty()) {
+    this.completeTextData(this.currentData);
+  }
 }
 
-TextProperty.prototype.addEffect = function(effectFunction) {
-	this.effectsSequence.push(effectFunction);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.defaultBoxWidth = [0, 0];
+
+TextProperty.prototype.copyData = function (obj, data) {
+  for (var s in data) {
+    if (Object.prototype.hasOwnProperty.call(data, s)) {
+      obj[s] = data[s];
+    }
+  }
+  return obj;
 };
 
-TextProperty.prototype.getValue = function(_finalValue) {
-    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
-        return;
-    }
-    this.currentData.t = this.data.d.k[this.keysIndex].s.t;
-    var currentValue = this.currentData;
-    var currentIndex = this.keysIndex;
-    if(this.lock) {
-        this.setCurrentData(this.currentData);
-        return;
-    }
-    this.lock = true;
-    this._mdf = false;
-    var multipliedValue;
-    var i, len = this.effectsSequence.length;
-    var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
-    for(i = 0; i < len; i += 1) {
-        //Checking if index changed to prevent creating a new object every time the expression updates.
-        if(currentIndex !== this.keysIndex) {
-            finalValue = this.effectsSequence[i](finalValue, finalValue.t);
-        } else {
-            finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
-        }
-    }
-    if(currentValue !== finalValue) {
-        this.setCurrentData(finalValue);
-    }
-    this.pv = this.v = this.currentData;
-    this.lock = false;
-    this.frameId = this.elem.globalData.frameId;
-}
+TextProperty.prototype.setCurrentData = function (data) {
+  if (!data.__complete) {
+    this.completeTextData(data);
+  }
+  this.currentData = data;
+  this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+  this._mdf = true;
+};
 
-TextProperty.prototype.getKeyframeValue = function() {
-    var textKeys = this.data.d.k, textDocumentData;
-    var frameNum = this.elem.comp.renderedFrame;
-    var i = 0, len = textKeys.length;
-    while(i <= len - 1) {
-        textDocumentData = textKeys[i].s;
-        if(i === len - 1 || textKeys[i+1].t > frameNum){
-            break;
-        }
+TextProperty.prototype.searchProperty = function () {
+  return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function () {
+  this.kf = this.data.d.k.length > 1;
+  if (this.kf) {
+    this.addEffect(this.getKeyframeValue.bind(this));
+  }
+  return this.kf;
+};
+
+TextProperty.prototype.addEffect = function (effectFunction) {
+  this.effectsSequence.push(effectFunction);
+  this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function (_finalValue) {
+  if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+    return;
+  }
+  this.currentData.t = this.data.d.k[this.keysIndex].s.t;
+  var currentValue = this.currentData;
+  var currentIndex = this.keysIndex;
+  if (this.lock) {
+    this.setCurrentData(this.currentData);
+    return;
+  }
+  this.lock = true;
+  this._mdf = false;
+  var i; var
+    len = this.effectsSequence.length;
+  var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
+  for (i = 0; i < len; i += 1) {
+    // Checking if index changed to prevent creating a new object every time the expression updates.
+    if (currentIndex !== this.keysIndex) {
+      finalValue = this.effectsSequence[i](finalValue, finalValue.t);
+    } else {
+      finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
+    }
+  }
+  if (currentValue !== finalValue) {
+    this.setCurrentData(finalValue);
+  }
+  this.v = this.currentData;
+  this.pv = this.v;
+  this.lock = false;
+  this.frameId = this.elem.globalData.frameId;
+};
+
+TextProperty.prototype.getKeyframeValue = function () {
+  var textKeys = this.data.d.k;
+  var frameNum = this.elem.comp.renderedFrame;
+  var i = 0; var
+    len = textKeys.length;
+  while (i <= len - 1) {
+    if (i === len - 1 || textKeys[i + 1].t > frameNum) {
+      break;
+    }
+    i += 1;
+  }
+  if (this.keysIndex !== i) {
+    this.keysIndex = i;
+  }
+  return this.data.d.k[this.keysIndex].s;
+};
+
+TextProperty.prototype.buildFinalText = function (text) {
+  var combinedCharacters = FontManager.getCombinedCharacterCodes();
+  var charactersArray = [];
+  var i = 0; var
+    len = text.length;
+  var charCode;
+  while (i < len) {
+    charCode = text.charCodeAt(i);
+    if (combinedCharacters.indexOf(charCode) !== -1) {
+      charactersArray[charactersArray.length - 1] += text.charAt(i);
+    } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      charCode = text.charCodeAt(i + 1);
+      if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
+        charactersArray.push(text.substr(i, 2));
         i += 1;
+      } else {
+        charactersArray.push(text.charAt(i));
+      }
+    } else {
+      charactersArray.push(text.charAt(i));
     }
-    if(this.keysIndex !== i) {
-        this.keysIndex = i;
-    }
-    return this.data.d.k[this.keysIndex].s;
+    i += 1;
+  }
+  return charactersArray;
 };
 
-TextProperty.prototype.buildFinalText = function(text) {
-    var combinedCharacters = FontManager.getCombinedCharacterCodes();
-    var charactersArray = [];
-    var i = 0, len = text.length;
-    var charCode;
-    while (i < len) {
-        charCode = text.charCodeAt(i);
-        if (combinedCharacters.indexOf(charCode) !== -1) {
-            charactersArray[charactersArray.length - 1] += text.charAt(i);
-        } else {
-            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
-                charCode = text.charCodeAt(i + 1);
-                if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
-                    charactersArray.push(text.substr(i, 2));
-                    ++i;
-                } else {
-                    charactersArray.push(text.charAt(i));
-                }
-            } else {
-                charactersArray.push(text.charAt(i));
-            }
-        }
-        i += 1;
-    }
-    return charactersArray;
-}
-
-TextProperty.prototype.completeTextData = function(documentData) {
-    documentData.__complete = true;
-    var fontManager = this.elem.globalData.fontManager;
-    var data = this.data;
-    var letters = [];
-    var i, len;
-    var newLineFlag, index = 0, val;
-    var anchorGrouping = data.m.g;
-    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-    var lineWidth = 0;
-    var maxLineWidth = 0;
-    var j, jLen;
-    var fontData = fontManager.getFontByName(documentData.f);
-    var charData, cLength = 0;
-    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
-
-    var fWeight = 'normal', fStyle = 'normal';
-    len = styles.length;
-    var styleName;
-    for(i=0;i<len;i+=1){
-        styleName = styles[i].toLowerCase();
-        switch(styleName) {
-            case 'italic':
-            fStyle = 'italic';
-            break;
-            case 'bold':
-            fWeight = '700';
-            break;
-            case 'black':
-            fWeight = '900';
-            break;
-            case 'medium':
-            fWeight = '500';
-            break;
-            case 'regular':
-            case 'normal':
-            fWeight = '400';
-            break;
-            case 'light':
-            case 'thin':
-            fWeight = '200';
-            break;
-        }
-    }
-    documentData.fWeight = fontData.fWeight || fWeight;
-    documentData.fStyle = fStyle;
-    documentData.finalSize = documentData.s;
-    documentData.finalText = this.buildFinalText(documentData.t);
-    len = documentData.finalText.length;
-    documentData.finalLineHeight = documentData.lh;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var charCode;
-    if(documentData.sz){
-        var flag = true;
-        var boxWidth = documentData.sz[0];
-        var boxHeight = documentData.sz[1];
-        var currentHeight, finalText;
-        while(flag) {
-            finalText = this.buildFinalText(documentData.t);
-            currentHeight = 0;
-            lineWidth = 0;
-            len = finalText.length;
-            trackingOffset = documentData.tr/1000*documentData.finalSize;
-            var lastSpaceIndex = -1;
-            for(i=0;i<len;i+=1){
-                charCode = finalText[i].charCodeAt(0);
-                newLineFlag = false;
-                if(finalText[i] === ' '){
-                    lastSpaceIndex = i;
-                }else if(charCode === 13 || charCode === 3){
-                    lineWidth = 0;
-                    newLineFlag = true;
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-                }else{
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
-                }
-                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
-                    if(lastSpaceIndex === -1){
-                        len += 1;
-                    } else {
-                        i = lastSpaceIndex;
-                    }
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
-                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
-                    lastSpaceIndex = -1;
-                    lineWidth = 0;
-                }else {
-                    lineWidth += cLength;
-                    lineWidth += trackingOffset;
-                }
-            }
-            currentHeight += fontData.ascent*documentData.finalSize/100;
-            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
-                documentData.finalSize -= 1;
-                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
-            } else {
-                documentData.finalText = finalText;
-                len = documentData.finalText.length;
-                flag = false;
-            }
-        }
-
-    }
-    lineWidth = - trackingOffset;
+TextProperty.prototype.completeTextData = function (documentData) {
+  documentData.__complete = true;
+  var fontManager = this.elem.globalData.fontManager;
+  var data = this.data;
+  var letters = [];
+  var i; var
+    len;
+  var newLineFlag; var index = 0; var
+    val;
+  var anchorGrouping = data.m.g;
+  var currentSize = 0; var currentPos = 0; var currentLine = 0; var
+    lineWidths = [];
+  var lineWidth = 0;
+  var maxLineWidth = 0;
+  var j; var
+    jLen;
+  var fontData = fontManager.getFontByName(documentData.f);
+  var charData; var
     cLength = 0;
-    var uncollapsedSpaces = 0;
-    var currentChar;
-    for (i = 0;i < len ;i += 1) {
+
+  var fontProps = getFontProperties(fontData);
+  documentData.fWeight = fontProps.weight;
+  documentData.fStyle = fontProps.style;
+  documentData.finalSize = documentData.s;
+  documentData.finalText = this.buildFinalText(documentData.t);
+  len = documentData.finalText.length;
+  documentData.finalLineHeight = documentData.lh;
+  var trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+  var charCode;
+  if (documentData.sz) {
+    var flag = true;
+    var boxWidth = documentData.sz[0];
+    var boxHeight = documentData.sz[1];
+    var currentHeight; var
+      finalText;
+    while (flag) {
+      finalText = this.buildFinalText(documentData.t);
+      currentHeight = 0;
+      lineWidth = 0;
+      len = finalText.length;
+      trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+      var lastSpaceIndex = -1;
+      for (i = 0; i < len; i += 1) {
+        charCode = finalText[i].charCodeAt(0);
         newLineFlag = false;
-        currentChar = documentData.finalText[i];
-        charCode = currentChar.charCodeAt(0);
-        if (charCode === 13 || charCode === 3) {
-            uncollapsedSpaces = 0;
-            lineWidths.push(lineWidth);
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidth = - 2 * trackingOffset;
-            val = '';
-            newLineFlag = true;
-            currentLine += 1;
-        }else{
-            val = currentChar;
+        if (finalText[i] === ' ') {
+          lastSpaceIndex = i;
+        } else if (charCode === 13 || charCode === 3) {
+          lineWidth = 0;
+          newLineFlag = true;
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
         }
-        if(fontManager.chars){
-            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-        }else{
-            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
-            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
-        }
-
-        //
-        if(currentChar === ' '){
-            uncollapsedSpaces += cLength + trackingOffset;
+        if (fontManager.chars) {
+          charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+          cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
         } else {
-            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
-            uncollapsedSpaces = 0;
+          // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+          cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
         }
-        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
-        if(anchorGrouping == 2){
-            currentSize += cLength;
-            if(val === '' || val === ' ' || i === len - 1){
-                if(val === '' || val === ' '){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                index += 1;
-                currentSize = 0;
-            }
-        }else if(anchorGrouping == 3){
-            currentSize += cLength;
-            if(val === '' || i === len - 1){
-                if(val === ''){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                currentSize = 0;
-                index += 1;
-            }
-        }else{
-            letters[index].ind = index;
-            letters[index].extra = 0;
-            index += 1;
+        if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
+          if (lastSpaceIndex === -1) {
+            len += 1;
+          } else {
+            i = lastSpaceIndex;
+          }
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
+          finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r');
+          // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+          lastSpaceIndex = -1;
+          lineWidth = 0;
+        } else {
+          lineWidth += cLength;
+          lineWidth += trackingOffset;
         }
+      }
+      currentHeight += (fontData.ascent * documentData.finalSize) / 100;
+      if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+        documentData.finalSize -= 1;
+        documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s;
+      } else {
+        documentData.finalText = finalText;
+        len = documentData.finalText.length;
+        flag = false;
+      }
     }
-    documentData.l = letters;
-    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-    lineWidths.push(lineWidth);
-    if(documentData.sz){
-        documentData.boxWidth = documentData.sz[0];
+  }
+  lineWidth = -trackingOffset;
+  cLength = 0;
+  var uncollapsedSpaces = 0;
+  var currentChar;
+  for (i = 0; i < len; i += 1) {
+    newLineFlag = false;
+    currentChar = documentData.finalText[i];
+    charCode = currentChar.charCodeAt(0);
+    if (charCode === 13 || charCode === 3) {
+      uncollapsedSpaces = 0;
+      lineWidths.push(lineWidth);
+      maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+      lineWidth = -2 * trackingOffset;
+      val = '';
+      newLineFlag = true;
+      currentLine += 1;
+    } else {
+      val = currentChar;
+    }
+    if (fontManager.chars) {
+      charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+      cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
+    } else {
+      // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+      // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+      cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+    }
+
+    //
+    if (currentChar === ' ') {
+      uncollapsedSpaces += cLength + trackingOffset;
+    } else {
+      lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+      uncollapsedSpaces = 0;
+    }
+    letters.push({
+      l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0,
+    });
+    if (anchorGrouping == 2) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || val === ' ' || i === len - 1) {
+        if (val === '' || val === ' ') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        index += 1;
+        currentSize = 0;
+      }
+    } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || i === len - 1) {
+        if (val === '') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        currentSize = 0;
+        index += 1;
+      }
+    } else {
+      letters[index].ind = index;
+      letters[index].extra = 0;
+      index += 1;
+    }
+  }
+  documentData.l = letters;
+  maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+  lineWidths.push(lineWidth);
+  if (documentData.sz) {
+    documentData.boxWidth = documentData.sz[0];
+    documentData.justifyOffset = 0;
+  } else {
+    documentData.boxWidth = maxLineWidth;
+    switch (documentData.j) {
+      case 1:
+        documentData.justifyOffset = -documentData.boxWidth;
+        break;
+      case 2:
+        documentData.justifyOffset = -documentData.boxWidth / 2;
+        break;
+      default:
         documentData.justifyOffset = 0;
-    }else{
-        documentData.boxWidth = maxLineWidth;
-        switch(documentData.j){
-            case 1:
-                documentData.justifyOffset = - documentData.boxWidth;
-                break;
-            case 2:
-                documentData.justifyOffset = - documentData.boxWidth/2;
-                break;
-            default:
-                documentData.justifyOffset = 0;
-        }
     }
-    documentData.lineWidths = lineWidths;
+  }
+  documentData.lineWidths = lineWidths;
 
-    var animators = data.a, animatorData, letterData;
-    jLen = animators.length;
-    var based, ind, indexes = [];
-    for(j=0;j<jLen;j+=1){
-        animatorData = animators[j];
-        if(animatorData.a.sc){
-            documentData.strokeColorAnim = true;
-        }
-        if(animatorData.a.sw){
-            documentData.strokeWidthAnim = true;
-        }
-        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
-            documentData.fillColorAnim = true;
-        }
-        ind = 0;
-        based = animatorData.s.b;
-        for(i=0;i<len;i+=1){
-            letterData = letters[i];
-            letterData.anIndexes[j] = ind;
-            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))){
-                if(animatorData.s.rn === 1){
-                    indexes.push(ind);
-                }
-                ind += 1;
-            }
-        }
-        data.a[j].s.totalChars = ind;
-        var currentInd = -1, newInd;
-        if(animatorData.s.rn === 1){
-            for(i = 0; i < len; i += 1){
-                letterData = letters[i];
-                if(currentInd != letterData.anIndexes[j]){
-                    currentInd = letterData.anIndexes[j];
-                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                }
-                letterData.anIndexes[j] = newInd;
-            }
-        }
+  var animators = data.a; var animatorData; var
+    letterData;
+  jLen = animators.length;
+  var based; var ind; var
+    indexes = [];
+  for (j = 0; j < jLen; j += 1) {
+    animatorData = animators[j];
+    if (animatorData.a.sc) {
+      documentData.strokeColorAnim = true;
     }
-    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
-    documentData.ls = documentData.ls || 0;
-    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+    if (animatorData.a.sw) {
+      documentData.strokeWidthAnim = true;
+    }
+    if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
+      documentData.fillColorAnim = true;
+    }
+    ind = 0;
+    based = animatorData.s.b;
+    for (i = 0; i < len; i += 1) {
+      letterData = letters[i];
+      letterData.anIndexes[j] = ind;
+      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))) { // eslint-disable-line eqeqeq
+        if (animatorData.s.rn === 1) {
+          indexes.push(ind);
+        }
+        ind += 1;
+      }
+    }
+    data.a[j].s.totalChars = ind;
+    var currentInd = -1; var
+      newInd;
+    if (animatorData.s.rn === 1) {
+      for (i = 0; i < len; i += 1) {
+        letterData = letters[i];
+        if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq
+          currentInd = letterData.anIndexes[j];
+          newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
+        }
+        letterData.anIndexes[j] = newInd;
+      }
+    }
+  }
+  documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
+  documentData.ls = documentData.ls || 0;
+  documentData.ascent = (fontData.ascent * documentData.finalSize) / 100;
 };
 
-TextProperty.prototype.updateDocumentData = function(newData, index) {
-	index = index === undefined ? this.keysIndex : index;
-    var dData = this.copyData({}, this.data.d.k[index].s);
-    dData = this.copyData(dData, newData);
-    this.data.d.k[index].s = dData;
-    this.recalculate(index);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.updateDocumentData = function (newData, index) {
+  index = index === undefined ? this.keysIndex : index;
+  var dData = this.copyData({}, this.data.d.k[index].s);
+  dData = this.copyData(dData, newData);
+  this.data.d.k[index].s = dData;
+  this.recalculate(index);
+  this.elem.addDynamicProperty(this);
 };
 
-TextProperty.prototype.recalculate = function(index) {
-    var dData = this.data.d.k[index].s;
-    dData.__complete = false;
-    this.keysIndex = 0;
-    this._isFirstFrame = true;
-    this.getValue(dData);
-}
-
-TextProperty.prototype.canResizeFont = function(_canResize) {
-    this.canResize = _canResize;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.recalculate = function (index) {
+  var dData = this.data.d.k[index].s;
+  dData.__complete = false;
+  this.keysIndex = 0;
+  this._isFirstFrame = true;
+  this.getValue(dData);
 };
 
-TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
-    this.minimumFontSize = Math.floor(_fontValue) || 1;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.canResizeFont = function (_canResize) {
+  this.canResize = _canResize;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
 };
 
-var TextSelectorProp = (function(){
-    var max = Math.max;
-    var min = Math.min;
-    var floor = Math.floor;
+TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
+  this.minimumFontSize = Math.floor(_fontValue) || 1;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
+};
 
-    function TextSelectorProp(elem,data){
-        this._currentTextLength = -1;
-        this.k = false;
-        this.data = data;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.finalS = 0;
-        this.finalE = 0;
-        this.initDynamicPropertyContainer(elem);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
-        if('e' in data){
-            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
-        }else{
-            this.e = {v:100};
+/* global extendPrototype, BezierFactory, PropertyFactory, DynamicPropertyContainer */
+/* exported TextSelectorProp */
+
+var TextSelectorProp = (function () {
+  var max = Math.max;
+  var min = Math.min;
+  var floor = Math.floor;
+
+  function TextSelectorPropFactory(elem, data) {
+    this._currentTextLength = -1;
+    this.k = false;
+    this.data = data;
+    this.elem = elem;
+    this.comp = elem.comp;
+    this.finalS = 0;
+    this.finalE = 0;
+    this.initDynamicPropertyContainer(elem);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this);
+    if ('e' in data) {
+      this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
+    } else {
+      this.e = { v: 100 };
+    }
+    this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this);
+    this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this);
+    this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this);
+    this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
+    if (!this.dynamicProperties.length) {
+      this.getValue();
+    }
+  }
+
+  TextSelectorPropFactory.prototype = {
+    getMult: function (ind) {
+      if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+        this.getValue();
+      }
+      // var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+      var x1 = 0;
+      var y1 = 0;
+      var x2 = 1;
+      var y2 = 1;
+      if (this.ne.v > 0) {
+        x1 = this.ne.v / 100.0;
+      } else {
+        y1 = -this.ne.v / 100.0;
+      }
+      if (this.xe.v > 0) {
+        x2 = 1.0 - this.xe.v / 100.0;
+      } else {
+        y2 = 1.0 + this.xe.v / 100.0;
+      }
+      var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
+
+      var mult = 0;
+      var s = this.finalS;
+      var e = this.finalE;
+      var type = this.data.sh;
+      if (type === 2) {
+        if (e === s) {
+          mult = ind >= e ? 1 : 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
-        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
-        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
-        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
-        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
-        if(!this.dynamicProperties.length){
-            this.getValue();
+        mult = easer(mult);
+      } else if (type === 3) {
+        if (e === s) {
+          mult = ind >= e ? 0 : 1;
+        } else {
+          mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
+
+        mult = easer(mult);
+      } else if (type === 4) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
+          if (mult < 0.5) {
+            mult *= 2;
+          } else {
+            mult = 1 - 2 * (mult - 0.5);
+          }
+        }
+        mult = easer(mult);
+      } else if (type === 5) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          var tot = e - s;
+          /* ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          var x = -tot / 2 + ind;
+          var a = tot / 2;
+          mult = Math.sqrt(1 - (x * x) / (a * a));
+        }
+        mult = easer(mult);
+      } else if (type === 6) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line
+        }
+        mult = easer(mult);
+      } else {
+        if (ind >= floor(s)) {
+          if (ind - s < 0) {
+            mult = max(0, min(min(e, 1) - (s - ind), 1));
+          } else {
+            mult = max(0, min(e - ind, 1));
+          }
+        }
+        mult = easer(mult);
+      }
+      return mult * this.a.v;
+    },
+    getValue: function (newCharsFlag) {
+      this.iterateDynamicProperties();
+      this._mdf = newCharsFlag || this._mdf;
+      this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+      if (newCharsFlag && this.data.r === 2) {
+        this.e.v = this._currentTextLength;
+      }
+      var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
+      var o = this.o.v / divisor;
+      var s = this.s.v / divisor + o;
+      var e = (this.e.v / divisor) + o;
+      if (s > e) {
+        var _s = s;
+        s = e;
+        e = _s;
+      }
+      this.finalS = s;
+      this.finalE = e;
+    },
+  };
+  extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
+
+  function getTextSelectorProp(elem, data, arr) {
+    return new TextSelectorPropFactory(elem, data, arr);
+  }
+
+  return {
+    getTextSelectorProp: getTextSelectorProp,
+  };
+}());
+
+/* global createSizedArray, pooling */
+/* exported poolFactory */
+
+var poolFactory = (function () {
+  return function (initialLength, _create, _release) {
+    var _length = 0;
+    var _maxLength = initialLength;
+    var pool = createSizedArray(_maxLength);
+
+    var ob = {
+      newElement: newElement,
+      release: release,
+    };
+
+    function newElement() {
+      var element;
+      if (_length) {
+        _length -= 1;
+        element = pool[_length];
+      } else {
+        element = _create();
+      }
+      return element;
     }
 
-    TextSelectorProp.prototype = {
-        getMult: function(ind) {
-            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
-                this.getValue();
-            }
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var x1 = 0;
-            var y1 = 0;
-            var x2 = 1;
-            var y2 = 1;
-            if(this.ne.v > 0) {
-                x1 = this.ne.v / 100.0;
-            }
-            else {
-                y1 = -this.ne.v / 100.0;
-            }
-            if(this.xe.v > 0) {
-                x2 = 1.0 - this.xe.v / 100.0;
-            }
-            else {
-                y2 = 1.0 + this.xe.v / 100.0;
-            }
-            var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
-
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if (type === 2){
-                if (e === s) {
-                    mult = ind >= e ? 1 : 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                }
-                mult = easer(mult);
-            } else if(type === 3) {
-                if (e === s) {
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
-                }
-
-                mult = easer(mult);
-            } else if (type === 4) {
-                if (e === s) {
-                    mult = 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                    if (mult < 0.5) {
-                        mult *= 2;
-                    } else {
-                        mult = 1 - 2 * (mult - 0.5);
-                    }
-                }
-                mult = easer(mult);
-            } else if (type === 5) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x * x) / (a * a));
-                }
-                mult = easer(mult);
-            } else if (type === 6) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
-                }
-                mult = easer(mult);
-            } else {
-                if (ind >= floor(s)) {
-                    if (ind - s < 0) {
-                        mult = max(0, min(min(e, 1) - (s - ind), 1));
-                    } else {
-                        mult = max(0, min(e - ind, 1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        },
-        getValue: function(newCharsFlag) {
-            this.iterateDynamicProperties();
-            this._mdf = newCharsFlag || this._mdf;
-            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
-            if(newCharsFlag && this.data.r === 2) {
-                this.e.v = this._currentTextLength;
-            }
-            var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-    }
-    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
+    function release(element) {
+      if (_length === _maxLength) {
+        pool = pooling.double(pool);
+        _maxLength *= 2;
+      }
+      if (_release) {
+        _release(element);
+      }
+      pool[_length] = element;
+      _length += 1;
     }
 
+    return ob;
+  };
+}());
+
+/* global createSizedArray */
+/* exported pooling */
+
+var pooling = (function () {
+  function double(arr) {
+    return arr.concat(createSizedArray(arr.length));
+  }
+
+  return {
+    double: double,
+  };
+}());
+
+/* global createTypedArray, poolFactory */
+/* exported pointPool */
+
+var pointPool = (function () {
+  function create() {
+    return createTypedArray('float32', 2);
+  }
+  return poolFactory(8, create);
+}());
+
+/* global ShapePath, pointPool, poolFactory */
+/* exported shapePool */
+
+var shapePool = (function () {
+  function create() {
+    return new ShapePath();
+  }
+
+  function release(shapePath) {
+    var len = shapePath._length;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      pointPool.release(shapePath.v[i]);
+      pointPool.release(shapePath.i[i]);
+      pointPool.release(shapePath.o[i]);
+      shapePath.v[i] = null;
+      shapePath.i[i] = null;
+      shapePath.o[i] = null;
+    }
+    shapePath._length = 0;
+    shapePath.c = false;
+  }
+
+  function clone(shape) {
+    var cloned = factory.newElement();
+    var i;
+    var len = shape._length === undefined ? shape.v.length : shape._length;
+    cloned.setLength(len);
+    cloned.c = shape.c;
+
+    for (i = 0; i < len; i += 1) {
+      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);
+    }
+    return cloned;
+  }
+
+  var factory = poolFactory(4, create, release);
+  factory.clone = clone;
+
+  return factory;
+}());
+
+/* global createSizedArray, ShapeCollection, shapePool, pooling */
+/* exported shapeCollectionPool */
+
+var shapeCollectionPool = (function () {
+  var ob = {
+    newShapeCollection: newShapeCollection,
+    release: release,
+  };
+
+  var _length = 0;
+  var _maxLength = 4;
+  var pool = createSizedArray(_maxLength);
+
+  function newShapeCollection() {
+    var shapeCollection;
+    if (_length) {
+      _length -= 1;
+      shapeCollection = pool[_length];
+    } else {
+      shapeCollection = new ShapeCollection();
+    }
+    return shapeCollection;
+  }
+
+  function release(shapeCollection) {
+    var i;
+    var len = shapeCollection._length;
+    for (i = 0; i < len; i += 1) {
+      shapePool.release(shapeCollection.shapes[i]);
+    }
+    shapeCollection._length = 0;
+
+    if (_length === _maxLength) {
+      pool = pooling.double(pool);
+      _maxLength *= 2;
+    }
+    pool[_length] = shapeCollection;
+    _length += 1;
+  }
+
+  return ob;
+}());
+
+/* global poolFactory, bezierLengthPool */
+/* exported segmentsLengthPool */
+
+var segmentsLengthPool = (function () {
+  function create() {
     return {
-        getTextSelectorProp: getTextSelectorProp
+      lengths: [],
+      totalLength: 0,
     };
-}());
+  }
 
-    
-var pool_factory = (function() {
-	return function(initialLength, _create, _release, _clone) {
-
-		var _length = 0;
-		var _maxLength = initialLength;
-		var pool = createSizedArray(_maxLength);
-
-		var ob = {
-			newElement: newElement,
-			release: release
-		};
-
-		function newElement(){
-			var element;
-			if(_length){
-				_length -= 1;
-				element = pool[_length];
-			} else {
-				element = _create();
-			}
-			return element;
-		}
-
-		function release(element) {
-			if(_length === _maxLength) {
-				pool = pooling.double(pool);
-				_maxLength = _maxLength*2;
-			}
-			if (_release) {
-				_release(element);
-			}
-			pool[_length] = element;
-			_length += 1;
-		}
-
-		function clone() {
-			var clonedElement = newElement();
-			return _clone(clonedElement);
-		}
-
-		return ob;
-	};
-}());
-
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(createSizedArray(arr.length));
-	}
-
-	return {
-		double: double
-	};
-}());
-var point_pool = (function(){
-
-	function create() {
-		return createTypedArray('float32', 2);
-	}
-	return pool_factory(8, create);
-}());
-var shape_pool = (function(){
-
-	function create() {
-		return new ShapePath();
-	}
-
-	function release(shapePath) {
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-	}
-
-	function clone(shape) {
-		var cloned = factory.newElement();
-		var i, len = shape._length === undefined ? shape.v.length : shape._length;
-		cloned.setLength(len);
-		cloned.c = shape.c;
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			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);
-		}
-		return cloned;
-	}
-
-	var factory = pool_factory(4, create, release);
-	factory.clone = clone;
-
-	return factory;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release
-	};
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = createSizedArray(_maxLength);
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	return ob;
-}());
-var segments_length_pool = (function(){
-
-	function create() {
-		return {
-			lengths: [],
-			totalLength: 0
-		};
-	}
-
-	function release(element) {
-		var i, len = element.lengths.length;
-		for(i=0;i<len;i+=1) {
-			bezier_length_pool.release(element.lengths[i]);
-		}
-		element.lengths.length = 0;
-	}
-
-	return pool_factory(8, create, release);
-}());
-var bezier_length_pool = (function(){
-
-	function create() {
-		return {
-            addedLength: 0,
-            percents: createTypedArray('float32', defaultCurveSegments),
-            lengths: createTypedArray('float32', defaultCurveSegments),
-        };
-	}
-	return pool_factory(8, create);
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
+  function release(element) {
+    var i;
+    var len = element.lengths.length;
+    for (i = 0; i < len; i += 1) {
+      bezierLengthPool.release(element.lengths[i]);
     }
-    this.checkPendingElements();
-};
+    element.lengths.length = 0;
+  }
 
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 3:
-            return this.createNull(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 6:
-            return this.createAudio(layer);
-        case 13:
-            return this.createCamera(layer);
-    }
-    return this.createNull(layer);
-};
+  return poolFactory(8, create, release);
+}());
 
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-};
+/* global createTypedArray, defaultCurveSegments, poolFactory */
+/* exported bezierLengthPool */
 
-BaseRenderer.prototype.createAudio = function(data){
-    return new AudioElement(data, this.globalData, this);
-};
+var bezierLengthPool = (function () {
+  function create() {
+    return {
+      addedLength: 0,
+      percents: createTypedArray('float32', defaultCurveSegments),
+      lengths: createTypedArray('float32', defaultCurveSegments),
+    };
+  }
+  return poolFactory(8, create);
+}());
 
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
+/* global AudioElement, FontManager */
+
+function BaseRenderer() {}
+BaseRenderer.prototype.checkLayers = function (num) {
+  var i;
+  var len = this.layers.length;
+  var data;
+  this.completeLayers = true;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (!this.elements[i]) {
+      data = this.layers[i];
+      if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) {
         this.buildItem(i);
+      }
     }
-    this.checkPendingElements();
+    this.completeLayers = this.elements[i] ? this.completeLayers : false;
+  }
+  this.checkPendingElements();
 };
 
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
+BaseRenderer.prototype.createItem = function (layer) {
+  switch (layer.ty) {
+    case 2:
+      return this.createImage(layer);
+    case 0:
+      return this.createComp(layer);
+    case 1:
+      return this.createSolid(layer);
+    case 3:
+      return this.createNull(layer);
+    case 4:
+      return this.createShape(layer);
+    case 5:
+      return this.createText(layer);
+    case 6:
+      return this.createAudio(layer);
+    case 13:
+      return this.createCamera(layer);
+    default:
+      return this.createNull(layer);
+  }
+};
+
+BaseRenderer.prototype.createCamera = function () {
+  throw new Error('You\'re using a 3d camera. Try the html renderer.');
+};
+
+BaseRenderer.prototype.createAudio = function (data) {
+  return new AudioElement(data, this.globalData, this);
+};
+
+BaseRenderer.prototype.buildAllItems = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    this.buildItem(i);
+  }
+  this.checkPendingElements();
+};
+
+BaseRenderer.prototype.includeLayers = function (newLayers) {
+  this.completeLayers = false;
+  var i;
+  var len = newLayers.length;
+  var j;
+  var jLen = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    j = 0;
+    while (j < jLen) {
+      if (this.layers[j].id === newLayers[i].id) {
+        this.layers[j] = newLayers[i];
+        break;
+      }
+      j += 1;
+    }
+  }
+};
+
+BaseRenderer.prototype.setProjectInterface = function (pInterface) {
+  this.globalData.projectInterface = pInterface;
+};
+
+BaseRenderer.prototype.initItems = function () {
+  if (!this.globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+};
+BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
+  var elements = this.elements;
+  var layers = this.layers;
+  var i = 0;
+  var len = layers.length;
+  while (i < len) {
+    if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq
+      if (!elements[i] || elements[i] === true) {
+        this.buildItem(i);
+        this.addPendingElement(element);
+      } else {
+        hierarchy.push(elements[i]);
+        elements[i].setAsParent();
+        if (layers[i].parent !== undefined) {
+          this.buildElementParenting(element, layers[i].parent, hierarchy);
+        } else {
+          element.setHierarchy(hierarchy);
         }
+      }
     }
+    i += 1;
+  }
 };
 
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
+BaseRenderer.prototype.addPendingElement = function (element) {
+  this.pendingElements.push(element);
 };
 
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
+BaseRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i]);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
     }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while (i < len) {
-        if (layers[i].ind == parentName) {
-            if (!elements[i] || elements[i] === true) {
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i].setAsParent();
-                if(layers[i].parent !== undefined) {
-                    this.buildElementParenting(element, layers[i].parent, hierarchy);
-                } else {
-                    element.setHierarchy(hierarchy);
-                }
-            }
-        }
-        i += 1;
-    }
+  }
 };
 
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
+BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
+  this.globalData.fontManager = new FontManager();
+  this.globalData.fontManager.addChars(animData.chars);
+  this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
+  this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+  this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
+  this.globalData.imageLoader = this.animationItem.imagePreloader;
+  this.globalData.audioController = this.animationItem.audioController;
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
 };
 
-BaseRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i]);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
+/* global createElementID, extendPrototype, BaseRenderer, NullElement, SVGShapeElement, SVGTextLottieElement,
+IImageElement, SVGCompElement, ISolidElement, createNS, locationHref, createSizedArray, expressionsPlugin */
 
-BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.imageLoader = this.animationItem.imagePreloader;
-    this.globalData.audioController = this.animationItem.audioController;
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-}
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.svgElement = createNS('svg');
-    var ariaLabel = '';
-    if (config && config.title) {
-        var titleElement = createNS('title');
-        var titleId = createElementID();
-        titleElement.setAttribute('id', titleId);
-        titleElement.textContent = config.title;
-        this.svgElement.appendChild(titleElement);
-        ariaLabel += titleId;
-    }
-    if (config && config.description) {
-        var descElement = createNS('desc');
-        var descId = createElementID();
-        descElement.setAttribute('id', descId);
-        descElement.textContent = config.description;
-        this.svgElement.appendChild(descElement);
-        ariaLabel += ' ' + descId;
-    }
-    if (ariaLabel) {
-        this.svgElement.setAttribute('aria-labelledby', ariaLabel)
-    }
-    var defs = createNS( 'defs');
-    this.svgElement.appendChild(defs);
-    var maskElement = createNS('g');
-    this.svgElement.appendChild(maskElement);
-    this.layerElement = maskElement;
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        viewBoxOnly: (config && config.viewBoxOnly) || false,
-        viewBoxSize: (config && config.viewBoxSize) || false,
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-        focusable: config && config.focusable,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '100%',
-            height: config && config.filterSize && config.filterSize.height || '100%',
-            x: config && config.filterSize && config.filterSize.x || '0%',
-            y: config && config.filterSize && config.filterSize.y || '0%',
-        }
-    };
+function SVGRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.svgElement = createNS('svg');
+  var ariaLabel = '';
+  if (config && config.title) {
+    var titleElement = createNS('title');
+    var titleId = createElementID();
+    titleElement.setAttribute('id', titleId);
+    titleElement.textContent = config.title;
+    this.svgElement.appendChild(titleElement);
+    ariaLabel += titleId;
+  }
+  if (config && config.description) {
+    var descElement = createNS('desc');
+    var descId = createElementID();
+    descElement.setAttribute('id', descId);
+    descElement.textContent = config.description;
+    this.svgElement.appendChild(descElement);
+    ariaLabel += ' ' + descId;
+  }
+  if (ariaLabel) {
+    this.svgElement.setAttribute('aria-labelledby', ariaLabel);
+  }
+  var defs = createNS('defs');
+  this.svgElement.appendChild(defs);
+  var maskElement = createNS('g');
+  this.svgElement.appendChild(maskElement);
+  this.layerElement = maskElement;
+  this.renderConfig = {
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    hideOnTransparent: !((config && config.hideOnTransparent === false)),
+    viewBoxOnly: (config && config.viewBoxOnly) || false,
+    viewBoxSize: (config && config.viewBoxSize) || false,
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+    focusable: config && config.focusable,
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '100%',
+      height: (config && config.filterSize && config.filterSize.height) || '100%',
+      x: (config && config.filterSize && config.filterSize.x) || '0%',
+      y: (config && config.filterSize && config.filterSize.y) || '0%',
+    },
+  };
 
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        defs: defs,
-        renderConfig: this.renderConfig
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-    this.rendererType = 'svg';
-
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    defs: defs,
+    renderConfig: this.renderConfig,
+  };
+  this.elements = [];
+  this.pendingElements = [];
+  this.destroyed = false;
+  this.rendererType = 'svg';
 }
 
-extendPrototype([BaseRenderer],SVGRenderer);
+extendPrototype([BaseRenderer], SVGRenderer);
 
 SVGRenderer.prototype.createNull = function (data) {
-    return new NullElement(data,this.globalData,this);
+  return new NullElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new SVGShapeElement(data,this.globalData,this);
+  return new SVGShapeElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data,this.globalData,this);
-
+  return new SVGTextLottieElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data,this.globalData,this);
+  return new IImageElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new SVGCompElement(data,this.globalData,this);
-
+  return new SVGCompElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data,this.globalData,this);
+  return new ISolidElement(data, this.globalData, this);
 };
 
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    if(this.renderConfig.viewBoxSize) {
-        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
-    } else {
-        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    }
+SVGRenderer.prototype.configAnimation = function (animData) {
+  this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+  if (this.renderConfig.viewBoxSize) {
+    this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
+  } else {
+    this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
+  }
 
-    if(!this.renderConfig.viewBoxOnly) {
-        this.svgElement.setAttribute('width',animData.w);
-        this.svgElement.setAttribute('height',animData.h);
-        this.svgElement.style.width = '100%';
-        this.svgElement.style.height = '100%';
-        this.svgElement.style.transform = 'translate3d(0,0,0)';
-    }
-    if (this.renderConfig.className) {
-        this.svgElement.setAttribute('class', this.renderConfig.className);
-    }
-    if (this.renderConfig.id) {
-        this.svgElement.setAttribute('id', this.renderConfig.id);
-    }
-    if (this.renderConfig.focusable !== undefined) {
-        this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
-    }
-    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.svgElement);
-    //Mask animation
-    var defs = this.globalData.defs;
+  if (!this.renderConfig.viewBoxOnly) {
+    this.svgElement.setAttribute('width', animData.w);
+    this.svgElement.setAttribute('height', animData.h);
+    this.svgElement.style.width = '100%';
+    this.svgElement.style.height = '100%';
+    this.svgElement.style.transform = 'translate3d(0,0,0)';
+  }
+  if (this.renderConfig.className) {
+    this.svgElement.setAttribute('class', this.renderConfig.className);
+  }
+  if (this.renderConfig.id) {
+    this.svgElement.setAttribute('id', this.renderConfig.id);
+  }
+  if (this.renderConfig.focusable !== undefined) {
+    this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
+  }
+  this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio);
+  // this.layerElement.style.transform = 'translate3d(0,0,0)';
+  // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
+  this.animationItem.wrapper.appendChild(this.svgElement);
+  // Mask animation
+  var defs = this.globalData.defs;
 
-    this.setupGlobalData(animData, defs);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.data = animData;
+  this.setupGlobalData(animData, defs);
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.data = animData;
 
-    var maskElement = createNS( 'clipPath');
-    var rect = createNS('rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = createElementID();
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+  var maskElement = createNS('clipPath');
+  var rect = createNS('rect');
+  rect.setAttribute('width', animData.w);
+  rect.setAttribute('height', animData.h);
+  rect.setAttribute('x', 0);
+  rect.setAttribute('y', 0);
+  var maskId = createElementID();
+  maskElement.setAttribute('id', maskId);
+  maskElement.appendChild(rect);
+  this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + maskId + ')');
 
-    defs.appendChild(maskElement);
-    this.layers = animData.layers;
-    this.elements = createSizedArray(animData.layers.length);
+  defs.appendChild(maskElement);
+  this.layers = animData.layers;
+  this.elements = createSizedArray(animData.layers.length);
 };
 
-
 SVGRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.layerElement = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 SVGRenderer.prototype.updateContainerSize = function () {
 };
 
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
+SVGRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  elements[pos] = true;
+  var element = this.createItem(this.layers[pos]);
 
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
+  elements[pos] = element;
+  if (expressionsPlugin) {
+    if (this.layers[pos].ty === 0) {
+      this.globalData.projectInterface.registerComposition(element);
     }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
+    element.initExpressions();
+  }
+  this.appendElementInPos(element, pos);
+  if (this.layers[pos].tt) {
+    if (!this.elements[pos - 1] || this.elements[pos - 1] === true) {
+      this.buildItem(pos - 1);
+      this.addPendingElement(element);
+    } else {
+      element.setMatte(elements[pos - 1].layerId);
     }
+  }
 };
 
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame === num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    // console.log('-------');
-    // console.log('FRAME ',num);
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    this.globalData._mdf = false;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    if(this.globalData._mdf) {
-        for (i = 0; i < len; i += 1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
+SVGRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+    if (element.data.tt) {
+      var i = 0;
+      var len = this.elements.length;
+      while (i < len) {
+        if (this.elements[i] === element) {
+          element.setMatte(this.elements[i - 1].layerId);
+          break;
         }
         i += 1;
+      }
     }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
-    } else {
-        this.layerElement.appendChild(newElement);
-    }
+  }
 };
 
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
-};
-
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
-};
-
-function CanvasRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.renderConfig = {
-        clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
-        context: (config && config.context) || null,
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-    };
-    this.renderConfig.dpr = (config && config.dpr) || 1;
-    if (this.animationItem.wrapper) {
-        this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
+SVGRenderer.prototype.renderFrame = function (num) {
+  if (this.renderedFrame === num || this.destroyed) {
+    return;
+  }
+  if (num === null) {
+    num = this.renderedFrame;
+  } else {
+    this.renderedFrame = num;
+  }
+  // console.log('-------');
+  // console.log('FRAME ',num);
+  this.globalData.frameNum = num;
+  this.globalData.frameId += 1;
+  this.globalData.projectInterface.currentFrame = num;
+  this.globalData._mdf = false;
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
-    this.renderedFrame = -1;
-    this.globalData = {
-        frameNum: -1,
-        _mdf: false,
-        renderConfig: this.renderConfig,
-        currentGlobalAlpha: -1
-    };
-    this.contextData = new CVContextData();
-    this.elements = [];
-    this.pendingElements = [];
-    this.transformMat = new Matrix();
-    this.completeLayers = false;
-    this.rendererType = 'canvas';
+  }
+  if (this.globalData._mdf) {
+    for (i = 0; i < len; i += 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+  }
+};
+
+SVGRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newElement = element.getBaseElement();
+  if (!newElement) {
+    return;
+  }
+  var i = 0;
+  var nextElement;
+  while (i < pos) {
+    if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
+      nextElement = this.elements[i].getBaseElement();
+    }
+    i += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(newElement, nextElement);
+  } else {
+    this.layerElement.appendChild(newElement);
+  }
+};
+
+SVGRenderer.prototype.hide = function () {
+  this.layerElement.style.display = 'none';
+};
+
+SVGRenderer.prototype.show = function () {
+  this.layerElement.style.display = 'block';
+};
+
+/* global CVContextData, Matrix, extendPrototype, BaseRenderer, CVShapeElement, CVTextElement,
+CVImageElement, CVCompElement, CVSolidElement, SVGRenderer, createTag, createSizedArray */
+
+function CanvasRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.renderConfig = {
+    clearCanvas: (config && config.clearCanvas !== undefined) ? config.clearCanvas : true,
+    context: (config && config.context) || null,
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+  };
+  this.renderConfig.dpr = (config && config.dpr) || 1;
+  if (this.animationItem.wrapper) {
+    this.renderConfig.dpr = (config && config.dpr) || window.devicePixelRatio || 1;
+  }
+  this.renderedFrame = -1;
+  this.globalData = {
+    frameNum: -1,
+    _mdf: false,
+    renderConfig: this.renderConfig,
+    currentGlobalAlpha: -1,
+  };
+  this.contextData = new CVContextData();
+  this.elements = [];
+  this.pendingElements = [];
+  this.transformMat = new Matrix();
+  this.completeLayers = false;
+  this.rendererType = 'canvas';
 }
-extendPrototype([BaseRenderer],CanvasRenderer);
+extendPrototype([BaseRenderer], CanvasRenderer);
 
 CanvasRenderer.prototype.createShape = function (data) {
-    return new CVShapeElement(data, this.globalData, this);
+  return new CVShapeElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createText = function (data) {
-    return new CVTextElement(data, this.globalData, this);
+  return new CVTextElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createImage = function (data) {
-    return new CVImageElement(data, this.globalData, this);
+  return new CVImageElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createComp = function (data) {
-    return new CVCompElement(data, this.globalData, this);
+  return new CVCompElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createSolid = function (data) {
-    return new CVSolidElement(data, this.globalData, this);
+  return new CVSolidElement(data, this.globalData, this);
 };
 
 CanvasRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
 
-CanvasRenderer.prototype.ctxTransform = function(props){
-    if(props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0){
-        return;
-    }
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.transform(props[0],props[1],props[4],props[5],props[12],props[13]);
-        return;
-    }
-    this.transformMat.cloneFromProps(props);
-    var cProps = this.contextData.cTr.props;
-    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]);
-    //this.contextData.cTr.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]);
-    this.contextData.cTr.cloneFromProps(this.transformMat.props);
-    var trProps = this.contextData.cTr.props;
-    this.canvasContext.setTransform(trProps[0],trProps[1],trProps[4],trProps[5],trProps[12],trProps[13]);
+CanvasRenderer.prototype.ctxTransform = function (props) {
+  if (props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0) {
+    return;
+  }
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.transform(props[0], props[1], props[4], props[5], props[12], props[13]);
+    return;
+  }
+  this.transformMat.cloneFromProps(props);
+  var cProps = this.contextData.cTr.props;
+  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]);
+  // this.contextData.cTr.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]);
+  this.contextData.cTr.cloneFromProps(this.transformMat.props);
+  var trProps = this.contextData.cTr.props;
+  this.canvasContext.setTransform(trProps[0], trProps[1], trProps[4], trProps[5], trProps[12], trProps[13]);
 };
 
-CanvasRenderer.prototype.ctxOpacity = function(op){
-    /*if(op === 1){
+CanvasRenderer.prototype.ctxOpacity = function (op) {
+  /* if(op === 1){
         return;
-    }*/
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
-        this.globalData.currentGlobalAlpha = this.contextData.cO;
-        return;
-    }
-    this.contextData.cO *= op < 0 ? 0 : op;
-    if(this.globalData.currentGlobalAlpha !== this.contextData.cO) {
-        this.canvasContext.globalAlpha = this.contextData.cO;
-        this.globalData.currentGlobalAlpha = this.contextData.cO;
-    }
+    } */
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
+    this.globalData.currentGlobalAlpha = this.contextData.cO;
+    return;
+  }
+  this.contextData.cO *= op < 0 ? 0 : op;
+  if (this.globalData.currentGlobalAlpha !== this.contextData.cO) {
+    this.canvasContext.globalAlpha = this.contextData.cO;
+    this.globalData.currentGlobalAlpha = this.contextData.cO;
+  }
 };
 
-CanvasRenderer.prototype.reset = function(){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.restore();
-        return;
-    }
-    this.contextData.reset();
+CanvasRenderer.prototype.reset = function () {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.restore();
+    return;
+  }
+  this.contextData.reset();
 };
 
-CanvasRenderer.prototype.save = function(actionFlag){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.save();
-        return;
-    }
-    if(actionFlag){
-        this.canvasContext.save();
-    }
-    var props = this.contextData.cTr.props;
-    if(this.contextData._length <= this.contextData.cArrPos) {
-        this.contextData.duplicate();
-    }
-    var i, arr = this.contextData.saved[this.contextData.cArrPos];
-    for (i = 0; i < 16; i += 1) {
-        arr[i] = props[i];
-    }
-    this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
-    this.contextData.cArrPos += 1;
+CanvasRenderer.prototype.save = function (actionFlag) {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.save();
+    return;
+  }
+  if (actionFlag) {
+    this.canvasContext.save();
+  }
+  var props = this.contextData.cTr.props;
+  if (this.contextData._length <= this.contextData.cArrPos) {
+    this.contextData.duplicate();
+  }
+  var i;
+  var arr = this.contextData.saved[this.contextData.cArrPos];
+  for (i = 0; i < 16; i += 1) {
+    arr[i] = props[i];
+  }
+  this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO;
+  this.contextData.cArrPos += 1;
 };
 
-CanvasRenderer.prototype.restore = function(actionFlag){
-    if(!this.renderConfig.clearCanvas){
-        this.canvasContext.restore();
-        return;
-    }
-    if(actionFlag){
-        this.canvasContext.restore();
-        this.globalData.blendMode = 'source-over';
-    }
-    this.contextData.cArrPos -= 1;
-    var popped = this.contextData.saved[this.contextData.cArrPos];
-    var i,arr = this.contextData.cTr.props;
-    for(i=0;i<16;i+=1){
-        arr[i] = popped[i];
-    }
-    this.canvasContext.setTransform(popped[0],popped[1],popped[4],popped[5],popped[12],popped[13]);
-    popped = this.contextData.savedOp[this.contextData.cArrPos];
-    this.contextData.cO = popped;
-    if(this.globalData.currentGlobalAlpha !== popped) {
-        this.canvasContext.globalAlpha = popped;
-        this.globalData.currentGlobalAlpha = popped;
-    }
+CanvasRenderer.prototype.restore = function (actionFlag) {
+  if (!this.renderConfig.clearCanvas) {
+    this.canvasContext.restore();
+    return;
+  }
+  if (actionFlag) {
+    this.canvasContext.restore();
+    this.globalData.blendMode = 'source-over';
+  }
+  this.contextData.cArrPos -= 1;
+  var popped = this.contextData.saved[this.contextData.cArrPos];
+  var i;
+  var arr = this.contextData.cTr.props;
+  for (i = 0; i < 16; i += 1) {
+    arr[i] = popped[i];
+  }
+  this.canvasContext.setTransform(popped[0], popped[1], popped[4], popped[5], popped[12], popped[13]);
+  popped = this.contextData.savedOp[this.contextData.cArrPos];
+  this.contextData.cO = popped;
+  if (this.globalData.currentGlobalAlpha !== popped) {
+    this.canvasContext.globalAlpha = popped;
+    this.globalData.currentGlobalAlpha = popped;
+  }
 };
 
-CanvasRenderer.prototype.configAnimation = function(animData){
-    if(this.animationItem.wrapper){
-        this.animationItem.container = createTag('canvas');
-        this.animationItem.container.style.width = '100%';
-        this.animationItem.container.style.height = '100%';
-        //this.animationItem.container.style.transform = 'translate3d(0,0,0)';
-        //this.animationItem.container.style.webkitTransform = 'translate3d(0,0,0)';
-        this.animationItem.container.style.transformOrigin = this.animationItem.container.style.mozTransformOrigin = this.animationItem.container.style.webkitTransformOrigin = this.animationItem.container.style['-webkit-transform'] = "0px 0px 0px";
-        this.animationItem.wrapper.appendChild(this.animationItem.container);
-        this.canvasContext = this.animationItem.container.getContext('2d');
-        if(this.renderConfig.className) {
-            this.animationItem.container.setAttribute('class', this.renderConfig.className);
-        }
-        if(this.renderConfig.id) {
-            this.animationItem.container.setAttribute('id', this.renderConfig.id);
-        }
-    }else{
-        this.canvasContext = this.renderConfig.context;
+CanvasRenderer.prototype.configAnimation = function (animData) {
+  if (this.animationItem.wrapper) {
+    this.animationItem.container = createTag('canvas');
+    var containerStyle = this.animationItem.container.style;
+    containerStyle.width = '100%';
+    containerStyle.height = '100%';
+    var origin = '0px 0px 0px';
+    containerStyle.transformOrigin = origin;
+    containerStyle.mozTransformOrigin = origin;
+    containerStyle.webkitTransformOrigin = origin;
+    containerStyle['-webkit-transform'] = origin;
+    this.animationItem.wrapper.appendChild(this.animationItem.container);
+    this.canvasContext = this.animationItem.container.getContext('2d');
+    if (this.renderConfig.className) {
+      this.animationItem.container.setAttribute('class', this.renderConfig.className);
     }
-    this.data = animData;
-    this.layers = animData.layers;
-    this.transformCanvas = {
-        w: animData.w,
-        h:animData.h,
-        sx:0,
-        sy:0,
-        tx:0,
-        ty:0
-    };
-    this.setupGlobalData(animData, document.body);
-    this.globalData.canvasContext = this.canvasContext;
-    this.globalData.renderer = this;
-    this.globalData.isDashed = false;
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.globalData.transformCanvas = this.transformCanvas;
-    this.elements = createSizedArray(animData.layers.length);
+    if (this.renderConfig.id) {
+      this.animationItem.container.setAttribute('id', this.renderConfig.id);
+    }
+  } else {
+    this.canvasContext = this.renderConfig.context;
+  }
+  this.data = animData;
+  this.layers = animData.layers;
+  this.transformCanvas = {
+    w: animData.w,
+    h: animData.h,
+    sx: 0,
+    sy: 0,
+    tx: 0,
+    ty: 0,
+  };
+  this.setupGlobalData(animData, document.body);
+  this.globalData.canvasContext = this.canvasContext;
+  this.globalData.renderer = this;
+  this.globalData.isDashed = false;
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.globalData.transformCanvas = this.transformCanvas;
+  this.elements = createSizedArray(animData.layers.length);
 
-    this.updateContainerSize();
+  this.updateContainerSize();
 };
 
 CanvasRenderer.prototype.updateContainerSize = function () {
-    this.reset();
-    var elementWidth,elementHeight;
-    if(this.animationItem.wrapper && this.animationItem.container){
-        elementWidth = this.animationItem.wrapper.offsetWidth;
-        elementHeight = this.animationItem.wrapper.offsetHeight;
-        this.animationItem.container.setAttribute('width',elementWidth * this.renderConfig.dpr );
-        this.animationItem.container.setAttribute('height',elementHeight * this.renderConfig.dpr);
-    }else{
-        elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
-        elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
+  this.reset();
+  var elementWidth;
+  var elementHeight;
+  if (this.animationItem.wrapper && this.animationItem.container) {
+    elementWidth = this.animationItem.wrapper.offsetWidth;
+    elementHeight = this.animationItem.wrapper.offsetHeight;
+    this.animationItem.container.setAttribute('width', elementWidth * this.renderConfig.dpr);
+    this.animationItem.container.setAttribute('height', elementHeight * this.renderConfig.dpr);
+  } else {
+    elementWidth = this.canvasContext.canvas.width * this.renderConfig.dpr;
+    elementHeight = this.canvasContext.canvas.height * this.renderConfig.dpr;
+  }
+  var elementRel;
+  var animationRel;
+  if (this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1) {
+    var par = this.renderConfig.preserveAspectRatio.split(' ');
+    var fillType = par[1] || 'meet';
+    var pos = par[0] || 'xMidYMid';
+    var xPos = pos.substr(0, 4);
+    var yPos = pos.substr(4);
+    elementRel = elementWidth / elementHeight;
+    animationRel = this.transformCanvas.w / this.transformCanvas.h;
+    if ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice')) {
+      this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+      this.transformCanvas.sy = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+    } else {
+      this.transformCanvas.sx = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
+      this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
     }
-    var elementRel,animationRel;
-    if(this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1){
-        var par = this.renderConfig.preserveAspectRatio.split(' ');
-        var fillType = par[1] || 'meet';
-        var pos = par[0] || 'xMidYMid';
-        var xPos = pos.substr(0,4);
-        var yPos = pos.substr(4);
-        elementRel = elementWidth/elementHeight;
-        animationRel = this.transformCanvas.w/this.transformCanvas.h;
-        if(animationRel>elementRel && fillType === 'meet' || animationRel<elementRel && fillType === 'slice'){
-            this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-            this.transformCanvas.sy = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-        }else{
-            this.transformCanvas.sx = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
-            this.transformCanvas.sy = elementHeight/(this.transformCanvas.h / this.renderConfig.dpr);
-        }
 
-        if(xPos === 'xMid' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
-            this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))/2*this.renderConfig.dpr;
-        } else if(xPos === 'xMax' && ((animationRel<elementRel && fillType==='meet') || (animationRel>elementRel && fillType === 'slice'))){
-            this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))*this.renderConfig.dpr;
-        } else {
-            this.transformCanvas.tx = 0;
-        }
-        if(yPos === 'YMid' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
-            this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w))/2)*this.renderConfig.dpr;
-        } else if(yPos === 'YMax' && ((animationRel>elementRel && fillType==='meet') || (animationRel<elementRel && fillType === 'slice'))){
-            this.transformCanvas.ty = ((elementHeight-this.transformCanvas.h*(elementWidth/this.transformCanvas.w)))*this.renderConfig.dpr;
-        } else {
-            this.transformCanvas.ty = 0;
-        }
-
-    }else if(this.renderConfig.preserveAspectRatio == 'none'){
-        this.transformCanvas.sx = elementWidth/(this.transformCanvas.w/this.renderConfig.dpr);
-        this.transformCanvas.sy = elementHeight/(this.transformCanvas.h/this.renderConfig.dpr);
-        this.transformCanvas.tx = 0;
-        this.transformCanvas.ty = 0;
-    }else{
-        this.transformCanvas.sx = this.renderConfig.dpr;
-        this.transformCanvas.sy = this.renderConfig.dpr;
-        this.transformCanvas.tx = 0;
-        this.transformCanvas.ty = 0;
+    if (xPos === 'xMid' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) {
+      this.transformCanvas.tx = ((elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) / 2) * this.renderConfig.dpr;
+    } else if (xPos === 'xMax' && ((animationRel < elementRel && fillType === 'meet') || (animationRel > elementRel && fillType === 'slice'))) {
+      this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) * this.renderConfig.dpr;
+    } else {
+      this.transformCanvas.tx = 0;
     }
-    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];
-    /*var i, len = this.elements.length;
+    if (yPos === 'YMid' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) {
+      this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) / 2) * this.renderConfig.dpr;
+    } else if (yPos === 'YMax' && ((animationRel > elementRel && fillType === 'meet') || (animationRel < elementRel && fillType === 'slice'))) {
+      this.transformCanvas.ty = ((elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w))) * this.renderConfig.dpr;
+    } else {
+      this.transformCanvas.ty = 0;
+    }
+  } else if (this.renderConfig.preserveAspectRatio === 'none') {
+    this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
+    this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
+    this.transformCanvas.tx = 0;
+    this.transformCanvas.ty = 0;
+  } else {
+    this.transformCanvas.sx = this.renderConfig.dpr;
+    this.transformCanvas.sy = this.renderConfig.dpr;
+    this.transformCanvas.tx = 0;
+    this.transformCanvas.ty = 0;
+  }
+  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];
+  /* var i, len = this.elements.length;
     for(i=0;i<len;i+=1){
         if(this.elements[i] && this.elements[i].data.ty === 0){
             this.elements[i].resize(this.globalData.transformCanvas);
         }
-    }*/
-    this.ctxTransform(this.transformCanvas.props);
-    this.canvasContext.beginPath();
-    this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
-    this.canvasContext.closePath();
-    this.canvasContext.clip();
+    } */
+  this.ctxTransform(this.transformCanvas.props);
+  this.canvasContext.beginPath();
+  this.canvasContext.rect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+  this.canvasContext.closePath();
+  this.canvasContext.clip();
 
-    this.renderFrame(this.renderedFrame, true);
+  this.renderFrame(this.renderedFrame, true);
 };
 
 CanvasRenderer.prototype.destroy = function () {
-    if(this.renderConfig.clearCanvas && this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.renderConfig.clearCanvas && this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = len - 1; i >= 0; i-=1) {
-        if(this.elements[i]) {
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.globalData.canvasContext = null;
-    this.animationItem.container = null;
-    this.destroyed = true;
+  }
+  this.elements.length = 0;
+  this.globalData.canvasContext = null;
+  this.animationItem.container = null;
+  this.destroyed = true;
 };
 
-CanvasRenderer.prototype.renderFrame = function(num, forceRender){
-    if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){
-        return;
-    }
-    this.renderedFrame = num;
-    this.globalData.frameNum = num - this.animationItem._isFirstFrame;
-    this.globalData.frameId += 1;
-    this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
-    this.globalData.projectInterface.currentFrame = num;
+CanvasRenderer.prototype.renderFrame = function (num, forceRender) {
+  if ((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1) {
+    return;
+  }
+  this.renderedFrame = num;
+  this.globalData.frameNum = num - this.animationItem._isFirstFrame;
+  this.globalData.frameId += 1;
+  this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
+  this.globalData.projectInterface.currentFrame = num;
 
-     // console.log('--------');
-     // console.log('NEW: ',num);
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
+  // console.log('--------');
+  // console.log('NEW: ',num);
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
 
-    for (i = 0; i < len; i++) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
-    if(this.globalData._mdf) {
-        if(this.renderConfig.clearCanvas === true){
-            this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
-        }else{
-            this.save();
-        }
-        for (i = len - 1; i >= 0; i-=1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-        if(this.renderConfig.clearCanvas !== true){
-            this.restore();
-        }
+  }
+  if (this.globalData._mdf) {
+    if (this.renderConfig.clearCanvas === true) {
+      this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
+    } else {
+      this.save();
     }
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+    if (this.renderConfig.clearCanvas !== true) {
+      this.restore();
+    }
+  }
 };
 
-CanvasRenderer.prototype.buildItem = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    var element = this.createItem(this.layers[pos], this,this.globalData);
-    elements[pos] = element;
-    element.initExpressions();
-    /*if(this.layers[pos].ty === 0){
+CanvasRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  var element = this.createItem(this.layers[pos], this, this.globalData);
+  elements[pos] = element;
+  element.initExpressions();
+  /* if(this.layers[pos].ty === 0){
         element.resize(this.globalData.transformCanvas);
-    }*/
+    } */
 };
 
-CanvasRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-    }
+CanvasRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+  }
 };
 
-CanvasRenderer.prototype.hide = function(){
-    this.animationItem.container.style.display = 'none';
+CanvasRenderer.prototype.hide = function () {
+  this.animationItem.container.style.display = 'none';
 };
 
-CanvasRenderer.prototype.show = function(){
-    this.animationItem.container.style.display = 'block';
+CanvasRenderer.prototype.show = function () {
+  this.animationItem.container.style.display = 'block';
 };
 
-function MaskElement(data,element,globalData) {
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties || [];
-    this.maskElement = null;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties ? this.masksProperties.length : 0;
-    this.viewData = createSizedArray(len);
-    this.solidPath = '';
+/* global createSizedArray, createElementID, PropertyFactory, ShapePropertyFactory, createNS, locationHref */
 
+function MaskElement(data, element, globalData) {
+  this.data = data;
+  this.element = element;
+  this.globalData = globalData;
+  this.storedData = [];
+  this.masksProperties = this.data.masksProperties || [];
+  this.maskElement = null;
+  var defs = this.globalData.defs;
+  var i;
+  var len = this.masksProperties ? this.masksProperties.length : 0;
+  this.viewData = createSizedArray(len);
+  this.solidPath = '';
 
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = createElementID();
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
-            rect = createNS( 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w || 0);
-            rect.setAttribute('height', this.element.comp.data.h || 0);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = createNS( 'path');
-        if(properties[i].mode == 'n') {
-            // TODO move this to a factory or to a constructor
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-                elem: path,
-                lastPath: ''
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
-        path.setAttribute('clip-rule','nonzero');
-        var filterID;
-
-        if (properties[i].x.k !== 0) {
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
-            filterID = createElementID();
-            expansor = createNS('filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = createNS('feMorphology');
-            feMorph.setAttribute('operator','erode');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
-        } else {
-            feMorph = null;
-            x = null;
-        }
-
-        // TODO move this to a factory or to a constructor
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = createNS('g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = createNS('mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        // TODO move this to a factory or to a constructor
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-            invRect: rect
-        };
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
+  var path;
+  var properties = this.masksProperties;
+  var count = 0;
+  var currentMasks = [];
+  var j;
+  var jLen;
+  var layerId = createElementID();
+  var rect;
+  var expansor;
+  var feMorph;
+  var x;
+  var maskType = 'clipPath';
+  var maskRef = 'clip-path';
+  for (i = 0; i < len; i += 1) {
+    if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
+      maskType = 'mask';
+      maskRef = 'mask';
     }
 
-    this.maskElement = createNS( maskType);
-
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
+    if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
+      rect = createNS('rect');
+      rect.setAttribute('fill', '#ffffff');
+      rect.setAttribute('width', this.element.comp.data.w || 0);
+      rect.setAttribute('height', this.element.comp.data.h || 0);
+      currentMasks.push(rect);
+    } else {
+      rect = null;
     }
 
-    if(count > 0){
-        this.maskElement.setAttribute('id', layerId);
-        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
-        defs.appendChild(this.maskElement);
-    }
-    if (this.viewData.length) {
-        this.element.addRenderableComponent(this);
-    }
+    path = createNS('path');
+    if (properties[i].mode === 'n') {
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        elem: path,
+        lastPath: '',
+      };
+      defs.appendChild(path);
+    } else {
+      count += 1;
 
+      path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      path.setAttribute('clip-rule', 'nonzero');
+      var filterID;
+
+      if (properties[i].x.k !== 0) {
+        maskType = 'mask';
+        maskRef = 'mask';
+        x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
+        filterID = createElementID();
+        expansor = createNS('filter');
+        expansor.setAttribute('id', filterID);
+        feMorph = createNS('feMorphology');
+        feMorph.setAttribute('operator', 'erode');
+        feMorph.setAttribute('in', 'SourceGraphic');
+        feMorph.setAttribute('radius', '0');
+        expansor.appendChild(feMorph);
+        defs.appendChild(expansor);
+        path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      } else {
+        feMorph = null;
+        x = null;
+      }
+
+      // TODO move this to a factory or to a constructor
+      this.storedData[i] = {
+        elem: path,
+        x: x,
+        expan: feMorph,
+        lastPath: '',
+        lastOperator: '',
+        filterId: filterID,
+        lastRadius: 0,
+      };
+      if (properties[i].mode === 'i') {
+        jLen = currentMasks.length;
+        var g = createNS('g');
+        for (j = 0; j < jLen; j += 1) {
+          g.appendChild(currentMasks[j]);
+        }
+        var mask = createNS('mask');
+        mask.setAttribute('mask-type', 'alpha');
+        mask.setAttribute('id', layerId + '_' + count);
+        mask.appendChild(path);
+        defs.appendChild(mask);
+        g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
+
+        currentMasks.length = 0;
+        currentMasks.push(g);
+      } else {
+        currentMasks.push(path);
+      }
+      if (properties[i].inv && !this.solidPath) {
+        this.solidPath = this.createLayerSolidPath();
+      }
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        elem: path,
+        lastPath: '',
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        invRect: rect,
+      };
+      if (!this.viewData[i].prop.k) {
+        this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
+      }
+    }
+  }
+
+  this.maskElement = createNS(maskType);
+
+  len = currentMasks.length;
+  for (i = 0; i < len; i += 1) {
+    this.maskElement.appendChild(currentMasks[i]);
+  }
+
+  if (count > 0) {
+    this.maskElement.setAttribute('id', layerId);
+    this.element.maskedElement.setAttribute(maskRef, 'url(' + locationHref + '#' + layerId + ')');
+    defs.appendChild(this.maskElement);
+  }
+  if (this.viewData.length) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
+MaskElement.prototype.getMaskProperty = function (pos) {
+  return this.viewData[pos].prop;
 };
 
 MaskElement.prototype.renderFrame = function (isFirstFrame) {
-    var finalMat = this.element.finalTransform.mat;
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop._mdf || isFirstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op._mdf || isFirstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
-                this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
-            }
-            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
+  var finalMat = this.element.finalTransform.mat;
+  var i;
+  var len = this.masksProperties.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.viewData[i].prop._mdf || isFirstFrame) {
+      this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
     }
+    if (this.viewData[i].op._mdf || isFirstFrame) {
+      this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
+    }
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
+        this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
+      }
+      if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
+        var feMorph = this.storedData[i].expan;
+        if (this.storedData[i].x.v < 0) {
+          if (this.storedData[i].lastOperator !== 'erode') {
+            this.storedData[i].lastOperator = 'erode';
+            this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
+          }
+          feMorph.setAttribute('radius', -this.storedData[i].x.v);
+        } else {
+          if (this.storedData[i].lastOperator !== 'dilate') {
+            this.storedData[i].lastOperator = 'dilate';
+            this.storedData[i].elem.setAttribute('filter', null);
+          }
+          this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
+        }
+      }
+    }
+  }
 };
 
 MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
+  return this.maskElement;
 };
 
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
+MaskElement.prototype.createLayerSolidPath = function () {
+  var path = 'M0,0 ';
+  path += ' h' + this.globalData.compSize.w;
+  path += ' v' + this.globalData.compSize.h;
+  path += ' h-' + this.globalData.compSize.w;
+  path += ' v-' + this.globalData.compSize.h + ' ';
+  return path;
 };
 
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //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];
-        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];
-    }
-        //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];
-    if(pathNodes.c && len > 1){
-        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];
-    }
-    //pathNodes.__renderedString = pathString;
+MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
+  var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
+  var i;
+  var len;
+  len = pathNodes._length;
+  for (i = 1; i < len; i += 1) {
+    // 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];
+    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];
+  }
+  // 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];
+  if (pathNodes.c && len > 1) {
+    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];
+  }
+  // pathNodes.__renderedString = pathString;
 
-    if(viewData.lastPath !== pathString){
-        var pathShapeValue = '';
-        if(viewData.elem){
-            if(pathNodes.c){
-                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
-            }
-            viewData.elem.setAttribute('d',pathShapeValue);
-        }
-        viewData.lastPath = pathString;
+  if (viewData.lastPath !== pathString) {
+    var pathShapeValue = '';
+    if (viewData.elem) {
+      if (pathNodes.c) {
+        pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
+      }
+      viewData.elem.setAttribute('d', pathShapeValue);
     }
+    viewData.lastPath = pathString;
+  }
 };
 
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.masksProperties = null;
+MaskElement.prototype.destroy = function () {
+  this.element = null;
+  this.globalData = null;
+  this.maskElement = null;
+  this.data = null;
+  this.masksProperties = null;
 };
 
 /**
- * @file 
+ * @file
  * Handles AE's layer parenting property.
  *
  */
 
-function HierarchyElement(){}
+function HierarchyElement() {}
 
 HierarchyElement.prototype = {
-	/**
-     * @function 
+  /**
+     * @function
      * Initializes hierarchy properties
      *
      */
-	initHierarchy: function() {
-		//element's parent list
-	    this.hierarchy = [];
-	    //if element is parent of another layer _isParent will be true
-	    this._isParent = false;
-	    this.checkParenting();
-	},
-	/**
-     * @function 
+  initHierarchy: function () {
+    // element's parent list
+    this.hierarchy = [];
+    // if element is parent of another layer _isParent will be true
+    this._isParent = false;
+    this.checkParenting();
+  },
+  /**
+     * @function
      * Sets layer's hierarchy.
      * @param {array} hierarch
      * layer's parent list
      *
-     */ 
-	setHierarchy: function(hierarchy){
-	    this.hierarchy = hierarchy;
-	},
-	/**
-     * @function 
+     */
+  setHierarchy: function (hierarchy) {
+    this.hierarchy = hierarchy;
+  },
+  /**
+     * @function
      * Sets layer as parent.
      *
-     */ 
-	setAsParent: function() {
-	    this._isParent = true;
-	},
-	/**
-     * @function 
+     */
+  setAsParent: function () {
+    this._isParent = true;
+  },
+  /**
+     * @function
      * Searches layer's parenting chain
      *
-     */ 
-	checkParenting: function(){
-	    if (this.data.parent !== undefined){
-	        this.comp.buildElementParenting(this, this.data.parent, []);
-	    }
-	}
+     */
+  checkParenting: function () {
+    if (this.data.parent !== undefined) {
+      this.comp.buildElementParenting(this, this.data.parent, []);
+    }
+  },
 };
+
 /**
- * @file 
+ * @file
  * Handles element's layer frame update.
  * Checks layer in point and out point
  *
  */
 
-function FrameElement(){}
+function FrameElement() {}
 
 FrameElement.prototype = {
-    /**
-     * @function 
+  /**
+     * @function
      * Initializes frame related properties.
      *
      */
-    initFrame: function(){
-        //set to true when inpoint is rendered
-        this._isFirstFrame = false;
-        //list of animated properties
-        this.dynamicProperties = [];
-        // If layer has been modified in current tick this will be true
-        this._mdf = false;
-    },
-    /**
-     * @function 
+  initFrame: function () {
+    // set to true when inpoint is rendered
+    this._isFirstFrame = false;
+    // list of animated properties
+    this.dynamicProperties = [];
+    // If layer has been modified in current tick this will be true
+    this._mdf = false;
+  },
+  /**
+     * @function
      * Calculates all dynamic values
      *
      * @param {number} num
      * current frame number in Layer's time
      * @param {boolean} isVisible
      * if layers is currently in range
-     * 
+     *
      */
-    prepareProperties: function(num, isVisible) {
-        var i, len = this.dynamicProperties.length;
-        for (i = 0;i < len; i += 1) {
-            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i]._mdf) {
-                    this.globalData._mdf = true;
-                    this._mdf = true;
-                }
-            }
+  prepareProperties: function (num, isVisible) {
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+        this.dynamicProperties[i].getValue();
+        if (this.dynamicProperties[i]._mdf) {
+          this.globalData._mdf = true;
+          this._mdf = true;
         }
-    },
-    addDynamicProperty: function(prop) {
-        if(this.dynamicProperties.indexOf(prop) === -1) {
-            this.dynamicProperties.push(prop);
-        }
+      }
     }
+  },
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+    }
+  },
 };
-function TransformElement(){}
+
+/* global TransformPropertyFactory, Matrix */
+
+function TransformElement() {}
 
 TransformElement.prototype = {
-    initTransform: function() {
-        this.finalTransform = {
-            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
-            _matMdf: false,
-            _opMdf: false,
-            mat: new Matrix()
-        };
-        if (this.data.ao) {
-            this.finalTransform.mProp.autoOriented = true;
-        }
+  initTransform: function () {
+    this.finalTransform = {
+      mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 },
+      _matMdf: false,
+      _opMdf: false,
+      mat: new Matrix(),
+    };
+    if (this.data.ao) {
+      this.finalTransform.mProp.autoOriented = true;
+    }
 
-        //TODO: check TYPE 11: Guided elements
-        if (this.data.ty !== 11) {
-            //this.createElements();
-        }
-    },
-    renderTransform: function() {
+    // TODO: check TYPE 11: Guided elements
+    if (this.data.ty !== 11) {
+      // this.createElements();
+    }
+  },
+  renderTransform: function () {
+    this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+    this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
 
-        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
-        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+    if (this.hierarchy) {
+      var mat;
+      var finalMat = this.finalTransform.mat;
+      var i = 0;
+      var len = this.hierarchy.length;
+      // Checking if any of the transformation matrices in the hierarchy chain has changed.
+      if (!this.finalTransform._matMdf) {
+        while (i < len) {
+          if (this.hierarchy[i].finalTransform.mProp._mdf) {
+            this.finalTransform._matMdf = true;
+            break;
+          }
+          i += 1;
+        }
+      }
 
-        if (this.hierarchy) {
-            var mat;
-            var finalMat = this.finalTransform.mat;
-            var i = 0, len = this.hierarchy.length;
-            //Checking if any of the transformation matrices in the hierarchy chain has changed.
-            if (!this.finalTransform._matMdf) {
-                while (i < len) {
-                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
-                        this.finalTransform._matMdf = true;
-                        break;
-                    }
-                    i += 1;
-                }
-            }
-            
-            if (this.finalTransform._matMdf) {
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-                for (i = 0; i < len; i += 1) {
-                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                    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]);
-                }
-            }
-        }
-    },
-    globalToLocal: function(pt) {
-        var transforms = [];
-        transforms.push(this.finalTransform);
-        var flag = true;
-        var comp = this.comp;
-        while (flag) {
-            if (comp.finalTransform) {
-                if (comp.data.hasMask) {
-                    transforms.splice(0, 0, comp.finalTransform);
-                }
-                comp = comp.comp;
-            } else {
-                flag = false;
-            }
-        }
-        var i, len = transforms.length,ptNew;
+      if (this.finalTransform._matMdf) {
+        mat = this.finalTransform.mProp.v.props;
+        finalMat.cloneFromProps(mat);
         for (i = 0; i < len; i += 1) {
-            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
-            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+          mat = this.hierarchy[i].finalTransform.mProp.v.props;
+          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]);
         }
-        return pt;
-    },
-    mHelper: new Matrix()
+      }
+    }
+  },
+  globalToLocal: function (pt) {
+    var transforms = [];
+    transforms.push(this.finalTransform);
+    var flag = true;
+    var comp = this.comp;
+    while (flag) {
+      if (comp.finalTransform) {
+        if (comp.data.hasMask) {
+          transforms.splice(0, 0, comp.finalTransform);
+        }
+        comp = comp.comp;
+      } else {
+        flag = false;
+      }
+    }
+    var i;
+    var len = transforms.length;
+    var ptNew;
+    for (i = 0; i < len; i += 1) {
+      ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+      // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+      pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+    }
+    return pt;
+  },
+  mHelper: new Matrix(),
 };
-function RenderableElement(){
+
+function RenderableElement() {
 
 }
 
 RenderableElement.prototype = {
-    initRenderable: function() {
-        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
-        this.isInRange = false;
-        //layer's display state
-        this.hidden = false;
-        // If layer's transparency equals 0, it can be hidden
-        this.isTransparent = false;
-        //list of animated components
-        this.renderableComponents = [];
-    },
-    addRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) === -1) {
-            this.renderableComponents.push(component);
-        }
-    },
-    removeRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) !== -1) {
-            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
-        }
-    },
-    prepareRenderableFrame: function(num) {
-        this.checkLayerLimits(num);
-    },
-    checkTransparency: function(){
-        if(this.finalTransform.mProp.o.v <= 0) {
-            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
-                this.isTransparent = true;
-                this.hide();
-            }
-        } else if(this.isTransparent) {
-            this.isTransparent = false;
-            this.show();
-        }
-    },
-    /**
-     * @function 
+  initRenderable: function () {
+    // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+    this.isInRange = false;
+    // layer's display state
+    this.hidden = false;
+    // If layer's transparency equals 0, it can be hidden
+    this.isTransparent = false;
+    // list of animated components
+    this.renderableComponents = [];
+  },
+  addRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) === -1) {
+      this.renderableComponents.push(component);
+    }
+  },
+  removeRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) !== -1) {
+      this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+    }
+  },
+  prepareRenderableFrame: function (num) {
+    this.checkLayerLimits(num);
+  },
+  checkTransparency: function () {
+    if (this.finalTransform.mProp.o.v <= 0) {
+      if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
+        this.isTransparent = true;
+        this.hide();
+      }
+    } else if (this.isTransparent) {
+      this.isTransparent = false;
+      this.show();
+    }
+  },
+  /**
+     * @function
      * Initializes frame related properties.
      *
      * @param {number} num
      * current frame number in Layer's time
-     * 
+     *
      */
-    checkLayerLimits: function(num) {
-        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-        {
-            if(this.isInRange !== true){
-                this.globalData._mdf = true;
-                this._mdf = true;
-                this.isInRange = true;
-                this.show();
-            }
-        } else {
-            if(this.isInRange !== false){
-                this.globalData._mdf = true;
-                this.isInRange = false;
-                this.hide();
-            }
-        }
-    },
-    renderRenderable: function() {
-        var i, len = this.renderableComponents.length;
-        for(i = 0; i < len; i += 1) {
-            this.renderableComponents[i].renderFrame(this._isFirstFrame);
-        }
-        /*this.maskManager.renderFrame(this.finalTransform.mat);
-        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
-    },
-    sourceRectAtTime: function(){
-        return {
-            top:0,
-            left:0,
-            width:100,
-            height:100
-        };
-    },
-    getLayerSize: function(){
-        if(this.data.ty === 5){
-            return {w:this.data.textData.width,h:this.data.textData.height};
-        }else{
-            return {w:this.data.width,h:this.data.height};
-        }
+  checkLayerLimits: function (num) {
+    if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
+      if (this.isInRange !== true) {
+        this.globalData._mdf = true;
+        this._mdf = true;
+        this.isInRange = true;
+        this.show();
+      }
+    } else if (this.isInRange !== false) {
+      this.globalData._mdf = true;
+      this.isInRange = false;
+      this.hide();
     }
+  },
+  renderRenderable: function () {
+    var i;
+    var len = this.renderableComponents.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderableComponents[i].renderFrame(this._isFirstFrame);
+    }
+    /* this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
+  },
+  sourceRectAtTime: function () {
+    return {
+      top: 0,
+      left: 0,
+      width: 100,
+      height: 100,
+    };
+  },
+  getLayerSize: function () {
+    if (this.data.ty === 5) {
+      return { w: this.data.textData.width, h: this.data.textData.height };
+    }
+    return { w: this.data.width, h: this.data.height };
+  },
 };
+
+/* global extendPrototype, RenderableElement, createProxyFunction */
+
 function RenderableDOMElement() {}
 
-(function(){
-    var _prototype = {
-        initElement: function(data,globalData,comp) {
-            this.initFrame();
-            this.initBaseData(data, globalData, comp);
-            this.initTransform(data, globalData, comp);
-            this.initHierarchy();
-            this.initRenderable();
-            this.initRendererElement();
-            this.createContainerElements();
-            this.createRenderableComponents();
-            this.createContent();
-            this.hide();
-        },
-        hide: function(){
-            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-                var elem = this.baseElement || this.layerElement;
-                elem.style.display = 'none';
-                this.hidden = true;
-            }
-        },
-        show: function(){
-            if (this.isInRange && !this.isTransparent){
-                if (!this.data.hd) {
-                    var elem = this.baseElement || this.layerElement;
-                    elem.style.display = 'block';
-                }
-                this.hidden = false;
-                this._isFirstFrame = true;
-            }
-        },
-        renderFrame: function() {
-            //If it is exported as hidden (data.hd === true) no need to render
-            //If it is not visible no need to render
-            if (this.data.hd || this.hidden) {
-                return;
-            }
-            this.renderTransform();
-            this.renderRenderable();
-            this.renderElement();
-            this.renderInnerContent();
-            if (this._isFirstFrame) {
-                this._isFirstFrame = false;
-            }
-        },
-        renderInnerContent: function() {},
-        prepareFrame: function(num) {
-            this._mdf = false;
-            this.prepareRenderableFrame(num);
-            this.prepareProperties(num, this.isInRange);
-            this.checkTransparency();
-        },
-        destroy: function(){
-            this.innerElem =  null;
-            this.destroyBaseElement();
+(function () {
+  var _prototype = {
+    initElement: function (data, globalData, comp) {
+      this.initFrame();
+      this.initBaseData(data, globalData, comp);
+      this.initTransform(data, globalData, comp);
+      this.initHierarchy();
+      this.initRenderable();
+      this.initRendererElement();
+      this.createContainerElements();
+      this.createRenderableComponents();
+      this.createContent();
+      this.hide();
+    },
+    hide: function () {
+      if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+        var elem = this.baseElement || this.layerElement;
+        elem.style.display = 'none';
+        this.hidden = true;
+      }
+    },
+    show: function () {
+      if (this.isInRange && !this.isTransparent) {
+        if (!this.data.hd) {
+          var elem = this.baseElement || this.layerElement;
+          elem.style.display = 'block';
         }
-    };
-    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+        this.hidden = false;
+        this._isFirstFrame = true;
+      }
+    },
+    renderFrame: function () {
+      // If it is exported as hidden (data.hd === true) no need to render
+      // If it is not visible no need to render
+      if (this.data.hd || this.hidden) {
+        return;
+      }
+      this.renderTransform();
+      this.renderRenderable();
+      this.renderElement();
+      this.renderInnerContent();
+      if (this._isFirstFrame) {
+        this._isFirstFrame = false;
+      }
+    },
+    renderInnerContent: function () {},
+    prepareFrame: function (num) {
+      this._mdf = false;
+      this.prepareRenderableFrame(num);
+      this.prepareProperties(num, this.isInRange);
+      this.checkTransparency();
+    },
+    destroy: function () {
+      this.innerElem = null;
+      this.destroyBaseElement();
+    },
+  };
+  extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
 }());
+
+/* exported ProcessedElement */
+
 function ProcessedElement(element, position) {
-	this.elem = element;
-	this.pos = position;
-}
-function SVGShapeData(transformers, level, shape) {
-    this.caches = [];
-    this.styles = [];
-    this.transformers = transformers;
-    this.lStr = '';
-    this.sh = shape;
-    this.lvl = level;
-    //TODO find if there are some cases where _isAnimated can be false. 
-    // For now, since shapes add up with other shapes. They have to be calculated every time.
-    // One way of finding out is checking if all styles associated to this shape depend only of this shape
-    this._isAnimated = !!shape.k;
-    // TODO: commenting this for now since all shapes are animated
-    var i = 0, len = transformers.length;
-    while(i < len) {
-    	if(transformers[i].mProps.dynamicProperties.length) {
-    		this._isAnimated = true;
-    		break;
-    	}
-    	i += 1;
-    }
+  this.elem = element;
+  this.pos = position;
 }
 
-SVGShapeData.prototype.setAsAnimated = function() {
-    this._isAnimated = true;
+function SVGShapeData(transformers, level, shape) {
+  this.caches = [];
+  this.styles = [];
+  this.transformers = transformers;
+  this.lStr = '';
+  this.sh = shape;
+  this.lvl = level;
+  // TODO find if there are some cases where _isAnimated can be false.
+  // For now, since shapes add up with other shapes. They have to be calculated every time.
+  // One way of finding out is checking if all styles associated to this shape depend only of this shape
+  this._isAnimated = !!shape.k;
+  // TODO: commenting this for now since all shapes are animated
+  var i = 0;
+  var len = transformers.length;
+  while (i < len) {
+    if (transformers[i].mProps.dynamicProperties.length) {
+      this._isAnimated = true;
+      break;
+    }
+    i += 1;
+  }
 }
+
+SVGShapeData.prototype.setAsAnimated = function () {
+  this._isAnimated = true;
+};
+
+/* global createNS */
+/* exported ShapeGroupData */
+
 function ShapeGroupData() {
-	this.it = [];
-    this.prevViewData = [];
-    this.gr = createNS('g');
+  this.it = [];
+  this.prevViewData = [];
+  this.gr = createNS('g');
 }
+
+/* global Matrix */
+
 function ShapeTransformManager() {
-	this.sequences = {};
-	this.sequenceList = [];
-    this.transform_key_count = 0;
+  this.sequences = {};
+  this.sequenceList = [];
+  this.transform_key_count = 0;
 }
 
 ShapeTransformManager.prototype = {
-	addTransformSequence: function(transforms) {
-		var i, len = transforms.length;
-		var key = '_';
-		for(i = 0; i < len; i += 1) {
-			key += transforms[i].transform.key + '_';
-		}
-		var sequence = this.sequences[key];
-		if(!sequence) {
-			sequence = {
-				transforms: [].concat(transforms),
-				finalTransform: new Matrix(),
-				_mdf: false
-			};
-			this.sequences[key] = sequence;
-			this.sequenceList.push(sequence);
-		}
-		return sequence;
-	},
-	processSequence: function(sequence, isFirstFrame) {
-		var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
-		while (i < len && !isFirstFrame) {
-			if (sequence.transforms[i].transform.mProps._mdf) {
-				_mdf = true;
-				break;
-			}
-			i += 1
-		}
-		if (_mdf) {
-			var props;
-			sequence.finalTransform.reset();
-			for (i = len - 1; i >= 0; i -= 1) {
-		        props = sequence.transforms[i].transform.mProps.v.props;
-		        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]);
-			}
-		}
-		sequence._mdf = _mdf;
-		
-	},
-	processSequences: function(isFirstFrame) {
-		var i, len = this.sequenceList.length;
-		for (i = 0; i < len; i += 1) {
-			this.processSequence(this.sequenceList[i], isFirstFrame);
-		}
-
-	},
-	getNewKey: function() {
-		return '_' + this.transform_key_count++;
-	}
-}
-function CVShapeData(element, data, styles, transformsManager) {
-    this.styledShapes = [];
-    this.tr = [0,0,0,0,0,0];
-    var ty = 4;
-    if(data.ty == 'rc'){
-        ty = 5;
-    }else if(data.ty == 'el'){
-        ty = 6;
-    }else if(data.ty == 'sr'){
-        ty = 7;
-    }
-    this.sh = ShapePropertyFactory.getShapeProp(element,data,ty,element);
-    var i , len = styles.length,styledShape;
+  addTransformSequence: function (transforms) {
+    var i;
+    var len = transforms.length;
+    var key = '_';
     for (i = 0; i < len; i += 1) {
-        if (!styles[i].closed) {
-            styledShape = {
-                transforms: transformsManager.addTransformSequence(styles[i].transforms),
-                trNodes: []
-            }
-            this.styledShapes.push(styledShape);
-            styles[i].elements.push(styledShape);
-        }
+      key += transforms[i].transform.key + '_';
     }
+    var sequence = this.sequences[key];
+    if (!sequence) {
+      sequence = {
+        transforms: [].concat(transforms),
+        finalTransform: new Matrix(),
+        _mdf: false,
+      };
+      this.sequences[key] = sequence;
+      this.sequenceList.push(sequence);
+    }
+    return sequence;
+  },
+  processSequence: function (sequence, isFirstFrame) {
+    var i = 0;
+    var len = sequence.transforms.length;
+    var _mdf = isFirstFrame;
+    while (i < len && !isFirstFrame) {
+      if (sequence.transforms[i].transform.mProps._mdf) {
+        _mdf = true;
+        break;
+      }
+      i += 1;
+    }
+    if (_mdf) {
+      var props;
+      sequence.finalTransform.reset();
+      for (i = len - 1; i >= 0; i -= 1) {
+        props = sequence.transforms[i].transform.mProps.v.props;
+        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]);
+      }
+    }
+    sequence._mdf = _mdf;
+  },
+  processSequences: function (isFirstFrame) {
+    var i;
+    var len = this.sequenceList.length;
+    for (i = 0; i < len; i += 1) {
+      this.processSequence(this.sequenceList[i], isFirstFrame);
+    }
+  },
+  getNewKey: function () {
+    this.transform_key_count += 1;
+    return '_' + this.transform_key_count;
+  },
+};
+
+/* global ShapePropertyFactory, SVGShapeData */
+
+function CVShapeData(element, data, styles, transformsManager) {
+  this.styledShapes = [];
+  this.tr = [0, 0, 0, 0, 0, 0];
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  this.sh = ShapePropertyFactory.getShapeProp(element, data, ty, element);
+  var i;
+  var len = styles.length;
+  var styledShape;
+  for (i = 0; i < len; i += 1) {
+    if (!styles[i].closed) {
+      styledShape = {
+        transforms: transformsManager.addTransformSequence(styles[i].transforms),
+        trNodes: [],
+      };
+      this.styledShapes.push(styledShape);
+      styles[i].elements.push(styledShape);
+    }
+  }
 }
 
 CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;
-function BaseElement(){
+
+/* global LayerExpressionInterface, EffectsExpressionInterface, CompExpressionInterface, ShapeExpressionInterface,
+TextExpressionInterface, getBlendMode,createElementID, EffectsManager */
+
+function BaseElement() {
 }
 
 BaseElement.prototype = {
-    checkMasks: function(){
-        if(!this.data.hasMask){
-            return false;
-        }
-        var i = 0, len = this.data.masksProperties.length;
-        while(i<len) {
-            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-                return true;
-            }
-            i += 1;
-        }
-        return false;
-    },
-    initExpressions: function(){
-        this.layerInterface = LayerExpressionInterface(this);
-        if(this.data.hasMask && this.maskManager) {
-            this.layerInterface.registerMaskInterface(this.maskManager);
-        }
-        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-        this.layerInterface.registerEffectsInterface(effectsInterface);
-
-        if(this.data.ty === 0 || this.data.xt){
-            this.compInterface = CompExpressionInterface(this);
-        } else if(this.data.ty === 4){
-            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
-            this.layerInterface.content = this.layerInterface.shapeInterface;
-        } else if(this.data.ty === 5){
-            this.layerInterface.textInterface = TextExpressionInterface(this);
-            this.layerInterface.text = this.layerInterface.textInterface;
-        }
-    },
-    setBlendMode: function(){
-        var blendModeValue = getBlendMode(this.data.bm);
-        var elem = this.baseElement || this.layerElement;
-
-        elem.style['mix-blend-mode'] = blendModeValue;
-    },
-    initBaseData: function(data, globalData, comp){
-        this.globalData = globalData;
-        this.comp = comp;
-        this.data = data;
-        this.layerId = createElementID();
-        
-        //Stretch factor for old animations missing this property.
-        if(!this.data.sr){
-            this.data.sr = 1;
-        }
-        // effects manager
-        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-        
-    },
-    getType: function(){
-        return this.type;
+  checkMasks: function () {
+    if (!this.data.hasMask) {
+      return false;
     }
-    ,sourceRectAtTime: function(){}
-}
-function NullElement(data,globalData,comp){
-    this.initFrame();
-	this.initBaseData(data, globalData, comp);
-    this.initFrame();
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
+    var i = 0;
+    var len = this.data.masksProperties.length;
+    while (i < len) {
+      if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+        return true;
+      }
+      i += 1;
+    }
+    return false;
+  },
+  initExpressions: function () {
+    this.layerInterface = LayerExpressionInterface(this);
+    if (this.data.hasMask && this.maskManager) {
+      this.layerInterface.registerMaskInterface(this.maskManager);
+    }
+    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
+    this.layerInterface.registerEffectsInterface(effectsInterface);
+
+    if (this.data.ty === 0 || this.data.xt) {
+      this.compInterface = CompExpressionInterface(this);
+    } else if (this.data.ty === 4) {
+      this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
+      this.layerInterface.content = this.layerInterface.shapeInterface;
+    } else if (this.data.ty === 5) {
+      this.layerInterface.textInterface = TextExpressionInterface(this);
+      this.layerInterface.text = this.layerInterface.textInterface;
+    }
+  },
+  setBlendMode: function () {
+    var blendModeValue = getBlendMode(this.data.bm);
+    var elem = this.baseElement || this.layerElement;
+
+    elem.style['mix-blend-mode'] = blendModeValue;
+  },
+  initBaseData: function (data, globalData, comp) {
+    this.globalData = globalData;
+    this.comp = comp;
+    this.data = data;
+    this.layerId = createElementID();
+
+    // Stretch factor for old animations missing this property.
+    if (!this.data.sr) {
+      this.data.sr = 1;
+    }
+    // effects manager
+    this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
+  },
+  getType: function () {
+    return this.type;
+  },
+  sourceRectAtTime: function () {},
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement */
+
+function NullElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initFrame();
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
 }
 
-NullElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
+NullElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-NullElement.prototype.renderFrame = function() {
+NullElement.prototype.renderFrame = function () {
 };
 
-NullElement.prototype.getBaseElement = function() {
-	return null;
+NullElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-NullElement.prototype.destroy = function() {
+NullElement.prototype.destroy = function () {
 };
 
-NullElement.prototype.sourceRectAtTime = function() {
+NullElement.prototype.sourceRectAtTime = function () {
 };
 
-NullElement.prototype.hide = function() {
+NullElement.prototype.hide = function () {
 };
 
-extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
 
-function SVGBaseElement(){
+/* global filtersFactory, featureSupport, filtersFactory, createElementID, createNS, MaskElement, SVGEffects, locationHref */
+
+function SVGBaseElement() {
 }
 
 SVGBaseElement.prototype = {
-    initRendererElement: function() {
-        this.layerElement = createNS('g');
-    },
-    createContainerElements: function(){
-        this.matteElement = createNS('g');
-        this.transformedElement = this.layerElement;
-        this.maskedElement = this.layerElement;
-        this._sizeChanged = false;
-        var layerElementParent = null;
-        //If this layer acts as a mask for the following layer
-        var filId, fil, gg;
-        if (this.data.td) {
-            if (this.data.td == 3 || this.data.td == 1) {
-                var masker = createNS('mask');
-                masker.setAttribute('id', this.layerId);
-                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
-                masker.appendChild(this.layerElement);
-                layerElementParent = masker;
-                this.globalData.defs.appendChild(masker);
-                // This is only for IE and Edge when mask if of type alpha
-                if (!featureSupport.maskType && this.data.td == 1) {
-                    masker.setAttribute('mask-type', 'luminance');
-                    filId = createElementID();
-                    fil = filtersFactory.createFilter(filId);
-                    this.globalData.defs.appendChild(fil);
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    masker.appendChild(gg);
-                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
-                }
-            } else if(this.data.td == 2) {
-                var maskGroup = createNS('mask');
-                maskGroup.setAttribute('id', this.layerId);
-                maskGroup.setAttribute('mask-type','alpha');
-                var maskGrouper = createNS('g');
-                maskGroup.appendChild(maskGrouper);
-                filId = createElementID();
-                fil = filtersFactory.createFilter(filId);
-                ////
+  initRendererElement: function () {
+    this.layerElement = createNS('g');
+  },
+  createContainerElements: function () {
+    this.matteElement = createNS('g');
+    this.transformedElement = this.layerElement;
+    this.maskedElement = this.layerElement;
+    this._sizeChanged = false;
+    var layerElementParent = null;
+    // If this layer acts as a mask for the following layer
+    var filId;
+    var fil;
+    var gg;
+    if (this.data.td) {
+      if (this.data.td == 3 || this.data.td == 1) { // eslint-disable-line eqeqeq
+        var masker = createNS('mask');
+        masker.setAttribute('id', this.layerId);
+        masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha'); // eslint-disable-line eqeqeq
+        masker.appendChild(this.layerElement);
+        layerElementParent = masker;
+        this.globalData.defs.appendChild(masker);
+        // This is only for IE and Edge when mask if of type alpha
+        if (!featureSupport.maskType && this.data.td == 1) { // eslint-disable-line eqeqeq
+          masker.setAttribute('mask-type', 'luminance');
+          filId = createElementID();
+          fil = filtersFactory.createFilter(filId);
+          this.globalData.defs.appendChild(fil);
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          masker.appendChild(gg);
+          gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        }
+      } else if (this.data.td == 2) { // eslint-disable-line eqeqeq
+        var maskGroup = createNS('mask');
+        maskGroup.setAttribute('id', this.layerId);
+        maskGroup.setAttribute('mask-type', 'alpha');
+        var maskGrouper = createNS('g');
+        maskGroup.appendChild(maskGrouper);
+        filId = createElementID();
+        fil = filtersFactory.createFilter(filId);
+        /// /
 
-                // This solution doesn't work on Android when meta tag with viewport attribute is set
-                /*var feColorMatrix = createNS('feColorMatrix');
+        // This solution doesn't work on Android when meta tag with viewport attribute is set
+        /* var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type', 'matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
                 feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-                fil.appendChild(feColorMatrix);*/
-                ////
-                var feCTr = createNS('feComponentTransfer');
-                feCTr.setAttribute('in','SourceGraphic');
-                fil.appendChild(feCTr);
-                var feFunc = createNS('feFuncA');
-                feFunc.setAttribute('type','table');
-                feFunc.setAttribute('tableValues','1.0 0.0');
-                feCTr.appendChild(feFunc);
-                ////
-                this.globalData.defs.appendChild(fil);
-                var alphaRect = createNS('rect');
-                alphaRect.setAttribute('width',  this.comp.data.w);
-                alphaRect.setAttribute('height', this.comp.data.h);
-                alphaRect.setAttribute('x','0');
-                alphaRect.setAttribute('y','0');
-                alphaRect.setAttribute('fill','#ffffff');
-                alphaRect.setAttribute('opacity','0');
-                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
-                maskGrouper.appendChild(alphaRect);
-                maskGrouper.appendChild(this.layerElement);
-                layerElementParent = maskGrouper;
-                if (!featureSupport.maskType) {
-                    maskGroup.setAttribute('mask-type', 'luminance');
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    maskGrouper.appendChild(alphaRect);
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    maskGrouper.appendChild(gg);
-                }
-                this.globalData.defs.appendChild(maskGroup);
-            }
-        } else if (this.data.tt) {
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        } else {
-            this.baseElement = this.layerElement;
+                fil.appendChild(feColorMatrix); */
+        /// /
+        var feCTr = createNS('feComponentTransfer');
+        feCTr.setAttribute('in', 'SourceGraphic');
+        fil.appendChild(feCTr);
+        var feFunc = createNS('feFuncA');
+        feFunc.setAttribute('type', 'table');
+        feFunc.setAttribute('tableValues', '1.0 0.0');
+        feCTr.appendChild(feFunc);
+        /// /
+        this.globalData.defs.appendChild(fil);
+        var alphaRect = createNS('rect');
+        alphaRect.setAttribute('width', this.comp.data.w);
+        alphaRect.setAttribute('height', this.comp.data.h);
+        alphaRect.setAttribute('x', '0');
+        alphaRect.setAttribute('y', '0');
+        alphaRect.setAttribute('fill', '#ffffff');
+        alphaRect.setAttribute('opacity', '0');
+        maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        maskGrouper.appendChild(alphaRect);
+        maskGrouper.appendChild(this.layerElement);
+        layerElementParent = maskGrouper;
+        if (!featureSupport.maskType) {
+          maskGroup.setAttribute('mask-type', 'luminance');
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          maskGrouper.appendChild(alphaRect);
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          maskGrouper.appendChild(gg);
         }
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id', this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
-        if (this.data.ty === 0 && !this.data.hd) {
-            var cp = createNS( 'clipPath');
-            var pt = createNS('path');
-            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
-            var clipId = createElementID();
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-
-            if (this.checkMasks()) {
-                var cpGroup = createNS('g');
-                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
-                cpGroup.appendChild(this.layerElement);
-                this.transformedElement = cpGroup;
-                if (layerElementParent) {
-                    layerElementParent.appendChild(this.transformedElement);
-                } else {
-                    this.baseElement = this.transformedElement;
-                }
-            } else {
-                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
-            }
-            
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-
-    },
-    renderElement: function() {
-        if (this.finalTransform._matMdf) {
-            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
-        }
-        if (this.finalTransform._opMdf) {
-            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
-        }
-    },
-    destroyBaseElement: function() {
-        this.layerElement = null;
-        this.matteElement = null;
-        this.maskManager.destroy();
-    },
-    getBaseElement: function() {
-        if (this.data.hd) {
-            return null;
-        }
-        return this.baseElement;
-    },
-    createRenderableComponents: function() {
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-        this.renderableEffectsManager = new SVGEffects(this);
-    },
-    setMatte: function(id) {
-        if (!this.matteElement) {
-            return;
-        }
-        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
+        this.globalData.defs.appendChild(maskGroup);
+      }
+    } else if (this.data.tt) {
+      this.matteElement.appendChild(this.layerElement);
+      layerElementParent = this.matteElement;
+      this.baseElement = this.matteElement;
+    } else {
+      this.baseElement = this.layerElement;
     }
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+    if (this.data.ty === 0 && !this.data.hd) {
+      var cp = createNS('clipPath');
+      var pt = createNS('path');
+      pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+      var clipId = createElementID();
+      cp.setAttribute('id', clipId);
+      cp.appendChild(pt);
+      this.globalData.defs.appendChild(cp);
+
+      if (this.checkMasks()) {
+        var cpGroup = createNS('g');
+        cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+        cpGroup.appendChild(this.layerElement);
+        this.transformedElement = cpGroup;
+        if (layerElementParent) {
+          layerElementParent.appendChild(this.transformedElement);
+        } else {
+          this.baseElement = this.transformedElement;
+        }
+      } else {
+        this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+      }
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    if (this.finalTransform._matMdf) {
+      this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+    }
+    if (this.finalTransform._opMdf) {
+      this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+    }
+  },
+  destroyBaseElement: function () {
+    this.layerElement = null;
+    this.matteElement = null;
+    this.maskManager.destroy();
+  },
+  getBaseElement: function () {
+    if (this.data.hd) {
+      return null;
+    }
+    return this.baseElement;
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+    this.renderableEffectsManager = new SVGEffects(this);
+  },
+  setMatte: function (id) {
+    if (!this.matteElement) {
+      return;
+    }
+    this.matteElement.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+  },
 };
-function IShapeElement(){
+
+/* global ProcessedElement */
+
+function IShapeElement() {
 }
 
 IShapeElement.prototype = {
-    addShapeToModifiers: function(data) {
-        var i, len = this.shapeModifiers.length;
-        for(i=0;i<len;i+=1){
-            this.shapeModifiers[i].addShape(data);
-        }
-    },
-    isShapeInAnimatedModifiers: function(data) {
-        var i = 0, len = this.shapeModifiers.length;
-        while(i < len) {
-            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
-                return true;
-            }
-        }
-        return false;
-    },
-    renderModifiers: function() {
-        if(!this.shapeModifiers.length){
-            return;
-        }
-        var i, len = this.shapes.length;
-        for(i=0;i<len;i+=1){
-            this.shapes[i].sh.reset();
-        }
-
-        len = this.shapeModifiers.length;
-        for(i=len-1;i>=0;i-=1){
-            this.shapeModifiers[i].processShapes(this._isFirstFrame);
-        }
-    },
-    lcEnum: {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'square'
-    },
-    ljEnum: {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    },
-    searchProcessedElement: function(elem){
-        var elements = this.processedElements;
-        var i = 0, len = elements.length;
-        while (i < len) {
-            if (elements[i].elem === elem) {
-                return elements[i].pos;
-            }
-            i += 1;
-        }
-        return 0;
-    },
-    addProcessedElement: function(elem, pos){
-        var elements = this.processedElements;
-        var i = elements.length;
-        while(i) {
-            i -= 1;
-            if (elements[i].elem === elem) {
-                elements[i].pos = pos;
-                return;
-            }
-        }
-        elements.push(new ProcessedElement(elem, pos));
-    },
-    prepareFrame: function(num) {
-        this.prepareRenderableFrame(num);
-        this.prepareProperties(num, this.isInRange);
+  addShapeToModifiers: function (data) {
+    var i;
+    var len = this.shapeModifiers.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapeModifiers[i].addShape(data);
     }
-};
-function ITextElement(){
-}
+  },
+  isShapeInAnimatedModifiers: function (data) {
+    var i = 0;
+    var len = this.shapeModifiers.length;
+    while (i < len) {
+      if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  renderModifiers: function () {
+    if (!this.shapeModifiers.length) {
+      return;
+    }
+    var i;
+    var len = this.shapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].sh.reset();
+    }
 
-ITextElement.prototype.initElement = function(data,globalData,comp){
-    this.lettersChangedFlag = true;
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
-    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
-    this.initRenderable();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    this.createContent();
-    this.hide();
-    this.textAnimator.searchProperties(this.dynamicProperties);
-};
-
-ITextElement.prototype.prepareFrame = function(num) {
-    this._mdf = false;
+    len = this.shapeModifiers.length;
+    for (i = len - 1; i >= 0; i -= 1) {
+      this.shapeModifiers[i].processShapes(this._isFirstFrame);
+    }
+  },
+  lcEnum: {
+    1: 'butt',
+    2: 'round',
+    3: 'square',
+  },
+  ljEnum: {
+    1: 'miter',
+    2: 'round',
+    3: 'bevel',
+  },
+  searchProcessedElement: function (elem) {
+    var elements = this.processedElements;
+    var i = 0;
+    var len = elements.length;
+    while (i < len) {
+      if (elements[i].elem === elem) {
+        return elements[i].pos;
+      }
+      i += 1;
+    }
+    return 0;
+  },
+  addProcessedElement: function (elem, pos) {
+    var elements = this.processedElements;
+    var i = elements.length;
+    while (i) {
+      i -= 1;
+      if (elements[i].elem === elem) {
+        elements[i].pos = pos;
+        return;
+      }
+    }
+    elements.push(new ProcessedElement(elem, pos));
+  },
+  prepareFrame: function (num) {
     this.prepareRenderableFrame(num);
     this.prepareProperties(num, this.isInRange);
-    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
-        this.buildNewText();
-        this.textProperty._isFirstFrame = false;
-        this.textProperty._mdf = false;
-    }
+  },
 };
 
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        pathNodes = shapes[j].ks.k;
-        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
-    }
-    return shapeStr;
+/* global TextProperty, TextAnimatorProperty, buildShapeString, LetterProps */
+
+function ITextElement() {
+}
+
+ITextElement.prototype.initElement = function (data, globalData, comp) {
+  this.lettersChangedFlag = true;
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+  this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
+  this.initRenderable();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  this.createContent();
+  this.hide();
+  this.textAnimator.searchProperties(this.dynamicProperties);
 };
 
-ITextElement.prototype.updateDocumentData = function(newData, index) {
-    this.textProperty.updateDocumentData(newData, index);
+ITextElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
+    this.buildNewText();
+    this.textProperty._isFirstFrame = false;
+    this.textProperty._mdf = false;
+  }
 };
 
-ITextElement.prototype.canResizeFont = function(_canResize) {
-    this.textProperty.canResizeFont(_canResize);
+ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
+  var j;
+  var jLen = shapes.length;
+  var pathNodes;
+  var shapeStr = '';
+  for (j = 0; j < jLen; j += 1) {
+    pathNodes = shapes[j].ks.k;
+    shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
+  }
+  return shapeStr;
 };
 
-ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
-    this.textProperty.setMinimumFontSize(_fontSize);
+ITextElement.prototype.updateDocumentData = function (newData, index) {
+  this.textProperty.updateDocumentData(newData, index);
 };
 
-ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
-    if(documentData.ps){
-        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-    }
-    matrixHelper.translate(0,-documentData.ls,0);
-    switch(documentData.j){
-        case 1:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
-            break;
-        case 2:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
-            break;
-    }
-    matrixHelper.translate(xPos, yPos, 0);
+ITextElement.prototype.canResizeFont = function (_canResize) {
+  this.textProperty.canResizeFont(_canResize);
 };
 
+ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
+  this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-ITextElement.prototype.buildColor = function(colorData) {
-    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
+ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
+  if (documentData.ps) {
+    matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+  }
+  matrixHelper.translate(0, -documentData.ls, 0);
+  switch (documentData.j) {
+    case 1:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
+      break;
+    case 2:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
+      break;
+    default:
+      break;
+  }
+  matrixHelper.translate(xPos, yPos, 0);
+};
+
+ITextElement.prototype.buildColor = function (colorData) {
+  return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
 
-ITextElement.prototype.destroy = function(){
-    
+ITextElement.prototype.destroy = function () {
+
 };
-function ICompElement(){}
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement */
+
+function ICompElement() {}
 
 extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
 
-ICompElement.prototype.initElement = function(data,globalData,comp) {
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.initTransform(data, globalData, comp);
-    this.initRenderable();
-    this.initHierarchy();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-    this.hide();
+ICompElement.prototype.initElement = function (data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initTransform(data, globalData, comp);
+  this.initRenderable();
+  this.initHierarchy();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  if (this.data.xt || !globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+  this.hide();
 };
 
-/*ICompElement.prototype.hide = function(){
+/* ICompElement.prototype.hide = function(){
     if(!this.hidden){
         this.hideElement();
         var i,len = this.elements.length;
@@ -7832,2368 +8256,2547 @@
             }
         }
     }
-};*/
+}; */
 
-ICompElement.prototype.prepareFrame = function(num){
-    this._mdf = false;
-    this.prepareRenderableFrame(num);
-    this.prepareProperties(num, this.isInRange);
-    if(!this.isInRange && !this.data.xt){
-        return;
-    }
+ICompElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (!this.isInRange && !this.data.xt) {
+    return;
+  }
 
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    if (timeRemapped === this.data.op) {
+      timeRemapped = this.data.op - 1;
     }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
+    this.renderedFrame = timeRemapped;
+  } else {
+    this.renderedFrame = num / this.data.sr;
+  }
+  var i;
+  var len = this.elements.length;
+  if (!this.completeLayers) {
+    this.checkLayers(this.renderedFrame);
+  }
+  // This iteration needs to be backwards because of how expressions connect between each other
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+      if (this.elements[i]._mdf) {
+        this._mdf = true;
+      }
     }
-    //This iteration needs to be backwards because of how expressions connect between each other
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-            if(this.elements[i]._mdf) {
-                this._mdf = true;
-            }
-        }
-    }
+  }
 };
 
-ICompElement.prototype.renderInnerContent = function() {
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i += 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+ICompElement.prototype.renderInnerContent = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
+ICompElement.prototype.setElements = function (elems) {
+  this.elements = elems;
 };
 
-ICompElement.prototype.getElements = function(){
-    return this.elements;
+ICompElement.prototype.getElements = function () {
+  return this.elements;
 };
 
-ICompElement.prototype.destroyElements = function(){
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
+ICompElement.prototype.destroyElements = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
+  }
 };
 
-ICompElement.prototype.destroy = function(){
-    this.destroyElements();
-    this.destroyBaseElement();
+ICompElement.prototype.destroy = function () {
+  this.destroyElements();
+  this.destroyBaseElement();
 };
 
-function IImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
-    this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, createNS */
+
+function IImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
+  this.sourceRect = {
+    top: 0, left: 0, width: this.assetData.w, height: this.assetData.h,
+  };
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
 
-IImageElement.prototype.createContent = function(){
+IImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.innerElem = createNS('image');
+  this.innerElem.setAttribute('width', this.assetData.w + 'px');
+  this.innerElem.setAttribute('height', this.assetData.h + 'px');
+  this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
+  this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
 
-    this.innerElem = createNS('image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    
-    this.layerElement.appendChild(this.innerElem);
+  this.layerElement.appendChild(this.innerElem);
 };
 
-IImageElement.prototype.sourceRectAtTime = function() {
-	return this.sourceRect;
-}
-function ISolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
+IImageElement.prototype.sourceRectAtTime = function () {
+  return this.sourceRect;
+};
+
+/* global extendPrototype, IImageElement, createNS */
+
+function ISolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createContent = function(){
-
-    var rect = createNS('rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
+ISolidElement.prototype.createContent = function () {
+  var rect = createNS('rect');
+  /// /rect.style.width = this.data.sw;
+  /// /rect.style.height = this.data.sh;
+  /// /rect.style.fill = this.data.sc;
+  rect.setAttribute('width', this.data.sw);
+  rect.setAttribute('height', this.data.sh);
+  rect.setAttribute('fill', this.data.sc);
+  this.layerElement.appendChild(rect);
 };
-function AudioElement(data,globalData,comp){
-    this.initFrame();
-    this.initRenderable();
-    this.assetData = globalData.getAssetData(data.refId);
-	this.initBaseData(data, globalData, comp);
-	this._isPlaying = false;
-	this._canPlay = false;
-	var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.audio = this.globalData.audioController.createAudio(assetPath);
-    this._currentTime = 0;
-    this.globalData.audioController.addAudio(this);
-    this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate,this) : {_placeholder:true};
+
+/* global PropertyFactory, extendPrototype, RenderableElement, BaseElement, FrameElement */
+
+function AudioElement(data, globalData, comp) {
+  this.initFrame();
+  this.initRenderable();
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initBaseData(data, globalData, comp);
+  this._isPlaying = false;
+  this._canPlay = false;
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.audio = this.globalData.audioController.createAudio(assetPath);
+  this._currentTime = 0;
+  this.globalData.audioController.addAudio(this);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
-AudioElement.prototype.prepareFrame = function(num) {
-    this.prepareRenderableFrame(num, true);
-    this.prepareProperties(num, true);
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        this._currentTime = timeRemapped;
-    } else {
-        this._currentTime = num / this.data.sr;
+AudioElement.prototype.prepareFrame = function (num) {
+  this.prepareRenderableFrame(num, true);
+  this.prepareProperties(num, true);
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    this._currentTime = timeRemapped;
+  } else {
+    this._currentTime = num / this.data.sr;
+  }
+};
+
+extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
+
+AudioElement.prototype.renderFrame = function () {
+  if (this.isInRange && this._canPlay) {
+    if (!this._isPlaying) {
+      this.audio.play();
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
+      this._isPlaying = true;
+    } else if (!this.audio.playing()
+      || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
+    ) {
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
     }
+  }
 };
 
-extendPrototype([RenderableElement,BaseElement,FrameElement], AudioElement);
-
-AudioElement.prototype.renderFrame = function() {
-	if (this.isInRange && this._canPlay) {
-		if (!this._isPlaying) {
-			this.audio.play();
-			this.audio.seek(this._currentTime / this.globalData.frameRate);
-			this._isPlaying = true;
-		} else if (!this.audio.playing()
-			|| Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
-		) {
-			this.audio.seek(this._currentTime / this.globalData.frameRate)
-		}
-	}
+AudioElement.prototype.show = function () {
+  // this.audio.play()
 };
 
-AudioElement.prototype.show = function() {
-	// this.audio.play()
+AudioElement.prototype.hide = function () {
+  this.audio.pause();
+  this._isPlaying = false;
 };
 
-AudioElement.prototype.hide = function() {
-	this.audio.pause();
-	this._isPlaying = false;
+AudioElement.prototype.pause = function () {
+  this.audio.pause();
+  this._isPlaying = false;
+  this._canPlay = false;
 };
 
-AudioElement.prototype.pause = function() {
-	this.audio.pause();
-	this._isPlaying = false;
-	this._canPlay = false;
+AudioElement.prototype.resume = function () {
+  this._canPlay = true;
 };
 
-AudioElement.prototype.resume = function() {
-	this._canPlay = true;
+AudioElement.prototype.setRate = function (rateValue) {
+  this.audio.rate(rateValue);
 };
 
-AudioElement.prototype.setRate = function(rateValue) {
-	this.audio.rate(rateValue);
+AudioElement.prototype.volume = function (volumeValue) {
+  this.audio.volume(volumeValue);
 };
 
-AudioElement.prototype.volume = function(volumeValue) {
-	this.audio.volume(volumeValue);
+AudioElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-AudioElement.prototype.getBaseElement = function() {
-	return null;
+AudioElement.prototype.destroy = function () {
 };
 
-AudioElement.prototype.destroy = function() {
+AudioElement.prototype.sourceRectAtTime = function () {
 };
 
-AudioElement.prototype.sourceRectAtTime = function() {
+AudioElement.prototype.initExpressions = function () {
 };
 
-AudioElement.prototype.initExpressions = function() {
-};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement,
+FrameElement, RenderableDOMElement, Matrix, SVGStyleData, SVGStrokeStyleData, SVGFillStyleData,
+SVGGradientFillStyleData, SVGGradientStrokeStyleData, locationHref, getBlendMode, ShapeGroupData,
+TransformPropertyFactory, SVGTransformData, ShapePropertyFactory, SVGShapeData, SVGElementsRenderer, ShapeModifiers */
 
-
-function SVGShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
+function SVGShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
 
-SVGShapeElement.prototype.initSecondaryElement = function() {
+SVGShapeElement.prototype.initSecondaryElement = function () {
 };
 
 SVGShapeElement.prototype.identityMatrix = new Matrix();
 
-SVGShapeElement.prototype.buildExpressionInterface = function(){};
+SVGShapeElement.prototype.buildExpressionInterface = function () {};
 
-SVGShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
+SVGShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
 };
 
 /*
 This method searches for multiple shapes that affect a single element and one of them is animated
 */
-SVGShapeElement.prototype.filterUniqueShapes = function(){
-    var i, len = this.shapes.length, shape;
-    var j, jLen = this.stylesList.length;
-    var style, count = 0;
-    var tempShapes = [];
-    var areAnimated = false;
-    for(j = 0; j < jLen; j += 1) {
-        style = this.stylesList[j];
-        areAnimated = false;
-        tempShapes.length = 0;
-        for(i = 0; i < len; i += 1) {
-            shape = this.shapes[i];
-            if(shape.styles.indexOf(style) !== -1) {
-                tempShapes.push(shape);
-                areAnimated = shape._isAnimated || areAnimated;
-            }
-        }
-        if(tempShapes.length > 1 && areAnimated) {
-            this.setShapesAsAnimated(tempShapes);
-        }
-    }
-}
-
-SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
-    var i, len = shapes.length;
-    for(i = 0; i < len; i += 1) {
-        shapes[i].setAsAnimated();
-    }
-}
-
-SVGShapeElement.prototype.createStyleElement = function(data, level){
-    //TODO: prevent drawing of hidden styles
-    var elementData;
-    var styleOb = new SVGStyleData(data, level);
-
-    var pathElement = styleOb.pElem;
-    if(data.ty === 'st') {
-        elementData = new SVGStrokeStyleData(this, data, styleOb);
-    } else if(data.ty === 'fl') {
-        elementData = new SVGFillStyleData(this, data, styleOb);
-    } else if(data.ty === 'gf' || data.ty === 'gs') {
-        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
-        elementData = new gradientConstructor(this, data, styleOb);
-        this.globalData.defs.appendChild(elementData.gf);
-        if (elementData.maskId) {
-            this.globalData.defs.appendChild(elementData.ms);
-            this.globalData.defs.appendChild(elementData.of);
-            pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
-        }
-    }
-    
-    if(data.ty === 'st' || data.ty === 'gs') {
-        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
-        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
-        pathElement.setAttribute('fill-opacity','0');
-        if(data.lj === 1) {
-            pathElement.setAttribute('stroke-miterlimit',data.ml);
-        }
-    }
-
-    if(data.r === 2) {
-        pathElement.setAttribute('fill-rule', 'evenodd');
-    }
-
-    if(data.ln){
-        pathElement.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        pathElement.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    this.stylesList.push(styleOb);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = new ShapeGroupData();
-    if(data.ln){
-        elementData.gr.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        elementData.gr.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    return elementData;
-};
-
-SVGShapeElement.prototype.createTransformElement = function(data, container) {
-    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
-    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
-    var ty = 4;
-    if(data.ty === 'rc'){
-        ty = 5;
-    }else if(data.ty === 'el'){
-        ty = 6;
-    }else if(data.ty === 'sr'){
-        ty = 7;
-    }
-    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
-    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
-    var i = 0, len = this.animatedContents.length;
-    while(i < len) {
-        if(this.animatedContents[i].element === element) {
-            return;
-        }
-        i += 1;
-    }
-    this.animatedContents.push({
-        fn: SVGElementsRenderer.createRenderFunction(data),
-        element: element,
-        data: data
-    });
-};
-
-SVGShapeElement.prototype.setElementStyles = function(elementData){
-    var arr = elementData.styles;
-    var j, jLen = this.stylesList.length;
-    for (j = 0; j < jLen; j += 1) {
-        if (!this.stylesList[j].closed) {
-            arr.push(this.stylesList[j]);
-        }
-    }
-};
-
-SVGShapeElement.prototype.reloadShapes = function(){
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for( i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
-    len = this.dynamicProperties.length;
-    for(i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-};
-
-SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._render = render;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], level);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].style.pElem);
-            }
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].gr);
-            }
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                itemsData[i] = this.createTransformElement(arr[i], container);
-            }
-            currentTransform = itemsData[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
-            }
-            this.setElementStyles(itemsData[i]);
-
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        }else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                render = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    len = ownStyles.length;
-    for(i=0;i<len;i+=1){
-        ownStyles[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-SVGShapeElement.prototype.renderInnerContent = function() {
-    this.renderModifiers();
-    var i, len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        this.stylesList[i].reset();
-    }
-    this.renderShape();
-
+SVGShapeElement.prototype.filterUniqueShapes = function () {
+  var i;
+  var len = this.shapes.length;
+  var shape;
+  var j;
+  var jLen = this.stylesList.length;
+  var style;
+  var tempShapes = [];
+  var areAnimated = false;
+  for (j = 0; j < jLen; j += 1) {
+    style = this.stylesList[j];
+    areAnimated = false;
+    tempShapes.length = 0;
     for (i = 0; i < len; i += 1) {
-        if (this.stylesList[i]._mdf || this._isFirstFrame) {
-            if(this.stylesList[i].msElem){
-                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                //Adding M0 0 fixes same mask bug on all browsers
-                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
-            }
-            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
-        }
+      shape = this.shapes[i];
+      if (shape.styles.indexOf(style) !== -1) {
+        tempShapes.push(shape);
+        areAnimated = shape._isAnimated || areAnimated;
+      }
     }
+    if (tempShapes.length > 1 && areAnimated) {
+      this.setShapesAsAnimated(tempShapes);
+    }
+  }
 };
 
-SVGShapeElement.prototype.renderShape = function() {
-    var i, len = this.animatedContents.length;
-    var animatedContent;
-    for(i = 0; i < len; i += 1) {
-        animatedContent = this.animatedContents[i];
-        if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
-            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
-        }
-    }
-}
-
-SVGShapeElement.prototype.destroy = function(){
-    this.destroyBaseElement();
-    this.shapesData = null;
-    this.itemsData = null;
+SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
+  var i;
+  var len = shapes.length;
+  for (i = 0; i < len; i += 1) {
+    shapes[i].setAsAnimated();
+  }
 };
 
+SVGShapeElement.prototype.createStyleElement = function (data, level) {
+  // TODO: prevent drawing of hidden styles
+  var elementData;
+  var styleOb = new SVGStyleData(data, level);
+
+  var pathElement = styleOb.pElem;
+  if (data.ty === 'st') {
+    elementData = new SVGStrokeStyleData(this, data, styleOb);
+  } else if (data.ty === 'fl') {
+    elementData = new SVGFillStyleData(this, data, styleOb);
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+    elementData = new GradientConstructor(this, data, styleOb);
+    this.globalData.defs.appendChild(elementData.gf);
+    if (elementData.maskId) {
+      this.globalData.defs.appendChild(elementData.ms);
+      this.globalData.defs.appendChild(elementData.of);
+      pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
+    }
+  }
+
+  if (data.ty === 'st' || data.ty === 'gs') {
+    pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+    pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
+    pathElement.setAttribute('fill-opacity', '0');
+    if (data.lj === 1) {
+      pathElement.setAttribute('stroke-miterlimit', data.ml);
+    }
+  }
+
+  if (data.r === 2) {
+    pathElement.setAttribute('fill-rule', 'evenodd');
+  }
+
+  if (data.ln) {
+    pathElement.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    pathElement.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  this.stylesList.push(styleOb);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.createGroupElement = function (data) {
+  var elementData = new ShapeGroupData();
+  if (data.ln) {
+    elementData.gr.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    elementData.gr.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  return elementData;
+};
+
+SVGShapeElement.prototype.createTransformElement = function (data, container) {
+  var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
+  var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
+  var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
+
+SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
+  var i = 0;
+  var len = this.animatedContents.length;
+  while (i < len) {
+    if (this.animatedContents[i].element === element) {
+      return;
+    }
+    i += 1;
+  }
+  this.animatedContents.push({
+    fn: SVGElementsRenderer.createRenderFunction(data),
+    element: element,
+    data: data,
+  });
+};
+
+SVGShapeElement.prototype.setElementStyles = function (elementData) {
+  var arr = elementData.styles;
+  var j;
+  var jLen = this.stylesList.length;
+  for (j = 0; j < jLen; j += 1) {
+    if (!this.stylesList[j].closed) {
+      arr.push(this.stylesList[j]);
+    }
+  }
+};
+
+SVGShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
+  var ownTransformers = [].concat(transformers);
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var currentTransform;
+  var modifier;
+  var processedPos;
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._render = render;
+    } else {
+      itemsData[i] = prevViewData[processedPos - 1];
+    }
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], level);
+      } else {
+        itemsData[i].style.closed = false;
+      }
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].style.pElem);
+      }
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
+        for (j = 0; j < jLen; j += 1) {
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
+        }
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].gr);
+      }
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        itemsData[i] = this.createTransformElement(arr[i], container);
+      }
+      currentTransform = itemsData[i].transform;
+      ownTransformers.push(currentTransform);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+      }
+      this.setElementStyles(itemsData[i]);
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        render = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
+    }
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  len = ownStyles.length;
+  for (i = 0; i < len; i += 1) {
+    ownStyles[i].closed = true;
+  }
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
+};
+
+SVGShapeElement.prototype.renderInnerContent = function () {
+  this.renderModifiers();
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    this.stylesList[i].reset();
+  }
+  this.renderShape();
+
+  for (i = 0; i < len; i += 1) {
+    if (this.stylesList[i]._mdf || this._isFirstFrame) {
+      if (this.stylesList[i].msElem) {
+        this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+        // Adding M0 0 fixes same mask bug on all browsers
+        this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+      }
+      this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
+    }
+  }
+};
+
+SVGShapeElement.prototype.renderShape = function () {
+  var i;
+  var len = this.animatedContents.length;
+  var animatedContent;
+  for (i = 0; i < len; i += 1) {
+    animatedContent = this.animatedContents[i];
+    if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
+      animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
+    }
+  }
+};
+
+SVGShapeElement.prototype.destroy = function () {
+  this.destroyBaseElement();
+  this.shapesData = null;
+  this.itemsData = null;
+};
+
+/* global Matrix, createTypedArray */
+
 function CVContextData() {
-	this.saved = [];
-    this.cArrPos = 0;
-    this.cTr = new Matrix();
-    this.cO = 1;
-    var i, len = 15;
-    this.savedOp = createTypedArray('float32', len);
-    for(i=0;i<len;i+=1){
-        this.saved[i] = createTypedArray('float32', 16);
-    }
-    this._length = len;
+  this.saved = [];
+  this.cArrPos = 0;
+  this.cTr = new Matrix();
+  this.cO = 1;
+  var i;
+  var len = 15;
+  this.savedOp = createTypedArray('float32', len);
+  for (i = 0; i < len; i += 1) {
+    this.saved[i] = createTypedArray('float32', 16);
+  }
+  this._length = len;
 }
 
-CVContextData.prototype.duplicate = function() {
-	var newLength = this._length * 2;
-	var currentSavedOp = this.savedOp;
-    this.savedOp = createTypedArray('float32', newLength);
-    this.savedOp.set(currentSavedOp);
-    var i = 0;
-    for(i = this._length; i < newLength; i += 1) {
-        this.saved[i] = createTypedArray('float32', 16);
-    }
-    this._length = newLength;
+CVContextData.prototype.duplicate = function () {
+  var newLength = this._length * 2;
+  var currentSavedOp = this.savedOp;
+  this.savedOp = createTypedArray('float32', newLength);
+  this.savedOp.set(currentSavedOp);
+  var i = 0;
+  for (i = this._length; i < newLength; i += 1) {
+    this.saved[i] = createTypedArray('float32', 16);
+  }
+  this._length = newLength;
 };
 
-CVContextData.prototype.reset = function() {
-	this.cArrPos = 0;
-	this.cTr.reset();
-    this.cO = 1;
+CVContextData.prototype.reset = function () {
+  this.cArrPos = 0;
+  this.cTr.reset();
+  this.cO = 1;
 };
-function CVBaseElement(){
+
+/* global CVEffects, getBlendMode, CVMaskElement, Matrix */
+
+function CVBaseElement() {
 }
 
 CVBaseElement.prototype = {
-    createElements: function(){},
-    initRendererElement: function(){},
-    createContainerElements: function(){
-        this.canvasContext = this.globalData.canvasContext;
-        this.renderableEffectsManager = new CVEffects(this);
-    },
-    createContent: function(){},
-    setBlendMode: function(){
-        var globalData = this.globalData;
-        if(globalData.blendMode !== this.data.bm) {
-            globalData.blendMode = this.data.bm;
-            var blendModeValue = getBlendMode(this.data.bm);
-            globalData.canvasContext.globalCompositeOperation = blendModeValue;
-        }
-    },
-    createRenderableComponents: function(){
-        this.maskManager = new CVMaskElement(this.data, this);
-    },
-    hideElement: function(){
-        if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-            this.hidden = true;
-        }
-    },
-    showElement: function(){
-        if (this.isInRange && !this.isTransparent){
-            this.hidden = false;
-            this._isFirstFrame = true;
-            this.maskManager._isFirstFrame = true;
-        }
-    },
-    renderFrame: function() {
-        if (this.hidden || this.data.hd) {
-            return;
-        }
-        this.renderTransform();
-        this.renderRenderable();
-        this.setBlendMode();
-        var forceRealStack = this.data.ty === 0;
-        this.globalData.renderer.save(forceRealStack);
-        this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
-        this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
-        this.renderInnerContent();
-        this.globalData.renderer.restore(forceRealStack);
-        if(this.maskManager.hasMasks) {
-            this.globalData.renderer.restore(true);
-        }
-        if (this._isFirstFrame) {
-            this._isFirstFrame = false;
-        }
-    },
-    destroy: function(){
-        this.canvasContext = null;
-        this.data = null;
-        this.globalData = null;
-        this.maskManager.destroy();
-    },
-    mHelper: new Matrix()
+  createElements: function () {},
+  initRendererElement: function () {},
+  createContainerElements: function () {
+    this.canvasContext = this.globalData.canvasContext;
+    this.renderableEffectsManager = new CVEffects(this);
+  },
+  createContent: function () {},
+  setBlendMode: function () {
+    var globalData = this.globalData;
+    if (globalData.blendMode !== this.data.bm) {
+      globalData.blendMode = this.data.bm;
+      var blendModeValue = getBlendMode(this.data.bm);
+      globalData.canvasContext.globalCompositeOperation = blendModeValue;
+    }
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new CVMaskElement(this.data, this);
+  },
+  hideElement: function () {
+    if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+      this.hidden = true;
+    }
+  },
+  showElement: function () {
+    if (this.isInRange && !this.isTransparent) {
+      this.hidden = false;
+      this._isFirstFrame = true;
+      this.maskManager._isFirstFrame = true;
+    }
+  },
+  renderFrame: function () {
+    if (this.hidden || this.data.hd) {
+      return;
+    }
+    this.renderTransform();
+    this.renderRenderable();
+    this.setBlendMode();
+    var forceRealStack = this.data.ty === 0;
+    this.globalData.renderer.save(forceRealStack);
+    this.globalData.renderer.ctxTransform(this.finalTransform.mat.props);
+    this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v);
+    this.renderInnerContent();
+    this.globalData.renderer.restore(forceRealStack);
+    if (this.maskManager.hasMasks) {
+      this.globalData.renderer.restore(true);
+    }
+    if (this._isFirstFrame) {
+      this._isFirstFrame = false;
+    }
+  },
+  destroy: function () {
+    this.canvasContext = null;
+    this.data = null;
+    this.globalData = null;
+    this.maskManager.destroy();
+  },
+  mHelper: new Matrix(),
 };
 CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;
 CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;
 
-function CVImageElement(data, globalData, comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.img = globalData.imageLoader.getImage(this.assetData);
-    this.initElement(data,globalData,comp);
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement,HierarchyElement, FrameElement,
+RenderableElement, SVGShapeElement, IImageElement, createTag */
+
+function CVImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.img = globalData.imageLoader.getImage(this.assetData);
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement);
 
 CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement;
 CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
 
-CVImageElement.prototype.createContent = function(){
+CVImageElement.prototype.createContent = function () {
+  if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
+    var canvas = createTag('canvas');
+    canvas.width = this.assetData.w;
+    canvas.height = this.assetData.h;
+    var ctx = canvas.getContext('2d');
 
-    if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
-        var canvas = createTag('canvas');
-        canvas.width = this.assetData.w;
-        canvas.height = this.assetData.h;
-        var ctx = canvas.getContext('2d');
-
-        var imgW = this.img.width;
-        var imgH = this.img.height;
-        var imgRel = imgW / imgH;
-        var canvasRel = this.assetData.w/this.assetData.h;
-        var widthCrop, heightCrop;
-        var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
-        if((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) {
-            heightCrop = imgH;
-            widthCrop = heightCrop*canvasRel;
-        } else {
-            widthCrop = imgW;
-            heightCrop = widthCrop/canvasRel;
-        }
-        ctx.drawImage(this.img,(imgW-widthCrop)/2,(imgH-heightCrop)/2,widthCrop,heightCrop,0,0,this.assetData.w,this.assetData.h);
-        this.img = canvas;
+    var imgW = this.img.width;
+    var imgH = this.img.height;
+    var imgRel = imgW / imgH;
+    var canvasRel = this.assetData.w / this.assetData.h;
+    var widthCrop;
+    var heightCrop;
+    var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
+    if ((imgRel > canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) {
+      heightCrop = imgH;
+      widthCrop = heightCrop * canvasRel;
+    } else {
+      widthCrop = imgW;
+      heightCrop = widthCrop / canvasRel;
     }
-
+    ctx.drawImage(this.img, (imgW - widthCrop) / 2, (imgH - heightCrop) / 2, widthCrop, heightCrop, 0, 0, this.assetData.w, this.assetData.h);
+    this.img = canvas;
+  }
 };
 
-CVImageElement.prototype.renderInnerContent = function(parentMatrix){
-    this.canvasContext.drawImage(this.img, 0, 0);
+CVImageElement.prototype.renderInnerContent = function () {
+  this.canvasContext.drawImage(this.img, 0, 0);
 };
 
-CVImageElement.prototype.destroy = function(){
-    this.img = null;
+CVImageElement.prototype.destroy = function () {
+  this.img = null;
 };
+
+/* global createSizedArray, PropertyFactory, extendPrototype, CanvasRenderer, ICompElement, CVBaseElement */
+
 function CVCompElement(data, globalData, comp) {
-    this.completeLayers = false;
-    this.layers = data.layers;
-    this.pendingElements = [];
-    this.elements = createSizedArray(this.layers.length);
-    this.initElement(data, globalData, comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate, this) : {_placeholder:true};
+  this.completeLayers = false;
+  this.layers = data.layers;
+  this.pendingElements = [];
+  this.elements = createSizedArray(this.layers.length);
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([CanvasRenderer, ICompElement, CVBaseElement], CVCompElement);
 
-CVCompElement.prototype.renderInnerContent = function() {
-    var ctx = this.canvasContext;
-    ctx.beginPath();
-    ctx.moveTo(0, 0);
-    ctx.lineTo(this.data.w, 0);
-    ctx.lineTo(this.data.w, this.data.h);
-    ctx.lineTo(0, this.data.h);
-    ctx.lineTo(0, 0);
-    ctx.clip();
-    var i,len = this.layers.length;
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+CVCompElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.beginPath();
+  ctx.moveTo(0, 0);
+  ctx.lineTo(this.data.w, 0);
+  ctx.lineTo(this.data.w, this.data.h);
+  ctx.lineTo(0, this.data.h);
+  ctx.lineTo(0, 0);
+  ctx.clip();
+  var i;
+  var len = this.layers.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-CVCompElement.prototype.destroy = function(){
-    var i,len = this.layers.length;
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.elements[i]) {
-            this.elements[i].destroy();
-        }
+CVCompElement.prototype.destroy = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layers = null;
-    this.elements = null;
+  }
+  this.layers = null;
+  this.elements = null;
 };
 
-function CVMaskElement(data,element){
-    this.data = data;
-    this.element = element;
-    this.masksProperties = this.data.masksProperties || [];
-    this.viewData = createSizedArray(this.masksProperties.length);
-    var i, len = this.masksProperties.length, hasMasks = false;
-    for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode !== 'n'){
-            hasMasks = true;
-        }
-        this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3);
+/* global createSizedArray, ShapePropertyFactory, MaskElement */
+
+function CVMaskElement(data, element) {
+  this.data = data;
+  this.element = element;
+  this.masksProperties = this.data.masksProperties || [];
+  this.viewData = createSizedArray(this.masksProperties.length);
+  var i;
+  var len = this.masksProperties.length;
+  var hasMasks = false;
+  for (i = 0; i < len; i += 1) {
+    if (this.masksProperties[i].mode !== 'n') {
+      hasMasks = true;
     }
-    this.hasMasks = hasMasks;
-    if(hasMasks) {
-        this.element.addRenderableComponent(this);
-    }
+    this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[i], 3);
+  }
+  this.hasMasks = hasMasks;
+  if (hasMasks) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
 CVMaskElement.prototype.renderFrame = function () {
-    if(!this.hasMasks){
-        return;
+  if (!this.hasMasks) {
+    return;
+  }
+  var transform = this.element.finalTransform.mat;
+  var ctx = this.element.canvasContext;
+  var i;
+  var len = this.masksProperties.length;
+  var pt;
+  var pts;
+  var data;
+  ctx.beginPath();
+  for (i = 0; i < len; i += 1) {
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.masksProperties[i].inv) {
+        ctx.moveTo(0, 0);
+        ctx.lineTo(this.element.globalData.compSize.w, 0);
+        ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
+        ctx.lineTo(0, this.element.globalData.compSize.h);
+        ctx.lineTo(0, 0);
+      }
+      data = this.viewData[i].v;
+      pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0);
+      ctx.moveTo(pt[0], pt[1]);
+      var j;
+      var jLen = data._length;
+      for (j = 1; j < jLen; j += 1) {
+        pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
+        ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
+      }
+      pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
+      ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
     }
-    var transform = this.element.finalTransform.mat;
-    var ctx = this.element.canvasContext;
-    var i, len = this.masksProperties.length;
-    var pt,pts,data;
-    ctx.beginPath();
-    for (i = 0; i < len; i++) {
-        if(this.masksProperties[i].mode !== 'n'){
-            if (this.masksProperties[i].inv) {
-                ctx.moveTo(0, 0);
-                ctx.lineTo(this.element.globalData.compSize.w, 0);
-                ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
-                ctx.lineTo(0, this.element.globalData.compSize.h);
-                ctx.lineTo(0, 0);
-            }
-            data = this.viewData[i].v;
-            pt = transform.applyToPointArray(data.v[0][0],data.v[0][1],0);
-            ctx.moveTo(pt[0], pt[1]);
-            var j, jLen = data._length;
-            for (j = 1; j < jLen; j++) {
-                pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
-                ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
-            }
-            pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
-            ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
-        }
-    }
-    this.element.globalData.renderer.save(true);
-    ctx.clip();
+  }
+  this.element.globalData.renderer.save(true);
+  ctx.clip();
 };
 
 CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;
 
-CVMaskElement.prototype.destroy = function(){
-    this.element = null;
+CVMaskElement.prototype.destroy = function () {
+  this.element = null;
 };
+
+/* global ShapeTransformManager, extendPrototype, BaseElement, TransformElement, CVBaseElement, IShapeElement,
+HierarchyElement, FrameElement, RenderableElement, RenderableDOMElement, PropertyFactory, degToRads, GradientProperty,
+DashProperty, TransformPropertyFactory, CVShapeData, ShapeModifiers, bmFloor */
+
 function CVShapeElement(data, globalData, comp) {
-    this.shapes = [];
-    this.shapesData = data.shapes;
-    this.stylesList = [];
-    this.itemsData = [];
-    this.prevViewData = [];
-    this.shapeModifiers = [];
-    this.processedElements = [];
-    this.transformsManager = new ShapeTransformManager();
-    this.initElement(data, globalData, comp);
+  this.shapes = [];
+  this.shapesData = data.shapes;
+  this.stylesList = [];
+  this.itemsData = [];
+  this.prevViewData = [];
+  this.shapeModifiers = [];
+  this.processedElements = [];
+  this.transformsManager = new ShapeTransformManager();
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement], CVShapeElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement);
 
 CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;
 
-CVShapeElement.prototype.transformHelper = {opacity:1,_opMdf:false};
+CVShapeElement.prototype.transformHelper = { opacity: 1, _opMdf: false };
 
 CVShapeElement.prototype.dashResetter = [];
 
-CVShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
+CVShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
 };
 
-CVShapeElement.prototype.createStyleElement = function(data, transforms) {
-    var styleElem = {
-        data: data,
-        type: data.ty,
-        preTransforms: this.transformsManager.addTransformSequence(transforms),
-        transforms: [],
-        elements: [],
-        closed: data.hd === true
-    };
-    var elementData = {};
-    if(data.ty == 'fl' || data.ty == 'st'){
-        elementData.c = PropertyFactory.getProp(this,data.c,1,255,this);
-        if(!elementData.c.k){
-            styleElem.co = 'rgb('+bm_floor(elementData.c.v[0])+','+bm_floor(elementData.c.v[1])+','+bm_floor(elementData.c.v[2])+')';
-        }
-    } else if (data.ty === 'gf' || data.ty === 'gs') {
-        elementData.s = PropertyFactory.getProp(this,data.s,1,null,this);
-        elementData.e = PropertyFactory.getProp(this,data.e,1,null,this);
-        elementData.h = PropertyFactory.getProp(this,data.h||{k:0},0,0.01,this);
-        elementData.a = PropertyFactory.getProp(this,data.a||{k:0},0,degToRads,this);
-        elementData.g = new GradientProperty(this,data.g,this);
+CVShapeElement.prototype.createStyleElement = function (data, transforms) {
+  var styleElem = {
+    data: data,
+    type: data.ty,
+    preTransforms: this.transformsManager.addTransformSequence(transforms),
+    transforms: [],
+    elements: [],
+    closed: data.hd === true,
+  };
+  var elementData = {};
+  if (data.ty === 'fl' || data.ty === 'st') {
+    elementData.c = PropertyFactory.getProp(this, data.c, 1, 255, this);
+    if (!elementData.c.k) {
+      styleElem.co = 'rgb(' + bmFloor(elementData.c.v[0]) + ',' + bmFloor(elementData.c.v[1]) + ',' + bmFloor(elementData.c.v[2]) + ')';
     }
-    elementData.o = PropertyFactory.getProp(this,data.o,0,0.01,this);
-    if(data.ty == 'st' || data.ty == 'gs') {
-        styleElem.lc = this.lcEnum[data.lc] || 'round';
-        styleElem.lj = this.ljEnum[data.lj] || 'round';
-        if(data.lj == 1) {
-            styleElem.ml = data.ml;
-        }
-        elementData.w = PropertyFactory.getProp(this,data.w,0,null,this);
-        if(!elementData.w.k){
-            styleElem.wi = elementData.w.v;
-        }
-        if(data.d){
-            var d = new DashProperty(this,data.d,'canvas', this);
-            elementData.d = d;
-            if(!elementData.d.k){
-                styleElem.da = elementData.d.dashArray;
-                styleElem.do = elementData.d.dashoffset[0];
-            }
-        }
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    elementData.s = PropertyFactory.getProp(this, data.s, 1, null, this);
+    elementData.e = PropertyFactory.getProp(this, data.e, 1, null, this);
+    elementData.h = PropertyFactory.getProp(this, data.h || { k: 0 }, 0, 0.01, this);
+    elementData.a = PropertyFactory.getProp(this, data.a || { k: 0 }, 0, degToRads, this);
+    elementData.g = new GradientProperty(this, data.g, this);
+  }
+  elementData.o = PropertyFactory.getProp(this, data.o, 0, 0.01, this);
+  if (data.ty === 'st' || data.ty === 'gs') {
+    styleElem.lc = this.lcEnum[data.lc] || 'round';
+    styleElem.lj = this.ljEnum[data.lj] || 'round';
+    if (data.lj == 1) { // eslint-disable-line eqeqeq
+      styleElem.ml = data.ml;
+    }
+    elementData.w = PropertyFactory.getProp(this, data.w, 0, null, this);
+    if (!elementData.w.k) {
+      styleElem.wi = elementData.w.v;
+    }
+    if (data.d) {
+      var d = new DashProperty(this, data.d, 'canvas', this);
+      elementData.d = d;
+      if (!elementData.d.k) {
+        styleElem.da = elementData.d.dashArray;
+        styleElem.do = elementData.d.dashoffset[0];
+      }
+    }
+  } else {
+    styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+  }
+  this.stylesList.push(styleElem);
+  elementData.style = styleElem;
+  return elementData;
+};
+
+CVShapeElement.prototype.createGroupElement = function () {
+  var elementData = {
+    it: [],
+    prevViewData: [],
+  };
+  return elementData;
+};
+
+CVShapeElement.prototype.createTransformElement = function (data) {
+  var elementData = {
+    transform: {
+      opacity: 1,
+      _opMdf: false,
+      key: this.transformsManager.getNewKey(),
+      op: PropertyFactory.getProp(this, data.o, 0, 0.01, this),
+      mProps: TransformPropertyFactory.getTransformProperty(this, data, this),
+    },
+  };
+  return elementData;
+};
+
+CVShapeElement.prototype.createShapeElement = function (data) {
+  var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
+
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  return elementData;
+};
+
+CVShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+  this.transformsManager.processSequences(this._isFirstFrame);
+};
+
+CVShapeElement.prototype.addTransformToStyleList = function (transform) {
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    if (!this.stylesList[i].closed) {
+      this.stylesList[i].transforms.push(transform);
+    }
+  }
+};
+
+CVShapeElement.prototype.removeTransformFromStyleList = function () {
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    if (!this.stylesList[i].closed) {
+      this.stylesList[i].transforms.pop();
+    }
+  }
+};
+
+CVShapeElement.prototype.closeStyles = function (styles) {
+  var i;
+  var len = styles.length;
+  for (i = 0; i < len; i += 1) {
+    styles[i].closed = true;
+  }
+};
+
+CVShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, shouldRender, transforms) {
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var processedPos;
+  var modifier;
+  var currentTransform;
+  var ownTransforms = [].concat(transforms);
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._shouldRender = shouldRender;
     } else {
-        styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    this.stylesList.push(styleElem);
-    elementData.style = styleElem;
-    return elementData;
-};
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
+      } else {
+        itemsData[i].style.closed = false;
+      }
 
-CVShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = {
-        it: [],
-        prevViewData: []
-    };
-    return elementData;
-};
-
-CVShapeElement.prototype.createTransformElement = function(data) {
-    var elementData = {
-        transform : {
-            opacity: 1,
-            _opMdf:false,
-            key: this.transformsManager.getNewKey(),
-            op: PropertyFactory.getProp(this,data.o,0,0.01,this),
-            mProps: TransformPropertyFactory.getTransformProperty(this,data,this)
-        }
-    };
-    return elementData;
-};
-
-CVShapeElement.prototype.createShapeElement = function(data) {
-    var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
-    
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    return elementData;
-};
-
-CVShapeElement.prototype.reloadShapes = function() {
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for (i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []);
-    len = this.dynamicProperties.length;
-    for (i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-    this.transformsManager.processSequences(this._isFirstFrame);
-};
-
-CVShapeElement.prototype.addTransformToStyleList = function(transform) {
-    var i, len = this.stylesList.length;
-    for (i = 0; i < len; i += 1) {
-        if(!this.stylesList[i].closed) {
-            this.stylesList[i].transforms.push(transform);
-        }
-    }
-}
-
-CVShapeElement.prototype.removeTransformFromStyleList = function() {
-    var i, len = this.stylesList.length;
-    for (i = 0; i < len; i += 1) {
-        if(!this.stylesList[i].closed) {
-            this.stylesList[i].transforms.pop();
-        }
-    }
-}
-
-CVShapeElement.prototype.closeStyles = function(styles) {
-    var i, len = styles.length, j, jLen;
-    for (i = 0; i < len; i += 1) {
-        styles[i].closed = true;
-    }
-}
-
-CVShapeElement.prototype.searchShapes = function(arr,itemsData, prevViewData, shouldRender, transforms){
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], processedPos, modifier, currentTransform;
-    var ownTransforms = [].concat(transforms);
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._shouldRender = shouldRender;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st'|| arr[i].ty == 'gf'|| arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData, shouldRender, ownTransforms);
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                currentTransform = this.createTransformElement(arr[i]);
-                itemsData[i] = currentTransform;
-            }
-            ownTransforms.push(itemsData[i]);
-            this.addTransformToStyleList(itemsData[i]);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i]);
-            }
-            
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        } else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                shouldRender = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    this.removeTransformFromStyleList();
-    this.closeStyles(ownStyles);
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-CVShapeElement.prototype.renderInnerContent = function() {
-    this.transformHelper.opacity = 1;
-    this.transformHelper._opMdf = false;
-    this.renderModifiers();
-    this.transformsManager.processSequences(this._isFirstFrame);
-    this.renderShape(this.transformHelper,this.shapesData,this.itemsData,true);
-};
-
-CVShapeElement.prototype.renderShapeTransform = function(parentTransform, groupTransform) {
-    var props, groupMatrix;
-    if(parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
-        groupTransform.opacity = parentTransform.opacity;
-        groupTransform.opacity *= groupTransform.op.v;
-        groupTransform._opMdf = true;
-    }
-};
-
-CVShapeElement.prototype.drawLayer = function() {
-    var i, len = this.stylesList.length;
-    var j, jLen, k, kLen,elems,nodes, renderer = this.globalData.renderer, ctx = this.globalData.canvasContext, type, currentStyle;
-    for(i=0;i<len;i+=1){
-        currentStyle = this.stylesList[i];
-        type = currentStyle.type;
-
-        //Skipping style when
-        //Stroke width equals 0
-        //style should not be rendered (extra unused repeaters)
-        //current opacity equals 0
-        //global opacity equals 0
-        if(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0){
-            continue;
-        }
-        renderer.save();
-        elems = currentStyle.elements;
-        if(type === 'st' || type === 'gs'){
-            ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
-            ctx.lineWidth = currentStyle.wi;
-            ctx.lineCap = currentStyle.lc;
-            ctx.lineJoin = currentStyle.lj;
-            ctx.miterLimit = currentStyle.ml || 0;
-        } else {
-            ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
-        }
-        renderer.ctxOpacity(currentStyle.coOp);
-        if(type !== 'st' && type !== 'gs'){
-            ctx.beginPath();
-        }
-        renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
-        jLen = elems.length;
-        for(j=0;j<jLen;j+=1){
-            if(type === 'st' || type === 'gs'){
-                ctx.beginPath();
-                if(currentStyle.da){
-                    ctx.setLineDash(currentStyle.da);
-                    ctx.lineDashOffset = currentStyle.do;
-                }
-            }
-            nodes = elems[j].trNodes;
-            kLen = nodes.length;
-
-            for(k=0;k<kLen;k+=1){
-                if(nodes[k].t == 'm'){
-                    ctx.moveTo(nodes[k].p[0],nodes[k].p[1]);
-                }else if(nodes[k].t == 'c'){
-                    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]);
-                }else{
-                    ctx.closePath();
-                }
-            }
-            if(type === 'st' || type === 'gs'){
-                ctx.stroke();
-                if(currentStyle.da){
-                    ctx.setLineDash(this.dashResetter);
-                }
-            }
-        }
-        if(type !== 'st' && type !== 'gs'){
-            ctx.fill(currentStyle.r);
-        }
-        renderer.restore();
-    }
-};
-
-CVShapeElement.prototype.renderShape = function(parentTransform,items,data,isMain){
-    var i, len = items.length - 1;
-    var groupTransform;
-    groupTransform = parentTransform;
-    for(i=len;i>=0;i-=1){
-        if(items[i].ty == 'tr'){
-            groupTransform = data[i].transform;
-            this.renderShapeTransform(parentTransform, groupTransform);
-        }else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc' || items[i].ty == 'sr'){
-            this.renderPath(items[i],data[i]);
-        }else if(items[i].ty == 'fl'){
-            this.renderFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'st'){
-            this.renderStroke(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gf' || items[i].ty == 'gs'){
-            this.renderGradientFill(items[i],data[i],groupTransform);
-        }else if(items[i].ty == 'gr'){
-            this.renderShape(groupTransform,items[i].it,data[i].it);
-        }else if(items[i].ty == 'tm'){
-            //
-        }
-    }
-    if(isMain){
-        this.drawLayer();
-    }
-    
-};
-
-CVShapeElement.prototype.renderStyledShape = function(styledShape, shape){
-    if(this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
-        var shapeNodes = styledShape.trNodes;
-        var paths = shape.paths;
-        var i, len, j, jLen = paths._length;
-        shapeNodes.length = 0;
-        var groupTransformMat = styledShape.transforms.finalTransform;
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
         for (j = 0; j < jLen; j += 1) {
-            var pathNodes = paths.shapes[j];
-            if(pathNodes && pathNodes.v){
-                len = pathNodes._length;
-                for (i = 1; i < len; i += 1) {
-                    if (i === 1) {
-                        shapeNodes.push({
-                            t: 'm',
-                            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
-                        });
-                    }
-                    shapeNodes.push({
-                        t: 'c',
-                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])
-                    });
-                }
-                if (len === 1) {
-                    shapeNodes.push({
-                        t: 'm',
-                        p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
-                    });
-                }
-                if (pathNodes.c && len) {
-                    shapeNodes.push({
-                        t: 'c',
-                        pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])
-                    });
-                    shapeNodes.push({
-                        t: 'z'
-                    });
-                }
-            }
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        styledShape.trNodes = shapeNodes;
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, shouldRender, ownTransforms);
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        currentTransform = this.createTransformElement(arr[i]);
+        itemsData[i] = currentTransform;
+      }
+      ownTransforms.push(itemsData[i]);
+      this.addTransformToStyleList(itemsData[i]);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i]);
+      }
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        shouldRender = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-}
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  this.removeTransformFromStyleList();
+  this.closeStyles(ownStyles);
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
+};
 
-CVShapeElement.prototype.renderPath = function(pathData,itemData){
-    if(pathData.hd !== true && pathData._shouldRender) {
-        var i, len = itemData.styledShapes.length;
-        for (i = 0; i < len; i += 1) {
-            this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
+CVShapeElement.prototype.renderInnerContent = function () {
+  this.transformHelper.opacity = 1;
+  this.transformHelper._opMdf = false;
+  this.renderModifiers();
+  this.transformsManager.processSequences(this._isFirstFrame);
+  this.renderShape(this.transformHelper, this.shapesData, this.itemsData, true);
+};
+
+CVShapeElement.prototype.renderShapeTransform = function (parentTransform, groupTransform) {
+  if (parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
+    groupTransform.opacity = parentTransform.opacity;
+    groupTransform.opacity *= groupTransform.op.v;
+    groupTransform._opMdf = true;
+  }
+};
+
+CVShapeElement.prototype.drawLayer = function () {
+  var i;
+  var len = this.stylesList.length;
+  var j;
+  var jLen;
+  var k;
+  var kLen;
+  var elems;
+  var nodes;
+  var renderer = this.globalData.renderer;
+  var ctx = this.globalData.canvasContext;
+  var type;
+  var currentStyle;
+  for (i = 0; i < len; i += 1) {
+    currentStyle = this.stylesList[i];
+    type = currentStyle.type;
+
+    // Skipping style when
+    // Stroke width equals 0
+    // style should not be rendered (extra unused repeaters)
+    // current opacity equals 0
+    // global opacity equals 0
+    if (!(((type === 'st' || type === 'gs') && currentStyle.wi === 0) || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0)) {
+      renderer.save();
+      elems = currentStyle.elements;
+      if (type === 'st' || type === 'gs') {
+        ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
+        ctx.lineWidth = currentStyle.wi;
+        ctx.lineCap = currentStyle.lc;
+        ctx.lineJoin = currentStyle.lj;
+        ctx.miterLimit = currentStyle.ml || 0;
+      } else {
+        ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
+      }
+      renderer.ctxOpacity(currentStyle.coOp);
+      if (type !== 'st' && type !== 'gs') {
+        ctx.beginPath();
+      }
+      renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
+      jLen = elems.length;
+      for (j = 0; j < jLen; j += 1) {
+        if (type === 'st' || type === 'gs') {
+          ctx.beginPath();
+          if (currentStyle.da) {
+            ctx.setLineDash(currentStyle.da);
+            ctx.lineDashOffset = currentStyle.do;
+          }
         }
-    }
-};
+        nodes = elems[j].trNodes;
+        kLen = nodes.length;
 
-CVShapeElement.prototype.renderFill = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-
-    if (itemData.c._mdf || this._isFirstFrame) {
-        styleElem.co = 'rgb(' 
-        + bm_floor(itemData.c.v[0]) + ',' 
-        + bm_floor(itemData.c.v[1]) + ',' 
-        + bm_floor(itemData.c.v[2]) + ')';
-    }
-    if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
-        styleElem.coOp = itemData.o.v * groupTransform.opacity;
-    }
-};
-
-CVShapeElement.prototype.renderGradientFill = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-    if(!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
-        var ctx = this.globalData.canvasContext;
-        var grd;
-        var pt1 = itemData.s.v, pt2 = itemData.e.v;
-        if (styleData.t === 1) {
-            grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
-        } else {
-            var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
-
-            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-            var dist = rad * percent;
-            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-            var grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
+        for (k = 0; k < kLen; k += 1) {
+          if (nodes[k].t === 'm') {
+            ctx.moveTo(nodes[k].p[0], nodes[k].p[1]);
+          } else if (nodes[k].t === 'c') {
+            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]);
+          } else {
+            ctx.closePath();
+          }
         }
-
-        var i, len = styleData.g.p;
-        var cValues = itemData.g.c;
-        var opacity = 1;
-
-        for (i = 0; i < len; i += 1){
-            if(itemData.g._hasOpacity && itemData.g._collapsable) {
-                opacity = itemData.g.o[i*2 + 1];
-            }
-            grd.addColorStop(cValues[i * 4] / 100,'rgba('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ',' + opacity + ')');
+        if (type === 'st' || type === 'gs') {
+          ctx.stroke();
+          if (currentStyle.da) {
+            ctx.setLineDash(this.dashResetter);
+          }
         }
-        styleElem.grd = grd;
+      }
+      if (type !== 'st' && type !== 'gs') {
+        ctx.fill(currentStyle.r);
+      }
+      renderer.restore();
     }
-    styleElem.coOp = itemData.o.v*groupTransform.opacity;
-    
+  }
 };
 
-CVShapeElement.prototype.renderStroke = function(styleData,itemData, groupTransform){
-    var styleElem = itemData.style;
-    var d = itemData.d;
-    if(d && (d._mdf  || this._isFirstFrame)){
-        styleElem.da = d.dashArray;
-        styleElem.do = d.dashoffset[0];
+CVShapeElement.prototype.renderShape = function (parentTransform, items, data, isMain) {
+  var i;
+  var len = items.length - 1;
+  var groupTransform;
+  groupTransform = parentTransform;
+  for (i = len; i >= 0; i -= 1) {
+    if (items[i].ty === 'tr') {
+      groupTransform = data[i].transform;
+      this.renderShapeTransform(parentTransform, groupTransform);
+    } else if (items[i].ty === 'sh' || items[i].ty === 'el' || items[i].ty === 'rc' || items[i].ty === 'sr') {
+      this.renderPath(items[i], data[i]);
+    } else if (items[i].ty === 'fl') {
+      this.renderFill(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'st') {
+      this.renderStroke(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'gf' || items[i].ty === 'gs') {
+      this.renderGradientFill(items[i], data[i], groupTransform);
+    } else if (items[i].ty === 'gr') {
+      this.renderShape(groupTransform, items[i].it, data[i].it);
+    } else if (items[i].ty === 'tm') {
+      //
     }
-    if(itemData.c._mdf || this._isFirstFrame){
-        styleElem.co = 'rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')';
-    }
-    if(itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame){
-        styleElem.coOp = itemData.o.v*groupTransform.opacity;
-    }
-    if(itemData.w._mdf || this._isFirstFrame){
-        styleElem.wi = itemData.w.v;
-    }
+  }
+  if (isMain) {
+    this.drawLayer();
+  }
 };
 
-
-CVShapeElement.prototype.destroy = function(){
-    this.shapesData = null;
-    this.globalData = null;
-    this.canvasContext = null;
-    this.stylesList.length = 0;
-    this.itemsData.length = 0;
+CVShapeElement.prototype.renderStyledShape = function (styledShape, shape) {
+  if (this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
+    var shapeNodes = styledShape.trNodes;
+    var paths = shape.paths;
+    var i;
+    var len;
+    var j;
+    var jLen = paths._length;
+    shapeNodes.length = 0;
+    var groupTransformMat = styledShape.transforms.finalTransform;
+    for (j = 0; j < jLen; j += 1) {
+      var pathNodes = paths.shapes[j];
+      if (pathNodes && pathNodes.v) {
+        len = pathNodes._length;
+        for (i = 1; i < len; i += 1) {
+          if (i === 1) {
+            shapeNodes.push({
+              t: 'm',
+              p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0),
+            });
+          }
+          shapeNodes.push({
+            t: 'c',
+            pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i]),
+          });
+        }
+        if (len === 1) {
+          shapeNodes.push({
+            t: 'm',
+            p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0),
+          });
+        }
+        if (pathNodes.c && len) {
+          shapeNodes.push({
+            t: 'c',
+            pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0]),
+          });
+          shapeNodes.push({
+            t: 'z',
+          });
+        }
+      }
+    }
+    styledShape.trNodes = shapeNodes;
+  }
 };
 
+CVShapeElement.prototype.renderPath = function (pathData, itemData) {
+  if (pathData.hd !== true && pathData._shouldRender) {
+    var i;
+    var len = itemData.styledShapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
+    }
+  }
+};
+
+CVShapeElement.prototype.renderFill = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+
+  if (itemData.c._mdf || this._isFirstFrame) {
+    styleElem.co = 'rgb('
+        + bmFloor(itemData.c.v[0]) + ','
+        + bmFloor(itemData.c.v[1]) + ','
+        + bmFloor(itemData.c.v[2]) + ')';
+  }
+  if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
+    styleElem.coOp = itemData.o.v * groupTransform.opacity;
+  }
+};
+
+CVShapeElement.prototype.renderGradientFill = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+  var grd;
+  if (!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) {
+    var ctx = this.globalData.canvasContext;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
+    if (styleData.t === 1) {
+      grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
+    } else {
+      var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+      var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+
+      var percent = itemData.h.v;
+      if (percent >= 1) {
+        percent = 0.99;
+      } else if (percent <= -1) {
+        percent = -0.99;
+      }
+      var dist = rad * percent;
+      var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+      var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+      grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
+    }
+
+    var i;
+    var len = styleData.g.p;
+    var cValues = itemData.g.c;
+    var opacity = 1;
+
+    for (i = 0; i < len; i += 1) {
+      if (itemData.g._hasOpacity && itemData.g._collapsable) {
+        opacity = itemData.g.o[i * 2 + 1];
+      }
+      grd.addColorStop(cValues[i * 4] / 100, 'rgba(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ',' + opacity + ')');
+    }
+    styleElem.grd = grd;
+  }
+  styleElem.coOp = itemData.o.v * groupTransform.opacity;
+};
+
+CVShapeElement.prototype.renderStroke = function (styleData, itemData, groupTransform) {
+  var styleElem = itemData.style;
+  var d = itemData.d;
+  if (d && (d._mdf || this._isFirstFrame)) {
+    styleElem.da = d.dashArray;
+    styleElem.do = d.dashoffset[0];
+  }
+  if (itemData.c._mdf || this._isFirstFrame) {
+    styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')';
+  }
+  if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
+    styleElem.coOp = itemData.o.v * groupTransform.opacity;
+  }
+  if (itemData.w._mdf || this._isFirstFrame) {
+    styleElem.wi = itemData.w.v;
+  }
+};
+
+CVShapeElement.prototype.destroy = function () {
+  this.shapesData = null;
+  this.globalData = null;
+  this.canvasContext = null;
+  this.stylesList.length = 0;
+  this.itemsData.length = 0;
+};
+
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement,
+SVGShapeElement, IImageElement */
 
 function CVSolidElement(data, globalData, comp) {
-    this.initElement(data,globalData,comp);
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);
 
 CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;
 CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
 
-CVSolidElement.prototype.renderInnerContent = function() {
-    var ctx = this.canvasContext;
-    ctx.fillStyle = this.data.sc;
-    ctx.fillRect(0, 0, this.data.sw, this.data.sh);
-    //
+CVSolidElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.fillStyle = this.data.sc;
+  ctx.fillRect(0, 0, this.data.sw, this.data.sh);
+  //
 };
-function CVTextElement(data, globalData, comp){
-    this.textSpans = [];
-    this.yOffset = 0;
-    this.fillColorAnim = false;
-    this.strokeColorAnim = false;
-    this.strokeWidthAnim = false;
-    this.stroke = false;
-    this.fill = false;
-    this.justifyOffset = 0;
-    this.currentRender = null;
-    this.renderType = 'canvas';
-    this.values = {
-        fill: 'rgba(0,0,0,0)',
-        stroke: 'rgba(0,0,0,0)',
-        sWidth: 0,
-        fValue: ''
-    };
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement,
+RenderableElement, ITextElement, createTag, createSizedArray */
+
+function CVTextElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.yOffset = 0;
+  this.fillColorAnim = false;
+  this.strokeColorAnim = false;
+  this.strokeWidthAnim = false;
+  this.stroke = false;
+  this.fill = false;
+  this.justifyOffset = 0;
+  this.currentRender = null;
+  this.renderType = 'canvas';
+  this.values = {
+    fill: 'rgba(0,0,0,0)',
+    stroke: 'rgba(0,0,0,0)',
+    sWidth: 0,
+    fValue: '',
+  };
+  this.initElement(data, globalData, comp);
 }
-extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement], CVTextElement);
+extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement);
 
 CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d');
 
-CVTextElement.prototype.buildNewText = function(){
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
+CVTextElement.prototype.buildNewText = function () {
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
 
-    var hasFill = false;
-    if(documentData.fc) {
-        hasFill = true;
-        this.values.fill = this.buildColor(documentData.fc);
-    }else{
-        this.values.fill = 'rgba(0,0,0,0)';
+  var hasFill = false;
+  if (documentData.fc) {
+    hasFill = true;
+    this.values.fill = this.buildColor(documentData.fc);
+  } else {
+    this.values.fill = 'rgba(0,0,0,0)';
+  }
+  this.fill = hasFill;
+  var hasStroke = false;
+  if (documentData.sc) {
+    hasStroke = true;
+    this.values.stroke = this.buildColor(documentData.sc);
+    this.values.sWidth = documentData.sw;
+  }
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  var i;
+  var len;
+  var letters = documentData.l;
+  var matrixHelper = this.mHelper;
+  this.stroke = hasStroke;
+  this.values.fValue = documentData.finalSize + 'px ' + this.globalData.fontManager.getFontByName(documentData.f).fFamily;
+  len = documentData.finalText.length;
+  // this.tHelper.font = this.values.fValue;
+  var charData;
+  var shapeData;
+  var k;
+  var kLen;
+  var shapes;
+  var j;
+  var jLen;
+  var pathNodes;
+  var commands;
+  var pathArr;
+  var singleShape = this.data.singleShape;
+  var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
+  var xPos = 0;
+  var yPos = 0;
+  var firstLine = true;
+  var cnt = 0;
+  for (i = 0; i < len; i += 1) {
+    charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+    shapeData = (charData && charData.data) || {};
+    matrixHelper.reset();
+    if (singleShape && letters[i].n) {
+      xPos = -trackingOffset;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      firstLine = false;
     }
-    this.fill = hasFill;
-    var hasStroke = false;
-    if(documentData.sc){
-        hasStroke = true;
-        this.values.stroke = this.buildColor(documentData.sc);
-        this.values.sWidth = documentData.sw;
-    }
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    var i, len;
-    var letters = documentData.l;
-    var matrixHelper = this.mHelper;
-    this.stroke = hasStroke;
-    this.values.fValue = documentData.finalSize + 'px '+ this.globalData.fontManager.getFontByName(documentData.f).fFamily;
-    len = documentData.finalText.length;
-    //this.tHelper.font = this.values.fValue;
-    var charData, shapeData, k, kLen, shapes, j, jLen, pathNodes, commands, pathArr, singleShape = this.data.singleShape;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var xPos = 0, yPos = 0, firstLine = true;
-    var cnt = 0;
-    for (i = 0; i < len; i += 1) {
-        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-        shapeData = charData && charData.data || {};
-        matrixHelper.reset();
-        if(singleShape && letters[i].n) {
-            xPos = -trackingOffset;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            firstLine = false;
-        }
 
-        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
-        jLen = shapes.length;
-        matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
-        if(singleShape){
-            this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
-        }
-        commands = createSizedArray(jLen);
-        for(j=0;j<jLen;j+=1){
-            kLen = shapes[j].ks.k.i.length;
-            pathNodes = shapes[j].ks.k;
-            pathArr = [];
-            for(k=1;k<kLen;k+=1){
-                if(k==1){
-                    pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0],pathNodes.v[0][1],0),matrixHelper.applyToY(pathNodes.v[0][0],pathNodes.v[0][1],0));
-                }
-                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));
-            }
-            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));
-            commands[j] = pathArr;
-        }
-        if(singleShape){
-            xPos += letters[i].l;
-            xPos += trackingOffset;
-        }
-        if(this.textSpans[cnt]){
-            this.textSpans[cnt].elem = commands;
-        } else {
-            this.textSpans[cnt] = {elem: commands};
-        }
-        cnt +=1;
+    shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+    jLen = shapes.length;
+    matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+    if (singleShape) {
+      this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
     }
+    commands = createSizedArray(jLen);
+    for (j = 0; j < jLen; j += 1) {
+      kLen = shapes[j].ks.k.i.length;
+      pathNodes = shapes[j].ks.k;
+      pathArr = [];
+      for (k = 1; k < kLen; k += 1) {
+        if (k === 1) {
+          pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));
+        }
+        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));
+      }
+      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));
+      commands[j] = pathArr;
+    }
+    if (singleShape) {
+      xPos += letters[i].l;
+      xPos += trackingOffset;
+    }
+    if (this.textSpans[cnt]) {
+      this.textSpans[cnt].elem = commands;
+    } else {
+      this.textSpans[cnt] = { elem: commands };
+    }
+    cnt += 1;
+  }
 };
 
-CVTextElement.prototype.renderInnerContent = function(){
-    var ctx = this.canvasContext;
-    var finalMat = this.finalTransform.mat.props;
-    ctx.font = this.values.fValue;
-    ctx.lineCap = 'butt';
-    ctx.lineJoin = 'miter';
-    ctx.miterLimit = 4;
+CVTextElement.prototype.renderInnerContent = function () {
+  var ctx = this.canvasContext;
+  ctx.font = this.values.fValue;
+  ctx.lineCap = 'butt';
+  ctx.lineJoin = 'miter';
+  ctx.miterLimit = 4;
 
-    if(!this.data.singleShape){
-        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  if (!this.data.singleShape) {
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  }
+
+  var i;
+  var len;
+  var j;
+  var jLen;
+  var k;
+  var kLen;
+  var renderedLetters = this.textAnimator.renderedLetters;
+
+  var letters = this.textProperty.currentData.l;
+
+  len = letters.length;
+  var renderedLetter;
+  var lastFill = null;
+  var lastStroke = null;
+  var lastStrokeW = null;
+  var commands;
+  var pathArr;
+  for (i = 0; i < len; i += 1) {
+    if (!letters[i].n) {
+      renderedLetter = renderedLetters[i];
+      if (renderedLetter) {
+        this.globalData.renderer.save();
+        this.globalData.renderer.ctxTransform(renderedLetter.p);
+        this.globalData.renderer.ctxOpacity(renderedLetter.o);
+      }
+      if (this.fill) {
+        if (renderedLetter && renderedLetter.fc) {
+          if (lastFill !== renderedLetter.fc) {
+            lastFill = renderedLetter.fc;
+            ctx.fillStyle = renderedLetter.fc;
+          }
+        } else if (lastFill !== this.values.fill) {
+          lastFill = this.values.fill;
+          ctx.fillStyle = this.values.fill;
+        }
+        commands = this.textSpans[i].elem;
+        jLen = commands.length;
+        this.globalData.canvasContext.beginPath();
+        for (j = 0; j < jLen; j += 1) {
+          pathArr = commands[j];
+          kLen = pathArr.length;
+          this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
+          for (k = 2; k < kLen; k += 6) {
+            this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
+          }
+        }
+        this.globalData.canvasContext.closePath();
+        this.globalData.canvasContext.fill();
+        /// ctx.fillText(this.textSpans[i].val,0,0);
+      }
+      if (this.stroke) {
+        if (renderedLetter && renderedLetter.sw) {
+          if (lastStrokeW !== renderedLetter.sw) {
+            lastStrokeW = renderedLetter.sw;
+            ctx.lineWidth = renderedLetter.sw;
+          }
+        } else if (lastStrokeW !== this.values.sWidth) {
+          lastStrokeW = this.values.sWidth;
+          ctx.lineWidth = this.values.sWidth;
+        }
+        if (renderedLetter && renderedLetter.sc) {
+          if (lastStroke !== renderedLetter.sc) {
+            lastStroke = renderedLetter.sc;
+            ctx.strokeStyle = renderedLetter.sc;
+          }
+        } else if (lastStroke !== this.values.stroke) {
+          lastStroke = this.values.stroke;
+          ctx.strokeStyle = this.values.stroke;
+        }
+        commands = this.textSpans[i].elem;
+        jLen = commands.length;
+        this.globalData.canvasContext.beginPath();
+        for (j = 0; j < jLen; j += 1) {
+          pathArr = commands[j];
+          kLen = pathArr.length;
+          this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
+          for (k = 2; k < kLen; k += 6) {
+            this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
+          }
+        }
+        this.globalData.canvasContext.closePath();
+        this.globalData.canvasContext.stroke();
+        /// ctx.strokeText(letters[i].val,0,0);
+      }
+      if (renderedLetter) {
+        this.globalData.renderer.restore();
+      }
     }
-
-    var  i,len, j, jLen, k, kLen;
-    var renderedLetters = this.textAnimator.renderedLetters;
-
-    var letters = this.textProperty.currentData.l;
-
-    len = letters.length;
-    var renderedLetter;
-    var lastFill = null, lastStroke = null, lastStrokeW = null, commands, pathArr;
-    for(i=0;i<len;i+=1){
-        if(letters[i].n){
-            continue;
-        }
-        renderedLetter = renderedLetters[i];
-        if(renderedLetter){
-            this.globalData.renderer.save();
-            this.globalData.renderer.ctxTransform(renderedLetter.p);
-            this.globalData.renderer.ctxOpacity(renderedLetter.o);
-        }
-        if(this.fill){
-            if(renderedLetter && renderedLetter.fc){
-                if(lastFill !== renderedLetter.fc){
-                    lastFill = renderedLetter.fc;
-                    ctx.fillStyle = renderedLetter.fc;
-                }
-            }else if(lastFill !== this.values.fill){
-                lastFill = this.values.fill;
-                ctx.fillStyle = this.values.fill;
-            }
-            commands = this.textSpans[i].elem;
-            jLen = commands.length;
-            this.globalData.canvasContext.beginPath();
-            for(j=0;j<jLen;j+=1) {
-                pathArr = commands[j];
-                kLen = pathArr.length;
-                this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
-                for (k = 2; k < kLen; k += 6) {
-                    this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
-                }
-            }
-            this.globalData.canvasContext.closePath();
-            this.globalData.canvasContext.fill();
-            ///ctx.fillText(this.textSpans[i].val,0,0);
-        }
-        if(this.stroke){
-            if(renderedLetter && renderedLetter.sw){
-                if(lastStrokeW !== renderedLetter.sw){
-                    lastStrokeW = renderedLetter.sw;
-                    ctx.lineWidth = renderedLetter.sw;
-                }
-            }else if(lastStrokeW !== this.values.sWidth){
-                lastStrokeW = this.values.sWidth;
-                ctx.lineWidth = this.values.sWidth;
-            }
-            if(renderedLetter && renderedLetter.sc){
-                if(lastStroke !== renderedLetter.sc){
-                    lastStroke = renderedLetter.sc;
-                    ctx.strokeStyle = renderedLetter.sc;
-                }
-            }else if(lastStroke !== this.values.stroke){
-                lastStroke = this.values.stroke;
-                ctx.strokeStyle = this.values.stroke;
-            }
-            commands = this.textSpans[i].elem;
-            jLen = commands.length;
-            this.globalData.canvasContext.beginPath();
-            for(j=0;j<jLen;j+=1) {
-                pathArr = commands[j];
-                kLen = pathArr.length;
-                this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
-                for (k = 2; k < kLen; k += 6) {
-                    this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
-                }
-            }
-            this.globalData.canvasContext.closePath();
-            this.globalData.canvasContext.stroke();
-            ///ctx.strokeText(letters[i].val,0,0);
-        }
-        if(renderedLetter) {
-            this.globalData.renderer.restore();
-        }
-    }
+  }
 };
+
 function CVEffects() {
 
 }
-CVEffects.prototype.renderFrame = function(){};
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
+CVEffects.prototype.renderFrame = function () {};
 
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+/* global createTag, AnimationItem */
+/* exported animationManager */
+
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
+    while (i < len) {
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      window.requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            window.requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    window.requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        window.requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations(animationData, standalone, renderer) {
+    var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+      [].slice.call(document.getElementsByClassName('bodymovin')));
+    var i;
+    var lenAnims = animElements.length;
+    for (i = 0; i < lenAnims; i += 1) {
+      if (renderer) {
+        animElements[i].setAttribute('data-bm-type', renderer);
+      }
+      registerAnimation(animElements[i], animationData);
     }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
-                  [].slice.call(document.getElementsByClassName('bodymovin')));
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerText = '';
-            var div = createTag('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
+    if (standalone && lenAnims === 0) {
+      if (!renderer) {
+        renderer = 'svg';
+      }
+      var body = document.getElementsByTagName('body')[0];
+      body.innerText = '';
+      var div = createTag('div');
+      div.style.width = '100%';
+      div.style.height = '100%';
+      div.setAttribute('data-bm-type', renderer);
+      body.appendChild(div);
+      registerAnimation(div, animationData);
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                window.requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        window.requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function freeze() {
-        _isFrozen = true;
+  function freeze() {
+    _isFrozen = true;
+  }
+
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
+
+  function setVolume(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setVolume(val, animation);
     }
+  }
 
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
+  function mute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.mute(animation);
     }
+  }
 
-    function setVolume(val,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setVolume(val, animation);
-        }
+  function unmute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.unmute(animation);
     }
+  }
 
-    function mute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.mute(animation);
-        }
-    }
-
-    function unmute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.unmute(animation);
-        }
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.setVolume = setVolume;
-    moduleOb.mute = mute;
-    moduleOb.unmute = unmute;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.setVolume = setVolume;
+  moduleOb.mute = mute;
+  moduleOb.unmute = unmute;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
+/* global createElementID, subframeEnabled, ProjectInterface, ImagePreloader, audioControllerFactory, extendPrototype, BaseEvent,
+CanvasRenderer, SVGRenderer, HybridRenderer, assetLoader, dataManager, expressionsPlugin, BMEnterFrameEvent, BMCompleteLoopEvent,
+BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent,
+BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent */
+
 var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.firstFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.playCount = 0;
-    this.animationData = {};
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = createElementID();
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.isSubframeEnabled = subframeEnabled;
-    this.segments = [];
-    this._idle = true;
-    this._completedLoop = false;
-    this.projectInterface = ProjectInterface();
-    this.imagePreloader = new ImagePreloader();
-    this.audioController = audioControllerFactory();
+  this._cbs = [];
+  this.name = '';
+  this.path = '';
+  this.isLoaded = false;
+  this.currentFrame = 0;
+  this.currentRawFrame = 0;
+  this.firstFrame = 0;
+  this.totalFrames = 0;
+  this.frameRate = 0;
+  this.frameMult = 0;
+  this.playSpeed = 1;
+  this.playDirection = 1;
+  this.playCount = 0;
+  this.animationData = {};
+  this.assets = [];
+  this.isPaused = true;
+  this.autoplay = false;
+  this.loop = true;
+  this.renderer = null;
+  this.animationID = createElementID();
+  this.assetsPath = '';
+  this.timeCompleted = 0;
+  this.segmentPos = 0;
+  this.isSubframeEnabled = subframeEnabled;
+  this.segments = [];
+  this._idle = true;
+  this._completedLoop = false;
+  this.projectInterface = ProjectInterface();
+  this.imagePreloader = new ImagePreloader();
+  this.audioController = audioControllerFactory();
 };
 
 extendPrototype([BaseEvent], AnimationItem);
 
-AnimationItem.prototype.setParams = function(params) {
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-    if (params.loop === ''
+AnimationItem.prototype.setParams = function (params) {
+  if (params.wrapper || params.container) {
+    this.wrapper = params.wrapper || params.container;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    case 'svg':
+      this.renderer = new SVGRenderer(this, params.rendererSettings);
+      break;
+    default:
+      this.renderer = new HybridRenderer(this, params.rendererSettings);
+      break;
+  }
+  this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+  if (params.loop === ''
         || params.loop === null
         || params.loop === undefined
-        || params.loop === true)
-    {
-        this.loop = true;
-    } else if (params.loop === false) {
-        this.loop = false;
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = params.assetsPath;
+  this.initialSegment = params.initialSegment;
+  if (params.audioFactory) {
+    this.audioController.setAudioFactory(params.audioFactory);
+  }
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    if (params.path.lastIndexOf('\\') !== -1) {
+      this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
     } else {
-        this.loop = parseInt(params.loop);
+      this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
     }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = params.assetsPath;
-    this.initialSegment = params.initialSegment;
-    if (params.audioFactory) {
-        this.audioController.setAudioFactory(params.audioFactory);
-    }
-    if (params.animationData) {
-        this.configAnimation(params.animationData);
-    } else if(params.path){
+    this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
+    this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
 
-        if( params.path.lastIndexOf('\\') !== -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        } else {
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-
-        assetLoader.load(params.path, this.configAnimation.bind(this), function() {
-            this.trigger('data_failed');
-        }.bind(this));
-    }
-
+    assetLoader.load(params.path, this.configAnimation.bind(this), function () {
+      this.trigger('data_failed');
+    }.bind(this));
+  }
 };
 
 AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
+  if (animationData) {
+    if (typeof animationData !== 'object') {
+      animationData = JSON.parse(animationData);
     }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
+  }
+  var params = {
+    wrapper: wrapper,
+    animationData: animationData,
+  };
+  var wrapperAttributes = wrapper.attributes;
 
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
+  params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-animation-path').value
+    : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-path').value
+      : wrapperAttributes.getNamedItem('bm-path')
+        ? wrapperAttributes.getNamedItem('bm-path').value
+        : '';
+  params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-type').value
+    : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-type').value
+      : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
+        ? wrapperAttributes.getNamedItem('bm-type').value
+        : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
+          ? wrapperAttributes.getNamedItem('data-bm-renderer').value
+          : wrapperAttributes.getNamedItem('bm-renderer')
+            ? wrapperAttributes.getNamedItem('bm-renderer').value
+            : 'canvas';
 
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
+  var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-loop').value
+    : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-loop').value
+      : wrapperAttributes.getNamedItem('bm-loop')
+        ? wrapperAttributes.getNamedItem('bm-loop').value
+        : '';
+  if (loop === 'false') {
+    params.loop = false;
+  } else if (loop === 'true') {
+    params.loop = true;
+  } else if (loop !== '') {
+    params.loop = parseInt(loop, 10);
+  }
+  var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-autoplay').value
+    : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-autoplay').value
+      : wrapperAttributes.getNamedItem('bm-autoplay')
+        ? wrapperAttributes.getNamedItem('bm-autoplay').value
+        : true;
+  params.autoplay = autoplay !== 'false';
+
+  params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-name').value
+    : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-name').value
+      : wrapperAttributes.getNamedItem('bm-name')
+        ? wrapperAttributes.getNamedItem('bm-name').value
+        : '';
+  var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-prerender').value
+    : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-prerender').value
+      : wrapperAttributes.getNamedItem('bm-prerender')
+        ? wrapperAttributes.getNamedItem('bm-prerender').value
+        : '';
+
+  if (prerender === 'false') {
+    params.prerender = false;
+  }
+  this.setParams(params);
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
+  }
+  if (data.chars || data.fonts) {
+    this.renderer.globalData.fontManager.addChars(data.chars);
+    this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
+  }
+  if (data.assets) {
+    len = data.assets.length;
+    for (i = 0; i < len; i += 1) {
+      this.animationData.assets.push(data.assets[i]);
     }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
-        this.trigger('data_failed');
-    }.bind(this));
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.trigger('data_ready');
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  var segment = segments.shift();
+  this.timeCompleted = segment.time * this.frameRate;
+  var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
+  this.segmentPos += 1;
+  assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
+    this.trigger('data_failed');
+  }.bind(this));
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
-    }
-    this.loadNextSegment();
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.imagesLoaded = function() {
-    this.trigger('loaded_images');
-    this.checkLoaded()
-}
+AnimationItem.prototype.imagesLoaded = function () {
+  this.trigger('loaded_images');
+  this.checkLoaded();
+};
 
-AnimationItem.prototype.preloadImages = function() {
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
-}
+AnimationItem.prototype.preloadImages = function () {
+  this.imagePreloader.setAssetsPath(this.assetsPath);
+  this.imagePreloader.setPath(this.path);
+  this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
+};
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    try {
-        this.animationData = animData;
+  if (!this.renderer) {
+    return;
+  }
+  try {
+    this.animationData = animData;
 
-        if (this.initialSegment) {
-            this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
-            this.firstFrame = Math.round(this.initialSegment[0]);
-        } else {
-            this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-            this.firstFrame = Math.round(this.animationData.ip);
-        }
-        this.renderer.configAnimation(animData);
-        if(!animData.assets){
-            animData.assets = [];
-        }
-
-        this.assets = this.animationData.assets;
-        this.frameRate = this.animationData.fr;
-        this.frameMult = this.animationData.fr / 1000;
-        this.renderer.searchExtraCompositions(animData.assets);
-        this.trigger('config_ready');
-        this.preloadImages();
-        this.loadSegments();
-        this.updaFrameModifier();
-        this.waitForFontsLoaded();
-        if (this.isPaused) {
-            this.audioController.pause();
-        }
-    } catch(error) {
-        this.triggerConfigError(error);
+    if (this.initialSegment) {
+      this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+      this.firstFrame = Math.round(this.initialSegment[0]);
+    } else {
+      this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+      this.firstFrame = Math.round(this.animationData.ip);
     }
+    this.renderer.configAnimation(animData);
+    if (!animData.assets) {
+      animData.assets = [];
+    }
+
+    this.assets = this.animationData.assets;
+    this.frameRate = this.animationData.fr;
+    this.frameMult = this.animationData.fr / 1000;
+    this.renderer.searchExtraCompositions(animData.assets);
+    this.trigger('config_ready');
+    this.preloadImages();
+    this.loadSegments();
+    this.updaFrameModifier();
+    this.waitForFontsLoaded();
+    if (this.isPaused) {
+      this.audioController.pause();
+    }
+  } catch (error) {
+    this.triggerConfigError(error);
+  }
 };
 
-AnimationItem.prototype.waitForFontsLoaded = function(){
-    if(!this.renderer) {
-        return;
-    }
-    if(this.renderer.globalData.fontManager.isLoaded){
-        this.checkLoaded();
-    }else{
-        setTimeout(this.waitForFontsLoaded.bind(this),20);
-    }
-}
+AnimationItem.prototype.waitForFontsLoaded = function () {
+  if (!this.renderer) {
+    return;
+  }
+  if (this.renderer.globalData.fontManager.isLoaded) {
+    this.checkLoaded();
+  } else {
+    setTimeout(this.waitForFontsLoaded.bind(this), 20);
+  }
+};
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded 
+  if (!this.isLoaded
         && this.renderer.globalData.fontManager.isLoaded
         && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')
-    ) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function() {
-            this.trigger('DOMLoaded');
-        }.bind(this), 0);
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
+  ) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    setTimeout(function () {
+      this.trigger('DOMLoaded');
+    }.bind(this), 0);
+    this.gotoFrame();
+    if (this.autoplay) {
+      this.play();
+    }
+  }
 };
 
 AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
+  this.renderer.updateContainerSize();
 };
 
-AnimationItem.prototype.setSubframe = function(flag){
-    this.isSubframeEnabled = !!flag;
+AnimationItem.prototype.setSubframe = function (flag) {
+  this.isSubframeEnabled = !!flag;
 };
 
 AnimationItem.prototype.gotoFrame = function () {
-    this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
+  this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
 
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
+  if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
+    this.currentFrame = this.timeCompleted;
+  }
+  this.trigger('enterFrame');
+  this.renderFrame();
 };
 
 AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    try {
-        this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-    } catch(error) {
-        this.triggerRenderFrameError(error);
-    }
+  if (this.isLoaded === false) {
+    return;
+  }
+  try {
+    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
+  } catch (error) {
+    this.triggerRenderFrameError(error);
+  }
 };
 
 AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.isPaused = false;
+    this.audioController.resume();
+    if (this._idle) {
+      this._idle = false;
+      this.trigger('_active');
     }
-    if (this.isPaused === true) {
-        this.isPaused = false;
-        this.audioController.resume();
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
+  }
 };
 
 AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        this._idle = true;
-        this.trigger('_idle');
-        this.audioController.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === false) {
+    this.isPaused = true;
+    this._idle = true;
+    this.trigger('_idle');
+    this.audioController.pause();
+  }
 };
 
 AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.play();
+  } else {
+    this.pause();
+  }
 };
 
 AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.playCount = 0;
-    this._completedLoop = false;
-    this.setCurrentRawFrameValue(0);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.pause();
+  this.playCount = 0;
+  this._completedLoop = false;
+  this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
+  if (name && this.name !== name) {
+    return;
+  }
+  if (isFrame) {
+    this.setCurrentRawFrameValue(value);
+  } else {
+    this.setCurrentRawFrameValue(value * this.frameModifier);
+  }
+  this.pause();
 };
 
 AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
+  this.goToAndStop(value, isFrame, name);
+  this.play();
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    var nextValue = this.currentRawFrame + value * this.frameModifier;
-    var _isComplete = false;
-    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
-    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
-    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
-        if (!this.loop || this.playCount === this.loop) {
-            if (!this.checkSegments(nextValue >  this.totalFrames ? nextValue % this.totalFrames : 0)) {
-                _isComplete = true;
-                nextValue = this.totalFrames - 1;
-            }
-        } else if (nextValue >= this.totalFrames) {
-            this.playCount += 1;
-            if (!this.checkSegments(nextValue % this.totalFrames)) {
-                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
-                this._completedLoop = true;
-                this.trigger('loopComplete');
-            }
-        } else {
-            this.setCurrentRawFrameValue(nextValue);
-        }
-    } else if(nextValue < 0) {
-        if (!this.checkSegments(nextValue % this.totalFrames)) {
-            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
-                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
-                if(!this._completedLoop) {
-                    this._completedLoop = true;
-                } else {
-                    this.trigger('loopComplete');
-                }
-            } else {
-                _isComplete = true;
-                nextValue = 0;
-            }
-        }
+  if (this.isPaused === true || this.isLoaded === false) {
+    return;
+  }
+  var nextValue = this.currentRawFrame + value * this.frameModifier;
+  var _isComplete = false;
+  // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+  // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+  if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+    if (!this.loop || this.playCount === this.loop) {
+      if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
+        _isComplete = true;
+        nextValue = this.totalFrames - 1;
+      }
+    } else if (nextValue >= this.totalFrames) {
+      this.playCount += 1;
+      if (!this.checkSegments(nextValue % this.totalFrames)) {
+        this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+        this._completedLoop = true;
+        this.trigger('loopComplete');
+      }
     } else {
-        this.setCurrentRawFrameValue(nextValue);
+      this.setCurrentRawFrameValue(nextValue);
     }
-    if (_isComplete) {
-        this.setCurrentRawFrameValue(nextValue);
-        this.pause();
-        this.trigger('complete');
+  } else if (nextValue < 0) {
+    if (!this.checkSegments(nextValue % this.totalFrames)) {
+      if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) { // eslint-disable-line no-plusplus
+        this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+        if (!this._completedLoop) {
+          this._completedLoop = true;
+        } else {
+          this.trigger('loopComplete');
+        }
+      } else {
+        _isComplete = true;
+        nextValue = 0;
+      }
     }
+  } else {
+    this.setCurrentRawFrameValue(nextValue);
+  }
+  if (_isComplete) {
+    this.setCurrentRawFrameValue(nextValue);
+    this.pause();
+    this.trigger('complete');
+  }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr, offset){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0.001 + offset);
+AnimationItem.prototype.adjustSegment = function (arr, offset) {
+  this.playCount = 0;
+  if (arr[1] < arr[0]) {
+    if (this.frameModifier > 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(-1);
+      }
     }
-    this.trigger('segmentStart');
+    this.totalFrames = arr[0] - arr[1];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[1];
+    this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
+  } else if (arr[1] > arr[0]) {
+    if (this.frameModifier < 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(1);
+      }
+    }
+    this.totalFrames = arr[1] - arr[0];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[0];
+    this.setCurrentRawFrameValue(0.001 + offset);
+  }
+  this.trigger('segmentStart');
 };
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init;
-        }
+AnimationItem.prototype.setSegment = function (init, end) {
+  var pendingFrame = -1;
+  if (this.isPaused) {
+    if (this.currentRawFrame + this.firstFrame < init) {
+      pendingFrame = init;
+    } else if (this.currentRawFrame + this.firstFrame > end) {
+      pendingFrame = end - init;
     }
+  }
 
-    this.firstFrame = init;
-    this.timeCompleted = this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
+  this.firstFrame = init;
+  this.totalFrames = end - init;
+  this.timeCompleted = this.totalFrames;
+  if (pendingFrame !== -1) {
+    this.goToAndStop(pendingFrame, true);
+  }
 };
 
 AnimationItem.prototype.playSegments = function (arr, forceFlag) {
-    if (forceFlag) {
-        this.segments.length = 0;
+  if (forceFlag) {
+    this.segments.length = 0;
+  }
+  if (typeof arr[0] === 'object') {
+    var i;
+    var len = arr.length;
+    for (i = 0; i < len; i += 1) {
+      this.segments.push(arr[i]);
     }
-    if (typeof arr[0] === 'object') {
-        var i, len = arr.length;
-        for (i = 0; i < len; i += 1) {
-            this.segments.push(arr[i]);
-        }
-    } else {
-        this.segments.push(arr);
-    }
-    if (this.segments.length && forceFlag) {
-        this.adjustSegment(this.segments.shift(), 0);
-    }
-    if (this.isPaused) {
-        this.play();
-    }
+  } else {
+    this.segments.push(arr);
+  }
+  if (this.segments.length && forceFlag) {
+    this.adjustSegment(this.segments.shift(), 0);
+  }
+  if (this.isPaused) {
+    this.play();
+  }
 };
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip,this.animationData.op]);
-    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if (forceFlag) {
-        this.checkSegments(0);
-    }
+  this.segments.length = 0;
+  this.segments.push([this.animationData.ip, this.animationData.op]);
+  // this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+  if (forceFlag) {
+    this.checkSegments(0);
+  }
 };
-AnimationItem.prototype.checkSegments = function(offset) {
-    if (this.segments.length) {
-        this.adjustSegment(this.segments.shift(), offset);
-        return true;
-    }
-    return false;
+AnimationItem.prototype.checkSegments = function (offset) {
+  if (this.segments.length) {
+    this.adjustSegment(this.segments.shift(), offset);
+    return true;
+  }
+  return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this.imagePreloader.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this.imagePreloader.destroy();
+  this.trigger('destroy');
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
+  this.renderer = null;
+  this.imagePreloader = null;
+  this.projectInterface = null;
 };
 
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    this.gotoFrame();
+AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
+  this.currentRawFrame = value;
+  this.gotoFrame();
 };
 
 AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
+  this.playSpeed = val;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
+  this.playDirection = val < 0 ? -1 : 1;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setVolume = function (val, name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.setVolume(val);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.setVolume(val);
 };
 
 AnimationItem.prototype.getVolume = function () {
-    return this.audioController.getVolume();
+  return this.audioController.getVolume();
 };
 
 AnimationItem.prototype.mute = function (name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.mute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.mute();
 };
 
 AnimationItem.prototype.unmute = function (name) {
-    if(name && this.name !== name){
-        return;
-    }
-    this.audioController.unmute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.unmute();
 };
 
 AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-    this.audioController.setRate(this.playSpeed * this.playDirection)
+  this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
+  this.audioController.setRate(this.playSpeed * this.playDirection);
 };
 
 AnimationItem.prototype.getPath = function () {
-    return this.path;
+  return this.path;
 };
 
 AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(assetData.e) {
-        path = assetData.p;
-    } else if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
+  var path = '';
+  if (assetData.e) {
+    path = assetData.p;
+  } else if (this.assetsPath) {
+    var imagePath = assetData.p;
+    if (imagePath.indexOf('images/') !== -1) {
+      imagePath = imagePath.split('/')[1];
     }
-    return path;
+    path = this.assetsPath + imagePath;
+  } else {
+    path = this.path;
+    path += assetData.u ? assetData.u : '';
+    path += assetData.p;
+  }
+  return path;
 };
 
 AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
+  var i = 0;
+  var len = this.assets.length;
+  while (i < len) {
+    if (id === this.assets[i].id) {
+      return this.assets[i];
     }
+    i += 1;
+  }
+  return null;
 };
 
 AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
+  this.renderer.hide();
 };
 
 AnimationItem.prototype.show = function () {
-    this.renderer.show();
+  this.renderer.show();
 };
 
 AnimationItem.prototype.getDuration = function (isFrame) {
-    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+  return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
 };
 
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
+AnimationItem.prototype.trigger = function (name) {
+  if (this._cbs && this._cbs[name]) {
+    switch (name) {
+      case 'enterFrame':
+        this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
+        break;
+      case 'loopComplete':
+        this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+        break;
+      case 'complete':
+        this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
+        break;
+      case 'segmentStart':
+        this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+        break;
+      case 'destroy':
+        this.triggerEvent(name, new BMDestroyEvent(name, this));
+        break;
+      default:
+        this.triggerEvent(name);
     }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
+  }
+  if (name === 'enterFrame' && this.onEnterFrame) {
+    this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
+  }
+  if (name === 'loopComplete' && this.onLoopComplete) {
+    this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+  }
+  if (name === 'complete' && this.onComplete) {
+    this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
+  }
+  if (name === 'segmentStart' && this.onSegmentStart) {
+    this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+  }
+  if (name === 'destroy' && this.onDestroy) {
+    this.onDestroy.call(this, new BMDestroyEvent(name, this));
+  }
 };
 
-AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
+AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
+  var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-    var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
 
-    if (this.onError) {
-        this.onError.call(this, error);
-    }
-}
+AnimationItem.prototype.triggerConfigError = function (nativeError) {
+  var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-AnimationItem.prototype.triggerConfigError = function(nativeError) {
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
 
-    var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
-    }
-}
 
 var lottie = {};
 
-var _isFrozen = false;
-
-function setLocationHref (href) {
-    locationHref = href;
+function setLocationHref(href) {
+  locationHref = href;
 }
 
 function searchAnimations() {
-    if (standalone === true) {
-        animationManager.searchAnimations(animationData, standalone, renderer);
-    } else {
-        animationManager.searchAnimations();
-    }
+  if (standalone === true) {
+    animationManager.searchAnimations(animationData, standalone, renderer);
+  } else {
+    animationManager.searchAnimations();
+  }
 }
 
 function setSubframeRendering(flag) {
-    subframeEnabled = flag;
+  subframeEnabled = flag;
 }
 
 function loadAnimation(params) {
-    if (standalone === true) {
-        params.animationData = JSON.parse(animationData);
-    }
-    return animationManager.loadAnimation(params);
+  if (standalone === true) {
+    params.animationData = JSON.parse(animationData);
+  }
+  return animationManager.loadAnimation(params);
 }
 
 function setQuality(value) {
-    if (typeof value === 'string') {
-        switch (value) {
-            case 'high':
-                defaultCurveSegments = 200;
-                break;
-            case 'medium':
-                defaultCurveSegments = 50;
-                break;
-            case 'low':
-                defaultCurveSegments = 10;
-                break;
-        }
-    } else if (!isNaN(value) && value > 1) {
-        defaultCurveSegments = value;
+  if (typeof value === 'string') {
+    switch (value) {
+      case 'high':
+        defaultCurveSegments = 200;
+        break;
+      default:
+      case 'medium':
+        defaultCurveSegments = 50;
+        break;
+      case 'low':
+        defaultCurveSegments = 10;
+        break;
     }
-    if (defaultCurveSegments >= 50) {
-        roundValues(false);
-    } else {
-        roundValues(true);
-    }
+  } else if (!isNaN(value) && value > 1) {
+    defaultCurveSegments = value;
+  }
+  if (defaultCurveSegments >= 50) {
+    roundValues(false);
+  } else {
+    roundValues(true);
+  }
 }
 
 function inBrowser() {
-    return typeof navigator !== 'undefined';
+  return typeof navigator !== 'undefined';
 }
 
 function installPlugin(type, plugin) {
-    if (type === 'expressions') {
-        expressionsPlugin = plugin;
-    }
+  if (type === 'expressions') {
+    expressionsPlugin = plugin;
+  }
 }
 
 function getFactory(name) {
-    switch (name) {
-        case "propertyFactory":
-            return PropertyFactory;
-        case "shapePropertyFactory":
-            return ShapePropertyFactory;
-        case "matrix":
-            return Matrix;
-    }
+  switch (name) {
+    case 'propertyFactory':
+      return PropertyFactory;
+    case 'shapePropertyFactory':
+      return ShapePropertyFactory;
+    case 'matrix':
+      return Matrix;
+    default:
+      return null;
+  }
 }
 
 lottie.play = animationManager.play;
@@ -10208,7 +10811,7 @@
 lottie.loadAnimation = loadAnimation;
 lottie.setSubframeRendering = setSubframeRendering;
 lottie.resize = animationManager.resize;
-//lottie.start = start;
+// lottie.start = start;
 lottie.goToAndStop = animationManager.goToAndStop;
 lottie.destroy = animationManager.destroy;
 lottie.setQuality = setQuality;
@@ -10221,35 +10824,37 @@
 lottie.unmute = animationManager.unmute;
 lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
 lottie.__getFactory = getFactory;
-lottie.version = '5.7.5';
+lottie.version = '5.7.6';
 
 function checkReady() {
-    if (document.readyState === "complete") {
-        clearInterval(readyStateCheckInterval);
-        searchAnimations();
-    }
+  if (document.readyState === 'complete') {
+    clearInterval(readyStateCheckInterval);
+    searchAnimations();
+  }
 }
 
 function getQueryVariable(variable) {
-    var vars = queryString.split('&');
-    for (var i = 0; i < vars.length; i++) {
-        var pair = vars[i].split('=');
-        if (decodeURIComponent(pair[0]) == variable) {
-            return decodeURIComponent(pair[1]);
-        }
+  var vars = queryString.split('&');
+  for (var i = 0; i < vars.length; i += 1) {
+    var pair = vars[i].split('=');
+    if (decodeURIComponent(pair[0]) == variable) { // eslint-disable-line eqeqeq
+      return decodeURIComponent(pair[1]);
     }
+  }
+  return null;
 }
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
+var queryString;
 if (standalone) {
-    var scripts = document.getElementsByTagName('script');
-    var index = scripts.length - 1;
-    var myScript = scripts[index] || {
-        src: ''
-    };
-    var queryString = myScript.src.replace(/^[^\?]+\??/, '');
-    renderer = getQueryVariable('renderer');
+  var scripts = document.getElementsByTagName('script');
+  var index = scripts.length - 1;
+  var myScript = scripts[index] || {
+    src: '',
+  };
+  queryString = myScript.src.replace(/^[^\?]+\??/, ''); // eslint-disable-line no-useless-escape
+  renderer = getQueryVariable('renderer');
 }
 var readyStateCheckInterval = setInterval(checkReady, 100);
 
diff --git a/build/player/lottie_light_canvas.min.js b/build/player/lottie_light_canvas.min.js
index 13698df..261ec93 100644
--- a/build/player/lottie_light_canvas.min.js
+++ b/build/player/lottie_light_canvas.min.js
@@ -10,6 +10,6 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";var h,k="",s=-999999,e=!0,n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),_=(Math.round,Math.pow),C=Math.sqrt,f=(Math.abs,Math.floor),m=(Math.max,Math.min),i={};!function(){var t,e=["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"],s=e.length;for(t=0;t<s;t+=1)i[e[t]]=Math[e[t]]}(),i.random=Math.random,i.abs=function(t){if("object"===typeof t&&t.length){var e,s=x(t.length),i=t.length;for(e=0;e<i;e+=1)s[e]=Math.abs(t[e]);return s}return Math.abs(t)};var D=150,B=Math.PI/180,v=.5519;function a(t){t?Math.round:function(t){return t}}function r(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function o(t,e){this.type=t,this.direction=e<0?-1:1}function l(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}function p(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function d(t,e){this.type=t,this.target=e}function c(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function u(t){this.type="configError",this.nativeError=t}a(!1);var t,S=(t=0,function(){return"__lottie_element_"+ ++t});function g(t,e,s){var i,a,r,n,h,o,l,p;switch(o=s*(1-e),l=s*(1-(h=6*t-(n=Math.floor(6*t)))*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function y(t,e,s){var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function lt(t,e){var s=y(255*t[0],255*t[1],255*t[2]);return s[1]+=e,1<s[1]?s[1]=1:s[1]<=0&&(s[1]=0),g(s[0],s[1],s[2])}function pt(t,e){var s=y(255*t[0],255*t[1],255*t[2]);return s[2]+=e,1<s[2]?s[2]=1:s[2]<0&&(s[2]=0),g(s[0],s[1],s[2])}function ft(t,e){var s=y(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,1<s[0]?s[0]-=1:s[0]<0&&(s[0]+=1),g(s[0],s[1],s[2])}!function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1==e.length?"0"+e:e}();function b(){}b.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;i<s;i++)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s-=1,i-=1),s+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var j="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var s,i=0,a=[];switch(t){case"int16":case"uint8c":s=1;break;default:s=1.1}for(i=0;i<e;i+=1)a.push(s);return a};function x(t){return Array.apply(null,{length:t})}function P(t){return document.createElement(t)}function w(){}w.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var T,A=(T={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return T[t]||""}),E=function(){var a=Math.cos,r=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function s(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var s=a(e),i=r(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}function m(t,e,s){return s||0===s||(s=1),1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}function d(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=a,this.props[5]=r,this.props[6]=n,this.props[7]=h,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=d,this.props[14]=c,this.props[15]=u,this}function c(t,e,s){return s=s||0,0!==t||0!==e||0!==s?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1):this}function u(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){var g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===a&&1===r&&0===n&&0===h&&0===o&&0===l&&1===p&&0===f)return g[12]=g[12]*t+g[15]*m,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*c,g[15]=g[15]*u,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],_=g[3],C=g[4],k=g[5],D=g[6],S=g[7],x=g[8],P=g[9],w=g[10],T=g[11],A=g[12],F=g[13],M=g[14],I=g[15];return g[0]=y*t+v*a+b*o+_*m,g[1]=y*e+v*r+b*l+_*d,g[2]=y*s+v*n+b*p+_*c,g[3]=y*i+v*h+b*f+_*u,g[4]=C*t+k*a+D*o+S*m,g[5]=C*e+k*r+D*l+S*d,g[6]=C*s+k*n+D*p+S*c,g[7]=C*i+k*h+D*f+S*u,g[8]=x*t+P*a+w*o+T*m,g[9]=x*e+P*r+w*l+T*d,g[10]=x*s+P*n+w*p+T*c,g[11]=x*i+P*h+w*f+T*u,g[12]=A*t+F*a+M*o+I*m,g[13]=A*e+F*r+M*l+I*d,g[14]=A*s+F*n+M*p+I*c,g[15]=A*i+F*h+M*f+I*u,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function _(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}function C(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function k(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function D(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function S(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,a=this.props[0]/t,r=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,h=new E;return h.props[0]=e,h.props[1]=s,h.props[4]=i,h.props[5]=a,h.props[12]=r,h.props[13]=n,h}function x(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function P(t){var e,s=t.length,i=[];for(e=0;e<s;e+=1)i[e]=x(t[e]);return i}function w(t,e,s){var i=j("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=s[0],i[5]=s[1];else{var a=this.props[0],r=this.props[1],n=this.props[4],h=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*a+t[1]*n+o,i[1]=t[0]*r+t[1]*h+l,i[2]=e[0]*a+e[1]*n+o,i[3]=e[0]*r+e[1]*h+l,i[4]=s[0]*a+s[1]*n+o,i[5]=s[0]*r+s[1]*h+l}return i}function T(t,e,s){return this.isIdentity()?[t,e,s]:[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}function A(t,e){if(this.isIdentity())return t+","+e;var s=this.props;return Math.round(100*(t*s[0]+e*s[4]+s[12]))/100+","+Math.round(100*(t*s[1]+e*s[5]+s[13]))/100}function F(){for(var t=0,e=this.props,s="matrix3d(";t<16;)s+=i(1e4*e[t])/1e4,s+=15===t?")":",",t+=1;return s}function M(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function I(){var t=this.props;return"matrix("+M(t[0])+","+M(t[1])+","+M(t[4])+","+M(t[5])+","+M(t[12])+","+M(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=s,this.rotateY=h,this.rotateZ=o,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=d,this.translate=c,this.transform=u,this.applyToPoint=_,this.applyToX=C,this.applyToY=k,this.applyToZ=D,this.applyToPointArray=T,this.applyToTriplePoints=w,this.applyToPointStringified=A,this.toCSS=F,this.to2dCSS=I,this.clone=v,this.cloneFromProps=b,this.equals=y,this.inversePoints=P,this.inversePoint=x,this.getInverseMatrix=S,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=j("float32",16),this.reset()}}();!function(h,o){var l,p=this,f=256,m=6,d="random",c=o.pow(f,m),u=o.pow(2,52),g=2*u,y=f-1;function v(t){var e,s=t.length,n=this,i=0,a=n.i=n.j=0,r=n.S=[];for(s||(t=[s++]);i<f;)r[i]=i++;for(i=0;i<f;i++)r[i]=r[a=y&a+t[i%s]+(e=r[i])],r[a]=e;n.g=function(t){for(var e,s=0,i=n.i,a=n.j,r=n.S;t--;)e=r[i=y&i+1],s=s*f+r[y&(r[i]=r[a=y&a+e])+(r[a]=e)];return n.i=i,n.j=a,s}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function _(t,e){for(var s,i=t+"",a=0;a<i.length;)e[y&a]=y&(s^=19*e[y&a])+i.charCodeAt(a++);return C(e)}function C(t){return String.fromCharCode.apply(0,t)}o["seed"+d]=function(t,e,s){var i=[],a=_(function t(e,s){var i,a=[],r=typeof e;if(s&&"object"==r)for(i in e)try{a.push(t(e[i],s-1))}catch(t){}return a.length?a:"string"==r?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,C(h)]:null===t?function(){try{if(l)return C(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),C(t)}catch(t){var e=p.navigator,s=e&&e.plugins;return[+new Date,p,s,p.screen,C(h)]}}():t,3),i),r=new v(i),n=function(){for(var t=r.g(m),e=c,s=0;t<u;)t=(t+s)*f,e*=f,s=r.g(1);for(;g<=t;)t/=2,e/=2,s>>>=1;return(t+s)/e};return n.int32=function(){return 0|r.g(4)},n.quick=function(){return r.g(4)/4294967296},n.double=n,_(C(r.S),h),(e.pass||s||function(t,e,s,i){return i&&(i.S&&b(i,r),t.state=function(){return b(r,{})}),s?(o[d]=t,e):t})(n,a,"global"in e?e.global:this==o,e.state)},_(o.random(),h)}([],i);var W=function(){var t={getBezierEasing:function(t,e,s,i,a){var r=a||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");if(h[r])return h[r];var n=new o([t,e,s,i]);return h[r]=n}},h={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function a(t,e){return 3*e-6*t}function r(t){return 3*t}function f(t,e,s){return((i(e,s)*t+a(e,s))*t+r(e))*t}function m(t,e,s){return 3*i(e,s)*t*t+2*a(e,s)*t+r(e)}function o(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return o.prototype={get:function(t){var e=this._p[0],s=this._p[1],i=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===s&&i===a?t:0===t?0:1===t?1:f(this._getTForX(t),s,a)},_precompute:function(){var t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&s===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;s<l;++s)this._mSampleValues[s]=f(s*p,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,a=0,r=1,n=l-1;r!==n&&i[r]<=t;++r)a+=p;var h=a+(t-i[--r])/(i[r+1]-i[r])*p,o=m(h,e,s);return.001<=o?function(t,e,s,i){for(var a=0;a<4;++a){var r=m(e,s,i);if(0===r)return e;e-=(f(e,s,i)-t)/r}return e}(t,h,e,s):0===o?h:function(t,e,s,i,a){for(var r,n,h=0;0<(r=f(n=e+(s-e)/2,i,a)-t)?s=n:e=n,1e-7<Math.abs(r)&&++h<10;);return n}(t,a,a+p,e,s)}},t}();function F(t,e){var s,i,a=t.length;for(s=0;s<a;s+=1)for(var r in i=t[s].prototype)i.hasOwnProperty(r)&&(e.prototype[r]=i[r])}!function(){for(var r=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var s=(new Date).getTime(),i=Math.max(0,16-(s-r)),a=setTimeout(function(){t(s+i)},i);return r=s+i,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var mt=function(){function g(t,e,s,i,a,r){var n=t*i+e*a+s*r-a*i-r*t-s*e;return-.001<n&&n<.001}Math;var p=function(t,e,s,i){var a,r,n,h,o,l,p=D,f=0,m=[],d=[],c=Pt.newElement();for(n=s.length,a=0;a<p;a+=1){for(o=a/(p-1),r=l=0;r<n;r+=1)h=_(1-o,3)*t[r]+3*_(1-o,2)*o*s[r]+3*(1-o)*_(o,2)*i[r]+_(o,3)*e[r],m[r]=h,null!==d[r]&&(l+=_(m[r]-d[r],2)),d[r]=m[r];l&&(f+=l=C(l)),c.percents[a]=o,c.lengths[a]=f}return c.addedLength=f,c};function y(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,s,i){var a=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+s[0]+"_"+s[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!b[a]){var r,n,h,o,l,p,f,m=D,d=0,c=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&g(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&g(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var u=new y(m);for(h=s.length,r=0;r<m;r+=1){for(f=x(h),l=r/(m-1),n=p=0;n<h;n+=1)o=_(1-l,3)*t[n]+3*_(1-l,2)*l*(t[n]+s[n])+3*(1-l)*_(l,2)*(e[n]+i[n])+_(l,3)*e[n],f[n]=o,null!==c&&(p+=_(f[n]-c[n],2));d+=p=C(p),u.points[r]=new v(p,f),c=f}u.segmentLength=d,b[a]=u}return b[a]});function A(t,e){var s=e.percents,i=e.lengths,a=s.length,r=f((a-1)*t),n=t*e.addedLength,h=0;if(r===a-1||0===r||n===i[r])return s[r];for(var o=i[r]>n?-1:1,l=!0;l;)if(i[r]<=n&&i[r+1]>n?(h=(n-i[r])/(i[r+1]-i[r]),l=!1):r+=o,r<0||a-1<=r){if(r===a-1)return s[r];l=!1}return s[r]+(s[r+1]-s[r])*h}var F=j("float32",8);return{getSegmentsLength:function(t){var e,s=xt.newElement(),i=t.c,a=t.v,r=t.o,n=t.i,h=t._length,o=s.lengths,l=0;for(e=0;e<h-1;e+=1)o[e]=p(a[e],a[e+1],r[e],n[e+1]),l+=o[e].addedLength;return i&&h&&(o[e]=p(a[e],a[0],r[e],n[0]),l+=o[e].addedLength),s.totalLength=l,s},getNewSegment:function(t,e,s,i,a,r,n){var h,o=A(a=a<0?0:1<a?1:a,n),l=A(r=1<r?1:r,n),p=t.length,f=1-o,m=1-l,d=f*f*f,c=o*f*f*3,u=o*o*f*3,g=o*o*o,y=f*f*m,v=o*f*m+f*o*m+f*f*l,b=o*o*m+f*o*l+o*f*l,_=o*o*l,C=f*m*m,k=o*m*m+f*l*m+f*m*l,D=o*l*m+f*l*l+o*m*l,S=o*l*l,x=m*m*m,P=l*m*m+m*l*m+m*m*l,w=l*l*m+m*l*l+l*m*l,T=l*l*l;for(h=0;h<p;h+=1)F[4*h]=Math.round(1e3*(d*t[h]+c*s[h]+u*i[h]+g*e[h]))/1e3,F[4*h+1]=Math.round(1e3*(y*t[h]+v*s[h]+b*i[h]+_*e[h]))/1e3,F[4*h+2]=Math.round(1e3*(C*t[h]+k*s[h]+D*i[h]+S*e[h]))/1e3,F[4*h+3]=Math.round(1e3*(x*t[h]+P*s[h]+w*i[h]+T*e[h]))/1e3;return F},getPointInSegment:function(t,e,s,i,a,r){var n=A(a,r),h=1-n;return[Math.round(1e3*(h*h*h*t[0]+(n*h*h+h*n*h+h*h*n)*s[0]+(n*n*h+h*n*n+n*h*n)*i[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(h*h*h*t[1]+(n*h*h+h*n*h+h*h*n)*s[1]+(n*n*h+h*n*n+n*h*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:g,pointOnLine3D:function(t,e,s,i,a,r,n,h,o){if(0===s&&0===r&&0===o)return g(t,e,i,a,n,h);var l,p=Math.sqrt(Math.pow(i-t,2)+Math.pow(a-e,2)+Math.pow(r-s,2)),f=Math.sqrt(Math.pow(n-t,2)+Math.pow(h-e,2)+Math.pow(o-s,2)),m=Math.sqrt(Math.pow(n-i,2)+Math.pow(h-a,2)+Math.pow(o-r,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}();var M=function(){function m(t,e,s){var i,a,r,n,h,o,l,p=t.length;for(a=0;a<p;a+=1)if("ks"in(i=t[a])&&!i.completed){if(i.completed=!0,i.tt&&(t[a-1].td=i.tt),i.hasMask){var f=i.masksProperties;for(n=f.length,r=0;r<n;r+=1)if(f[r].pt.k.i)u(f[r].pt.k);else for(o=f[r].pt.k.length,h=0;h<o;h+=1)f[r].pt.k[h].s&&u(f[r].pt.k[h].s[0]),f[r].pt.k[h].e&&u(f[r].pt.k[h].e[0])}0===i.ty?(i.layers=d(i.refId,e),m(i.layers,e,s)):4===i.ty?c(i.shapes):5==i.ty&&(0!==(l=i).t.a.length||"m"in l.t.p||(l.singleShape=!0))}}function d(t,e){for(var s=0,i=e.length;s<i;){if(e[s].id===t)return e[s].layers.__used?JSON.parse(JSON.stringify(e[s].layers)):(e[s].layers.__used=!0,e[s].layers);s+=1}}function c(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)u(t[e].ks.k);else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&u(t[e].ks.k[s].s[0]),t[e].ks.k[s].e&&u(t[e].ks.k[s].e[0]);else"gr"==t[e].ty&&c(t[e].it)}function u(t){var e,s=t.i.length;for(e=0;e<s;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function h(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&void 0))}var o,s=function(){var i=[4,4,14];function a(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)5===t[e].ty&&(s=t[e],i=s.t.d,s.t.d={k:[{s:i,t:0}]})}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),i=(o=[4,7,99],function(t){if(t.chars&&!h(o,t.v)){var e,s,i,a,r,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(r=t.chars[e].data.shapes[0].it).length,s=0;s<i;s+=1)(a=r[s].ks.k).__converted||(u(r[s].ks.k),a.__converted=!0)}}),a=function(){var i=[4,1,9];function r(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)if("gr"===t[e].ty)r(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,s=0;s<i;s+=1)t[e].c.k[s].s&&(t[e].c.k[s].s[0]/=255,t[e].c.k[s].s[1]/=255,t[e].c.k[s].s[2]/=255,t[e].c.k[s].s[3]/=255),t[e].c.k[s].e&&(t[e].c.k[s].e[0]/=255,t[e].c.k[s].e[1]/=255,t[e].c.k[s].e[2]/=255,t[e].c.k[s].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function a(t){var e,s=t.length;for(e=0;e<s;e+=1)4===t[e].ty&&r(t[e].shapes)}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),r=function(){var i=[4,4,18];function l(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&(t[e].ks.k[s].s[0].c=t[e].closed),t[e].ks.k[s].e&&(t[e].ks.k[s].e[0].c=t[e].closed);else"gr"==t[e].ty&&l(t[e].it)}function a(t){var e,s,i,a,r,n,h=t.length;for(s=0;s<h;s+=1){if((e=t[s]).hasMask){var o=e.masksProperties;for(a=o.length,i=0;i<a;i+=1)if(o[i].pt.k.i)o[i].pt.k.c=o[i].cl;else for(n=o[i].pt.k.length,r=0;r<n;r+=1)o[i].pt.k[r].s&&(o[i].pt.k[r].s[0].c=o[i].cl),o[i].pt.k[r].e&&(o[i].pt.k[r].e[0].c=o[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}();var t={completeData:function(t,e){t.__complete||(a(t),s(t),i(t),r(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=a,t.checkChars=i,t.checkShapes=r,t.completeLayers=m,t}(),I=function(){var r={w:0,size:0,shapes:[]},t=[];function u(t,e){var s=P("span");s.style.fontFamily=e;var i=P("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);var a=i.offsetWidth;return i.style.fontFamily=function(t){var e,s=t.split(","),i=s.length,a=[];for(e=0;e<i;e+=1)"sans-serif"!==s[e]&&"monospace"!==s[e]&&a.push(s[e]);return a.join(",")}(t)+", "+e,{node:i,w:a,parent:s}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){this.chars||(this.chars=[]);var e,s,i,a=t.length,r=this.chars.length;for(e=0;e<a;e+=1){for(s=0,i=!1;s<r;)this.chars[s].style===t[e].style&&this.chars[s].fFamily===t[e].fFamily&&this.chars[s].ch===t[e].ch&&(i=!0),s+=1;i||(this.chars.push(t[e]),r+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var s,i,a,r,n=t.list,h=n.length,o=h;for(s=0;s<h;s+=1){var l,p,f=!0;if(n[s].loaded=!1,n[s].monoCase=u(n[s].fFamily,"monospace"),n[s].sansCase=u(n[s].fFamily,"sans-serif"),n[s].fPath){if("p"===n[s].fOrigin||3===n[s].origin){if(0<(l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[s].fFamily+'"], style[f-origin="3"][f-family="'+n[s].fFamily+'"]')).length&&(f=!1),f){var m=P("style");m.setAttribute("f-forigin",n[s].fOrigin),m.setAttribute("f-origin",n[s].origin),m.setAttribute("f-family",n[s].fFamily),m.type="text/css",m.innerText="@font-face {font-family: "+n[s].fFamily+"; font-style: normal; src: url('"+n[s].fPath+"');}",e.appendChild(m)}}else if("g"===n[s].fOrigin||1===n[s].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),p=0;p<l.length;p++)-1!==l[p].href.indexOf(n[s].fPath)&&(f=!1);if(f){var d=P("link");d.setAttribute("f-forigin",n[s].fOrigin),d.setAttribute("f-origin",n[s].origin),d.type="text/css",d.rel="stylesheet",d.href=n[s].fPath,document.body.appendChild(d)}}else if("t"===n[s].fOrigin||2===n[s].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),p=0;p<l.length;p++)n[s].fPath===l[p].src&&(f=!1);if(f){var c=P("link");c.setAttribute("f-forigin",n[s].fOrigin),c.setAttribute("f-origin",n[s].origin),c.setAttribute("rel","stylesheet"),c.setAttribute("href",n[s].fPath),e.appendChild(c)}}}else n[s].loaded=!0,o-=1;n[s].helper=(i=e,a=n[s],r=void 0,(r=createNS("text")).style.fontSize="100px",r.setAttribute("font-family",a.fFamily),r.setAttribute("font-style",a.fStyle),r.setAttribute("font-weight",a.fWeight),r.textContent="1",a.fClass?(r.style.fontFamily="inherit",r.setAttribute("class",a.fClass)):r.style.fontFamily=a.fFamily,i.appendChild(r),P("canvas").getContext("2d").font=a.fWeight+" "+a.fStyle+" 100px "+a.fFamily,r),n[s].cache={},this.fonts.push(n[s])}0===o?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,s){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),r},getFontByName:function(t){for(var e=0,s=this.fonts.length;e<s;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,s){var i=this.getFontByName(e),a=t.charCodeAt(0);if(!i.cache[a+1]){var r=i.helper;if(" "===t){r.textContent="|"+t+"|";var n=r.getComputedTextLength();r.textContent="||";var h=r.getComputedTextLength();i.cache[a+1]=(n-h)/100}else r.textContent=t,i.cache[a+1]=r.getComputedTextLength()/100}return i.cache[a+1]*s},checkLoadedFonts:function(){var t,e,s,i=this.fonts.length,a=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?a-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,s=this.fonts[t].monoCase.w,e.offsetWidth!==s?(a-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,s=this.fonts[t].sansCase.w,e.offsetWidth!==s&&(a-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==a&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),L=function(){var f=s,a=Math.abs;function m(t,e){var s,i=this.offsetTime;"multidimensional"===this.propType&&(s=j("float32",this.pv.length));for(var a,r,n,h,o,l,p,f,m=e.lastIndex,d=m,c=this.keyframes.length-1,u=!0;u;){if(a=this.keyframes[d],r=this.keyframes[d+1],d===c-1&&t>=r.t-i){a.h&&(a=r),m=0;break}if(r.t-i>t){m=d;break}d<c-1?d+=1:(m=0,u=!1)}var g,y,v,b,_,C,k,D,S,x,P=r.t-i,w=a.t-i;if(a.to){a.bezierData||(a.bezierData=mt.buildBezierData(a.s,r.s||a.e,a.to,a.ti));var T=a.bezierData;if(P<=t||t<w){var A=P<=t?T.points.length-1:0;for(h=T.points[A].point.length,n=0;n<h;n+=1)s[n]=T.points[A].point[n]}else{a.__fnct?f=a.__fnct:(f=W.getBezierEasing(a.o.x,a.o.y,a.i.x,a.i.y,a.n).get,a.__fnct=f),o=f((t-w)/(P-w));var F,M=T.segmentLength*o,I=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastPoint:0,u=!0,l=T.points.length;u;){if(I+=T.points[p].partialLength,0===M||0===o||p===T.points.length-1){for(h=T.points[p].point.length,n=0;n<h;n+=1)s[n]=T.points[p].point[n];break}if(I<=M&&M<I+T.points[p+1].partialLength){for(F=(M-I)/T.points[p+1].partialLength,h=T.points[p].point.length,n=0;n<h;n+=1)s[n]=T.points[p].point[n]+(T.points[p+1].point[n]-T.points[p].point[n])*F;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=I-T.points[p].partialLength,e._lastKeyframeIndex=d}}else{var E,L,R,V,N;if(c=a.s.length,g=r.s||a.e,this.sh&&1!==a.h)if(P<=t)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=w)s[0]=a.s[0],s[1]=a.s[1],s[2]=a.s[2];else{var z=q(a.s),O=q(g);y=s,v=function(t,e,s){var i,a,r,n,h,o=[],l=t[0],p=t[1],f=t[2],m=t[3],d=e[0],c=e[1],u=e[2],g=e[3];(a=l*d+p*c+f*u+m*g)<0&&(a=-a,d=-d,c=-c,u=-u,g=-g);h=1e-6<1-a?(i=Math.acos(a),r=Math.sin(i),n=Math.sin((1-s)*i)/r,Math.sin(s*i)/r):(n=1-s,s);return o[0]=n*l+h*d,o[1]=n*p+h*c,o[2]=n*f+h*u,o[3]=n*m+h*g,o}(z,O,(t-w)/(P-w)),b=v[0],_=v[1],C=v[2],k=v[3],D=Math.atan2(2*_*k-2*b*C,1-2*_*_-2*C*C),S=Math.asin(2*b*_+2*C*k),x=Math.atan2(2*b*k-2*_*C,1-2*b*b-2*C*C),y[0]=D/B,y[1]=S/B,y[2]=x/B}else for(d=0;d<c;d+=1)1!==a.h&&(o=P<=t?1:t<w?0:(a.o.x.constructor===Array?(a.__fnct||(a.__fnct=[]),a.__fnct[d]?f=a.__fnct[d]:(E=void 0===a.o.x[d]?a.o.x[0]:a.o.x[d],L=void 0===a.o.y[d]?a.o.y[0]:a.o.y[d],R=void 0===a.i.x[d]?a.i.x[0]:a.i.x[d],V=void 0===a.i.y[d]?a.i.y[0]:a.i.y[d],f=W.getBezierEasing(E,L,R,V).get,a.__fnct[d]=f)):a.__fnct?f=a.__fnct:(E=a.o.x,L=a.o.y,R=a.i.x,V=a.i.y,f=W.getBezierEasing(E,L,R,V).get,a.__fnct=f),f((t-w)/(P-w)))),g=r.s||a.e,N=1===a.h?a.s[d]:a.s[d]+(g[d]-a.s[d])*o,"multidimensional"===this.propType?s[d]=N:s=N}return e.lastIndex=m,s}function q(t){var e=t[0]*B,s=t[1]*B,i=t[2]*B,a=Math.cos(e/2),r=Math.cos(s/2),n=Math.cos(i/2),h=Math.sin(e/2),o=Math.sin(s/2),l=Math.sin(i/2);return[h*o*n+a*r*l,h*r*n+a*o*l,a*o*n-h*r*l,a*r*n-h*o*l]}function d(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=s&&s<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function c(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<a(this.v-e)&&(this.v=e,this._mdf=!0);else for(var s=0,i=this.v.length;s<i;)e=t[s]*this.mult,1e-5<a(this.v[s]-e)&&(this.v[s]=e,this._mdf=!0),s+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,s=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)s=this.effectsSequence[t](s);this.setVValue(s),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function g(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,s,i){this.propType="unidimensional",this.mult=s||1,this.data=e,this.v=s?e.k*s:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.addEffect=g}function h(t,e,s,i){this.propType="multidimensional",this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a,r=e.k.length;this.v=j("float32",r),this.pv=j("float32",r);j("float32",r);for(this.vel=j("float32",r),a=0;a<r;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=c,this.addEffect=g}function o(t,e,s,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.effectsSequence=[d.bind(this)],this.addEffect=g}function l(t,e,s,i){this.propType="multidimensional";var a,r,n,h,o,l=e.k.length;for(a=0;a<l-1;a+=1)e.k[a].to&&e.k[a].s&&e.k[a+1]&&e.k[a+1].s&&(r=e.k[a].s,n=e.k[a+1].s,h=e.k[a].to,o=e.k[a].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+h[0],r[1]+h[1],r[2]+h[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(e.k[a].to=null,e.k[a].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===h[0]&&0===h[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===n[2]&&0===h[2]&&0===o[2])&&(e.k[a].to=null,e.k[a].ti=null));this.effectsSequence=[d.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=j("float32",p),this.pv=j("float32",p),a=0;a<p;a+=1)this.v[a]=f,this.pv[a]=f;this._caching={lastFrame:f,lastIndex:0,value:j("float32",p)},this.addEffect=g}return{getProp:function(t,e,s,i,a){var r;if(e.k.length)if("number"==typeof e.k[0])r=new h(t,e,i,a);else switch(s){case 0:r=new o(t,e,i,a);break;case 1:r=new l(t,e,i,a)}else r=new n(t,e,i,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}}}(),R=function(){var n=[0,0];function i(t,e,s){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new E,this.pre=new E,this.appliedTransformations=0,this.initDynamicPropertyContainer(s||t),e.p&&e.p.s?(this.px=L.getProp(t,e.p.x,0,0,this),this.py=L.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=L.getProp(t,e.p.z,0,0,this))):this.p=L.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=L.getProp(t,e.rx,0,B,this),this.ry=L.getProp(t,e.ry,0,B,this),this.rz=L.getProp(t,e.rz,0,B,this),e.or.k[0].ti){var i,a=e.or.k.length;for(i=0;i<a;i+=1)e.or.k[i].to=e.or.k[i].ti=null}this.or=L.getProp(t,e.or,1,B,this),this.or.sh=!0}else this.r=L.getProp(t,e.r||{k:0},0,B,this);e.sk&&(this.sk=L.getProp(t,e.sk,0,B,this),this.sa=L.getProp(t,e.sa,0,B,this)),this.a=L.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=L.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=L.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,s,i=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)s=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],s=[];var a=this.px,r=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(e[0]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),e[1]=r.getValueAtTime((r.keyframes[0].t+.01)/i,0),s[0]=a.getValueAtTime(a.keyframes[0].t/i,0),s[1]=r.getValueAtTime(r.keyframes[0].t/i,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(e[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),e[1]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/i,0),s[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0),s[1]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/i,0)):(e=[a.pv,r.pv],s[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime),s[1]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/i,r.offsetTime))}else e=s=n;this.v.rotate(-Math.atan2(e[1]-s[1],e[0]-s[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},F([w],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=w.prototype.addDynamicProperty,{getTransformProperty:function(t,e,s){return new i(t,e,s)}}}();function V(){this.c=!1,this._length=0,this._maxLength=8,this.v=x(this._maxLength),this.o=x(this._maxLength),this.i=x(this._maxLength)}V.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var s=0;s<e;)this.v[s]=kt.newElement(),this.o[s]=kt.newElement(),this.i[s]=kt.newElement(),s+=1},V.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},V.prototype.doubleArrayLength=function(){this.v=this.v.concat(x(this._maxLength)),this.i=this.i.concat(x(this._maxLength)),this.o=this.o.concat(x(this._maxLength)),this._maxLength*=2},V.prototype.setXYAt=function(t,e,s,i,a){var r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o}(!r[i]||r[i]&&!a)&&(r[i]=kt.newElement()),r[i][0]=t,r[i][1]=e},V.prototype.setTripleAt=function(t,e,s,i,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(s,i,"o",n,h),this.setXYAt(a,r,"i",n,h)},V.prototype.reverse=function(){var t=new V;t.setPathData(this.c,this._length);var e=this.v,s=this.o,i=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],s[0][0],s[0][1],0,!1),a=1);var r,n=this._length-1,h=this._length;for(r=a;r<h;r+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],s[n][0],s[n][1],r,!1),n-=1;return t};var N,z,O=function(){var a=-999999;function t(t,e,s){var i,a,r,n,h,o,l,p,f,m=s.lastIndex,d=this.keyframes;if(t<d[0].t-this.offsetTime)i=d[0].s[0],r=!0,m=0;else if(t>=d[d.length-1].t-this.offsetTime)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var c,u,g=m,y=d.length-1,v=!0;v&&(c=d[g],!((u=d[g+1]).t-this.offsetTime>t));)g<y-1?g+=1:v=!1;if(m=g,!(r=1===c.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<c.t-this.offsetTime)p=0;else{var b;c.__fnct?b=c.__fnct:(b=W.getBezierEasing(c.o.x,c.o.y,c.i.x,c.i.y).get,c.__fnct=b),p=b((t-(c.t-this.offsetTime))/(u.t-this.offsetTime-(c.t-this.offsetTime)))}a=u.s?u.s[0]:c.e[0]}i=c.s[0]}for(o=e._length,l=i.i[0].length,s.lastIndex=m,n=0;n<o;n+=1)for(h=0;h<l;h+=1)f=r?i.i[n][h]:i.i[n][h]+(a.i[n][h]-i.i[n][h])*p,e.i[n][h]=f,f=r?i.o[n][h]:i.o[n][h]+(a.o[n][h]-i.o[n][h])*p,e.o[n][h]=f,f=r?i.v[n][h]:i.v[n][h]+(a.v[n][h]-i.v[n][h])*p,e.v[n][h]=f}function r(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var s,i=t._length;for(s=0;s<i;s+=1)if(t.v[s][0]!==e.v[s][0]||t.v[s][1]!==e.v[s][1]||t.o[s][0]!==e.o[s][0]||t.o[s][1]!==e.o[s][1]||t.i[s][0]!==e.i[s][0]||t.i[s][1]!==e.i[s][1])return!1;return!0})(this.v,t)||(this.v=Dt.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,s=this.effectsSequence.length;for(t=0;t<s;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,s){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===s?e.pt.k:e.ks.k;this.v=Dt.clone(i),this.pv=Dt.clone(this.v),this.localShapeCollection=St.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function h(t,e,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=Dt.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=Dt.clone(this.v),this.localShapeCollection=St.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=a,this.reset=r,this._caching={lastFrame:a,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==a&&(i<e&&t<e||s<i&&s<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=s,n.prototype.setVValue=e,n.prototype.addEffect=i,h.prototype.getValue=s,h.prototype.interpolateShape=t,h.prototype.setVValue=e,h.prototype.addEffect=i;var o=function(){var n=v;function t(t,e){this.v=Dt.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=St.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=L.getProp(t,e.p,1,0,this),this.s=L.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=3!==this.d,r=this.v;r.v[0][0]=t,r.v[0][1]=e-i,r.v[1][0]=a?t+s:t-s,r.v[1][1]=e,r.v[2][0]=t,r.v[2][1]=e+i,r.v[3][0]=a?t-s:t+s,r.v[3][1]=e,r.i[0][0]=a?t-s*n:t+s*n,r.i[0][1]=e-i,r.i[1][0]=a?t+s:t-s,r.i[1][1]=e-i*n,r.i[2][0]=a?t+s*n:t-s*n,r.i[2][1]=e+i,r.i[3][0]=a?t-s:t+s,r.i[3][1]=e+i*n,r.o[0][0]=a?t+s*n:t-s*n,r.o[0][1]=e-i,r.o[1][0]=a?t+s:t-s,r.o[1][1]=e+i*n,r.o[2][0]=a?t-s*n:t+s*n,r.o[2][1]=e+i,r.o[3][0]=a?t-s:t+s,r.o[3][1]=e-i*n}},F([w],t),t}(),l=function(){function t(t,e){this.v=Dt.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=L.getProp(t,e.ir,0,0,this),this.is=L.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=L.getProp(t,e.pt,0,0,this),this.p=L.getProp(t,e.p,1,0,this),this.r=L.getProp(t,e.r,0,B,this),this.or=L.getProp(t,e.or,0,0,this),this.os=L.getProp(t,e.os,0,.01,this),this.localShapeCollection=St.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,s,i,a=2*Math.floor(this.pt.v),r=2*Math.PI/a,n=!0,h=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*h/(2*a),m=2*Math.PI*o/(2*a),d=-Math.PI/2;d+=this.r.v;var c=3===this.data.d?-1:1;for(t=this.v._length=0;t<a;t+=1){s=n?l:p,i=n?f:m;var u=(e=n?h:o)*Math.cos(d),g=e*Math.sin(d),y=0===u&&0===g?0:g/Math.sqrt(u*u+g*g),v=0===u&&0===g?0:-u/Math.sqrt(u*u+g*g);u+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(u,g,u-y*i*s*c,g-v*i*s*c,u+y*i*s*c,g+v*i*s*c,t,!0),n=!n,d+=r*c}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),s=2*Math.PI/e,i=this.or.v,a=this.os.v,r=2*Math.PI*i/(4*e),n=-Math.PI/2,h=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var o=i*Math.cos(n),l=i*Math.sin(n),p=0===o&&0===l?0:l/Math.sqrt(o*o+l*l),f=0===o&&0===l?0:-o/Math.sqrt(o*o+l*l);o+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(o,l,o-p*r*a*h,l-f*r*a*h,o+p*r*a*h,l+f*r*a*h,t,!0),n+=s*h}this.paths.length=0,this.paths[0]=this.v}},F([w],t),t}(),p=function(){function t(t,e){this.v=Dt.newElement(),this.v.c=!0,this.localShapeCollection=St.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=L.getProp(t,e.p,1,0,this),this.s=L.getProp(t,e.s,1,0,this),this.r=L.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=m(s,i,this.r.v),r=a*(1-v);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+a,t+s,e-i+r,0,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-r,t+s,e+i-a,1,!0),0!==a?(this.v.setTripleAt(t+s-a,e+i,t+s-a,e+i,t+s-r,e+i,2,!0),this.v.setTripleAt(t-s+a,e+i,t-s+r,e+i,t-s+a,e+i,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-a,t-s,e+i-r,4,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+r,t-s,e-i+a,5,!0),this.v.setTripleAt(t-s+a,e-i,t-s+a,e-i,t-s+r,e-i,6,!0),this.v.setTripleAt(t+s-a,e-i,t+s-r,e-i,t+s-a,e-i,7,!0)):(this.v.setTripleAt(t-s,e+i,t-s+r,e+i,t-s,e+i,2),this.v.setTripleAt(t-s,e-i,t-s,e-i+r,t-s,e-i,3))):(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+r,t+s,e-i+a,0,!0),0!==a?(this.v.setTripleAt(t+s-a,e-i,t+s-a,e-i,t+s-r,e-i,1,!0),this.v.setTripleAt(t-s+a,e-i,t-s+r,e-i,t-s+a,e-i,2,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+a,t-s,e-i+r,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-r,t-s,e+i-a,4,!0),this.v.setTripleAt(t-s+a,e+i,t-s+a,e+i,t-s+r,e+i,5,!0),this.v.setTripleAt(t+s-a,e+i,t+s-r,e+i,t+s-a,e+i,6,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-a,t+s,e+i-r,7,!0)):(this.v.setTripleAt(t-s,e-i,t-s+r,e-i,t-s,e-i,1,!0),this.v.setTripleAt(t-s,e+i,t-s,e+i-r,t-s,e+i,2,!0),this.v.setTripleAt(t+s,e+i,t+s-r,e+i,t+s,e+i,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:r},F([w],t),t}();var f={getShapeProp:function(t,e,s){var i;return 3===s||4===s?i=(3===s?e.pt:e.ks).k.length?new h(t,e,s):new n(t,e,s):5===s?i=new p(t,e):6===s?i=new o(t,e):7===s&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return h}};return f}(),q=(z={},(N={}).registerModifier=function(t,e){z[t]||(z[t]=e)},N.getModifier=function(t,e,s){return new z[t](e,s)},N);function Y(){}function G(){}function X(){}function H(){}function K(){}function J(){this._length=0,this._maxLength=4,this.shapes=x(this._maxLength)}function Z(t,e,s,i){this.elem=t,this.frameId=-1,this.dataProps=x(e.length),this.renderer=s,this.k=!1,this.dashStr="",this.dashArray=j("float32",e.length?e.length-1:0),this.dashoffset=j("float32",1),this.initDynamicPropertyContainer(i);var a,r,n=e.length||0;for(a=0;a<n;a+=1)r=L.getProp(t,e[a].v,0,0,this),this.k=r.k||this.k,this.dataProps[a]={n:e[a].n,p:r};this.k||this.getValue(!0),this._isAnimated=this.k}function U(t,e,s){this.data=e,this.c=j("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=j("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=L.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}Y.prototype.initModifierProperties=function(){},Y.prototype.addShapeToModifier=function(){},Y.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:St.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},Y.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=s,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},Y.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},F([w],Y),F([Y],G),G.prototype.initModifierProperties=function(t,e){this.s=L.getProp(t,e.s,0,.01,this),this.e=L.getProp(t,e.e,0,.01,this),this.o=L.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},G.prototype.addShapeToModifier=function(t){t.pathsData=[]},G.prototype.calculateShapeEdges=function(t,e,s,i,a){var r=[];e<=1?r.push({s:t,e:e}):1<=t?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],l=r.length;for(n=0;n<l;n+=1){var p,f;if((h=r[n]).e*a<i||h.s*a>i+s);else p=h.s*a<=i?0:(h.s*a-i)/s,f=h.e*a>=i+s?1:(h.e*a-i)/s,o.push([p,f])}return o.length||o.push([0,0]),o},G.prototype.releasePathsData=function(t){var e,s=t.length;for(e=0;e<s;e+=1)xt.release(t[e]);return t.length=0,t},G.prototype.processShapes=function(t){var e,s,i;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+a,(s=(1<this.e.v?1:this.e.v<0?0:this.e.v)+a)<e){var r=e;e=s,s=r}e=1e-4*Math.round(1e4*e),s=1e-4*Math.round(1e4*s),this.sValue=e,this.eValue=s}else e=this.sValue,s=this.eValue;var n,h,o,l,p,f,m=this.shapes.length,d=0;if(s===e)for(n=0;n<m;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===s&&0===e||0===s&&1===e){if(this._mdf)for(n=0;n<m;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var c,u,g=[];for(n=0;n<m;n+=1)if((c=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(o=(i=c.shape.paths)._length,f=0,!c.shape._mdf&&c.pathsData.length)f=c.totalShapeLength;else{for(l=this.releasePathsData(c.pathsData),h=0;h<o;h+=1)p=mt.getSegmentsLength(i.shapes[h]),l.push(p),f+=p.totalLength;c.totalShapeLength=f,c.pathsData=l}d+=f,c.shape._mdf=!0}else c.shape.paths=c.localShapeCollection;var y,v=e,b=s,_=0;for(n=m-1;0<=n;n-=1)if((c=this.shapes[n]).shape._mdf){for((u=c.localShapeCollection).releaseShapes(),2===this.m&&1<m?(y=this.calculateShapeEdges(e,s,c.totalShapeLength,_,d),_+=c.totalShapeLength):y=[[v,b]],o=y.length,h=0;h<o;h+=1){v=y[h][0],b=y[h][1],g.length=0,b<=1?g.push({s:c.totalShapeLength*v,e:c.totalShapeLength*b}):1<=v?g.push({s:c.totalShapeLength*(v-1),e:c.totalShapeLength*(b-1)}):(g.push({s:c.totalShapeLength*v,e:c.totalShapeLength}),g.push({s:0,e:c.totalShapeLength*(b-1)}));var C=this.addShapes(c,g[0]);if(g[0].s!==g[0].e){if(1<g.length)if(c.shape.paths.shapes[c.shape.paths._length-1].c){var k=C.pop();this.addPaths(C,u),C=this.addShapes(c,g[1],k)}else this.addPaths(C,u),C=this.addShapes(c,g[1]);this.addPaths(C,u)}}c.shape.paths=u}}},G.prototype.addPaths=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e.addShape(t[s])},G.prototype.addSegment=function(t,e,s,i,a,r,n){a.setXYAt(e[0],e[1],"o",r),a.setXYAt(s[0],s[1],"i",r+1),n&&a.setXYAt(t[0],t[1],"v",r),a.setXYAt(i[0],i[1],"v",r+1)},G.prototype.addSegmentFromArray=function(t,e,s,i){e.setXYAt(t[1],t[5],"o",s),e.setXYAt(t[2],t[6],"i",s+1),i&&e.setXYAt(t[0],t[4],"v",s),e.setXYAt(t[3],t[7],"v",s+1)},G.prototype.addShapes=function(t,e,s){var i,a,r,n,h,o,l,p,f=t.pathsData,m=t.shape.paths.shapes,d=t.shape.paths._length,c=0,u=[],g=!0;for(p=s?(h=s._length,s._length):(s=Dt.newElement(),h=0),u.push(s),i=0;i<d;i+=1){for(o=f[i].lengths,s.c=m[i].c,r=m[i].c?o.length:o.length+1,a=1;a<r;a+=1)if(c+(n=o[a-1]).addedLength<e.s)c+=n.addedLength,s.c=!1;else{if(c>e.e){s.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[a],m[i].v[a],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[a],m[i].o[a-1],m[i].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1),c+=n.addedLength,h+=1}if(m[i].c&&o.length){if(n=o[a-1],c<=e.e){var y=o[a-1].addedLength;e.s<=c&&e.e>=c+y?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[0],m[i].v[0],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[0],m[i].o[a-1],m[i].i[0],(e.s-c)/y,(e.e-c)/y,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1)}else s.c=!1;c+=n.addedLength,h+=1}if(s._length&&(s.setXYAt(s.v[p][0],s.v[p][1],"i",p),s.setXYAt(s.v[s._length-1][0],s.v[s._length-1][1],"o",s._length-1)),c>e.e)break;i<d-1&&(s=Dt.newElement(),g=!0,u.push(s),h=0)}return u},q.registerModifier("tm",G),F([Y],X),X.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=L.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},X.prototype.processPath=function(t,e){var s=Dt.newElement();s.c=t.c;var i,a,r,n,h,o,l,p,f,m,d,c,u,g=t._length,y=0;for(i=0;i<g;i+=1)a=t.v[i],n=t.o[i],r=t.i[i],a[0]===n[0]&&a[1]===n[1]&&a[0]===r[0]&&a[1]===r[1]?0!==i&&i!==g-1||t.c?(h=0===i?t.v[g-1]:t.v[i-1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=c=a[0]+(h[0]-a[0])*l,f=u=a[1]-(a[1]-h[1])*l,m=p-(p-a[0])*v,d=f-(f-a[1])*v,s.setTripleAt(p,f,m,d,c,u,y),y+=1,h=i===g-1?t.v[0]:t.v[i+1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=m=a[0]+(h[0]-a[0])*l,f=d=a[1]+(h[1]-a[1])*l,c=p-(p-a[0])*v,u=f-(f-a[1])*v,s.setTripleAt(p,f,m,d,c,u,y)):s.setTripleAt(a[0],a[1],n[0],n[1],r[0],r[1],y):s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],y),y+=1;return s},X.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.rd.v;if(0!==o)for(s=0;s<h;s+=1){if((r=this.shapes[s]).shape.paths,n=r.localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},q.registerModifier("rd",X),F([Y],H),H.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=L.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},H.prototype.processPath=function(t,e){var s=e/100,i=[0,0],a=t._length,r=0;for(r=0;r<a;r+=1)i[0]+=t.v[r][0],i[1]+=t.v[r][1];i[0]/=a,i[1]/=a;var n,h,o,l,p,f,m=Dt.newElement();for(m.c=t.c,r=0;r<a;r+=1)n=t.v[r][0]+(i[0]-t.v[r][0])*s,h=t.v[r][1]+(i[1]-t.v[r][1])*s,o=t.o[r][0]+(i[0]-t.o[r][0])*-s,l=t.o[r][1]+(i[1]-t.o[r][1])*-s,p=t.i[r][0]+(i[0]-t.i[r][0])*-s,f=t.i[r][1]+(i[1]-t.i[r][1])*-s,m.setTripleAt(n,h,o,l,p,f,r);return m},H.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.amount.v;if(0!==o)for(s=0;s<h;s+=1){if((r=this.shapes[s]).shape.paths,n=r.localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},q.registerModifier("pb",H),F([Y],K),K.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=L.getProp(t,e.c,0,null,this),this.o=L.getProp(t,e.o,0,null,this),this.tr=R.getTransformProperty(t,e.tr,this),this.so=L.getProp(t,e.tr.so,0,.01,this),this.eo=L.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new E,this.rMatrix=new E,this.sMatrix=new E,this.tMatrix=new E,this.matrix=new E},K.prototype.applyTransforms=function(t,e,s,i,a,r){var n=r?-1:1,h=i.s.v[0]+(1-i.s.v[0])*(1-a),o=i.s.v[1]+(1-i.s.v[1])*(1-a);t.translate(i.p.v[0]*n*a,i.p.v[1]*n*a,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*a),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.scale(r?1/h:h,r?1/o:o),s.translate(i.a.v[0],i.a.v[1],i.a.v[2])},K.prototype.init=function(t,e,s,i){this.elem=t,this.arr=e,this.pos=s,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[s]);for(;0<s;)s-=1,this._elements.unshift(e[s]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},K.prototype.resetElements=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},K.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},K.prototype.changeGroupRender=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]._render=e,"gr"===t[s].ty&&this.changeGroupRender(t[s].it,e)},K.prototype.processShapes=function(t){var e,s,i,a,r;if(this._mdf||t){var n,h=Math.ceil(this.c.v);if(this._groups.length<h){for(;this._groups.length<h;){var o={it:this.cloneElements(this._elements),ty:"gr"};o.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,o),this._groups.splice(0,0,o),this._currentCopies+=1}this.elem.reloadShapes()}for(i=r=0;i<=this._groups.length-1;i+=1)n=r<h,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),r+=1;this._currentCopies=h;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=(this.tr.v.props,this.pMatrix.props),d=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,g,y=0;if(0<l){for(;y<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),y+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),y+=p)}else if(l<0){for(;f<y;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),y-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),y-=p)}for(i=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,r=this._currentCopies;r;){if(g=(s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==y){for((0!==i&&1===a||i!==this._currentCopies-1&&-1===a)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),u=0;u<g;u+=1)s[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<g;u+=1)s[u]=this.matrix.props[u];y+=1,r-=1,i+=a}}else for(r=this._currentCopies,i=0,a=1;r;)s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,r-=1,i+=a},K.prototype.addShape=function(){},q.registerModifier("rp",K),J.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(x(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},J.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)Dt.release(this.shapes[t]);this._length=0},Z.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,s=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<s;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},F([w],Z),U.prototype.comparePoints=function(t,e){for(var s=0,i=this.o.length/2;s<i;){if(.01<Math.abs(t[4*s]-t[4*e+2*s]))return!1;s+=1}return!0},U.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},U.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,s,i,a=4*this.data.p;for(e=0;e<a;e+=1)s=e%4==0?100:255,i=Math.round(this.prop.v[e]*s),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(a=this.prop.v.length,e=4*this.data.p;e<a;e+=1)s=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},F([w],U);var Q,$,tt=function(t,e,s,i){if(0===e)return"";var a,r=t.o,n=t.i,h=t.v,o=" M"+i.applyToPointStringified(h[0][0],h[0][1]);for(a=1;a<e;a+=1)o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[a][0],n[a][1])+" "+i.applyToPointStringified(h[a][0],h[a][1]);return s&&e&&(o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(h[0][0],h[0][1]),o+="z"),o},et=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,s=this.audios.length;for(e=0;e<s;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(t){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),st=function(){var a=function(){var t=P("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(t,e,s){var i="";if(t.e)i=t.p;else if(e){var a=t.p;-1!==a.indexOf("images/")&&(a=a.split("/")[1]),i=e+a}else i=s,i+=t.u?t.u:"",i+=t.p;return i}function t(t){this._imageLoaded=e.bind(this),this.testImageLoaded=function(t){var e=0,s=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(s)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return t.prototype={loadAssets:function(t,e){this.imagesLoadedCb=e;var s,i=t.length;for(s=0;s<i;s+=1)t[s].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[s])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,s=this.images.length;e<s;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}},createImgData:function(t){var e=r(t,this.assetsPath,this.path),s=P("img");s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.src=e;var i={img:s,assetData:t};return i},createImageData:function(t){var e=r(t,this.assetsPath,this.path),s=createNS("image");n?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(s);var i={img:s,assetData:t};return i},imageLoaded:e,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},t}(),it=(Q={maskType:!0},(/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))&&(Q.maskType=!1),Q),at=(($={}).createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},$.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},$),rt=function(){function r(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,s){var i,a=new XMLHttpRequest;a.open("GET",t,!0);try{a.responseType="json"}catch(t){}a.send(),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status)i=r(a),e(i);else try{i=r(a),e(i)}catch(t){s&&s(t)}}}}}();function nt(t,e,s){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=x(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(s)}function ht(t,e,s){var i={propType:!1},a=L.getProp,r=e.a;this.a={r:r.r?a(t,r.r,0,B,s):i,rx:r.rx?a(t,r.rx,0,B,s):i,ry:r.ry?a(t,r.ry,0,B,s):i,sk:r.sk?a(t,r.sk,0,B,s):i,sa:r.sa?a(t,r.sa,0,B,s):i,s:r.s?a(t,r.s,1,.01,s):i,a:r.a?a(t,r.a,1,0,s):i,o:r.o?a(t,r.o,0,.01,s):i,p:r.p?a(t,r.p,1,0,s):i,sw:r.sw?a(t,r.sw,0,0,s):i,sc:r.sc?a(t,r.sc,1,0,s):i,fc:r.fc?a(t,r.fc,1,0,s):i,fh:r.fh?a(t,r.fh,0,0,s):i,fs:r.fs?a(t,r.fs,0,.01,s):i,fb:r.fb?a(t,r.fb,0,.01,s):i,t:r.t?a(t,r.t,0,0,s):i},this.s=bt.getTextSelectorProp(t,e.s,s),this.s.t=e.s.t}function dt(t,e,s,i,a,r){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=a,this.p=r,this._mdf={o:!0,sw:!!e,sc:!!s,fc:!!i,m:!0,p:!0}}function ot(t,e){this._frameId=s,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}nt.prototype.searchProperties=function(){var t,e,s=this._textData.a.length,i=L.getProp;for(t=0;t<s;t+=1)e=this._textData.a[t],this._animatorsData[t]=new ht(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},nt.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var s,i,a,r,n,h,o,l,p,f,m,d,c,u,g,y,v,b,_,C=this._moreOptions.alignment.v,k=this._animatorsData,D=this._textData,S=this.mHelper,x=this._renderType,P=this.renderedLetters.length,w=(this.data,t.l);if(this._hasMaskedPath){if(_=this._pathData.m,!this._pathData.n||this._pathData._mdf){var T,A=_.v;for(this._pathData.r&&(A=A.reverse()),n={tLength:0,segments:[]},r=A._length-1,a=y=0;a<r;a+=1)T=mt.buildBezierData(A.v[a],A.v[a+1],[A.o[a][0]-A.v[a][0],A.o[a][1]-A.v[a][1]],[A.i[a+1][0]-A.v[a+1][0],A.i[a+1][1]-A.v[a+1][1]]),n.tLength+=T.segmentLength,n.segments.push(T),y+=T.segmentLength;a=r,_.v.c&&(T=mt.buildBezierData(A.v[a],A.v[0],[A.o[a][0]-A.v[a][0],A.o[a][1]-A.v[a][1]],[A.i[0][0]-A.v[0][0],A.i[0][1]-A.v[0][1]]),n.tLength+=T.segmentLength,n.segments.push(T),y+=T.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,h=this._pathData.f.v,f=1,p=!(l=m=0),u=n.segments,h<0&&_.v.c)for(n.tLength<Math.abs(h)&&(h=-Math.abs(h)%n.tLength),f=(c=u[m=u.length-1].points).length-1;h<0;)h+=c[f].partialLength,(f-=1)<0&&(f=(c=u[m-=1].points).length-1);d=(c=u[m].points)[f-1],g=(o=c[f]).partialLength}r=w.length,i=s=0;var F,M,I,E,L=1.2*t.finalSize*.714,R=!0;I=k.length;var V,N,z,O,q,B,j,W,Y,G,X,H,K,J=-1,Z=h,U=m,Q=f,$=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var st=0,it=0,at=2===t.j?-.5:-1,rt=0,nt=!0;for(a=0;a<r;a+=1)if(w[a].n){for(st&&(st+=it);rt<a;)w[rt].animatorJustifyOffset=st,rt+=1;nt=!(st=0)}else{for(M=0;M<I;M+=1)(F=k[M].a).t.propType&&(nt&&2===t.j&&(it+=F.t.v*at),(V=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?st+=F.t.v*V[0]*at:st+=F.t.v*V*at);nt=!1}for(st&&(st+=it);rt<a;)w[rt].animatorJustifyOffset=st,rt+=1}for(a=0;a<r;a+=1){if(S.reset(),q=1,w[a].n)s=0,i+=t.yOffset,i+=R?1:0,h=Z,R=!1,0,this._hasMaskedPath&&(f=Q,d=(c=u[m=U].points)[f-1],g=(o=c[f]).partialLength,l=0),K=G=H=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if($!==w[a].line){switch(t.j){case 1:h+=y-t.lineWidths[w[a].line];break;case 2:h+=(y-t.lineWidths[w[a].line])/2}$=w[a].line}J!==w[a].ind&&(w[J]&&(h+=w[J].extra),h+=w[a].an/2,J=w[a].ind),h+=C[0]*w[a].an/200;var ht=0;for(M=0;M<I;M+=1)(F=k[M].a).p.propType&&((V=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?ht+=F.p.v[0]*V[0]:ht+=F.p.v[0]*V),F.a.propType&&((V=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?ht+=F.a.v[0]*V[0]:ht+=F.a.v[0]*V);for(p=!0;p;)h+ht<=l+g||!c?(v=(h+ht-l)/o.partialLength,z=d.point[0]+(o.point[0]-d.point[0])*v,O=d.point[1]+(o.point[1]-d.point[1])*v,S.translate(-C[0]*w[a].an/200,-C[1]*L/100),p=!1):c&&(l+=o.partialLength,(f+=1)>=c.length&&(f=0,c=u[m+=1]?u[m].points:_.v.c?u[m=f=0].points:(l-=o.partialLength,null)),c&&(d=o,g=(o=c[f]).partialLength));N=w[a].an/2-w[a].add,S.translate(-N,0,0)}else N=w[a].an/2-w[a].add,S.translate(-N,0,0),S.translate(-C[0]*w[a].an/200,-C[1]*L/100,0);for(w[a].l/2,M=0;M<I;M+=1)(F=k[M].a).t.propType&&(V=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars),0===s&&0===t.j||(this._hasMaskedPath?V.length?h+=F.t.v*V[0]:h+=F.t.v*V:V.length?s+=F.t.v*V[0]:s+=F.t.v*V));for(w[a].l/2,t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(B=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(W=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<I;M+=1)(F=k[M].a).a.propType&&((V=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?S.translate(-F.a.v[0]*V[0],-F.a.v[1]*V[1],F.a.v[2]*V[2]):S.translate(-F.a.v[0]*V,-F.a.v[1]*V,F.a.v[2]*V));for(M=0;M<I;M+=1)(F=k[M].a).s.propType&&((V=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?S.scale(1+(F.s.v[0]-1)*V[0],1+(F.s.v[1]-1)*V[1],1):S.scale(1+(F.s.v[0]-1)*V,1+(F.s.v[1]-1)*V,1));for(M=0;M<I;M+=1){if(F=k[M].a,V=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars),F.sk.propType&&(V.length?S.skewFromAxis(-F.sk.v*V[0],F.sa.v*V[1]):S.skewFromAxis(-F.sk.v*V,F.sa.v*V)),F.r.propType&&(V.length?S.rotateZ(-F.r.v*V[2]):S.rotateZ(-F.r.v*V)),F.ry.propType&&(V.length?S.rotateY(F.ry.v*V[1]):S.rotateY(F.ry.v*V)),F.rx.propType&&(V.length?S.rotateX(F.rx.v*V[0]):S.rotateX(F.rx.v*V)),F.o.propType&&(V.length?q+=(F.o.v*V[0]-q)*V[0]:q+=(F.o.v*V-q)*V),t.strokeWidthAnim&&F.sw.propType&&(V.length?j+=F.sw.v*V[0]:j+=F.sw.v*V),t.strokeColorAnim&&F.sc.propType)for(Y=0;Y<3;Y+=1)V.length?B[Y]=B[Y]+(F.sc.v[Y]-B[Y])*V[0]:B[Y]=B[Y]+(F.sc.v[Y]-B[Y])*V;if(t.fillColorAnim&&t.fc){if(F.fc.propType)for(Y=0;Y<3;Y+=1)V.length?W[Y]=W[Y]+(F.fc.v[Y]-W[Y])*V[0]:W[Y]=W[Y]+(F.fc.v[Y]-W[Y])*V;F.fh.propType&&(W=V.length?ft(W,F.fh.v*V[0]):ft(W,F.fh.v*V)),F.fs.propType&&(W=V.length?lt(W,F.fs.v*V[0]):lt(W,F.fs.v*V)),F.fb.propType&&(W=V.length?pt(W,F.fb.v*V[0]):pt(W,F.fb.v*V))}}for(M=0;M<I;M+=1)(F=k[M].a).p.propType&&(V=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars),this._hasMaskedPath?V.length?S.translate(0,F.p.v[1]*V[0],-F.p.v[2]*V[1]):S.translate(0,F.p.v[1]*V,-F.p.v[2]*V):V.length?S.translate(F.p.v[0]*V[0],F.p.v[1]*V[1],-F.p.v[2]*V[2]):S.translate(F.p.v[0]*V,F.p.v[1]*V,-F.p.v[2]*V));if(t.strokeWidthAnim&&(G=j<0?0:j),t.strokeColorAnim&&(X="rgb("+Math.round(255*B[0])+","+Math.round(255*B[1])+","+Math.round(255*B[2])+")"),t.fillColorAnim&&t.fc&&(H="rgb("+Math.round(255*W[0])+","+Math.round(255*W[1])+","+Math.round(255*W[2])+")"),this._hasMaskedPath){if(S.translate(0,-t.ls),S.translate(0,C[1]*L/100+i,0),D.p.p){b=(o.point[1]-d.point[1])/(o.point[0]-d.point[0]);var ot=180*Math.atan(b)/Math.PI;o.point[0]<d.point[0]&&(ot+=180),S.rotate(-ot*Math.PI/180)}S.translate(z,O,0),h-=C[0]*w[a].an/200,w[a+1]&&J!==w[a+1].ind&&(h+=w[a].an/2,h+=t.tr/1e3*t.finalSize)}else{switch(S.translate(s,i,0),t.ps&&S.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:S.translate(w[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[w[a].line]),0,0);break;case 2:S.translate(w[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[w[a].line])/2,0,0)}S.translate(0,-t.ls),S.translate(N,0,0),S.translate(C[0]*w[a].an/200,C[1]*L/100,0),s+=w[a].l+t.tr/1e3*t.finalSize}"html"===x?tt=S.toCSS():"svg"===x?tt=S.to2dCSS():et=[S.props[0],S.props[1],S.props[2],S.props[3],S.props[4],S.props[5],S.props[6],S.props[7],S.props[8],S.props[9],S.props[10],S.props[11],S.props[12],S.props[13],S.props[14],S.props[15]],K=q}this.lettersChangedFlag=P<=a?(E=new dt(K,G,X,H,tt,et),this.renderedLetters.push(E),P+=1,!0):(E=this.renderedLetters[a]).update(K,G,X,H,tt,et)||this.lettersChangedFlag}}},nt.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},nt.prototype.mHelper=new E,nt.prototype.defaultPropsArray=[],F([w],nt),dt.prototype.update=function(t,e,s,i,a,r){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==s&&(this.sc=s,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==a&&(this.m=a,n=this._mdf.m=!0),!r.length||this.p[0]===r[0]&&this.p[1]===r[1]&&this.p[4]===r[4]&&this.p[5]===r[5]&&this.p[12]===r[12]&&this.p[13]===r[13]||(this.p=r,n=this._mdf.p=!0),n},ot.prototype.defaultBoxWidth=[0,0],ot.prototype.copyData=function(t,e){for(var s in e)e.hasOwnProperty(s)&&(t[s]=e[s]);return t},ot.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},ot.prototype.searchProperty=function(){return this.searchKeyframes()},ot.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},ot.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},ot.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,s=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var i,a=this.effectsSequence.length,r=t||this.data.d.k[this.keysIndex].s;for(i=0;i<a;i+=1)r=s!==this.keysIndex?this.effectsSequence[i](r,r.t):this.effectsSequence[i](this.currentData,r.t);e!==r&&this.setCurrentData(r),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},ot.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,s=0,i=t.length;s<=i-1&&(t[s].s,!(s===i-1||t[s+1].t>e));)s+=1;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d.k[this.keysIndex].s},ot.prototype.buildFinalText=function(t){for(var e,s=I.getCombinedCharacterCodes(),i=[],a=0,r=t.length;a<r;)e=t.charCodeAt(a),-1!==s.indexOf(e)?i[i.length-1]+=t.charAt(a):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(a+1))&&e<=57343?(i.push(t.substr(a,2)),++a):i.push(t.charAt(a)),a+=1;return i},ot.prototype.completeTextData=function(t){t.__complete=!0;var e,s,i,a,r,n,h,o=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,d=0,c=0,u=0,g=[],y=0,v=0,b=o.getFontByName(t.f),_=0,C=b.fStyle?b.fStyle.split(" "):[],k="normal",D="normal";for(s=C.length,e=0;e<s;e+=1)switch(C[e].toLowerCase()){case"italic":D="italic";break;case"bold":k="700";break;case"black":k="900";break;case"medium":k="500";break;case"regular":case"normal":k="400";break;case"light":case"thin":k="200"}t.fWeight=b.fWeight||k,t.fStyle=D,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),s=t.finalText.length,t.finalLineHeight=t.lh;var S,x=t.tr/1e3*t.finalSize;if(t.sz)for(var P,w,T=!0,A=t.sz[0],F=t.sz[1];T;){y=P=0,s=(w=this.buildFinalText(t.t)).length,x=t.tr/1e3*t.finalSize;var M=-1;for(e=0;e<s;e+=1)S=w[e].charCodeAt(0),i=!1," "===w[e]?M=e:13!==S&&3!==S||(i=!(y=0),P+=t.finalLineHeight||1.2*t.finalSize),A<y+(_=o.chars?(h=o.getCharData(w[e],b.fStyle,b.fFamily),i?0:h.w*t.finalSize/100):o.measureText(w[e],t.f,t.finalSize))&&" "!==w[e]?(-1===M?s+=1:e=M,P+=t.finalLineHeight||1.2*t.finalSize,w.splice(e,M===e?1:0,"\r"),M=-1,y=0):(y+=_,y+=x);P+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&F<P?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=w,s=t.finalText.length,T=!1)}y=-x;var I,E=_=0;for(e=0;e<s;e+=1)if(i=!1,13===(S=(I=t.finalText[e]).charCodeAt(0))||3===S?(E=0,g.push(y),v=v<y?y:v,y=-2*x,i=!(a=""),u+=1):a=I,_=o.chars?(h=o.getCharData(I,b.fStyle,o.getFontByName(t.f).fFamily),i?0:h.w*t.finalSize/100):o.measureText(a,t.f,t.finalSize)," "===I?E+=_+x:(y+=_+x+E,E=0),p.push({l:_,an:_,add:d,n:i,anIndexes:[],val:a,line:u,animatorJustifyOffset:0}),2==m){if(d+=_,""===a||" "===a||e===s-1){for(""!==a&&" "!==a||(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;f+=1,d=0}}else if(3==m){if(d+=_,""===a||e===s-1){for(""===a&&(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;d=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<y?y:v,g.push(y),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var L,R,V=l.a;n=V.length;var N,z,O=[];for(r=0;r<n;r+=1){for((L=V[r]).a.sc&&(t.strokeColorAnim=!0),L.a.sw&&(t.strokeWidthAnim=!0),(L.a.fc||L.a.fh||L.a.fs||L.a.fb)&&(t.fillColorAnim=!0),z=0,N=L.s.b,e=0;e<s;e+=1)(R=p[e]).anIndexes[r]=z,(1==N&&""!==R.val||2==N&&""!==R.val&&" "!==R.val||3==N&&(R.n||" "==R.val||e==s-1)||4==N&&(R.n||e==s-1))&&(1===L.s.rn&&O.push(z),z+=1);l.a[r].s.totalChars=z;var q,B=-1;if(1===L.s.rn)for(e=0;e<s;e+=1)B!=(R=p[e]).anIndexes[r]&&(B=R.anIndexes[r],q=O.splice(Math.floor(Math.random()*O.length),1)[0]),R.anIndexes[r]=q}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},ot.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var s=this.copyData({},this.data.d.k[e].s);s=this.copyData(s,t),this.data.d.k[e].s=s,this.recalculate(e),this.elem.addDynamicProperty(this)},ot.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},ot.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},ot.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var ct,ut,gt,yt,vt,bt=function(){var d=Math.max,c=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=L.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?L.getProp(t,e.e,0,0,this):{v:100},this.o=L.getProp(t,e.o||{k:0},0,0,this),this.xe=L.getProp(t,e.xe||{k:0},0,0,this),this.ne=L.getProp(t,e.ne||{k:0},0,0,this),this.a=L.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,s=0,i=1,a=1;0<this.ne.v?e=this.ne.v/100:s=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:a=1+this.xe.v/100;var r=W.getBezierEasing(e,s,i,a).get,n=0,h=this.finalS,o=this.finalE,l=this.data.sh;if(2===l)n=r(n=o===h?o<=t?1:0:d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(3===l)n=r(n=o===h?o<=t?0:1:1-d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(4===l)o===h?n=0:(n=d(0,c(.5/(o-h)+(t-h)/(o-h),1)))<.5?n*=2:n=1-2*(n-.5),n=r(n);else if(5===l){if(o===h)n=0;else{var p=o-h,f=-p/2+(t=c(d(0,t+.5-h),o-h)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=r(n)}else n=6===l?r(n=o===h?0:(t=c(d(0,t+.5-h),o-h),(1+Math.cos(Math.PI+2*Math.PI*t/(o-h)))/2)):(t>=u(h)&&(n=d(0,c(t-h<0?c(o,1)-(h-t):o-t,1))),r(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,s=this.o.v/e,i=this.s.v/e+s,a=this.e.v/e+s;if(a<i){var r=i;i=a,a=r}this.finalS=i,this.finalE=a}},F([w],i),{getTextSelectorProp:function(t,e,s){return new i(t,e,s)}}}(),_t=function(t,e,s,i){var a=0,r=t,n=x(r);function h(){return a?n[a-=1]:e()}return{newElement:h,release:function(t){a===r&&(n=Ct.double(n),r*=2),s&&s(t),n[a]=t,a+=1}}},Ct={double:function(t){return t.concat(x(t.length))}},kt=_t(8,function(){return j("float32",2)}),Dt=((ct=_t(4,function(){return new V},function(t){var e,s=t._length;for(e=0;e<s;e+=1)kt.release(t.v[e]),kt.release(t.i[e]),kt.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1})).clone=function(t){var e,s=ct.newElement(),i=void 0===t._length?t.v.length:t._length;for(s.setLength(i),s.c=t.c,e=0;e<i;e+=1)s.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return s},ct),St=(ut={newShapeCollection:function(){var t;t=gt?vt[gt-=1]:new J;return t},release:function(t){var e,s=t._length;for(e=0;e<s;e+=1)Dt.release(t.shapes[e]);t._length=0,gt===yt&&(vt=Ct.double(vt),yt*=2);vt[gt]=t,gt+=1}},gt=0,vt=x(yt=4),ut),xt=_t(8,function(){return{lengths:[],totalLength:0}},function(t){var e,s=t.lengths.length;for(e=0;e<s;e+=1)Pt.release(t.lengths[e]);t.lengths.length=0}),Pt=_t(8,function(){return{addedLength:0,percents:j("float32",D),lengths:j("float32",D)}});function wt(){}function Tt(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var s="";if(e&&e.title){var i=createNS("title"),a=S();i.setAttribute("id",a),i.textContent=e.title,this.svgElement.appendChild(i),s+=a}if(e&&e.description){var r=createNS("desc"),n=S();r.setAttribute("id",n),r.textContent=e.description,this.svgElement.appendChild(r),s+=" "+n}s&&this.svgElement.setAttribute("aria-labelledby",s);var h=createNS("defs");this.svgElement.appendChild(h);var o=createNS("g");this.svgElement.appendChild(o),this.layerElement=o,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:h,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function At(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new Ut,this.elements=[],this.pendingElements=[],this.transformMat=new E,this.completeLayers=!1,this.rendererType="canvas"}function Ft(t,e,s){this.data=t,this.element=e,this.globalData=s,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,a=this.globalData.defs,r=this.masksProperties?this.masksProperties.length:0;this.viewData=x(r),this.solidPath="";var n,h,o,l,p,f,m,d=this.masksProperties,c=0,u=[],g=S(),y="clipPath",v="clip-path";for(i=0;i<r;i++)if(("a"!==d[i].mode&&"n"!==d[i].mode||d[i].inv||100!==d[i].o.k||d[i].o.x)&&(v=y="mask"),"s"!=d[i].mode&&"i"!=d[i].mode||0!==c?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),n=createNS("path"),"n"!=d[i].mode){var b;if(c+=1,n.setAttribute("fill","s"===d[i].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==d[i].x.k?(v=y="mask",m=L.getProp(this.element,d[i].x,0,null,this.element),b=S(),(p=createNS("filter")).setAttribute("id",b),(f=createNS("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),a.appendChild(p),n.setAttribute("stroke","s"===d[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:n,x:m,expan:f,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==d[i].mode){o=u.length;var _=createNS("g");for(h=0;h<o;h+=1)_.appendChild(u[h]);var C=createNS("mask");C.setAttribute("mask-type","alpha"),C.setAttribute("id",g+"_"+c),C.appendChild(n),a.appendChild(C),_.setAttribute("mask","url("+k+"#"+g+"_"+c+")"),u.length=0,u.push(_)}else u.push(n);d[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:n,lastPath:"",op:L.getProp(this.element,d[i].o,0,.01,this.element),prop:O.getShapeProp(this.element,d[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(d[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:L.getProp(this.element,d[i].o,0,.01,this.element),prop:O.getShapeProp(this.element,d[i],3),elem:n,lastPath:""},a.appendChild(n);for(this.maskElement=createNS(y),r=u.length,i=0;i<r;i+=1)this.maskElement.appendChild(u[i]);0<c&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+k+"#"+g+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function Mt(){}function It(){}function Et(){}function Lt(){}function Rt(){}function Vt(t,e){this.elem=t,this.pos=e}function Nt(t,e,s){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;for(var i=0,a=t.length;i<a;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function zt(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function Ot(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function qt(t,e,s,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var a=4;"rc"==e.ty?a=5:"el"==e.ty?a=6:"sr"==e.ty&&(a=7),this.sh=O.getShapeProp(t,e,a,t);var r,n,h=s.length;for(r=0;r<h;r+=1)s[r].closed||(n={transforms:i.addTransformSequence(s[r].transforms),trNodes:[]},this.styledShapes.push(n),s[r].elements.push(n))}function Bt(){}function jt(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initFrame(),this.initTransform(t,e,s),this.initHierarchy()}function Wt(){}function Yt(){}function Gt(){}function Xt(){}function Ht(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function Kt(t,e,s){this.initElement(t,e,s)}function Jt(t,e,s){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,s),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?L.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function Zt(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,s),this.prevViewData=[]}function Ut(){this.saved=[],this.cArrPos=0,this.cTr=new E,this.cO=1;var t;for(this.savedOp=j("float32",15),t=0;t<15;t+=1)this.saved[t]=j("float32",16);this._length=15}function Qt(){}function $t(t,e,s){this.assetData=e.getAssetData(t.refId),this.img=e.imageLoader.getImage(this.assetData),this.initElement(t,e,s)}function te(t,e,s){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=x(this.layers.length),this.initElement(t,e,s),this.tm=t.tm?L.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ee(t,e){this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=x(this.masksProperties.length);var s,i=this.masksProperties.length,a=!1;for(s=0;s<i;s++)"n"!==this.masksProperties[s].mode&&(a=!0),this.viewData[s]=O.getShapeProp(this.element,this.masksProperties[s],3);(this.hasMasks=a)&&this.element.addRenderableComponent(this)}function se(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new Ot,this.initElement(t,e,s)}function ie(t,e,s){this.initElement(t,e,s)}function ae(t,e,s){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,s)}function re(){}wt.prototype.checkLayers=function(t){var e,s,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e--)this.elements[e]||(s=this.layers[e]).ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},wt.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t)}return this.createNull(t)},wt.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},wt.prototype.createAudio=function(t){return new Jt(t,this.globalData,this)},wt.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},wt.prototype.includeLayers=function(t){this.completeLayers=!1;var e,s,i=t.length,a=this.layers.length;for(e=0;e<i;e+=1)for(s=0;s<a;){if(this.layers[s].id==t[e].id){this.layers[s]=t[e];break}s+=1}},wt.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},wt.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},wt.prototype.buildElementParenting=function(t,e,s){for(var i=this.elements,a=this.layers,r=0,n=a.length;r<n;)a[r].ind==e&&(i[r]&&!0!==i[r]?(s.push(i[r]),i[r].setAsParent(),void 0!==a[r].parent?this.buildElementParenting(t,a[r].parent,s):t.setHierarchy(s)):(this.buildItem(r),this.addPendingElement(t))),r+=1},wt.prototype.addPendingElement=function(t){this.pendingElements.push(t)},wt.prototype.searchExtraCompositions=function(t){var e,s=t.length;for(e=0;e<s;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},wt.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new I,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},F([wt],Tt),Tt.prototype.createNull=function(t){return new jt(t,this.globalData,this)},Tt.prototype.createShape=function(t){return new Zt(t,this.globalData,this)},Tt.prototype.createText=function(t){return new SVGTextElement(t,this.globalData,this)},Tt.prototype.createImage=function(t){return new Ht(t,this.globalData,this)},Tt.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},Tt.prototype.createSolid=function(t){return new Kt(t,this.globalData,this)},Tt.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var s=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var a=S();s.setAttribute("id",a),s.appendChild(i),this.layerElement.setAttribute("clip-path","url("+k+"#"+a+")"),e.appendChild(s),this.layers=t.layers,this.elements=x(t.layers.length)},Tt.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},Tt.prototype.updateContainerSize=function(){},Tt.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var s=this.createItem(this.layers[t]);e[t]=s,h&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(s),s.initExpressions()),this.appendElementInPos(s,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?s.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(s)))}},Tt.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,s=this.elements.length;e<s;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},Tt.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=s-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<s;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},Tt.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){for(var i,a=0;a<e;)this.elements[a]&&!0!==this.elements[a]&&this.elements[a].getBaseElement()&&(i=this.elements[a].getBaseElement()),a+=1;i?this.layerElement.insertBefore(s,i):this.layerElement.appendChild(s)}},Tt.prototype.hide=function(){this.layerElement.style.display="none"},Tt.prototype.show=function(){this.layerElement.style.display="block"},F([wt],At),At.prototype.createShape=function(t){return new se(t,this.globalData,this)},At.prototype.createText=function(t){return new ae(t,this.globalData,this)},At.prototype.createImage=function(t){return new $t(t,this.globalData,this)},At.prototype.createComp=function(t){return new te(t,this.globalData,this)},At.prototype.createSolid=function(t){return new ie(t,this.globalData,this)},At.prototype.createNull=Tt.prototype.createNull,At.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var s=this.contextData.cTr.props;this.canvasContext.setTransform(s[0],s[1],s[4],s[5],s[12],s[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},At.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},At.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},At.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var s,i=this.contextData.saved[this.contextData.cArrPos];for(s=0;s<16;s+=1)i[s]=e[s];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},At.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,s=this.contextData.saved[this.contextData.cArrPos],i=this.contextData.cTr.props;for(e=0;e<16;e+=1)i[e]=s[e];this.canvasContext.setTransform(s[0],s[1],s[4],s[5],s[12],s[13]),s=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=s,this.globalData.currentGlobalAlpha!==s&&(this.canvasContext.globalAlpha=s,this.globalData.currentGlobalAlpha=s)}else this.canvasContext.restore()},At.prototype.configAnimation=function(t){this.animationItem.wrapper?(this.animationItem.container=P("canvas"),this.animationItem.container.style.width="100%",this.animationItem.container.style.height="100%",this.animationItem.container.style.transformOrigin=this.animationItem.container.style.mozTransformOrigin=this.animationItem.container.style.webkitTransformOrigin=this.animationItem.container.style["-webkit-transform"]="0px 0px 0px",this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)):this.canvasContext=this.renderConfig.context,this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=x(t.layers.length),this.updateContainerSize()},At.prototype.updateContainerSize=function(){var t,e,s,i;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var a=this.renderConfig.preserveAspectRatio.split(" "),r=a[1]||"meet",n=a[0]||"xMidYMid",h=n.substr(0,4),o=n.substr(4);s=t/e,i=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=s<i&&"meet"===r||i<s&&"slice"===r?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===h&&(i<s&&"meet"===r||s<i&&"slice"===r)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===h&&(i<s&&"meet"===r||s<i&&"slice"===r)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===o&&(s<i&&"meet"===r||i<s&&"slice"===r)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===o&&(s<i&&"meet"===r||i<s&&"slice"===r)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"==this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;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],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},At.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},At.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var s,i=this.layers.length;for(this.completeLayers||this.checkLayers(t),s=0;s<i;s++)(this.completeLayers||this.elements[s])&&this.elements[s].prepareFrame(t-this.layers[s].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),s=i-1;0<=s;s-=1)(this.completeLayers||this.elements[s])&&this.elements[s].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},At.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){var s=this.createItem(this.layers[t],this,this.globalData);(e[t]=s).initExpressions()}},At.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},At.prototype.hide=function(){this.animationItem.container.style.display="none"},At.prototype.show=function(){this.animationItem.container.style.display="block"},Ft.prototype.getMaskProperty=function(t){return this.viewData[t].prop},Ft.prototype.renderFrame=function(t){var e,s=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",s.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var a=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+k+"#"+this.storedData[e].filterId+")")),a.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},Ft.prototype.getMaskelement=function(){return this.maskElement},Ft.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},Ft.prototype.drawPath=function(t,e,s){var i,a,r=" M"+e.v[0][0]+","+e.v[0][1];for(a=e._length,i=1;i<a;i+=1)r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<a&&(r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),s.lastPath!==r){var n="";s.elem&&(e.c&&(n=t.inv?this.solidPath+r:r),s.elem.setAttribute("d",n)),s.lastPath=r}},Ft.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},Mt.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},It.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var s,i=this.dynamicProperties.length;for(s=0;s<i;s+=1)(e||this._isParent&&"transform"===this.dynamicProperties[s].propType)&&(this.dynamicProperties[s].getValue(),this.dynamicProperties[s]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},Et.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?R.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new E},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,s=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;s<i;){if(this.hierarchy[s].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}s+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),s=0;s<i;s+=1)t=this.hierarchy[s].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var s=!0,i=this.comp;s;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):s=!1;var a,r,n=e.length;for(a=0;a<n;a+=1)r=e[a].mat.applyToPointArray(0,0,0),t=[t[0]-r[0],t[1]-r[1],0];return t},mHelper:new E},Lt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},F([Lt,function(t){function e(){}return e.prototype=t,e}({initElement:function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],Rt),Nt.prototype.setAsAnimated=function(){this._isAnimated=!0},Ot.prototype={addTransformSequence:function(t){var e,s=t.length,i="_";for(e=0;e<s;e+=1)i+=t[e].transform.key+"_";var a=this.sequences[i];return a||(a={transforms:[].concat(t),finalTransform:new E,_mdf:!1},this.sequences[i]=a,this.sequenceList.push(a)),a},processSequence:function(t,e){for(var s,i=0,a=t.transforms.length,r=e;i<a&&!e;){if(t.transforms[i].transform.mProps._mdf){r=!0;break}i+=1}if(r)for(t.finalTransform.reset(),i=a-1;0<=i;i-=1)s=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10],s[11],s[12],s[13],s[14],s[15]);t._mdf=r},processSequences:function(t){var e,s=this.sequenceList.length;for(e=0;e<s;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return"_"+this.transform_key_count++}},qt.prototype.setAsAnimated=Nt.prototype.setAsAnimated,Bt.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=A(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=S(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},jt.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},jt.prototype.renderFrame=function(){},jt.prototype.getBaseElement=function(){return null},jt.prototype.destroy=function(){},jt.prototype.sourceRectAtTime=function(){},jt.prototype.hide=function(){},F([Bt,Et,Mt,It],jt),Wt.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,s,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),a.appendChild(this.layerElement),i=a,this.globalData.defs.appendChild(a),it.maskType||1!=this.data.td||(a.setAttribute("mask-type","luminance"),t=S(),e=at.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(at.createAlphaToLuminanceFilter()),(s=createNS("g")).appendChild(this.layerElement),i=s,a.appendChild(s),s.setAttribute("filter","url("+k+"#"+t+")"))}else if(2==this.data.td){var r=createNS("mask");r.setAttribute("id",this.layerId),r.setAttribute("mask-type","alpha");var n=createNS("g");r.appendChild(n),t=S(),e=at.createFilter(t);var h=createNS("feComponentTransfer");h.setAttribute("in","SourceGraphic"),e.appendChild(h);var o=createNS("feFuncA");o.setAttribute("type","table"),o.setAttribute("tableValues","1.0 0.0"),h.appendChild(o),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+k+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,it.maskType||(r.setAttribute("mask-type","luminance"),e.appendChild(at.createAlphaToLuminanceFilter()),s=createNS("g"),n.appendChild(l),s.appendChild(this.layerElement),i=s,n.appendChild(s)),this.globalData.defs.appendChild(r)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),f=createNS("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=S();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var d=createNS("g");d.setAttribute("clip-path","url("+k+"#"+m+")"),d.appendChild(this.layerElement),this.transformedElement=d,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+k+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new Ft(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+k+"#"+t+")")}},Yt.prototype={addShapeToModifiers:function(t){var e,s=this.shapeModifiers.length;for(e=0;e<s;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,s=0,i=e.length;s<i;){if(e[s].elem===t)return e[s].pos;s+=1}return 0},addProcessedElement:function(t,e){for(var s=this.processedElements,i=s.length;i;)if(s[i-=1].elem===t)return void(s[i].pos=e);s.push(new Vt(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},Gt.prototype.initElement=function(t,e,s){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new ot(this,t.t,this.dynamicProperties),this.textAnimator=new nt(t.t,this.renderType,this),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},Gt.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},Gt.prototype.createPathShape=function(t,e){var s,i,a=e.length,r="";for(s=0;s<a;s+=1)i=e[s].ks.k,r+=tt(i,i.i.length,!0,t);return r},Gt.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},Gt.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},Gt.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},Gt.prototype.applyTextPropertiesToMatrix=function(t,e,s,i,a){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s])/2,0,0)}e.translate(i,a,0)},Gt.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},Gt.prototype.emptyProp=new dt,Gt.prototype.destroy=function(){},F([Bt,Et,Mt,It,Rt],Xt),Xt.prototype.initElement=function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},Xt.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var s,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),s=i-1;0<=s;s-=1)(this.completeLayers||this.elements[s])&&(this.elements[s].prepareFrame(this.renderedFrame-this.layers[s].st),this.elements[s]._mdf&&(this._mdf=!0))}},Xt.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Xt.prototype.setElements=function(t){this.elements=t},Xt.prototype.getElements=function(){return this.elements},Xt.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},Xt.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},F([Bt,Et,Wt,Mt,It,Rt],Ht),Ht.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},Ht.prototype.sourceRectAtTime=function(){return this.sourceRect},F([Ht],Kt),Kt.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},Jt.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},F([Lt,Bt,It],Jt),Jt.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},Jt.prototype.show=function(){},Jt.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},Jt.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},Jt.prototype.resume=function(){this._canPlay=!0},Jt.prototype.setRate=function(t){this.audio.rate(t)},Jt.prototype.volume=function(t){this.audio.volume(t)},Jt.prototype.getBaseElement=function(){return null},Jt.prototype.destroy=function(){},Jt.prototype.sourceRectAtTime=function(){},Jt.prototype.initExpressions=function(){},F([Bt,Et,Wt,Yt,Mt,It,Rt],Zt),Zt.prototype.initSecondaryElement=function(){},Zt.prototype.identityMatrix=new E,Zt.prototype.buildExpressionInterface=function(){},Zt.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Zt.prototype.filterUniqueShapes=function(){var t,e,s,i,a=this.shapes.length,r=this.stylesList.length,n=[],h=!1;for(s=0;s<r;s+=1){for(i=this.stylesList[s],h=!1,t=n.length=0;t<a;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),h=e._isAnimated||h);1<n.length&&h&&this.setShapesAsAnimated(n)}},Zt.prototype.setShapesAsAnimated=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].setAsAnimated()},Zt.prototype.createStyleElement=function(t,e){var s,i=new SVGStyleData(t,e),a=i.pElem;if("st"===t.ty)s=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)s=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){s=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(s.gf),s.maskId&&(this.globalData.defs.appendChild(s.ms),this.globalData.defs.appendChild(s.of),a.setAttribute("mask","url("+k+"#"+s.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(a.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),a.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),a.setAttribute("fill-opacity","0"),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&a.setAttribute("fill-rule","evenodd"),t.ln&&a.setAttribute("id",t.ln),t.cl&&a.setAttribute("class",t.cl),t.bm&&(a.style["mix-blend-mode"]=A(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,s),s},Zt.prototype.createGroupElement=function(t){var e=new zt;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=A(t.bm)),e},Zt.prototype.createTransformElement=function(t,e){var s=R.getTransformProperty(this,t,this),i=new SVGTransformData(s,s.o,e);return this.addToAnimatedContents(t,i),i},Zt.prototype.createShapeElement=function(t,e,s){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var a=new Nt(e,s,O.getShapeProp(this,t,i,this));return this.shapes.push(a),this.addShapeToModifiers(a),this.addToAnimatedContents(t,a),a},Zt.prototype.addToAnimatedContents=function(t,e){for(var s=0,i=this.animatedContents.length;s<i;){if(this.animatedContents[s].element===e)return;s+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},Zt.prototype.setElementStyles=function(t){var e,s=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||s.push(this.stylesList[e])},Zt.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},Zt.prototype.searchShapes=function(t,e,s,i,a,r,n){var h,o,l,p,f,m,d=[].concat(r),c=t.length-1,u=[],g=[];for(h=c;0<=h;h-=1){if((m=this.searchProcessedElement(t[h]))?e[h]=s[m-1]:t[h]._render=n,"fl"==t[h].ty||"st"==t[h].ty||"gf"==t[h].ty||"gs"==t[h].ty)m?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],a),t[h]._render&&i.appendChild(e[h].style.pElem),u.push(e[h].style);else if("gr"==t[h].ty){if(m)for(l=e[h].it.length,o=0;o<l;o+=1)e[h].prevViewData[o]=e[h].it[o];else e[h]=this.createGroupElement(t[h]);this.searchShapes(t[h].it,e[h].it,e[h].prevViewData,e[h].gr,a+1,d,n),t[h]._render&&i.appendChild(e[h].gr)}else"tr"==t[h].ty?(m||(e[h]=this.createTransformElement(t[h],i)),p=e[h].transform,d.push(p)):"sh"==t[h].ty||"rc"==t[h].ty||"el"==t[h].ty||"sr"==t[h].ty?(m||(e[h]=this.createShapeElement(t[h],d,a)),this.setElementStyles(e[h])):"tm"==t[h].ty||"rd"==t[h].ty||"ms"==t[h].ty||"pb"==t[h].ty?(m?(f=e[h]).closed=!1:((f=q.getModifier(t[h].ty)).init(this,t[h]),e[h]=f,this.shapeModifiers.push(f)),g.push(f)):"rp"==t[h].ty&&(m?(f=e[h]).closed=!0:(f=q.getModifier(t[h].ty),(e[h]=f).init(this,t,h,e),this.shapeModifiers.push(f),n=!1),g.push(f));this.addProcessedElement(t[h],h+1)}for(c=u.length,h=0;h<c;h+=1)u[h].closed=!0;for(c=g.length,h=0;h<c;h+=1)g[h].closed=!0},Zt.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},Zt.prototype.renderShape=function(){var t,e,s=this.animatedContents.length;for(t=0;t<s;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},Zt.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},Ut.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=j("float32",t),this.savedOp.set(e);var s=0;for(s=this._length;s<t;s+=1)this.saved[s]=j("float32",16);this._length=t},Ut.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},(Qt.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new re(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=A(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new ee(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new E}).hide=Qt.prototype.hideElement,Qt.prototype.show=Qt.prototype.showElement,F([Bt,Et,Qt,Mt,It,Lt],$t),$t.prototype.initElement=Zt.prototype.initElement,$t.prototype.prepareFrame=Ht.prototype.prepareFrame,$t.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var t=P("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,s,i=t.getContext("2d"),a=this.img.width,r=this.img.height,n=a/r,h=this.assetData.w/this.assetData.h,o=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;h<n&&"xMidYMid slice"===o||n<h&&"xMidYMid slice"!==o?e=(s=r)*h:s=(e=a)/h,i.drawImage(this.img,(a-e)/2,(r-s)/2,e,s,0,0,this.assetData.w,this.assetData.h),this.img=t}},$t.prototype.renderInnerContent=function(t){this.canvasContext.drawImage(this.img,0,0)},$t.prototype.destroy=function(){this.img=null},F([At,Xt,Qt],te),te.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},te.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},ee.prototype.renderFrame=function(){if(this.hasMasks){var t,e,s,i,a=this.element.finalTransform.mat,r=this.element.canvasContext,n=this.masksProperties.length;for(r.beginPath(),t=0;t<n;t++)if("n"!==this.masksProperties[t].mode){this.masksProperties[t].inv&&(r.moveTo(0,0),r.lineTo(this.element.globalData.compSize.w,0),r.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),r.lineTo(0,this.element.globalData.compSize.h),r.lineTo(0,0)),i=this.viewData[t].v,e=a.applyToPointArray(i.v[0][0],i.v[0][1],0),r.moveTo(e[0],e[1]);var h,o=i._length;for(h=1;h<o;h++)s=a.applyToTriplePoints(i.o[h-1],i.i[h],i.v[h]),r.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);s=a.applyToTriplePoints(i.o[h-1],i.i[0],i.v[0]),r.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}this.element.globalData.renderer.save(!0),r.clip()}},ee.prototype.getMaskProperty=Ft.prototype.getMaskProperty,ee.prototype.destroy=function(){this.element=null},F([Bt,Et,Qt,Yt,Mt,It,Lt],se),se.prototype.initElement=Rt.prototype.initElement,se.prototype.transformHelper={opacity:1,_opMdf:!1},se.prototype.dashResetter=[],se.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},se.prototype.createStyleElement=function(t,e){var s={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"==t.ty||"st"==t.ty?(i.c=L.getProp(this,t.c,1,255,this),i.c.k||(s.co="rgb("+f(i.c.v[0])+","+f(i.c.v[1])+","+f(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=L.getProp(this,t.s,1,null,this),i.e=L.getProp(this,t.e,1,null,this),i.h=L.getProp(this,t.h||{k:0},0,.01,this),i.a=L.getProp(this,t.a||{k:0},0,B,this),i.g=new U(this,t.g,this)),i.o=L.getProp(this,t.o,0,.01,this),"st"==t.ty||"gs"==t.ty){if(s.lc=this.lcEnum[t.lc]||"round",s.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(s.ml=t.ml),i.w=L.getProp(this,t.w,0,null,this),i.w.k||(s.wi=i.w.v),t.d){var a=new Z(this,t.d,"canvas",this);i.d=a,i.d.k||(s.da=i.d.dashArray,s.do=i.d.dashoffset[0])}}else s.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(s),i.style=s,i},se.prototype.createGroupElement=function(t){return{it:[],prevViewData:[]}},se.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:L.getProp(this,t.o,0,.01,this),mProps:R.getTransformProperty(this,t,this)}}},se.prototype.createShapeElement=function(t){var e=new qt(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},se.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},se.prototype.addTransformToStyleList=function(t){var e,s=this.stylesList.length;for(e=0;e<s;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},se.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},se.prototype.closeStyles=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].closed=!0},se.prototype.searchShapes=function(t,e,s,i,a){var r,n,h,o,l,p,f=t.length-1,m=[],d=[],c=[].concat(a);for(r=f;0<=r;r-=1){if((o=this.searchProcessedElement(t[r]))?e[r]=s[o-1]:t[r]._shouldRender=i,"fl"==t[r].ty||"st"==t[r].ty||"gf"==t[r].ty||"gs"==t[r].ty)o?e[r].style.closed=!1:e[r]=this.createStyleElement(t[r],c),m.push(e[r].style);else if("gr"==t[r].ty){if(o)for(h=e[r].it.length,n=0;n<h;n+=1)e[r].prevViewData[n]=e[r].it[n];else e[r]=this.createGroupElement(t[r]);this.searchShapes(t[r].it,e[r].it,e[r].prevViewData,i,c)}else"tr"==t[r].ty?(o||(p=this.createTransformElement(t[r]),e[r]=p),c.push(e[r]),this.addTransformToStyleList(e[r])):"sh"==t[r].ty||"rc"==t[r].ty||"el"==t[r].ty||"sr"==t[r].ty?o||(e[r]=this.createShapeElement(t[r])):"tm"==t[r].ty||"rd"==t[r].ty||"pb"==t[r].ty?(o?(l=e[r]).closed=!1:((l=q.getModifier(t[r].ty)).init(this,t[r]),e[r]=l,this.shapeModifiers.push(l)),d.push(l)):"rp"==t[r].ty&&(o?(l=e[r]).closed=!0:(l=q.getModifier(t[r].ty),(e[r]=l).init(this,t,r,e),this.shapeModifiers.push(l),i=!1),d.push(l));this.addProcessedElement(t[r],r+1)}for(this.removeTransformFromStyleList(),this.closeStyles(m),f=d.length,r=0;r<f;r+=1)d[r].closed=!0},se.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},se.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},se.prototype.drawLayer=function(){var t,e,s,i,a,r,n,h,o,l=this.stylesList.length,p=this.globalData.renderer,f=this.globalData.canvasContext;for(t=0;t<l;t+=1)if(("st"!==(h=(o=this.stylesList[t]).type)&&"gs"!==h||0!==o.wi)&&o.data._shouldRender&&0!==o.coOp&&0!==this.globalData.currentGlobalAlpha){for(p.save(),r=o.elements,"st"===h||"gs"===h?(f.strokeStyle="st"===h?o.co:o.grd,f.lineWidth=o.wi,f.lineCap=o.lc,f.lineJoin=o.lj,f.miterLimit=o.ml||0):f.fillStyle="fl"===h?o.co:o.grd,p.ctxOpacity(o.coOp),"st"!==h&&"gs"!==h&&f.beginPath(),p.ctxTransform(o.preTransforms.finalTransform.props),s=r.length,e=0;e<s;e+=1){for("st"!==h&&"gs"!==h||(f.beginPath(),o.da&&(f.setLineDash(o.da),f.lineDashOffset=o.do)),a=(n=r[e].trNodes).length,i=0;i<a;i+=1)"m"==n[i].t?f.moveTo(n[i].p[0],n[i].p[1]):"c"==n[i].t?f.bezierCurveTo(n[i].pts[0],n[i].pts[1],n[i].pts[2],n[i].pts[3],n[i].pts[4],n[i].pts[5]):f.closePath();"st"!==h&&"gs"!==h||(f.stroke(),o.da&&f.setLineDash(this.dashResetter))}"st"!==h&&"gs"!==h&&f.fill(o.r),p.restore()}},se.prototype.renderShape=function(t,e,s,i){var a,r;for(r=t,a=e.length-1;0<=a;a-=1)"tr"==e[a].ty?(r=s[a].transform,this.renderShapeTransform(t,r)):"sh"==e[a].ty||"el"==e[a].ty||"rc"==e[a].ty||"sr"==e[a].ty?this.renderPath(e[a],s[a]):"fl"==e[a].ty?this.renderFill(e[a],s[a],r):"st"==e[a].ty?this.renderStroke(e[a],s[a],r):"gf"==e[a].ty||"gs"==e[a].ty?this.renderGradientFill(e[a],s[a],r):"gr"==e[a].ty?this.renderShape(r,e[a].it,s[a].it):e[a].ty;i&&this.drawLayer()},se.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var s,i,a,r=t.trNodes,n=e.paths,h=n._length;r.length=0;var o=t.transforms.finalTransform;for(a=0;a<h;a+=1){var l=n.shapes[a];if(l&&l.v){for(i=l._length,s=1;s<i;s+=1)1===s&&r.push({t:"m",p:o.applyToPointArray(l.v[0][0],l.v[0][1],0)}),r.push({t:"c",pts:o.applyToTriplePoints(l.o[s-1],l.i[s],l.v[s])});1===i&&r.push({t:"m",p:o.applyToPointArray(l.v[0][0],l.v[0][1],0)}),l.c&&i&&(r.push({t:"c",pts:o.applyToTriplePoints(l.o[s-1],l.i[0],l.v[0])}),r.push({t:"z"}))}}t.trNodes=r}},se.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var s,i=e.styledShapes.length;for(s=0;s<i;s+=1)this.renderStyledShape(e.styledShapes[s],e.sh)}},se.prototype.renderFill=function(t,e,s){var i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*s.opacity)},se.prototype.renderGradientFill=function(t,e,s){var i=e.style;if(!i.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var a=this.globalData.canvasContext,r=e.s.v,n=e.e.v;if(1===t.t)m=a.createLinearGradient(r[0],r[1],n[0],n[1]);else var h=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2)),o=Math.atan2(n[1]-r[1],n[0]-r[0]),l=h*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),p=Math.cos(o+e.a.v)*l+r[0],f=Math.sin(o+e.a.v)*l+r[1],m=a.createRadialGradient(p,f,0,r[0],r[1],h);var d,c=t.g.p,u=e.g.c,g=1;for(d=0;d<c;d+=1)e.g._hasOpacity&&e.g._collapsable&&(g=e.g.o[2*d+1]),m.addColorStop(u[4*d]/100,"rgba("+u[4*d+1]+","+u[4*d+2]+","+u[4*d+3]+","+g+")");i.grd=m}i.coOp=e.o.v*s.opacity},se.prototype.renderStroke=function(t,e,s){var i=e.style,a=e.d;a&&(a._mdf||this._isFirstFrame)&&(i.da=a.dashArray,i.do=a.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*s.opacity),(e.w._mdf||this._isFirstFrame)&&(i.wi=e.w.v)},se.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},F([Bt,Et,Qt,Mt,It,Lt],ie),ie.prototype.initElement=Zt.prototype.initElement,ie.prototype.prepareFrame=Ht.prototype.prepareFrame,ie.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},F([Bt,Et,Qt,Mt,It,Lt,Gt],ae),ae.prototype.tHelper=P("canvas").getContext("2d"),ae.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=x(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var s=!1;t.sc&&(s=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var i,a,r=this.globalData.fontManager.getFontByName(t.f),n=t.l,h=this.mHelper;this.stroke=s,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,a=t.finalText.length;var o,l,p,f,m,d,c,u,g,y,v=this.data.singleShape,b=t.tr/1e3*t.finalSize,_=0,C=0,k=!0,D=0;for(i=0;i<a;i+=1){for(l=(o=this.globalData.fontManager.getCharData(t.finalText[i],r.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&o.data||{},h.reset(),v&&n[i].n&&(_=-b,C+=t.yOffset,C+=k?1:0,k=!1),c=(m=l.shapes?l.shapes[0].it:[]).length,h.scale(t.finalSize/100,t.finalSize/100),v&&this.applyTextPropertiesToMatrix(t,h,n[i].line,_,C),g=x(c),d=0;d<c;d+=1){for(f=m[d].ks.k.i.length,u=m[d].ks.k,y=[],p=1;p<f;p+=1)1==p&&y.push(h.applyToX(u.v[0][0],u.v[0][1],0),h.applyToY(u.v[0][0],u.v[0][1],0)),y.push(h.applyToX(u.o[p-1][0],u.o[p-1][1],0),h.applyToY(u.o[p-1][0],u.o[p-1][1],0),h.applyToX(u.i[p][0],u.i[p][1],0),h.applyToY(u.i[p][0],u.i[p][1],0),h.applyToX(u.v[p][0],u.v[p][1],0),h.applyToY(u.v[p][0],u.v[p][1],0));y.push(h.applyToX(u.o[p-1][0],u.o[p-1][1],0),h.applyToY(u.o[p-1][0],u.o[p-1][1],0),h.applyToX(u.i[0][0],u.i[0][1],0),h.applyToY(u.i[0][0],u.i[0][1],0),h.applyToX(u.v[0][0],u.v[0][1],0),h.applyToY(u.v[0][0],u.v[0][1],0)),g[d]=y}v&&(_+=n[i].l,_+=b),this.textSpans[D]?this.textSpans[D].elem=g:this.textSpans[D]={elem:g},D+=1}},ae.prototype.renderInnerContent=function(){var t,e,s,i,a,r,n=this.canvasContext;this.finalTransform.mat.props;n.font=this.values.fValue,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var h,o=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;e=l.length;var p,f,m=null,d=null,c=null;for(t=0;t<e;t+=1)if(!l[t].n){if((h=o[t])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(h.p),this.globalData.renderer.ctxOpacity(h.o)),this.fill){for(h&&h.fc?m!==h.fc&&(m=h.fc,n.fillStyle=h.fc):m!==this.values.fill&&(m=this.values.fill,n.fillStyle=this.values.fill),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),s=0;s<i;s+=1)for(r=(f=p[s]).length,this.globalData.canvasContext.moveTo(f[0],f[1]),a=2;a<r;a+=6)this.globalData.canvasContext.bezierCurveTo(f[a],f[a+1],f[a+2],f[a+3],f[a+4],f[a+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(h&&h.sw?c!==h.sw&&(c=h.sw,n.lineWidth=h.sw):c!==this.values.sWidth&&(c=this.values.sWidth,n.lineWidth=this.values.sWidth),h&&h.sc?d!==h.sc&&(d=h.sc,n.strokeStyle=h.sc):d!==this.values.stroke&&(d=this.values.stroke,n.strokeStyle=this.values.stroke),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),s=0;s<i;s+=1)for(r=(f=p[s]).length,this.globalData.canvasContext.moveTo(f[0],f[1]),a=2;a<r;a+=6)this.globalData.canvasContext.bezierCurveTo(f[a],f[a+1],f[a+2],f[a+3],f[a+4],f[a+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}h&&this.globalData.renderer.restore()}},re.prototype.renderFrame=function(){};var ne=function(){var t={},a=[],i=0,r=0,n=0,h=!0,o=!1;function s(t){for(var e=0,s=t.target;e<r;)a[e].animation===s&&(a.splice(e,1),e-=1,r-=1,s.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var s=0;s<r;){if(a[s].elem==t&&null!==a[s].elem)return a[s].animation;s+=1}var i=new he;return m(i,t),i.setData(t,e),i}function p(){n+=1,c()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",s),t.addEventListener("_active",p),t.addEventListener("_idle",f),a.push({elem:e,animation:t}),r+=1}function d(t){var e,s=t-i;for(e=0;e<r;e+=1)a[e].animation.advanceTime(s);i=t,n&&!o?window.requestAnimationFrame(d):h=!0}function e(t){i=t,window.requestAnimationFrame(d)}function c(){!o&&n&&h&&(window.requestAnimationFrame(e),h=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new he;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setSpeed(t,e)},t.setDirection=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.togglePause(t)},t.searchAnimations=function(t,e,s){var i,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),r=a.length;for(i=0;i<r;i+=1)s&&a[i].setAttribute("data-bm-type",s),l(a[i],t);if(e&&0===r){s||(s="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var h=P("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",s),n.appendChild(h),l(h,t)}},t.resize=function(){var t;for(t=0;t<r;t+=1)a[t].animation.resize()},t.goToAndStop=function(t,e,s){var i;for(i=0;i<r;i+=1)a[i].animation.goToAndStop(t,e,s)},t.destroy=function(t){var e;for(e=r-1;0<=e;e-=1)a[e].animation.destroy(t)},t.freeze=function(){o=!0},t.unfreeze=function(){o=!1,c()},t.setVolume=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=a.length,s=[];for(t=0;t<e;t+=1)s.push(a[t].animation);return s},t}(),he=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=S(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=e,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface={},this.imagePreloader=new st,this.audioController=et()};F([b],he),he.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new At(this,t.rendererSettings);break;case"svg":this.renderer=new Tt(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),rt.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},he.prototype.setData=function(t,e){var s={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;s.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",s.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===a||(s.loop="false"!==a&&("true"===a||parseInt(a)));var r=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;s.autoplay="false"!==r,s.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(s.prerender=!1),this.setParams(s)},he.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,s,i=this.animationData.layers,a=i.length,r=t.layers,n=r.length;for(s=0;s<n;s+=1)for(e=0;e<a;){if(i[e].id==r[s].id){i[e]=r[s];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,M.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),h&&h.initExpressions(this),this.loadNextSegment()},he.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,rt.load(s,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},he.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},he.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},he.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},he.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},he.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},he.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,M.completeData(this.animationData,this.renderer.globalData.fontManager),h&&h.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},he.prototype.resize=function(){this.renderer.updateContainerSize()},he.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},he.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},he.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},he.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},he.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},he.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},he.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},he.prototype.goToAndStop=function(t,e,s){s&&this.name!=s||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},he.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},he.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(s=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},he.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},he.prototype.setSegment=function(t,e){var s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==s&&this.goToAndStop(s,!0)},he.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var s,i=t.length;for(s=0;s<i;s+=1)this.segments.push(t[s])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},he.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},he.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},he.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},he.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},he.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},he.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},he.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},he.prototype.getVolume=function(){return this.audioController.getVolume()},he.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},he.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},he.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},he.prototype.getPath=function(){return this.path},he.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},he.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;e<s;){if(t==this.assets[e].id)return this.assets[e];e+=1}},he.prototype.hide=function(){this.renderer.hide()},he.prototype.show=function(){this.renderer.show()},he.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},he.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new r(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new l(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new o(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new p(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new d(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new r(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new l(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new o(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new p(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new d(t,this))},he.prototype.triggerRenderFrameError=function(t){var e=new c(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var lottie={};he.prototype.triggerConfigError=function(t){var e=new u(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};function oe(){!0===le?ne.searchAnimations(pe,le,fe):ne.searchAnimations()}lottie.play=ne.play,lottie.pause=ne.pause,lottie.setLocationHref=function(t){k=t},lottie.togglePause=ne.togglePause,lottie.setSpeed=ne.setSpeed,lottie.setDirection=ne.setDirection,lottie.stop=ne.stop,lottie.searchAnimations=oe,lottie.registerAnimation=ne.registerAnimation,lottie.loadAnimation=function(t){return!0===le&&(t.animationData=JSON.parse(pe)),ne.loadAnimation(t)},lottie.setSubframeRendering=function(t){e=t},lottie.resize=ne.resize,lottie.goToAndStop=ne.goToAndStop,lottie.destroy=ne.destroy,lottie.setQuality=function(t){if("string"==typeof t)switch(t){case"high":D=200;break;case"medium":D=50;break;case"low":D=10}else!isNaN(t)&&1<t&&(D=t);a(!(50<=D))},lottie.inBrowser=function(){return"undefined"!=typeof navigator},lottie.installPlugin=function(t,e){"expressions"===t&&(h=e)},lottie.freeze=ne.freeze,lottie.unfreeze=ne.unfreeze,lottie.setVolume=ne.setVolume,lottie.mute=ne.mute,lottie.unmute=ne.unmute,lottie.getRegisteredAnimations=ne.getRegisteredAnimations,lottie.__getFactory=function(t){switch(t){case"propertyFactory":return L;case"shapePropertyFactory":return O;case"matrix":return E}},lottie.version="5.7.5";var le="__[STANDALONE]__",pe="__[ANIMATIONDATA]__",fe="";if(le){var me=document.getElementsByTagName("script"),de=(me[me.length-1]||{src:""}).src.replace(/^[^\?]+\??/,"");fe=function(t){for(var e=de.split("&"),s=0;s<e.length;s++){var i=e[s].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}}("renderer")}var ce=setInterval(function(){"complete"===document.readyState&&(clearInterval(ce),oe())},100);
+	"use strict";var h,k="",s=-999999,e=!0,n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),_=Math.pow,C=Math.sqrt,f=Math.floor,m=(Math.max,Math.min),i={};!function(){var t,e=["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"],s=e.length;for(t=0;t<s;t+=1)i[e[t]]=Math[e[t]]}(),i.random=Math.random,i.abs=function(t){if("object"===typeof t&&t.length){var e,s=x(t.length),i=t.length;for(e=0;e<i;e+=1)s[e]=Math.abs(t[e]);return s}return Math.abs(t)};var D=150,B=Math.PI/180,v=.5519;function a(t){t?Math.round:function(t){return t}}function r(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function o(t,e){this.type=t,this.direction=e<0?-1:1}function l(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}function p(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function d(t,e){this.type=t,this.target=e}function c(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function u(t){this.type="configError",this.nativeError=t}a(!1);var t,S=(t=0,function(){return"__lottie_element_"+(t+=1)});function g(t,e,s){var i,a,r,n,h,o,l,p;switch(o=s*(1-e),l=s*(1-(h=6*t-(n=Math.floor(6*t)))*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function y(t,e,s){var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function lt(t,e){var s=y(255*t[0],255*t[1],255*t[2]);return s[1]+=e,1<s[1]?s[1]=1:s[1]<=0&&(s[1]=0),g(s[0],s[1],s[2])}function pt(t,e){var s=y(255*t[0],255*t[1],255*t[2]);return s[2]+=e,1<s[2]?s[2]=1:s[2]<0&&(s[2]=0),g(s[0],s[1],s[2])}function ft(t,e){var s=y(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,1<s[0]?s[0]-=1:s[0]<0&&(s[0]+=1),g(s[0],s[1],s[2])}!function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1===e.length?"0"+e:e}();function b(){}b.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;i<s;i+=1)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s-=1,i-=1),s+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var j=function(){function s(t,e){var s,i=0,a=[];switch(t){case"int16":case"uint8c":s=1;break;default:s=1.1}for(i=0;i<e;i+=1)a.push(s);return a}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):s(t,e)}:s}();function x(t){return Array.apply(null,{length:t})}function P(t){return document.createElement(t)}function w(){}w.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var T,A=(T={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return T[t]||""}),E=function(){var a=Math.cos,r=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function s(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var s=a(e),i=r(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}function m(t,e,s){return s||0===s||(s=1),1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}function d(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=a,this.props[5]=r,this.props[6]=n,this.props[7]=h,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=d,this.props[14]=c,this.props[15]=u,this}function c(t,e,s){return s=s||0,0!==t||0!==e||0!==s?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1):this}function u(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){var g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===a&&1===r&&0===n&&0===h&&0===o&&0===l&&1===p&&0===f)return g[12]=g[12]*t+g[15]*m,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*c,g[15]*=u,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],_=g[3],C=g[4],k=g[5],D=g[6],S=g[7],x=g[8],P=g[9],w=g[10],T=g[11],A=g[12],F=g[13],M=g[14],I=g[15];return g[0]=y*t+v*a+b*o+_*m,g[1]=y*e+v*r+b*l+_*d,g[2]=y*s+v*n+b*p+_*c,g[3]=y*i+v*h+b*f+_*u,g[4]=C*t+k*a+D*o+S*m,g[5]=C*e+k*r+D*l+S*d,g[6]=C*s+k*n+D*p+S*c,g[7]=C*i+k*h+D*f+S*u,g[8]=x*t+P*a+w*o+T*m,g[9]=x*e+P*r+w*l+T*d,g[10]=x*s+P*n+w*p+T*c,g[11]=x*i+P*h+w*f+T*u,g[12]=A*t+F*a+M*o+I*m,g[13]=A*e+F*r+M*l+I*d,g[14]=A*s+F*n+M*p+I*c,g[15]=A*i+F*h+M*f+I*u,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function _(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}function C(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function k(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function D(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function S(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,a=this.props[0]/t,r=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,h=new E;return h.props[0]=e,h.props[1]=s,h.props[4]=i,h.props[5]=a,h.props[12]=r,h.props[13]=n,h}function x(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function P(t){var e,s=t.length,i=[];for(e=0;e<s;e+=1)i[e]=x(t[e]);return i}function w(t,e,s){var i=j("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=s[0],i[5]=s[1];else{var a=this.props[0],r=this.props[1],n=this.props[4],h=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*a+t[1]*n+o,i[1]=t[0]*r+t[1]*h+l,i[2]=e[0]*a+e[1]*n+o,i[3]=e[0]*r+e[1]*h+l,i[4]=s[0]*a+s[1]*n+o,i[5]=s[0]*r+s[1]*h+l}return i}function T(t,e,s){return this.isIdentity()?[t,e,s]:[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}function A(t,e){if(this.isIdentity())return t+","+e;var s=this.props;return Math.round(100*(t*s[0]+e*s[4]+s[12]))/100+","+Math.round(100*(t*s[1]+e*s[5]+s[13]))/100}function F(){for(var t=0,e=this.props,s="matrix3d(";t<16;)s+=i(1e4*e[t])/1e4,s+=15===t?")":",",t+=1;return s}function M(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function I(){var t=this.props;return"matrix("+M(t[0])+","+M(t[1])+","+M(t[4])+","+M(t[5])+","+M(t[12])+","+M(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=s,this.rotateY=h,this.rotateZ=o,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=d,this.translate=c,this.transform=u,this.applyToPoint=_,this.applyToX=C,this.applyToY=k,this.applyToZ=D,this.applyToPointArray=T,this.applyToTriplePoints=w,this.applyToPointStringified=A,this.toCSS=F,this.to2dCSS=I,this.clone=v,this.cloneFromProps=b,this.equals=y,this.inversePoints=P,this.inversePoint=x,this.getInverseMatrix=S,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=j("float32",16),this.reset()}}();!function(h,o){var l,p=this,f=256,m=6,d="random",c=o.pow(f,m),u=o.pow(2,52),g=2*u,y=f-1;function v(t){var e,s=t.length,n=this,i=0,a=n.i=n.j=0,r=n.S=[];for(s||(t=[s++]);i<f;)r[i]=i++;for(i=0;i<f;i++)r[i]=r[a=y&a+t[i%s]+(e=r[i])],r[a]=e;n.g=function(t){for(var e,s=0,i=n.i,a=n.j,r=n.S;t--;)e=r[i=y&i+1],s=s*f+r[y&(r[i]=r[a=y&a+e])+(r[a]=e)];return n.i=i,n.j=a,s}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function _(t,e){for(var s,i=t+"",a=0;a<i.length;)e[y&a]=y&(s^=19*e[y&a])+i.charCodeAt(a++);return C(e)}function C(t){return String.fromCharCode.apply(0,t)}o["seed"+d]=function(t,e,s){var i=[],a=_(function t(e,s){var i,a=[],r=typeof e;if(s&&"object"==r)for(i in e)try{a.push(t(e[i],s-1))}catch(t){}return a.length?a:"string"==r?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,C(h)]:null===t?function(){try{if(l)return C(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),C(t)}catch(t){var e=p.navigator,s=e&&e.plugins;return[+new Date,p,s,p.screen,C(h)]}}():t,3),i),r=new v(i),n=function(){for(var t=r.g(m),e=c,s=0;t<u;)t=(t+s)*f,e*=f,s=r.g(1);for(;g<=t;)t/=2,e/=2,s>>>=1;return(t+s)/e};return n.int32=function(){return 0|r.g(4)},n.quick=function(){return r.g(4)/4294967296},n.double=n,_(C(r.S),h),(e.pass||s||function(t,e,s,i){return i&&(i.S&&b(i,r),t.state=function(){return b(r,{})}),s?(o[d]=t,e):t})(n,a,"global"in e?e.global:this==o,e.state)},_(o.random(),h)}([],i);var W=function(){var t={getBezierEasing:function(t,e,s,i,a){var r=a||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");if(h[r])return h[r];var n=new o([t,e,s,i]);return h[r]=n}},h={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function a(t,e){return 3*e-6*t}function r(t){return 3*t}function f(t,e,s){return((i(e,s)*t+a(e,s))*t+r(e))*t}function m(t,e,s){return 3*i(e,s)*t*t+2*a(e,s)*t+r(e)}function o(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return o.prototype={get:function(t){var e=this._p[0],s=this._p[1],i=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===s&&i===a?t:0===t?0:1===t?1:f(this._getTForX(t),s,a)},_precompute:function(){var t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&s===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;s<l;++s)this._mSampleValues[s]=f(s*p,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,a=0,r=1,n=l-1;r!==n&&i[r]<=t;++r)a+=p;var h=a+(t-i[--r])/(i[r+1]-i[r])*p,o=m(h,e,s);return.001<=o?function(t,e,s,i){for(var a=0;a<4;++a){var r=m(e,s,i);if(0===r)return e;e-=(f(e,s,i)-t)/r}return e}(t,h,e,s):0===o?h:function(t,e,s,i,a){for(var r,n,h=0;0<(r=f(n=e+(s-e)/2,i,a)-t)?s=n:e=n,1e-7<Math.abs(r)&&++h<10;);return n}(t,a,a+p,e,s)}},t}();function F(t,e){var s,i,a=t.length;for(s=0;s<a;s+=1)for(var r in i=t[s].prototype)Object.prototype.hasOwnProperty.call(i,r)&&(e.prototype[r]=i[r])}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),s=Math.max(0,16-(e-a)),i=setTimeout(function(){t(e+s)},s);return a=e+s,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var mt=function(){var A=Math;function g(t,e,s,i,a,r){var n=t*i+e*a+s*r-a*i-r*t-s*e;return-.001<n&&n<.001}var p=function(t,e,s,i){var a,r,n,h,o,l,p=D,f=0,m=[],d=[],c=wt.newElement();for(n=s.length,a=0;a<p;a+=1){for(o=a/(p-1),r=l=0;r<n;r+=1)h=_(1-o,3)*t[r]+3*_(1-o,2)*o*s[r]+3*(1-o)*_(o,2)*i[r]+_(o,3)*e[r],m[r]=h,null!==d[r]&&(l+=_(m[r]-d[r],2)),d[r]=m[r];l&&(f+=l=C(l)),c.percents[a]=o,c.lengths[a]=f}return c.addedLength=f,c};function y(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,s,i){var a=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+s[0]+"_"+s[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!b[a]){var r,n,h,o,l,p,f,m=D,d=0,c=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&g(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&g(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var u=new y(m);for(h=s.length,r=0;r<m;r+=1){for(f=x(h),l=r/(m-1),n=p=0;n<h;n+=1)o=_(1-l,3)*t[n]+3*_(1-l,2)*l*(t[n]+s[n])+3*(1-l)*_(l,2)*(e[n]+i[n])+_(l,3)*e[n],f[n]=o,null!==c&&(p+=_(f[n]-c[n],2));d+=p=C(p),u.points[r]=new v(p,f),c=f}u.segmentLength=d,b[a]=u}return b[a]});function F(t,e){var s=e.percents,i=e.lengths,a=s.length,r=f((a-1)*t),n=t*e.addedLength,h=0;if(r===a-1||0===r||n===i[r])return s[r];for(var o=i[r]>n?-1:1,l=!0;l;)if(i[r]<=n&&i[r+1]>n?(h=(n-i[r])/(i[r+1]-i[r]),l=!1):r+=o,r<0||a-1<=r){if(r===a-1)return s[r];l=!1}return s[r]+(s[r+1]-s[r])*h}var M=j("float32",8);return{getSegmentsLength:function(t){var e,s=Pt.newElement(),i=t.c,a=t.v,r=t.o,n=t.i,h=t._length,o=s.lengths,l=0;for(e=0;e<h-1;e+=1)o[e]=p(a[e],a[e+1],r[e],n[e+1]),l+=o[e].addedLength;return i&&h&&(o[e]=p(a[e],a[0],r[e],n[0]),l+=o[e].addedLength),s.totalLength=l,s},getNewSegment:function(t,e,s,i,a,r,n){a<0?a=0:1<a&&(a=1);var h,o=F(a,n),l=F(r=1<r?1:r,n),p=t.length,f=1-o,m=1-l,d=f*f*f,c=o*f*f*3,u=o*o*f*3,g=o*o*o,y=f*f*m,v=o*f*m+f*o*m+f*f*l,b=o*o*m+f*o*l+o*f*l,_=o*o*l,C=f*m*m,k=o*m*m+f*l*m+f*m*l,D=o*l*m+f*l*l+o*m*l,S=o*l*l,x=m*m*m,P=l*m*m+m*l*m+m*m*l,w=l*l*m+m*l*l+l*m*l,T=l*l*l;for(h=0;h<p;h+=1)M[4*h]=A.round(1e3*(d*t[h]+c*s[h]+u*i[h]+g*e[h]))/1e3,M[4*h+1]=A.round(1e3*(y*t[h]+v*s[h]+b*i[h]+_*e[h]))/1e3,M[4*h+2]=A.round(1e3*(C*t[h]+k*s[h]+D*i[h]+S*e[h]))/1e3,M[4*h+3]=A.round(1e3*(x*t[h]+P*s[h]+w*i[h]+T*e[h]))/1e3;return M},getPointInSegment:function(t,e,s,i,a,r){var n=F(a,r),h=1-n;return[A.round(1e3*(h*h*h*t[0]+(n*h*h+h*n*h+h*h*n)*s[0]+(n*n*h+h*n*n+n*h*n)*i[0]+n*n*n*e[0]))/1e3,A.round(1e3*(h*h*h*t[1]+(n*h*h+h*n*h+h*h*n)*s[1]+(n*n*h+h*n*n+n*h*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:g,pointOnLine3D:function(t,e,s,i,a,r,n,h,o){if(0===s&&0===r&&0===o)return g(t,e,i,a,n,h);var l,p=A.sqrt(A.pow(i-t,2)+A.pow(a-e,2)+A.pow(r-s,2)),f=A.sqrt(A.pow(n-t,2)+A.pow(h-e,2)+A.pow(o-s,2)),m=A.sqrt(A.pow(n-i,2)+A.pow(h-a,2)+A.pow(o-r,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}();var M=function(){function m(t,e,s){var i,a,r,n,h,o,l,p=t.length;for(a=0;a<p;a+=1)if("ks"in(i=t[a])&&!i.completed){if(i.completed=!0,i.tt&&(t[a-1].td=i.tt),i.hasMask){var f=i.masksProperties;for(n=f.length,r=0;r<n;r+=1)if(f[r].pt.k.i)u(f[r].pt.k);else for(o=f[r].pt.k.length,h=0;h<o;h+=1)f[r].pt.k[h].s&&u(f[r].pt.k[h].s[0]),f[r].pt.k[h].e&&u(f[r].pt.k[h].e[0])}0===i.ty?(i.layers=d(i.refId,e),m(i.layers,e,s)):4===i.ty?c(i.shapes):5===i.ty&&(0!==(l=i).t.a.length||"m"in l.t.p||(l.singleShape=!0))}}function d(t,e){for(var s=0,i=e.length;s<i;){if(e[s].id===t)return e[s].layers.__used?JSON.parse(JSON.stringify(e[s].layers)):(e[s].layers.__used=!0,e[s].layers);s+=1}return null}function c(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)u(t[e].ks.k);else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&u(t[e].ks.k[s].s[0]),t[e].ks.k[s].e&&u(t[e].ks.k[s].e[0]);else"gr"===t[e].ty&&c(t[e].it)}function u(t){var e,s=t.i.length;for(e=0;e<s;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function h(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&null))}var o,s=function(){var i=[4,4,14];function a(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)5===t[e].ty&&(s=t[e],i=s.t.d,s.t.d={k:[{s:i,t:0}]})}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),i=(o=[4,7,99],function(t){if(t.chars&&!h(o,t.v)){var e,s,i,a,r,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(r=t.chars[e].data.shapes[0].it).length,s=0;s<i;s+=1)(a=r[s].ks.k).__converted||(u(r[s].ks.k),a.__converted=!0)}}),a=function(){var i=[4,1,9];function r(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)if("gr"===t[e].ty)r(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,s=0;s<i;s+=1)t[e].c.k[s].s&&(t[e].c.k[s].s[0]/=255,t[e].c.k[s].s[1]/=255,t[e].c.k[s].s[2]/=255,t[e].c.k[s].s[3]/=255),t[e].c.k[s].e&&(t[e].c.k[s].e[0]/=255,t[e].c.k[s].e[1]/=255,t[e].c.k[s].e[2]/=255,t[e].c.k[s].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function a(t){var e,s=t.length;for(e=0;e<s;e+=1)4===t[e].ty&&r(t[e].shapes)}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),r=function(){var i=[4,4,18];function l(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&(t[e].ks.k[s].s[0].c=t[e].closed),t[e].ks.k[s].e&&(t[e].ks.k[s].e[0].c=t[e].closed);else"gr"===t[e].ty&&l(t[e].it)}function a(t){var e,s,i,a,r,n,h=t.length;for(s=0;s<h;s+=1){if((e=t[s]).hasMask){var o=e.masksProperties;for(a=o.length,i=0;i<a;i+=1)if(o[i].pt.k.i)o[i].pt.k.c=o[i].cl;else for(n=o[i].pt.k.length,r=0;r<n;r+=1)o[i].pt.k[r].s&&(o[i].pt.k[r].s[0].c=o[i].cl),o[i].pt.k[r].e&&(o[i].pt.k[r].e[0].c=o[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}();var t={completeData:function(t,e){t.__complete||(a(t),s(t),i(t),r(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=a,t.checkChars=i,t.checkShapes=r,t.completeLayers=m,t}();function q(t){for(var e=t.fStyle?t.fStyle.split(" "):[],s="normal",i="normal",a=e.length,r=0;r<a;r+=1)switch(e[r].toLowerCase()){case"italic":i="italic";break;case"bold":s="700";break;case"black":s="900";break;case"medium":s="500";break;case"regular":case"normal":s="400";break;case"light":case"thin":s="200"}return{style:i,weight:t.fWeight||s}}var I=function(){var r={w:0,size:0,shapes:[]},t=[];function m(t,e){var s=P("span");s.style.fontFamily=e;var i=P("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);var a=i.offsetWidth;return i.style.fontFamily=function(t){var e,s=t.split(","),i=s.length,a=[];for(e=0;e<i;e+=1)"sans-serif"!==s[e]&&"monospace"!==s[e]&&a.push(s[e]);return a.join(",")}(t)+", "+e,{node:i,w:a,parent:s}}function d(t,e){var s=createNS("text");s.style.fontSize="100px";var i=q(e);return s.setAttribute("font-family",e.fFamily),s.setAttribute("font-style",i.style),s.setAttribute("font-weight",i.weight),s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.setAttribute("class",e.fClass)):s.style.fontFamily=e.fFamily,t.appendChild(s),P("canvas").getContext("2d").font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,s}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var s,i,a=t.length,r=this.chars.length;for(e=0;e<a;e+=1){for(s=0,i=!1;s<r;)this.chars[s].style===t[e].style&&this.chars[s].fFamily===t[e].fFamily&&this.chars[s].ch===t[e].ch&&(i=!0),s+=1;i||(this.chars.push(t[e]),r+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var s,i=t.list,a=i.length,r=a;for(s=0;s<a;s+=1){var n,h,o=!0;if(i[s].loaded=!1,i[s].monoCase=m(i[s].fFamily,"monospace"),i[s].sansCase=m(i[s].fFamily,"sans-serif"),i[s].fPath){if("p"===i[s].fOrigin||3===i[s].origin){if(0<(n=document.querySelectorAll('style[f-forigin="p"][f-family="'+i[s].fFamily+'"], style[f-origin="3"][f-family="'+i[s].fFamily+'"]')).length&&(o=!1),o){var l=P("style");l.setAttribute("f-forigin",i[s].fOrigin),l.setAttribute("f-origin",i[s].origin),l.setAttribute("f-family",i[s].fFamily),l.type="text/css",l.innerText="@font-face {font-family: "+i[s].fFamily+"; font-style: normal; src: url('"+i[s].fPath+"');}",e.appendChild(l)}}else if("g"===i[s].fOrigin||1===i[s].origin){for(n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),h=0;h<n.length;h+=1)-1!==n[h].href.indexOf(i[s].fPath)&&(o=!1);if(o){var p=P("link");p.setAttribute("f-forigin",i[s].fOrigin),p.setAttribute("f-origin",i[s].origin),p.type="text/css",p.rel="stylesheet",p.href=i[s].fPath,document.body.appendChild(p)}}else if("t"===i[s].fOrigin||2===i[s].origin){for(n=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),h=0;h<n.length;h+=1)i[s].fPath===n[h].src&&(o=!1);if(o){var f=P("link");f.setAttribute("f-forigin",i[s].fOrigin),f.setAttribute("f-origin",i[s].origin),f.setAttribute("rel","stylesheet"),f.setAttribute("href",i[s].fPath),e.appendChild(f)}}}else i[s].loaded=!0,r-=1;i[s].helper=d(e,i[s]),i[s].cache={},this.fonts.push(i[s])}0===r?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,s){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),r},getFontByName:function(t){for(var e=0,s=this.fonts.length;e<s;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,s){var i=this.getFontByName(e),a=t.charCodeAt(0);if(!i.cache[a+1]){var r=i.helper;if(" "===t){r.textContent="|"+t+"|";var n=r.getComputedTextLength();r.textContent="||";var h=r.getComputedTextLength();i.cache[a+1]=(n-h)/100}else r.textContent=t,i.cache[a+1]=r.getComputedTextLength()/100}return i.cache[a+1]*s},checkLoadedFonts:function(){var t,e,s,i=this.fonts.length,a=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?a-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,s=this.fonts[t].monoCase.w,e.offsetWidth!==s?(a-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,s=this.fonts[t].sansCase.w,e.offsetWidth!==s&&(a-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==a&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),L=function(){var f=s,a=Math.abs;function m(t,e){var s,i=this.offsetTime;"multidimensional"===this.propType&&(s=j("float32",this.pv.length));for(var a,r,n,h,o,l,p,f,m=e.lastIndex,d=m,c=this.keyframes.length-1,u=!0;u;){if(a=this.keyframes[d],r=this.keyframes[d+1],d===c-1&&t>=r.t-i){a.h&&(a=r),m=0;break}if(r.t-i>t){m=d;break}d<c-1?d+=1:(m=0,u=!1)}var g,y,v,b,_,C,k,D,S,x,P=r.t-i,w=a.t-i;if(a.to){a.bezierData||(a.bezierData=mt.buildBezierData(a.s,r.s||a.e,a.to,a.ti));var T=a.bezierData;if(P<=t||t<w){var A=P<=t?T.points.length-1:0;for(h=T.points[A].point.length,n=0;n<h;n+=1)s[n]=T.points[A].point[n]}else{a.__fnct?f=a.__fnct:(f=W.getBezierEasing(a.o.x,a.o.y,a.i.x,a.i.y,a.n).get,a.__fnct=f),o=f((t-w)/(P-w));var F,M=T.segmentLength*o,I=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastPoint:0,u=!0,l=T.points.length;u;){if(I+=T.points[p].partialLength,0===M||0===o||p===T.points.length-1){for(h=T.points[p].point.length,n=0;n<h;n+=1)s[n]=T.points[p].point[n];break}if(I<=M&&M<I+T.points[p+1].partialLength){for(F=(M-I)/T.points[p+1].partialLength,h=T.points[p].point.length,n=0;n<h;n+=1)s[n]=T.points[p].point[n]+(T.points[p+1].point[n]-T.points[p].point[n])*F;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=I-T.points[p].partialLength,e._lastKeyframeIndex=d}}else{var E,L,R,V,N;if(c=a.s.length,g=r.s||a.e,this.sh&&1!==a.h)if(P<=t)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=w)s[0]=a.s[0],s[1]=a.s[1],s[2]=a.s[2];else{var z=q(a.s),O=q(g);y=s,v=function(t,e,s){var i,a,r,n,h,o=[],l=t[0],p=t[1],f=t[2],m=t[3],d=e[0],c=e[1],u=e[2],g=e[3];(a=l*d+p*c+f*u+m*g)<0&&(a=-a,d=-d,c=-c,u=-u,g=-g);h=1e-6<1-a?(i=Math.acos(a),r=Math.sin(i),n=Math.sin((1-s)*i)/r,Math.sin(s*i)/r):(n=1-s,s);return o[0]=n*l+h*d,o[1]=n*p+h*c,o[2]=n*f+h*u,o[3]=n*m+h*g,o}(z,O,(t-w)/(P-w)),b=v[0],_=v[1],C=v[2],k=v[3],D=Math.atan2(2*_*k-2*b*C,1-2*_*_-2*C*C),S=Math.asin(2*b*_+2*C*k),x=Math.atan2(2*b*k-2*_*C,1-2*b*b-2*C*C),y[0]=D/B,y[1]=S/B,y[2]=x/B}else for(d=0;d<c;d+=1)1!==a.h&&(o=P<=t?1:t<w?0:(a.o.x.constructor===Array?(a.__fnct||(a.__fnct=[]),a.__fnct[d]?f=a.__fnct[d]:(E=void 0===a.o.x[d]?a.o.x[0]:a.o.x[d],L=void 0===a.o.y[d]?a.o.y[0]:a.o.y[d],R=void 0===a.i.x[d]?a.i.x[0]:a.i.x[d],V=void 0===a.i.y[d]?a.i.y[0]:a.i.y[d],f=W.getBezierEasing(E,L,R,V).get,a.__fnct[d]=f)):a.__fnct?f=a.__fnct:(E=a.o.x,L=a.o.y,R=a.i.x,V=a.i.y,f=W.getBezierEasing(E,L,R,V).get,a.__fnct=f),f((t-w)/(P-w)))),g=r.s||a.e,N=1===a.h?a.s[d]:a.s[d]+(g[d]-a.s[d])*o,"multidimensional"===this.propType?s[d]=N:s=N}return e.lastIndex=m,s}function q(t){var e=t[0]*B,s=t[1]*B,i=t[2]*B,a=Math.cos(e/2),r=Math.cos(s/2),n=Math.cos(i/2),h=Math.sin(e/2),o=Math.sin(s/2),l=Math.sin(i/2);return[h*o*n+a*r*l,h*r*n+a*o*l,a*o*n-h*r*l,a*r*n-h*o*l]}function d(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=s&&s<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function c(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<a(this.v-e)&&(this.v=e,this._mdf=!0);else for(var s=0,i=this.v.length;s<i;)e=t[s]*this.mult,1e-5<a(this.v[s]-e)&&(this.v[s]=e,this._mdf=!0),s+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,s=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)s=this.effectsSequence[t](s);this.setVValue(s),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function g(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,s,i){this.propType="unidimensional",this.mult=s||1,this.data=e,this.v=s?e.k*s:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.addEffect=g}function h(t,e,s,i){var a;this.propType="multidimensional",this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var r=e.k.length;for(this.v=j("float32",r),this.pv=j("float32",r),this.vel=j("float32",r),a=0;a<r;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=c,this.addEffect=g}function o(t,e,s,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.effectsSequence=[d.bind(this)],this.addEffect=g}function l(t,e,s,i){var a;this.propType="multidimensional";var r,n,h,o,l=e.k.length;for(a=0;a<l-1;a+=1)e.k[a].to&&e.k[a].s&&e.k[a+1]&&e.k[a+1].s&&(r=e.k[a].s,n=e.k[a+1].s,h=e.k[a].to,o=e.k[a].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+h[0],r[1]+h[1],r[2]+h[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(e.k[a].to=null,e.k[a].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===h[0]&&0===h[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===n[2]&&0===h[2]&&0===o[2])&&(e.k[a].to=null,e.k[a].ti=null));this.effectsSequence=[d.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=j("float32",p),this.pv=j("float32",p),a=0;a<p;a+=1)this.v[a]=f,this.pv[a]=f;this._caching={lastFrame:f,lastIndex:0,value:j("float32",p)},this.addEffect=g}return{getProp:function(t,e,s,i,a){var r;if(e.k.length)if("number"==typeof e.k[0])r=new h(t,e,i,a);else switch(s){case 0:r=new o(t,e,i,a);break;case 1:r=new l(t,e,i,a)}else r=new n(t,e,i,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}}}(),R=function(){var n=[0,0];function i(t,e,s){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new E,this.pre=new E,this.appliedTransformations=0,this.initDynamicPropertyContainer(s||t),e.p&&e.p.s?(this.px=L.getProp(t,e.p.x,0,0,this),this.py=L.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=L.getProp(t,e.p.z,0,0,this))):this.p=L.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=L.getProp(t,e.rx,0,B,this),this.ry=L.getProp(t,e.ry,0,B,this),this.rz=L.getProp(t,e.rz,0,B,this),e.or.k[0].ti){var i,a=e.or.k.length;for(i=0;i<a;i+=1)e.or.k[i].to=null,e.or.k[i].ti=null}this.or=L.getProp(t,e.or,1,B,this),this.or.sh=!0}else this.r=L.getProp(t,e.r||{k:0},0,B,this);e.sk&&(this.sk=L.getProp(t,e.sk,0,B,this),this.sa=L.getProp(t,e.sa,0,B,this)),this.a=L.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=L.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=L.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var e;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var s,i;if(e=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(s=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(s=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){s=[],i=[];var a=this.px,r=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(s[0]=a.getValueAtTime((a.keyframes[0].t+.01)/e,0),s[1]=r.getValueAtTime((r.keyframes[0].t+.01)/e,0),i[0]=a.getValueAtTime(a.keyframes[0].t/e,0),i[1]=r.getValueAtTime(r.keyframes[0].t/e,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(s[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/e,0),s[1]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/e,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/e,0),i[1]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/e,0)):(s=[a.pv,r.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/e,a.offsetTime),i[1]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/e,r.offsetTime))}else s=i=n;this.v.rotate(-Math.atan2(s[1]-i[1],s[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},F([w],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=w.prototype.addDynamicProperty,{getTransformProperty:function(t,e,s){return new i(t,e,s)}}}();function V(){this.c=!1,this._length=0,this._maxLength=8,this.v=x(this._maxLength),this.o=x(this._maxLength),this.i=x(this._maxLength)}V.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var s=0;s<e;)this.v[s]=Dt.newElement(),this.o[s]=Dt.newElement(),this.i[s]=Dt.newElement(),s+=1},V.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},V.prototype.doubleArrayLength=function(){this.v=this.v.concat(x(this._maxLength)),this.i=this.i.concat(x(this._maxLength)),this.o=this.o.concat(x(this._maxLength)),this._maxLength*=2},V.prototype.setXYAt=function(t,e,s,i,a){var r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o;break;default:r=[]}(!r[i]||r[i]&&!a)&&(r[i]=Dt.newElement()),r[i][0]=t,r[i][1]=e},V.prototype.setTripleAt=function(t,e,s,i,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(s,i,"o",n,h),this.setXYAt(a,r,"i",n,h)},V.prototype.reverse=function(){var t=new V;t.setPathData(this.c,this._length);var e=this.v,s=this.o,i=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],s[0][0],s[0][1],0,!1),a=1);var r,n=this._length-1,h=this._length;for(r=a;r<h;r+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],s[n][0],s[n][1],r,!1),n-=1;return t};var N,z,O=function(){var a=-999999;function t(t,e,s){var i,a,r,n,h,o,l,p,f,m=s.lastIndex,d=this.keyframes;if(t<d[0].t-this.offsetTime)i=d[0].s[0],r=!0,m=0;else if(t>=d[d.length-1].t-this.offsetTime)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var c,u,g=m,y=d.length-1,v=!0;v&&(c=d[g],!((u=d[g+1]).t-this.offsetTime>t));)g<y-1?g+=1:v=!1;if(m=g,!(r=1===c.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<c.t-this.offsetTime)p=0;else{var b;c.__fnct?b=c.__fnct:(b=W.getBezierEasing(c.o.x,c.o.y,c.i.x,c.i.y).get,c.__fnct=b),p=b((t-(c.t-this.offsetTime))/(u.t-this.offsetTime-(c.t-this.offsetTime)))}a=u.s?u.s[0]:c.e[0]}i=c.s[0]}for(o=e._length,l=i.i[0].length,s.lastIndex=m,n=0;n<o;n+=1)for(h=0;h<l;h+=1)f=r?i.i[n][h]:i.i[n][h]+(a.i[n][h]-i.i[n][h])*p,e.i[n][h]=f,f=r?i.o[n][h]:i.o[n][h]+(a.o[n][h]-i.o[n][h])*p,e.o[n][h]=f,f=r?i.v[n][h]:i.v[n][h]+(a.v[n][h]-i.v[n][h])*p,e.v[n][h]=f}function r(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var s,i=t._length;for(s=0;s<i;s+=1)if(t.v[s][0]!==e.v[s][0]||t.v[s][1]!==e.v[s][1]||t.o[s][0]!==e.o[s][0]||t.o[s][1]!==e.o[s][1]||t.i[s][0]!==e.i[s][0]||t.i[s][1]!==e.i[s][1])return!1;return!0})(this.v,t)||(this.v=St.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var s=this.effectsSequence.length;for(e=0;e<s;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,s){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===s?e.pt.k:e.ks.k;this.v=St.clone(i),this.pv=St.clone(this.v),this.localShapeCollection=xt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function h(t,e,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.v=St.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=St.clone(this.v),this.localShapeCollection=xt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=a,this.reset=r,this._caching={lastFrame:a,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==a&&(i<e&&t<e||s<i&&s<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=s,n.prototype.setVValue=e,n.prototype.addEffect=i,h.prototype.getValue=s,h.prototype.interpolateShape=t,h.prototype.setVValue=e,h.prototype.addEffect=i;var o=function(){var n=v;function t(t,e){this.v=St.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=xt.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=L.getProp(t,e.p,1,0,this),this.s=L.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=3!==this.d,r=this.v;r.v[0][0]=t,r.v[0][1]=e-i,r.v[1][0]=a?t+s:t-s,r.v[1][1]=e,r.v[2][0]=t,r.v[2][1]=e+i,r.v[3][0]=a?t-s:t+s,r.v[3][1]=e,r.i[0][0]=a?t-s*n:t+s*n,r.i[0][1]=e-i,r.i[1][0]=a?t+s:t-s,r.i[1][1]=e-i*n,r.i[2][0]=a?t+s*n:t-s*n,r.i[2][1]=e+i,r.i[3][0]=a?t-s:t+s,r.i[3][1]=e+i*n,r.o[0][0]=a?t+s*n:t-s*n,r.o[0][1]=e-i,r.o[1][0]=a?t+s:t-s,r.o[1][1]=e+i*n,r.o[2][0]=a?t-s*n:t+s*n,r.o[2][1]=e+i,r.o[3][0]=a?t-s:t+s,r.o[3][1]=e-i*n}},F([w],t),t}(),l=function(){function t(t,e){this.v=St.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=L.getProp(t,e.ir,0,0,this),this.is=L.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=L.getProp(t,e.pt,0,0,this),this.p=L.getProp(t,e.p,1,0,this),this.r=L.getProp(t,e.r,0,B,this),this.or=L.getProp(t,e.or,0,0,this),this.os=L.getProp(t,e.os,0,.01,this),this.localShapeCollection=xt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,s,i,a=2*Math.floor(this.pt.v),r=2*Math.PI/a,n=!0,h=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*h/(2*a),m=2*Math.PI*o/(2*a),d=-Math.PI/2;d+=this.r.v;var c=3===this.data.d?-1:1;for(t=this.v._length=0;t<a;t+=1){s=n?l:p,i=n?f:m;var u=(e=n?h:o)*Math.cos(d),g=e*Math.sin(d),y=0===u&&0===g?0:g/Math.sqrt(u*u+g*g),v=0===u&&0===g?0:-u/Math.sqrt(u*u+g*g);u+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(u,g,u-y*i*s*c,g-v*i*s*c,u+y*i*s*c,g+v*i*s*c,t,!0),n=!n,d+=r*c}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),s=2*Math.PI/e,i=this.or.v,a=this.os.v,r=2*Math.PI*i/(4*e),n=.5*-Math.PI,h=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var o=i*Math.cos(n),l=i*Math.sin(n),p=0===o&&0===l?0:l/Math.sqrt(o*o+l*l),f=0===o&&0===l?0:-o/Math.sqrt(o*o+l*l);o+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(o,l,o-p*r*a*h,l-f*r*a*h,o+p*r*a*h,l+f*r*a*h,t,!0),n+=s*h}this.paths.length=0,this.paths[0]=this.v}},F([w],t),t}(),p=function(){function t(t,e){this.v=St.newElement(),this.v.c=!0,this.localShapeCollection=xt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=L.getProp(t,e.p,1,0,this),this.s=L.getProp(t,e.s,1,0,this),this.r=L.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=m(s,i,this.r.v),r=a*(1-v);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+a,t+s,e-i+r,0,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-r,t+s,e+i-a,1,!0),0!==a?(this.v.setTripleAt(t+s-a,e+i,t+s-a,e+i,t+s-r,e+i,2,!0),this.v.setTripleAt(t-s+a,e+i,t-s+r,e+i,t-s+a,e+i,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-a,t-s,e+i-r,4,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+r,t-s,e-i+a,5,!0),this.v.setTripleAt(t-s+a,e-i,t-s+a,e-i,t-s+r,e-i,6,!0),this.v.setTripleAt(t+s-a,e-i,t+s-r,e-i,t+s-a,e-i,7,!0)):(this.v.setTripleAt(t-s,e+i,t-s+r,e+i,t-s,e+i,2),this.v.setTripleAt(t-s,e-i,t-s,e-i+r,t-s,e-i,3))):(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+r,t+s,e-i+a,0,!0),0!==a?(this.v.setTripleAt(t+s-a,e-i,t+s-a,e-i,t+s-r,e-i,1,!0),this.v.setTripleAt(t-s+a,e-i,t-s+r,e-i,t-s+a,e-i,2,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+a,t-s,e-i+r,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-r,t-s,e+i-a,4,!0),this.v.setTripleAt(t-s+a,e+i,t-s+a,e+i,t-s+r,e+i,5,!0),this.v.setTripleAt(t+s-a,e+i,t+s-r,e+i,t+s-a,e+i,6,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-a,t+s,e+i-r,7,!0)):(this.v.setTripleAt(t-s,e-i,t-s+r,e-i,t-s,e-i,1,!0),this.v.setTripleAt(t-s,e+i,t-s,e+i-r,t-s,e+i,2,!0),this.v.setTripleAt(t+s,e+i,t+s-r,e+i,t+s,e+i,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:r},F([w],t),t}();var f={getShapeProp:function(t,e,s){var i;return 3===s||4===s?i=(3===s?e.pt:e.ks).k.length?new h(t,e,s):new n(t,e,s):5===s?i=new p(t,e):6===s?i=new o(t,e):7===s&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return h}};return f}(),Y=(z={},(N={}).registerModifier=function(t,e){z[t]||(z[t]=e)},N.getModifier=function(t,e,s){return new z[t](e,s)},N);function G(){}function X(){}function H(){}function K(){}function J(){}function Z(){this._length=0,this._maxLength=4,this.shapes=x(this._maxLength)}function U(t,e,s,i){var a;this.elem=t,this.frameId=-1,this.dataProps=x(e.length),this.renderer=s,this.k=!1,this.dashStr="",this.dashArray=j("float32",e.length?e.length-1:0),this.dashoffset=j("float32",1),this.initDynamicPropertyContainer(i);var r,n=e.length||0;for(a=0;a<n;a+=1)r=L.getProp(t,e[a].v,0,0,this),this.k=r.k||this.k,this.dataProps[a]={n:e[a].n,p:r};this.k||this.getValue(!0),this._isAnimated=this.k}function Q(t,e,s){this.data=e,this.c=j("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=j("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=L.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}G.prototype.initModifierProperties=function(){},G.prototype.addShapeToModifier=function(){},G.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:xt.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},G.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=s,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},G.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},F([w],G),F([G],X),X.prototype.initModifierProperties=function(t,e){this.s=L.getProp(t,e.s,0,.01,this),this.e=L.getProp(t,e.e,0,.01,this),this.o=L.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},X.prototype.addShapeToModifier=function(t){t.pathsData=[]},X.prototype.calculateShapeEdges=function(t,e,s,i,a){var r=[];e<=1?r.push({s:t,e:e}):1<=t?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],l=r.length;for(n=0;n<l;n+=1){var p,f;if(!((h=r[n]).e*a<i||h.s*a>i+s))p=h.s*a<=i?0:(h.s*a-i)/s,f=h.e*a>=i+s?1:(h.e*a-i)/s,o.push([p,f])}return o.length||o.push([0,0]),o},X.prototype.releasePathsData=function(t){var e,s=t.length;for(e=0;e<s;e+=1)Pt.release(t[e]);return t.length=0,t},X.prototype.processShapes=function(t){var e,s,i,a;if(this._mdf||t){var r=this.o.v%360/360;if(r<0&&(r+=1),e=1<this.s.v?1+r:this.s.v<0?0+r:this.s.v+r,(s=1<this.e.v?1+r:this.e.v<0?0+r:this.e.v+r)<e){var n=e;e=s,s=n}e=1e-4*Math.round(1e4*e),s=1e-4*Math.round(1e4*s),this.sValue=e,this.eValue=s}else e=this.sValue,s=this.eValue;var h,o,l,p,f,m=this.shapes.length,d=0;if(s===e)for(a=0;a<m;a+=1)this.shapes[a].localShapeCollection.releaseShapes(),this.shapes[a].shape._mdf=!0,this.shapes[a].shape.paths=this.shapes[a].localShapeCollection,this._mdf&&(this.shapes[a].pathsData.length=0);else if(1===s&&0===e||0===s&&1===e){if(this._mdf)for(a=0;a<m;a+=1)this.shapes[a].pathsData.length=0,this.shapes[a].shape._mdf=!0}else{var c,u,g=[];for(a=0;a<m;a+=1)if((c=this.shapes[a]).shape._mdf||this._mdf||t||2===this.m){if(o=(i=c.shape.paths)._length,f=0,!c.shape._mdf&&c.pathsData.length)f=c.totalShapeLength;else{for(l=this.releasePathsData(c.pathsData),h=0;h<o;h+=1)p=mt.getSegmentsLength(i.shapes[h]),l.push(p),f+=p.totalLength;c.totalShapeLength=f,c.pathsData=l}d+=f,c.shape._mdf=!0}else c.shape.paths=c.localShapeCollection;var y,v=e,b=s,_=0;for(a=m-1;0<=a;a-=1)if((c=this.shapes[a]).shape._mdf){for((u=c.localShapeCollection).releaseShapes(),2===this.m&&1<m?(y=this.calculateShapeEdges(e,s,c.totalShapeLength,_,d),_+=c.totalShapeLength):y=[[v,b]],o=y.length,h=0;h<o;h+=1){v=y[h][0],b=y[h][1],g.length=0,b<=1?g.push({s:c.totalShapeLength*v,e:c.totalShapeLength*b}):1<=v?g.push({s:c.totalShapeLength*(v-1),e:c.totalShapeLength*(b-1)}):(g.push({s:c.totalShapeLength*v,e:c.totalShapeLength}),g.push({s:0,e:c.totalShapeLength*(b-1)}));var C=this.addShapes(c,g[0]);if(g[0].s!==g[0].e){if(1<g.length)if(c.shape.paths.shapes[c.shape.paths._length-1].c){var k=C.pop();this.addPaths(C,u),C=this.addShapes(c,g[1],k)}else this.addPaths(C,u),C=this.addShapes(c,g[1]);this.addPaths(C,u)}}c.shape.paths=u}}},X.prototype.addPaths=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e.addShape(t[s])},X.prototype.addSegment=function(t,e,s,i,a,r,n){a.setXYAt(e[0],e[1],"o",r),a.setXYAt(s[0],s[1],"i",r+1),n&&a.setXYAt(t[0],t[1],"v",r),a.setXYAt(i[0],i[1],"v",r+1)},X.prototype.addSegmentFromArray=function(t,e,s,i){e.setXYAt(t[1],t[5],"o",s),e.setXYAt(t[2],t[6],"i",s+1),i&&e.setXYAt(t[0],t[4],"v",s),e.setXYAt(t[3],t[7],"v",s+1)},X.prototype.addShapes=function(t,e,s){var i,a,r,n,h,o,l,p,f=t.pathsData,m=t.shape.paths.shapes,d=t.shape.paths._length,c=0,u=[],g=!0;for(p=s?(h=s._length,s._length):(s=St.newElement(),h=0),u.push(s),i=0;i<d;i+=1){for(o=f[i].lengths,s.c=m[i].c,r=m[i].c?o.length:o.length+1,a=1;a<r;a+=1)if(c+(n=o[a-1]).addedLength<e.s)c+=n.addedLength,s.c=!1;else{if(c>e.e){s.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[a],m[i].v[a],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[a],m[i].o[a-1],m[i].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1),c+=n.addedLength,h+=1}if(m[i].c&&o.length){if(n=o[a-1],c<=e.e){var y=o[a-1].addedLength;e.s<=c&&e.e>=c+y?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[0],m[i].v[0],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[0],m[i].o[a-1],m[i].i[0],(e.s-c)/y,(e.e-c)/y,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1)}else s.c=!1;c+=n.addedLength,h+=1}if(s._length&&(s.setXYAt(s.v[p][0],s.v[p][1],"i",p),s.setXYAt(s.v[s._length-1][0],s.v[s._length-1][1],"o",s._length-1)),c>e.e)break;i<d-1&&(s=St.newElement(),g=!0,u.push(s),h=0)}return u},Y.registerModifier("tm",X),F([G],H),H.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=L.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},H.prototype.processPath=function(t,e){var s,i=St.newElement();i.c=t.c;var a,r,n,h,o,l,p,f,m,d,c,u,g=t._length,y=0;for(s=0;s<g;s+=1)a=t.v[s],n=t.o[s],r=t.i[s],a[0]===n[0]&&a[1]===n[1]&&a[0]===r[0]&&a[1]===r[1]?0!==s&&s!==g-1||t.c?(h=0===s?t.v[g-1]:t.v[s-1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=c=a[0]+(h[0]-a[0])*l,f=u=a[1]-(a[1]-h[1])*l,m=p-(p-a[0])*v,d=f-(f-a[1])*v,i.setTripleAt(p,f,m,d,c,u,y),y+=1,h=s===g-1?t.v[0]:t.v[s+1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=m=a[0]+(h[0]-a[0])*l,f=d=a[1]+(h[1]-a[1])*l,c=p-(p-a[0])*v,u=f-(f-a[1])*v,i.setTripleAt(p,f,m,d,c,u,y)):i.setTripleAt(a[0],a[1],n[0],n[1],r[0],r[1],y):i.setTripleAt(t.v[s][0],t.v[s][1],t.o[s][0],t.o[s][1],t.i[s][0],t.i[s][1],y),y+=1;return i},H.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.rd.v;if(0!==o)for(s=0;s<h;s+=1){if(n=(r=this.shapes[s]).localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},Y.registerModifier("rd",H),F([G],K),K.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=L.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},K.prototype.processPath=function(t,e){var s=e/100,i=[0,0],a=t._length,r=0;for(r=0;r<a;r+=1)i[0]+=t.v[r][0],i[1]+=t.v[r][1];i[0]/=a,i[1]/=a;var n,h,o,l,p,f,m=St.newElement();for(m.c=t.c,r=0;r<a;r+=1)n=t.v[r][0]+(i[0]-t.v[r][0])*s,h=t.v[r][1]+(i[1]-t.v[r][1])*s,o=t.o[r][0]+(i[0]-t.o[r][0])*-s,l=t.o[r][1]+(i[1]-t.o[r][1])*-s,p=t.i[r][0]+(i[0]-t.i[r][0])*-s,f=t.i[r][1]+(i[1]-t.i[r][1])*-s,m.setTripleAt(n,h,o,l,p,f,r);return m},K.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.amount.v;if(0!==o)for(s=0;s<h;s+=1){if(n=(r=this.shapes[s]).localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},Y.registerModifier("pb",K),F([G],J),J.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=L.getProp(t,e.c,0,null,this),this.o=L.getProp(t,e.o,0,null,this),this.tr=R.getTransformProperty(t,e.tr,this),this.so=L.getProp(t,e.tr.so,0,.01,this),this.eo=L.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new E,this.rMatrix=new E,this.sMatrix=new E,this.tMatrix=new E,this.matrix=new E},J.prototype.applyTransforms=function(t,e,s,i,a,r){var n=r?-1:1,h=i.s.v[0]+(1-i.s.v[0])*(1-a),o=i.s.v[1]+(1-i.s.v[1])*(1-a);t.translate(i.p.v[0]*n*a,i.p.v[1]*n*a,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*a),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.scale(r?1/h:h,r?1/o:o),s.translate(i.a.v[0],i.a.v[1],i.a.v[2])},J.prototype.init=function(t,e,s,i){for(this.elem=t,this.arr=e,this.pos=s,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[s]);0<s;)s-=1,this._elements.unshift(e[s]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},J.prototype.resetElements=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},J.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},J.prototype.changeGroupRender=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]._render=e,"gr"===t[s].ty&&this.changeGroupRender(t[s].it,e)},J.prototype.processShapes=function(t){var e,s,i,a,r;if(this._mdf||t){var n,h=Math.ceil(this.c.v);if(this._groups.length<h){for(;this._groups.length<h;){var o={it:this.cloneElements(this._elements),ty:"gr"};o.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,o),this._groups.splice(0,0,o),this._currentCopies+=1}this.elem.reloadShapes()}for(i=r=0;i<=this._groups.length-1;i+=1)n=r<h,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),r+=1;this._currentCopies=h;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=this.pMatrix.props,d=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,g,y=0;if(0<l){for(;y<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),y+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),y+=p)}else if(l<0){for(;f<y;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),y-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),y-=p)}for(i=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,r=this._currentCopies;r;){if(g=(s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==y){for((0!==i&&1===a||i!==this._currentCopies-1&&-1===a)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),u=0;u<g;u+=1)s[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<g;u+=1)s[u]=this.matrix.props[u];y+=1,r-=1,i+=a}}else for(r=this._currentCopies,i=0,a=1;r;)s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,r-=1,i+=a},J.prototype.addShape=function(){},Y.registerModifier("rp",J),Z.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(x(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},Z.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)St.release(this.shapes[t]);this._length=0},U.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,s=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<s;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},F([w],U),Q.prototype.comparePoints=function(t,e){for(var s=0,i=this.o.length/2;s<i;){if(.01<Math.abs(t[4*s]-t[4*e+2*s]))return!1;s+=1}return!0},Q.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},Q.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,s,i,a=4*this.data.p;for(e=0;e<a;e+=1)s=e%4==0?100:255,i=Math.round(this.prop.v[e]*s),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(a=this.prop.v.length,e=4*this.data.p;e<a;e+=1)s=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},F([w],Q);var $,tt,et=function(t,e,s,i){if(0===e)return"";var a,r=t.o,n=t.i,h=t.v,o=" M"+i.applyToPointStringified(h[0][0],h[0][1]);for(a=1;a<e;a+=1)o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[a][0],n[a][1])+" "+i.applyToPointStringified(h[a][0],h[a][1]);return s&&e&&(o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(h[0][0],h[0][1]),o+="z"),o},st=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,s=this.audios.length;for(e=0;e<s;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),it=function(){var a=function(){var t=P("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(t,e,s){var i="";if(t.e)i=t.p;else if(e){var a=t.p;-1!==a.indexOf("images/")&&(a=a.split("/")[1]),i=e+a}else i=s,i+=t.u?t.u:"",i+=t.p;return i}function e(){this._imageLoaded=t.bind(this),this.testImageLoaded=function(t){var e=0,s=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(s)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return e.prototype={loadAssets:function(t,e){var s;this.imagesLoadedCb=e;var i=t.length;for(s=0;s<i;s+=1)t[s].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[s])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,s=this.images.length;e<s;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function(t){var e=r(t,this.assetsPath,this.path),s=P("img");s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.src=e;var i={img:s,assetData:t};return i},createImageData:function(t){var e=r(t,this.assetsPath,this.path),s=createNS("image");n?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(s);var i={img:s,assetData:t};return i},imageLoaded:t,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},e}(),at=($={maskType:!0},(/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))&&($.maskType=!1),$),rt=((tt={}).createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},tt.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},tt),nt=function(){function r(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function(t,e,s){var i,a=new XMLHttpRequest;a.open("GET",t,!0);try{a.responseType="json"}catch(t){}a.send(),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)i=r(a),e(i);else try{i=r(a),e(i)}catch(t){s&&s(t)}}}}}();function ht(t,e,s){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=x(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(s)}function ot(t,e,s){var i={propType:!1},a=L.getProp,r=e.a;this.a={r:r.r?a(t,r.r,0,B,s):i,rx:r.rx?a(t,r.rx,0,B,s):i,ry:r.ry?a(t,r.ry,0,B,s):i,sk:r.sk?a(t,r.sk,0,B,s):i,sa:r.sa?a(t,r.sa,0,B,s):i,s:r.s?a(t,r.s,1,.01,s):i,a:r.a?a(t,r.a,1,0,s):i,o:r.o?a(t,r.o,0,.01,s):i,p:r.p?a(t,r.p,1,0,s):i,sw:r.sw?a(t,r.sw,0,0,s):i,sc:r.sc?a(t,r.sc,1,0,s):i,fc:r.fc?a(t,r.fc,1,0,s):i,fh:r.fh?a(t,r.fh,0,0,s):i,fs:r.fs?a(t,r.fs,0,.01,s):i,fb:r.fb?a(t,r.fb,0,.01,s):i,t:r.t?a(t,r.t,0,0,s):i},this.s=_t.getTextSelectorProp(t,e.s,s),this.s.t=e.s.t}function dt(t,e,s,i,a,r){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=a,this.p=r,this._mdf={o:!0,sw:!!e,sc:!!s,fc:!!i,m:!0,p:!0}}function ct(t,e){this._frameId=s,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}ht.prototype.searchProperties=function(){var t,e,s=this._textData.a.length,i=L.getProp;for(t=0;t<s;t+=1)e=this._textData.a[t],this._animatorsData[t]=new ot(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},ht.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var s,i,a,r,n,h,o,l,p,f,m,d,c,u,g,y,v,b,_,C=this._moreOptions.alignment.v,k=this._animatorsData,D=this._textData,S=this.mHelper,x=this._renderType,P=this.renderedLetters.length,w=t.l;if(this._hasMaskedPath){if(_=this._pathData.m,!this._pathData.n||this._pathData._mdf){var T,A=_.v;for(this._pathData.r&&(A=A.reverse()),n={tLength:0,segments:[]},r=A._length-1,a=y=0;a<r;a+=1)T=mt.buildBezierData(A.v[a],A.v[a+1],[A.o[a][0]-A.v[a][0],A.o[a][1]-A.v[a][1]],[A.i[a+1][0]-A.v[a+1][0],A.i[a+1][1]-A.v[a+1][1]]),n.tLength+=T.segmentLength,n.segments.push(T),y+=T.segmentLength;a=r,_.v.c&&(T=mt.buildBezierData(A.v[a],A.v[0],[A.o[a][0]-A.v[a][0],A.o[a][1]-A.v[a][1]],[A.i[0][0]-A.v[0][0],A.i[0][1]-A.v[0][1]]),n.tLength+=T.segmentLength,n.segments.push(T),y+=T.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,h=this._pathData.f.v,f=1,p=!(l=m=0),u=n.segments,h<0&&_.v.c)for(n.tLength<Math.abs(h)&&(h=-Math.abs(h)%n.tLength),f=(c=u[m=u.length-1].points).length-1;h<0;)h+=c[f].partialLength,(f-=1)<0&&(f=(c=u[m-=1].points).length-1);d=(c=u[m].points)[f-1],g=(o=c[f]).partialLength}r=w.length,i=s=0;var F,M,I,E,L,R=1.2*t.finalSize*.714,V=!0;I=k.length;var N,z,O,q,B,j,W,Y,G,X,H,K,J=-1,Z=h,U=m,Q=f,$=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var st=0,it=0,at=2===t.j?-.5:-1,rt=0,nt=!0;for(a=0;a<r;a+=1)if(w[a].n){for(st&&(st+=it);rt<a;)w[rt].animatorJustifyOffset=st,rt+=1;nt=!(st=0)}else{for(M=0;M<I;M+=1)(F=k[M].a).t.propType&&(nt&&2===t.j&&(it+=F.t.v*at),(L=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?st+=F.t.v*L[0]*at:st+=F.t.v*L*at);nt=!1}for(st&&(st+=it);rt<a;)w[rt].animatorJustifyOffset=st,rt+=1}for(a=0;a<r;a+=1){if(S.reset(),q=1,w[a].n)s=0,i+=t.yOffset,i+=V?1:0,h=Z,V=!1,this._hasMaskedPath&&(f=Q,d=(c=u[m=U].points)[f-1],g=(o=c[f]).partialLength,l=0),K=G=H=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if($!==w[a].line){switch(t.j){case 1:h+=y-t.lineWidths[w[a].line];break;case 2:h+=(y-t.lineWidths[w[a].line])/2}$=w[a].line}J!==w[a].ind&&(w[J]&&(h+=w[J].extra),h+=w[a].an/2,J=w[a].ind),h+=C[0]*w[a].an*.005;var ht=0;for(M=0;M<I;M+=1)(F=k[M].a).p.propType&&((L=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?ht+=F.p.v[0]*L[0]:ht+=F.p.v[0]*L),F.a.propType&&((L=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?ht+=F.a.v[0]*L[0]:ht+=F.a.v[0]*L);for(p=!0;p;)h+ht<=l+g||!c?(v=(h+ht-l)/o.partialLength,z=d.point[0]+(o.point[0]-d.point[0])*v,O=d.point[1]+(o.point[1]-d.point[1])*v,S.translate(-C[0]*w[a].an*.005,-C[1]*R*.01),p=!1):c&&(l+=o.partialLength,(f+=1)>=c.length&&(f=0,c=u[m+=1]?u[m].points:_.v.c?u[m=f=0].points:(l-=o.partialLength,null)),c&&(d=o,g=(o=c[f]).partialLength));N=w[a].an/2-w[a].add,S.translate(-N,0,0)}else N=w[a].an/2-w[a].add,S.translate(-N,0,0),S.translate(-C[0]*w[a].an*.005,-C[1]*R*.01,0);for(M=0;M<I;M+=1)(F=k[M].a).t.propType&&(L=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars),0===s&&0===t.j||(this._hasMaskedPath?L.length?h+=F.t.v*L[0]:h+=F.t.v*L:L.length?s+=F.t.v*L[0]:s+=F.t.v*L));for(t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(B=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(W=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<I;M+=1)(F=k[M].a).a.propType&&((L=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?S.translate(-F.a.v[0]*L[0],-F.a.v[1]*L[1],F.a.v[2]*L[2]):S.translate(-F.a.v[0]*L,-F.a.v[1]*L,F.a.v[2]*L));for(M=0;M<I;M+=1)(F=k[M].a).s.propType&&((L=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars)).length?S.scale(1+(F.s.v[0]-1)*L[0],1+(F.s.v[1]-1)*L[1],1):S.scale(1+(F.s.v[0]-1)*L,1+(F.s.v[1]-1)*L,1));for(M=0;M<I;M+=1){if(F=k[M].a,L=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars),F.sk.propType&&(L.length?S.skewFromAxis(-F.sk.v*L[0],F.sa.v*L[1]):S.skewFromAxis(-F.sk.v*L,F.sa.v*L)),F.r.propType&&(L.length?S.rotateZ(-F.r.v*L[2]):S.rotateZ(-F.r.v*L)),F.ry.propType&&(L.length?S.rotateY(F.ry.v*L[1]):S.rotateY(F.ry.v*L)),F.rx.propType&&(L.length?S.rotateX(F.rx.v*L[0]):S.rotateX(F.rx.v*L)),F.o.propType&&(L.length?q+=(F.o.v*L[0]-q)*L[0]:q+=(F.o.v*L-q)*L),t.strokeWidthAnim&&F.sw.propType&&(L.length?j+=F.sw.v*L[0]:j+=F.sw.v*L),t.strokeColorAnim&&F.sc.propType)for(Y=0;Y<3;Y+=1)L.length?B[Y]+=(F.sc.v[Y]-B[Y])*L[0]:B[Y]+=(F.sc.v[Y]-B[Y])*L;if(t.fillColorAnim&&t.fc){if(F.fc.propType)for(Y=0;Y<3;Y+=1)L.length?W[Y]+=(F.fc.v[Y]-W[Y])*L[0]:W[Y]+=(F.fc.v[Y]-W[Y])*L;F.fh.propType&&(W=L.length?ft(W,F.fh.v*L[0]):ft(W,F.fh.v*L)),F.fs.propType&&(W=L.length?lt(W,F.fs.v*L[0]):lt(W,F.fs.v*L)),F.fb.propType&&(W=L.length?pt(W,F.fb.v*L[0]):pt(W,F.fb.v*L))}}for(M=0;M<I;M+=1)(F=k[M].a).p.propType&&(L=k[M].s.getMult(w[a].anIndexes[M],D.a[M].s.totalChars),this._hasMaskedPath?L.length?S.translate(0,F.p.v[1]*L[0],-F.p.v[2]*L[1]):S.translate(0,F.p.v[1]*L,-F.p.v[2]*L):L.length?S.translate(F.p.v[0]*L[0],F.p.v[1]*L[1],-F.p.v[2]*L[2]):S.translate(F.p.v[0]*L,F.p.v[1]*L,-F.p.v[2]*L));if(t.strokeWidthAnim&&(G=j<0?0:j),t.strokeColorAnim&&(X="rgb("+Math.round(255*B[0])+","+Math.round(255*B[1])+","+Math.round(255*B[2])+")"),t.fillColorAnim&&t.fc&&(H="rgb("+Math.round(255*W[0])+","+Math.round(255*W[1])+","+Math.round(255*W[2])+")"),this._hasMaskedPath){if(S.translate(0,-t.ls),S.translate(0,C[1]*R*.01+i,0),D.p.p){b=(o.point[1]-d.point[1])/(o.point[0]-d.point[0]);var ot=180*Math.atan(b)/Math.PI;o.point[0]<d.point[0]&&(ot+=180),S.rotate(-ot*Math.PI/180)}S.translate(z,O,0),h-=C[0]*w[a].an*.005,w[a+1]&&J!==w[a+1].ind&&(h+=w[a].an/2,h+=.001*t.tr*t.finalSize)}else{switch(S.translate(s,i,0),t.ps&&S.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:S.translate(w[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[w[a].line]),0,0);break;case 2:S.translate(w[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[w[a].line])/2,0,0)}S.translate(0,-t.ls),S.translate(N,0,0),S.translate(C[0]*w[a].an*.005,C[1]*R*.01,0),s+=w[a].l+.001*t.tr*t.finalSize}"html"===x?tt=S.toCSS():"svg"===x?tt=S.to2dCSS():et=[S.props[0],S.props[1],S.props[2],S.props[3],S.props[4],S.props[5],S.props[6],S.props[7],S.props[8],S.props[9],S.props[10],S.props[11],S.props[12],S.props[13],S.props[14],S.props[15]],K=q}this.lettersChangedFlag=P<=a?(E=new dt(K,G,X,H,tt,et),this.renderedLetters.push(E),P+=1,!0):(E=this.renderedLetters[a]).update(K,G,X,H,tt,et)||this.lettersChangedFlag}}},ht.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},ht.prototype.mHelper=new E,ht.prototype.defaultPropsArray=[],F([w],ht),dt.prototype.update=function(t,e,s,i,a,r){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==s&&(this.sc=s,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==a&&(this.m=a,n=this._mdf.m=!0),!r.length||this.p[0]===r[0]&&this.p[1]===r[1]&&this.p[4]===r[4]&&this.p[5]===r[5]&&this.p[12]===r[12]&&this.p[13]===r[13]||(this.p=r,n=this._mdf.p=!0),n},ct.prototype.defaultBoxWidth=[0,0],ct.prototype.copyData=function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},ct.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},ct.prototype.searchProperty=function(){return this.searchKeyframes()},ct.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},ct.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},ct.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,s=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var a=this.effectsSequence.length,r=t||this.data.d.k[this.keysIndex].s;for(i=0;i<a;i+=1)r=s!==this.keysIndex?this.effectsSequence[i](r,r.t):this.effectsSequence[i](this.currentData,r.t);e!==r&&this.setCurrentData(r),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},ct.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,s=0,i=t.length;s<=i-1&&!(s===i-1||t[s+1].t>e);)s+=1;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d.k[this.keysIndex].s},ct.prototype.buildFinalText=function(t){for(var e,s=I.getCombinedCharacterCodes(),i=[],a=0,r=t.length;a<r;)e=t.charCodeAt(a),-1!==s.indexOf(e)?i[i.length-1]+=t.charAt(a):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(a+1))&&e<=57343?(i.push(t.substr(a,2)),a+=1):i.push(t.charAt(a)),a+=1;return i},ct.prototype.completeTextData=function(t){t.__complete=!0;var e,s,i,a,r,n,h,o=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,d=0,c=0,u=0,g=[],y=0,v=0,b=o.getFontByName(t.f),_=0,C=q(b);t.fWeight=C.weight,t.fStyle=C.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),s=t.finalText.length,t.finalLineHeight=t.lh;var k,D=t.tr/1e3*t.finalSize;if(t.sz)for(var S,x,P=!0,w=t.sz[0],T=t.sz[1];P;){y=S=0,s=(x=this.buildFinalText(t.t)).length,D=t.tr/1e3*t.finalSize;var A=-1;for(e=0;e<s;e+=1)k=x[e].charCodeAt(0),i=!1," "===x[e]?A=e:13!==k&&3!==k||(i=!(y=0),S+=t.finalLineHeight||1.2*t.finalSize),w<y+(_=o.chars?(h=o.getCharData(x[e],b.fStyle,b.fFamily),i?0:h.w*t.finalSize/100):o.measureText(x[e],t.f,t.finalSize))&&" "!==x[e]?(-1===A?s+=1:e=A,S+=t.finalLineHeight||1.2*t.finalSize,x.splice(e,A===e?1:0,"\r"),A=-1,y=0):(y+=_,y+=D);S+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&T<S?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=x,s=t.finalText.length,P=!1)}y=-D;var F,M=_=0;for(e=0;e<s;e+=1)if(i=!1,13===(k=(F=t.finalText[e]).charCodeAt(0))||3===k?(M=0,g.push(y),v=v<y?y:v,y=-2*D,i=!(a=""),u+=1):a=F,_=o.chars?(h=o.getCharData(F,b.fStyle,o.getFontByName(t.f).fFamily),i?0:h.w*t.finalSize/100):o.measureText(a,t.f,t.finalSize)," "===F?M+=_+D:(y+=_+D+M,M=0),p.push({l:_,an:_,add:d,n:i,anIndexes:[],val:a,line:u,animatorJustifyOffset:0}),2==m){if(d+=_,""===a||" "===a||e===s-1){for(""!==a&&" "!==a||(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;f+=1,d=0}}else if(3==m){if(d+=_,""===a||e===s-1){for(""===a&&(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;d=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<y?y:v,g.push(y),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var I,E,L,R,V=l.a;n=V.length;var N=[];for(r=0;r<n;r+=1){for((I=V[r]).a.sc&&(t.strokeColorAnim=!0),I.a.sw&&(t.strokeWidthAnim=!0),(I.a.fc||I.a.fh||I.a.fs||I.a.fb)&&(t.fillColorAnim=!0),R=0,L=I.s.b,e=0;e<s;e+=1)(E=p[e]).anIndexes[r]=R,(1==L&&""!==E.val||2==L&&""!==E.val&&" "!==E.val||3==L&&(E.n||" "==E.val||e==s-1)||4==L&&(E.n||e==s-1))&&(1===I.s.rn&&N.push(R),R+=1);l.a[r].s.totalChars=R;var z,O=-1;if(1===I.s.rn)for(e=0;e<s;e+=1)O!=(E=p[e]).anIndexes[r]&&(O=E.anIndexes[r],z=N.splice(Math.floor(Math.random()*N.length),1)[0]),E.anIndexes[r]=z}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},ct.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var s=this.copyData({},this.data.d.k[e].s);s=this.copyData(s,t),this.data.d.k[e].s=s,this.recalculate(e),this.elem.addDynamicProperty(this)},ct.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},ct.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},ct.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var ut,gt,yt,vt,bt,_t=function(){var d=Math.max,c=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=L.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?L.getProp(t,e.e,0,0,this):{v:100},this.o=L.getProp(t,e.o||{k:0},0,0,this),this.xe=L.getProp(t,e.xe||{k:0},0,0,this),this.ne=L.getProp(t,e.ne||{k:0},0,0,this),this.a=L.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,s=0,i=1,a=1;0<this.ne.v?e=this.ne.v/100:s=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:a=1+this.xe.v/100;var r=W.getBezierEasing(e,s,i,a).get,n=0,h=this.finalS,o=this.finalE,l=this.data.sh;if(2===l)n=r(n=o===h?o<=t?1:0:d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(3===l)n=r(n=o===h?o<=t?0:1:1-d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(4===l)o===h?n=0:(n=d(0,c(.5/(o-h)+(t-h)/(o-h),1)))<.5?n*=2:n=1-2*(n-.5),n=r(n);else if(5===l){if(o===h)n=0;else{var p=o-h,f=-p/2+(t=c(d(0,t+.5-h),o-h)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=r(n)}else n=6===l?r(n=o===h?0:(t=c(d(0,t+.5-h),o-h),(1+Math.cos(Math.PI+2*Math.PI*t/(o-h)))/2)):(t>=u(h)&&(n=d(0,c(t-h<0?c(o,1)-(h-t):o-t,1))),r(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,s=this.o.v/e,i=this.s.v/e+s,a=this.e.v/e+s;if(a<i){var r=i;i=a,a=r}this.finalS=i,this.finalE=a}},F([w],i),{getTextSelectorProp:function(t,e,s){return new i(t,e,s)}}}(),Ct=function(t,e,s){var i=0,a=t,r=x(a);return{newElement:function(){return i?r[i-=1]:e()},release:function(t){i===a&&(r=kt.double(r),a*=2),s&&s(t),r[i]=t,i+=1}}},kt={double:function(t){return t.concat(x(t.length))}},Dt=Ct(8,function(){return j("float32",2)}),St=((ut=Ct(4,function(){return new V},function(t){var e,s=t._length;for(e=0;e<s;e+=1)Dt.release(t.v[e]),Dt.release(t.i[e]),Dt.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1})).clone=function(t){var e,s=ut.newElement(),i=void 0===t._length?t.v.length:t._length;for(s.setLength(i),s.c=t.c,e=0;e<i;e+=1)s.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return s},ut),xt=(gt={newShapeCollection:function(){var t;t=yt?bt[yt-=1]:new Z;return t},release:function(t){var e,s=t._length;for(e=0;e<s;e+=1)St.release(t.shapes[e]);t._length=0,yt===vt&&(bt=kt.double(bt),vt*=2);bt[yt]=t,yt+=1}},yt=0,bt=x(vt=4),gt),Pt=Ct(8,function(){return{lengths:[],totalLength:0}},function(t){var e,s=t.lengths.length;for(e=0;e<s;e+=1)wt.release(t.lengths[e]);t.lengths.length=0}),wt=Ct(8,function(){return{addedLength:0,percents:j("float32",D),lengths:j("float32",D)}});function Tt(){}function At(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var s="";if(e&&e.title){var i=createNS("title"),a=S();i.setAttribute("id",a),i.textContent=e.title,this.svgElement.appendChild(i),s+=a}if(e&&e.description){var r=createNS("desc"),n=S();r.setAttribute("id",n),r.textContent=e.description,this.svgElement.appendChild(r),s+=" "+n}s&&this.svgElement.setAttribute("aria-labelledby",s);var h=createNS("defs");this.svgElement.appendChild(h);var o=createNS("g");this.svgElement.appendChild(o),this.layerElement=o,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:h,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function Ft(t,e){this.animationItem=t,this.renderConfig={clearCanvas:!e||void 0===e.clearCanvas||e.clearCanvas,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",className:e&&e.className||"",id:e&&e.id||""},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new Qt,this.elements=[],this.pendingElements=[],this.transformMat=new E,this.completeLayers=!1,this.rendererType="canvas"}function Mt(t,e,s){this.data=t,this.element=e,this.globalData=s,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,a,r=this.globalData.defs,n=this.masksProperties?this.masksProperties.length:0;this.viewData=x(n),this.solidPath="";var h,o,l,p,f,m,d=this.masksProperties,c=0,u=[],g=S(),y="clipPath",v="clip-path";for(i=0;i<n;i+=1)if(("a"!==d[i].mode&&"n"!==d[i].mode||d[i].inv||100!==d[i].o.k||d[i].o.x)&&(v=y="mask"),"s"!==d[i].mode&&"i"!==d[i].mode||0!==c?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),a=createNS("path"),"n"===d[i].mode)this.viewData[i]={op:L.getProp(this.element,d[i].o,0,.01,this.element),prop:O.getShapeProp(this.element,d[i],3),elem:a,lastPath:""},r.appendChild(a);else{var b;if(c+=1,a.setAttribute("fill","s"===d[i].mode?"#000000":"#ffffff"),a.setAttribute("clip-rule","nonzero"),0!==d[i].x.k?(v=y="mask",m=L.getProp(this.element,d[i].x,0,null,this.element),b=S(),(p=createNS("filter")).setAttribute("id",b),(f=createNS("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),r.appendChild(p),a.setAttribute("stroke","s"===d[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:a,x:m,expan:f,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===d[i].mode){o=u.length;var _=createNS("g");for(h=0;h<o;h+=1)_.appendChild(u[h]);var C=createNS("mask");C.setAttribute("mask-type","alpha"),C.setAttribute("id",g+"_"+c),C.appendChild(a),r.appendChild(C),_.setAttribute("mask","url("+k+"#"+g+"_"+c+")"),u.length=0,u.push(_)}else u.push(a);d[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:a,lastPath:"",op:L.getProp(this.element,d[i].o,0,.01,this.element),prop:O.getShapeProp(this.element,d[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(d[i],this.viewData[i].prop.v,this.viewData[i])}for(this.maskElement=createNS(y),n=u.length,i=0;i<n;i+=1)this.maskElement.appendChild(u[i]);0<c&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+k+"#"+g+")"),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function It(){}function Et(){}function Lt(){}function Rt(){}function Vt(){}function Nt(t,e){this.elem=t,this.pos=e}function zt(t,e,s){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;for(var i=0,a=t.length;i<a;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function Ot(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function qt(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function Bt(t,e,s,i){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var a,r=4;"rc"===e.ty?r=5:"el"===e.ty?r=6:"sr"===e.ty&&(r=7),this.sh=O.getShapeProp(t,e,r,t);var n,h=s.length;for(a=0;a<h;a+=1)s[a].closed||(n={transforms:i.addTransformSequence(s[a].transforms),trNodes:[]},this.styledShapes.push(n),s[a].elements.push(n))}function jt(){}function Wt(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initFrame(),this.initTransform(t,e,s),this.initHierarchy()}function Yt(){}function Gt(){}function Xt(){}function Ht(){}function Kt(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function Jt(t,e,s){this.initElement(t,e,s)}function Zt(t,e,s){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,s),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?L.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function Ut(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,s),this.prevViewData=[]}function Qt(){var t;this.saved=[],this.cArrPos=0,this.cTr=new E,this.cO=1;for(this.savedOp=j("float32",15),t=0;t<15;t+=1)this.saved[t]=j("float32",16);this._length=15}function $t(){}function te(t,e,s){this.assetData=e.getAssetData(t.refId),this.img=e.imageLoader.getImage(this.assetData),this.initElement(t,e,s)}function ee(t,e,s){this.completeLayers=!1,this.layers=t.layers,this.pendingElements=[],this.elements=x(this.layers.length),this.initElement(t,e,s),this.tm=t.tm?L.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function se(t,e){var s;this.data=t,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=x(this.masksProperties.length);var i=this.masksProperties.length,a=!1;for(s=0;s<i;s+=1)"n"!==this.masksProperties[s].mode&&(a=!0),this.viewData[s]=O.getShapeProp(this.element,this.masksProperties[s],3);(this.hasMasks=a)&&this.element.addRenderableComponent(this)}function ie(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new qt,this.initElement(t,e,s)}function ae(t,e,s){this.initElement(t,e,s)}function re(t,e,s){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(t,e,s)}function ne(){}Tt.prototype.checkLayers=function(t){var e,s,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e-=1)this.elements[e]||(s=this.layers[e]).ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},Tt.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);default:return this.createNull(t)}},Tt.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Tt.prototype.createAudio=function(t){return new Zt(t,this.globalData,this)},Tt.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},Tt.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var s,i=t.length,a=this.layers.length;for(e=0;e<i;e+=1)for(s=0;s<a;){if(this.layers[s].id===t[e].id){this.layers[s]=t[e];break}s+=1}},Tt.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},Tt.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},Tt.prototype.buildElementParenting=function(t,e,s){for(var i=this.elements,a=this.layers,r=0,n=a.length;r<n;)a[r].ind==e&&(i[r]&&!0!==i[r]?(s.push(i[r]),i[r].setAsParent(),void 0!==a[r].parent?this.buildElementParenting(t,a[r].parent,s):t.setHierarchy(s)):(this.buildItem(r),this.addPendingElement(t))),r+=1},Tt.prototype.addPendingElement=function(t){this.pendingElements.push(t)},Tt.prototype.searchExtraCompositions=function(t){var e,s=t.length;for(e=0;e<s;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},Tt.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new I,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},F([Tt],At),At.prototype.createNull=function(t){return new Wt(t,this.globalData,this)},At.prototype.createShape=function(t){return new Ut(t,this.globalData,this)},At.prototype.createText=function(t){return new SVGTextLottieElement(t,this.globalData,this)},At.prototype.createImage=function(t){return new Kt(t,this.globalData,this)},At.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},At.prototype.createSolid=function(t){return new Jt(t,this.globalData,this)},At.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var s=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var a=S();s.setAttribute("id",a),s.appendChild(i),this.layerElement.setAttribute("clip-path","url("+k+"#"+a+")"),e.appendChild(s),this.layers=t.layers,this.elements=x(t.layers.length)},At.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},At.prototype.updateContainerSize=function(){},At.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var s=this.createItem(this.layers[t]);e[t]=s,h&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(s),s.initExpressions()),this.appendElementInPos(s,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?s.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(s)))}},At.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,s=this.elements.length;e<s;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},At.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var s=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=s-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<s;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},At.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){for(var i,a=0;a<e;)this.elements[a]&&!0!==this.elements[a]&&this.elements[a].getBaseElement()&&(i=this.elements[a].getBaseElement()),a+=1;i?this.layerElement.insertBefore(s,i):this.layerElement.appendChild(s)}},At.prototype.hide=function(){this.layerElement.style.display="none"},At.prototype.show=function(){this.layerElement.style.display="block"},F([Tt],Ft),Ft.prototype.createShape=function(t){return new ie(t,this.globalData,this)},Ft.prototype.createText=function(t){return new re(t,this.globalData,this)},Ft.prototype.createImage=function(t){return new te(t,this.globalData,this)},Ft.prototype.createComp=function(t){return new ee(t,this.globalData,this)},Ft.prototype.createSolid=function(t){return new ae(t,this.globalData,this)},Ft.prototype.createNull=At.prototype.createNull,Ft.prototype.ctxTransform=function(t){if(1!==t[0]||0!==t[1]||0!==t[4]||1!==t[5]||0!==t[12]||0!==t[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(t);var e=this.contextData.cTr.props;this.transformMat.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]),this.contextData.cTr.cloneFromProps(this.transformMat.props);var s=this.contextData.cTr.props;this.canvasContext.setTransform(s[0],s[1],s[4],s[5],s[12],s[13])}else this.canvasContext.transform(t[0],t[1],t[4],t[5],t[12],t[13])},Ft.prototype.ctxOpacity=function(t){if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=t<0?0:t,void(this.globalData.currentGlobalAlpha=this.contextData.cO);this.contextData.cO*=t<0?0:t,this.globalData.currentGlobalAlpha!==this.contextData.cO&&(this.canvasContext.globalAlpha=this.contextData.cO,this.globalData.currentGlobalAlpha=this.contextData.cO)},Ft.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},Ft.prototype.save=function(t){if(this.renderConfig.clearCanvas){t&&this.canvasContext.save();var e,s=this.contextData.cTr.props;this.contextData._length<=this.contextData.cArrPos&&this.contextData.duplicate();var i=this.contextData.saved[this.contextData.cArrPos];for(e=0;e<16;e+=1)i[e]=s[e];this.contextData.savedOp[this.contextData.cArrPos]=this.contextData.cO,this.contextData.cArrPos+=1}else this.canvasContext.save()},Ft.prototype.restore=function(t){if(this.renderConfig.clearCanvas){t&&(this.canvasContext.restore(),this.globalData.blendMode="source-over"),this.contextData.cArrPos-=1;var e,s=this.contextData.saved[this.contextData.cArrPos],i=this.contextData.cTr.props;for(e=0;e<16;e+=1)i[e]=s[e];this.canvasContext.setTransform(s[0],s[1],s[4],s[5],s[12],s[13]),s=this.contextData.savedOp[this.contextData.cArrPos],this.contextData.cO=s,this.globalData.currentGlobalAlpha!==s&&(this.canvasContext.globalAlpha=s,this.globalData.currentGlobalAlpha=s)}else this.canvasContext.restore()},Ft.prototype.configAnimation=function(t){if(this.animationItem.wrapper){this.animationItem.container=P("canvas");var e=this.animationItem.container.style;e.width="100%",e.height="100%";var s="0px 0px 0px";e.transformOrigin=s,e.mozTransformOrigin=s,e.webkitTransformOrigin=s,e["-webkit-transform"]=s,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.data=t,this.layers=t.layers,this.transformCanvas={w:t.w,h:t.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(t,document.body),this.globalData.canvasContext=this.canvasContext,(this.globalData.renderer=this).globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=x(t.layers.length),this.updateContainerSize()},Ft.prototype.updateContainerSize=function(){var t,e,s,i;if(this.reset(),this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,this.animationItem.container.setAttribute("width",t*this.renderConfig.dpr),this.animationItem.container.setAttribute("height",e*this.renderConfig.dpr)):(t=this.canvasContext.canvas.width*this.renderConfig.dpr,e=this.canvasContext.canvas.height*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var a=this.renderConfig.preserveAspectRatio.split(" "),r=a[1]||"meet",n=a[0]||"xMidYMid",h=n.substr(0,4),o=n.substr(4);s=t/e,i=this.transformCanvas.w/this.transformCanvas.h,this.transformCanvas.sy=s<i&&"meet"===r||i<s&&"slice"===r?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=e/(this.transformCanvas.h/this.renderConfig.dpr),e/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===h&&(i<s&&"meet"===r||s<i&&"slice"===r)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===h&&(i<s&&"meet"===r||s<i&&"slice"===r)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===o&&(s<i&&"meet"===r||i<s&&"slice"===r)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===o&&(s<i&&"meet"===r||i<s&&"slice"===r)?(e-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=e/(this.transformCanvas.h/this.renderConfig.dpr)):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0;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],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},Ft.prototype.destroy=function(){var t;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),t=(this.layers?this.layers.length:0)-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},Ft.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){var s;this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i=this.layers.length;for(this.completeLayers||this.checkLayers(t),s=0;s<i;s+=1)(this.completeLayers||this.elements[s])&&this.elements[s].prepareFrame(t-this.layers[s].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),s=i-1;0<=s;s-=1)(this.completeLayers||this.elements[s])&&this.elements[s].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},Ft.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var s=this.createItem(this.layers[t],this,this.globalData);(e[t]=s).initExpressions()}},Ft.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},Ft.prototype.hide=function(){this.animationItem.container.style.display="none"},Ft.prototype.show=function(){this.animationItem.container.style.display="block"},Mt.prototype.getMaskProperty=function(t){return this.viewData[t].prop},Mt.prototype.renderFrame=function(t){var e,s=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",s.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var a=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+k+"#"+this.storedData[e].filterId+")")),a.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},Mt.prototype.getMaskelement=function(){return this.maskElement},Mt.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},Mt.prototype.drawPath=function(t,e,s){var i,a,r=" M"+e.v[0][0]+","+e.v[0][1];for(a=e._length,i=1;i<a;i+=1)r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<a&&(r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),s.lastPath!==r){var n="";s.elem&&(e.c&&(n=t.inv?this.solidPath+r:r),s.elem.setAttribute("d",n)),s.lastPath=r}},Mt.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},It.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},Et.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var s,i=this.dynamicProperties.length;for(s=0;s<i;s+=1)(e||this._isParent&&"transform"===this.dynamicProperties[s].propType)&&(this.dynamicProperties[s].getValue(),this.dynamicProperties[s]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},Lt.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?R.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new E},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,s=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;s<i;){if(this.hierarchy[s].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}s+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),s=0;s<i;s+=1)t=this.hierarchy[s].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var s,i=!0,a=this.comp;i;)a.finalTransform?(a.data.hasMask&&e.splice(0,0,a.finalTransform),a=a.comp):i=!1;var r,n=e.length;for(s=0;s<n;s+=1)r=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-r[0],t[1]-r[1],0];return t},mHelper:new E},Rt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},F([Rt,function(t){function e(){}return e.prototype=t,e}({initElement:function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],Vt),zt.prototype.setAsAnimated=function(){this._isAnimated=!0},qt.prototype={addTransformSequence:function(t){var e,s=t.length,i="_";for(e=0;e<s;e+=1)i+=t[e].transform.key+"_";var a=this.sequences[i];return a||(a={transforms:[].concat(t),finalTransform:new E,_mdf:!1},this.sequences[i]=a,this.sequenceList.push(a)),a},processSequence:function(t,e){for(var s,i=0,a=t.transforms.length,r=e;i<a&&!e;){if(t.transforms[i].transform.mProps._mdf){r=!0;break}i+=1}if(r)for(t.finalTransform.reset(),i=a-1;0<=i;i-=1)s=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10],s[11],s[12],s[13],s[14],s[15]);t._mdf=r},processSequences:function(t){var e,s=this.sequenceList.length;for(e=0;e<s;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}},Bt.prototype.setAsAnimated=zt.prototype.setAsAnimated,jt.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=A(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=S(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},Wt.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},Wt.prototype.renderFrame=function(){},Wt.prototype.getBaseElement=function(){return null},Wt.prototype.destroy=function(){},Wt.prototype.sourceRectAtTime=function(){},Wt.prototype.hide=function(){},F([jt,Lt,It,Et],Wt),Yt.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,s,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),a.appendChild(this.layerElement),i=a,this.globalData.defs.appendChild(a),at.maskType||1!=this.data.td||(a.setAttribute("mask-type","luminance"),t=S(),e=rt.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(rt.createAlphaToLuminanceFilter()),(s=createNS("g")).appendChild(this.layerElement),i=s,a.appendChild(s),s.setAttribute("filter","url("+k+"#"+t+")"))}else if(2==this.data.td){var r=createNS("mask");r.setAttribute("id",this.layerId),r.setAttribute("mask-type","alpha");var n=createNS("g");r.appendChild(n),t=S(),e=rt.createFilter(t);var h=createNS("feComponentTransfer");h.setAttribute("in","SourceGraphic"),e.appendChild(h);var o=createNS("feFuncA");o.setAttribute("type","table"),o.setAttribute("tableValues","1.0 0.0"),h.appendChild(o),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+k+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,at.maskType||(r.setAttribute("mask-type","luminance"),e.appendChild(rt.createAlphaToLuminanceFilter()),s=createNS("g"),n.appendChild(l),s.appendChild(this.layerElement),i=s,n.appendChild(s)),this.globalData.defs.appendChild(r)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),f=createNS("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=S();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var d=createNS("g");d.setAttribute("clip-path","url("+k+"#"+m+")"),d.appendChild(this.layerElement),this.transformedElement=d,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+k+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new Mt(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+k+"#"+t+")")}},Gt.prototype={addShapeToModifiers:function(t){var e,s=this.shapeModifiers.length;for(e=0;e<s;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,s=0,i=e.length;s<i;){if(e[s].elem===t)return e[s].pos;s+=1}return 0},addProcessedElement:function(t,e){for(var s=this.processedElements,i=s.length;i;)if(s[i-=1].elem===t)return void(s[i].pos=e);s.push(new Nt(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},Xt.prototype.initElement=function(t,e,s){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new ct(this,t.t,this.dynamicProperties),this.textAnimator=new ht(t.t,this.renderType,this),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},Xt.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},Xt.prototype.createPathShape=function(t,e){var s,i,a=e.length,r="";for(s=0;s<a;s+=1)i=e[s].ks.k,r+=et(i,i.i.length,!0,t);return r},Xt.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},Xt.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},Xt.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},Xt.prototype.applyTextPropertiesToMatrix=function(t,e,s,i,a){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s])/2,0,0)}e.translate(i,a,0)},Xt.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},Xt.prototype.emptyProp=new dt,Xt.prototype.destroy=function(){},F([jt,Lt,It,Et,Vt],Ht),Ht.prototype.initElement=function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},Ht.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var s,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),s=i-1;0<=s;s-=1)(this.completeLayers||this.elements[s])&&(this.elements[s].prepareFrame(this.renderedFrame-this.layers[s].st),this.elements[s]._mdf&&(this._mdf=!0))}},Ht.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Ht.prototype.setElements=function(t){this.elements=t},Ht.prototype.getElements=function(){return this.elements},Ht.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},Ht.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},F([jt,Lt,Yt,It,Et,Vt],Kt),Kt.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},Kt.prototype.sourceRectAtTime=function(){return this.sourceRect},F([Kt],Jt),Jt.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},Zt.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},F([Rt,jt,Et],Zt),Zt.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},Zt.prototype.show=function(){},Zt.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},Zt.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},Zt.prototype.resume=function(){this._canPlay=!0},Zt.prototype.setRate=function(t){this.audio.rate(t)},Zt.prototype.volume=function(t){this.audio.volume(t)},Zt.prototype.getBaseElement=function(){return null},Zt.prototype.destroy=function(){},Zt.prototype.sourceRectAtTime=function(){},Zt.prototype.initExpressions=function(){},F([jt,Lt,Yt,Gt,It,Et,Vt],Ut),Ut.prototype.initSecondaryElement=function(){},Ut.prototype.identityMatrix=new E,Ut.prototype.buildExpressionInterface=function(){},Ut.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Ut.prototype.filterUniqueShapes=function(){var t,e,s,i,a=this.shapes.length,r=this.stylesList.length,n=[],h=!1;for(s=0;s<r;s+=1){for(i=this.stylesList[s],h=!1,t=n.length=0;t<a;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),h=e._isAnimated||h);1<n.length&&h&&this.setShapesAsAnimated(n)}},Ut.prototype.setShapesAsAnimated=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].setAsAnimated()},Ut.prototype.createStyleElement=function(t,e){var s,i=new SVGStyleData(t,e),a=i.pElem;if("st"===t.ty)s=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)s=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){s=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(s.gf),s.maskId&&(this.globalData.defs.appendChild(s.ms),this.globalData.defs.appendChild(s.of),a.setAttribute("mask","url("+k+"#"+s.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(a.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),a.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),a.setAttribute("fill-opacity","0"),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&a.setAttribute("fill-rule","evenodd"),t.ln&&a.setAttribute("id",t.ln),t.cl&&a.setAttribute("class",t.cl),t.bm&&(a.style["mix-blend-mode"]=A(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,s),s},Ut.prototype.createGroupElement=function(t){var e=new Ot;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=A(t.bm)),e},Ut.prototype.createTransformElement=function(t,e){var s=R.getTransformProperty(this,t,this),i=new SVGTransformData(s,s.o,e);return this.addToAnimatedContents(t,i),i},Ut.prototype.createShapeElement=function(t,e,s){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var a=new zt(e,s,O.getShapeProp(this,t,i,this));return this.shapes.push(a),this.addShapeToModifiers(a),this.addToAnimatedContents(t,a),a},Ut.prototype.addToAnimatedContents=function(t,e){for(var s=0,i=this.animatedContents.length;s<i;){if(this.animatedContents[s].element===e)return;s+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},Ut.prototype.setElementStyles=function(t){var e,s=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||s.push(this.stylesList[e])},Ut.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},Ut.prototype.searchShapes=function(t,e,s,i,a,r,n){var h,o,l,p,f,m,d=[].concat(r),c=t.length-1,u=[],g=[];for(h=c;0<=h;h-=1){if((m=this.searchProcessedElement(t[h]))?e[h]=s[m-1]:t[h]._render=n,"fl"===t[h].ty||"st"===t[h].ty||"gf"===t[h].ty||"gs"===t[h].ty)m?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],a),t[h]._render&&i.appendChild(e[h].style.pElem),u.push(e[h].style);else if("gr"===t[h].ty){if(m)for(l=e[h].it.length,o=0;o<l;o+=1)e[h].prevViewData[o]=e[h].it[o];else e[h]=this.createGroupElement(t[h]);this.searchShapes(t[h].it,e[h].it,e[h].prevViewData,e[h].gr,a+1,d,n),t[h]._render&&i.appendChild(e[h].gr)}else"tr"===t[h].ty?(m||(e[h]=this.createTransformElement(t[h],i)),p=e[h].transform,d.push(p)):"sh"===t[h].ty||"rc"===t[h].ty||"el"===t[h].ty||"sr"===t[h].ty?(m||(e[h]=this.createShapeElement(t[h],d,a)),this.setElementStyles(e[h])):"tm"===t[h].ty||"rd"===t[h].ty||"ms"===t[h].ty||"pb"===t[h].ty?(m?(f=e[h]).closed=!1:((f=Y.getModifier(t[h].ty)).init(this,t[h]),e[h]=f,this.shapeModifiers.push(f)),g.push(f)):"rp"===t[h].ty&&(m?(f=e[h]).closed=!0:(f=Y.getModifier(t[h].ty),(e[h]=f).init(this,t,h,e),this.shapeModifiers.push(f),n=!1),g.push(f));this.addProcessedElement(t[h],h+1)}for(c=u.length,h=0;h<c;h+=1)u[h].closed=!0;for(c=g.length,h=0;h<c;h+=1)g[h].closed=!0},Ut.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},Ut.prototype.renderShape=function(){var t,e,s=this.animatedContents.length;for(t=0;t<s;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},Ut.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},Qt.prototype.duplicate=function(){var t=2*this._length,e=this.savedOp;this.savedOp=j("float32",t),this.savedOp.set(e);var s=0;for(s=this._length;s<t;s+=1)this.saved[s]=j("float32",16);this._length=t},Qt.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},($t.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){this.canvasContext=this.globalData.canvasContext,this.renderableEffectsManager=new ne(this)},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=A(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new se(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},renderFrame:function(){if(!this.hidden&&!this.data.hd){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new E}).hide=$t.prototype.hideElement,$t.prototype.show=$t.prototype.showElement,F([jt,Lt,$t,It,Et,Rt],te),te.prototype.initElement=Ut.prototype.initElement,te.prototype.prepareFrame=Kt.prototype.prepareFrame,te.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var t=P("canvas");t.width=this.assetData.w,t.height=this.assetData.h;var e,s,i=t.getContext("2d"),a=this.img.width,r=this.img.height,n=a/r,h=this.assetData.w/this.assetData.h,o=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;h<n&&"xMidYMid slice"===o||n<h&&"xMidYMid slice"!==o?e=(s=r)*h:s=(e=a)/h,i.drawImage(this.img,(a-e)/2,(r-s)/2,e,s,0,0,this.assetData.w,this.assetData.h),this.img=t}},te.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},te.prototype.destroy=function(){this.img=null},F([Ft,Ht,$t],ee),ee.prototype.renderInnerContent=function(){var t,e=this.canvasContext;for(e.beginPath(),e.moveTo(0,0),e.lineTo(this.data.w,0),e.lineTo(this.data.w,this.data.h),e.lineTo(0,this.data.h),e.lineTo(0,0),e.clip(),t=this.layers.length-1;0<=t;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ee.prototype.destroy=function(){var t;for(t=this.layers.length-1;0<=t;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},se.prototype.renderFrame=function(){if(this.hasMasks){var t,e,s,i,a=this.element.finalTransform.mat,r=this.element.canvasContext,n=this.masksProperties.length;for(r.beginPath(),t=0;t<n;t+=1)if("n"!==this.masksProperties[t].mode){var h;this.masksProperties[t].inv&&(r.moveTo(0,0),r.lineTo(this.element.globalData.compSize.w,0),r.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),r.lineTo(0,this.element.globalData.compSize.h),r.lineTo(0,0)),i=this.viewData[t].v,e=a.applyToPointArray(i.v[0][0],i.v[0][1],0),r.moveTo(e[0],e[1]);var o=i._length;for(h=1;h<o;h+=1)s=a.applyToTriplePoints(i.o[h-1],i.i[h],i.v[h]),r.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);s=a.applyToTriplePoints(i.o[h-1],i.i[0],i.v[0]),r.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}this.element.globalData.renderer.save(!0),r.clip()}},se.prototype.getMaskProperty=Mt.prototype.getMaskProperty,se.prototype.destroy=function(){this.element=null},F([jt,Lt,$t,Gt,It,Et,Rt],ie),ie.prototype.initElement=Vt.prototype.initElement,ie.prototype.transformHelper={opacity:1,_opMdf:!1},ie.prototype.dashResetter=[],ie.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},ie.prototype.createStyleElement=function(t,e){var s={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"===t.ty||"st"===t.ty?(i.c=L.getProp(this,t.c,1,255,this),i.c.k||(s.co="rgb("+f(i.c.v[0])+","+f(i.c.v[1])+","+f(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=L.getProp(this,t.s,1,null,this),i.e=L.getProp(this,t.e,1,null,this),i.h=L.getProp(this,t.h||{k:0},0,.01,this),i.a=L.getProp(this,t.a||{k:0},0,B,this),i.g=new Q(this,t.g,this)),i.o=L.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(s.lc=this.lcEnum[t.lc]||"round",s.lj=this.ljEnum[t.lj]||"round",1==t.lj&&(s.ml=t.ml),i.w=L.getProp(this,t.w,0,null,this),i.w.k||(s.wi=i.w.v),t.d){var a=new U(this,t.d,"canvas",this);i.d=a,i.d.k||(s.da=i.d.dashArray,s.do=i.d.dashoffset[0])}}else s.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(s),i.style=s,i},ie.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},ie.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:L.getProp(this,t.o,0,.01,this),mProps:R.getTransformProperty(this,t,this)}}},ie.prototype.createShapeElement=function(t){var e=new Bt(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},ie.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},ie.prototype.addTransformToStyleList=function(t){var e,s=this.stylesList.length;for(e=0;e<s;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(t)},ie.prototype.removeTransformFromStyleList=function(){var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.pop()},ie.prototype.closeStyles=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].closed=!0},ie.prototype.searchShapes=function(t,e,s,i,a){var r,n,h,o,l,p,f=t.length-1,m=[],d=[],c=[].concat(a);for(r=f;0<=r;r-=1){if((o=this.searchProcessedElement(t[r]))?e[r]=s[o-1]:t[r]._shouldRender=i,"fl"===t[r].ty||"st"===t[r].ty||"gf"===t[r].ty||"gs"===t[r].ty)o?e[r].style.closed=!1:e[r]=this.createStyleElement(t[r],c),m.push(e[r].style);else if("gr"===t[r].ty){if(o)for(h=e[r].it.length,n=0;n<h;n+=1)e[r].prevViewData[n]=e[r].it[n];else e[r]=this.createGroupElement(t[r]);this.searchShapes(t[r].it,e[r].it,e[r].prevViewData,i,c)}else"tr"===t[r].ty?(o||(p=this.createTransformElement(t[r]),e[r]=p),c.push(e[r]),this.addTransformToStyleList(e[r])):"sh"===t[r].ty||"rc"===t[r].ty||"el"===t[r].ty||"sr"===t[r].ty?o||(e[r]=this.createShapeElement(t[r])):"tm"===t[r].ty||"rd"===t[r].ty||"pb"===t[r].ty?(o?(l=e[r]).closed=!1:((l=Y.getModifier(t[r].ty)).init(this,t[r]),e[r]=l,this.shapeModifiers.push(l)),d.push(l)):"rp"===t[r].ty&&(o?(l=e[r]).closed=!0:(l=Y.getModifier(t[r].ty),(e[r]=l).init(this,t,r,e),this.shapeModifiers.push(l),i=!1),d.push(l));this.addProcessedElement(t[r],r+1)}for(this.removeTransformFromStyleList(),this.closeStyles(m),f=d.length,r=0;r<f;r+=1)d[r].closed=!0},ie.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},ie.prototype.renderShapeTransform=function(t,e){(t._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=t.opacity,e.opacity*=e.op.v,e._opMdf=!0)},ie.prototype.drawLayer=function(){var t,e,s,i,a,r,n,h,o,l=this.stylesList.length,p=this.globalData.renderer,f=this.globalData.canvasContext;for(t=0;t<l;t+=1)if(("st"!==(h=(o=this.stylesList[t]).type)&&"gs"!==h||0!==o.wi)&&o.data._shouldRender&&0!==o.coOp&&0!==this.globalData.currentGlobalAlpha){for(p.save(),r=o.elements,"st"===h||"gs"===h?(f.strokeStyle="st"===h?o.co:o.grd,f.lineWidth=o.wi,f.lineCap=o.lc,f.lineJoin=o.lj,f.miterLimit=o.ml||0):f.fillStyle="fl"===h?o.co:o.grd,p.ctxOpacity(o.coOp),"st"!==h&&"gs"!==h&&f.beginPath(),p.ctxTransform(o.preTransforms.finalTransform.props),s=r.length,e=0;e<s;e+=1){for("st"!==h&&"gs"!==h||(f.beginPath(),o.da&&(f.setLineDash(o.da),f.lineDashOffset=o.do)),a=(n=r[e].trNodes).length,i=0;i<a;i+=1)"m"===n[i].t?f.moveTo(n[i].p[0],n[i].p[1]):"c"===n[i].t?f.bezierCurveTo(n[i].pts[0],n[i].pts[1],n[i].pts[2],n[i].pts[3],n[i].pts[4],n[i].pts[5]):f.closePath();"st"!==h&&"gs"!==h||(f.stroke(),o.da&&f.setLineDash(this.dashResetter))}"st"!==h&&"gs"!==h&&f.fill(o.r),p.restore()}},ie.prototype.renderShape=function(t,e,s,i){var a,r;for(r=t,a=e.length-1;0<=a;a-=1)"tr"===e[a].ty?(r=s[a].transform,this.renderShapeTransform(t,r)):"sh"===e[a].ty||"el"===e[a].ty||"rc"===e[a].ty||"sr"===e[a].ty?this.renderPath(e[a],s[a]):"fl"===e[a].ty?this.renderFill(e[a],s[a],r):"st"===e[a].ty?this.renderStroke(e[a],s[a],r):"gf"===e[a].ty||"gs"===e[a].ty?this.renderGradientFill(e[a],s[a],r):"gr"===e[a].ty?this.renderShape(r,e[a].it,s[a].it):e[a].ty;i&&this.drawLayer()},ie.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var s,i,a,r=t.trNodes,n=e.paths,h=n._length;r.length=0;var o=t.transforms.finalTransform;for(a=0;a<h;a+=1){var l=n.shapes[a];if(l&&l.v){for(i=l._length,s=1;s<i;s+=1)1===s&&r.push({t:"m",p:o.applyToPointArray(l.v[0][0],l.v[0][1],0)}),r.push({t:"c",pts:o.applyToTriplePoints(l.o[s-1],l.i[s],l.v[s])});1===i&&r.push({t:"m",p:o.applyToPointArray(l.v[0][0],l.v[0][1],0)}),l.c&&i&&(r.push({t:"c",pts:o.applyToTriplePoints(l.o[s-1],l.i[0],l.v[0])}),r.push({t:"z"}))}}t.trNodes=r}},ie.prototype.renderPath=function(t,e){if(!0!==t.hd&&t._shouldRender){var s,i=e.styledShapes.length;for(s=0;s<i;s+=1)this.renderStyledShape(e.styledShapes[s],e.sh)}},ie.prototype.renderFill=function(t,e,s){var i=e.style;(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*s.opacity)},ie.prototype.renderGradientFill=function(t,e,s){var i,a=e.style;if(!a.grd||e.g._mdf||e.s._mdf||e.e._mdf||1!==t.t&&(e.h._mdf||e.a._mdf)){var r,n=this.globalData.canvasContext,h=e.s.v,o=e.e.v;if(1===t.t)i=n.createLinearGradient(h[0],h[1],o[0],o[1]);else{var l=Math.sqrt(Math.pow(h[0]-o[0],2)+Math.pow(h[1]-o[1],2)),p=Math.atan2(o[1]-h[1],o[0]-h[0]),f=e.h.v;1<=f?f=.99:f<=-1&&(f=-.99);var m=l*f,d=Math.cos(p+e.a.v)*m+h[0],c=Math.sin(p+e.a.v)*m+h[1];i=n.createRadialGradient(d,c,0,h[0],h[1],l)}var u=t.g.p,g=e.g.c,y=1;for(r=0;r<u;r+=1)e.g._hasOpacity&&e.g._collapsable&&(y=e.g.o[2*r+1]),i.addColorStop(g[4*r]/100,"rgba("+g[4*r+1]+","+g[4*r+2]+","+g[4*r+3]+","+y+")");a.grd=i}a.coOp=e.o.v*s.opacity},ie.prototype.renderStroke=function(t,e,s){var i=e.style,a=e.d;a&&(a._mdf||this._isFirstFrame)&&(i.da=a.dashArray,i.do=a.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(i.co="rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s._opMdf||this._isFirstFrame)&&(i.coOp=e.o.v*s.opacity),(e.w._mdf||this._isFirstFrame)&&(i.wi=e.w.v)},ie.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},F([jt,Lt,$t,It,Et,Rt],ae),ae.prototype.initElement=Ut.prototype.initElement,ae.prototype.prepareFrame=Kt.prototype.prepareFrame,ae.prototype.renderInnerContent=function(){var t=this.canvasContext;t.fillStyle=this.data.sc,t.fillRect(0,0,this.data.sw,this.data.sh)},F([jt,Lt,$t,It,Et,Rt,Xt],re),re.prototype.tHelper=P("canvas").getContext("2d"),re.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=x(t.l?t.l.length:0);var e=!1;t.fc?(e=!0,this.values.fill=this.buildColor(t.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var s=!1;t.sc&&(s=!0,this.values.stroke=this.buildColor(t.sc),this.values.sWidth=t.sw);var i,a,r,n,h,o,l,p,f,m,d,c,u=this.globalData.fontManager.getFontByName(t.f),g=t.l,y=this.mHelper;this.stroke=s,this.values.fValue=t.finalSize+"px "+this.globalData.fontManager.getFontByName(t.f).fFamily,a=t.finalText.length;var v=this.data.singleShape,b=.001*t.tr*t.finalSize,_=0,C=0,k=!0,D=0;for(i=0;i<a;i+=1){for(n=(r=this.globalData.fontManager.getCharData(t.finalText[i],u.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily))&&r.data||{},y.reset(),v&&g[i].n&&(_=-b,C+=t.yOffset,C+=k?1:0,k=!1),f=(l=n.shapes?n.shapes[0].it:[]).length,y.scale(t.finalSize/100,t.finalSize/100),v&&this.applyTextPropertiesToMatrix(t,y,g[i].line,_,C),d=x(f),p=0;p<f;p+=1){for(o=l[p].ks.k.i.length,m=l[p].ks.k,c=[],h=1;h<o;h+=1)1===h&&c.push(y.applyToX(m.v[0][0],m.v[0][1],0),y.applyToY(m.v[0][0],m.v[0][1],0)),c.push(y.applyToX(m.o[h-1][0],m.o[h-1][1],0),y.applyToY(m.o[h-1][0],m.o[h-1][1],0),y.applyToX(m.i[h][0],m.i[h][1],0),y.applyToY(m.i[h][0],m.i[h][1],0),y.applyToX(m.v[h][0],m.v[h][1],0),y.applyToY(m.v[h][0],m.v[h][1],0));c.push(y.applyToX(m.o[h-1][0],m.o[h-1][1],0),y.applyToY(m.o[h-1][0],m.o[h-1][1],0),y.applyToX(m.i[0][0],m.i[0][1],0),y.applyToY(m.i[0][0],m.i[0][1],0),y.applyToX(m.v[0][0],m.v[0][1],0),y.applyToY(m.v[0][0],m.v[0][1],0)),d[p]=c}v&&(_+=g[i].l,_+=b),this.textSpans[D]?this.textSpans[D].elem=d:this.textSpans[D]={elem:d},D+=1}},re.prototype.renderInnerContent=function(){var t,e,s,i,a,r,n=this.canvasContext;n.font=this.values.fValue,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var h,o=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;e=l.length;var p,f,m=null,d=null,c=null;for(t=0;t<e;t+=1)if(!l[t].n){if((h=o[t])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(h.p),this.globalData.renderer.ctxOpacity(h.o)),this.fill){for(h&&h.fc?m!==h.fc&&(m=h.fc,n.fillStyle=h.fc):m!==this.values.fill&&(m=this.values.fill,n.fillStyle=this.values.fill),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),s=0;s<i;s+=1)for(r=(f=p[s]).length,this.globalData.canvasContext.moveTo(f[0],f[1]),a=2;a<r;a+=6)this.globalData.canvasContext.bezierCurveTo(f[a],f[a+1],f[a+2],f[a+3],f[a+4],f[a+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(h&&h.sw?c!==h.sw&&(c=h.sw,n.lineWidth=h.sw):c!==this.values.sWidth&&(c=this.values.sWidth,n.lineWidth=this.values.sWidth),h&&h.sc?d!==h.sc&&(d=h.sc,n.strokeStyle=h.sc):d!==this.values.stroke&&(d=this.values.stroke,n.strokeStyle=this.values.stroke),i=(p=this.textSpans[t].elem).length,this.globalData.canvasContext.beginPath(),s=0;s<i;s+=1)for(r=(f=p[s]).length,this.globalData.canvasContext.moveTo(f[0],f[1]),a=2;a<r;a+=6)this.globalData.canvasContext.bezierCurveTo(f[a],f[a+1],f[a+2],f[a+3],f[a+4],f[a+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}h&&this.globalData.renderer.restore()}},ne.prototype.renderFrame=function(){};var he=function(){var t={},a=[],i=0,r=0,n=0,h=!0,o=!1;function s(t){for(var e=0,s=t.target;e<r;)a[e].animation===s&&(a.splice(e,1),e-=1,r-=1,s.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var s=0;s<r;){if(a[s].elem===t&&null!==a[s].elem)return a[s].animation;s+=1}var i=new oe;return m(i,t),i.setData(t,e),i}function p(){n+=1,c()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",s),t.addEventListener("_active",p),t.addEventListener("_idle",f),a.push({elem:e,animation:t}),r+=1}function d(t){var e,s=t-i;for(e=0;e<r;e+=1)a[e].animation.advanceTime(s);i=t,n&&!o?window.requestAnimationFrame(d):h=!0}function e(t){i=t,window.requestAnimationFrame(d)}function c(){!o&&n&&h&&(window.requestAnimationFrame(e),h=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new oe;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setSpeed(t,e)},t.setDirection=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.togglePause(t)},t.searchAnimations=function(t,e,s){var i,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),r=a.length;for(i=0;i<r;i+=1)s&&a[i].setAttribute("data-bm-type",s),l(a[i],t);if(e&&0===r){s||(s="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var h=P("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",s),n.appendChild(h),l(h,t)}},t.resize=function(){var t;for(t=0;t<r;t+=1)a[t].animation.resize()},t.goToAndStop=function(t,e,s){var i;for(i=0;i<r;i+=1)a[i].animation.goToAndStop(t,e,s)},t.destroy=function(t){var e;for(e=r-1;0<=e;e-=1)a[e].animation.destroy(t)},t.freeze=function(){o=!0},t.unfreeze=function(){o=!1,c()},t.setVolume=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=a.length,s=[];for(t=0;t<e;t+=1)s.push(a[t].animation);return s},t}(),oe=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=S(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=e,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface={},this.imagePreloader=new it,this.audioController=st()};F([b],oe),oe.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new Ft(this,t.rendererSettings);break;case"svg":this.renderer=new At(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),nt.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},oe.prototype.setData=function(t,e){e&&"object"!=typeof e&&(e=JSON.parse(e));var s={wrapper:t,animationData:e},i=t.attributes;s.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",s.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";"false"===a?s.loop=!1:"true"===a?s.loop=!0:""!==a&&(s.loop=parseInt(a,10));var r=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;s.autoplay="false"!==r,s.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(s.prerender=!1),this.setParams(s)},oe.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,s,i=this.animationData.layers,a=i.length,r=t.layers,n=r.length;for(s=0;s<n;s+=1)for(e=0;e<a;){if(i[e].id===r[s].id){i[e]=r[s];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,M.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),h&&h.initExpressions(this),this.loadNextSegment()},oe.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,nt.load(s,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},oe.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},oe.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},oe.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},oe.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},oe.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},oe.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,M.completeData(this.animationData,this.renderer.globalData.fontManager),h&&h.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},oe.prototype.resize=function(){this.renderer.updateContainerSize()},oe.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},oe.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},oe.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},oe.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},oe.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},oe.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},oe.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},oe.prototype.goToAndStop=function(t,e,s){s&&this.name!==s||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},oe.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},oe.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(s=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},oe.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},oe.prototype.setSegment=function(t,e){var s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==s&&this.goToAndStop(s,!0)},oe.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var s,i=t.length;for(s=0;s<i;s+=1)this.segments.push(t[s])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},oe.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},oe.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},oe.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},oe.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},oe.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},oe.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},oe.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},oe.prototype.getVolume=function(){return this.audioController.getVolume()},oe.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},oe.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},oe.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},oe.prototype.getPath=function(){return this.path},oe.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},oe.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;e<s;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},oe.prototype.hide=function(){this.renderer.hide()},oe.prototype.show=function(){this.renderer.show()},oe.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},oe.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new r(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new l(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new o(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new p(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new d(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new r(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new l(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new o(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new p(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new d(t,this))},oe.prototype.triggerRenderFrameError=function(t){var e=new c(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},oe.prototype.triggerConfigError=function(t){var e=new u(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var lottie={};function le(){!0===fe?he.searchAnimations(me,fe,de):he.searchAnimations()}lottie.play=he.play,lottie.pause=he.pause,lottie.setLocationHref=function(t){k=t},lottie.togglePause=he.togglePause,lottie.setSpeed=he.setSpeed,lottie.setDirection=he.setDirection,lottie.stop=he.stop,lottie.searchAnimations=le,lottie.registerAnimation=he.registerAnimation,lottie.loadAnimation=function(t){return!0===fe&&(t.animationData=JSON.parse(me)),he.loadAnimation(t)},lottie.setSubframeRendering=function(t){e=t},lottie.resize=he.resize,lottie.goToAndStop=he.goToAndStop,lottie.destroy=he.destroy,lottie.setQuality=function(t){if("string"==typeof t)switch(t){case"high":D=200;break;default:case"medium":D=50;break;case"low":D=10}else!isNaN(t)&&1<t&&(D=t);a(!(50<=D))},lottie.inBrowser=function(){return"undefined"!=typeof navigator},lottie.installPlugin=function(t,e){"expressions"===t&&(h=e)},lottie.freeze=he.freeze,lottie.unfreeze=he.unfreeze,lottie.setVolume=he.setVolume,lottie.mute=he.mute,lottie.unmute=he.unmute,lottie.getRegisteredAnimations=he.getRegisteredAnimations,lottie.__getFactory=function(t){switch(t){case"propertyFactory":return L;case"shapePropertyFactory":return O;case"matrix":return E;default:return null}},lottie.version="5.7.6";var pe,fe="__[STANDALONE]__",me="__[ANIMATIONDATA]__",de="";if(fe){var ce=document.getElementsByTagName("script"),ue=ce[ce.length-1]||{src:""};pe=ue.src.replace(/^[^\?]+\??/,""),de=function(t){for(var e=pe.split("&"),s=0;s<e.length;s+=1){var i=e[s].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}return null}("renderer")}var ge=setInterval(function(){"complete"===document.readyState&&(clearInterval(ge),le())},100);
 return lottie;
 }));
\ No newline at end of file
diff --git a/build/player/lottie_light_html.js b/build/player/lottie_light_html.js
index 732fac1..a54c6b5 100644
--- a/build/player/lottie_light_html.js
+++ b/build/player/lottie_light_html.js
@@ -10,364 +10,407 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";
-var svgNS = "http://www.w3.org/2000/svg";
+	/* global locationHref:writable, animationManager, subframeEnabled:writable, defaultCurveSegments:writable, roundValues,
+expressionsPlugin:writable, PropertyFactory, ShapePropertyFactory, Matrix */
+/* exported locationHref, subframeEnabled, expressionsPlugin */
+
+'use strict';
+
+/* exported svgNS, locationHref, initialDefaultFrame */
+
+var svgNS = 'http://www.w3.org/2000/svg';
 
 var locationHref = '';
 
 var initialDefaultFrame = -999999;
 
+/* global createSizedArray */
+/* exported subframeEnabled, expressionsPlugin, isSafari, cachedColors, bmPow, bmSqrt, bmFloor, bmMax, bmMin, ProjectInterface,
+defaultCurveSegments, degToRads, roundCorner, bmRnd, styleDiv, BMEnterFrameEvent, BMCompleteEvent, BMCompleteLoopEvent,
+BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, BMAnimationConfigErrorEvent, createElementID,
+addSaturationToRGB, addBrightnessToRGB, addHueToRGB, rgbToHex */
+
 var subframeEnabled = true;
 var expressionsPlugin;
 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
+var bmRnd;
+var bmPow = Math.pow;
+var bmSqrt = Math.sqrt;
+var bmFloor = Math.floor;
+var bmMax = Math.max;
+var bmMin = Math.min;
 
 var BMMath = {};
-(function(){
-    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"];
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
+(function () {
+  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'];
+  var i;
+  var len = propertyNames.length;
+  for (i = 0; i < len; i += 1) {
+    BMMath[propertyNames[i]] = Math[propertyNames[i]];
+  }
 }());
 
-function ProjectInterface(){return {};}
+function ProjectInterface() { return {}; }
 
 BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = createSizedArray(val.length);
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
+BMMath.abs = function (val) {
+  var tOfVal = typeof val;
+  if (tOfVal === 'object' && val.length) {
+    var absArr = createSizedArray(val.length);
+    var i;
+    var len = val.length;
+    for (i = 0; i < len; i += 1) {
+      absArr[i] = Math.abs(val[i]);
     }
-    return Math.abs(val);
-
+    return absArr;
+  }
+  return Math.abs(val);
 };
 var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
+var degToRads = Math.PI / 180;
 var roundCorner = 0.5519;
 
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
+function roundValues(flag) {
+  if (flag) {
+    bmRnd = Math.round;
+  } else {
+    bmRnd = function (val) {
+      return val;
+    };
+  }
 }
 roundValues(false);
 
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
+function styleDiv(element) {
+  element.style.position = 'absolute';
+  element.style.top = 0;
+  element.style.left = 0;
+  element.style.display = 'block';
+  element.style.transformOrigin = '0 0';
+  element.style.webkitTransformOrigin = '0 0';
+  element.style.backfaceVisibility = 'visible';
+  element.style.webkitBackfaceVisibility = 'visible';
+  element.style.transformStyle = 'preserve-3d';
+  element.style.webkitTransformStyle = 'preserve-3d';
+  element.style.mozTransformStyle = 'preserve-3d';
 }
 
-function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
-    this.type = type;
-    this.currentTime = currentTime;
-    this.totalTime = totalTime;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
+  this.type = type;
+  this.currentTime = currentTime;
+  this.totalTime = totalTime;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteEvent(type, frameMultiplier){
-    this.type = type;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteEvent(type, frameMultiplier) {
+  this.type = type;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
-    this.type = type;
-    this.currentLoop = currentLoop;
-    this.totalLoops = totalLoops;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
+  this.type = type;
+  this.currentLoop = currentLoop;
+  this.totalLoops = totalLoops;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMSegmentStartEvent(type, firstFrame, totalFrames){
-    this.type = type;
-    this.firstFrame = firstFrame;
-    this.totalFrames = totalFrames;
+function BMSegmentStartEvent(type, firstFrame, totalFrames) {
+  this.type = type;
+  this.firstFrame = firstFrame;
+  this.totalFrames = totalFrames;
 }
 
-function BMDestroyEvent(type, target){
-    this.type = type;
-    this.target = target;
+function BMDestroyEvent(type, target) {
+  this.type = type;
+  this.target = target;
 }
 
 function BMRenderFrameErrorEvent(nativeError, currentTime) {
-    this.type = 'renderFrameError';
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = 'renderFrameError';
+  this.nativeError = nativeError;
+  this.currentTime = currentTime;
 }
 
 function BMConfigErrorEvent(nativeError) {
-    this.type = 'configError';
-    this.nativeError = nativeError;
+  this.type = 'configError';
+  this.nativeError = nativeError;
 }
 
 function BMAnimationConfigErrorEvent(type, nativeError) {
-    this.type = type;
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = type;
+  this.nativeError = nativeError;
 }
 
-var createElementID = (function(){
-    var _count = 0;
-    return function createID() {
-        return '__lottie_element_' + ++_count
-    }
-}())
+var createElementID = (function () {
+  var _count = 0;
+  return function createID() {
+    _count += 1;
+    return '__lottie_element_' + _count;
+  };
+}());
 
 function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v; g = t; b = p; break;
-        case 1: r = q; g = v; b = p; break;
-        case 2: r = p; g = v; b = t; break;
-        case 3: r = p; g = q; b = v; break;
-        case 4: r = t; g = p; b = v; break;
-        case 5: r = v; g = p; b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
+  var r;
+  var g;
+  var b;
+  var i;
+  var f;
+  var p;
+  var q;
+  var t;
+  i = Math.floor(h * 6);
+  f = h * 6 - i;
+  p = v * (1 - s);
+  q = v * (1 - f * s);
+  t = v * (1 - (1 - f) * s);
+  switch (i % 6) {
+    case 0: r = v; g = t; b = p; break;
+    case 1: r = q; g = v; b = p; break;
+    case 2: r = p; g = v; b = t; break;
+    case 3: r = p; g = q; b = v; break;
+    case 4: r = t; g = p; b = v; break;
+    case 5: r = v; g = p; b = q; break;
+    default: break;
+  }
+  return [r,
+    g,
+    b];
 }
 
 function RGBtoHSV(r, g, b) {
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
+  var max = Math.max(r, g, b);
+  var min = Math.min(r, g, b);
+  var d = max - min;
+  var h;
+  var s = (max === 0 ? 0 : d / max);
+  var v = max / 255;
 
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
+  switch (max) {
+    case min: h = 0; break;
+    case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break;
+    case g: h = (b - r) + d * 2; h /= 6 * d; break;
+    case b: h = (r - g) + d * 4; h /= 6 * d; break;
+    default: break;
+  }
 
-    return [
-         h,
-         s,
-         v
-    ];
+  return [
+    h,
+    s,
+    v,
+  ];
 }
 
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addSaturationToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[1] += offset;
+  if (hsv[1] > 1) {
+    hsv[1] = 1;
+  } else if (hsv[1] <= 0) {
+    hsv[1] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addBrightnessToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[2] += offset;
+  if (hsv[2] > 1) {
+    hsv[2] = 1;
+  } else if (hsv[2] < 0) {
+    hsv[2] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addHueToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[0] += offset / 360;
+  if (hsv[0] > 1) {
+    hsv[0] -= 1;
+  } else if (hsv[0] < 0) {
+    hsv[0] += 1;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
+var rgbToHex = (function () {
+  var colorMap = [];
+  var i;
+  var hex;
+  for (i = 0; i < 256; i += 1) {
+    hex = i.toString(16);
+    colorMap[i] = hex.length === 1 ? '0' + hex : hex;
+  }
 
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
+  return function (r, g, b) {
+    if (r < 0) {
+      r = 0;
+    }
+    if (g < 0) {
+      g = 0;
+    }
+    if (b < 0) {
+      b = 0;
+    }
+    return '#' + colorMap[r] + colorMap[g] + colorMap[b];
+  };
 }());
-function BaseEvent(){}
-BaseEvent.prototype = {
-	triggerEvent: function (eventName, args) {
-	    if (this._cbs[eventName]) {
-	        var len = this._cbs[eventName].length;
-	        for (var i = 0; i < len; i++){
-	            this._cbs[eventName][i](args);
-	        }
-	    }
-	},
-	addEventListener: function (eventName, callback) {
-	    if (!this._cbs[eventName]){
-	        this._cbs[eventName] = [];
-	    }
-	    this._cbs[eventName].push(callback);
 
-		return function() {
-			this.removeEventListener(eventName, callback);
-		}.bind(this);
-	},
-	removeEventListener: function (eventName,callback){
-	    if (!callback){
-	        this._cbs[eventName] = null;
-	    }else if(this._cbs[eventName]){
-	        var i = 0, len = this._cbs[eventName].length;
-	        while(i<len){
-	            if(this._cbs[eventName][i] === callback){
-	                this._cbs[eventName].splice(i,1);
-	                i -=1;
-	                len -= 1;
-	            }
-	            i += 1;
-	        }
-	        if(!this._cbs[eventName].length){
-	            this._cbs[eventName] = null;
-	        }
-	    }
-	}
+function BaseEvent() {}
+BaseEvent.prototype = {
+  triggerEvent: function (eventName, args) {
+    if (this._cbs[eventName]) {
+      var len = this._cbs[eventName].length;
+      for (var i = 0; i < len; i += 1) {
+        this._cbs[eventName][i](args);
+      }
+    }
+  },
+  addEventListener: function (eventName, callback) {
+    if (!this._cbs[eventName]) {
+      this._cbs[eventName] = [];
+    }
+    this._cbs[eventName].push(callback);
+
+    return function () {
+      this.removeEventListener(eventName, callback);
+    }.bind(this);
+  },
+  removeEventListener: function (eventName, callback) {
+    if (!callback) {
+      this._cbs[eventName] = null;
+    } else if (this._cbs[eventName]) {
+      var i = 0;
+      var len = this._cbs[eventName].length;
+      while (i < len) {
+        if (this._cbs[eventName][i] === callback) {
+          this._cbs[eventName].splice(i, 1);
+          i -= 1;
+          len -= 1;
+        }
+        i += 1;
+      }
+      if (!this._cbs[eventName].length) {
+        this._cbs[eventName] = null;
+      }
+    }
+  },
 };
-var createTypedArray = (function(){
-	function createRegularArray(type, len){
-		var i = 0, arr = [], value;
-		switch(type) {
-			case 'int16':
-			case 'uint8c':
-				value = 1;
-				break;
-			default:
-				value = 1.1;
-				break;
-		}
-		for(i = 0; i < len; i += 1) {
-			arr.push(value);
-		}
-		return arr;
-	}
-	function createTypedArray(type, len){
-		if(type === 'float32') {
-			return new Float32Array(len);
-		} else if(type === 'int16') {
-			return new Int16Array(len);
-		} else if(type === 'uint8c') {
-			return new Uint8ClampedArray(len);
-		}
-	}
-	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
-		return createTypedArray;
-	} else {
-		return createRegularArray;
-	}
+
+/* exported createTypedArray, createSizedArray */
+
+var createTypedArray = (function () {
+  function createRegularArray(type, len) {
+    var i = 0;
+    var arr = [];
+    var value;
+    switch (type) {
+      case 'int16':
+      case 'uint8c':
+        value = 1;
+        break;
+      default:
+        value = 1.1;
+        break;
+    }
+    for (i = 0; i < len; i += 1) {
+      arr.push(value);
+    }
+    return arr;
+  }
+  function createTypedArrayFactory(type, len) {
+    if (type === 'float32') {
+      return new Float32Array(len);
+    } if (type === 'int16') {
+      return new Int16Array(len);
+    } if (type === 'uint8c') {
+      return new Uint8ClampedArray(len);
+    }
+    return createRegularArray(type, len);
+  }
+  if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+    return createTypedArrayFactory;
+  }
+  return createRegularArray;
 }());
 
 function createSizedArray(len) {
-	return Array.apply(null,{length:len});
+  return Array.apply(null, { length: len });
 }
+
+/* global svgNS */
+/* exported createNS */
+
 function createNS(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElementNS(svgNS, type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElementNS(svgNS, type);
 }
+
+/* exported createTag */
+
 function createTag(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElement(type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElement(type);
 }
-function DynamicPropertyContainer(){};
+
+function DynamicPropertyContainer() {}
 DynamicPropertyContainer.prototype = {
-	addDynamicProperty: function(prop) {
-		if(this.dynamicProperties.indexOf(prop) === -1) {
-	        this.dynamicProperties.push(prop);
-	        this.container.addDynamicProperty(this);
-	    	this._isAnimated = true;
-	    }
-	},
-	iterateDynamicProperties: function(){
-	    this._mdf = false;
-	    var i, len = this.dynamicProperties.length;
-	    for(i=0;i<len;i+=1){
-	        this.dynamicProperties[i].getValue();
-	        if(this.dynamicProperties[i]._mdf) {
-	            this._mdf = true;
-	        }
-	    }
-	},
-	initDynamicPropertyContainer: function(container){
-	    this.container = container;
-	    this.dynamicProperties = [];
-	    this._mdf = false;
-	    this._isAnimated = false;
-	}
-}
-var getBlendMode = (function() {
-
-	var blendModeEnums = {
-        0:'source-over',
-        1:'multiply',
-        2:'screen',
-        3:'overlay',
-        4:'darken',
-        5:'lighten',
-        6:'color-dodge',
-        7:'color-burn',
-        8:'hard-light',
-        9:'soft-light',
-        10:'difference',
-        11:'exclusion',
-        12:'hue',
-        13:'saturation',
-        14:'color',
-        15:'luminosity'
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+      this.container.addDynamicProperty(this);
+      this._isAnimated = true;
     }
+  },
+  iterateDynamicProperties: function () {
+    this._mdf = false;
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      this.dynamicProperties[i].getValue();
+      if (this.dynamicProperties[i]._mdf) {
+        this._mdf = true;
+      }
+    }
+  },
+  initDynamicPropertyContainer: function (container) {
+    this.container = container;
+    this.dynamicProperties = [];
+    this._mdf = false;
+    this._isAnimated = false;
+  },
+};
 
-	return function(mode) {
-		return blendModeEnums[mode] || '';
-	}
-}())
+/* exported getBlendMode */
+
+var getBlendMode = (function () {
+  var blendModeEnums = {
+    0: 'source-over',
+    1: 'multiply',
+    2: 'screen',
+    3: 'overlay',
+    4: 'darken',
+    5: 'lighten',
+    6: 'color-dodge',
+    7: 'color-burn',
+    8: 'hard-light',
+    9: 'soft-light',
+    10: 'difference',
+    11: 'exclusion',
+    12: 'hue',
+    13: 'saturation',
+    14: 'color',
+    15: 'luminosity',
+  };
+
+  return function (mode) {
+    return blendModeEnums[mode] || '';
+  };
+}());
+
+/* global createTypedArray */
+
 /*!
  Transformation Matrix v2.0
  (c) Epistemex 2014-2015
@@ -397,394 +440,399 @@
  * @constructor
  */
 
-var Matrix = (function(){
+var Matrix = (function () {
+  var _cos = Math.cos;
+  var _sin = Math.sin;
+  var _tan = Math.tan;
+  var _rnd = Math.round;
 
-    var _cos = Math.cos;
-    var _sin = Math.sin;
-    var _tan = Math.tan;
-    var _rnd = Math.round;
+  function reset() {
+    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;
+    return this;
+  }
 
-    function reset(){
-        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;
-        return this;
+  function rotate(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function rotateX(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateY(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateZ(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function shear(sx, sy) {
+    return this._t(1, sy, sx, 1, 0, 0);
+  }
+
+  function skew(ax, ay) {
+    return this.shear(_tan(ax), _tan(ay));
+  }
+
+  function skewFromAxis(ax, angle) {
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    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);
+  }
+
+  function scale(sx, sy, sz) {
+    if (!sz && sz !== 0) {
+      sz = 1;
+    }
+    if (sx === 1 && sy === 1 && sz === 1) {
+      return this;
+    }
+    return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
+  }
+
+  function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
+    this.props[0] = a;
+    this.props[1] = b;
+    this.props[2] = c;
+    this.props[3] = d;
+    this.props[4] = e;
+    this.props[5] = f;
+    this.props[6] = g;
+    this.props[7] = h;
+    this.props[8] = i;
+    this.props[9] = j;
+    this.props[10] = k;
+    this.props[11] = l;
+    this.props[12] = m;
+    this.props[13] = n;
+    this.props[14] = o;
+    this.props[15] = p;
+    return this;
+  }
+
+  function translate(tx, ty, tz) {
+    tz = tz || 0;
+    if (tx !== 0 || ty !== 0 || tz !== 0) {
+      return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
+    }
+    return this;
+  }
+
+  function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
+    var _p = this.props;
+
+    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) {
+      // NOTE: commenting this condition because TurboFan deoptimizes code when present
+      // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+      _p[12] = _p[12] * a2 + _p[15] * m2;
+      _p[13] = _p[13] * f2 + _p[15] * n2;
+      _p[14] = _p[14] * k2 + _p[15] * o2;
+      _p[15] *= p2;
+      // }
+      this._identityCalculated = false;
+      return this;
     }
 
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
+    var a1 = _p[0];
+    var b1 = _p[1];
+    var c1 = _p[2];
+    var d1 = _p[3];
+    var e1 = _p[4];
+    var f1 = _p[5];
+    var g1 = _p[6];
+    var h1 = _p[7];
+    var i1 = _p[8];
+    var j1 = _p[9];
+    var k1 = _p[10];
+    var l1 = _p[11];
+    var m1 = _p[12];
+    var n1 = _p[13];
+    var o1 = _p[14];
+    var p1 = _p[15];
 
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(_tan(ax), _tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        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);
-    }
-
-    function scale(sx, sy, sz) {
-        if(!sz && sz !== 0) {
-            sz = 1;
-        }
-        if(sx === 1 && sy === 1 && sz === 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        var _p = this.props;
-
-        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){
-            //NOTE: commenting this condition because TurboFan deoptimizes code when present
-            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-                _p[12] = _p[12] * a2 + _p[15] * m2;
-                _p[13] = _p[13] * f2 + _p[15] * n2;
-                _p[14] = _p[14] * k2 + _p[15] * o2;
-                _p[15] = _p[15] * p2;
-            //}
-            this._identityCalculated = false;
-            return this;
-        }
-
-        var a1 = _p[0];
-        var b1 = _p[1];
-        var c1 = _p[2];
-        var d1 = _p[3];
-        var e1 = _p[4];
-        var f1 = _p[5];
-        var g1 = _p[6];
-        var h1 = _p[7];
-        var i1 = _p[8];
-        var j1 = _p[9];
-        var k1 = _p[10];
-        var l1 = _p[11];
-        var m1 = _p[12];
-        var n1 = _p[13];
-        var o1 = _p[14];
-        var p1 = _p[15];
-
-        /* matrix order (canvas compatible):
+    /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+    _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+    _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
+    _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
+    _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
 
-        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+    _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
+    _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
+    _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
+    _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
 
-        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+    _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
+    _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
+    _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
+    _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
 
-        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+    _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
+    _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
+    _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
+    _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
 
-        this._identityCalculated = false;
-        return this;
+    this._identityCalculated = false;
+    return this;
+  }
+
+  function isIdentity() {
+    if (!this._identityCalculated) {
+      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);
+      this._identityCalculated = true;
     }
+    return this._identity;
+  }
 
-    function isIdentity() {
-        if(!this._identityCalculated){
-            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);
-            this._identityCalculated = true;
-        }
-        return this._identity;
+  function equals(matr) {
+    var i = 0;
+    while (i < 16) {
+      if (matr.props[i] !== this.props[i]) {
+        return false;
+      }
+      i += 1;
     }
+    return true;
+  }
 
-    function equals(matr){
-        var i = 0;
-        while (i < 16) {
-            if(matr.props[i] !== this.props[i]) {
-                return false;
-            }
-            i+=1;
-        }
-        return true;
+  function clone(matr) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      matr.props[i] = this.props[i];
     }
+    return matr;
+  }
 
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-        return matr;
+  function cloneFromProps(props) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      this.props[i] = props[i];
     }
+  }
 
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
+  function applyToPoint(x, y, z) {
+    return {
+      x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
+      y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
+      z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14],
+    };
+    /* return {
          x: x * me.a + y * me.c + me.e,
          y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
+         }; */
+  }
+  function applyToX(x, y, z) {
+    return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
+  }
+  function applyToY(x, y, z) {
+    return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
+  }
+  function applyToZ(x, y, z) {
+    return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
+  }
 
-    function getInverseMatrix() {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        var inverseMatrix = new Matrix();
-        inverseMatrix.props[0] = a;
-        inverseMatrix.props[1] = b;
-        inverseMatrix.props[4] = c;
-        inverseMatrix.props[5] = d;
-        inverseMatrix.props[12] = e;
-        inverseMatrix.props[13] = f;
-        return inverseMatrix;
-    }
+  function getInverseMatrix() {
+    var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
+    var a = this.props[5] / determinant;
+    var b = -this.props[1] / determinant;
+    var c = -this.props[4] / determinant;
+    var d = this.props[0] / determinant;
+    var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
+    var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
+    var inverseMatrix = new Matrix();
+    inverseMatrix.props[0] = a;
+    inverseMatrix.props[1] = b;
+    inverseMatrix.props[4] = c;
+    inverseMatrix.props[5] = d;
+    inverseMatrix.props[12] = e;
+    inverseMatrix.props[13] = f;
+    return inverseMatrix;
+  }
 
-    function inversePoint(pt) {
-        var inverseMatrix = this.getInverseMatrix();
-        return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
-    }
+  function inversePoint(pt) {
+    var inverseMatrix = this.getInverseMatrix();
+    return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
+  }
 
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
+  function inversePoints(pts) {
+    var i;
+    var len = pts.length;
+    var retPts = [];
+    for (i = 0; i < len; i += 1) {
+      retPts[i] = inversePoint(pts[i]);
     }
+    return retPts;
+  }
 
-    function applyToTriplePoints(pt1, pt2, pt3) {
-        var arr = createTypedArray('float32', 6);
-        if(this.isIdentity()) {
-            arr[0] = pt1[0];
-            arr[1] = pt1[1];
-            arr[2] = pt2[0];
-            arr[3] = pt2[1];
-            arr[4] = pt3[0];
-            arr[5] = pt3[1];
-        } else {
-            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
-            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
-            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
-            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
-            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
-            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
-            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
-        }
-        return arr;
+  function applyToTriplePoints(pt1, pt2, pt3) {
+    var arr = createTypedArray('float32', 6);
+    if (this.isIdentity()) {
+      arr[0] = pt1[0];
+      arr[1] = pt1[1];
+      arr[2] = pt2[0];
+      arr[3] = pt2[1];
+      arr[4] = pt3[0];
+      arr[5] = pt3[1];
+    } else {
+      var p0 = this.props[0];
+      var p1 = this.props[1];
+      var p4 = this.props[4];
+      var p5 = this.props[5];
+      var p12 = this.props[12];
+      var p13 = this.props[13];
+      arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+      arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+      arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+      arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+      arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+      arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
     }
+    return arr;
+  }
 
-    function applyToPointArray(x,y,z){
-        var arr;
-        if(this.isIdentity()) {
-            arr = [x,y,z];
-        } else {
-            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]
-            ];
-        }
-        return arr;
+  function applyToPointArray(x, y, z) {
+    var arr;
+    if (this.isIdentity()) {
+      arr = [x, y, z];
+    } else {
+      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],
+      ];
     }
+    return arr;
+  }
 
-    function applyToPointStringified(x, y) {
-        if(this.isIdentity()) {
-            return x + ',' + y;
-        }
-        var _p = this.props;
-        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;
+  function applyToPointStringified(x, y) {
+    if (this.isIdentity()) {
+      return x + ',' + y;
     }
+    var _p = this.props;
+    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;
+  }
 
-    function toCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function toCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var i = 0;
-        var props = this.props;
-        var cssValue = 'matrix3d(';
-        var v = 10000;
-        while(i<16){
-            cssValue += _rnd(props[i]*v)/v;
-            cssValue += i === 15 ? ')':',';
-            i += 1;
-        }
-        return cssValue;
+        } */
+    var i = 0;
+    var props = this.props;
+    var cssValue = 'matrix3d(';
+    var v = 10000;
+    while (i < 16) {
+      cssValue += _rnd(props[i] * v) / v;
+      cssValue += i === 15 ? ')' : ',';
+      i += 1;
     }
+    return cssValue;
+  }
 
-    function roundMatrixProperty(val) {
-        var v = 10000;
-        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
-            return _rnd(val * v) / v;
-        }
-        return val;
+  function roundMatrixProperty(val) {
+    var v = 10000;
+    if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+      return _rnd(val * v) / v;
     }
+    return val;
+  }
 
-    function to2dCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function to2dCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var props = this.props;
-        var _a = roundMatrixProperty(props[0]);
-        var _b = roundMatrixProperty(props[1]);
-        var _c = roundMatrixProperty(props[4]);
-        var _d = roundMatrixProperty(props[5]);
-        var _e = roundMatrixProperty(props[12]);
-        var _f = roundMatrixProperty(props[13]);
-        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
-    }
+        } */
+    var props = this.props;
+    var _a = roundMatrixProperty(props[0]);
+    var _b = roundMatrixProperty(props[1]);
+    var _c = roundMatrixProperty(props[4]);
+    var _d = roundMatrixProperty(props[5]);
+    var _e = roundMatrixProperty(props[12]);
+    var _f = roundMatrixProperty(props[13]);
+    return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
+  }
 
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToTriplePoints = applyToTriplePoints;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.equals = equals;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this.getInverseMatrix = getInverseMatrix;
-        this._t = this.transform;
-        this.isIdentity = isIdentity;
-        this._identity = true;
-        this._identityCalculated = false;
+  return function () {
+    this.reset = reset;
+    this.rotate = rotate;
+    this.rotateX = rotateX;
+    this.rotateY = rotateY;
+    this.rotateZ = rotateZ;
+    this.skew = skew;
+    this.skewFromAxis = skewFromAxis;
+    this.shear = shear;
+    this.scale = scale;
+    this.setTransform = setTransform;
+    this.translate = translate;
+    this.transform = transform;
+    this.applyToPoint = applyToPoint;
+    this.applyToX = applyToX;
+    this.applyToY = applyToY;
+    this.applyToZ = applyToZ;
+    this.applyToPointArray = applyToPointArray;
+    this.applyToTriplePoints = applyToTriplePoints;
+    this.applyToPointStringified = applyToPointStringified;
+    this.toCSS = toCSS;
+    this.to2dCSS = to2dCSS;
+    this.clone = clone;
+    this.cloneFromProps = cloneFromProps;
+    this.equals = equals;
+    this.inversePoints = inversePoints;
+    this.inversePoint = inversePoint;
+    this.getInverseMatrix = getInverseMatrix;
+    this._t = this.transform;
+    this.isIdentity = isIdentity;
+    this._identity = true;
+    this._identityCalculated = false;
 
-        this.props = createTypedArray('float32', 16);
-        this.reset();
-    };
+    this.props = createTypedArray('float32', 16);
+    this.reset();
+  };
 }());
 
+/* eslint-disable */
 /*
  Copyright 2014 David Bau.
 
@@ -1018,8 +1066,9 @@
     [],     // pool: entropy pool starts empty
     BMMath    // math: package containing random, pow, and seedrandom
 );
-var BezierFactory = (function(){
-    /**
+/* eslint-disable */
+var BezierFactory = (function () {
+  /**
      * BezierEasing - use bezier curve for transition easing function
      * by Gaëtan Renaudeau 2014 - 2015 – MIT License
      *
@@ -1030,7087 +1079,7522 @@
      *
      */
 
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
+  var ob = {};
+  ob.getBezierEasing = getBezierEasing;
+  var beziers = {};
 
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
+  function getBezierEasing(a, b, c, d, nm) {
+    var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
+    if (beziers[str]) {
+      return beziers[str];
     }
+    var bezEasing = new BezierEasing([a, b, c, d]);
+    beziers[str] = bezEasing;
+    return bezEasing;
+  }
 
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
+  // These values are established by empiricism with tests (tradeoff: performance VS precision)
+  var NEWTON_ITERATIONS = 4;
+  var NEWTON_MIN_SLOPE = 0.001;
+  var SUBDIVISION_PRECISION = 0.0000001;
+  var SUBDIVISION_MAX_ITERATIONS = 10;
 
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+  var kSplineTableSize = 11;
+  var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
 
-    var float32ArraySupported = typeof Float32Array === "function";
+  var float32ArraySupported = typeof Float32Array === 'function';
 
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
+  function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+  function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+  function C(aA1) { return 3.0 * aA1; }
 
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
+  // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+  function calcBezier(aT, aA1, aA2) {
+    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
+  }
+
+  // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+  function getSlope(aT, aA1, aA2) {
+    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
+  }
+
+  function binarySubdivide(aX, aA, aB, mX1, mX2) {
+    var currentX,
+      currentT,
+      i = 0;
+    do {
+      currentT = aA + (aB - aA) / 2.0;
+      currentX = calcBezier(currentT, mX1, mX2) - aX;
+      if (currentX > 0.0) {
+        aB = currentT;
+      } else {
+        aA = currentT;
+      }
+    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+    return currentT;
+  }
+
+  function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
+    for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+      var currentSlope = getSlope(aGuessT, mX1, mX2);
+      if (currentSlope === 0.0) return aGuessT;
+      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+      aGuessT -= currentX / currentSlope;
     }
+    return aGuessT;
+  }
 
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
+  /**
      * points is an array of [ mX1, mY1, mX2, mY2 ]
      */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
+  function BezierEasing(points) {
+    this._p = points;
+    this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+    this._precomputed = false;
 
-        this.get = this.get.bind(this);
-    }
+    this.get = this.get.bind(this);
+  }
 
-    BezierEasing.prototype = {
+  BezierEasing.prototype = {
 
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
+    get: function (x) {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      if (!this._precomputed) this._precompute();
+      if (mX1 === mY1 && mX2 === mY2) return x; // linear
+      // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+      if (x === 0) return 0;
+      if (x === 1) return 1;
+      return calcBezier(this._getTForX(x), mY1, mY2);
+    },
 
-        // Private part
+    // Private part
 
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
+    _precompute: function () {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      this._precomputed = true;
+      if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); }
+    },
 
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
+    _calcSampleValues: function () {
+      var mX1 = this._p[0],
+        mX2 = this._p[2];
+      for (var i = 0; i < kSplineTableSize; ++i) {
+        this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+      }
+    },
 
-        /**
+    /**
          * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
          */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
+    _getTForX: function (aX) {
+      var mX1 = this._p[0],
+        mX2 = this._p[2],
+        mSampleValues = this._mSampleValues;
 
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
+      var intervalStart = 0.0;
+      var currentSample = 1;
+      var lastSample = kSplineTableSize - 1;
 
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
+      for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
+        intervalStart += kSampleStepSize;
+      }
+      --currentSample;
 
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
+      // Interpolate to provide an initial guess for t
+      var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
+      var guessForT = intervalStart + dist * kSampleStepSize;
 
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
+      var initialSlope = getSlope(guessForT, mX1, mX2);
+      if (initialSlope >= NEWTON_MIN_SLOPE) {
+        return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+      } if (initialSlope === 0.0) {
+        return guessForT;
+      }
+      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+    },
+  };
 
-    return ob;
-
+  return ob;
 }());
+
 (function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
+  var lastTime = 0;
+  var vendors = ['ms', 'moz', 'webkit', 'o'];
+  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { // eslint-disable-line no-plusplus
+    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
+    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
+  }
+  if (!window.requestAnimationFrame) {
+    window.requestAnimationFrame = function (callback) {
+      var currTime = new Date().getTime();
+      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+      var id = setTimeout(function () {
+        callback(currTime + timeToCall);
+      },
+      timeToCall);
+      lastTime = currTime + timeToCall;
+      return id;
+    };
+  }
+  if (!window.cancelAnimationFrame) {
+    window.cancelAnimationFrame = function (id) {
+      clearTimeout(id);
+    };
+  }
 }());
 
-function extendPrototype(sources,destination){
-    var i, len = sources.length, sourcePrototype;
-    for (i = 0;i < len;i += 1) {
-        sourcePrototype = sources[i].prototype;
-        for (var attr in sourcePrototype) {
-            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
-        }
+/* exported extendPrototype, getDescriptor, createProxyFunction */
+
+function extendPrototype(sources, destination) {
+  var i;
+  var len = sources.length;
+  var sourcePrototype;
+  for (i = 0; i < len; i += 1) {
+    sourcePrototype = sources[i].prototype;
+    for (var attr in sourcePrototype) {
+      if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
     }
+  }
 }
 
 function getDescriptor(object, prop) {
-    return Object.getOwnPropertyDescriptor(object, prop);
+  return Object.getOwnPropertyDescriptor(object, prop);
 }
 
 function createProxyFunction(prototype) {
-	function ProxyFunction(){}
-	ProxyFunction.prototype = prototype;
-	return ProxyFunction;
+  function ProxyFunction() {}
+  ProxyFunction.prototype = prototype;
+  return ProxyFunction;
 }
-function bezFunction(){
 
-    var easingFunctions = [];
-    var math = Math;
+/* global segmentsLengthPool, defaultCurveSegments, createSizedArray, bmPow, bmSqrt, bmFloor, createTypedArray, bezierLengthPool */
+/* exported bez */
 
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.001 && det1 < 0.001;
+function bezFunction() {
+  var math = Math;
+
+  function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
+    var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1);
+    return det1 > -0.001 && det1 < 0.001;
+  }
+
+  function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
+    if (z1 === 0 && z2 === 0 && z3 === 0) {
+      return pointOnLine2D(x1, y1, x2, y2, x3, y3);
     }
+    var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
+    var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
+    var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
+    var diffDist;
+    if (dist1 > dist2) {
+      if (dist1 > dist3) {
+        diffDist = dist1 - dist2 - dist3;
+      } else {
+        diffDist = dist3 - dist2 - dist1;
+      }
+    } else if (dist3 > dist2) {
+      diffDist = dist3 - dist2 - dist1;
+    } else {
+      diffDist = dist2 - dist1 - dist3;
+    }
+    return diffDist > -0.0001 && diffDist < 0.0001;
+  }
 
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        if(z1 === 0 && z2 === 0 && z3 === 0) {
-            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+  var getBezierLength = (function () {
+    return function (pt1, pt2, pt3, pt4) {
+      var curveSegments = defaultCurveSegments;
+      var k;
+      var i;
+      var len;
+      var ptCoord;
+      var perc;
+      var addedLength = 0;
+      var ptDistance;
+      var point = [];
+      var lastPoint = [];
+      var lengthData = bezierLengthPool.newElement();
+      len = pt3.length;
+      for (k = 0; k < curveSegments; k += 1) {
+        perc = k / (curveSegments - 1);
+        ptDistance = 0;
+        for (i = 0; i < len; i += 1) {
+          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];
+          point[i] = ptCoord;
+          if (lastPoint[i] !== null) {
+            ptDistance += bmPow(point[i] - lastPoint[i], 2);
+          }
+          lastPoint[i] = point[i];
         }
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
+        if (ptDistance) {
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
         }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    var getBezierLength = (function(){
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = bezier_length_pool.newElement();
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.percents[k] = perc;
-                lengthData.lengths[k] = addedLength;
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function getSegmentsLength(shapeData) {
-        var segmentsLength = segments_length_pool.newElement();
-        var closed = shapeData.c;
-        var pathV = shapeData.v;
-        var pathO = shapeData.o;
-        var pathI = shapeData.i;
-        var i, len = shapeData._length;
-        var lengths = segmentsLength.lengths;
-        var totalLength = 0;
-        for(i=0;i<len-1;i+=1){
-            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-            totalLength += lengths[i].addedLength;
-        }
-        if(closed && len){
-            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-            totalLength += lengths[i].addedLength;
-        }
-        segmentsLength.totalLength = totalLength;
-        return segmentsLength;
-    }
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (pt1, pt2, pt3, pt4){
-            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
-            if(!storedData[bezierName]){
-                var curveSegments = defaultCurveSegments;
-                var k, i, len;
-                var ptCoord,perc,addedLength = 0;
-                var ptDistance;
-                var point,lastPoint = null;
-                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])){
-                    curveSegments = 2;
-                }
-                var bezierData = new BezierData(curveSegments);
-                len = pt3.length;
-                for (k = 0; k < curveSegments; k += 1) {
-                    point = createSizedArray(len);
-                    perc = k / (curveSegments - 1);
-                    ptDistance = 0;
-                    for (i = 0; i < len; i += 1){
-                        ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                        point[i] = ptCoord;
-                        if(lastPoint !== null){
-                            ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                        }
-                    }
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                    bezierData.points[k] = new PointData(ptDistance, point);
-                    lastPoint = point;
-                }
-                bezierData.segmentLength = addedLength;
-                storedData[bezierName] = bezierData;
-            }
-            return storedData[bezierName];
-        };
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var percents = bezierData.percents;
-        var lengths = bezierData.lengths;
-        var len = percents.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
-            return percents[initPos];
-        }else{
-            var dir = lengths[initPos] > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
-                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    //FIX for TypedArrays that don't store floating point values with enough accuracy
-                    if(initPos === len - 1) {
-                        return percents[initPos];
-                    }
-                    flag = false;
-                }
-            }
-            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
-        }
-    }
-
-    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
-        var t1 = getDistancePerc(percent,bezierData);
-        var u0 = 1;
-        var u1 = 1 - t1;
-        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;
-        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;
-        return [ptX, ptY];
-    }
-
-    function getSegmentArray() {
-
-    }
-
-    var bezier_segment_points = createTypedArray('float32', 8);
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        var u0u0u0 = u0*u0*u0;
-        var t0u0u0_3 = t0*u0*u0*3;
-        var t0t0u0_3 = t0*t0*u0*3;
-        var t0t0t0 = t0*t0*t0;
-        //
-        var u0u0u1 = u0*u0*u1;
-        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
-        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
-        var t0t0t1 = t0*t0*t1;
-        //
-        var u0u1u1 = u0*u1*u1;
-        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
-        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
-        var t0t1t1 = t0*t1*t1;
-        //
-        var u1u1u1 = u1*u1*u1;
-        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
-        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
-        var t1t1t1 = t1*t1*t1;
-        for(i=0;i<len;i+=1){
-            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
-        }
-
-        return bezier_segment_points;
-    }
-
-    return {
-        getSegmentsLength : getSegmentsLength,
-        getNewSegment : getNewSegment,
-        getPointInSegment : getPointInSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
+        lengthData.percents[k] = perc;
+        lengthData.lengths[k] = addedLength;
+      }
+      lengthData.addedLength = addedLength;
+      return lengthData;
     };
+  }());
+
+  function getSegmentsLength(shapeData) {
+    var segmentsLength = segmentsLengthPool.newElement();
+    var closed = shapeData.c;
+    var pathV = shapeData.v;
+    var pathO = shapeData.o;
+    var pathI = shapeData.i;
+    var i;
+    var len = shapeData._length;
+    var lengths = segmentsLength.lengths;
+    var totalLength = 0;
+    for (i = 0; i < len - 1; i += 1) {
+      lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
+      totalLength += lengths[i].addedLength;
+    }
+    if (closed && len) {
+      lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
+      totalLength += lengths[i].addedLength;
+    }
+    segmentsLength.totalLength = totalLength;
+    return segmentsLength;
+  }
+
+  function BezierData(length) {
+    this.segmentLength = 0;
+    this.points = new Array(length);
+  }
+
+  function PointData(partial, point) {
+    this.partialLength = partial;
+    this.point = point;
+  }
+
+  var buildBezierData = (function () {
+    var storedData = {};
+
+    return function (pt1, pt2, pt3, pt4) {
+      var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
+      if (!storedData[bezierName]) {
+        var curveSegments = defaultCurveSegments;
+        var k;
+        var i;
+        var len;
+        var ptCoord;
+        var perc;
+        var addedLength = 0;
+        var ptDistance;
+        var point;
+        var lastPoint = null;
+        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])) {
+          curveSegments = 2;
+        }
+        var bezierData = new BezierData(curveSegments);
+        len = pt3.length;
+        for (k = 0; k < curveSegments; k += 1) {
+          point = createSizedArray(len);
+          perc = k / (curveSegments - 1);
+          ptDistance = 0;
+          for (i = 0; i < len; i += 1) {
+            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];
+            point[i] = ptCoord;
+            if (lastPoint !== null) {
+              ptDistance += bmPow(point[i] - lastPoint[i], 2);
+            }
+          }
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
+          bezierData.points[k] = new PointData(ptDistance, point);
+          lastPoint = point;
+        }
+        bezierData.segmentLength = addedLength;
+        storedData[bezierName] = bezierData;
+      }
+      return storedData[bezierName];
+    };
+  }());
+
+  function getDistancePerc(perc, bezierData) {
+    var percents = bezierData.percents;
+    var lengths = bezierData.lengths;
+    var len = percents.length;
+    var initPos = bmFloor((len - 1) * perc);
+    var lengthPos = perc * bezierData.addedLength;
+    var lPerc = 0;
+    if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
+      return percents[initPos];
+    }
+    var dir = lengths[initPos] > lengthPos ? -1 : 1;
+    var flag = true;
+    while (flag) {
+      if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
+        lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
+        flag = false;
+      } else {
+        initPos += dir;
+      }
+      if (initPos < 0 || initPos >= len - 1) {
+        // FIX for TypedArrays that don't store floating point values with enough accuracy
+        if (initPos === len - 1) {
+          return percents[initPos];
+        }
+        flag = false;
+      }
+    }
+    return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
+  }
+
+  function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+    var t1 = getDistancePerc(percent, bezierData);
+    var u1 = 1 - t1;
+    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;
+    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;
+    return [ptX, ptY];
+  }
+
+  var bezierSegmentPoints = createTypedArray('float32', 8);
+
+  function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
+    if (startPerc < 0) {
+      startPerc = 0;
+    } else if (startPerc > 1) {
+      startPerc = 1;
+    }
+    var t0 = getDistancePerc(startPerc, bezierData);
+    endPerc = endPerc > 1 ? 1 : endPerc;
+    var t1 = getDistancePerc(endPerc, bezierData);
+    var i;
+    var len = pt1.length;
+    var u0 = 1 - t0;
+    var u1 = 1 - t1;
+    var u0u0u0 = u0 * u0 * u0;
+    var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0t0 = t0 * t0 * t0;
+    //
+    var u0u0u1 = u0 * u0 * u1;
+    var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0t1 = t0 * t0 * t1;
+    //
+    var u0u1u1 = u0 * u1 * u1;
+    var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1t1 = t0 * t1 * t1;
+    //
+    var u1u1u1 = u1 * u1 * u1;
+    var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1t1 = t1 * t1 * t1;
+    for (i = 0; i < len; i += 1) {
+      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
+      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
+      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
+      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
+    }
+
+    return bezierSegmentPoints;
+  }
+
+  return {
+    getSegmentsLength: getSegmentsLength,
+    getNewSegment: getNewSegment,
+    getPointInSegment: getPointInSegment,
+    buildBezierData: buildBezierData,
+    pointOnLine2D: pointOnLine2D,
+    pointOnLine3D: pointOnLine3D,
+  };
 }
 
 var bez = bezFunction();
-function dataFunctionManager(){
 
-    //var tCanvasHelper = createTag('canvas').getContext('2d');
+/* exported dataManager */
 
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
+function dataFunctionManager() {
+  // var tCanvasHelper = createTag('canvas').getContext('2d');
+
+  function completeLayers(layers, comps, fontManager) {
+    var layerData;
+    var i;
+    var len = layers.length;
+    var j;
+    var jLen;
+    var k;
+    var kLen;
+    for (i = 0; i < len; i += 1) {
+      layerData = layers[i];
+      if (('ks' in layerData) && !layerData.completed) {
+        layerData.completed = true;
+        if (layerData.tt) {
+          layers[i - 1].td = layerData.tt;
         }
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              convertPathsToAbsoluteValues(maskProps[j].pt.k);
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
+                }
+              }
+            }
+          }
+        }
+        if (layerData.ty === 0) {
+          layerData.layers = findCompLayers(layerData.refId, comps);
+          completeLayers(layerData.layers, comps, fontManager);
+        } else if (layerData.ty === 4) {
+          completeShapes(layerData.shapes);
+        } else if (layerData.ty === 5) {
+          completeText(layerData, fontManager);
+        }
+      }
+    }
+  }
+
+  function findCompLayers(id, comps) {
+    var i = 0;
+    var len = comps.length;
+    while (i < len) {
+      if (comps[i].id === id) {
+        if (!comps[i].layers.__used) {
+          comps[i].layers.__used = true;
+          return comps[i].layers;
+        }
+        return JSON.parse(JSON.stringify(comps[i].layers));
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function completeShapes(arr) {
+    var i;
+    var len = arr.length;
+    var j;
+    var jLen;
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (arr[i].ty === 'sh') {
+        if (arr[i].ks.k.i) {
+          convertPathsToAbsoluteValues(arr[i].ks.k);
+        } else {
+          jLen = arr[i].ks.k.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (arr[i].ks.k[j].s) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
+            }
+            if (arr[i].ks.k[j].e) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
+            }
+          }
+        }
+      } else if (arr[i].ty === 'gr') {
+        completeShapes(arr[i].it);
+      }
+    }
+  }
+
+  function convertPathsToAbsoluteValues(path) {
+    var i;
+    var len = path.i.length;
+    for (i = 0; i < len; i += 1) {
+      path.i[i][0] += path.v[i][0];
+      path.i[i][1] += path.v[i][1];
+      path.o[i][0] += path.v[i][0];
+      path.o[i][1] += path.v[i][1];
+    }
+  }
+
+  function checkVersion(minimum, animVersionString) {
+    var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
+    if (minimum[0] > animVersion[0]) {
+      return true;
+    } if (animVersion[0] > minimum[0]) {
+      return false;
+    }
+    if (minimum[1] > animVersion[1]) {
+      return true;
+    } if (animVersion[1] > minimum[1]) {
+      return false;
+    }
+    if (minimum[2] > animVersion[2]) {
+      return true;
+    } if (animVersion[2] > minimum[2]) {
+      return false;
+    }
+    return null;
+  }
+
+  var checkText = (function () {
+    var minimumVersion = [4, 4, 14];
+
+    function updateTextLayer(textLayer) {
+      var documentData = textLayer.t.d;
+      textLayer.t.d = {
+        k: [
+          {
+            s: documentData,
+            t: 0,
+          },
+        ],
+      };
     }
 
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                if(!comps[i].layers.__used) {
-                    comps[i].layers.__used = true;
-                    return comps[i].layers;
-                }
-                return JSON.parse(JSON.stringify(comps[i].layers));
-            }
-            i += 1;
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 5) {
+          updateTextLayer(layers[i]);
         }
+      }
     }
 
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
             }
+          }
         }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
+      }
+    };
+  }());
+
+  var checkChars = (function () {
+    var minimumVersion = [4, 7, 99];
+    return function (animationData) {
+      if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
+        var i;
+        var len = animationData.chars.length;
+        var j;
+        var jLen;
+        var pathData;
+        var paths;
+        for (i = 0; i < len; i += 1) {
+          if (animationData.chars[i].data && animationData.chars[i].data.shapes) {
+            paths = animationData.chars[i].data.shapes[0].it;
+            jLen = paths.length;
+
+            for (j = 0; j < jLen; j += 1) {
+              pathData = paths[j].ks.k;
+              if (!pathData.__converted) {
+                convertPathsToAbsoluteValues(paths[j].ks.k);
+                pathData.__converted = true;
+              }
+            }
+          }
+        }
+      }
+    };
+  }());
+
+  var checkColors = (function () {
+    var minimumVersion = [4, 1, 9];
+
+    function iterateShapes(shapes) {
+      var i;
+      var len = shapes.length;
+      var j;
+      var jLen;
+      for (i = 0; i < len; i += 1) {
+        if (shapes[i].ty === 'gr') {
+          iterateShapes(shapes[i].it);
+        } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
+          if (shapes[i].c.k && shapes[i].c.k[0].i) {
+            jLen = shapes[i].c.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (shapes[i].c.k[j].s) {
+                shapes[i].c.k[j].s[0] /= 255;
+                shapes[i].c.k[j].s[1] /= 255;
+                shapes[i].c.k[j].s[2] /= 255;
+                shapes[i].c.k[j].s[3] /= 255;
+              }
+              if (shapes[i].c.k[j].e) {
+                shapes[i].c.k[j].e[0] /= 255;
+                shapes[i].c.k[j].e[1] /= 255;
+                shapes[i].c.k[j].e[2] /= 255;
+                shapes[i].c.k[j].e[3] /= 255;
+              }
+            }
+          } else {
+            shapes[i].c.k[0] /= 255;
+            shapes[i].c.k[1] /= 255;
+            shapes[i].c.k[2] /= 255;
+            shapes[i].c.k[3] /= 255;
+          }
+        }
+      }
     }
 
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 4) {
+          iterateShapes(layers[i].shapes);
         }
+      }
     }
 
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
+      }
+    };
+  }());
+
+  var checkShapes = (function () {
+    var minimumVersion = [4, 4, 18];
+
+    function completeClosingShapes(arr) {
+      var i;
+      var len = arr.length;
+      var j;
+      var jLen;
+      for (i = len - 1; i >= 0; i -= 1) {
+        if (arr[i].ty === 'sh') {
+          if (arr[i].ks.k.i) {
+            arr[i].ks.k.c = arr[i].closed;
+          } else {
+            jLen = arr[i].ks.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (arr[i].ks.k[j].s) {
+                arr[i].ks.k[j].s[0].c = arr[i].closed;
+              }
+              if (arr[i].ks.k[j].e) {
+                arr[i].ks.k[j].e[0].c = arr[i].closed;
+              }
+            }
+          }
+        } else if (arr[i].ty === 'gr') {
+          completeClosingShapes(arr[i].it);
         }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
+      }
     }
 
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            };
+    function iterateLayers(layers) {
+      var layerData;
+      var i;
+      var len = layers.length;
+      var j;
+      var jLen;
+      var k;
+      var kLen;
+      for (i = 0; i < len; i += 1) {
+        layerData = layers[i];
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              maskProps[j].pt.k.c = maskProps[j].cl;
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
+                }
+              }
+            }
+          }
         }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
+        if (layerData.ty === 4) {
+          completeClosingShapes(layerData.shapes);
         }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkChars = (function() {
-        var minimumVersion = [4,7,99];
-        return function (animationData){
-            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
-                var i, len = animationData.chars.length, j, jLen, k, kLen;
-                var pathData, paths;
-                for(i = 0; i < len; i += 1) {
-                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
-                        paths = animationData.chars[i].data.shapes[0].it;
-                        jLen = paths.length;
-
-                        for(j = 0; j < jLen; j += 1) {
-                            pathData = paths[j].ks.k;
-                            if(!pathData.__converted) {
-                                convertPathsToAbsoluteValues(paths[j].ks.k);
-                                pathData.__converted = true;
-                            }
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkChars(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
+      }
     }
 
-    function completeText(data, fontManager){
-        if(data.t.a.length === 0 && !('m' in data.t.p)){
-            data.singleShape = true;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
+      }
+    };
+  }());
+
+  function completeData(animationData, fontManager) {
+    if (animationData.__complete) {
+      return;
     }
+    checkColors(animationData);
+    checkText(animationData);
+    checkChars(animationData);
+    checkShapes(animationData);
+    completeLayers(animationData.layers, animationData.assets, fontManager);
+    animationData.__complete = true;
+  }
 
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-    moduleOb.checkColors = checkColors;
-    moduleOb.checkChars = checkChars;
-    moduleOb.checkShapes = checkShapes;
-    moduleOb.completeLayers = completeLayers;
+  function completeText(data) {
+    if (data.t.a.length === 0 && !('m' in data.t.p)) {
+      data.singleShape = true;
+    }
+  }
 
-    return moduleOb;
+  var moduleOb = {};
+  moduleOb.completeData = completeData;
+  moduleOb.checkColors = checkColors;
+  moduleOb.checkChars = checkChars;
+  moduleOb.checkShapes = checkShapes;
+  moduleOb.completeLayers = completeLayers;
+
+  return moduleOb;
 }
 
 var dataManager = dataFunctionManager();
 
-var FontManager = (function(){
+/* exported getFontProperties */
 
-    var maxWaitingTime = 5000;
-    var emptyChar = {
-        w: 0,
-        size:0,
-        shapes:[]
-    };
-    var combinedCharacters = [];
-    //Hindi characters
-    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]);
+function getFontProperties(fontData) {
+  var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
 
-    function trimFontOptions(font) {
-        var familyArray = font.split(',');
-        var i, len = familyArray.length;
-        var enabledFamilies = [];
-        for (i = 0; i < len; i += 1) {
-            if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
-                enabledFamilies.push(familyArray[i]);
-            }
-        }
-        return enabledFamilies.join(',');
+  var fWeight = 'normal'; var
+    fStyle = 'normal';
+  var len = styles.length;
+  var styleName;
+  for (var i = 0; i < len; i += 1) {
+    styleName = styles[i].toLowerCase();
+    switch (styleName) {
+      case 'italic':
+        fStyle = 'italic';
+        break;
+      case 'bold':
+        fWeight = '700';
+        break;
+      case 'black':
+        fWeight = '900';
+        break;
+      case 'medium':
+        fWeight = '500';
+        break;
+      case 'regular':
+      case 'normal':
+        fWeight = '400';
+        break;
+      case 'light':
+      case 'thin':
+        fWeight = '200';
+        break;
+      default:
+        break;
     }
+  }
 
-    function setUpNode(font, family){
-        var parentNode = createTag('span');
-        parentNode.style.fontFamily    = family;
-        var node = createTag('span');
-        // Characters that vary significantly among different fonts
-        node.innerText = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = trimFontOptions(font) + ', ' + family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(this.checkLoadedFontsBinded, 20);
-        }else{
-            setTimeout(this.setIsLoadedBinded, 10);
-
-        }
-    }
-
-    function createHelper(def, fontData){
-        var tHelper = createNS('text');
-        tHelper.style.fontSize = '100px';
-        //tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.setAttribute('font-family', fontData.fFamily);
-        tHelper.setAttribute('font-style', fontData.fStyle);
-        tHelper.setAttribute('font-weight', fontData.fWeight);
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.setAttribute('class', fontData.fClass);
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = createTag('canvas').getContext('2d');
-        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
-        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.isLoaded = true;
-            return;
-        }
-        if(this.chars){
-            this.isLoaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        var _pendingFonts = len;
-        for(i=0; i<len; i+= 1){
-            var shouldLoadFont = true;
-            var loadedSelector;
-            var j;
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-                _pendingFonts -= 1;
-            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
-                loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
-
-                if (loadedSelector.length > 0) {
-                    shouldLoadFont = false;
-                }
-
-                if (shouldLoadFont) {
-                    var s = createTag('style');
-                    s.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    s.setAttribute('f-origin', fontArr[i].origin);
-                    s.setAttribute('f-family', fontArr[i].fFamily);
-                    s.type = "text/css";
-                    s.innerText = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                    defs.appendChild(s);
-                }
-            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
-                loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var l = createTag('link');
-                    l.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    l.setAttribute('f-origin', fontArr[i].origin);
-                    l.type = "text/css";
-                    l.rel = "stylesheet";
-                    l.href = fontArr[i].fPath;
-                    document.body.appendChild(l);
-                }
-            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
-                loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (fontArr[i].fPath === loadedSelector[j].src) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var sc = createTag('link');
-                    sc.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    sc.setAttribute('f-origin', fontArr[i].origin);
-                    sc.setAttribute('rel','stylesheet');
-                    sc.setAttribute('href',fontArr[i].fPath);
-                    defs.appendChild(sc);
-                }
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            fontArr[i].cache = {};
-            this.fonts.push(fontArr[i]);
-        }
-        if (_pendingFonts === 0) {
-            this.isLoaded = true;
-        } else {
-            //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
-            //Adding this timeout seems to fix it
-           setTimeout(this.checkLoadedFonts.bind(this), 100);
-        }
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-        if ((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char)
-            && console
-            && console.warn
-            && !this._warned
-           ) {
-            this._warned = true
-            console.warn('Missing character from exported characters list: ', char, style, font);
-        }
-        return emptyChar;
-    }
-
-    function measureText(char, fontName, size) {
-        var fontData = this.getFontByName(fontName);
-        var index = char.charCodeAt(0);
-        if(!fontData.cache[index + 1]) {
-            var tHelper = fontData.helper;
-            //Canvas version
-            //fontData.cache[index] = tHelper.measureText(char).width / 100;
-            //SVG version
-            //console.log(tHelper.getBBox().width)
-            if (char === ' ') {
-                tHelper.textContent = '|' + char + '|';
-                var doubleSize = tHelper.getComputedTextLength();
-                tHelper.textContent = '||';
-                var singleSize = tHelper.getComputedTextLength();
-                fontData.cache[index + 1] = (doubleSize - singleSize)/100;
-            } else {
-                tHelper.textContent = char;
-                fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
-            }
-        }
-        return fontData.cache[index + 1] * size;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return this.fonts[0];
-    }
-
-    function getCombinedCharacterCodes() {
-        return combinedCharacters;
-    }
-
-    function setIsLoaded() {
-        this.isLoaded = true
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this._warned = false;
-        this.initTime = Date.now();
-        this.setIsLoadedBinded = this.setIsLoaded.bind(this)
-        this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)
-    };
-    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
-    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
-
-    var fontPrototype = {
-        addChars: addChars,
-        addFonts: addFonts,
-        getCharData: getCharData,
-        getFontByName: getFontByName,
-        measureText: measureText,
-        checkLoadedFonts: checkLoadedFonts,
-        setIsLoaded: setIsLoaded,
-    }
-
-    Font.prototype = fontPrototype;
-
-    return Font;
-
-}());
-
-var PropertyFactory = (function(){
-
-    var initFrame = initialDefaultFrame;
-    var math_abs = Math.abs;
-
-    function interpolateValue(frameNum, caching) {
-        var offsetTime = this.offsetTime;
-        var newValue;
-        if (this.propType === 'multidimensional') {
-            newValue = createTypedArray('float32', this.pv.length);
-        }
-        var iterationIndex = caching.lastIndex;
-        var i = iterationIndex;
-        var len = this.keyframes.length - 1, flag = true;
-        var keyData, nextKeyData;
-
-        while (flag) {
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i + 1];
-            if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                iterationIndex = 0;
-                break;
-            }
-            if ((nextKeyData.t - offsetTime) > frameNum){
-                iterationIndex = i;
-                break;
-            }
-            if (i < len - 1){
-                i += 1;
-            } else {
-                iterationIndex = 0;
-                flag = false;
-            }
-        }
-
-        var k, kLen, perc, jLen, j, fnc;
-        var nextKeyTime = nextKeyData.t - offsetTime;
-        var keyTime = keyData.t - offsetTime;
-        var endValue;
-        if (keyData.to) {
-            if (!keyData.bezierData) {
-                keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyTime || frameNum < keyTime) {
-                var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for (k = 0; k < kLen; k += 1) {
-                    newValue[k] = bezierData.points[ind].point[k];
-                }
-                // caching._lastKeyframeIndex = -1;
-            } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
-                } else {
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
-                }
-                perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
-                var distanceInLine = bezierData.segmentLength*perc;
-
-                var segmentPerc;
-                var addedLength =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
-                j =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
-                flag = true;
-                jLen = bezierData.points.length;
-                while (flag) {
-                    addedLength += bezierData.points[j].partialLength;
-                    if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
-                        segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1){
-                        j += 1;
-                    } else {
-                        flag = false;
-                    }
-                }
-                caching._lastPoint = j;
-                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                caching._lastKeyframeIndex = i;
-            }
-        } else {
-            var outX, outY, inX, inY, keyValue;
-            len = keyData.s.length;
-            endValue = nextKeyData.s || keyData.e;
-            if (this.sh && keyData.h !== 1) {
-                if (frameNum >= nextKeyTime) {
-                    newValue[0] = endValue[0];
-                    newValue[1] = endValue[1];
-                    newValue[2] = endValue[2];
-                } else if (frameNum <= keyTime) {
-                    newValue[0] = keyData.s[0];
-                    newValue[1] = keyData.s[1];
-                    newValue[2] = keyData.s[2];
-                } else {
-                    var quatStart = createQuaternion(keyData.s);
-                    var quatEnd = createQuaternion(endValue);
-                    var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
-                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
-                }
-                
-            } else {
-                for(i = 0; i < len; i += 1) {
-                    if (keyData.h !== 1) {
-                        if (frameNum >= nextKeyTime) {
-                            perc = 1;
-                        } else if(frameNum < keyTime) {
-                            perc = 0;
-                        } else {
-                            if(keyData.o.x.constructor === Array) {
-                                if (!keyData.__fnct) {
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
-                                    outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
-                                    inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
-                                    inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct = fnc;
-                                } else {
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
-                        }
-                    }
-
-                    endValue = nextKeyData.s || keyData.e;
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
-
-                    if (this.propType === 'multidimensional') {
-                        newValue[i] = keyValue;
-                    } else {
-                        newValue = keyValue;
-                    }
-                }
-            }
-        }
-        caching.lastIndex = iterationIndex;
-        return newValue;
-    }
-
-    //based on @Toji's https://github.com/toji/gl-matrix/
-    function slerp(a, b, t) {
-        var out = [];
-        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
-        bx = b[0], by = b[1], bz = b[2], bw = b[3]
-
-        var omega, cosom, sinom, scale0, scale1;
-
-        cosom = ax * bx + ay * by + az * bz + aw * bw;
-        if (cosom < 0.0) {
-            cosom = -cosom;
-            bx = -bx;
-            by = -by;
-            bz = -bz;
-            bw = -bw;
-        }
-        if ((1.0 - cosom) > 0.000001) {
-            omega = Math.acos(cosom);
-            sinom = Math.sin(omega);
-            scale0 = Math.sin((1.0 - t) * omega) / sinom;
-            scale1 = Math.sin(t * omega) / sinom;
-        } else {
-            scale0 = 1.0 - t;
-            scale1 = t;
-        }
-        out[0] = scale0 * ax + scale1 * bx;
-        out[1] = scale0 * ay + scale1 * by;
-        out[2] = scale0 * az + scale1 * bz;
-        out[3] = scale0 * aw + scale1 * bw;
-
-        return out;
-    }
-
-    function quaternionToEuler(out, quat) {
-        var qx = quat[0];
-        var qy = quat[1];
-        var qz = quat[2];
-        var qw = quat[3];
-        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
-        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
-        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
-        out[0] = heading/degToRads;
-        out[1] = attitude/degToRads;
-        out[2] = bank/degToRads;
-    }
-
-    function createQuaternion(values) {
-        var heading = values[0] * degToRads;
-        var attitude = values[1] * degToRads;
-        var bank = values[2] * degToRads;
-        var c1 = Math.cos(heading / 2);
-        var c2 = Math.cos(attitude / 2);
-        var c3 = Math.cos(bank / 2);
-        var s1 = Math.sin(heading / 2);
-        var s2 = Math.sin(attitude / 2);
-        var s3 = Math.sin(bank / 2);
-        var w = c1 * c2 * c3 - s1 * s2 * s3;
-        var x = s1 * s2 * c3 + c1 * c2 * s3;
-        var y = s1 * c2 * c3 + c1 * s2 * s3;
-        var z = c1 * s2 * c3 - s1 * c2 * s3;
-
-        return [x,y,z,w];
-    }
-
-    function getValueAtCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
-        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
-            if(this._caching.lastFrame >= frameNum) {
-                this._caching._lastKeyframeIndex = -1;
-                this._caching.lastIndex = 0;
-            }
-
-            var renderResult = this.interpolateValue(frameNum, this._caching);
-            this.pv = renderResult;
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
-    }
-
-    function setVValue(val) {
-        var multipliedValue;
-        if(this.propType === 'unidimensional') {
-            multipliedValue = val * this.mult;
-            if(math_abs(this.v - multipliedValue) > 0.00001) {
-                this.v = multipliedValue;
-                this._mdf = true;
-            }
-        } else {
-            var i = 0, len = this.v.length;
-            while (i < len) {
-                multipliedValue = val[i] * this.mult;
-                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
-                    this.v[i] = multipliedValue;
-                    this._mdf = true;
-                }
-                i += 1;
-            }
-        }
-    }
-
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
-            return;
-        }
-        if(this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = this._isFirstFrame;
-        var multipliedValue;
-        var i, len = this.effectsSequence.length;
-        var finalValue = this.kf ? this.pv : this.data.k;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this._isFirstFrame = false;
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
-    }
-
-    function ValueProperty(elem, data, mult, container){
-        this.propType = 'unidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.effectsSequence = [];
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function MultiDimensionalProperty(elem, data, mult, container) {
-        this.propType = 'multidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        var i, len = data.k.length;
-        this.v = createTypedArray('float32', len);
-        this.pv = createTypedArray('float32', len);
-        var arr = createTypedArray('float32', len);
-        this.vel = createTypedArray('float32', len);
-        for (i = 0; i < len; i += 1) {
-            this.v[i] = data.k[i] * this.mult;
-            this.pv[i] = data.k[i];
-        }
-        this._isFirstFrame = true;
-        this.effectsSequence = [];
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedValueProperty(elem, data, mult, container) {
-        this.propType = 'unidimensional';
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.frameId = -1;
-        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.v = initFrame;
-        this.pv = initFrame;
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult, container){
-        this.propType = 'multidimensional';
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for (i = 0; i < len - 1; i += 1) {
-            if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
-                s = data.k[i].s;
-                e = data.k[i + 1].s;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                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]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
-                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
-                        data.k[i].to = null;
-                        data.k[i].ti = null;
-                    }
-                }
-            }
-        }
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.data = data;
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this._isFirstFrame = true;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.frameId = -1;
-        var arrLen = data.k[0].s.length;
-        this.v = createTypedArray('float32', arrLen);
-        this.pv = createTypedArray('float32', arrLen);
-        for (i = 0; i < arrLen; i += 1) {
-            this.v[i] = initFrame;
-            this.pv[i] = initFrame;
-        }
-        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
-        this.addEffect = addEffect;
-    }
-
-    function getProp(elem,data,type, mult, container) {
-        var p;
-        if(!data.k.length){
-            p = new ValueProperty(elem,data, mult, container);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult, container);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult, container);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
-                    break;
-            }
-        }
-        if(p.effectsSequence.length){
-            container.addDynamicProperty(p);
-        }
-        return p;
-    }
-
-    var ob = {
-        getProp: getProp
-    };
-    return ob;
-}());
-var TransformPropertyFactory = (function() {
-
-    var defaultVector = [0,0]
-
-    function applyToMatrix(mat) {
-        var _mdf = this._mdf;
-        this.iterateDynamicProperties();
-        this._mdf = this._mdf || _mdf;
-        if (this.a) {
-            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-        }
-        if (this.s) {
-            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-        }
-        if (this.sk) {
-            mat.skewFromAxis(-this.sk.v, this.sa.v);
-        }
-        if (this.r) {
-            mat.rotate(-this.r.v);
-        } else {
-            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]);
-        }
-        if (this.data.p.s) {
-            if (this.data.p.z) {
-                mat.translate(this.px.v, this.py.v, -this.pz.v);
-            } else {
-                mat.translate(this.px.v, this.py.v, 0);
-            }
-        } else {
-            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-        }
-    }
-    function processKeys(forceRender){
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        }
-        if(this._isDirty) {
-            this.precalculateMatrix();
-            this._isDirty = false;
-        }
-
-        this.iterateDynamicProperties();
-
-        if (this._mdf || forceRender) {
-            this.v.cloneFromProps(this.pre.props);
-            if (this.appliedTransformations < 1) {
-                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if(this.appliedTransformations < 2) {
-                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.sk && this.appliedTransformations < 3) {
-                this.v.skewFromAxis(-this.sk.v, this.sa.v);
-            }
-            if (this.r && this.appliedTransformations < 4) {
-                this.v.rotate(-this.r.v);
-            } else if (!this.r && this.appliedTransformations < 4){
-                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]);
-            }
-            if (this.autoOriented) {
-                var v1,v2, frameRate = this.elem.globalData.frameRate;
-                if(this.p && this.p.keyframes && this.p.getValueAtTime) {
-                    if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
-                    } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
-                    }
-                } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
-                    v1 = [];
-                    v2 = [];
-                    var px = this.px, py = this.py, frameRate;
-                    if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
-                        v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
-                        v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
-                    } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
-                        v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
-                        v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
-                    } else {
-                        v1 = [px.pv, py.pv];
-                        v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
-                        v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
-                    }
-                } else {
-                    v1 = v2 = defaultVector
-                }
-                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-            }
-            if(this.data.p && this.data.p.s){
-                if(this.data.p.z) {
-                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    this.v.translate(this.px.v, this.py.v, 0);
-                }
-            }else{
-                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-            }
-        }
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function precalculateMatrix() {
-        if(!this.a.k) {
-            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            this.appliedTransformations = 1;
-        } else {
-            return;
-        }
-        if(!this.s.effectsSequence.length) {
-            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            this.appliedTransformations = 2;
-        } else {
-            return;
-        }
-        if(this.sk) {
-            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
-                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
-            this.appliedTransformations = 3;
-            } else {
-                return;
-            }
-        }
-        if (this.r) {
-            if(!this.r.effectsSequence.length) {
-                this.pre.rotate(-this.r.v);
-                this.appliedTransformations = 4;
-            } else {
-                return;
-            }
-        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
-            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]);
-            this.appliedTransformations = 4;
-        }
-    }
-
-    function autoOrient(){
-        //
-        //var prevP = this.getValueAtTime();
-    }
-
-    function addDynamicProperty(prop) {
-        this._addDynamicProperty(prop);
-        this.elem.addDynamicProperty(prop);
-        this._isDirty = true;
-    }
-
-    function TransformProperty(elem,data,container){
-        this.elem = elem;
-        this.frameId = -1;
-        this.propType = 'transform';
-        this.data = data;
-        this.v = new Matrix();
-        //Precalculated matrix with non animated properties
-        this.pre = new Matrix();
-        this.appliedTransformations = 0;
-        this.initDynamicPropertyContainer(container || elem);
-        if(data.p && data.p.s){
-            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
-            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
-            if(data.p.z){
-                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
-            }
-        }else{
-            this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
-        }
-        if(data.rx) {
-            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
-            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
-            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
-            if(data.or.k[0].ti) {
-                var i, len = data.or.k.length;
-                for(i=0;i<len;i+=1) {
-                    data.or.k[i].to = data.or.k[i].ti = null;
-                }
-            }
-            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
-            //sh Indicates it needs to be capped between -180 and 180
-            this.or.sh = true;
-        } else {
-            this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
-        }
-        if(data.sk){
-            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
-            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
-        }
-        this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},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.
-        if(data.o){
-            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
-        } else {
-            this.o = {_mdf:false,v:1};
-        }
-        this._isDirty = true;
-        if(!this.dynamicProperties.length){
-            this.getValue(true);
-        }
-    }
-
-    TransformProperty.prototype = {
-        applyToMatrix: applyToMatrix,
-        getValue: processKeys,
-        precalculateMatrix: precalculateMatrix,
-        autoOrient: autoOrient
-    }
-
-    extendPrototype([DynamicPropertyContainer], TransformProperty);
-    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
-    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
-
-    function getTransformProperty(elem,data,container){
-        return new TransformProperty(elem,data,container);
-    }
-
-    return {
-        getTransformProperty: getTransformProperty
-    };
-
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = createSizedArray(this._maxLength);
-	this.o = createSizedArray(this._maxLength);
-	this.i = createSizedArray(this._maxLength);
+  return {
+    style: fStyle,
+    weight: fontData.fWeight || fWeight,
+  };
 }
 
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	this.setLength(len);
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newElement();
-		this.o[i] = point_pool.newElement();
-		this.i[i] = point_pool.newElement();
-		i += 1;
-	}
-};
+/* global createNS, createTag, getFontProperties */
+/* exported FontManager */
 
-ShapePath.prototype.setLength = function(len) {
-	while(this._maxLength < len) {
-		this.doubleArrayLength();
-	}
-	this._length = len;
-};
+var FontManager = (function () {
+  var maxWaitingTime = 5000;
+  var emptyChar = {
+    w: 0,
+    size: 0,
+    shapes: [],
+  };
+  var combinedCharacters = [];
+  // Hindi characters
+  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]);
 
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(createSizedArray(this._maxLength));
-	this.i = this.i.concat(createSizedArray(this._maxLength));
-	this.o = this.o.concat(createSizedArray(this._maxLength));
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newElement();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-
-ShapePath.prototype.reverse = function() {
-	var newPath = new ShapePath();
-	newPath.setPathData(this.c, this._length);
-	var vertices = this.v, outPoints = this.o, inPoints = this.i;
-	var init = 0;
-	if (this.c) {
-		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
-        init = 1;
-    }
-    var cnt = this._length - 1;
-    var len = this._length;
-
+  function trimFontOptions(font) {
+    var familyArray = font.split(',');
     var i;
-    for (i = init; i < len; i += 1) {
-    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
-        cnt -= 1;
+    var len = familyArray.length;
+    var enabledFamilies = [];
+    for (i = 0; i < len; i += 1) {
+      if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
+        enabledFamilies.push(familyArray[i]);
+      }
     }
-    return newPath;
+    return enabledFamilies.join(',');
+  }
+
+  function setUpNode(font, family) {
+    var parentNode = createTag('span');
+    parentNode.style.fontFamily = family;
+    var node = createTag('span');
+    // Characters that vary significantly among different fonts
+    node.innerText = 'giItT1WQy@!-/#';
+    // Visible - so we can measure it - but not on the screen
+    parentNode.style.position = 'absolute';
+    parentNode.style.left = '-10000px';
+    parentNode.style.top = '-10000px';
+    // Large font size makes even subtle changes obvious
+    parentNode.style.fontSize = '300px';
+    // Reset any font properties
+    parentNode.style.fontVariant = 'normal';
+    parentNode.style.fontStyle = 'normal';
+    parentNode.style.fontWeight = 'normal';
+    parentNode.style.letterSpacing = '0';
+    parentNode.appendChild(node);
+    document.body.appendChild(parentNode);
+
+    // Remember width with no applied web font
+    var width = node.offsetWidth;
+    node.style.fontFamily = trimFontOptions(font) + ', ' + family;
+    return { node: node, w: width, parent: parentNode };
+  }
+
+  function checkLoadedFonts() {
+    var i;
+    var len = this.fonts.length;
+    var node;
+    var w;
+    var loadedCount = len;
+    for (i = 0; i < len; i += 1) {
+      if (this.fonts[i].loaded) {
+        loadedCount -= 1;
+      } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
+        this.fonts[i].loaded = true;
+      } else {
+        node = this.fonts[i].monoCase.node;
+        w = this.fonts[i].monoCase.w;
+        if (node.offsetWidth !== w) {
+          loadedCount -= 1;
+          this.fonts[i].loaded = true;
+        } else {
+          node = this.fonts[i].sansCase.node;
+          w = this.fonts[i].sansCase.w;
+          if (node.offsetWidth !== w) {
+            loadedCount -= 1;
+            this.fonts[i].loaded = true;
+          }
+        }
+        if (this.fonts[i].loaded) {
+          this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
+          this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
+        }
+      }
+    }
+
+    if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
+      setTimeout(this.checkLoadedFontsBinded, 20);
+    } else {
+      setTimeout(this.setIsLoadedBinded, 10);
+    }
+  }
+
+  function createHelper(def, fontData) {
+    var tHelper = createNS('text');
+    tHelper.style.fontSize = '100px';
+    // tHelper.style.fontFamily = fontData.fFamily;
+
+    var fontProps = getFontProperties(fontData);
+    tHelper.setAttribute('font-family', fontData.fFamily);
+    tHelper.setAttribute('font-style', fontProps.style);
+    tHelper.setAttribute('font-weight', fontProps.weight);
+    tHelper.textContent = '1';
+    if (fontData.fClass) {
+      tHelper.style.fontFamily = 'inherit';
+      tHelper.setAttribute('class', fontData.fClass);
+    } else {
+      tHelper.style.fontFamily = fontData.fFamily;
+    }
+    def.appendChild(tHelper);
+    var tCanvasHelper = createTag('canvas').getContext('2d');
+    tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px ' + fontData.fFamily;
+    // tCanvasHelper.font = ' 100px '+ fontData.fFamily;
+    return tHelper;
+  }
+
+  function addFonts(fontData, defs) {
+    if (!fontData) {
+      this.isLoaded = true;
+      return;
+    }
+    if (this.chars) {
+      this.isLoaded = true;
+      this.fonts = fontData.list;
+      return;
+    }
+
+    var fontArr = fontData.list;
+    var i;
+    var len = fontArr.length;
+    var _pendingFonts = len;
+    for (i = 0; i < len; i += 1) {
+      var shouldLoadFont = true;
+      var loadedSelector;
+      var j;
+      fontArr[i].loaded = false;
+      fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
+      fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
+      if (!fontArr[i].fPath) {
+        fontArr[i].loaded = true;
+        _pendingFonts -= 1;
+      } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
+        loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
+
+        if (loadedSelector.length > 0) {
+          shouldLoadFont = false;
+        }
+
+        if (shouldLoadFont) {
+          var s = createTag('style');
+          s.setAttribute('f-forigin', fontArr[i].fOrigin);
+          s.setAttribute('f-origin', fontArr[i].origin);
+          s.setAttribute('f-family', fontArr[i].fFamily);
+          s.type = 'text/css';
+          s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
+          defs.appendChild(s);
+        }
+      } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
+        loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var l = createTag('link');
+          l.setAttribute('f-forigin', fontArr[i].fOrigin);
+          l.setAttribute('f-origin', fontArr[i].origin);
+          l.type = 'text/css';
+          l.rel = 'stylesheet';
+          l.href = fontArr[i].fPath;
+          document.body.appendChild(l);
+        }
+      } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
+        loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (fontArr[i].fPath === loadedSelector[j].src) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var sc = createTag('link');
+          sc.setAttribute('f-forigin', fontArr[i].fOrigin);
+          sc.setAttribute('f-origin', fontArr[i].origin);
+          sc.setAttribute('rel', 'stylesheet');
+          sc.setAttribute('href', fontArr[i].fPath);
+          defs.appendChild(sc);
+        }
+      }
+      fontArr[i].helper = createHelper(defs, fontArr[i]);
+      fontArr[i].cache = {};
+      this.fonts.push(fontArr[i]);
+    }
+    if (_pendingFonts === 0) {
+      this.isLoaded = true;
+    } else {
+      // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
+      // Adding this timeout seems to fix it
+      setTimeout(this.checkLoadedFonts.bind(this), 100);
+    }
+  }
+
+  function addChars(chars) {
+    if (!chars) {
+      return;
+    }
+    if (!this.chars) {
+      this.chars = [];
+    }
+    var i;
+    var len = chars.length;
+    var j;
+    var jLen = this.chars.length;
+    var found;
+    for (i = 0; i < len; i += 1) {
+      j = 0;
+      found = false;
+      while (j < jLen) {
+        if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
+          found = true;
+        }
+        j += 1;
+      }
+      if (!found) {
+        this.chars.push(chars[i]);
+        jLen += 1;
+      }
+    }
+  }
+
+  function getCharData(char, style, font) {
+    var i = 0;
+    var len = this.chars.length;
+    while (i < len) {
+      if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) {
+        return this.chars[i];
+      }
+      i += 1;
+    }
+    if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char)
+            && console
+            && console.warn // eslint-disable-line no-console
+            && !this._warned
+    ) {
+      this._warned = true;
+      console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console
+    }
+    return emptyChar;
+  }
+
+  function measureText(char, fontName, size) {
+    var fontData = this.getFontByName(fontName);
+    var index = char.charCodeAt(0);
+    if (!fontData.cache[index + 1]) {
+      var tHelper = fontData.helper;
+      // Canvas version
+      // fontData.cache[index] = tHelper.measureText(char).width / 100;
+      // SVG version
+      // console.log(tHelper.getBBox().width)
+      if (char === ' ') {
+        tHelper.textContent = '|' + char + '|';
+        var doubleSize = tHelper.getComputedTextLength();
+        tHelper.textContent = '||';
+        var singleSize = tHelper.getComputedTextLength();
+        fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
+      } else {
+        tHelper.textContent = char;
+        fontData.cache[index + 1] = (tHelper.getComputedTextLength()) / 100;
+      }
+    }
+    return fontData.cache[index + 1] * size;
+  }
+
+  function getFontByName(name) {
+    var i = 0;
+    var len = this.fonts.length;
+    while (i < len) {
+      if (this.fonts[i].fName === name) {
+        return this.fonts[i];
+      }
+      i += 1;
+    }
+    return this.fonts[0];
+  }
+
+  function getCombinedCharacterCodes() {
+    return combinedCharacters;
+  }
+
+  function setIsLoaded() {
+    this.isLoaded = true;
+  }
+
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this._warned = false;
+    this.initTime = Date.now();
+    this.setIsLoadedBinded = this.setIsLoaded.bind(this);
+    this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
+  };
+    // TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
+  Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
+  var fontPrototype = {
+    addChars: addChars,
+    addFonts: addFonts,
+    getCharData: getCharData,
+    getFontByName: getFontByName,
+    measureText: measureText,
+    checkLoadedFonts: checkLoadedFonts,
+    setIsLoaded: setIsLoaded,
+  };
+
+  Font.prototype = fontPrototype;
+
+  return Font;
+}());
+
+/* global initialDefaultFrame, BezierFactory, degToRads, bez, createTypedArray */
+/* exported PropertyFactory */
+
+var PropertyFactory = (function () {
+  var initFrame = initialDefaultFrame;
+  var mathAbs = Math.abs;
+
+  function interpolateValue(frameNum, caching) {
+    var offsetTime = this.offsetTime;
+    var newValue;
+    if (this.propType === 'multidimensional') {
+      newValue = createTypedArray('float32', this.pv.length);
+    }
+    var iterationIndex = caching.lastIndex;
+    var i = iterationIndex;
+    var len = this.keyframes.length - 1;
+    var flag = true;
+    var keyData;
+    var nextKeyData;
+
+    while (flag) {
+      keyData = this.keyframes[i];
+      nextKeyData = this.keyframes[i + 1];
+      if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
+        if (keyData.h) {
+          keyData = nextKeyData;
+        }
+        iterationIndex = 0;
+        break;
+      }
+      if ((nextKeyData.t - offsetTime) > frameNum) {
+        iterationIndex = i;
+        break;
+      }
+      if (i < len - 1) {
+        i += 1;
+      } else {
+        iterationIndex = 0;
+        flag = false;
+      }
+    }
+
+    var k;
+    var kLen;
+    var perc;
+    var jLen;
+    var j;
+    var fnc;
+    var nextKeyTime = nextKeyData.t - offsetTime;
+    var keyTime = keyData.t - offsetTime;
+    var endValue;
+    if (keyData.to) {
+      if (!keyData.bezierData) {
+        keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
+      }
+      var bezierData = keyData.bezierData;
+      if (frameNum >= nextKeyTime || frameNum < keyTime) {
+        var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
+        kLen = bezierData.points[ind].point.length;
+        for (k = 0; k < kLen; k += 1) {
+          newValue[k] = bezierData.points[ind].point[k];
+        }
+        // caching._lastKeyframeIndex = -1;
+      } else {
+        if (keyData.__fnct) {
+          fnc = keyData.__fnct;
+        } else {
+          fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
+          keyData.__fnct = fnc;
+        }
+        perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+        var distanceInLine = bezierData.segmentLength * perc;
+
+        var segmentPerc;
+        var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+        j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
+        flag = true;
+        jLen = bezierData.points.length;
+        while (flag) {
+          addedLength += bezierData.points[j].partialLength;
+          if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k];
+            }
+            break;
+          } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
+            segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
+            }
+            break;
+          }
+          if (j < jLen - 1) {
+            j += 1;
+          } else {
+            flag = false;
+          }
+        }
+        caching._lastPoint = j;
+        caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+        caching._lastKeyframeIndex = i;
+      }
+    } else {
+      var outX;
+      var outY;
+      var inX;
+      var inY;
+      var keyValue;
+      len = keyData.s.length;
+      endValue = nextKeyData.s || keyData.e;
+      if (this.sh && keyData.h !== 1) {
+        if (frameNum >= nextKeyTime) {
+          newValue[0] = endValue[0];
+          newValue[1] = endValue[1];
+          newValue[2] = endValue[2];
+        } else if (frameNum <= keyTime) {
+          newValue[0] = keyData.s[0];
+          newValue[1] = keyData.s[1];
+          newValue[2] = keyData.s[2];
+        } else {
+          var quatStart = createQuaternion(keyData.s);
+          var quatEnd = createQuaternion(endValue);
+          var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
+          quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+        }
+      } else {
+        for (i = 0; i < len; i += 1) {
+          if (keyData.h !== 1) {
+            if (frameNum >= nextKeyTime) {
+              perc = 1;
+            } else if (frameNum < keyTime) {
+              perc = 0;
+            } else {
+              if (keyData.o.x.constructor === Array) {
+                if (!keyData.__fnct) {
+                  keyData.__fnct = [];
+                }
+                if (!keyData.__fnct[i]) {
+                  outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+                  outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+                  inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+                  inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
+                  fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                  keyData.__fnct[i] = fnc;
+                } else {
+                  fnc = keyData.__fnct[i];
+                }
+              } else if (!keyData.__fnct) {
+                outX = keyData.o.x;
+                outY = keyData.o.y;
+                inX = keyData.i.x;
+                inY = keyData.i.y;
+                fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                keyData.__fnct = fnc;
+              } else {
+                fnc = keyData.__fnct;
+              }
+              perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+            }
+          }
+
+          endValue = nextKeyData.s || keyData.e;
+          keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
+
+          if (this.propType === 'multidimensional') {
+            newValue[i] = keyValue;
+          } else {
+            newValue = keyValue;
+          }
+        }
+      }
+    }
+    caching.lastIndex = iterationIndex;
+    return newValue;
+  }
+
+  // based on @Toji's https://github.com/toji/gl-matrix/
+  function slerp(a, b, t) {
+    var out = [];
+    var ax = a[0];
+    var ay = a[1];
+    var az = a[2];
+    var aw = a[3];
+    var bx = b[0];
+    var by = b[1];
+    var bz = b[2];
+    var bw = b[3];
+
+    var omega;
+    var cosom;
+    var sinom;
+    var scale0;
+    var scale1;
+
+    cosom = ax * bx + ay * by + az * bz + aw * bw;
+    if (cosom < 0.0) {
+      cosom = -cosom;
+      bx = -bx;
+      by = -by;
+      bz = -bz;
+      bw = -bw;
+    }
+    if ((1.0 - cosom) > 0.000001) {
+      omega = Math.acos(cosom);
+      sinom = Math.sin(omega);
+      scale0 = Math.sin((1.0 - t) * omega) / sinom;
+      scale1 = Math.sin(t * omega) / sinom;
+    } else {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+    out[0] = scale0 * ax + scale1 * bx;
+    out[1] = scale0 * ay + scale1 * by;
+    out[2] = scale0 * az + scale1 * bz;
+    out[3] = scale0 * aw + scale1 * bw;
+
+    return out;
+  }
+
+  function quaternionToEuler(out, quat) {
+    var qx = quat[0];
+    var qy = quat[1];
+    var qz = quat[2];
+    var qw = quat[3];
+    var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
+    var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
+    var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
+    out[0] = heading / degToRads;
+    out[1] = attitude / degToRads;
+    out[2] = bank / degToRads;
+  }
+
+  function createQuaternion(values) {
+    var heading = values[0] * degToRads;
+    var attitude = values[1] * degToRads;
+    var bank = values[2] * degToRads;
+    var c1 = Math.cos(heading / 2);
+    var c2 = Math.cos(attitude / 2);
+    var c3 = Math.cos(bank / 2);
+    var s1 = Math.sin(heading / 2);
+    var s2 = Math.sin(attitude / 2);
+    var s3 = Math.sin(bank / 2);
+    var w = c1 * c2 * c3 - s1 * s2 * s3;
+    var x = s1 * s2 * c3 + c1 * c2 * s3;
+    var y = s1 * c2 * c3 + c1 * s2 * s3;
+    var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+    return [x, y, z, w];
+  }
+
+  function getValueAtCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) {
+      if (this._caching.lastFrame >= frameNum) {
+        this._caching._lastKeyframeIndex = -1;
+        this._caching.lastIndex = 0;
+      }
+
+      var renderResult = this.interpolateValue(frameNum, this._caching);
+      this.pv = renderResult;
+    }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
+
+  function setVValue(val) {
+    var multipliedValue;
+    if (this.propType === 'unidimensional') {
+      multipliedValue = val * this.mult;
+      if (mathAbs(this.v - multipliedValue) > 0.00001) {
+        this.v = multipliedValue;
+        this._mdf = true;
+      }
+    } else {
+      var i = 0;
+      var len = this.v.length;
+      while (i < len) {
+        multipliedValue = val[i] * this.mult;
+        if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
+          this.v[i] = multipliedValue;
+          this._mdf = true;
+        }
+        i += 1;
+      }
+    }
+  }
+
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+      return;
+    }
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
+    }
+    this.lock = true;
+    this._mdf = this._isFirstFrame;
+    var i;
+    var len = this.effectsSequence.length;
+    var finalValue = this.kf ? this.pv : this.data.k;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this._isFirstFrame = false;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
+
+  function ValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this.v = mult ? data.k * mult : data.k;
+    this.pv = data.k;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.vel = 0;
+    this.effectsSequence = [];
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function MultiDimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.frameId = -1;
+    var i;
+    var len = data.k.length;
+    this.v = createTypedArray('float32', len);
+    this.pv = createTypedArray('float32', len);
+    this.vel = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      this.v[i] = data.k[i] * this.mult;
+      this.pv[i] = data.k[i];
+    }
+    this._isFirstFrame = true;
+    this.effectsSequence = [];
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.frameId = -1;
+    this._caching = {
+      lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1,
+    };
+    this.k = true;
+    this.kf = true;
+    this.data = data;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.v = initFrame;
+    this.pv = initFrame;
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedMultidimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    var i;
+    var len = data.k.length;
+    var s;
+    var e;
+    var to;
+    var ti;
+    for (i = 0; i < len - 1; i += 1) {
+      if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
+        s = data.k[i].s;
+        e = data.k[i + 1].s;
+        to = data.k[i].to;
+        ti = data.k[i].ti;
+        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]))) {
+          data.k[i].to = null;
+          data.k[i].ti = null;
+        }
+        if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+          if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+            data.k[i].to = null;
+            data.k[i].ti = null;
+          }
+        }
+      }
+    }
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.data = data;
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.k = true;
+    this.kf = true;
+    this._isFirstFrame = true;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.frameId = -1;
+    var arrLen = data.k[0].s.length;
+    this.v = createTypedArray('float32', arrLen);
+    this.pv = createTypedArray('float32', arrLen);
+    for (i = 0; i < arrLen; i += 1) {
+      this.v[i] = initFrame;
+      this.pv[i] = initFrame;
+    }
+    this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) };
+    this.addEffect = addEffect;
+  }
+
+  function getProp(elem, data, type, mult, container) {
+    var p;
+    if (!data.k.length) {
+      p = new ValueProperty(elem, data, mult, container);
+    } else if (typeof (data.k[0]) === 'number') {
+      p = new MultiDimensionalProperty(elem, data, mult, container);
+    } else {
+      switch (type) {
+        case 0:
+          p = new KeyframedValueProperty(elem, data, mult, container);
+          break;
+        case 1:
+          p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
+          break;
+        default:
+          break;
+      }
+    }
+    if (p.effectsSequence.length) {
+      container.addDynamicProperty(p);
+    }
+    return p;
+  }
+
+  var ob = {
+    getProp: getProp,
+  };
+  return ob;
+}());
+
+/* global Matrix, degToRads, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+/* exported TransformPropertyFactory */
+
+var TransformPropertyFactory = (function () {
+  var defaultVector = [0, 0];
+
+  function applyToMatrix(mat) {
+    var _mdf = this._mdf;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || _mdf;
+    if (this.a) {
+      mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+    }
+    if (this.s) {
+      mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+    }
+    if (this.sk) {
+      mat.skewFromAxis(-this.sk.v, this.sa.v);
+    }
+    if (this.r) {
+      mat.rotate(-this.r.v);
+    } else {
+      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]);
+    }
+    if (this.data.p.s) {
+      if (this.data.p.z) {
+        mat.translate(this.px.v, this.py.v, -this.pz.v);
+      } else {
+        mat.translate(this.px.v, this.py.v, 0);
+      }
+    } else {
+      mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+    }
+  }
+  function processKeys(forceRender) {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    }
+    if (this._isDirty) {
+      this.precalculateMatrix();
+      this._isDirty = false;
+    }
+
+    this.iterateDynamicProperties();
+
+    if (this._mdf || forceRender) {
+      var frameRate;
+      this.v.cloneFromProps(this.pre.props);
+      if (this.appliedTransformations < 1) {
+        this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      }
+      if (this.appliedTransformations < 2) {
+        this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      }
+      if (this.sk && this.appliedTransformations < 3) {
+        this.v.skewFromAxis(-this.sk.v, this.sa.v);
+      }
+      if (this.r && this.appliedTransformations < 4) {
+        this.v.rotate(-this.r.v);
+      } else if (!this.r && this.appliedTransformations < 4) {
+        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]);
+      }
+      if (this.autoOriented) {
+        var v1;
+        var v2;
+        frameRate = this.elem.globalData.frameRate;
+        if (this.p && this.p.keyframes && this.p.getValueAtTime) {
+          if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
+            v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
+          } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
+            v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
+          } else {
+            v1 = this.p.pv;
+            v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
+          }
+        } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
+          v1 = [];
+          v2 = [];
+          var px = this.px;
+          var py = this.py;
+          if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
+            v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
+            v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0);
+          } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0);
+            v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0);
+            v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
+          } else {
+            v1 = [px.pv, py.pv];
+            v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
+            v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
+          }
+        } else {
+          v2 = defaultVector;
+          v1 = v2;
+        }
+        this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+      }
+      if (this.data.p && this.data.p.s) {
+        if (this.data.p.z) {
+          this.v.translate(this.px.v, this.py.v, -this.pz.v);
+        } else {
+          this.v.translate(this.px.v, this.py.v, 0);
+        }
+      } else {
+        this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+      }
+    }
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function precalculateMatrix() {
+    if (!this.a.k) {
+      this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      this.appliedTransformations = 1;
+    } else {
+      return;
+    }
+    if (!this.s.effectsSequence.length) {
+      this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      this.appliedTransformations = 2;
+    } else {
+      return;
+    }
+    if (this.sk) {
+      if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+        this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+        this.appliedTransformations = 3;
+      } else {
+        return;
+      }
+    }
+    if (this.r) {
+      if (!this.r.effectsSequence.length) {
+        this.pre.rotate(-this.r.v);
+        this.appliedTransformations = 4;
+      }
+    } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+      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]);
+      this.appliedTransformations = 4;
+    }
+  }
+
+  function autoOrient() {
+    //
+    // var prevP = this.getValueAtTime();
+  }
+
+  function addDynamicProperty(prop) {
+    this._addDynamicProperty(prop);
+    this.elem.addDynamicProperty(prop);
+    this._isDirty = true;
+  }
+
+  function TransformProperty(elem, data, container) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.propType = 'transform';
+    this.data = data;
+    this.v = new Matrix();
+    // Precalculated matrix with non animated properties
+    this.pre = new Matrix();
+    this.appliedTransformations = 0;
+    this.initDynamicPropertyContainer(container || elem);
+    if (data.p && data.p.s) {
+      this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
+      this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
+      if (data.p.z) {
+        this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
+      }
+    } else {
+      this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this);
+    }
+    if (data.rx) {
+      this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+      this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+      this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+      if (data.or.k[0].ti) {
+        var i;
+        var len = data.or.k.length;
+        for (i = 0; i < len; i += 1) {
+          data.or.k[i].to = null;
+          data.or.k[i].ti = null;
+        }
+      }
+      this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+      // sh Indicates it needs to be capped between -180 and 180
+      this.or.sh = true;
+    } else {
+      this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this);
+    }
+    if (data.sk) {
+      this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+      this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+    }
+    this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 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.
+    if (data.o) {
+      this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
+    } else {
+      this.o = { _mdf: false, v: 1 };
+    }
+    this._isDirty = true;
+    if (!this.dynamicProperties.length) {
+      this.getValue(true);
+    }
+  }
+
+  TransformProperty.prototype = {
+    applyToMatrix: applyToMatrix,
+    getValue: processKeys,
+    precalculateMatrix: precalculateMatrix,
+    autoOrient: autoOrient,
+  };
+
+  extendPrototype([DynamicPropertyContainer], TransformProperty);
+  TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+  TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+  function getTransformProperty(elem, data, container) {
+    return new TransformProperty(elem, data, container);
+  }
+
+  return {
+    getTransformProperty: getTransformProperty,
+  };
+}());
+
+/* global createSizedArray, createSizedArray, pointPool */
+
+function ShapePath() {
+  this.c = false;
+  this._length = 0;
+  this._maxLength = 8;
+  this.v = createSizedArray(this._maxLength);
+  this.o = createSizedArray(this._maxLength);
+  this.i = createSizedArray(this._maxLength);
+}
+
+ShapePath.prototype.setPathData = function (closed, len) {
+  this.c = closed;
+  this.setLength(len);
+  var i = 0;
+  while (i < len) {
+    this.v[i] = pointPool.newElement();
+    this.o[i] = pointPool.newElement();
+    this.i[i] = pointPool.newElement();
+    i += 1;
+  }
 };
-var ShapePropertyFactory = (function(){
 
-    var initFrame = -999999;
+ShapePath.prototype.setLength = function (len) {
+  while (this._maxLength < len) {
+    this.doubleArrayLength();
+  }
+  this._length = len;
+};
 
-    function interpolateShape(frameNum, previousValue, caching) {
-        var iterationIndex = caching.lastIndex;
-        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
-        var kf = this.keyframes;
-        if(frameNum < kf[0].t-this.offsetTime){
-            keyPropS = kf[0].s[0];
-            isHold = true;
-            iterationIndex = 0;
-        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
-            keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
-            /*if(kf[kf.length - 1].s){
+ShapePath.prototype.doubleArrayLength = function () {
+  this.v = this.v.concat(createSizedArray(this._maxLength));
+  this.i = this.i.concat(createSizedArray(this._maxLength));
+  this.o = this.o.concat(createSizedArray(this._maxLength));
+  this._maxLength *= 2;
+};
+
+ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
+  var arr;
+  this._length = Math.max(this._length, pos + 1);
+  if (this._length >= this._maxLength) {
+    this.doubleArrayLength();
+  }
+  switch (type) {
+    case 'v':
+      arr = this.v;
+      break;
+    case 'i':
+      arr = this.i;
+      break;
+    case 'o':
+      arr = this.o;
+      break;
+    default:
+      arr = [];
+      break;
+  }
+  if (!arr[pos] || (arr[pos] && !replace)) {
+    arr[pos] = pointPool.newElement();
+  }
+  arr[pos][0] = x;
+  arr[pos][1] = y;
+};
+
+ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
+  this.setXYAt(vX, vY, 'v', pos, replace);
+  this.setXYAt(oX, oY, 'o', pos, replace);
+  this.setXYAt(iX, iY, 'i', pos, replace);
+};
+
+ShapePath.prototype.reverse = function () {
+  var newPath = new ShapePath();
+  newPath.setPathData(this.c, this._length);
+  var vertices = this.v;
+  var outPoints = this.o;
+  var inPoints = this.i;
+  var init = 0;
+  if (this.c) {
+    newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+    init = 1;
+  }
+  var cnt = this._length - 1;
+  var len = this._length;
+
+  var i;
+  for (i = init; i < len; i += 1) {
+    newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+    cnt -= 1;
+  }
+  return newPath;
+};
+
+/* global extendPrototype, roundCorner, BezierFactory, shapePool, degToRads,
+  shapeCollectionPool, PropertyFactory, bmMin, DynamicPropertyContainer */
+/* exported ShapePropertyFactory */
+
+var ShapePropertyFactory = (function () {
+  var initFrame = -999999;
+
+  function interpolateShape(frameNum, previousValue, caching) {
+    var iterationIndex = caching.lastIndex;
+    var keyPropS;
+    var keyPropE;
+    var isHold;
+    var j;
+    var k;
+    var jLen;
+    var kLen;
+    var perc;
+    var vertexValue;
+    var kf = this.keyframes;
+    if (frameNum < kf[0].t - this.offsetTime) {
+      keyPropS = kf[0].s[0];
+      isHold = true;
+      iterationIndex = 0;
+    } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
+      keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
+      /* if(kf[kf.length - 1].s){
                 keyPropS = kf[kf.length - 1].s[0];
             }else{
                 keyPropS = kf[kf.length - 2].e[0];
-            }*/
-            isHold = true;
-        }else{
-            var i = iterationIndex;
-            var len = kf.length- 1,flag = true,keyData,nextKeyData;
-            while(flag){
-                keyData = kf[i];
-                nextKeyData = kf[i+1];
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-            isHold = keyData.h === 1;
-            iterationIndex = i;
-            if(!isHold){
-                if(frameNum >= nextKeyData.t-this.offsetTime){
-                    perc = 1;
-                }else if(frameNum < keyData.t-this.offsetTime){
-                    perc = 0;
-                }else{
-                    var fnc;
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                }
-                keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
-            }
-            keyPropS = keyData.s[0];
+            } */
+      isHold = true;
+    } else {
+      var i = iterationIndex;
+      var len = kf.length - 1;
+      var flag = true;
+      var keyData;
+      var nextKeyData;
+      while (flag) {
+        keyData = kf[i];
+        nextKeyData = kf[i + 1];
+        if ((nextKeyData.t - this.offsetTime) > frameNum) {
+          break;
         }
-        jLen = previousValue._length;
-        kLen = keyPropS.i[0].length;
-        caching.lastIndex = iterationIndex;
-
-        for(j=0;j<jLen;j+=1){
-            for(k=0;k<kLen;k+=1){
-                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                previousValue.i[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                previousValue.o[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                previousValue.v[j][k] = vertexValue;
-            }
+        if (i < len - 1) {
+          i += 1;
+        } else {
+          flag = false;
         }
+      }
+      isHold = keyData.h === 1;
+      iterationIndex = i;
+      if (!isHold) {
+        if (frameNum >= nextKeyData.t - this.offsetTime) {
+          perc = 1;
+        } else if (frameNum < keyData.t - this.offsetTime) {
+          perc = 0;
+        } else {
+          var fnc;
+          if (keyData.__fnct) {
+            fnc = keyData.__fnct;
+          } else {
+            fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
+            keyData.__fnct = fnc;
+          }
+          perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime)));
+        }
+        keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
+      }
+      keyPropS = keyData.s[0];
     }
+    jLen = previousValue._length;
+    kLen = keyPropS.i[0].length;
+    caching.lastIndex = iterationIndex;
 
-    function interpolateShapeCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
-        var lastFrame = this._caching.lastFrame;
-        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
-            ////
-            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
-            this.interpolateShape(frameNum, this.pv, this._caching);
-            ////
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
+    for (j = 0; j < jLen; j += 1) {
+      for (k = 0; k < kLen; k += 1) {
+        vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
+        previousValue.i[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
+        previousValue.o[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
+        previousValue.v[j][k] = vertexValue;
+      }
     }
+  }
 
-    function resetShape(){
-        this.paths = this.localShapeCollection;
+  function interpolateShapeCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    var lastFrame = this._caching.lastFrame;
+    if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) {
+      /// /
+      this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+      this.interpolateShape(frameNum, this.pv, this._caching);
+      /// /
     }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            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] 
+  function resetShape() {
+    this.paths = this.localShapeCollection;
+  }
+
+  function shapesEqual(shape1, shape2) {
+    if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
+      return false;
+    }
+    var i;
+    var len = shape1._length;
+    for (i = 0; i < len; i += 1) {
+      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]) {
-                return false;
-            }
-        }
-        return true;
+        return false;
+      }
     }
+    return true;
+  }
 
-    function setVValue(newPath) {
-        if(!shapesEqual(this.v, newPath)) {
-            this.v = shape_pool.clone(newPath);
-            this.localShapeCollection.releaseShapes();
-            this.localShapeCollection.addShape(this.v);
-            this._mdf = true;
-            this.paths = this.localShapeCollection;
-        }
+  function setVValue(newPath) {
+    if (!shapesEqual(this.v, newPath)) {
+      this.v = shapePool.clone(newPath);
+      this.localShapeCollection.releaseShapes();
+      this.localShapeCollection.addShape(this.v);
+      this._mdf = true;
+      this.paths = this.localShapeCollection;
     }
+  }
 
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        } else if (!this.effectsSequence.length) {
-            this._mdf = false;
-            return;
-        }
-        if (this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = false;
-        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
-        var i, len = this.effectsSequence.length;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    };
-
-    function ShapeProperty(elem, data, type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.container = elem;
-        this.elem = elem;
-        this.data = data;
-        this.k = false;
-        this.kf = false;
-        this._mdf = false;
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v = shape_pool.clone(pathData);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-        this.effectsSequence = [];
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    } if (!this.effectsSequence.length) {
+      this._mdf = false;
+      return;
     }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
     }
-
-    ShapeProperty.prototype.interpolateShape = interpolateShape;
-    ShapeProperty.prototype.getValue = processEffectsSequence;
-    ShapeProperty.prototype.setVValue = setVValue;
-    ShapeProperty.prototype.addEffect = addEffect;
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.container = elem;
-        this.offsetTime = elem.data.st;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newElement();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-        this._caching = {lastFrame: initFrame, lastIndex: 0};
-        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+    this.lock = true;
+    this._mdf = false;
+    var finalValue;
+    if (this.kf) {
+      finalValue = this.pv;
+    } else if (this.data.ks) {
+      finalValue = this.data.ks.k;
+    } else {
+      finalValue = this.data.pt.k;
     }
-    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
-    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
-    KeyframedShapeProperty.prototype.setVValue = setVValue;
-    KeyframedShapeProperty.prototype.addEffect = addEffect;
+    var i;
+    var len = this.effectsSequence.length;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
 
-    var EllShapeProperty = (function(){
+  function ShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.container = elem;
+    this.elem = elem;
+    this.data = data;
+    this.k = false;
+    this.kf = false;
+    this._mdf = false;
+    var pathData = type === 3 ? data.pt.k : data.ks.k;
+    this.v = shapePool.clone(pathData);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.reset = resetShape;
+    this.effectsSequence = [];
+  }
 
-        var cPoint = roundCorner;
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
 
-        function EllShapeProperty(elem,data) {
-            /*this.v = {
+  ShapeProperty.prototype.interpolateShape = interpolateShape;
+  ShapeProperty.prototype.getValue = processEffectsSequence;
+  ShapeProperty.prototype.setVValue = setVValue;
+  ShapeProperty.prototype.addEffect = addEffect;
+
+  function KeyframedShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.elem = elem;
+    this.container = elem;
+    this.offsetTime = elem.data.st;
+    this.keyframes = type === 3 ? data.pt.k : data.ks.k;
+    this.k = true;
+    this.kf = true;
+    var len = this.keyframes[0].s[0].i.length;
+    this.v = shapePool.newElement();
+    this.v.setPathData(this.keyframes[0].s[0].c, len);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.lastFrame = initFrame;
+    this.reset = resetShape;
+    this._caching = { lastFrame: initFrame, lastIndex: 0 };
+    this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+  }
+  KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+  KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+  KeyframedShapeProperty.prototype.setVValue = setVValue;
+  KeyframedShapeProperty.prototype.addEffect = addEffect;
+
+  var EllShapeProperty = (function () {
+    var cPoint = roundCorner;
+
+    function EllShapePropertyFactory(elem, data) {
+      /* this.v = {
                 v: createSizedArray(4),
                 i: createSizedArray(4),
                 o: createSizedArray(4),
                 c: true
-            };*/
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertEllToPath();
-            }
-        };
+            }; */
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 4);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.paths = this.localShapeCollection;
+      this.localShapeCollection.addShape(this.v);
+      this.d = data.d;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertEllToPath();
+      }
+    }
 
-        EllShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function (){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-
-                if(this._mdf){
-                    this.convertEllToPath();
-                }
-            },
-            convertEllToPath: function() {
-                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-                var _cw = this.d !== 3;
-                var _v = this.v;
-                _v.v[0][0] = p0;
-                _v.v[0][1] = p1 - s1;
-                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.v[1][1] = p1;
-                _v.v[2][0] = p0;
-                _v.v[2][1] = p1 + s1;
-                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.v[3][1] = p1;
-                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.i[0][1] = p1 - s1;
-                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.i[1][1] = p1 - s1 * cPoint;
-                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.i[2][1] = p1 + s1;
-                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.i[3][1] = p1 + s1 * cPoint;
-                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.o[0][1] = p1 - s1;
-                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.o[1][1] = p1 + s1 * cPoint;
-                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.o[2][1] = p1 + s1;
-                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.o[3][1] = p1 - s1 * cPoint;
-            }
+    EllShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
         }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
 
-        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+        if (this._mdf) {
+          this.convertEllToPath();
+        }
+      },
+      convertEllToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var s0 = this.s.v[0] / 2;
+        var s1 = this.s.v[1] / 2;
+        var _cw = this.d !== 3;
+        var _v = this.v;
+        _v.v[0][0] = p0;
+        _v.v[0][1] = p1 - s1;
+        _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.v[1][1] = p1;
+        _v.v[2][0] = p0;
+        _v.v[2][1] = p1 + s1;
+        _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.v[3][1] = p1;
+        _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.i[0][1] = p1 - s1;
+        _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.i[1][1] = p1 - s1 * cPoint;
+        _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.i[2][1] = p1 + s1;
+        _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.i[3][1] = p1 + s1 * cPoint;
+        _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.o[0][1] = p1 - s1;
+        _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.o[1][1] = p1 + s1 * cPoint;
+        _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.o[2][1] = p1 + s1;
+        _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.o[3][1] = p1 - s1 * cPoint;
+      },
+    };
 
-        return EllShapeProperty;
-    }());
+    extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
 
-    var StarShapeProperty = (function() {
+    return EllShapePropertyFactory;
+  }());
 
-        function StarShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
-                this.convertToPath = this.convertStarToPath;
-            } else {
-                this.convertToPath = this.convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertToPath();
-            }
-        };
+  var StarShapeProperty = (function () {
+    function StarShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 0);
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.data = data;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      if (data.sy === 1) {
+        this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
+        this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
+        this.convertToPath = this.convertStarToPath;
+      } else {
+        this.convertToPath = this.convertPolygonToPath;
+      }
+      this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+      this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
+      this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertToPath();
+      }
+    }
 
-        StarShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function() {
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertToPath();
-                }
-            },
-            convertStarToPath: function() {
-                var numPts = Math.floor(this.pt.v)*2;
-                var angle = Math.PI*2/numPts;
-                /*this.v.v.length = numPts;
+    StarShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertToPath();
+        }
+      },
+      convertStarToPath: function () {
+        var numPts = Math.floor(this.pt.v) * 2;
+        var angle = (Math.PI * 2) / numPts;
+        /* this.v.v.length = numPts;
                 this.v.i.length = numPts;
-                this.v.o.length = numPts;*/
-                var longFlag = true;
-                var longRad = this.or.v;
-                var shortRad = this.ir.v;
-                var longRound = this.os.v;
-                var shortRound = this.is.v;
-                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-                currentAng += this.r.v;
-                var dir = this.data.d === 3 ? -1 : 1;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    rad = longFlag ? longRad : shortRad;
-                    roundness = longFlag ? longRound : shortRound;
-                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
+                this.v.o.length = numPts; */
+        var longFlag = true;
+        var longRad = this.or.v;
+        var shortRad = this.ir.v;
+        var longRound = this.os.v;
+        var shortRound = this.is.v;
+        var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2);
+        var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2);
+        var i;
+        var rad;
+        var roundness;
+        var perimSegment;
+        var currentAng = -Math.PI / 2;
+        currentAng += this.r.v;
+        var dir = this.data.d === 3 ? -1 : 1;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          rad = longFlag ? longRad : shortRad;
+          roundness = longFlag ? longRound : shortRound;
+          perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
 
-                    /*this.v.v[i] = [x,y];
+          /* this.v.v[i] = [x,y];
                     this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
                     this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                    this.v._length = numPts;*/
-                    longFlag = !longFlag;
-                    currentAng += angle*dir;
-                }
-            },
-            convertPolygonToPath: function() {
-                var numPts = Math.floor(this.pt.v);
-                var angle = Math.PI*2/numPts;
-                var rad = this.or.v;
-                var roundness = this.os.v;
-                var perimSegment = 2*Math.PI*rad/(numPts*4);
-                var i, currentAng = -Math.PI/ 2;
-                var dir = this.data.d === 3 ? -1 : 1;
-                currentAng += this.r.v;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
-                    currentAng += angle*dir;
-                }
-                this.paths.length = 0;
-                this.paths[0] = this.v;
-            }
-
+                    this.v._length = numPts; */
+          longFlag = !longFlag;
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
-
-        return StarShapeProperty;
-    }());
-
-    var RectShapeProperty = (function() {
-
-         function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertRectToPath();
-            }
-        };
-
-        RectShapeProperty.prototype = {
-            convertRectToPath: function (){
-                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-                var round = bm_min(v0,v1,this.r.v);
-                var cPoint = round*(1-roundCorner);
-                this.v._length = 0;
-
-                if(this.d === 2 || this.d === 1) {
-                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                    }
-                }else{
-                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                    }
-                }
-            },
-            getValue: function(frameNum){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertRectToPath();
-                }
-
-            },
-            reset: resetShape
+      },
+      convertPolygonToPath: function () {
+        var numPts = Math.floor(this.pt.v);
+        var angle = (Math.PI * 2) / numPts;
+        var rad = this.or.v;
+        var roundness = this.os.v;
+        var perimSegment = (2 * Math.PI * rad) / (numPts * 4);
+        var i;
+        var currentAng = -Math.PI * 0.5;
+        var dir = this.data.d === 3 ? -1 : 1;
+        currentAng += this.r.v;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+        this.paths.length = 0;
+        this.paths[0] = this.v;
+      },
 
-        return RectShapeProperty;
-    }());
+    };
+    extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
 
-    function getShapeProp(elem,data,type){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    }
+    return StarShapePropertyFactory;
+  }());
 
-    function getConstructorFunction() {
-        return ShapeProperty;
-    }
-
-    function getKeyframedConstructorFunction() {
-        return KeyframedShapeProperty;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    ob.getConstructorFunction = getConstructorFunction;
-    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data){
-        return new modifiers[nm](elem, data);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if (!this.closed) {
-        // 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.
-        data.sh.container.addDynamicProperty(data.sh);
-        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
-        this.shapes.push(shapeData);
-        this.addShapeToModifier(shapeData);
-        if (this._isAnimated) {
-            data.setAsAnimated();
-        }
-    }
-};
-ShapeModifier.prototype.init = function(elem,data){
-    this.shapes = [];
-    this.elem = elem;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,data);
-    this.frameId = initialDefaultFrame;
-    this.closed = false;
-    this.k = false;
-    if(this.dynamicProperties.length){
+  var RectShapeProperty = (function () {
+    function RectShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.c = true;
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
+      if (this.dynamicProperties.length) {
         this.k = true;
-    }else{
-        this.getValue(true);
+      } else {
+        this.k = false;
+        this.convertRectToPath();
+      }
     }
+
+    RectShapePropertyFactory.prototype = {
+      convertRectToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var v0 = this.s.v[0] / 2;
+        var v1 = this.s.v[1] / 2;
+        var round = bmMin(v0, v1, this.r.v);
+        var cPoint = round * (1 - roundCorner);
+        this.v._length = 0;
+
+        if (this.d === 2 || this.d === 1) {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
+          this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
+          }
+        } else {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
+          }
+        }
+      },
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertRectToPath();
+        }
+      },
+      reset: resetShape,
+    };
+    extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
+
+    return RectShapePropertyFactory;
+  }());
+
+  function getShapeProp(elem, data, type) {
+    var prop;
+    if (type === 3 || type === 4) {
+      var dataProp = type === 3 ? data.pt : data.ks;
+      var keys = dataProp.k;
+      if (keys.length) {
+        prop = new KeyframedShapeProperty(elem, data, type);
+      } else {
+        prop = new ShapeProperty(elem, data, type);
+      }
+    } else if (type === 5) {
+      prop = new RectShapeProperty(elem, data);
+    } else if (type === 6) {
+      prop = new EllShapeProperty(elem, data);
+    } else if (type === 7) {
+      prop = new StarShapeProperty(elem, data);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  }
+
+  function getConstructorFunction() {
+    return ShapeProperty;
+  }
+
+  function getKeyframedConstructorFunction() {
+    return KeyframedShapeProperty;
+  }
+
+  var ob = {};
+  ob.getShapeProp = getShapeProp;
+  ob.getConstructorFunction = getConstructorFunction;
+  ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
+  return ob;
+}());
+
+/* global shapeCollectionPool, initialDefaultFrame, extendPrototype, DynamicPropertyContainer */
+/* exported ShapeModifiers */
+
+var ShapeModifiers = (function () {
+  var ob = {};
+  var modifiers = {};
+  ob.registerModifier = registerModifier;
+  ob.getModifier = getModifier;
+
+  function registerModifier(nm, factory) {
+    if (!modifiers[nm]) {
+      modifiers[nm] = factory;
+    }
+  }
+
+  function getModifier(nm, elem, data) {
+    return new modifiers[nm](elem, data);
+  }
+
+  return ob;
+}());
+
+function ShapeModifier() {}
+ShapeModifier.prototype.initModifierProperties = function () {};
+ShapeModifier.prototype.addShapeToModifier = function () {};
+ShapeModifier.prototype.addShape = function (data) {
+  if (!this.closed) {
+    // 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.
+    data.sh.container.addDynamicProperty(data.sh);
+    var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() };
+    this.shapes.push(shapeData);
+    this.addShapeToModifier(shapeData);
+    if (this._isAnimated) {
+      data.setAsAnimated();
+    }
+  }
 };
-ShapeModifier.prototype.processKeys = function(){
-    if(this.elem.globalData.frameId === this.frameId){
-        return;
-    }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
+ShapeModifier.prototype.init = function (elem, data) {
+  this.shapes = [];
+  this.elem = elem;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, data);
+  this.frameId = initialDefaultFrame;
+  this.closed = false;
+  this.k = false;
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
+};
+ShapeModifier.prototype.processKeys = function () {
+  if (this.elem.globalData.frameId === this.frameId) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 extendPrototype([DynamicPropertyContainer], ShapeModifier);
-function TrimModifier(){
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, segmentsLengthPool, bez, shapePool, ShapeModifiers */
+
+function TrimModifier() {
 }
 extendPrototype([ShapeModifier], TrimModifier);
-TrimModifier.prototype.initModifierProperties = function(elem, data) {
-    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
-    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
-    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
-    this.sValue = 0;
-    this.eValue = 0;
-    this.getValue = this.processKeys;
-    this.m = data.m;
-    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
+TrimModifier.prototype.initModifierProperties = function (elem, data) {
+  this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
+  this.sValue = 0;
+  this.eValue = 0;
+  this.getValue = this.processKeys;
+  this.m = data.m;
+  this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.addShapeToModifier = function(shapeData){
-    shapeData.pathsData = [];
+TrimModifier.prototype.addShapeToModifier = function (shapeData) {
+  shapeData.pathsData = [];
 };
 
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
+TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
+  var segments = [];
+  if (e <= 1) {
+    segments.push({
+      s: s,
+      e: e,
+    });
+  } else if (s >= 1) {
+    segments.push({
+      s: s - 1,
+      e: e - 1,
+    });
+  } else {
+    segments.push({
+      s: s,
+      e: 1,
+    });
+    segments.push({
+      s: 0,
+      e: e - 1,
+    });
+  }
+  var shapeSegments = [];
+  var i;
+  var len = segments.length;
+  var segmentOb;
+  for (i = 0; i < len; i += 1) {
+    segmentOb = segments[i];
+    if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
+      var shapeS;
+      var shapeE;
+      if (segmentOb.s * totalModifierLength <= addedLength) {
+        shapeS = 0;
+      } else {
+        shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
+      }
+      if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
+        shapeE = 1;
+      } else {
+        shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
+      }
+      shapeSegments.push([shapeS, shapeE]);
+    }
+  }
+  if (!shapeSegments.length) {
+    shapeSegments.push([0, 0]);
+  }
+  return shapeSegments;
+};
+
+TrimModifier.prototype.releasePathsData = function (pathsData) {
+  var i;
+  var len = pathsData.length;
+  for (i = 0; i < len; i += 1) {
+    segmentsLengthPool.release(pathsData[i]);
+  }
+  pathsData.length = 0;
+  return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function (_isFirstFrame) {
+  var s;
+  var e;
+  if (this._mdf || _isFirstFrame) {
+    var o = (this.o.v % 360) / 360;
+    if (o < 0) {
+      o += 1;
+    }
+    if (this.s.v > 1) {
+      s = 1 + o;
+    } else if (this.s.v < 0) {
+      s = 0 + o;
+    } else {
+      s = this.s.v + o;
+    }
+    if (this.e.v > 1) {
+      e = 1 + o;
+    } else if (this.e.v < 0) {
+      e = 0 + o;
+    } else {
+      e = this.e.v + o;
+    }
+
+    if (s > e) {
+      var _s = s;
+      s = e;
+      e = _s;
+    }
+    s = Math.round(s * 10000) * 0.0001;
+    e = Math.round(e * 10000) * 0.0001;
+    this.sValue = s;
+    this.eValue = e;
+  } else {
+    s = this.sValue;
+    e = this.eValue;
+  }
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var pathsData;
+  var pathData;
+  var totalShapeLength;
+  var totalModifierLength = 0;
+
+  if (e === s) {
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].localShapeCollection.releaseShapes();
+      this.shapes[i].shape._mdf = true;
+      this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+      if (this._mdf) {
+        this.shapes[i].pathsData.length = 0;
+      }
+    }
+  } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) {
     var segments = [];
-    if (e <= 1) {
-        segments.push({
-            s: s,
-            e: e
-        });
-    } else if (s >= 1) {
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        });
-    } else {
-        segments.push({
-            s: s,
-            e: 1
-        });
-        segments.push({
-            s: 0,
-            e: e - 1
-        });
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
+    var shapeData;
+    var localShapeCollection;
     for (i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
+      shapeData = this.shapes[i];
+      // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+      if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
+        shapeData.shape.paths = shapeData.localShapeCollection;
+      } else {
+        shapePaths = shapeData.shape.paths;
+        jLen = shapePaths._length;
+        totalShapeLength = 0;
+        if (!shapeData.shape._mdf && shapeData.pathsData.length) {
+          totalShapeLength = shapeData.totalShapeLength;
         } else {
-            var shapeS, shapeE;
-            if (segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
+          pathsData = this.releasePathsData(shapeData.pathsData);
+          for (j = 0; j < jLen; j += 1) {
+            pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
+            pathsData.push(pathData);
+            totalShapeLength += pathData.totalLength;
+          }
+          shapeData.totalShapeLength = totalShapeLength;
+          shapeData.pathsData = pathsData;
         }
+
+        totalModifierLength += totalShapeLength;
+        shapeData.shape._mdf = true;
+      }
     }
-    if (!shapeSegments.length) {
-        shapeSegments.push([0, 0]);
-    }
-    return shapeSegments;
-};
-
-TrimModifier.prototype.releasePathsData = function(pathsData) {
-    var i, len = pathsData.length;
-    for (i = 0; i < len; i += 1) {
-        segments_length_pool.release(pathsData[i]);
-    }
-    pathsData.length = 0;
-    return pathsData;
-};
-
-TrimModifier.prototype.processShapes = function(_isFirstFrame) {
-    var s, e;
-    if (this._mdf || _isFirstFrame) {
-        var o = (this.o.v % 360) / 360;
-        if (o < 0) {
-            o += 1;
-        }
-        s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
-        e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
-        if (s === e) {
-
-        }
-        if (s > e) {
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        s = Math.round(s * 10000) * 0.0001;
-        e = Math.round(e * 10000) * 0.0001;
-        this.sValue = s;
-        this.eValue = e;
-    } else {
-        s = this.sValue;
-        e = this.eValue;
-    }
-    var shapePaths;
-    var i, len = this.shapes.length, j, jLen;
-    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
-
-    if (e === s) {
-        for (i = 0; i < len; i += 1) {
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape._mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-            if (this._mdf) {
-                this.shapes[i].pathsData.length = 0;
-            }
-        }
-    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for (i = 0; i < len; i += 1) {
-            shapeData = this.shapes[i];
-            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
-            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = this.releasePathsData(shapeData.pathsData);
-                    for (j = 0; j < jLen; j += 1) {
-                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape._mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0, edges;
-        for (i = len - 1; i >= 0; i -= 1) {
-            shapeData = this.shapes[i];
-            if (shapeData.shape._mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
-                if (this.m === 2 && len > 1) {
-                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]];
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if (shapeE <= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        });
-                    } else if (shapeS >= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    } else {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        });
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        if (segments.length > 1) {
-                            var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
-                            if (lastShapeInCollection.c) {
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if (this._mdf) {
-        for (i = 0; i < len; i += 1) {
-            //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
-            //Don't remove this even if it's losing cached info.
-            this.shapes[i].pathsData.length = 0;
-            this.shapes[i].shape._mdf = true;
-        }
-    }
-};
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for (i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i]);
-    }
-};
-
-TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
-    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
-    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
-    }
-    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
-    shapePath.setXYAt(points[1], points[5], 'o', pos);
-    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(points[0], points[4], 'v', pos);
-    }
-    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
+    var shapeS = s;
+    var shapeE = e;
     var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if (!shapePath) {
-        shapePath = shape_pool.newElement();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
+    var edges;
+    for (i = len - 1; i >= 0; i -= 1) {
+      shapeData = this.shapes[i];
+      if (shapeData.shape._mdf) {
+        localShapeCollection = shapeData.localShapeCollection;
+        localShapeCollection.releaseShapes();
+        // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+        if (this.m === 2 && len > 1) {
+          edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+          addedLength += shapeData.totalShapeLength;
+        } else {
+          edges = [[shapeS, shapeE]];
+        }
+        jLen = edges.length;
+        for (j = 0; j < jLen; j += 1) {
+          shapeS = edges[j][0];
+          shapeE = edges[j][1];
+          segments.length = 0;
+          if (shapeE <= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength * shapeE,
+            });
+          } else if (shapeS >= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * (shapeS - 1),
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          } else {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength,
+            });
+            segments.push({
+              s: 0,
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          }
+          var newShapesData = this.addShapes(shapeData, segments[0]);
+          if (segments[0].s !== segments[0].e) {
+            if (segments.length > 1) {
+              var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
+              if (lastShapeInCollection.c) {
+                var lastShape = newShapesData.pop();
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
+              } else {
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1]);
+              }
+            }
+            this.addPaths(newShapesData, localShapeCollection);
+          }
+        }
+        shapeData.shape.paths = localShapeCollection;
+      }
     }
-    shapes.push(shapePath);
+  } else if (this._mdf) {
     for (i = 0; i < len; i += 1) {
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for (j = 1; j < jLen; j +=1) {
-            currentLengthData = lengths[j-1];
-            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e) {
-                shapePath.c = false;
-                break;
-            } else {
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if (shapePaths[i].c && lengths.length) {
-            currentLengthData = lengths[j - 1];
-            if (addedLength <= shapeSegment.e) {
-                var segmentLength = lengths[j - 1].addedLength;
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if (shapePath._length) {
-            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
-        }
-        if (addedLength > shapeSegment.e) {
-            break;
-        }
-        if (i < len - 1) {
-            shapePath = shape_pool.newElement();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
+      // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
+      // Don't remove this even if it's losing cached info.
+      this.shapes[i].pathsData.length = 0;
+      this.shapes[i].shape._mdf = true;
     }
-    return shapes;
+  }
 };
 
+TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
+  var i;
+  var len = newPaths.length;
+  for (i = 0; i < len; i += 1) {
+    localShapeCollection.addShape(newPaths[i]);
+  }
+};
+
+TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+  shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+  shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
+  }
+  shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
+  shapePath.setXYAt(points[1], points[5], 'o', pos);
+  shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(points[0], points[4], 'v', pos);
+  }
+  shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
+  var pathsData = shapeData.pathsData;
+  var shapePaths = shapeData.shape.paths.shapes;
+  var i;
+  var len = shapeData.shape.paths._length;
+  var j;
+  var jLen;
+  var addedLength = 0;
+  var currentLengthData;
+  var segmentCount;
+  var lengths;
+  var segment;
+  var shapes = [];
+  var initPos;
+  var newShape = true;
+  if (!shapePath) {
+    shapePath = shapePool.newElement();
+    segmentCount = 0;
+    initPos = 0;
+  } else {
+    segmentCount = shapePath._length;
+    initPos = shapePath._length;
+  }
+  shapes.push(shapePath);
+  for (i = 0; i < len; i += 1) {
+    lengths = pathsData[i].lengths;
+    shapePath.c = shapePaths[i].c;
+    jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
+    for (j = 1; j < jLen; j += 1) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
+        addedLength += currentLengthData.addedLength;
+        shapePath.c = false;
+      } else if (addedLength > shapeSegment.e) {
+        shapePath.c = false;
+        break;
+      } else {
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+        addedLength += currentLengthData.addedLength;
+        segmentCount += 1;
+      }
+    }
+    if (shapePaths[i].c && lengths.length) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength <= shapeSegment.e) {
+        var segmentLength = lengths[j - 1].addedLength;
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+      } else {
+        shapePath.c = false;
+      }
+      addedLength += currentLengthData.addedLength;
+      segmentCount += 1;
+    }
+    if (shapePath._length) {
+      shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+      shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
+    }
+    if (addedLength > shapeSegment.e) {
+      break;
+    }
+    if (i < len - 1) {
+      shapePath = shapePool.newElement();
+      newShape = true;
+      shapes.push(shapePath);
+      segmentCount = 0;
+    }
+  }
+  return shapes;
+};
 
 ShapeModifiers.registerModifier('tm', TrimModifier);
-function RoundCornersModifier(){}
-extendPrototype([ShapeModifier],RoundCornersModifier);
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
-    this._isAnimated = !!this.rd.effectsSequence.length;
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, roundCorner, ShapeModifiers */
+
+function RoundCornersModifier() {}
+extendPrototype([ShapeModifier], RoundCornersModifier);
+RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
+  this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-            }
+RoundCornersModifier.prototype.processPath = function (path, round) {
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var i;
+  var len = path._length;
+  var currentV;
+  var currentI;
+  var currentO;
+  var closerV;
+  var distance;
+  var newPosPerc;
+  var index = 0;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < len; i += 1) {
+    currentV = path.v[i];
+    currentO = path.o[i];
+    currentI = path.i[i];
+    if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
+      if ((i === 0 || i === len - 1) && !path.c) {
+        clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
+        /* clonedPath.v[index] = currentV;
+                clonedPath.o[index] = currentO;
+                clonedPath.i[index] = currentI; */
+        index += 1;
+      } else {
+        if (i === 0) {
+          closerV = path.v[len - 1];
         } else {
-            cloned_path.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);
-            index += 1;
+          closerV = path.v[i - 1];
         }
-    }
-    return cloned_path;
-};
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = iX;
+        iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
+        vY = iY;
+        oX = vX - (vX - currentV[0]) * roundCorner;
+        oY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
 
-RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+        if (i === len - 1) {
+          closerV = path.v[0];
+        } else {
+          closerV = path.v[i + 1];
         }
-
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = oX;
+        oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
+        vY = oY;
+        iX = vX - (vX - currentV[0]) * roundCorner;
+        iY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
+      }
+    } else {
+      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);
+      index += 1;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  return clonedPath;
 };
 
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function PuckerAndBloatModifier(){}
-extendPrototype([ShapeModifier],PuckerAndBloatModifier);
-PuckerAndBloatModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.amount = PropertyFactory.getProp(elem,data.a,0,null,this);
-    this._isAnimated = !!this.amount.effectsSequence.length;
-};
+RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var rd = this.rd.v;
 
-PuckerAndBloatModifier.prototype.processPath = function(path, amount){
-    var percent = amount / 100;
-    var centerPoint = [0, 0];
-    var pathLength = path._length, i = 0;
-    for (i = 0; i < pathLength; i += 1) {
-        centerPoint[0] += path.v[i][0];
-        centerPoint[1] += path.v[i][1];
-    }
-    centerPoint[0] /= pathLength;
-    centerPoint[1] /= pathLength;
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var vX, vY, oX, oY, iX, iY;
-    for(i = 0; i < pathLength; i += 1) {
-        vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
-        vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
-        oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
-        oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
-        iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
-        iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
-        cloned_path.setTripleAt(vX, vY, oX, oY, iX, iY, i);
-    }
-    return cloned_path;
-};
-
-PuckerAndBloatModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var amount = this.amount.v;
-
-    if(amount !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+  if (rd !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
         }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
 };
-ShapeModifiers.registerModifier('pb',PuckerAndBloatModifier);
-function RepeaterModifier(){}
+
+ShapeModifiers.registerModifier('rd', RoundCornersModifier);
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, ShapeModifiers */
+
+function PuckerAndBloatModifier() {}
+extendPrototype([ShapeModifier], PuckerAndBloatModifier);
+PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
+  this._isAnimated = !!this.amount.effectsSequence.length;
+};
+
+PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
+  var percent = amount / 100;
+  var centerPoint = [0, 0];
+  var pathLength = path._length;
+  var i = 0;
+  for (i = 0; i < pathLength; i += 1) {
+    centerPoint[0] += path.v[i][0];
+    centerPoint[1] += path.v[i][1];
+  }
+  centerPoint[0] /= pathLength;
+  centerPoint[1] /= pathLength;
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < pathLength; i += 1) {
+    vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
+    vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
+    oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
+    oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
+    iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
+    iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
+    clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
+  }
+  return clonedPath;
+};
+
+PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var amount = this.amount.v;
+
+  if (amount !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
+        }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
+    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
+};
+ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
+
+/* global extendPrototype, ShapeModifier, TransformPropertyFactory, PropertyFactory, Matrix, ShapeModifiers */
+
+function RepeaterModifier() {}
 extendPrototype([ShapeModifier], RepeaterModifier);
 
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
-    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
-    this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
-    this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
-    this.data = data;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this._isAnimated = !!this.dynamicProperties.length;
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
+RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
+  this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
+  this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
+  this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
+  this.data = data;
+  if (!this.dynamicProperties.length) {
+    this.getValue(true);
+  }
+  this._isAnimated = !!this.dynamicProperties.length;
+  this.pMatrix = new Matrix();
+  this.rMatrix = new Matrix();
+  this.sMatrix = new Matrix();
+  this.tMatrix = new Matrix();
+  this.matrix = new Matrix();
 };
 
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
+  var dir = inv ? -1 : 1;
+  var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
+  var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
+  pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
+  rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  rMatrix.rotate(-transform.r.v * dir * perc);
+  rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+  sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
+  sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
 };
 
-RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
-    this.elem = elem;
-    this.arr = arr;
-    this.pos = pos;
-    this.elemsData = elemsData;
-    this._currentCopies = 0;
-    this._elements = [];
-    this._groups = [];
-    this.frameId = -1;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,arr[pos]);
-    var cont = 0;
-    while(pos>0){
-        pos -= 1;
-        //this._elements.unshift(arr.splice(pos,1)[0]);
-        this._elements.unshift(arr[pos]);
-        cont += 1;
-    }
-    if(this.dynamicProperties.length){
-        this.k = true;
-    }else{
-        this.getValue(true);
-    }
+RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
+  this.elem = elem;
+  this.arr = arr;
+  this.pos = pos;
+  this.elemsData = elemsData;
+  this._currentCopies = 0;
+  this._elements = [];
+  this._groups = [];
+  this.frameId = -1;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, arr[pos]);
+  while (pos > 0) {
+    pos -= 1;
+    // this._elements.unshift(arr.splice(pos,1)[0]);
+    this._elements.unshift(arr[pos]);
+  }
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
 };
 
-RepeaterModifier.prototype.resetElements = function(elements){
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._processed = false;
-        if(elements[i].ty === 'gr'){
-            this.resetElements(elements[i].it);
+RepeaterModifier.prototype.resetElements = function (elements) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._processed = false;
+    if (elements[i].ty === 'gr') {
+      this.resetElements(elements[i].it);
+    }
+  }
+};
+
+RepeaterModifier.prototype.cloneElements = function (elements) {
+  var newElements = JSON.parse(JSON.stringify(elements));
+  this.resetElements(newElements);
+  return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._render = renderFlag;
+    if (elements[i].ty === 'gr') {
+      this.changeGroupRender(elements[i].it, renderFlag);
+    }
+  }
+};
+
+RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
+  var items;
+  var itemsTransform;
+  var i;
+  var dir;
+  var cont;
+  if (this._mdf || _isFirstFrame) {
+    var copies = Math.ceil(this.c.v);
+    if (this._groups.length < copies) {
+      while (this._groups.length < copies) {
+        var group = {
+          it: this.cloneElements(this._elements),
+          ty: 'gr',
+        };
+        group.it.push({
+          a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr',
+        });
+
+        this.arr.splice(0, 0, group);
+        this._groups.splice(0, 0, group);
+        this._currentCopies += 1;
+      }
+      this.elem.reloadShapes();
+    }
+    cont = 0;
+    var renderFlag;
+    for (i = 0; i <= this._groups.length - 1; i += 1) {
+      renderFlag = cont < copies;
+      this._groups[i]._render = renderFlag;
+      this.changeGroupRender(this._groups[i].it, renderFlag);
+      cont += 1;
+    }
+
+    this._currentCopies = copies;
+    /// /
+
+    var offset = this.o.v;
+    var offsetModulo = offset % 1;
+    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+    var pProps = this.pMatrix.props;
+    var rProps = this.rMatrix.props;
+    var sProps = this.sMatrix.props;
+    this.pMatrix.reset();
+    this.rMatrix.reset();
+    this.sMatrix.reset();
+    this.tMatrix.reset();
+    this.matrix.reset();
+    var iteration = 0;
+
+    if (offset > 0) {
+      while (iteration < roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+        iteration += 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+        iteration += offsetModulo;
+      }
+    } else if (offset < 0) {
+      while (iteration > roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+        iteration -= 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
+        iteration -= offsetModulo;
+      }
+    }
+    i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+    dir = this.data.m === 1 ? 1 : -1;
+    cont = this._currentCopies;
+    var j;
+    var jLen;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      jLen = itemsTransform.length;
+      items[items.length - 1].transform.mProps._mdf = true;
+      items[items.length - 1].transform.op._mdf = true;
+      items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
+      if (iteration !== 0) {
+        if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
+          this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
         }
-    }
-};
+        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]);
+        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]);
+        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]);
 
-RepeaterModifier.prototype.cloneElements = function(elements){
-    var i, len = elements.length;
-    var newElements = JSON.parse(JSON.stringify(elements));
-    this.resetElements(newElements);
-    return newElements;
-};
-
-RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._render = renderFlag;
-        if(elements[i].ty === 'gr') {
-            this.changeGroupRender(elements[i].it, renderFlag);
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-    }
-};
-
-RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
-    var items, itemsTransform, i, dir, cont;
-    if(this._mdf || _isFirstFrame){
-        var copies = Math.ceil(this.c.v);
-        if(this._groups.length < copies){
-            while(this._groups.length < copies){
-                var group = {
-                    it:this.cloneElements(this._elements),
-                    ty:'gr'
-                };
-                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
-                
-                this.arr.splice(0,0,group);
-                this._groups.splice(0,0,group);
-                this._currentCopies += 1;
-            }
-            this.elem.reloadShapes();
-        }
-        cont = 0;
-        var renderFlag;
-        for(i = 0; i  <= this._groups.length - 1; i += 1){
-            renderFlag = cont < copies;
-            this._groups[i]._render = renderFlag;
-            this.changeGroupRender(this._groups[i].it, renderFlag);
-            cont += 1;
-        }
-        
-        this._currentCopies = copies;
-        ////
-
-        var offset = this.o.v;
-        var offsetModulo = offset%1;
-        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-        var k;
-        var tMat = this.tr.v.props;
-        var pProps = this.pMatrix.props;
-        var rProps = this.rMatrix.props;
-        var sProps = this.sMatrix.props;
-        this.pMatrix.reset();
-        this.rMatrix.reset();
-        this.sMatrix.reset();
-        this.tMatrix.reset();
         this.matrix.reset();
-        var iteration = 0;
-
-        if(offset > 0) {
-            while(iteration<roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                iteration += 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                iteration += offsetModulo;
-            }
-        } else if(offset < 0) {
-            while(iteration>roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                iteration -= 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                iteration -= offsetModulo;
-            }
+      } else {
+        this.matrix.reset();
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
-        dir = this.data.m === 1 ? 1 : -1;
-        cont = this._currentCopies;
-        var j, jLen;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            jLen = itemsTransform.length;
-            items[items.length - 1].transform.mProps._mdf = true;
-            items[items.length - 1].transform.op._mdf = true;
-            items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
-            if(iteration !== 0){
-                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                }
-                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]);
-                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]);
-                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]);
-                
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-                this.matrix.reset();
-            } else {
-                this.matrix.reset();
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-            }
-            iteration += 1;
-            cont -= 1;
-            i += dir;
-        }
-    } else {
-        cont = this._currentCopies;
-        i = 0;
-        dir = 1;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            items[items.length - 1].transform.mProps._mdf = false;
-            items[items.length - 1].transform.op._mdf = false;
-            cont -= 1;
-            i += dir;
-        }
+      }
+      iteration += 1;
+      cont -= 1;
+      i += dir;
     }
+  } else {
+    cont = this._currentCopies;
+    i = 0;
+    dir = 1;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      items[items.length - 1].transform.mProps._mdf = false;
+      items[items.length - 1].transform.op._mdf = false;
+      cont -= 1;
+      i += dir;
+    }
+  }
 };
 
-RepeaterModifier.prototype.addShape = function(){};
+RepeaterModifier.prototype.addShape = function () {};
 
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = createSizedArray(this._maxLength);
+ShapeModifiers.registerModifier('rp', RepeaterModifier);
+
+/* global createSizedArray, shapePool */
+
+function ShapeCollection() {
+  this._length = 0;
+  this._maxLength = 4;
+  this.shapes = createSizedArray(this._maxLength);
 }
 
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
+ShapeCollection.prototype.addShape = function (shapeData) {
+  if (this._length === this._maxLength) {
+    this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
+    this._maxLength *= 2;
+  }
+  this.shapes[this._length] = shapeData;
+  this._length += 1;
 };
 
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
+ShapeCollection.prototype.releaseShapes = function () {
+  var i;
+  for (i = 0; i < this._length; i += 1) {
+    shapePool.release(this.shapes[i]);
+  }
+  this._length = 0;
 };
+
+/* global createSizedArray, createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
 function DashProperty(elem, data, renderer, container) {
-    this.elem = elem;
-    this.frameId = -1;
-    this.dataProps = createSizedArray(data.length);
-    this.renderer = renderer;
-    this.k = false;
-    this.dashStr = '';
-    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
-    this.dashoffset = createTypedArray('float32',  1);
-    this.initDynamicPropertyContainer(container);
-    var i, len = data.length || 0, prop;
-    for(i = 0; i < len; i += 1) {
-        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
-        this.k = prop.k || this.k;
-        this.dataProps[i] = {n:data[i].n,p:prop};
-    }
-    if(!this.k){
-        this.getValue(true);
-    }
-    this._isAnimated = this.k;
+  this.elem = elem;
+  this.frameId = -1;
+  this.dataProps = createSizedArray(data.length);
+  this.renderer = renderer;
+  this.k = false;
+  this.dashStr = '';
+  this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
+  this.dashoffset = createTypedArray('float32', 1);
+  this.initDynamicPropertyContainer(container);
+  var i;
+  var len = data.length || 0;
+  var prop;
+  for (i = 0; i < len; i += 1) {
+    prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
+    this.k = prop.k || this.k;
+    this.dataProps[i] = { n: data[i].n, p: prop };
+  }
+  if (!this.k) {
+    this.getValue(true);
+  }
+  this._isAnimated = this.k;
 }
 
-DashProperty.prototype.getValue = function(forceRender) {
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
+DashProperty.prototype.getValue = function (forceRender) {
+  if (this.elem.globalData.frameId === this.frameId && !forceRender) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
+  this._mdf = this._mdf || forceRender;
+  if (this._mdf) {
+    var i = 0;
+    var len = this.dataProps.length;
+    if (this.renderer === 'svg') {
+      this.dashStr = '';
     }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
-    this._mdf = this._mdf || forceRender;
-    if (this._mdf) {
-        var i = 0, len = this.dataProps.length;
-        if(this.renderer === 'svg') {
-            this.dashStr = '';
+    for (i = 0; i < len; i += 1) {
+      if (this.dataProps[i].n !== 'o') {
+        if (this.renderer === 'svg') {
+          this.dashStr += ' ' + this.dataProps[i].p.v;
+        } else {
+          this.dashArray[i] = this.dataProps[i].p.v;
         }
-        for(i=0;i<len;i+=1){
-            if(this.dataProps[i].n != 'o'){
-                if(this.renderer === 'svg') {
-                    this.dashStr += ' ' + this.dataProps[i].p.v;
-                }else{
-                    this.dashArray[i] = this.dataProps[i].p.v;
-                }
-            }else{
-                this.dashoffset[0] = this.dataProps[i].p.v;
-            }
-        }
+      } else {
+        this.dashoffset[0] = this.dataProps[i].p.v;
+      }
     }
+  }
 };
 extendPrototype([DynamicPropertyContainer], DashProperty);
-function GradientProperty(elem,data,container){
-    this.data = data;
-    this.c = createTypedArray('uint8c', data.p*4);
-    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-    this.o = createTypedArray('float32', cLength);
-    this._cmdf = false;
-    this._omdf = false;
-    this._collapsable = this.checkCollapsable();
-    this._hasOpacity = cLength;
-    this.initDynamicPropertyContainer(container);
-    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
-    this.k = this.prop.k;
-    this.getValue(true);
+
+/* global createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+function GradientProperty(elem, data, container) {
+  this.data = data;
+  this.c = createTypedArray('uint8c', data.p * 4);
+  var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;
+  this.o = createTypedArray('float32', cLength);
+  this._cmdf = false;
+  this._omdf = false;
+  this._collapsable = this.checkCollapsable();
+  this._hasOpacity = cLength;
+  this.initDynamicPropertyContainer(container);
+  this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
+  this.k = this.prop.k;
+  this.getValue(true);
 }
 
-GradientProperty.prototype.comparePoints = function(values, points) {
-    var i = 0, len = this.o.length/2, diff;
-    while(i < len) {
-        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
-        if(diff > 0.01){
-            return false;
-        }
-        i += 1;
+GradientProperty.prototype.comparePoints = function (values, points) {
+  var i = 0;
+  var len = this.o.length / 2;
+  var diff;
+  while (i < len) {
+    diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
+    if (diff > 0.01) {
+      return false;
     }
-    return true;
+    i += 1;
+  }
+  return true;
 };
 
-GradientProperty.prototype.checkCollapsable = function() {
-    if (this.o.length/2 !== this.c.length/4) {
+GradientProperty.prototype.checkCollapsable = function () {
+  if (this.o.length / 2 !== this.c.length / 4) {
+    return false;
+  }
+  if (this.data.k.k[0].s) {
+    var i = 0;
+    var len = this.data.k.k.length;
+    while (i < len) {
+      if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
         return false;
+      }
+      i += 1;
     }
-    if (this.data.k.k[0].s) {
-        var i = 0, len = this.data.k.k.length;
-        while (i < len) {
-            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
-                return false;
-            }
-            i += 1;
-        }
-    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
-        return false;
-    }
-    return true;
+  } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
+    return false;
+  }
+  return true;
 };
 
-GradientProperty.prototype.getValue = function(forceRender){
-    this.prop.getValue();
-    this._mdf = false;
-    this._cmdf = false;
-    this._omdf = false;
-    if(this.prop._mdf || forceRender){
-        var i, len = this.data.p*4;
-        var mult, val;
-        for(i=0;i<len;i+=1){
-            mult = i%4 === 0 ? 100 : 255;
-            val = Math.round(this.prop.v[i]*mult);
-            if(this.c[i] !== val){
-                this.c[i] = val;
-                this._cmdf = !forceRender;
-            }
-        }
-        if(this.o.length){
-            len = this.prop.v.length;
-            for(i=this.data.p*4;i<len;i+=1){
-                mult = i%2 === 0 ? 100 : 1;
-                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                if(this.o[i-this.data.p*4] !== val){
-                    this.o[i-this.data.p*4] = val;
-                    this._omdf = !forceRender;
-                }
-            }
-        }
-        this._mdf = !forceRender;
+GradientProperty.prototype.getValue = function (forceRender) {
+  this.prop.getValue();
+  this._mdf = false;
+  this._cmdf = false;
+  this._omdf = false;
+  if (this.prop._mdf || forceRender) {
+    var i;
+    var len = this.data.p * 4;
+    var mult;
+    var val;
+    for (i = 0; i < len; i += 1) {
+      mult = i % 4 === 0 ? 100 : 255;
+      val = Math.round(this.prop.v[i] * mult);
+      if (this.c[i] !== val) {
+        this.c[i] = val;
+        this._cmdf = !forceRender;
+      }
     }
+    if (this.o.length) {
+      len = this.prop.v.length;
+      for (i = this.data.p * 4; i < len; i += 1) {
+        mult = i % 2 === 0 ? 100 : 1;
+        val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
+        if (this.o[i - this.data.p * 4] !== val) {
+          this.o[i - this.data.p * 4] = val;
+          this._omdf = !forceRender;
+        }
+      }
+    }
+    this._mdf = !forceRender;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], GradientProperty);
-var buildShapeString = function(pathNodes, length, closed, mat) {
-	if(length === 0) {
-            return '';
-        }
-        var _o = pathNodes.o;
-        var _i = pathNodes.i;
-        var _v = pathNodes.v;
-        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
-        for(i = 1; i < length; i += 1) {
-            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]);
-        }
-        if (closed && length) {
-            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]);
-            shapeString += 'z';
-        }
-        return shapeString;
-}
-var audioControllerFactory = (function() {
 
-	function AudioController(audioFactory) {
-		this.audios = [];
-		this.audioFactory = audioFactory;
-		this._volume = 1;
-		this._isMuted = false;
-	}
+/* exported buildShapeString */
 
-	AudioController.prototype = {
-		addAudio: function(audio) {
-			this.audios.push(audio);
-		},
-		pause: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].pause()
-			}
-		},
-		resume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].resume()
-			}
-		},
-		setRate: function(rateValue) {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].setRate(rateValue)
-			}
-		},
-		createAudio: function(assetPath) {
-			if (this.audioFactory) {
-				return this.audioFactory(assetPath);
-			} else if (Howl) {
-				return new Howl({
-					src: [assetPath]
-				})
-			} else {
-				return {
-					isPlaying: false,
-					play: function(){this.isPlaying = true},
-					seek: function(){this.isPlaying = false},
-					playing: function(){},
-					rate: function(){},
-					setVolume: function(){},
-				}
-			}
-		},
-		setAudioFactory: function(audioFactory) {
-			this.audioFactory = audioFactory;
-		},
-		setVolume: function(value) {
-			this._volume = value;
-			this._updateVolume();
-		},
-		mute: function() {
-			this._isMuted = true;
-			this._updateVolume();
-		},
-		unmute: function() {
-			this._isMuted = false;
-			this._updateVolume();
-		},
-		getVolume: function(value) {
-			return this._volume;
-		},
-		_updateVolume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1))
-			}
-		}
-	}
-
-	return function() {
-		return new AudioController()
-	}
-
-}())
-var ImagePreloader = (function(){
-
-    var proxyImage = (function(){
-        var canvas = createTag('canvas');
-        canvas.width = 1;
-        canvas.height = 1;
-        var ctx = canvas.getContext('2d');
-        ctx.fillStyle = 'rgba(0,0,0,0)';
-        ctx.fillRect(0, 0, 1, 1);
-        return canvas;
-    }())
-
-    function imageLoaded(){
-        this.loadedAssets += 1;
-        if(this.loadedAssets === this.totalImages){
-            if(this.imagesLoadedCb) {
-                this.imagesLoadedCb(null);
-            }
-        }
-    }
-
-    function getAssetsPath(assetData, assetsPath, original_path) {
-        var path = '';
-        if (assetData.e) {
-            path = assetData.p;
-        } else if(assetsPath) {
-            var imagePath = assetData.p;
-            if (imagePath.indexOf('images/') !== -1) {
-                imagePath = imagePath.split('/')[1];
-            }
-            path = assetsPath + imagePath;
-        } else {
-            path = original_path;
-            path += assetData.u ? assetData.u : '';
-            path += assetData.p;
-        }
-        return path;
-    }
-
-    function testImageLoaded(img) {
-        var _count = 0;
-        var intervalId = setInterval(function() {
-            var box = img.getBBox();
-            if (box.width || _count > 500) {
-                this._imageLoaded();
-                clearInterval(intervalId);
-            }
-            _count += 1;
-        }.bind(this), 50)
-    }
-
-    function createImageData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createNS('image');
-        if (isSafari) {
-            this.testImageLoaded(img)
-        } else {
-            img.addEventListener('load', this._imageLoaded, false);
-        }
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.setAttributeNS('http://www.w3.org/1999/xlink','href', path);
-        this._elementHelper.append(img);
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function createImgData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createTag('img');
-        img.crossOrigin = 'anonymous';
-        img.addEventListener('load', this._imageLoaded, false);
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.src = path;
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function loadAssets(assets, cb){
-        this.imagesLoadedCb = cb;
-        var i, len = assets.length;
-        for (i = 0; i < len; i += 1) {
-            if(!assets[i].layers){
-                this.totalImages += 1;
-                this.images.push(this._createImageData(assets[i]));
-            }
-        }
-    }
-
-    function setPath(path){
-        this.path = path || '';
-    }
-
-    function setAssetsPath(path){
-        this.assetsPath = path || '';
-    }
-
-    function getImage(assetData) {
-        var i = 0, len = this.images.length;
-        while (i < len) {
-            if (this.images[i].assetData === assetData) {
-                return this.images[i].img;
-            }
-            i += 1;
-        }
-    }
-
-    function destroy() {
-        this.imagesLoadedCb = null;
-        this.images.length = 0;
-    }
-
-    function loaded() {
-        return this.totalImages === this.loadedAssets;
-    }
-
-    function setCacheType(type, elementHelper) {
-        if (type === 'svg') {
-            this._elementHelper = elementHelper;
-            this._createImageData = this.createImageData.bind(this);
-        } else {
-            this._createImageData = this.createImgData.bind(this);
-        }
-    }
-
-    function ImagePreloader(type){
-        this._imageLoaded = imageLoaded.bind(this);
-        this.testImageLoaded = testImageLoaded.bind(this);
-        this.assetsPath = '';
-        this.path = '';
-        this.totalImages = 0;
-        this.loadedAssets = 0;
-        this.imagesLoadedCb = null;
-        this.images = [];
-    };
-
-    ImagePreloader.prototype = {
-        loadAssets: loadAssets,
-        setAssetsPath: setAssetsPath,
-        setPath: setPath,
-        loaded: loaded,
-        destroy: destroy,
-        getImage: getImage,
-        createImgData: createImgData,
-        createImageData: createImageData,
-        imageLoaded: imageLoaded,
-        setCacheType: setCacheType,
-    }
-
-    return ImagePreloader;
-}());
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	};
-	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)) {
-	   ob.maskType = false;
-	}
-	return ob;
-}());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
-
-	function createFilter(filId){
-        	var fil = createNS('filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
-
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = createNS('feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
-                return feColorMatrix;
-	}
-
-	return ob;
-}());
-var assetLoader = (function(){
-
-	function formatResponse(xhr) {
-		if(xhr.response && typeof xhr.response === 'object') {
-			return xhr.response;
-		} else if(xhr.response && typeof xhr.response === 'string') {
-			return JSON.parse(xhr.response);
-		} else if(xhr.responseText) {
-			return JSON.parse(xhr.responseText);
-		}
-	}
-
-	function loadAsset(path, callback, errorCallback) {
-		var response;
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', path, true);
-		// set responseType after calling open or IE will break.
-		try {
-		    // This crashes on Android WebView prior to KitKat
-		    xhr.responseType = "json";
-		} catch (err) {}
-	    xhr.send();
-	    xhr.onreadystatechange = function () {
-	        if (xhr.readyState == 4) {
-	            if(xhr.status == 200){
-	            	response = formatResponse(xhr);
-	            	callback(response);
-	            }else{
-	                try{
-	            		response = formatResponse(xhr);
-	            		callback(response);
-	                }catch(err){
-	                	if(errorCallback) {
-	                		errorCallback(err);
-	                	}
-	                }
-	            }
-	        }
-	    };
-	}
-	return {
-		load: loadAsset
-	}
-}())
-
-function TextAnimatorProperty(textData, renderType, elem){
-    this._isFirstFrame = true;
-	this._hasMaskedPath = false;
-	this._frameId = -1;
-	this._textData = textData;
-	this._renderType = renderType;
-    this._elem = elem;
-	this._animatorsData = createSizedArray(this._textData.a.length);
-	this._pathData = {};
-	this._moreOptions = {
-		alignment: {}
-	};
-	this.renderedLetters = [];
-    this.lettersChangedFlag = false;
-    this.initDynamicPropertyContainer(elem);
-
-}
-
-TextAnimatorProperty.prototype.searchProperties = function(){
-    var i, len = this._textData.a.length, animatorProps;
-    var getProp = PropertyFactory.getProp;
-    for(i=0;i<len;i+=1){
-        animatorProps = this._textData.a[i];
-        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
-    }
-    if(this._textData.p && 'm' in this._textData.p){
-        this._pathData = {
-            f: getProp(this._elem,this._textData.p.f,0,0,this),
-            l: getProp(this._elem,this._textData.p.l,0,0,this),
-            r: this._textData.p.r,
-            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
-        };
-        this._hasMaskedPath = true;
-    } else {
-        this._hasMaskedPath = false;
-    }
-    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+var buildShapeString = function (pathNodes, length, closed, mat) {
+  if (length === 0) {
+    return '';
+  }
+  var _o = pathNodes.o;
+  var _i = pathNodes.i;
+  var _v = pathNodes.v;
+  var i;
+  var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+  for (i = 1; i < length; i += 1) {
+    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]);
+  }
+  if (closed && length) {
+    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]);
+    shapeString += 'z';
+  }
+  return shapeString;
 };
 
-TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
-    this.lettersChangedFlag = lettersChangedFlag;
-    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
-        return;
+/* global Howl */
+/* exported audioControllerFactory */
+
+var audioControllerFactory = (function () {
+  function AudioController(audioFactory) {
+    this.audios = [];
+    this.audioFactory = audioFactory;
+    this._volume = 1;
+    this._isMuted = false;
+  }
+
+  AudioController.prototype = {
+    addAudio: function (audio) {
+      this.audios.push(audio);
+    },
+    pause: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].pause();
+      }
+    },
+    resume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].resume();
+      }
+    },
+    setRate: function (rateValue) {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].setRate(rateValue);
+      }
+    },
+    createAudio: function (assetPath) {
+      if (this.audioFactory) {
+        return this.audioFactory(assetPath);
+      } if (Howl) {
+        return new Howl({
+          src: [assetPath],
+        });
+      }
+      return {
+        isPlaying: false,
+        play: function () { this.isPlaying = true; },
+        seek: function () { this.isPlaying = false; },
+        playing: function () {},
+        rate: function () {},
+        setVolume: function () {},
+      };
+    },
+    setAudioFactory: function (audioFactory) {
+      this.audioFactory = audioFactory;
+    },
+    setVolume: function (value) {
+      this._volume = value;
+      this._updateVolume();
+    },
+    mute: function () {
+      this._isMuted = true;
+      this._updateVolume();
+    },
+    unmute: function () {
+      this._isMuted = false;
+      this._updateVolume();
+    },
+    getVolume: function () {
+      return this._volume;
+    },
+    _updateVolume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
+      }
+    },
+  };
+
+  return function () {
+    return new AudioController();
+  };
+}());
+
+/* global createTag, createNS, isSafari */
+/* exported ImagePreloader */
+
+var ImagePreloader = (function () {
+  var proxyImage = (function () {
+    var canvas = createTag('canvas');
+    canvas.width = 1;
+    canvas.height = 1;
+    var ctx = canvas.getContext('2d');
+    ctx.fillStyle = 'rgba(0,0,0,0)';
+    ctx.fillRect(0, 0, 1, 1);
+    return canvas;
+  }());
+
+  function imageLoaded() {
+    this.loadedAssets += 1;
+    if (this.loadedAssets === this.totalImages) {
+      if (this.imagesLoadedCb) {
+        this.imagesLoadedCb(null);
+      }
     }
-    this._isFirstFrame = false;
-    var alignment = this._moreOptions.alignment.v;
-    var animators = this._animatorsData;
-    var textData = this._textData;
-    var matrixHelper = this.mHelper;
-    var renderType = this._renderType;
-    var renderedLettersCount = this.renderedLetters.length;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
-    if(this._hasMaskedPath) {
-        mask = this._pathData.m;
-        if(!this._pathData.n || this._pathData._mdf){
-            var paths = mask.v;
-            if(this._pathData.r){
-                paths = paths.reverse();
-            }
-            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
-            pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths._length - 1;
-            var bezierData;
-            totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            this._pathData.pi = pathInfo;
-        }
-        pathInfo = this._pathData.pi;
+  }
 
-        currentLength = this._pathData.f.v;
-        segmentInd = 0;
-        pointInd = 1;
-        segmentLength = 0;
-        flag = true;
-        segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].points;
-                    pointInd = points.length - 1;
-                }
-            }
+  function getAssetsPath(assetData, assetsPath, originalPath) {
+    var path = '';
+    if (assetData.e) {
+      path = assetData.p;
+    } else if (assetsPath) {
+      var imagePath = assetData.p;
+      if (imagePath.indexOf('images/') !== -1) {
+        imagePath = imagePath.split('/')[1];
+      }
+      path = assetsPath + imagePath;
+    } else {
+      path = originalPath;
+      path += assetData.u ? assetData.u : '';
+      path += assetData.p;
+    }
+    return path;
+  }
 
+  function testImageLoaded(img) {
+    var _count = 0;
+    var intervalId = setInterval(function () {
+      var box = img.getBBox();
+      if (box.width || _count > 500) {
+        this._imageLoaded();
+        clearInterval(intervalId);
+      }
+      _count += 1;
+    }.bind(this), 50);
+  }
+
+  function createImageData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createNS('image');
+    if (isSafari) {
+      this.testImageLoaded(img);
+    } else {
+      img.addEventListener('load', this._imageLoaded, false);
+    }
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
+    this._elementHelper.append(img);
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function createImgData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createTag('img');
+    img.crossOrigin = 'anonymous';
+    img.addEventListener('load', this._imageLoaded, false);
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.src = path;
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function loadAssets(assets, cb) {
+    this.imagesLoadedCb = cb;
+    var i;
+    var len = assets.length;
+    for (i = 0; i < len; i += 1) {
+      if (!assets[i].layers) {
+        this.totalImages += 1;
+        this.images.push(this._createImageData(assets[i]));
+      }
+    }
+  }
+
+  function setPath(path) {
+    this.path = path || '';
+  }
+
+  function setAssetsPath(path) {
+    this.assetsPath = path || '';
+  }
+
+  function getImage(assetData) {
+    var i = 0;
+    var len = this.images.length;
+    while (i < len) {
+      if (this.images[i].assetData === assetData) {
+        return this.images[i].img;
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function destroy() {
+    this.imagesLoadedCb = null;
+    this.images.length = 0;
+  }
+
+  function loaded() {
+    return this.totalImages === this.loadedAssets;
+  }
+
+  function setCacheType(type, elementHelper) {
+    if (type === 'svg') {
+      this._elementHelper = elementHelper;
+      this._createImageData = this.createImageData.bind(this);
+    } else {
+      this._createImageData = this.createImgData.bind(this);
+    }
+  }
+
+  function ImagePreloaderFactory() {
+    this._imageLoaded = imageLoaded.bind(this);
+    this.testImageLoaded = testImageLoaded.bind(this);
+    this.assetsPath = '';
+    this.path = '';
+    this.totalImages = 0;
+    this.loadedAssets = 0;
+    this.imagesLoadedCb = null;
+    this.images = [];
+  }
+
+  ImagePreloaderFactory.prototype = {
+    loadAssets: loadAssets,
+    setAssetsPath: setAssetsPath,
+    setPath: setPath,
+    loaded: loaded,
+    destroy: destroy,
+    getImage: getImage,
+    createImgData: createImgData,
+    createImageData: createImageData,
+    imageLoaded: imageLoaded,
+    setCacheType: setCacheType,
+  };
+
+  return ImagePreloaderFactory;
+}());
+
+/* exported featureSupport */
+
+var featureSupport = (function () {
+  var ob = {
+    maskType: true,
+  };
+  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)) {
+    ob.maskType = false;
+  }
+  return ob;
+}());
+
+/* global createNS */
+/* exported filtersFactory */
+
+var filtersFactory = (function () {
+  var ob = {};
+  ob.createFilter = createFilter;
+  ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
+
+  function createFilter(filId) {
+    var fil = createNS('filter');
+    fil.setAttribute('id', filId);
+    fil.setAttribute('filterUnits', 'objectBoundingBox');
+    fil.setAttribute('x', '0%');
+    fil.setAttribute('y', '0%');
+    fil.setAttribute('width', '100%');
+    fil.setAttribute('height', '100%');
+    return fil;
+  }
+
+  function createAlphaToLuminanceFilter() {
+    var feColorMatrix = createNS('feColorMatrix');
+    feColorMatrix.setAttribute('type', 'matrix');
+    feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+    feColorMatrix.setAttribute('values', '0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
+    return feColorMatrix;
+  }
+
+  return ob;
+}());
+
+/* exported assetLoader */
+
+var assetLoader = (function () {
+  function formatResponse(xhr) {
+    if (xhr.response && typeof xhr.response === 'object') {
+      return xhr.response;
+    } if (xhr.response && typeof xhr.response === 'string') {
+      return JSON.parse(xhr.response);
+    } if (xhr.responseText) {
+      return JSON.parse(xhr.responseText);
+    }
+    return null;
+  }
+
+  function loadAsset(path, callback, errorCallback) {
+    var response;
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', path, true);
+    // set responseType after calling open or IE will break.
+    try {
+      // This crashes on Android WebView prior to KitKat
+      xhr.responseType = 'json';
+    } catch (err) {} // eslint-disable-line no-empty
+    xhr.send();
+    xhr.onreadystatechange = function () {
+      if (xhr.readyState === 4) {
+        if (xhr.status === 200) {
+          response = formatResponse(xhr);
+          callback(response);
+        } else {
+          try {
+            response = formatResponse(xhr);
+            callback(response);
+          } catch (err) {
+            if (errorCallback) {
+              errorCallback(err);
+            }
+          }
         }
+      }
+    };
+  }
+  return {
+    load: loadAsset,
+  };
+}());
+
+/* global createSizedArray, PropertyFactory, TextAnimatorDataProperty, bez, addHueToRGB,
+  addSaturationToRGB, addBrightnessToRGB, LetterProps, Matrix, extendPrototype, DynamicPropertyContainer */
+
+function TextAnimatorProperty(textData, renderType, elem) {
+  this._isFirstFrame = true;
+  this._hasMaskedPath = false;
+  this._frameId = -1;
+  this._textData = textData;
+  this._renderType = renderType;
+  this._elem = elem;
+  this._animatorsData = createSizedArray(this._textData.a.length);
+  this._pathData = {};
+  this._moreOptions = {
+    alignment: {},
+  };
+  this.renderedLetters = [];
+  this.lettersChangedFlag = false;
+  this.initDynamicPropertyContainer(elem);
+}
+
+TextAnimatorProperty.prototype.searchProperties = function () {
+  var i;
+  var len = this._textData.a.length;
+  var animatorProps;
+  var getProp = PropertyFactory.getProp;
+  for (i = 0; i < len; i += 1) {
+    animatorProps = this._textData.a[i];
+    this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+  }
+  if (this._textData.p && 'm' in this._textData.p) {
+    this._pathData = {
+      f: getProp(this._elem, this._textData.p.f, 0, 0, this),
+      l: getProp(this._elem, this._textData.p.l, 0, 0, this),
+      r: this._textData.p.r,
+      m: this._elem.maskManager.getMaskProperty(this._textData.p.m),
+    };
+    this._hasMaskedPath = true;
+  } else {
+    this._hasMaskedPath = false;
+  }
+  this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
+};
+
+TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
+  this.lettersChangedFlag = lettersChangedFlag;
+  if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+    return;
+  }
+  this._isFirstFrame = false;
+  var alignment = this._moreOptions.alignment.v;
+  var animators = this._animatorsData;
+  var textData = this._textData;
+  var matrixHelper = this.mHelper;
+  var renderType = this._renderType;
+  var renderedLettersCount = this.renderedLetters.length;
+  var xPos;
+  var yPos;
+  var i;
+  var len;
+  var letters = documentData.l;
+  var pathInfo;
+  var currentLength;
+  var currentPoint;
+  var segmentLength;
+  var flag;
+  var pointInd;
+  var segmentInd;
+  var prevPoint;
+  var points;
+  var segments;
+  var partialLength;
+  var totalLength;
+  var perc;
+  var tanAngle;
+  var mask;
+  if (this._hasMaskedPath) {
+    mask = this._pathData.m;
+    if (!this._pathData.n || this._pathData._mdf) {
+      var paths = mask.v;
+      if (this._pathData.r) {
+        paths = paths.reverse();
+      }
+      // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+      pathInfo = {
+        tLength: 0,
+        segments: [],
+      };
+      len = paths._length - 1;
+      var bezierData;
+      totalLength = 0;
+      for (i = 0; i < len; i += 1) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      i = len;
+      if (mask.v.c) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      this._pathData.pi = pathInfo;
+    }
+    pathInfo = this._pathData.pi;
+
+    currentLength = this._pathData.f.v;
+    segmentInd = 0;
+    pointInd = 1;
+    segmentLength = 0;
+    flag = true;
+    segments = pathInfo.segments;
+    if (currentLength < 0 && mask.v.c) {
+      if (pathInfo.tLength < Math.abs(currentLength)) {
+        currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+      }
+      segmentInd = segments.length - 1;
+      points = segments[segmentInd].points;
+      pointInd = points.length - 1;
+      while (currentLength < 0) {
+        currentLength += points[pointInd].partialLength;
+        pointInd -= 1;
+        if (pointInd < 0) {
+          segmentInd -= 1;
+          points = segments[segmentInd].points;
+          pointInd = points.length - 1;
+        }
+      }
+    }
+    points = segments[segmentInd].points;
+    prevPoint = points[pointInd - 1];
+    currentPoint = points[pointInd];
+    partialLength = currentPoint.partialLength;
+  }
+
+  len = letters.length;
+  xPos = 0;
+  yPos = 0;
+  var yOff = documentData.finalSize * 1.2 * 0.714;
+  var firstLine = true;
+  var animatorProps;
+  var animatorSelector;
+  var j;
+  var jLen;
+  var letterValue;
+
+  jLen = animators.length;
+
+  var mult;
+  var ind = -1;
+  var offf;
+  var xPathPos;
+  var yPathPos;
+  var initPathPos = currentLength;
+  var initSegmentInd = segmentInd;
+  var initPointInd = pointInd;
+  var currentLine = -1;
+  var elemOpacity;
+  var sc;
+  var sw;
+  var fc;
+  var k;
+  var letterSw;
+  var letterSc;
+  var letterFc;
+  var letterM = '';
+  var letterP = this.defaultPropsArray;
+  var letterO;
+
+  //
+  if (documentData.j === 2 || documentData.j === 1) {
+    var animatorJustifyOffset = 0;
+    var animatorFirstCharOffset = 0;
+    var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+    var lastIndex = 0;
+    var isNewLine = true;
+
+    for (i = 0; i < len; i += 1) {
+      if (letters[i].n) {
+        if (animatorJustifyOffset) {
+          animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while (lastIndex < i) {
+          letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+          lastIndex += 1;
+        }
+        animatorJustifyOffset = 0;
+        isNewLine = true;
+      } else {
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.t.propType) {
+            if (isNewLine && documentData.j === 2) {
+              animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+            }
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
+            } else {
+              animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
+            }
+          }
+        }
+        isNewLine = false;
+      }
+    }
+    if (animatorJustifyOffset) {
+      animatorJustifyOffset += animatorFirstCharOffset;
+    }
+    while (lastIndex < i) {
+      letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+      lastIndex += 1;
+    }
+  }
+  //
+
+  for (i = 0; i < len; i += 1) {
+    matrixHelper.reset();
+    elemOpacity = 1;
+    if (letters[i].n) {
+      xPos = 0;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      currentLength = initPathPos;
+      firstLine = false;
+      if (this._hasMaskedPath) {
+        segmentInd = initSegmentInd;
+        pointInd = initPointInd;
         points = segments[segmentInd].points;
         prevPoint = points[pointInd - 1];
         currentPoint = points[pointInd];
         partialLength = currentPoint.partialLength;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.finalSize * 1.2 * 0.714;
-    var firstLine = true;
-    var animatorProps, animatorSelector;
-    var j, jLen;
-    var letterValue;
-
-    jLen = animators.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
-
-    //
-    if(documentData.j === 2 || documentData.j === 1) {
-        var animatorJustifyOffset = 0;
-        var animatorFirstCharOffset = 0;
-        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
-        var lastIndex = 0;
-        var isNewLine = true;
-
-        for (i = 0; i < len; i += 1) {
-            if (letters[i].n) {
-                if(animatorJustifyOffset) {
-                    animatorJustifyOffset += animatorFirstCharOffset;
-                }
-                while (lastIndex < i) {
-                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-                    lastIndex += 1;
-                }
-                animatorJustifyOffset = 0;
-                isNewLine = true;
+        segmentLength = 0;
+      }
+      letterM = '';
+      letterFc = '';
+      letterSw = '';
+      letterO = '';
+      letterP = this.defaultPropsArray;
+    } else {
+      if (this._hasMaskedPath) {
+        if (currentLine !== letters[i].line) {
+          switch (documentData.j) {
+            case 1:
+              currentLength += totalLength - documentData.lineWidths[letters[i].line];
+              break;
+            case 2:
+              currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
+              break;
+            default:
+              break;
+          }
+          currentLine = letters[i].line;
+        }
+        if (ind !== letters[i].ind) {
+          if (letters[ind]) {
+            currentLength += letters[ind].extra;
+          }
+          currentLength += letters[i].an / 2;
+          ind = letters[i].ind;
+        }
+        currentLength += (alignment[0] * letters[i].an) * 0.005;
+        var animatorOffset = 0;
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.p.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.p.v[0] * mult[0];
             } else {
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.t.propType) {
-                        if (isNewLine && documentData.j === 2) {
-                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
-                        }
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
-                        if (mult.length) {
-                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
-                        } else {
-                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
-                        }
-                    }
-                }
-                isNewLine = false;
+              animatorOffset += animatorProps.p.v[0] * mult;
             }
+          }
+          if (animatorProps.a.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.a.v[0] * mult[0];
+            } else {
+              animatorOffset += animatorProps.a.v[0] * mult;
+            }
+          }
         }
-        if(animatorJustifyOffset) {
-            animatorJustifyOffset += animatorFirstCharOffset;
-        }
-        while(lastIndex < i) {
-            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-            lastIndex += 1;
-        }
-    }
-    //
-
-    for( i = 0; i < len; i += 1) {
-
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this._hasMaskedPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
+        flag = true;
+        while (flag) {
+          if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+            matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01);
+            flag = false;
+          } else if (points) {
+            segmentLength += currentPoint.partialLength;
+            pointInd += 1;
+            if (pointInd >= points.length) {
+              pointInd = 0;
+              segmentInd += 1;
+              if (!segments[segmentInd]) {
+                if (mask.v.c) {
+                  pointInd = 0;
+                  segmentInd = 0;
+                  points = segments[segmentInd].points;
+                } else {
+                  segmentLength -= currentPoint.partialLength;
+                  points = null;
+                }
+              } else {
                 points = segments[segmentInd].points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
+              }
             }
-            letterO = letterSw = letterFc = letterM = '';
-            letterP = this.defaultPropsArray;
-        }else{
-            if(this._hasMaskedPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += alignment[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.p.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
+            if (points) {
+              prevPoint = currentPoint;
+              currentPoint = points[pointInd];
+              partialLength = currentPoint.partialLength;
+            }
+          }
+        }
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
+      } else {
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
 
-                    }
-                    if (animatorProps.a.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
+        // Grouping alignment
+        matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0);
+      }
 
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.t.propType) {
+          animatorSelector = animators[j].s;
+          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"
+          if (xPos !== 0 || documentData.j !== 0) {
+            if (this._hasMaskedPath) {
+              if (mult.length) {
+                currentLength += animatorProps.t.v * mult[0];
+              } else {
+                currentLength += animatorProps.t.v * mult;
+              }
+            } else if (mult.length) {
+              xPos += animatorProps.t.v * mult[0];
             } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+              xPos += animatorProps.t.v * mult;
             }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.t.propType) {
-                    animatorSelector = animators[j].s;
-                    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"
-                    if(xPos !== 0 || documentData.j !== 0) {
-                        if(this._hasMaskedPath) {
-                            if(mult.length) {
-                                currentLength += animatorProps.t.v*mult[0];
-                            } else {
-                                currentLength += animatorProps.t.v*mult;
-                            }
-                        }else{
-                            if(mult.length) {
-                                xPos += animatorProps.t.v*mult[0];
-                            } else {
-                                xPos += animatorProps.t.v*mult;
-                            }
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim && documentData.fc) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.a.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.s.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = animators[j].a;
-                animatorSelector = animators[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                if (animatorProps.sk.propType) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if (animatorProps.r.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if (animatorProps.ry.propType) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if (animatorProps.rx.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if (animatorProps.o.propType) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
-                        } else {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim && documentData.fc) {
-                    if(animatorProps.fc.propType){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                            }
-                        }
-                    }
-                    if(animatorProps.fh.propType){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if(animatorProps.fs.propType){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if(animatorProps.fb.propType){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-
-                if (animatorProps.p.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(this._hasMaskedPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim && documentData.fc){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this._hasMaskedPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
-                if (textData.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= alignment[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.finalSize;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                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]];
-            }
-            letterO = elemOpacity;
+          }
         }
-
-        if(renderedLettersCount <= i) {
-            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            this.renderedLetters.push(letterValue);
-            renderedLettersCount += 1;
-            this.lettersChangedFlag = true;
+      }
+      if (documentData.strokeWidthAnim) {
+        sw = documentData.sw || 0;
+      }
+      if (documentData.strokeColorAnim) {
+        if (documentData.sc) {
+          sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
         } else {
-            letterValue = this.renderedLetters[i];
-            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+          sc = [0, 0, 0];
         }
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.a.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+
+          if (mult.length) {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.s.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (mult.length) {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1);
+          } else {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        animatorSelector = animators[j].s;
+        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+        if (animatorProps.sk.propType) {
+          if (mult.length) {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+          } else {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+          }
+        }
+        if (animatorProps.r.propType) {
+          if (mult.length) {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+          } else {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult);
+          }
+        }
+        if (animatorProps.ry.propType) {
+          if (mult.length) {
+            matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
+          } else {
+            matrixHelper.rotateY(animatorProps.ry.v * mult);
+          }
+        }
+        if (animatorProps.rx.propType) {
+          if (mult.length) {
+            matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
+          } else {
+            matrixHelper.rotateX(animatorProps.rx.v * mult);
+          }
+        }
+        if (animatorProps.o.propType) {
+          if (mult.length) {
+            elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0];
+          } else {
+            elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult;
+          }
+        }
+        if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+          if (mult.length) {
+            sw += animatorProps.sw.v * mult[0];
+          } else {
+            sw += animatorProps.sw.v * mult;
+          }
+        }
+        if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+          for (k = 0; k < 3; k += 1) {
+            if (mult.length) {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
+            } else {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
+            }
+          }
+        }
+        if (documentData.fillColorAnim && documentData.fc) {
+          if (animatorProps.fc.propType) {
+            for (k = 0; k < 3; k += 1) {
+              if (mult.length) {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
+              } else {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
+              }
+            }
+          }
+          if (animatorProps.fh.propType) {
+            if (mult.length) {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
+            } else {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult);
+            }
+          }
+          if (animatorProps.fs.propType) {
+            if (mult.length) {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
+            } else {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
+            }
+          }
+          if (animatorProps.fb.propType) {
+            if (mult.length) {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
+            } else {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
+            }
+          }
+        }
+      }
+
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+
+        if (animatorProps.p.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (this._hasMaskedPath) {
+            if (mult.length) {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+            } else {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+            }
+          } else if (mult.length) {
+            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+          }
+        }
+      }
+      if (documentData.strokeWidthAnim) {
+        letterSw = sw < 0 ? 0 : sw;
+      }
+      if (documentData.strokeColorAnim) {
+        letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
+      }
+
+      if (this._hasMaskedPath) {
+        matrixHelper.translate(0, -documentData.ls);
+
+        matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0);
+        if (textData.p.p) {
+          tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+          var rot = (Math.atan(tanAngle) * 180) / Math.PI;
+          if (currentPoint.point[0] < prevPoint.point[0]) {
+            rot += 180;
+          }
+          matrixHelper.rotate((-rot * Math.PI) / 180);
+        }
+        matrixHelper.translate(xPathPos, yPathPos, 0);
+        currentLength -= (alignment[0] * letters[i].an) * 0.005;
+        if (letters[i + 1] && ind !== letters[i + 1].ind) {
+          currentLength += letters[i].an / 2;
+          currentLength += (documentData.tr * 0.001) * documentData.finalSize;
+        }
+      } else {
+        matrixHelper.translate(xPos, yPos, 0);
+
+        if (documentData.ps) {
+          // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+          matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+        }
+        switch (documentData.j) {
+          case 1:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
+            break;
+          case 2:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
+            break;
+          default:
+            break;
+        }
+        matrixHelper.translate(0, -documentData.ls);
+        matrixHelper.translate(offf, 0, 0);
+        matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0);
+        xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize;
+      }
+      if (renderType === 'html') {
+        letterM = matrixHelper.toCSS();
+      } else if (renderType === 'svg') {
+        letterM = matrixHelper.to2dCSS();
+      } else {
+        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]];
+      }
+      letterO = elemOpacity;
     }
+
+    if (renderedLettersCount <= i) {
+      letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
+      this.renderedLetters.push(letterValue);
+      renderedLettersCount += 1;
+      this.lettersChangedFlag = true;
+    } else {
+      letterValue = this.renderedLetters[i];
+      this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+    }
+  }
 };
 
-TextAnimatorProperty.prototype.getValue = function(){
-	if(this._elem.globalData.frameId === this._frameId){
-        return;
-    }
-    this._frameId = this._elem.globalData.frameId;
-    this.iterateDynamicProperties();
+TextAnimatorProperty.prototype.getValue = function () {
+  if (this._elem.globalData.frameId === this._frameId) {
+    return;
+  }
+  this._frameId = this._elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 TextAnimatorProperty.prototype.mHelper = new Matrix();
 TextAnimatorProperty.prototype.defaultPropsArray = [];
 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
+
+/* global PropertyFactory, degToRads, TextSelectorProp */
+/* exported TextAnimatorDataProperty */
+
 function TextAnimatorDataProperty(elem, animatorProps, container) {
-	var defaultData = {propType:false};
-	var getProp = PropertyFactory.getProp;
-	var textAnimator_animatables = animatorProps.a;
-	this.a = {
-		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
-		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
-		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
-		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
-		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
-		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
-		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
-		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
-		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
-		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
-		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
-		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
-		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
-		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
-		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
-		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
-	};
+  var defaultData = { propType: false };
+  var getProp = PropertyFactory.getProp;
+  var textAnimatorAnimatables = animatorProps.a;
+  this.a = {
+    r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
+    rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
+    ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
+    sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
+    sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
+    s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
+    a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
+    o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
+    p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
+    sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
+    sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
+    fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
+    fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
+    fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
+    fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
+    t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData,
+  };
 
-	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
-    this.s.t = animatorProps.s.t;
+  this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
+  this.s.t = animatorProps.s.t;
 }
-function LetterProps(o, sw, sc, fc, m, p){
+
+function LetterProps(o, sw, sc, fc, m, p) {
+  this.o = o;
+  this.sw = sw;
+  this.sc = sc;
+  this.fc = fc;
+  this.m = m;
+  this.p = p;
+  this._mdf = {
+    o: true,
+    sw: !!sw,
+    sc: !!sc,
+    fc: !!fc,
+    m: true,
+    p: true,
+  };
+}
+
+LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
+  this._mdf.o = false;
+  this._mdf.sw = false;
+  this._mdf.sc = false;
+  this._mdf.fc = false;
+  this._mdf.m = false;
+  this._mdf.p = false;
+  var updated = false;
+
+  if (this.o !== o) {
     this.o = o;
+    this._mdf.o = true;
+    updated = true;
+  }
+  if (this.sw !== sw) {
     this.sw = sw;
+    this._mdf.sw = true;
+    updated = true;
+  }
+  if (this.sc !== sc) {
     this.sc = sc;
+    this._mdf.sc = true;
+    updated = true;
+  }
+  if (this.fc !== fc) {
     this.fc = fc;
+    this._mdf.fc = true;
+    updated = true;
+  }
+  if (this.m !== m) {
     this.m = m;
+    this._mdf.m = true;
+    updated = true;
+  }
+  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])) {
     this.p = p;
-    this._mdf = {
-    	o: true,
-    	sw: !!sw,
-    	sc: !!sc,
-    	fc: !!fc,
-    	m: true,
-    	p: true
-    };
-}
-
-LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
-	this._mdf.o = false;
-	this._mdf.sw = false;
-	this._mdf.sc = false;
-	this._mdf.fc = false;
-	this._mdf.m = false;
-	this._mdf.p = false;
-	var updated = false;
-
-	if(this.o !== o) {
-		this.o = o;
-		this._mdf.o = true;
-		updated = true;
-	}
-	if(this.sw !== sw) {
-		this.sw = sw;
-		this._mdf.sw = true;
-		updated = true;
-	}
-	if(this.sc !== sc) {
-		this.sc = sc;
-		this._mdf.sc = true;
-		updated = true;
-	}
-	if(this.fc !== fc) {
-		this.fc = fc;
-		this._mdf.fc = true;
-		updated = true;
-	}
-	if(this.m !== m) {
-		this.m = m;
-		this._mdf.m = true;
-		updated = true;
-	}
-	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])) {
-		this.p = p;
-		this._mdf.p = true;
-		updated = true;
-	}
-	return updated;
-};
-function TextProperty(elem, data){
-	this._frameId = initialDefaultFrame;
-	this.pv = '';
-	this.v = '';
-	this.kf = false;
-	this._isFirstFrame = true;
-	this._mdf = false;
-    this.data = data;
-	this.elem = elem;
-    this.comp = this.elem.comp;
-	this.keysIndex = 0;
-    this.canResize = false;
-    this.minimumFontSize = 1;
-    this.effectsSequence = [];
-	this.currentData = {
-		ascent: 0,
-        boxWidth: this.defaultBoxWidth,
-        f: '',
-        fStyle: '',
-        fWeight: '',
-        fc: '',
-        j: '',
-        justifyOffset: '',
-        l: [],
-        lh: 0,
-        lineWidths: [],
-        ls: '',
-        of: '',
-        s: '',
-        sc: '',
-        sw: 0,
-        t: 0,
-        tr: 0,
-        sz:0,
-        ps:null,
-        fillColorAnim: false,
-        strokeColorAnim: false,
-        strokeWidthAnim: false,
-        yOffset: 0,
-        finalSize:0,
-        finalText:[],
-        finalLineHeight: 0,
-        __complete: false
-
-	};
-    this.copyData(this.currentData, this.data.d.k[0].s);
-
-    if(!this.searchProperty()) {
-        this.completeTextData(this.currentData);
-    }
-}
-
-TextProperty.prototype.defaultBoxWidth = [0,0];
-
-TextProperty.prototype.copyData = function(obj, data) {
-    for(var s in data) {
-        if(data.hasOwnProperty(s)) {
-            obj[s] = data[s];
-        }
-    }
-    return obj;
-}
-
-TextProperty.prototype.setCurrentData = function(data){
-    if(!data.__complete) {
-        this.completeTextData(data);
-    }
-    this.currentData = data;
-    this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
-    this._mdf = true;
+    this._mdf.p = true;
+    updated = true;
+  }
+  return updated;
 };
 
-TextProperty.prototype.searchProperty = function() {
-    return this.searchKeyframes();
-};
+/* global FontManager, initialDefaultFrame, getFontProperties */
+/* exported TextProperty */
 
-TextProperty.prototype.searchKeyframes = function() {
-    this.kf = this.data.d.k.length > 1;
-    if(this.kf) {
-        this.addEffect(this.getKeyframeValue.bind(this));
-    }
-    return this.kf;
+function TextProperty(elem, data) {
+  this._frameId = initialDefaultFrame;
+  this.pv = '';
+  this.v = '';
+  this.kf = false;
+  this._isFirstFrame = true;
+  this._mdf = false;
+  this.data = data;
+  this.elem = elem;
+  this.comp = this.elem.comp;
+  this.keysIndex = 0;
+  this.canResize = false;
+  this.minimumFontSize = 1;
+  this.effectsSequence = [];
+  this.currentData = {
+    ascent: 0,
+    boxWidth: this.defaultBoxWidth,
+    f: '',
+    fStyle: '',
+    fWeight: '',
+    fc: '',
+    j: '',
+    justifyOffset: '',
+    l: [],
+    lh: 0,
+    lineWidths: [],
+    ls: '',
+    of: '',
+    s: '',
+    sc: '',
+    sw: 0,
+    t: 0,
+    tr: 0,
+    sz: 0,
+    ps: null,
+    fillColorAnim: false,
+    strokeColorAnim: false,
+    strokeWidthAnim: false,
+    yOffset: 0,
+    finalSize: 0,
+    finalText: [],
+    finalLineHeight: 0,
+    __complete: false,
+
+  };
+  this.copyData(this.currentData, this.data.d.k[0].s);
+
+  if (!this.searchProperty()) {
+    this.completeTextData(this.currentData);
+  }
 }
 
-TextProperty.prototype.addEffect = function(effectFunction) {
-	this.effectsSequence.push(effectFunction);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.defaultBoxWidth = [0, 0];
+
+TextProperty.prototype.copyData = function (obj, data) {
+  for (var s in data) {
+    if (Object.prototype.hasOwnProperty.call(data, s)) {
+      obj[s] = data[s];
+    }
+  }
+  return obj;
 };
 
-TextProperty.prototype.getValue = function(_finalValue) {
-    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
-        return;
-    }
-    this.currentData.t = this.data.d.k[this.keysIndex].s.t;
-    var currentValue = this.currentData;
-    var currentIndex = this.keysIndex;
-    if(this.lock) {
-        this.setCurrentData(this.currentData);
-        return;
-    }
-    this.lock = true;
-    this._mdf = false;
-    var multipliedValue;
-    var i, len = this.effectsSequence.length;
-    var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
-    for(i = 0; i < len; i += 1) {
-        //Checking if index changed to prevent creating a new object every time the expression updates.
-        if(currentIndex !== this.keysIndex) {
-            finalValue = this.effectsSequence[i](finalValue, finalValue.t);
-        } else {
-            finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
-        }
-    }
-    if(currentValue !== finalValue) {
-        this.setCurrentData(finalValue);
-    }
-    this.pv = this.v = this.currentData;
-    this.lock = false;
-    this.frameId = this.elem.globalData.frameId;
-}
+TextProperty.prototype.setCurrentData = function (data) {
+  if (!data.__complete) {
+    this.completeTextData(data);
+  }
+  this.currentData = data;
+  this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+  this._mdf = true;
+};
 
-TextProperty.prototype.getKeyframeValue = function() {
-    var textKeys = this.data.d.k, textDocumentData;
-    var frameNum = this.elem.comp.renderedFrame;
-    var i = 0, len = textKeys.length;
-    while(i <= len - 1) {
-        textDocumentData = textKeys[i].s;
-        if(i === len - 1 || textKeys[i+1].t > frameNum){
-            break;
-        }
+TextProperty.prototype.searchProperty = function () {
+  return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function () {
+  this.kf = this.data.d.k.length > 1;
+  if (this.kf) {
+    this.addEffect(this.getKeyframeValue.bind(this));
+  }
+  return this.kf;
+};
+
+TextProperty.prototype.addEffect = function (effectFunction) {
+  this.effectsSequence.push(effectFunction);
+  this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function (_finalValue) {
+  if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+    return;
+  }
+  this.currentData.t = this.data.d.k[this.keysIndex].s.t;
+  var currentValue = this.currentData;
+  var currentIndex = this.keysIndex;
+  if (this.lock) {
+    this.setCurrentData(this.currentData);
+    return;
+  }
+  this.lock = true;
+  this._mdf = false;
+  var i; var
+    len = this.effectsSequence.length;
+  var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
+  for (i = 0; i < len; i += 1) {
+    // Checking if index changed to prevent creating a new object every time the expression updates.
+    if (currentIndex !== this.keysIndex) {
+      finalValue = this.effectsSequence[i](finalValue, finalValue.t);
+    } else {
+      finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
+    }
+  }
+  if (currentValue !== finalValue) {
+    this.setCurrentData(finalValue);
+  }
+  this.v = this.currentData;
+  this.pv = this.v;
+  this.lock = false;
+  this.frameId = this.elem.globalData.frameId;
+};
+
+TextProperty.prototype.getKeyframeValue = function () {
+  var textKeys = this.data.d.k;
+  var frameNum = this.elem.comp.renderedFrame;
+  var i = 0; var
+    len = textKeys.length;
+  while (i <= len - 1) {
+    if (i === len - 1 || textKeys[i + 1].t > frameNum) {
+      break;
+    }
+    i += 1;
+  }
+  if (this.keysIndex !== i) {
+    this.keysIndex = i;
+  }
+  return this.data.d.k[this.keysIndex].s;
+};
+
+TextProperty.prototype.buildFinalText = function (text) {
+  var combinedCharacters = FontManager.getCombinedCharacterCodes();
+  var charactersArray = [];
+  var i = 0; var
+    len = text.length;
+  var charCode;
+  while (i < len) {
+    charCode = text.charCodeAt(i);
+    if (combinedCharacters.indexOf(charCode) !== -1) {
+      charactersArray[charactersArray.length - 1] += text.charAt(i);
+    } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      charCode = text.charCodeAt(i + 1);
+      if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
+        charactersArray.push(text.substr(i, 2));
         i += 1;
+      } else {
+        charactersArray.push(text.charAt(i));
+      }
+    } else {
+      charactersArray.push(text.charAt(i));
     }
-    if(this.keysIndex !== i) {
-        this.keysIndex = i;
-    }
-    return this.data.d.k[this.keysIndex].s;
+    i += 1;
+  }
+  return charactersArray;
 };
 
-TextProperty.prototype.buildFinalText = function(text) {
-    var combinedCharacters = FontManager.getCombinedCharacterCodes();
-    var charactersArray = [];
-    var i = 0, len = text.length;
-    var charCode;
-    while (i < len) {
-        charCode = text.charCodeAt(i);
-        if (combinedCharacters.indexOf(charCode) !== -1) {
-            charactersArray[charactersArray.length - 1] += text.charAt(i);
-        } else {
-            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
-                charCode = text.charCodeAt(i + 1);
-                if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
-                    charactersArray.push(text.substr(i, 2));
-                    ++i;
-                } else {
-                    charactersArray.push(text.charAt(i));
-                }
-            } else {
-                charactersArray.push(text.charAt(i));
-            }
-        }
-        i += 1;
-    }
-    return charactersArray;
-}
-
-TextProperty.prototype.completeTextData = function(documentData) {
-    documentData.__complete = true;
-    var fontManager = this.elem.globalData.fontManager;
-    var data = this.data;
-    var letters = [];
-    var i, len;
-    var newLineFlag, index = 0, val;
-    var anchorGrouping = data.m.g;
-    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-    var lineWidth = 0;
-    var maxLineWidth = 0;
-    var j, jLen;
-    var fontData = fontManager.getFontByName(documentData.f);
-    var charData, cLength = 0;
-    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
-
-    var fWeight = 'normal', fStyle = 'normal';
-    len = styles.length;
-    var styleName;
-    for(i=0;i<len;i+=1){
-        styleName = styles[i].toLowerCase();
-        switch(styleName) {
-            case 'italic':
-            fStyle = 'italic';
-            break;
-            case 'bold':
-            fWeight = '700';
-            break;
-            case 'black':
-            fWeight = '900';
-            break;
-            case 'medium':
-            fWeight = '500';
-            break;
-            case 'regular':
-            case 'normal':
-            fWeight = '400';
-            break;
-            case 'light':
-            case 'thin':
-            fWeight = '200';
-            break;
-        }
-    }
-    documentData.fWeight = fontData.fWeight || fWeight;
-    documentData.fStyle = fStyle;
-    documentData.finalSize = documentData.s;
-    documentData.finalText = this.buildFinalText(documentData.t);
-    len = documentData.finalText.length;
-    documentData.finalLineHeight = documentData.lh;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var charCode;
-    if(documentData.sz){
-        var flag = true;
-        var boxWidth = documentData.sz[0];
-        var boxHeight = documentData.sz[1];
-        var currentHeight, finalText;
-        while(flag) {
-            finalText = this.buildFinalText(documentData.t);
-            currentHeight = 0;
-            lineWidth = 0;
-            len = finalText.length;
-            trackingOffset = documentData.tr/1000*documentData.finalSize;
-            var lastSpaceIndex = -1;
-            for(i=0;i<len;i+=1){
-                charCode = finalText[i].charCodeAt(0);
-                newLineFlag = false;
-                if(finalText[i] === ' '){
-                    lastSpaceIndex = i;
-                }else if(charCode === 13 || charCode === 3){
-                    lineWidth = 0;
-                    newLineFlag = true;
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-                }else{
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
-                }
-                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
-                    if(lastSpaceIndex === -1){
-                        len += 1;
-                    } else {
-                        i = lastSpaceIndex;
-                    }
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
-                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
-                    lastSpaceIndex = -1;
-                    lineWidth = 0;
-                }else {
-                    lineWidth += cLength;
-                    lineWidth += trackingOffset;
-                }
-            }
-            currentHeight += fontData.ascent*documentData.finalSize/100;
-            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
-                documentData.finalSize -= 1;
-                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
-            } else {
-                documentData.finalText = finalText;
-                len = documentData.finalText.length;
-                flag = false;
-            }
-        }
-
-    }
-    lineWidth = - trackingOffset;
+TextProperty.prototype.completeTextData = function (documentData) {
+  documentData.__complete = true;
+  var fontManager = this.elem.globalData.fontManager;
+  var data = this.data;
+  var letters = [];
+  var i; var
+    len;
+  var newLineFlag; var index = 0; var
+    val;
+  var anchorGrouping = data.m.g;
+  var currentSize = 0; var currentPos = 0; var currentLine = 0; var
+    lineWidths = [];
+  var lineWidth = 0;
+  var maxLineWidth = 0;
+  var j; var
+    jLen;
+  var fontData = fontManager.getFontByName(documentData.f);
+  var charData; var
     cLength = 0;
-    var uncollapsedSpaces = 0;
-    var currentChar;
-    for (i = 0;i < len ;i += 1) {
+
+  var fontProps = getFontProperties(fontData);
+  documentData.fWeight = fontProps.weight;
+  documentData.fStyle = fontProps.style;
+  documentData.finalSize = documentData.s;
+  documentData.finalText = this.buildFinalText(documentData.t);
+  len = documentData.finalText.length;
+  documentData.finalLineHeight = documentData.lh;
+  var trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+  var charCode;
+  if (documentData.sz) {
+    var flag = true;
+    var boxWidth = documentData.sz[0];
+    var boxHeight = documentData.sz[1];
+    var currentHeight; var
+      finalText;
+    while (flag) {
+      finalText = this.buildFinalText(documentData.t);
+      currentHeight = 0;
+      lineWidth = 0;
+      len = finalText.length;
+      trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+      var lastSpaceIndex = -1;
+      for (i = 0; i < len; i += 1) {
+        charCode = finalText[i].charCodeAt(0);
         newLineFlag = false;
-        currentChar = documentData.finalText[i];
-        charCode = currentChar.charCodeAt(0);
-        if (charCode === 13 || charCode === 3) {
-            uncollapsedSpaces = 0;
-            lineWidths.push(lineWidth);
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidth = - 2 * trackingOffset;
-            val = '';
-            newLineFlag = true;
-            currentLine += 1;
-        }else{
-            val = currentChar;
+        if (finalText[i] === ' ') {
+          lastSpaceIndex = i;
+        } else if (charCode === 13 || charCode === 3) {
+          lineWidth = 0;
+          newLineFlag = true;
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
         }
-        if(fontManager.chars){
-            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-        }else{
-            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
-            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
-        }
-
-        //
-        if(currentChar === ' '){
-            uncollapsedSpaces += cLength + trackingOffset;
+        if (fontManager.chars) {
+          charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+          cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
         } else {
-            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
-            uncollapsedSpaces = 0;
+          // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+          cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
         }
-        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
-        if(anchorGrouping == 2){
-            currentSize += cLength;
-            if(val === '' || val === ' ' || i === len - 1){
-                if(val === '' || val === ' '){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                index += 1;
-                currentSize = 0;
-            }
-        }else if(anchorGrouping == 3){
-            currentSize += cLength;
-            if(val === '' || i === len - 1){
-                if(val === ''){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                currentSize = 0;
-                index += 1;
-            }
-        }else{
-            letters[index].ind = index;
-            letters[index].extra = 0;
-            index += 1;
+        if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
+          if (lastSpaceIndex === -1) {
+            len += 1;
+          } else {
+            i = lastSpaceIndex;
+          }
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
+          finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r');
+          // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+          lastSpaceIndex = -1;
+          lineWidth = 0;
+        } else {
+          lineWidth += cLength;
+          lineWidth += trackingOffset;
         }
+      }
+      currentHeight += (fontData.ascent * documentData.finalSize) / 100;
+      if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+        documentData.finalSize -= 1;
+        documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s;
+      } else {
+        documentData.finalText = finalText;
+        len = documentData.finalText.length;
+        flag = false;
+      }
     }
-    documentData.l = letters;
-    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-    lineWidths.push(lineWidth);
-    if(documentData.sz){
-        documentData.boxWidth = documentData.sz[0];
+  }
+  lineWidth = -trackingOffset;
+  cLength = 0;
+  var uncollapsedSpaces = 0;
+  var currentChar;
+  for (i = 0; i < len; i += 1) {
+    newLineFlag = false;
+    currentChar = documentData.finalText[i];
+    charCode = currentChar.charCodeAt(0);
+    if (charCode === 13 || charCode === 3) {
+      uncollapsedSpaces = 0;
+      lineWidths.push(lineWidth);
+      maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+      lineWidth = -2 * trackingOffset;
+      val = '';
+      newLineFlag = true;
+      currentLine += 1;
+    } else {
+      val = currentChar;
+    }
+    if (fontManager.chars) {
+      charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+      cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
+    } else {
+      // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+      // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+      cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+    }
+
+    //
+    if (currentChar === ' ') {
+      uncollapsedSpaces += cLength + trackingOffset;
+    } else {
+      lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+      uncollapsedSpaces = 0;
+    }
+    letters.push({
+      l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0,
+    });
+    if (anchorGrouping == 2) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || val === ' ' || i === len - 1) {
+        if (val === '' || val === ' ') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        index += 1;
+        currentSize = 0;
+      }
+    } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || i === len - 1) {
+        if (val === '') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        currentSize = 0;
+        index += 1;
+      }
+    } else {
+      letters[index].ind = index;
+      letters[index].extra = 0;
+      index += 1;
+    }
+  }
+  documentData.l = letters;
+  maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+  lineWidths.push(lineWidth);
+  if (documentData.sz) {
+    documentData.boxWidth = documentData.sz[0];
+    documentData.justifyOffset = 0;
+  } else {
+    documentData.boxWidth = maxLineWidth;
+    switch (documentData.j) {
+      case 1:
+        documentData.justifyOffset = -documentData.boxWidth;
+        break;
+      case 2:
+        documentData.justifyOffset = -documentData.boxWidth / 2;
+        break;
+      default:
         documentData.justifyOffset = 0;
-    }else{
-        documentData.boxWidth = maxLineWidth;
-        switch(documentData.j){
-            case 1:
-                documentData.justifyOffset = - documentData.boxWidth;
-                break;
-            case 2:
-                documentData.justifyOffset = - documentData.boxWidth/2;
-                break;
-            default:
-                documentData.justifyOffset = 0;
-        }
     }
-    documentData.lineWidths = lineWidths;
+  }
+  documentData.lineWidths = lineWidths;
 
-    var animators = data.a, animatorData, letterData;
-    jLen = animators.length;
-    var based, ind, indexes = [];
-    for(j=0;j<jLen;j+=1){
-        animatorData = animators[j];
-        if(animatorData.a.sc){
-            documentData.strokeColorAnim = true;
-        }
-        if(animatorData.a.sw){
-            documentData.strokeWidthAnim = true;
-        }
-        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
-            documentData.fillColorAnim = true;
-        }
-        ind = 0;
-        based = animatorData.s.b;
-        for(i=0;i<len;i+=1){
-            letterData = letters[i];
-            letterData.anIndexes[j] = ind;
-            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))){
-                if(animatorData.s.rn === 1){
-                    indexes.push(ind);
-                }
-                ind += 1;
-            }
-        }
-        data.a[j].s.totalChars = ind;
-        var currentInd = -1, newInd;
-        if(animatorData.s.rn === 1){
-            for(i = 0; i < len; i += 1){
-                letterData = letters[i];
-                if(currentInd != letterData.anIndexes[j]){
-                    currentInd = letterData.anIndexes[j];
-                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                }
-                letterData.anIndexes[j] = newInd;
-            }
-        }
+  var animators = data.a; var animatorData; var
+    letterData;
+  jLen = animators.length;
+  var based; var ind; var
+    indexes = [];
+  for (j = 0; j < jLen; j += 1) {
+    animatorData = animators[j];
+    if (animatorData.a.sc) {
+      documentData.strokeColorAnim = true;
     }
-    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
-    documentData.ls = documentData.ls || 0;
-    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+    if (animatorData.a.sw) {
+      documentData.strokeWidthAnim = true;
+    }
+    if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
+      documentData.fillColorAnim = true;
+    }
+    ind = 0;
+    based = animatorData.s.b;
+    for (i = 0; i < len; i += 1) {
+      letterData = letters[i];
+      letterData.anIndexes[j] = ind;
+      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))) { // eslint-disable-line eqeqeq
+        if (animatorData.s.rn === 1) {
+          indexes.push(ind);
+        }
+        ind += 1;
+      }
+    }
+    data.a[j].s.totalChars = ind;
+    var currentInd = -1; var
+      newInd;
+    if (animatorData.s.rn === 1) {
+      for (i = 0; i < len; i += 1) {
+        letterData = letters[i];
+        if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq
+          currentInd = letterData.anIndexes[j];
+          newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
+        }
+        letterData.anIndexes[j] = newInd;
+      }
+    }
+  }
+  documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
+  documentData.ls = documentData.ls || 0;
+  documentData.ascent = (fontData.ascent * documentData.finalSize) / 100;
 };
 
-TextProperty.prototype.updateDocumentData = function(newData, index) {
-	index = index === undefined ? this.keysIndex : index;
-    var dData = this.copyData({}, this.data.d.k[index].s);
-    dData = this.copyData(dData, newData);
-    this.data.d.k[index].s = dData;
-    this.recalculate(index);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.updateDocumentData = function (newData, index) {
+  index = index === undefined ? this.keysIndex : index;
+  var dData = this.copyData({}, this.data.d.k[index].s);
+  dData = this.copyData(dData, newData);
+  this.data.d.k[index].s = dData;
+  this.recalculate(index);
+  this.elem.addDynamicProperty(this);
 };
 
-TextProperty.prototype.recalculate = function(index) {
-    var dData = this.data.d.k[index].s;
-    dData.__complete = false;
-    this.keysIndex = 0;
-    this._isFirstFrame = true;
-    this.getValue(dData);
-}
-
-TextProperty.prototype.canResizeFont = function(_canResize) {
-    this.canResize = _canResize;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.recalculate = function (index) {
+  var dData = this.data.d.k[index].s;
+  dData.__complete = false;
+  this.keysIndex = 0;
+  this._isFirstFrame = true;
+  this.getValue(dData);
 };
 
-TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
-    this.minimumFontSize = Math.floor(_fontValue) || 1;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.canResizeFont = function (_canResize) {
+  this.canResize = _canResize;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
 };
 
-var TextSelectorProp = (function(){
-    var max = Math.max;
-    var min = Math.min;
-    var floor = Math.floor;
+TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
+  this.minimumFontSize = Math.floor(_fontValue) || 1;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
+};
 
-    function TextSelectorProp(elem,data){
-        this._currentTextLength = -1;
-        this.k = false;
-        this.data = data;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.finalS = 0;
-        this.finalE = 0;
-        this.initDynamicPropertyContainer(elem);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
-        if('e' in data){
-            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
-        }else{
-            this.e = {v:100};
+/* global extendPrototype, BezierFactory, PropertyFactory, DynamicPropertyContainer */
+/* exported TextSelectorProp */
+
+var TextSelectorProp = (function () {
+  var max = Math.max;
+  var min = Math.min;
+  var floor = Math.floor;
+
+  function TextSelectorPropFactory(elem, data) {
+    this._currentTextLength = -1;
+    this.k = false;
+    this.data = data;
+    this.elem = elem;
+    this.comp = elem.comp;
+    this.finalS = 0;
+    this.finalE = 0;
+    this.initDynamicPropertyContainer(elem);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this);
+    if ('e' in data) {
+      this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
+    } else {
+      this.e = { v: 100 };
+    }
+    this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this);
+    this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this);
+    this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this);
+    this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
+    if (!this.dynamicProperties.length) {
+      this.getValue();
+    }
+  }
+
+  TextSelectorPropFactory.prototype = {
+    getMult: function (ind) {
+      if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+        this.getValue();
+      }
+      // var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+      var x1 = 0;
+      var y1 = 0;
+      var x2 = 1;
+      var y2 = 1;
+      if (this.ne.v > 0) {
+        x1 = this.ne.v / 100.0;
+      } else {
+        y1 = -this.ne.v / 100.0;
+      }
+      if (this.xe.v > 0) {
+        x2 = 1.0 - this.xe.v / 100.0;
+      } else {
+        y2 = 1.0 + this.xe.v / 100.0;
+      }
+      var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
+
+      var mult = 0;
+      var s = this.finalS;
+      var e = this.finalE;
+      var type = this.data.sh;
+      if (type === 2) {
+        if (e === s) {
+          mult = ind >= e ? 1 : 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
-        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
-        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
-        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
-        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
-        if(!this.dynamicProperties.length){
-            this.getValue();
+        mult = easer(mult);
+      } else if (type === 3) {
+        if (e === s) {
+          mult = ind >= e ? 0 : 1;
+        } else {
+          mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
+
+        mult = easer(mult);
+      } else if (type === 4) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
+          if (mult < 0.5) {
+            mult *= 2;
+          } else {
+            mult = 1 - 2 * (mult - 0.5);
+          }
+        }
+        mult = easer(mult);
+      } else if (type === 5) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          var tot = e - s;
+          /* ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          var x = -tot / 2 + ind;
+          var a = tot / 2;
+          mult = Math.sqrt(1 - (x * x) / (a * a));
+        }
+        mult = easer(mult);
+      } else if (type === 6) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line
+        }
+        mult = easer(mult);
+      } else {
+        if (ind >= floor(s)) {
+          if (ind - s < 0) {
+            mult = max(0, min(min(e, 1) - (s - ind), 1));
+          } else {
+            mult = max(0, min(e - ind, 1));
+          }
+        }
+        mult = easer(mult);
+      }
+      return mult * this.a.v;
+    },
+    getValue: function (newCharsFlag) {
+      this.iterateDynamicProperties();
+      this._mdf = newCharsFlag || this._mdf;
+      this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+      if (newCharsFlag && this.data.r === 2) {
+        this.e.v = this._currentTextLength;
+      }
+      var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
+      var o = this.o.v / divisor;
+      var s = this.s.v / divisor + o;
+      var e = (this.e.v / divisor) + o;
+      if (s > e) {
+        var _s = s;
+        s = e;
+        e = _s;
+      }
+      this.finalS = s;
+      this.finalE = e;
+    },
+  };
+  extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
+
+  function getTextSelectorProp(elem, data, arr) {
+    return new TextSelectorPropFactory(elem, data, arr);
+  }
+
+  return {
+    getTextSelectorProp: getTextSelectorProp,
+  };
+}());
+
+/* global createSizedArray, pooling */
+/* exported poolFactory */
+
+var poolFactory = (function () {
+  return function (initialLength, _create, _release) {
+    var _length = 0;
+    var _maxLength = initialLength;
+    var pool = createSizedArray(_maxLength);
+
+    var ob = {
+      newElement: newElement,
+      release: release,
+    };
+
+    function newElement() {
+      var element;
+      if (_length) {
+        _length -= 1;
+        element = pool[_length];
+      } else {
+        element = _create();
+      }
+      return element;
     }
 
-    TextSelectorProp.prototype = {
-        getMult: function(ind) {
-            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
-                this.getValue();
-            }
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var x1 = 0;
-            var y1 = 0;
-            var x2 = 1;
-            var y2 = 1;
-            if(this.ne.v > 0) {
-                x1 = this.ne.v / 100.0;
-            }
-            else {
-                y1 = -this.ne.v / 100.0;
-            }
-            if(this.xe.v > 0) {
-                x2 = 1.0 - this.xe.v / 100.0;
-            }
-            else {
-                y2 = 1.0 + this.xe.v / 100.0;
-            }
-            var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
-
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if (type === 2){
-                if (e === s) {
-                    mult = ind >= e ? 1 : 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                }
-                mult = easer(mult);
-            } else if(type === 3) {
-                if (e === s) {
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
-                }
-
-                mult = easer(mult);
-            } else if (type === 4) {
-                if (e === s) {
-                    mult = 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                    if (mult < 0.5) {
-                        mult *= 2;
-                    } else {
-                        mult = 1 - 2 * (mult - 0.5);
-                    }
-                }
-                mult = easer(mult);
-            } else if (type === 5) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x * x) / (a * a));
-                }
-                mult = easer(mult);
-            } else if (type === 6) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
-                }
-                mult = easer(mult);
-            } else {
-                if (ind >= floor(s)) {
-                    if (ind - s < 0) {
-                        mult = max(0, min(min(e, 1) - (s - ind), 1));
-                    } else {
-                        mult = max(0, min(e - ind, 1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        },
-        getValue: function(newCharsFlag) {
-            this.iterateDynamicProperties();
-            this._mdf = newCharsFlag || this._mdf;
-            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
-            if(newCharsFlag && this.data.r === 2) {
-                this.e.v = this._currentTextLength;
-            }
-            var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-    }
-    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
+    function release(element) {
+      if (_length === _maxLength) {
+        pool = pooling.double(pool);
+        _maxLength *= 2;
+      }
+      if (_release) {
+        _release(element);
+      }
+      pool[_length] = element;
+      _length += 1;
     }
 
+    return ob;
+  };
+}());
+
+/* global createSizedArray */
+/* exported pooling */
+
+var pooling = (function () {
+  function double(arr) {
+    return arr.concat(createSizedArray(arr.length));
+  }
+
+  return {
+    double: double,
+  };
+}());
+
+/* global createTypedArray, poolFactory */
+/* exported pointPool */
+
+var pointPool = (function () {
+  function create() {
+    return createTypedArray('float32', 2);
+  }
+  return poolFactory(8, create);
+}());
+
+/* global ShapePath, pointPool, poolFactory */
+/* exported shapePool */
+
+var shapePool = (function () {
+  function create() {
+    return new ShapePath();
+  }
+
+  function release(shapePath) {
+    var len = shapePath._length;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      pointPool.release(shapePath.v[i]);
+      pointPool.release(shapePath.i[i]);
+      pointPool.release(shapePath.o[i]);
+      shapePath.v[i] = null;
+      shapePath.i[i] = null;
+      shapePath.o[i] = null;
+    }
+    shapePath._length = 0;
+    shapePath.c = false;
+  }
+
+  function clone(shape) {
+    var cloned = factory.newElement();
+    var i;
+    var len = shape._length === undefined ? shape.v.length : shape._length;
+    cloned.setLength(len);
+    cloned.c = shape.c;
+
+    for (i = 0; i < len; i += 1) {
+      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);
+    }
+    return cloned;
+  }
+
+  var factory = poolFactory(4, create, release);
+  factory.clone = clone;
+
+  return factory;
+}());
+
+/* global createSizedArray, ShapeCollection, shapePool, pooling */
+/* exported shapeCollectionPool */
+
+var shapeCollectionPool = (function () {
+  var ob = {
+    newShapeCollection: newShapeCollection,
+    release: release,
+  };
+
+  var _length = 0;
+  var _maxLength = 4;
+  var pool = createSizedArray(_maxLength);
+
+  function newShapeCollection() {
+    var shapeCollection;
+    if (_length) {
+      _length -= 1;
+      shapeCollection = pool[_length];
+    } else {
+      shapeCollection = new ShapeCollection();
+    }
+    return shapeCollection;
+  }
+
+  function release(shapeCollection) {
+    var i;
+    var len = shapeCollection._length;
+    for (i = 0; i < len; i += 1) {
+      shapePool.release(shapeCollection.shapes[i]);
+    }
+    shapeCollection._length = 0;
+
+    if (_length === _maxLength) {
+      pool = pooling.double(pool);
+      _maxLength *= 2;
+    }
+    pool[_length] = shapeCollection;
+    _length += 1;
+  }
+
+  return ob;
+}());
+
+/* global poolFactory, bezierLengthPool */
+/* exported segmentsLengthPool */
+
+var segmentsLengthPool = (function () {
+  function create() {
     return {
-        getTextSelectorProp: getTextSelectorProp
+      lengths: [],
+      totalLength: 0,
     };
-}());
+  }
 
-    
-var pool_factory = (function() {
-	return function(initialLength, _create, _release, _clone) {
-
-		var _length = 0;
-		var _maxLength = initialLength;
-		var pool = createSizedArray(_maxLength);
-
-		var ob = {
-			newElement: newElement,
-			release: release
-		};
-
-		function newElement(){
-			var element;
-			if(_length){
-				_length -= 1;
-				element = pool[_length];
-			} else {
-				element = _create();
-			}
-			return element;
-		}
-
-		function release(element) {
-			if(_length === _maxLength) {
-				pool = pooling.double(pool);
-				_maxLength = _maxLength*2;
-			}
-			if (_release) {
-				_release(element);
-			}
-			pool[_length] = element;
-			_length += 1;
-		}
-
-		function clone() {
-			var clonedElement = newElement();
-			return _clone(clonedElement);
-		}
-
-		return ob;
-	};
-}());
-
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(createSizedArray(arr.length));
-	}
-
-	return {
-		double: double
-	};
-}());
-var point_pool = (function(){
-
-	function create() {
-		return createTypedArray('float32', 2);
-	}
-	return pool_factory(8, create);
-}());
-var shape_pool = (function(){
-
-	function create() {
-		return new ShapePath();
-	}
-
-	function release(shapePath) {
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-	}
-
-	function clone(shape) {
-		var cloned = factory.newElement();
-		var i, len = shape._length === undefined ? shape.v.length : shape._length;
-		cloned.setLength(len);
-		cloned.c = shape.c;
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			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);
-		}
-		return cloned;
-	}
-
-	var factory = pool_factory(4, create, release);
-	factory.clone = clone;
-
-	return factory;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release
-	};
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = createSizedArray(_maxLength);
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	return ob;
-}());
-var segments_length_pool = (function(){
-
-	function create() {
-		return {
-			lengths: [],
-			totalLength: 0
-		};
-	}
-
-	function release(element) {
-		var i, len = element.lengths.length;
-		for(i=0;i<len;i+=1) {
-			bezier_length_pool.release(element.lengths[i]);
-		}
-		element.lengths.length = 0;
-	}
-
-	return pool_factory(8, create, release);
-}());
-var bezier_length_pool = (function(){
-
-	function create() {
-		return {
-            addedLength: 0,
-            percents: createTypedArray('float32', defaultCurveSegments),
-            lengths: createTypedArray('float32', defaultCurveSegments),
-        };
-	}
-	return pool_factory(8, create);
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
+  function release(element) {
+    var i;
+    var len = element.lengths.length;
+    for (i = 0; i < len; i += 1) {
+      bezierLengthPool.release(element.lengths[i]);
     }
-    this.checkPendingElements();
-};
+    element.lengths.length = 0;
+  }
 
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 3:
-            return this.createNull(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 6:
-            return this.createAudio(layer);
-        case 13:
-            return this.createCamera(layer);
-    }
-    return this.createNull(layer);
-};
+  return poolFactory(8, create, release);
+}());
 
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-};
+/* global createTypedArray, defaultCurveSegments, poolFactory */
+/* exported bezierLengthPool */
 
-BaseRenderer.prototype.createAudio = function(data){
-    return new AudioElement(data, this.globalData, this);
-};
+var bezierLengthPool = (function () {
+  function create() {
+    return {
+      addedLength: 0,
+      percents: createTypedArray('float32', defaultCurveSegments),
+      lengths: createTypedArray('float32', defaultCurveSegments),
+    };
+  }
+  return poolFactory(8, create);
+}());
 
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
+/* global AudioElement, FontManager */
+
+function BaseRenderer() {}
+BaseRenderer.prototype.checkLayers = function (num) {
+  var i;
+  var len = this.layers.length;
+  var data;
+  this.completeLayers = true;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (!this.elements[i]) {
+      data = this.layers[i];
+      if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) {
         this.buildItem(i);
+      }
     }
-    this.checkPendingElements();
+    this.completeLayers = this.elements[i] ? this.completeLayers : false;
+  }
+  this.checkPendingElements();
 };
 
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
+BaseRenderer.prototype.createItem = function (layer) {
+  switch (layer.ty) {
+    case 2:
+      return this.createImage(layer);
+    case 0:
+      return this.createComp(layer);
+    case 1:
+      return this.createSolid(layer);
+    case 3:
+      return this.createNull(layer);
+    case 4:
+      return this.createShape(layer);
+    case 5:
+      return this.createText(layer);
+    case 6:
+      return this.createAudio(layer);
+    case 13:
+      return this.createCamera(layer);
+    default:
+      return this.createNull(layer);
+  }
+};
+
+BaseRenderer.prototype.createCamera = function () {
+  throw new Error('You\'re using a 3d camera. Try the html renderer.');
+};
+
+BaseRenderer.prototype.createAudio = function (data) {
+  return new AudioElement(data, this.globalData, this);
+};
+
+BaseRenderer.prototype.buildAllItems = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    this.buildItem(i);
+  }
+  this.checkPendingElements();
+};
+
+BaseRenderer.prototype.includeLayers = function (newLayers) {
+  this.completeLayers = false;
+  var i;
+  var len = newLayers.length;
+  var j;
+  var jLen = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    j = 0;
+    while (j < jLen) {
+      if (this.layers[j].id === newLayers[i].id) {
+        this.layers[j] = newLayers[i];
+        break;
+      }
+      j += 1;
+    }
+  }
+};
+
+BaseRenderer.prototype.setProjectInterface = function (pInterface) {
+  this.globalData.projectInterface = pInterface;
+};
+
+BaseRenderer.prototype.initItems = function () {
+  if (!this.globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+};
+BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
+  var elements = this.elements;
+  var layers = this.layers;
+  var i = 0;
+  var len = layers.length;
+  while (i < len) {
+    if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq
+      if (!elements[i] || elements[i] === true) {
+        this.buildItem(i);
+        this.addPendingElement(element);
+      } else {
+        hierarchy.push(elements[i]);
+        elements[i].setAsParent();
+        if (layers[i].parent !== undefined) {
+          this.buildElementParenting(element, layers[i].parent, hierarchy);
+        } else {
+          element.setHierarchy(hierarchy);
         }
+      }
     }
+    i += 1;
+  }
 };
 
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
+BaseRenderer.prototype.addPendingElement = function (element) {
+  this.pendingElements.push(element);
 };
 
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
+BaseRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i]);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
     }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while (i < len) {
-        if (layers[i].ind == parentName) {
-            if (!elements[i] || elements[i] === true) {
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i].setAsParent();
-                if(layers[i].parent !== undefined) {
-                    this.buildElementParenting(element, layers[i].parent, hierarchy);
-                } else {
-                    element.setHierarchy(hierarchy);
-                }
-            }
-        }
-        i += 1;
-    }
+  }
 };
 
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
+BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
+  this.globalData.fontManager = new FontManager();
+  this.globalData.fontManager.addChars(animData.chars);
+  this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
+  this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+  this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
+  this.globalData.imageLoader = this.animationItem.imagePreloader;
+  this.globalData.audioController = this.animationItem.audioController;
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
 };
 
-BaseRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i]);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
+/* global createElementID, extendPrototype, BaseRenderer, NullElement, SVGShapeElement, SVGTextLottieElement,
+IImageElement, SVGCompElement, ISolidElement, createNS, locationHref, createSizedArray, expressionsPlugin */
 
-BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.imageLoader = this.animationItem.imagePreloader;
-    this.globalData.audioController = this.animationItem.audioController;
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-}
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.svgElement = createNS('svg');
-    var ariaLabel = '';
-    if (config && config.title) {
-        var titleElement = createNS('title');
-        var titleId = createElementID();
-        titleElement.setAttribute('id', titleId);
-        titleElement.textContent = config.title;
-        this.svgElement.appendChild(titleElement);
-        ariaLabel += titleId;
-    }
-    if (config && config.description) {
-        var descElement = createNS('desc');
-        var descId = createElementID();
-        descElement.setAttribute('id', descId);
-        descElement.textContent = config.description;
-        this.svgElement.appendChild(descElement);
-        ariaLabel += ' ' + descId;
-    }
-    if (ariaLabel) {
-        this.svgElement.setAttribute('aria-labelledby', ariaLabel)
-    }
-    var defs = createNS( 'defs');
-    this.svgElement.appendChild(defs);
-    var maskElement = createNS('g');
-    this.svgElement.appendChild(maskElement);
-    this.layerElement = maskElement;
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        viewBoxOnly: (config && config.viewBoxOnly) || false,
-        viewBoxSize: (config && config.viewBoxSize) || false,
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-        focusable: config && config.focusable,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '100%',
-            height: config && config.filterSize && config.filterSize.height || '100%',
-            x: config && config.filterSize && config.filterSize.x || '0%',
-            y: config && config.filterSize && config.filterSize.y || '0%',
-        }
-    };
+function SVGRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.svgElement = createNS('svg');
+  var ariaLabel = '';
+  if (config && config.title) {
+    var titleElement = createNS('title');
+    var titleId = createElementID();
+    titleElement.setAttribute('id', titleId);
+    titleElement.textContent = config.title;
+    this.svgElement.appendChild(titleElement);
+    ariaLabel += titleId;
+  }
+  if (config && config.description) {
+    var descElement = createNS('desc');
+    var descId = createElementID();
+    descElement.setAttribute('id', descId);
+    descElement.textContent = config.description;
+    this.svgElement.appendChild(descElement);
+    ariaLabel += ' ' + descId;
+  }
+  if (ariaLabel) {
+    this.svgElement.setAttribute('aria-labelledby', ariaLabel);
+  }
+  var defs = createNS('defs');
+  this.svgElement.appendChild(defs);
+  var maskElement = createNS('g');
+  this.svgElement.appendChild(maskElement);
+  this.layerElement = maskElement;
+  this.renderConfig = {
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    hideOnTransparent: !((config && config.hideOnTransparent === false)),
+    viewBoxOnly: (config && config.viewBoxOnly) || false,
+    viewBoxSize: (config && config.viewBoxSize) || false,
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+    focusable: config && config.focusable,
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '100%',
+      height: (config && config.filterSize && config.filterSize.height) || '100%',
+      x: (config && config.filterSize && config.filterSize.x) || '0%',
+      y: (config && config.filterSize && config.filterSize.y) || '0%',
+    },
+  };
 
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        defs: defs,
-        renderConfig: this.renderConfig
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-    this.rendererType = 'svg';
-
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    defs: defs,
+    renderConfig: this.renderConfig,
+  };
+  this.elements = [];
+  this.pendingElements = [];
+  this.destroyed = false;
+  this.rendererType = 'svg';
 }
 
-extendPrototype([BaseRenderer],SVGRenderer);
+extendPrototype([BaseRenderer], SVGRenderer);
 
 SVGRenderer.prototype.createNull = function (data) {
-    return new NullElement(data,this.globalData,this);
+  return new NullElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new SVGShapeElement(data,this.globalData,this);
+  return new SVGShapeElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data,this.globalData,this);
-
+  return new SVGTextLottieElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data,this.globalData,this);
+  return new IImageElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new SVGCompElement(data,this.globalData,this);
-
+  return new SVGCompElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data,this.globalData,this);
+  return new ISolidElement(data, this.globalData, this);
 };
 
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    if(this.renderConfig.viewBoxSize) {
-        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
-    } else {
-        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    }
+SVGRenderer.prototype.configAnimation = function (animData) {
+  this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+  if (this.renderConfig.viewBoxSize) {
+    this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
+  } else {
+    this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
+  }
 
-    if(!this.renderConfig.viewBoxOnly) {
-        this.svgElement.setAttribute('width',animData.w);
-        this.svgElement.setAttribute('height',animData.h);
-        this.svgElement.style.width = '100%';
-        this.svgElement.style.height = '100%';
-        this.svgElement.style.transform = 'translate3d(0,0,0)';
-    }
-    if (this.renderConfig.className) {
-        this.svgElement.setAttribute('class', this.renderConfig.className);
-    }
-    if (this.renderConfig.id) {
-        this.svgElement.setAttribute('id', this.renderConfig.id);
-    }
-    if (this.renderConfig.focusable !== undefined) {
-        this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
-    }
-    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.svgElement);
-    //Mask animation
-    var defs = this.globalData.defs;
+  if (!this.renderConfig.viewBoxOnly) {
+    this.svgElement.setAttribute('width', animData.w);
+    this.svgElement.setAttribute('height', animData.h);
+    this.svgElement.style.width = '100%';
+    this.svgElement.style.height = '100%';
+    this.svgElement.style.transform = 'translate3d(0,0,0)';
+  }
+  if (this.renderConfig.className) {
+    this.svgElement.setAttribute('class', this.renderConfig.className);
+  }
+  if (this.renderConfig.id) {
+    this.svgElement.setAttribute('id', this.renderConfig.id);
+  }
+  if (this.renderConfig.focusable !== undefined) {
+    this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
+  }
+  this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio);
+  // this.layerElement.style.transform = 'translate3d(0,0,0)';
+  // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
+  this.animationItem.wrapper.appendChild(this.svgElement);
+  // Mask animation
+  var defs = this.globalData.defs;
 
-    this.setupGlobalData(animData, defs);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.data = animData;
+  this.setupGlobalData(animData, defs);
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.data = animData;
 
-    var maskElement = createNS( 'clipPath');
-    var rect = createNS('rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = createElementID();
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+  var maskElement = createNS('clipPath');
+  var rect = createNS('rect');
+  rect.setAttribute('width', animData.w);
+  rect.setAttribute('height', animData.h);
+  rect.setAttribute('x', 0);
+  rect.setAttribute('y', 0);
+  var maskId = createElementID();
+  maskElement.setAttribute('id', maskId);
+  maskElement.appendChild(rect);
+  this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + maskId + ')');
 
-    defs.appendChild(maskElement);
-    this.layers = animData.layers;
-    this.elements = createSizedArray(animData.layers.length);
+  defs.appendChild(maskElement);
+  this.layers = animData.layers;
+  this.elements = createSizedArray(animData.layers.length);
 };
 
-
 SVGRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.layerElement = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 SVGRenderer.prototype.updateContainerSize = function () {
 };
 
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
+SVGRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  elements[pos] = true;
+  var element = this.createItem(this.layers[pos]);
 
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
+  elements[pos] = element;
+  if (expressionsPlugin) {
+    if (this.layers[pos].ty === 0) {
+      this.globalData.projectInterface.registerComposition(element);
     }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
+    element.initExpressions();
+  }
+  this.appendElementInPos(element, pos);
+  if (this.layers[pos].tt) {
+    if (!this.elements[pos - 1] || this.elements[pos - 1] === true) {
+      this.buildItem(pos - 1);
+      this.addPendingElement(element);
+    } else {
+      element.setMatte(elements[pos - 1].layerId);
     }
+  }
 };
 
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame === num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    // console.log('-------');
-    // console.log('FRAME ',num);
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    this.globalData._mdf = false;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    if(this.globalData._mdf) {
-        for (i = 0; i < len; i += 1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
+SVGRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+    if (element.data.tt) {
+      var i = 0;
+      var len = this.elements.length;
+      while (i < len) {
+        if (this.elements[i] === element) {
+          element.setMatte(this.elements[i - 1].layerId);
+          break;
         }
         i += 1;
+      }
     }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
-    } else {
-        this.layerElement.appendChild(newElement);
+  }
+};
+
+SVGRenderer.prototype.renderFrame = function (num) {
+  if (this.renderedFrame === num || this.destroyed) {
+    return;
+  }
+  if (num === null) {
+    num = this.renderedFrame;
+  } else {
+    this.renderedFrame = num;
+  }
+  // console.log('-------');
+  // console.log('FRAME ',num);
+  this.globalData.frameNum = num;
+  this.globalData.frameId += 1;
+  this.globalData.projectInterface.currentFrame = num;
+  this.globalData._mdf = false;
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
     }
+  }
+  if (this.globalData._mdf) {
+    for (i = 0; i < len; i += 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+  }
 };
 
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
+SVGRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newElement = element.getBaseElement();
+  if (!newElement) {
+    return;
+  }
+  var i = 0;
+  var nextElement;
+  while (i < pos) {
+    if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
+      nextElement = this.elements[i].getBaseElement();
+    }
+    i += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(newElement, nextElement);
+  } else {
+    this.layerElement.appendChild(newElement);
+  }
 };
 
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
+SVGRenderer.prototype.hide = function () {
+  this.layerElement.style.display = 'none';
 };
 
-function HybridRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.renderConfig = {
-        className: (config && config.className) || '',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '400%',
-            height: config && config.filterSize && config.filterSize.height || '400%',
-            x: config && config.filterSize && config.filterSize.x || '-100%',
-            y: config && config.filterSize && config.filterSize.y || '-100%',
-        }
-    };
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        renderConfig: this.renderConfig
-    };
-    this.pendingElements = [];
-    this.elements = [];
-    this.threeDElements = [];
-    this.destroyed = false;
-    this.camera = null;
-    this.supports3d = true;
-    this.rendererType = 'html';
+SVGRenderer.prototype.show = function () {
+  this.layerElement.style.display = 'block';
+};
 
+/* global extendPrototype, BaseRenderer, SVGRenderer, SVGShapeElement, HShapeElement, SVGTextLottieElement,
+HTextElement, HCameraElement, IImageElement, HImageElement, SVGCompElement, HCompElement, ISolidElement,
+HSolidElement, styleDiv, createTag, createNS */
+
+function HybridRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.renderConfig = {
+    className: (config && config.className) || '',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    hideOnTransparent: !(config && config.hideOnTransparent === false),
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '400%',
+      height: (config && config.filterSize && config.filterSize.height) || '400%',
+      x: (config && config.filterSize && config.filterSize.x) || '-100%',
+      y: (config && config.filterSize && config.filterSize.y) || '-100%',
+    },
+  };
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    renderConfig: this.renderConfig,
+  };
+  this.pendingElements = [];
+  this.elements = [];
+  this.threeDElements = [];
+  this.destroyed = false;
+  this.camera = null;
+  this.supports3d = true;
+  this.rendererType = 'html';
 }
 
-extendPrototype([BaseRenderer],HybridRenderer);
+extendPrototype([BaseRenderer], HybridRenderer);
 
 HybridRenderer.prototype.buildItem = SVGRenderer.prototype.buildItem;
 
-HybridRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-    }
+HybridRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+  }
 };
 
-HybridRenderer.prototype.appendElementInPos = function(element, pos){
-    var newDOMElement = element.getBaseElement();
-    if(!newDOMElement){
-        return;
-    }
-    var layer = this.layers[pos];
-    if(!layer.ddd || !this.supports3d){
-        if(this.threeDElements) {
-            this.addTo3dContainer(newDOMElement,pos);
-        } else {
-            var i = 0;
-            var nextDOMElement, nextLayer, tmpDOMElement;
-            while(i<pos){
-                if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement){
-                    nextLayer = this.elements[i];
-                    tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
-                    nextDOMElement = tmpDOMElement || nextDOMElement;
-                }
-                i += 1;
-            }
-            if(nextDOMElement){
-                if(!layer.ddd || !this.supports3d){
-                    this.layerElement.insertBefore(newDOMElement, nextDOMElement);
-                }
-            } else {
-                if(!layer.ddd || !this.supports3d){
-                    this.layerElement.appendChild(newDOMElement);
-                }
-            }
-        }
-        
+HybridRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newDOMElement = element.getBaseElement();
+  if (!newDOMElement) {
+    return;
+  }
+  var layer = this.layers[pos];
+  if (!layer.ddd || !this.supports3d) {
+    if (this.threeDElements) {
+      this.addTo3dContainer(newDOMElement, pos);
     } else {
-        this.addTo3dContainer(newDOMElement,pos);
+      var i = 0;
+      var nextDOMElement;
+      var nextLayer;
+      var tmpDOMElement;
+      while (i < pos) {
+        if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement) {
+          nextLayer = this.elements[i];
+          tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
+          nextDOMElement = tmpDOMElement || nextDOMElement;
+        }
+        i += 1;
+      }
+      if (nextDOMElement) {
+        if (!layer.ddd || !this.supports3d) {
+          this.layerElement.insertBefore(newDOMElement, nextDOMElement);
+        }
+      } else if (!layer.ddd || !this.supports3d) {
+        this.layerElement.appendChild(newDOMElement);
+      }
     }
+  } else {
+    this.addTo3dContainer(newDOMElement, pos);
+  }
 };
 
 HybridRenderer.prototype.createShape = function (data) {
-    if(!this.supports3d){
-        return new SVGShapeElement(data, this.globalData, this);
-    }
-    return new HShapeElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new SVGShapeElement(data, this.globalData, this);
+  }
+  return new HShapeElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createText = function (data) {
-    if(!this.supports3d){
-        return new SVGTextElement(data, this.globalData, this);
-    }
-    return new HTextElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new SVGTextLottieElement(data, this.globalData, this);
+  }
+  return new HTextElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createCamera = function (data) {
-    this.camera = new HCameraElement(data, this.globalData, this);
-    return this.camera;
+  this.camera = new HCameraElement(data, this.globalData, this);
+  return this.camera;
 };
 
 HybridRenderer.prototype.createImage = function (data) {
-    if(!this.supports3d){
-        return new IImageElement(data, this.globalData, this);
-    }
-    return new HImageElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new IImageElement(data, this.globalData, this);
+  }
+  return new HImageElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createComp = function (data) {
-    if(!this.supports3d){
-        return new SVGCompElement(data, this.globalData, this);
-    }
-    return new HCompElement(data, this.globalData, this);
-
+  if (!this.supports3d) {
+    return new SVGCompElement(data, this.globalData, this);
+  }
+  return new HCompElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createSolid = function (data) {
-    if(!this.supports3d){
-        return new ISolidElement(data, this.globalData, this);
-    }
-    return new HSolidElement(data, this.globalData, this);
+  if (!this.supports3d) {
+    return new ISolidElement(data, this.globalData, this);
+  }
+  return new HSolidElement(data, this.globalData, this);
 };
 
 HybridRenderer.prototype.createNull = SVGRenderer.prototype.createNull;
 
-HybridRenderer.prototype.getThreeDContainerByPos = function(pos){
-    var i = 0, len = this.threeDElements.length;
-    while(i<len) {
-        if(this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
-            return this.threeDElements[i].perspectiveElem;
+HybridRenderer.prototype.getThreeDContainerByPos = function (pos) {
+  var i = 0;
+  var len = this.threeDElements.length;
+  while (i < len) {
+    if (this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
+      return this.threeDElements[i].perspectiveElem;
+    }
+    i += 1;
+  }
+  return null;
+};
+
+HybridRenderer.prototype.createThreeDContainer = function (pos, type) {
+  var perspectiveElem = createTag('div');
+  var style;
+  var containerStyle;
+  styleDiv(perspectiveElem);
+  var container = createTag('div');
+  styleDiv(container);
+  if (type === '3d') {
+    style = perspectiveElem.style;
+    style.width = this.globalData.compSize.w + 'px';
+    style.height = this.globalData.compSize.h + 'px';
+    var center = '50% 50%';
+    style.webkitTransformOrigin = center;
+    style.mozTransformOrigin = center;
+    style.transformOrigin = center;
+    containerStyle = container.style;
+    var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+    containerStyle.transform = matrix;
+    containerStyle.webkitTransform = matrix;
+  }
+
+  perspectiveElem.appendChild(container);
+  // this.resizerElem.appendChild(perspectiveElem);
+  var threeDContainerData = {
+    container: container,
+    perspectiveElem: perspectiveElem,
+    startPos: pos,
+    endPos: pos,
+    type: type,
+  };
+  this.threeDElements.push(threeDContainerData);
+  return threeDContainerData;
+};
+
+HybridRenderer.prototype.build3dContainers = function () {
+  var i;
+  var len = this.layers.length;
+  var lastThreeDContainerData;
+  var currentContainer = '';
+  for (i = 0; i < len; i += 1) {
+    if (this.layers[i].ddd && this.layers[i].ty !== 3) {
+      if (currentContainer !== '3d') {
+        currentContainer = '3d';
+        lastThreeDContainerData = this.createThreeDContainer(i, '3d');
+      }
+      lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
+    } else {
+      if (currentContainer !== '2d') {
+        currentContainer = '2d';
+        lastThreeDContainerData = this.createThreeDContainer(i, '2d');
+      }
+      lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
+    }
+  }
+  len = this.threeDElements.length;
+  for (i = len - 1; i >= 0; i -= 1) {
+    this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
+  }
+};
+
+HybridRenderer.prototype.addTo3dContainer = function (elem, pos) {
+  var i = 0;
+  var len = this.threeDElements.length;
+  while (i < len) {
+    if (pos <= this.threeDElements[i].endPos) {
+      var j = this.threeDElements[i].startPos;
+      var nextElement;
+      while (j < pos) {
+        if (this.elements[j] && this.elements[j].getBaseElement) {
+          nextElement = this.elements[j].getBaseElement();
         }
-        i += 1;
+        j += 1;
+      }
+      if (nextElement) {
+        this.threeDElements[i].container.insertBefore(elem, nextElement);
+      } else {
+        this.threeDElements[i].container.appendChild(elem);
+      }
+      break;
     }
+    i += 1;
+  }
 };
 
-HybridRenderer.prototype.createThreeDContainer = function(pos, type){
-    var perspectiveElem = createTag('div');
-    styleDiv(perspectiveElem);
-    var container = createTag('div');
-    styleDiv(container);
-    if(type === '3d') {
-        perspectiveElem.style.width = this.globalData.compSize.w+'px';
-        perspectiveElem.style.height = this.globalData.compSize.h+'px';
-        perspectiveElem.style.transformOrigin = perspectiveElem.style.mozTransformOrigin = perspectiveElem.style.webkitTransformOrigin = "50% 50%";
-        container.style.transform = container.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
-    }
-    
-    perspectiveElem.appendChild(container);
-    //this.resizerElem.appendChild(perspectiveElem);
-    var threeDContainerData = {
-        container:container,
-        perspectiveElem:perspectiveElem,
-        startPos: pos,
-        endPos: pos,
-        type: type
-    };
-    this.threeDElements.push(threeDContainerData);
-    return threeDContainerData;
-};
+HybridRenderer.prototype.configAnimation = function (animData) {
+  var resizerElem = createTag('div');
+  var wrapper = this.animationItem.wrapper;
+  var style = resizerElem.style;
+  style.width = animData.w + 'px';
+  style.height = animData.h + 'px';
+  this.resizerElem = resizerElem;
+  styleDiv(resizerElem);
+  style.transformStyle = 'flat';
+  style.mozTransformStyle = 'flat';
+  style.webkitTransformStyle = 'flat';
+  if (this.renderConfig.className) {
+    resizerElem.setAttribute('class', this.renderConfig.className);
+  }
+  wrapper.appendChild(resizerElem);
 
-HybridRenderer.prototype.build3dContainers = function(){
-    var i, len = this.layers.length;
-    var lastThreeDContainerData;
-    var currentContainer = '';
-    for(i=0;i<len;i+=1){
-        if(this.layers[i].ddd && this.layers[i].ty !== 3){
-            if(currentContainer !== '3d'){
-                currentContainer = '3d';
-                lastThreeDContainerData = this.createThreeDContainer(i,'3d');
-            }
-            lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
-        } else {
-            if(currentContainer !== '2d'){
-                currentContainer = '2d';
-                lastThreeDContainerData = this.createThreeDContainer(i,'2d');
-            }
-            lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos,i);
-        }
-    }
-    len = this.threeDElements.length;
-    for(i = len - 1; i >= 0; i --) {
-        this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
-    }
-};
-
-HybridRenderer.prototype.addTo3dContainer = function(elem,pos){
-    var i = 0, len = this.threeDElements.length;
-    while(i<len){
-        if(pos <= this.threeDElements[i].endPos){
-            var j = this.threeDElements[i].startPos;
-            var nextElement;
-            while(j<pos){
-                if(this.elements[j] && this.elements[j].getBaseElement){
-                    nextElement = this.elements[j].getBaseElement();
-                }
-                j += 1;
-            }
-            if(nextElement){
-                this.threeDElements[i].container.insertBefore(elem, nextElement);
-            } else {
-                this.threeDElements[i].container.appendChild(elem);
-            }
-            break;
-        }
-        i += 1;
-    }
-};
-
-HybridRenderer.prototype.configAnimation = function(animData){
-    var resizerElem = createTag('div');
-    var wrapper = this.animationItem.wrapper;
-    resizerElem.style.width = animData.w+'px';
-    resizerElem.style.height = animData.h+'px';
-    this.resizerElem = resizerElem;
-    styleDiv(resizerElem);
-    resizerElem.style.transformStyle = resizerElem.style.webkitTransformStyle = resizerElem.style.mozTransformStyle = "flat";
-    if(this.renderConfig.className) {
-      resizerElem.setAttribute('class', this.renderConfig.className);
-    }
-    wrapper.appendChild(resizerElem);
-
-    resizerElem.style.overflow = 'hidden';
-    var svg = createNS('svg');
-    svg.setAttribute('width','1');
-    svg.setAttribute('height','1');
-    styleDiv(svg);
-    this.resizerElem.appendChild(svg);
-    var defs = createNS('defs');
-    svg.appendChild(defs);
-    this.data = animData;
-    //Mask animation
-    this.setupGlobalData(animData, svg);
-    this.globalData.defs = defs;
-    this.layers = animData.layers;
-    this.layerElement = this.resizerElem;
-    this.build3dContainers();
-    this.updateContainerSize();
+  style.overflow = 'hidden';
+  var svg = createNS('svg');
+  svg.setAttribute('width', '1');
+  svg.setAttribute('height', '1');
+  styleDiv(svg);
+  this.resizerElem.appendChild(svg);
+  var defs = createNS('defs');
+  svg.appendChild(defs);
+  this.data = animData;
+  // Mask animation
+  this.setupGlobalData(animData, svg);
+  this.globalData.defs = defs;
+  this.layers = animData.layers;
+  this.layerElement = this.resizerElem;
+  this.build3dContainers();
+  this.updateContainerSize();
 };
 
 HybridRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
-    }
-    this.animationItem.container = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        this.elements[i].destroy();
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.animationItem.container = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    this.elements[i].destroy();
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 HybridRenderer.prototype.updateContainerSize = function () {
-    var elementWidth = this.animationItem.wrapper.offsetWidth;
-    var elementHeight = this.animationItem.wrapper.offsetHeight;
-    var elementRel = elementWidth/elementHeight;
-    var animationRel = this.globalData.compSize.w/this.globalData.compSize.h;
-    var sx,sy,tx,ty;
-    if(animationRel>elementRel){
-        sx = elementWidth/(this.globalData.compSize.w);
-        sy = elementWidth/(this.globalData.compSize.w);
-        tx = 0;
-        ty = ((elementHeight-this.globalData.compSize.h*(elementWidth/this.globalData.compSize.w))/2);
-    }else{
-        sx = elementHeight/(this.globalData.compSize.h);
-        sy = elementHeight/(this.globalData.compSize.h);
-        tx = (elementWidth-this.globalData.compSize.w*(elementHeight/this.globalData.compSize.h))/2;
-        ty = 0;
-    }
-    this.resizerElem.style.transform = this.resizerElem.style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,'+sy+',0,0,0,0,1,0,'+tx+','+ty+',0,1)';
+  var elementWidth = this.animationItem.wrapper.offsetWidth;
+  var elementHeight = this.animationItem.wrapper.offsetHeight;
+  var elementRel = elementWidth / elementHeight;
+  var animationRel = this.globalData.compSize.w / this.globalData.compSize.h;
+  var sx;
+  var sy;
+  var tx;
+  var ty;
+  if (animationRel > elementRel) {
+    sx = elementWidth / (this.globalData.compSize.w);
+    sy = elementWidth / (this.globalData.compSize.w);
+    tx = 0;
+    ty = ((elementHeight - this.globalData.compSize.h * (elementWidth / this.globalData.compSize.w)) / 2);
+  } else {
+    sx = elementHeight / (this.globalData.compSize.h);
+    sy = elementHeight / (this.globalData.compSize.h);
+    tx = (elementWidth - this.globalData.compSize.w * (elementHeight / this.globalData.compSize.h)) / 2;
+    ty = 0;
+  }
+  var style = this.resizerElem.style;
+  style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,' + sy + ',0,0,0,0,1,0,' + tx + ',' + ty + ',0,1)';
+  style.transform = style.webkitTransform;
 };
 
 HybridRenderer.prototype.renderFrame = SVGRenderer.prototype.renderFrame;
 
-HybridRenderer.prototype.hide = function(){
-    this.resizerElem.style.display = 'none';
+HybridRenderer.prototype.hide = function () {
+  this.resizerElem.style.display = 'none';
 };
 
-HybridRenderer.prototype.show = function(){
-    this.resizerElem.style.display = 'block';
+HybridRenderer.prototype.show = function () {
+  this.resizerElem.style.display = 'block';
 };
 
-HybridRenderer.prototype.initItems = function(){
-    this.buildAllItems();
-    if(this.camera){
-        this.camera.setup();
+HybridRenderer.prototype.initItems = function () {
+  this.buildAllItems();
+  if (this.camera) {
+    this.camera.setup();
+  } else {
+    var cWidth = this.globalData.compSize.w;
+    var cHeight = this.globalData.compSize.h;
+    var i;
+    var len = this.threeDElements.length;
+    for (i = 0; i < len; i += 1) {
+      var style = this.threeDElements[i].perspectiveElem.style;
+      style.webkitPerspective = Math.sqrt(Math.pow(cWidth, 2) + Math.pow(cHeight, 2)) + 'px';
+      style.perspective = style.webkitPerspective;
+    }
+  }
+};
+
+HybridRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  var floatingContainer = createTag('div');
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i], floatingContainer, this.globalData.comp, null);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
+    }
+  }
+};
+
+/* global createSizedArray, createElementID, PropertyFactory, ShapePropertyFactory, createNS, locationHref */
+
+function MaskElement(data, element, globalData) {
+  this.data = data;
+  this.element = element;
+  this.globalData = globalData;
+  this.storedData = [];
+  this.masksProperties = this.data.masksProperties || [];
+  this.maskElement = null;
+  var defs = this.globalData.defs;
+  var i;
+  var len = this.masksProperties ? this.masksProperties.length : 0;
+  this.viewData = createSizedArray(len);
+  this.solidPath = '';
+
+  var path;
+  var properties = this.masksProperties;
+  var count = 0;
+  var currentMasks = [];
+  var j;
+  var jLen;
+  var layerId = createElementID();
+  var rect;
+  var expansor;
+  var feMorph;
+  var x;
+  var maskType = 'clipPath';
+  var maskRef = 'clip-path';
+  for (i = 0; i < len; i += 1) {
+    if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
+      maskType = 'mask';
+      maskRef = 'mask';
+    }
+
+    if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
+      rect = createNS('rect');
+      rect.setAttribute('fill', '#ffffff');
+      rect.setAttribute('width', this.element.comp.data.w || 0);
+      rect.setAttribute('height', this.element.comp.data.h || 0);
+      currentMasks.push(rect);
     } else {
-        var cWidth = this.globalData.compSize.w;
-        var cHeight = this.globalData.compSize.h;
-        var i, len = this.threeDElements.length;
-        for(i=0;i<len;i+=1){
-            this.threeDElements[i].perspectiveElem.style.perspective = this.threeDElements[i].perspectiveElem.style.webkitPerspective = Math.sqrt(Math.pow(cWidth,2) + Math.pow(cHeight,2)) + 'px';
-        }
-    }
-};
-
-HybridRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    var floatingContainer = createTag('div');
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i],floatingContainer,this.globalData.comp,null);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
-
-function MaskElement(data,element,globalData) {
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties || [];
-    this.maskElement = null;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties ? this.masksProperties.length : 0;
-    this.viewData = createSizedArray(len);
-    this.solidPath = '';
-
-
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = createElementID();
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
-            rect = createNS( 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w || 0);
-            rect.setAttribute('height', this.element.comp.data.h || 0);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = createNS( 'path');
-        if(properties[i].mode == 'n') {
-            // TODO move this to a factory or to a constructor
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-                elem: path,
-                lastPath: ''
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
-        path.setAttribute('clip-rule','nonzero');
-        var filterID;
-
-        if (properties[i].x.k !== 0) {
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
-            filterID = createElementID();
-            expansor = createNS('filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = createNS('feMorphology');
-            feMorph.setAttribute('operator','erode');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
-        } else {
-            feMorph = null;
-            x = null;
-        }
-
-        // TODO move this to a factory or to a constructor
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = createNS('g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = createNS('mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        // TODO move this to a factory or to a constructor
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-            invRect: rect
-        };
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
+      rect = null;
     }
 
-    this.maskElement = createNS( maskType);
+    path = createNS('path');
+    if (properties[i].mode === 'n') {
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        elem: path,
+        lastPath: '',
+      };
+      defs.appendChild(path);
+    } else {
+      count += 1;
 
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
-    }
+      path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      path.setAttribute('clip-rule', 'nonzero');
+      var filterID;
 
-    if(count > 0){
-        this.maskElement.setAttribute('id', layerId);
-        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
-        defs.appendChild(this.maskElement);
-    }
-    if (this.viewData.length) {
-        this.element.addRenderableComponent(this);
-    }
+      if (properties[i].x.k !== 0) {
+        maskType = 'mask';
+        maskRef = 'mask';
+        x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
+        filterID = createElementID();
+        expansor = createNS('filter');
+        expansor.setAttribute('id', filterID);
+        feMorph = createNS('feMorphology');
+        feMorph.setAttribute('operator', 'erode');
+        feMorph.setAttribute('in', 'SourceGraphic');
+        feMorph.setAttribute('radius', '0');
+        expansor.appendChild(feMorph);
+        defs.appendChild(expansor);
+        path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      } else {
+        feMorph = null;
+        x = null;
+      }
 
+      // TODO move this to a factory or to a constructor
+      this.storedData[i] = {
+        elem: path,
+        x: x,
+        expan: feMorph,
+        lastPath: '',
+        lastOperator: '',
+        filterId: filterID,
+        lastRadius: 0,
+      };
+      if (properties[i].mode === 'i') {
+        jLen = currentMasks.length;
+        var g = createNS('g');
+        for (j = 0; j < jLen; j += 1) {
+          g.appendChild(currentMasks[j]);
+        }
+        var mask = createNS('mask');
+        mask.setAttribute('mask-type', 'alpha');
+        mask.setAttribute('id', layerId + '_' + count);
+        mask.appendChild(path);
+        defs.appendChild(mask);
+        g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
+
+        currentMasks.length = 0;
+        currentMasks.push(g);
+      } else {
+        currentMasks.push(path);
+      }
+      if (properties[i].inv && !this.solidPath) {
+        this.solidPath = this.createLayerSolidPath();
+      }
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        elem: path,
+        lastPath: '',
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        invRect: rect,
+      };
+      if (!this.viewData[i].prop.k) {
+        this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
+      }
+    }
+  }
+
+  this.maskElement = createNS(maskType);
+
+  len = currentMasks.length;
+  for (i = 0; i < len; i += 1) {
+    this.maskElement.appendChild(currentMasks[i]);
+  }
+
+  if (count > 0) {
+    this.maskElement.setAttribute('id', layerId);
+    this.element.maskedElement.setAttribute(maskRef, 'url(' + locationHref + '#' + layerId + ')');
+    defs.appendChild(this.maskElement);
+  }
+  if (this.viewData.length) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
+MaskElement.prototype.getMaskProperty = function (pos) {
+  return this.viewData[pos].prop;
 };
 
 MaskElement.prototype.renderFrame = function (isFirstFrame) {
-    var finalMat = this.element.finalTransform.mat;
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop._mdf || isFirstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op._mdf || isFirstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
-                this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
-            }
-            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
+  var finalMat = this.element.finalTransform.mat;
+  var i;
+  var len = this.masksProperties.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.viewData[i].prop._mdf || isFirstFrame) {
+      this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
     }
+    if (this.viewData[i].op._mdf || isFirstFrame) {
+      this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
+    }
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
+        this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
+      }
+      if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
+        var feMorph = this.storedData[i].expan;
+        if (this.storedData[i].x.v < 0) {
+          if (this.storedData[i].lastOperator !== 'erode') {
+            this.storedData[i].lastOperator = 'erode';
+            this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
+          }
+          feMorph.setAttribute('radius', -this.storedData[i].x.v);
+        } else {
+          if (this.storedData[i].lastOperator !== 'dilate') {
+            this.storedData[i].lastOperator = 'dilate';
+            this.storedData[i].elem.setAttribute('filter', null);
+          }
+          this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
+        }
+      }
+    }
+  }
 };
 
 MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
+  return this.maskElement;
 };
 
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
+MaskElement.prototype.createLayerSolidPath = function () {
+  var path = 'M0,0 ';
+  path += ' h' + this.globalData.compSize.w;
+  path += ' v' + this.globalData.compSize.h;
+  path += ' h-' + this.globalData.compSize.w;
+  path += ' v-' + this.globalData.compSize.h + ' ';
+  return path;
 };
 
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //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];
-        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];
-    }
-        //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];
-    if(pathNodes.c && len > 1){
-        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];
-    }
-    //pathNodes.__renderedString = pathString;
+MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
+  var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
+  var i;
+  var len;
+  len = pathNodes._length;
+  for (i = 1; i < len; i += 1) {
+    // 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];
+    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];
+  }
+  // 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];
+  if (pathNodes.c && len > 1) {
+    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];
+  }
+  // pathNodes.__renderedString = pathString;
 
-    if(viewData.lastPath !== pathString){
-        var pathShapeValue = '';
-        if(viewData.elem){
-            if(pathNodes.c){
-                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
-            }
-            viewData.elem.setAttribute('d',pathShapeValue);
-        }
-        viewData.lastPath = pathString;
+  if (viewData.lastPath !== pathString) {
+    var pathShapeValue = '';
+    if (viewData.elem) {
+      if (pathNodes.c) {
+        pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
+      }
+      viewData.elem.setAttribute('d', pathShapeValue);
     }
+    viewData.lastPath = pathString;
+  }
 };
 
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.masksProperties = null;
+MaskElement.prototype.destroy = function () {
+  this.element = null;
+  this.globalData = null;
+  this.maskElement = null;
+  this.data = null;
+  this.masksProperties = null;
 };
 
 /**
- * @file 
+ * @file
  * Handles AE's layer parenting property.
  *
  */
 
-function HierarchyElement(){}
+function HierarchyElement() {}
 
 HierarchyElement.prototype = {
-	/**
-     * @function 
+  /**
+     * @function
      * Initializes hierarchy properties
      *
      */
-	initHierarchy: function() {
-		//element's parent list
-	    this.hierarchy = [];
-	    //if element is parent of another layer _isParent will be true
-	    this._isParent = false;
-	    this.checkParenting();
-	},
-	/**
-     * @function 
+  initHierarchy: function () {
+    // element's parent list
+    this.hierarchy = [];
+    // if element is parent of another layer _isParent will be true
+    this._isParent = false;
+    this.checkParenting();
+  },
+  /**
+     * @function
      * Sets layer's hierarchy.
      * @param {array} hierarch
      * layer's parent list
      *
-     */ 
-	setHierarchy: function(hierarchy){
-	    this.hierarchy = hierarchy;
-	},
-	/**
-     * @function 
+     */
+  setHierarchy: function (hierarchy) {
+    this.hierarchy = hierarchy;
+  },
+  /**
+     * @function
      * Sets layer as parent.
      *
-     */ 
-	setAsParent: function() {
-	    this._isParent = true;
-	},
-	/**
-     * @function 
+     */
+  setAsParent: function () {
+    this._isParent = true;
+  },
+  /**
+     * @function
      * Searches layer's parenting chain
      *
-     */ 
-	checkParenting: function(){
-	    if (this.data.parent !== undefined){
-	        this.comp.buildElementParenting(this, this.data.parent, []);
-	    }
-	}
+     */
+  checkParenting: function () {
+    if (this.data.parent !== undefined) {
+      this.comp.buildElementParenting(this, this.data.parent, []);
+    }
+  },
 };
+
 /**
- * @file 
+ * @file
  * Handles element's layer frame update.
  * Checks layer in point and out point
  *
  */
 
-function FrameElement(){}
+function FrameElement() {}
 
 FrameElement.prototype = {
-    /**
-     * @function 
+  /**
+     * @function
      * Initializes frame related properties.
      *
      */
-    initFrame: function(){
-        //set to true when inpoint is rendered
-        this._isFirstFrame = false;
-        //list of animated properties
-        this.dynamicProperties = [];
-        // If layer has been modified in current tick this will be true
-        this._mdf = false;
-    },
-    /**
-     * @function 
+  initFrame: function () {
+    // set to true when inpoint is rendered
+    this._isFirstFrame = false;
+    // list of animated properties
+    this.dynamicProperties = [];
+    // If layer has been modified in current tick this will be true
+    this._mdf = false;
+  },
+  /**
+     * @function
      * Calculates all dynamic values
      *
      * @param {number} num
      * current frame number in Layer's time
      * @param {boolean} isVisible
      * if layers is currently in range
-     * 
+     *
      */
-    prepareProperties: function(num, isVisible) {
-        var i, len = this.dynamicProperties.length;
-        for (i = 0;i < len; i += 1) {
-            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i]._mdf) {
-                    this.globalData._mdf = true;
-                    this._mdf = true;
-                }
-            }
+  prepareProperties: function (num, isVisible) {
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+        this.dynamicProperties[i].getValue();
+        if (this.dynamicProperties[i]._mdf) {
+          this.globalData._mdf = true;
+          this._mdf = true;
         }
-    },
-    addDynamicProperty: function(prop) {
-        if(this.dynamicProperties.indexOf(prop) === -1) {
-            this.dynamicProperties.push(prop);
-        }
+      }
     }
+  },
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+    }
+  },
 };
-function TransformElement(){}
+
+/* global TransformPropertyFactory, Matrix */
+
+function TransformElement() {}
 
 TransformElement.prototype = {
-    initTransform: function() {
-        this.finalTransform = {
-            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
-            _matMdf: false,
-            _opMdf: false,
-            mat: new Matrix()
-        };
-        if (this.data.ao) {
-            this.finalTransform.mProp.autoOriented = true;
-        }
+  initTransform: function () {
+    this.finalTransform = {
+      mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 },
+      _matMdf: false,
+      _opMdf: false,
+      mat: new Matrix(),
+    };
+    if (this.data.ao) {
+      this.finalTransform.mProp.autoOriented = true;
+    }
 
-        //TODO: check TYPE 11: Guided elements
-        if (this.data.ty !== 11) {
-            //this.createElements();
-        }
-    },
-    renderTransform: function() {
+    // TODO: check TYPE 11: Guided elements
+    if (this.data.ty !== 11) {
+      // this.createElements();
+    }
+  },
+  renderTransform: function () {
+    this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+    this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
 
-        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
-        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+    if (this.hierarchy) {
+      var mat;
+      var finalMat = this.finalTransform.mat;
+      var i = 0;
+      var len = this.hierarchy.length;
+      // Checking if any of the transformation matrices in the hierarchy chain has changed.
+      if (!this.finalTransform._matMdf) {
+        while (i < len) {
+          if (this.hierarchy[i].finalTransform.mProp._mdf) {
+            this.finalTransform._matMdf = true;
+            break;
+          }
+          i += 1;
+        }
+      }
 
-        if (this.hierarchy) {
-            var mat;
-            var finalMat = this.finalTransform.mat;
-            var i = 0, len = this.hierarchy.length;
-            //Checking if any of the transformation matrices in the hierarchy chain has changed.
-            if (!this.finalTransform._matMdf) {
-                while (i < len) {
-                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
-                        this.finalTransform._matMdf = true;
-                        break;
-                    }
-                    i += 1;
-                }
-            }
-            
-            if (this.finalTransform._matMdf) {
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-                for (i = 0; i < len; i += 1) {
-                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                    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]);
-                }
-            }
-        }
-    },
-    globalToLocal: function(pt) {
-        var transforms = [];
-        transforms.push(this.finalTransform);
-        var flag = true;
-        var comp = this.comp;
-        while (flag) {
-            if (comp.finalTransform) {
-                if (comp.data.hasMask) {
-                    transforms.splice(0, 0, comp.finalTransform);
-                }
-                comp = comp.comp;
-            } else {
-                flag = false;
-            }
-        }
-        var i, len = transforms.length,ptNew;
+      if (this.finalTransform._matMdf) {
+        mat = this.finalTransform.mProp.v.props;
+        finalMat.cloneFromProps(mat);
         for (i = 0; i < len; i += 1) {
-            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
-            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+          mat = this.hierarchy[i].finalTransform.mProp.v.props;
+          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]);
         }
-        return pt;
-    },
-    mHelper: new Matrix()
+      }
+    }
+  },
+  globalToLocal: function (pt) {
+    var transforms = [];
+    transforms.push(this.finalTransform);
+    var flag = true;
+    var comp = this.comp;
+    while (flag) {
+      if (comp.finalTransform) {
+        if (comp.data.hasMask) {
+          transforms.splice(0, 0, comp.finalTransform);
+        }
+        comp = comp.comp;
+      } else {
+        flag = false;
+      }
+    }
+    var i;
+    var len = transforms.length;
+    var ptNew;
+    for (i = 0; i < len; i += 1) {
+      ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+      // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+      pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+    }
+    return pt;
+  },
+  mHelper: new Matrix(),
 };
-function RenderableElement(){
+
+function RenderableElement() {
 
 }
 
 RenderableElement.prototype = {
-    initRenderable: function() {
-        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
-        this.isInRange = false;
-        //layer's display state
-        this.hidden = false;
-        // If layer's transparency equals 0, it can be hidden
-        this.isTransparent = false;
-        //list of animated components
-        this.renderableComponents = [];
-    },
-    addRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) === -1) {
-            this.renderableComponents.push(component);
-        }
-    },
-    removeRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) !== -1) {
-            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
-        }
-    },
-    prepareRenderableFrame: function(num) {
-        this.checkLayerLimits(num);
-    },
-    checkTransparency: function(){
-        if(this.finalTransform.mProp.o.v <= 0) {
-            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
-                this.isTransparent = true;
-                this.hide();
-            }
-        } else if(this.isTransparent) {
-            this.isTransparent = false;
-            this.show();
-        }
-    },
-    /**
-     * @function 
+  initRenderable: function () {
+    // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+    this.isInRange = false;
+    // layer's display state
+    this.hidden = false;
+    // If layer's transparency equals 0, it can be hidden
+    this.isTransparent = false;
+    // list of animated components
+    this.renderableComponents = [];
+  },
+  addRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) === -1) {
+      this.renderableComponents.push(component);
+    }
+  },
+  removeRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) !== -1) {
+      this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+    }
+  },
+  prepareRenderableFrame: function (num) {
+    this.checkLayerLimits(num);
+  },
+  checkTransparency: function () {
+    if (this.finalTransform.mProp.o.v <= 0) {
+      if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
+        this.isTransparent = true;
+        this.hide();
+      }
+    } else if (this.isTransparent) {
+      this.isTransparent = false;
+      this.show();
+    }
+  },
+  /**
+     * @function
      * Initializes frame related properties.
      *
      * @param {number} num
      * current frame number in Layer's time
-     * 
+     *
      */
-    checkLayerLimits: function(num) {
-        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-        {
-            if(this.isInRange !== true){
-                this.globalData._mdf = true;
-                this._mdf = true;
-                this.isInRange = true;
-                this.show();
-            }
-        } else {
-            if(this.isInRange !== false){
-                this.globalData._mdf = true;
-                this.isInRange = false;
-                this.hide();
-            }
-        }
-    },
-    renderRenderable: function() {
-        var i, len = this.renderableComponents.length;
-        for(i = 0; i < len; i += 1) {
-            this.renderableComponents[i].renderFrame(this._isFirstFrame);
-        }
-        /*this.maskManager.renderFrame(this.finalTransform.mat);
-        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
-    },
-    sourceRectAtTime: function(){
-        return {
-            top:0,
-            left:0,
-            width:100,
-            height:100
-        };
-    },
-    getLayerSize: function(){
-        if(this.data.ty === 5){
-            return {w:this.data.textData.width,h:this.data.textData.height};
-        }else{
-            return {w:this.data.width,h:this.data.height};
-        }
+  checkLayerLimits: function (num) {
+    if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
+      if (this.isInRange !== true) {
+        this.globalData._mdf = true;
+        this._mdf = true;
+        this.isInRange = true;
+        this.show();
+      }
+    } else if (this.isInRange !== false) {
+      this.globalData._mdf = true;
+      this.isInRange = false;
+      this.hide();
     }
+  },
+  renderRenderable: function () {
+    var i;
+    var len = this.renderableComponents.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderableComponents[i].renderFrame(this._isFirstFrame);
+    }
+    /* this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
+  },
+  sourceRectAtTime: function () {
+    return {
+      top: 0,
+      left: 0,
+      width: 100,
+      height: 100,
+    };
+  },
+  getLayerSize: function () {
+    if (this.data.ty === 5) {
+      return { w: this.data.textData.width, h: this.data.textData.height };
+    }
+    return { w: this.data.width, h: this.data.height };
+  },
 };
+
+/* global extendPrototype, RenderableElement, createProxyFunction */
+
 function RenderableDOMElement() {}
 
-(function(){
-    var _prototype = {
-        initElement: function(data,globalData,comp) {
-            this.initFrame();
-            this.initBaseData(data, globalData, comp);
-            this.initTransform(data, globalData, comp);
-            this.initHierarchy();
-            this.initRenderable();
-            this.initRendererElement();
-            this.createContainerElements();
-            this.createRenderableComponents();
-            this.createContent();
-            this.hide();
-        },
-        hide: function(){
-            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-                var elem = this.baseElement || this.layerElement;
-                elem.style.display = 'none';
-                this.hidden = true;
-            }
-        },
-        show: function(){
-            if (this.isInRange && !this.isTransparent){
-                if (!this.data.hd) {
-                    var elem = this.baseElement || this.layerElement;
-                    elem.style.display = 'block';
-                }
-                this.hidden = false;
-                this._isFirstFrame = true;
-            }
-        },
-        renderFrame: function() {
-            //If it is exported as hidden (data.hd === true) no need to render
-            //If it is not visible no need to render
-            if (this.data.hd || this.hidden) {
-                return;
-            }
-            this.renderTransform();
-            this.renderRenderable();
-            this.renderElement();
-            this.renderInnerContent();
-            if (this._isFirstFrame) {
-                this._isFirstFrame = false;
-            }
-        },
-        renderInnerContent: function() {},
-        prepareFrame: function(num) {
-            this._mdf = false;
-            this.prepareRenderableFrame(num);
-            this.prepareProperties(num, this.isInRange);
-            this.checkTransparency();
-        },
-        destroy: function(){
-            this.innerElem =  null;
-            this.destroyBaseElement();
+(function () {
+  var _prototype = {
+    initElement: function (data, globalData, comp) {
+      this.initFrame();
+      this.initBaseData(data, globalData, comp);
+      this.initTransform(data, globalData, comp);
+      this.initHierarchy();
+      this.initRenderable();
+      this.initRendererElement();
+      this.createContainerElements();
+      this.createRenderableComponents();
+      this.createContent();
+      this.hide();
+    },
+    hide: function () {
+      if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+        var elem = this.baseElement || this.layerElement;
+        elem.style.display = 'none';
+        this.hidden = true;
+      }
+    },
+    show: function () {
+      if (this.isInRange && !this.isTransparent) {
+        if (!this.data.hd) {
+          var elem = this.baseElement || this.layerElement;
+          elem.style.display = 'block';
         }
-    };
-    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+        this.hidden = false;
+        this._isFirstFrame = true;
+      }
+    },
+    renderFrame: function () {
+      // If it is exported as hidden (data.hd === true) no need to render
+      // If it is not visible no need to render
+      if (this.data.hd || this.hidden) {
+        return;
+      }
+      this.renderTransform();
+      this.renderRenderable();
+      this.renderElement();
+      this.renderInnerContent();
+      if (this._isFirstFrame) {
+        this._isFirstFrame = false;
+      }
+    },
+    renderInnerContent: function () {},
+    prepareFrame: function (num) {
+      this._mdf = false;
+      this.prepareRenderableFrame(num);
+      this.prepareProperties(num, this.isInRange);
+      this.checkTransparency();
+    },
+    destroy: function () {
+      this.innerElem = null;
+      this.destroyBaseElement();
+    },
+  };
+  extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
 }());
+
+/* exported ProcessedElement */
+
 function ProcessedElement(element, position) {
-	this.elem = element;
-	this.pos = position;
+  this.elem = element;
+  this.pos = position;
 }
+
+/* global createNS */
+
 function SVGStyleData(data, level) {
-	this.data = data;
-	this.type = data.ty;
-	this.d = '';
-	this.lvl = level;
-	this._mdf = false;
-	this.closed = data.hd === true;
-	this.pElem = createNS('path');
-	this.msElem = null;
+  this.data = data;
+  this.type = data.ty;
+  this.d = '';
+  this.lvl = level;
+  this._mdf = false;
+  this.closed = data.hd === true;
+  this.pElem = createNS('path');
+  this.msElem = null;
 }
 
-SVGStyleData.prototype.reset = function() {
-	this.d = '';
-	this._mdf = false;
+SVGStyleData.prototype.reset = function () {
+  this.d = '';
+  this._mdf = false;
 };
+
 function SVGShapeData(transformers, level, shape) {
-    this.caches = [];
-    this.styles = [];
-    this.transformers = transformers;
-    this.lStr = '';
-    this.sh = shape;
-    this.lvl = level;
-    //TODO find if there are some cases where _isAnimated can be false. 
-    // For now, since shapes add up with other shapes. They have to be calculated every time.
-    // One way of finding out is checking if all styles associated to this shape depend only of this shape
-    this._isAnimated = !!shape.k;
-    // TODO: commenting this for now since all shapes are animated
-    var i = 0, len = transformers.length;
-    while(i < len) {
-    	if(transformers[i].mProps.dynamicProperties.length) {
-    		this._isAnimated = true;
-    		break;
-    	}
-    	i += 1;
+  this.caches = [];
+  this.styles = [];
+  this.transformers = transformers;
+  this.lStr = '';
+  this.sh = shape;
+  this.lvl = level;
+  // TODO find if there are some cases where _isAnimated can be false.
+  // For now, since shapes add up with other shapes. They have to be calculated every time.
+  // One way of finding out is checking if all styles associated to this shape depend only of this shape
+  this._isAnimated = !!shape.k;
+  // TODO: commenting this for now since all shapes are animated
+  var i = 0;
+  var len = transformers.length;
+  while (i < len) {
+    if (transformers[i].mProps.dynamicProperties.length) {
+      this._isAnimated = true;
+      break;
     }
+    i += 1;
+  }
 }
 
-SVGShapeData.prototype.setAsAnimated = function() {
-    this._isAnimated = true;
-}
+SVGShapeData.prototype.setAsAnimated = function () {
+  this._isAnimated = true;
+};
+
+/* exported SVGTransformData */
+
 function SVGTransformData(mProps, op, container) {
-	this.transform = {
-		mProps: mProps,
-		op: op,
-		container: container
-	};
-	this.elements = [];
-    this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
+  this.transform = {
+    mProps: mProps,
+    op: op,
+    container: container,
+  };
+  this.elements = [];
+  this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
 }
-function SVGStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
-    this._isAnimated = !!this._isAnimated;
+
+/* global DashProperty, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
-function SVGFillStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
+
+/* global PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
-function SVGGradientFillStyleData(elem, data, styleOb){
-    this.initDynamicPropertyContainer(elem);
-    this.getValue = this.iterateDynamicProperties;
-    this.initGradientData(elem, data, styleOb);
+
+/* global PropertyFactory, degToRads, GradientProperty, createElementID, createNS, locationHref,
+extendPrototype, DynamicPropertyContainer */
+
+function SVGGradientFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.initGradientData(elem, data, styleOb);
 }
 
-SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){
-    this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-    this.s = PropertyFactory.getProp(elem,data.s,1,null,this);
-    this.e = PropertyFactory.getProp(elem,data.e,1,null,this);
-    this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this);
-    this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this);
-    this.g = new GradientProperty(elem,data.g,this);
-    this.style = styleOb;
-    this.stops = [];
-    this.setGradientData(styleOb.pElem, data);
-    this.setGradientOpacity(data, styleOb);
-    this._isAnimated = !!this._isAnimated;
-
+SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) {
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.s = PropertyFactory.getProp(elem, data.s, 1, null, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 1, null, this);
+  this.h = PropertyFactory.getProp(elem, data.h || { k: 0 }, 0, 0.01, this);
+  this.a = PropertyFactory.getProp(elem, data.a || { k: 0 }, 0, degToRads, this);
+  this.g = new GradientProperty(elem, data.g, this);
+  this.style = styleOb;
+  this.stops = [];
+  this.setGradientData(styleOb.pElem, data);
+  this.setGradientOpacity(data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 };
 
-SVGGradientFillStyleData.prototype.setGradientData = function(pathElement,data){
+SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) {
+  var gradientId = createElementID();
+  var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+  gfill.setAttribute('id', gradientId);
+  gfill.setAttribute('spreadMethod', 'pad');
+  gfill.setAttribute('gradientUnits', 'userSpaceOnUse');
+  var stops = [];
+  var stop;
+  var j;
+  var jLen;
+  jLen = data.g.p * 4;
+  for (j = 0; j < jLen; j += 4) {
+    stop = createNS('stop');
+    gfill.appendChild(stop);
+    stops.push(stop);
+  }
+  pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + gradientId + ')');
 
-    var gradientId = createElementID();
-    var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-    gfill.setAttribute('id',gradientId);
-    gfill.setAttribute('spreadMethod','pad');
-    gfill.setAttribute('gradientUnits','userSpaceOnUse');
-    var stops = [];
-    var stop, j, jLen;
-    jLen = data.g.p*4;
-    for(j=0;j<jLen;j+=4){
-        stop = createNS('stop');
-        gfill.appendChild(stop);
-        stops.push(stop);
-    }
-    pathElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+gradientId+')');
-    
-    this.gf = gfill;
-    this.cst = stops;
+  this.gf = gfill;
+  this.cst = stops;
 };
 
-SVGGradientFillStyleData.prototype.setGradientOpacity = function(data, styleOb){
-    if(this.g._hasOpacity && !this.g._collapsable){
-        var stop, j, jLen;
-        var mask = createNS("mask");
-        var maskElement = createNS( 'path');
-        mask.appendChild(maskElement);
-        var opacityId = createElementID();
-        var maskId = createElementID();
-        mask.setAttribute('id',maskId);
-        var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-        opFill.setAttribute('id',opacityId);
-        opFill.setAttribute('spreadMethod','pad');
-        opFill.setAttribute('gradientUnits','userSpaceOnUse');
-        jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
-        var stops = this.stops;
-        for(j=data.g.p*4;j<jLen;j+=2){
-            stop = createNS('stop');
-            stop.setAttribute('stop-color','rgb(255,255,255)');
-            opFill.appendChild(stop);
-            stops.push(stop);
-        }
-        maskElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+opacityId+')');
-        this.of = opFill;
-        this.ms = mask;
-        this.ost = stops;
-        this.maskId = maskId;
-        styleOb.msElem = maskElement;
+SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) {
+  if (this.g._hasOpacity && !this.g._collapsable) {
+    var stop;
+    var j;
+    var jLen;
+    var mask = createNS('mask');
+    var maskElement = createNS('path');
+    mask.appendChild(maskElement);
+    var opacityId = createElementID();
+    var maskId = createElementID();
+    mask.setAttribute('id', maskId);
+    var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+    opFill.setAttribute('id', opacityId);
+    opFill.setAttribute('spreadMethod', 'pad');
+    opFill.setAttribute('gradientUnits', 'userSpaceOnUse');
+    jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
+    var stops = this.stops;
+    for (j = data.g.p * 4; j < jLen; j += 2) {
+      stop = createNS('stop');
+      stop.setAttribute('stop-color', 'rgb(255,255,255)');
+      opFill.appendChild(stop);
+      stops.push(stop);
     }
+    maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + opacityId + ')');
+    this.of = opFill;
+    this.ms = mask;
+    this.ost = stops;
+    this.maskId = maskId;
+    styleOb.msElem = maskElement;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
-function SVGGradientStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-    this.initGradientData(elem, data, styleOb);
-    this._isAnimated = !!this._isAnimated;
+
+/* global PropertyFactory, DashProperty, extendPrototype, SVGGradientFillStyleData, DynamicPropertyContainer */
+
+function SVGGradientStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.initGradientData(elem, data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
+
+/* global createNS */
+/* exported ShapeGroupData */
+
 function ShapeGroupData() {
-	this.it = [];
-    this.prevViewData = [];
-    this.gr = createNS('g');
+  this.it = [];
+  this.prevViewData = [];
+  this.gr = createNS('g');
 }
-var SVGElementsRenderer = (function() {
-	var _identityMatrix = new Matrix();
-	var _matrixHelper = new Matrix();
 
-	var ob = {
-		createRenderFunction: createRenderFunction
-	}
+/* global Matrix, buildShapeString, bmFloor */
+/* exported SVGElementsRenderer */
 
-	function createRenderFunction(data) {
-	    var ty = data.ty;
-	    switch(data.ty) {
-	        case 'fl':
-	        return renderFill;
-	        case 'gf':
-	        return renderGradient;
-	        case 'gs':
-	        return renderGradientStroke;
-	        case 'st':
-	        return renderStroke;
-	        case 'sh':
-	        case 'el':
-	        case 'rc':
-	        case 'sr':
-	        return renderPath;
-	        case 'tr':
-	        return renderContentTransform;
-	    }
-	}
+var SVGElementsRenderer = (function () {
+  var _identityMatrix = new Matrix();
+  var _matrixHelper = new Matrix();
 
-	function renderContentTransform(styleData, itemData, isFirstFrame) {
-	    if(isFirstFrame || itemData.transform.op._mdf){
-	        itemData.transform.container.setAttribute('opacity',itemData.transform.op.v);
-	    }
-	    if(isFirstFrame || itemData.transform.mProps._mdf){
-	        itemData.transform.container.setAttribute('transform',itemData.transform.mProps.v.to2dCSS());
-	    }
-	}
+  var ob = {
+    createRenderFunction: createRenderFunction,
+  };
 
-	function renderPath(styleData, itemData, isFirstFrame) {
-	    var j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = itemData.styles.length;
-	    var lvl = itemData.lvl;
-	    var paths, mat, props, iterations, k;
-	    for(l=0;l<lLen;l+=1){
-	        redraw = itemData.sh._mdf || isFirstFrame;
-	        if(itemData.styles[l].lvl < lvl){
-	            mat = _matrixHelper.reset();
-	            iterations = lvl - itemData.styles[l].lvl;
-	            k = itemData.transformers.length-1;
-	            while(!redraw && iterations > 0) {
-	                redraw = itemData.transformers[k].mProps._mdf || redraw;
-	                iterations --;
-	                k --;
-	            }
-	            if(redraw) {
-	                iterations = lvl - itemData.styles[l].lvl;
-	                k = itemData.transformers.length-1;
-	                while(iterations > 0) {
-	                    props = itemData.transformers[k].mProps.v.props;
-	                    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]);
-	                    iterations --;
-	                    k --;
-	                }
-	            }
-	        } else {
-	            mat = _identityMatrix;
-	        }
-	        paths = itemData.sh.paths;
-	        jLen = paths._length;
-	        if(redraw){
-	            pathStringTransformed = '';
-	            for(j=0;j<jLen;j+=1){
-	                pathNodes = paths.shapes[j];
-	                if(pathNodes && pathNodes._length){
-	                    pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
-	                }
-	            }
-	            itemData.caches[l] = pathStringTransformed;
-	        } else {
-	            pathStringTransformed = itemData.caches[l];
-	        }
-	        itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
-	        itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
-	    }
-	}
+  function createRenderFunction(data) {
+    switch (data.ty) {
+      case 'fl':
+        return renderFill;
+      case 'gf':
+        return renderGradient;
+      case 'gs':
+        return renderGradientStroke;
+      case 'st':
+        return renderStroke;
+      case 'sh':
+      case 'el':
+      case 'rc':
+      case 'sr':
+        return renderPath;
+      case 'tr':
+        return renderContentTransform;
+      default:
+        return null;
+    }
+  }
 
-	function renderFill (styleData,itemData, isFirstFrame){
-	    var styleElem = itemData.style;
+  function renderContentTransform(styleData, itemData, isFirstFrame) {
+    if (isFirstFrame || itemData.transform.op._mdf) {
+      itemData.transform.container.setAttribute('opacity', itemData.transform.op.v);
+    }
+    if (isFirstFrame || itemData.transform.mProps._mdf) {
+      itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS());
+    }
+  }
 
-	    if(itemData.c._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill','rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill-opacity',itemData.o.v);
-	    }
-	};
+  function renderPath(styleData, itemData, isFirstFrame) {
+    var j;
+    var jLen;
+    var pathStringTransformed;
+    var redraw;
+    var pathNodes;
+    var l;
+    var lLen = itemData.styles.length;
+    var lvl = itemData.lvl;
+    var paths;
+    var mat;
+    var props;
+    var iterations;
+    var k;
+    for (l = 0; l < lLen; l += 1) {
+      redraw = itemData.sh._mdf || isFirstFrame;
+      if (itemData.styles[l].lvl < lvl) {
+        mat = _matrixHelper.reset();
+        iterations = lvl - itemData.styles[l].lvl;
+        k = itemData.transformers.length - 1;
+        while (!redraw && iterations > 0) {
+          redraw = itemData.transformers[k].mProps._mdf || redraw;
+          iterations -= 1;
+          k -= 1;
+        }
+        if (redraw) {
+          iterations = lvl - itemData.styles[l].lvl;
+          k = itemData.transformers.length - 1;
+          while (iterations > 0) {
+            props = itemData.transformers[k].mProps.v.props;
+            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]);
+            iterations -= 1;
+            k -= 1;
+          }
+        }
+      } else {
+        mat = _identityMatrix;
+      }
+      paths = itemData.sh.paths;
+      jLen = paths._length;
+      if (redraw) {
+        pathStringTransformed = '';
+        for (j = 0; j < jLen; j += 1) {
+          pathNodes = paths.shapes[j];
+          if (pathNodes && pathNodes._length) {
+            pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
+          }
+        }
+        itemData.caches[l] = pathStringTransformed;
+      } else {
+        pathStringTransformed = itemData.caches[l];
+      }
+      itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
+      itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
+    }
+  }
 
-	function renderGradientStroke (styleData, itemData, isFirstFrame) {
-	    renderGradient(styleData, itemData, isFirstFrame);
-	    renderStroke(styleData, itemData, isFirstFrame);
-	}
+  function renderFill(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
 
-	function renderGradient(styleData, itemData, isFirstFrame) {
-	    var gfill = itemData.gf;
-	    var hasOpacity = itemData.g._hasOpacity;
-	    var pt1 = itemData.s.v, pt2 = itemData.e.v;
+    if (itemData.c._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill-opacity', itemData.o.v);
+    }
+  }
 
-	    if (itemData.o._mdf || isFirstFrame) {
-	        var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
-	        itemData.style.pElem.setAttribute(attr, itemData.o.v);
-	    }
-	    if (itemData.s._mdf || isFirstFrame) {
-	        var attr1 = styleData.t === 1 ? 'x1' : 'cx';
-	        var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
-	        gfill.setAttribute(attr1, pt1[0]);
-	        gfill.setAttribute(attr2, pt1[1]);
-	        if (hasOpacity && !itemData.g._collapsable) {
-	            itemData.of.setAttribute(attr1, pt1[0]);
-	            itemData.of.setAttribute(attr2, pt1[1]);
-	        }
-	    }
-	    var stops, i, len, stop;
-	    if (itemData.g._cmdf || isFirstFrame) {
-	        stops = itemData.cst;
-	        var cValues = itemData.g.c;
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1){
-	            stop = stops[i];
-	            stop.setAttribute('offset', cValues[i * 4] + '%');
-	            stop.setAttribute('stop-color','rgb('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ')');
-	        }
-	    }
-	    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
-	        var oValues = itemData.g.o;
-	        if(itemData.g._collapsable) {
-	            stops = itemData.cst;
-	        } else {
-	            stops = itemData.ost;
-	        }
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1) {
-	            stop = stops[i];
-	            if(!itemData.g._collapsable) {
-	                stop.setAttribute('offset', oValues[i * 2] + '%');
-	            }
-	            stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
-	        }
-	    }
-	    if (styleData.t === 1) {
-	        if (itemData.e._mdf  || isFirstFrame) {
-	            gfill.setAttribute('x2', pt2[0]);
-	            gfill.setAttribute('y2', pt2[1]);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('x2', pt2[0]);
-	                itemData.of.setAttribute('y2', pt2[1]);
-	            }
-	        }
-	    } else {
-	        var rad;
-	        if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
-	            rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            gfill.setAttribute('r', rad);
-	            if(hasOpacity && !itemData.g._collapsable){
-	                itemData.of.setAttribute('r', rad);
-	            }
-	        }
-	        if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
-	            if (!rad) {
-	                rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            }
-	            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+  function renderGradientStroke(styleData, itemData, isFirstFrame) {
+    renderGradient(styleData, itemData, isFirstFrame);
+    renderStroke(styleData, itemData, isFirstFrame);
+  }
 
-	            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-	            var dist = rad * percent;
-	            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-	            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-	            gfill.setAttribute('fx', x);
-	            gfill.setAttribute('fy', y);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('fx', x);
-	                itemData.of.setAttribute('fy', y);
-	            }
-	        }
-	        //gfill.setAttribute('fy','200');
-	    }
-	};
+  function renderGradient(styleData, itemData, isFirstFrame) {
+    var gfill = itemData.gf;
+    var hasOpacity = itemData.g._hasOpacity;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
 
-	function renderStroke(styleData, itemData, isFirstFrame) {
-	    var styleElem = itemData.style;
-	    var d = itemData.d;
-	    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
-	        styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
-	        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
-	    }
-	    if(itemData.c && (itemData.c._mdf || isFirstFrame)){
-	        styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
-	    }
-	    if(itemData.w._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
-	        if(styleElem.msElem){
-	            styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
-	        }
-	    }
-	};
+    if (itemData.o._mdf || isFirstFrame) {
+      var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
+      itemData.style.pElem.setAttribute(attr, itemData.o.v);
+    }
+    if (itemData.s._mdf || isFirstFrame) {
+      var attr1 = styleData.t === 1 ? 'x1' : 'cx';
+      var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
+      gfill.setAttribute(attr1, pt1[0]);
+      gfill.setAttribute(attr2, pt1[1]);
+      if (hasOpacity && !itemData.g._collapsable) {
+        itemData.of.setAttribute(attr1, pt1[0]);
+        itemData.of.setAttribute(attr2, pt1[1]);
+      }
+    }
+    var stops;
+    var i;
+    var len;
+    var stop;
+    if (itemData.g._cmdf || isFirstFrame) {
+      stops = itemData.cst;
+      var cValues = itemData.g.c;
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        stop.setAttribute('offset', cValues[i * 4] + '%');
+        stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')');
+      }
+    }
+    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
+      var oValues = itemData.g.o;
+      if (itemData.g._collapsable) {
+        stops = itemData.cst;
+      } else {
+        stops = itemData.ost;
+      }
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        if (!itemData.g._collapsable) {
+          stop.setAttribute('offset', oValues[i * 2] + '%');
+        }
+        stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
+      }
+    }
+    if (styleData.t === 1) {
+      if (itemData.e._mdf || isFirstFrame) {
+        gfill.setAttribute('x2', pt2[0]);
+        gfill.setAttribute('y2', pt2[1]);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('x2', pt2[0]);
+          itemData.of.setAttribute('y2', pt2[1]);
+        }
+      }
+    } else {
+      var rad;
+      if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
+        rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        gfill.setAttribute('r', rad);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('r', rad);
+        }
+      }
+      if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
+        if (!rad) {
+          rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        }
+        var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
 
-	return ob;
-}())
+        var percent = itemData.h.v;
+        if (percent >= 1) {
+          percent = 0.99;
+        } else if (percent <= -1) {
+          percent = -0.99;
+        }
+        var dist = rad * percent;
+        var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+        var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+        gfill.setAttribute('fx', x);
+        gfill.setAttribute('fy', y);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('fx', x);
+          itemData.of.setAttribute('fy', y);
+        }
+      }
+      // gfill.setAttribute('fy','200');
+    }
+  }
+
+  function renderStroke(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
+    var d = itemData.d;
+    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
+      styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
+      styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
+    }
+    if (itemData.c && (itemData.c._mdf || isFirstFrame)) {
+      styleElem.pElem.setAttribute('stroke', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
+    }
+    if (itemData.w._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
+      if (styleElem.msElem) {
+        styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
+      }
+    }
+  }
+
+  return ob;
+}());
+
+/* global Matrix */
+
 function ShapeTransformManager() {
-	this.sequences = {};
-	this.sequenceList = [];
-    this.transform_key_count = 0;
+  this.sequences = {};
+  this.sequenceList = [];
+  this.transform_key_count = 0;
 }
 
 ShapeTransformManager.prototype = {
-	addTransformSequence: function(transforms) {
-		var i, len = transforms.length;
-		var key = '_';
-		for(i = 0; i < len; i += 1) {
-			key += transforms[i].transform.key + '_';
-		}
-		var sequence = this.sequences[key];
-		if(!sequence) {
-			sequence = {
-				transforms: [].concat(transforms),
-				finalTransform: new Matrix(),
-				_mdf: false
-			};
-			this.sequences[key] = sequence;
-			this.sequenceList.push(sequence);
-		}
-		return sequence;
-	},
-	processSequence: function(sequence, isFirstFrame) {
-		var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
-		while (i < len && !isFirstFrame) {
-			if (sequence.transforms[i].transform.mProps._mdf) {
-				_mdf = true;
-				break;
-			}
-			i += 1
-		}
-		if (_mdf) {
-			var props;
-			sequence.finalTransform.reset();
-			for (i = len - 1; i >= 0; i -= 1) {
-		        props = sequence.transforms[i].transform.mProps.v.props;
-		        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]);
-			}
-		}
-		sequence._mdf = _mdf;
-		
-	},
-	processSequences: function(isFirstFrame) {
-		var i, len = this.sequenceList.length;
-		for (i = 0; i < len; i += 1) {
-			this.processSequence(this.sequenceList[i], isFirstFrame);
-		}
+  addTransformSequence: function (transforms) {
+    var i;
+    var len = transforms.length;
+    var key = '_';
+    for (i = 0; i < len; i += 1) {
+      key += transforms[i].transform.key + '_';
+    }
+    var sequence = this.sequences[key];
+    if (!sequence) {
+      sequence = {
+        transforms: [].concat(transforms),
+        finalTransform: new Matrix(),
+        _mdf: false,
+      };
+      this.sequences[key] = sequence;
+      this.sequenceList.push(sequence);
+    }
+    return sequence;
+  },
+  processSequence: function (sequence, isFirstFrame) {
+    var i = 0;
+    var len = sequence.transforms.length;
+    var _mdf = isFirstFrame;
+    while (i < len && !isFirstFrame) {
+      if (sequence.transforms[i].transform.mProps._mdf) {
+        _mdf = true;
+        break;
+      }
+      i += 1;
+    }
+    if (_mdf) {
+      var props;
+      sequence.finalTransform.reset();
+      for (i = len - 1; i >= 0; i -= 1) {
+        props = sequence.transforms[i].transform.mProps.v.props;
+        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]);
+      }
+    }
+    sequence._mdf = _mdf;
+  },
+  processSequences: function (isFirstFrame) {
+    var i;
+    var len = this.sequenceList.length;
+    for (i = 0; i < len; i += 1) {
+      this.processSequence(this.sequenceList[i], isFirstFrame);
+    }
+  },
+  getNewKey: function () {
+    this.transform_key_count += 1;
+    return '_' + this.transform_key_count;
+  },
+};
 
-	},
-	getNewKey: function() {
-		return '_' + this.transform_key_count++;
-	}
-}
-function BaseElement(){
+/* global LayerExpressionInterface, EffectsExpressionInterface, CompExpressionInterface, ShapeExpressionInterface,
+TextExpressionInterface, getBlendMode,createElementID, EffectsManager */
+
+function BaseElement() {
 }
 
 BaseElement.prototype = {
-    checkMasks: function(){
-        if(!this.data.hasMask){
-            return false;
-        }
-        var i = 0, len = this.data.masksProperties.length;
-        while(i<len) {
-            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-                return true;
-            }
-            i += 1;
-        }
-        return false;
-    },
-    initExpressions: function(){
-        this.layerInterface = LayerExpressionInterface(this);
-        if(this.data.hasMask && this.maskManager) {
-            this.layerInterface.registerMaskInterface(this.maskManager);
-        }
-        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-        this.layerInterface.registerEffectsInterface(effectsInterface);
-
-        if(this.data.ty === 0 || this.data.xt){
-            this.compInterface = CompExpressionInterface(this);
-        } else if(this.data.ty === 4){
-            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
-            this.layerInterface.content = this.layerInterface.shapeInterface;
-        } else if(this.data.ty === 5){
-            this.layerInterface.textInterface = TextExpressionInterface(this);
-            this.layerInterface.text = this.layerInterface.textInterface;
-        }
-    },
-    setBlendMode: function(){
-        var blendModeValue = getBlendMode(this.data.bm);
-        var elem = this.baseElement || this.layerElement;
-
-        elem.style['mix-blend-mode'] = blendModeValue;
-    },
-    initBaseData: function(data, globalData, comp){
-        this.globalData = globalData;
-        this.comp = comp;
-        this.data = data;
-        this.layerId = createElementID();
-        
-        //Stretch factor for old animations missing this property.
-        if(!this.data.sr){
-            this.data.sr = 1;
-        }
-        // effects manager
-        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-        
-    },
-    getType: function(){
-        return this.type;
+  checkMasks: function () {
+    if (!this.data.hasMask) {
+      return false;
     }
-    ,sourceRectAtTime: function(){}
-}
-function NullElement(data,globalData,comp){
-    this.initFrame();
-	this.initBaseData(data, globalData, comp);
-    this.initFrame();
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
+    var i = 0;
+    var len = this.data.masksProperties.length;
+    while (i < len) {
+      if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+        return true;
+      }
+      i += 1;
+    }
+    return false;
+  },
+  initExpressions: function () {
+    this.layerInterface = LayerExpressionInterface(this);
+    if (this.data.hasMask && this.maskManager) {
+      this.layerInterface.registerMaskInterface(this.maskManager);
+    }
+    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
+    this.layerInterface.registerEffectsInterface(effectsInterface);
+
+    if (this.data.ty === 0 || this.data.xt) {
+      this.compInterface = CompExpressionInterface(this);
+    } else if (this.data.ty === 4) {
+      this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
+      this.layerInterface.content = this.layerInterface.shapeInterface;
+    } else if (this.data.ty === 5) {
+      this.layerInterface.textInterface = TextExpressionInterface(this);
+      this.layerInterface.text = this.layerInterface.textInterface;
+    }
+  },
+  setBlendMode: function () {
+    var blendModeValue = getBlendMode(this.data.bm);
+    var elem = this.baseElement || this.layerElement;
+
+    elem.style['mix-blend-mode'] = blendModeValue;
+  },
+  initBaseData: function (data, globalData, comp) {
+    this.globalData = globalData;
+    this.comp = comp;
+    this.data = data;
+    this.layerId = createElementID();
+
+    // Stretch factor for old animations missing this property.
+    if (!this.data.sr) {
+      this.data.sr = 1;
+    }
+    // effects manager
+    this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
+  },
+  getType: function () {
+    return this.type;
+  },
+  sourceRectAtTime: function () {},
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement */
+
+function NullElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initFrame();
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
 }
 
-NullElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
+NullElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-NullElement.prototype.renderFrame = function() {
+NullElement.prototype.renderFrame = function () {
 };
 
-NullElement.prototype.getBaseElement = function() {
-	return null;
+NullElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-NullElement.prototype.destroy = function() {
+NullElement.prototype.destroy = function () {
 };
 
-NullElement.prototype.sourceRectAtTime = function() {
+NullElement.prototype.sourceRectAtTime = function () {
 };
 
-NullElement.prototype.hide = function() {
+NullElement.prototype.hide = function () {
 };
 
-extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
 
-function SVGBaseElement(){
+/* global filtersFactory, featureSupport, filtersFactory, createElementID, createNS, MaskElement, SVGEffects, locationHref */
+
+function SVGBaseElement() {
 }
 
 SVGBaseElement.prototype = {
-    initRendererElement: function() {
-        this.layerElement = createNS('g');
-    },
-    createContainerElements: function(){
-        this.matteElement = createNS('g');
-        this.transformedElement = this.layerElement;
-        this.maskedElement = this.layerElement;
-        this._sizeChanged = false;
-        var layerElementParent = null;
-        //If this layer acts as a mask for the following layer
-        var filId, fil, gg;
-        if (this.data.td) {
-            if (this.data.td == 3 || this.data.td == 1) {
-                var masker = createNS('mask');
-                masker.setAttribute('id', this.layerId);
-                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
-                masker.appendChild(this.layerElement);
-                layerElementParent = masker;
-                this.globalData.defs.appendChild(masker);
-                // This is only for IE and Edge when mask if of type alpha
-                if (!featureSupport.maskType && this.data.td == 1) {
-                    masker.setAttribute('mask-type', 'luminance');
-                    filId = createElementID();
-                    fil = filtersFactory.createFilter(filId);
-                    this.globalData.defs.appendChild(fil);
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    masker.appendChild(gg);
-                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
-                }
-            } else if(this.data.td == 2) {
-                var maskGroup = createNS('mask');
-                maskGroup.setAttribute('id', this.layerId);
-                maskGroup.setAttribute('mask-type','alpha');
-                var maskGrouper = createNS('g');
-                maskGroup.appendChild(maskGrouper);
-                filId = createElementID();
-                fil = filtersFactory.createFilter(filId);
-                ////
+  initRendererElement: function () {
+    this.layerElement = createNS('g');
+  },
+  createContainerElements: function () {
+    this.matteElement = createNS('g');
+    this.transformedElement = this.layerElement;
+    this.maskedElement = this.layerElement;
+    this._sizeChanged = false;
+    var layerElementParent = null;
+    // If this layer acts as a mask for the following layer
+    var filId;
+    var fil;
+    var gg;
+    if (this.data.td) {
+      if (this.data.td == 3 || this.data.td == 1) { // eslint-disable-line eqeqeq
+        var masker = createNS('mask');
+        masker.setAttribute('id', this.layerId);
+        masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha'); // eslint-disable-line eqeqeq
+        masker.appendChild(this.layerElement);
+        layerElementParent = masker;
+        this.globalData.defs.appendChild(masker);
+        // This is only for IE and Edge when mask if of type alpha
+        if (!featureSupport.maskType && this.data.td == 1) { // eslint-disable-line eqeqeq
+          masker.setAttribute('mask-type', 'luminance');
+          filId = createElementID();
+          fil = filtersFactory.createFilter(filId);
+          this.globalData.defs.appendChild(fil);
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          masker.appendChild(gg);
+          gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        }
+      } else if (this.data.td == 2) { // eslint-disable-line eqeqeq
+        var maskGroup = createNS('mask');
+        maskGroup.setAttribute('id', this.layerId);
+        maskGroup.setAttribute('mask-type', 'alpha');
+        var maskGrouper = createNS('g');
+        maskGroup.appendChild(maskGrouper);
+        filId = createElementID();
+        fil = filtersFactory.createFilter(filId);
+        /// /
 
-                // This solution doesn't work on Android when meta tag with viewport attribute is set
-                /*var feColorMatrix = createNS('feColorMatrix');
+        // This solution doesn't work on Android when meta tag with viewport attribute is set
+        /* var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type', 'matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
                 feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-                fil.appendChild(feColorMatrix);*/
-                ////
-                var feCTr = createNS('feComponentTransfer');
-                feCTr.setAttribute('in','SourceGraphic');
-                fil.appendChild(feCTr);
-                var feFunc = createNS('feFuncA');
-                feFunc.setAttribute('type','table');
-                feFunc.setAttribute('tableValues','1.0 0.0');
-                feCTr.appendChild(feFunc);
-                ////
-                this.globalData.defs.appendChild(fil);
-                var alphaRect = createNS('rect');
-                alphaRect.setAttribute('width',  this.comp.data.w);
-                alphaRect.setAttribute('height', this.comp.data.h);
-                alphaRect.setAttribute('x','0');
-                alphaRect.setAttribute('y','0');
-                alphaRect.setAttribute('fill','#ffffff');
-                alphaRect.setAttribute('opacity','0');
-                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
-                maskGrouper.appendChild(alphaRect);
-                maskGrouper.appendChild(this.layerElement);
-                layerElementParent = maskGrouper;
-                if (!featureSupport.maskType) {
-                    maskGroup.setAttribute('mask-type', 'luminance');
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    maskGrouper.appendChild(alphaRect);
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    maskGrouper.appendChild(gg);
-                }
-                this.globalData.defs.appendChild(maskGroup);
-            }
-        } else if (this.data.tt) {
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        } else {
-            this.baseElement = this.layerElement;
+                fil.appendChild(feColorMatrix); */
+        /// /
+        var feCTr = createNS('feComponentTransfer');
+        feCTr.setAttribute('in', 'SourceGraphic');
+        fil.appendChild(feCTr);
+        var feFunc = createNS('feFuncA');
+        feFunc.setAttribute('type', 'table');
+        feFunc.setAttribute('tableValues', '1.0 0.0');
+        feCTr.appendChild(feFunc);
+        /// /
+        this.globalData.defs.appendChild(fil);
+        var alphaRect = createNS('rect');
+        alphaRect.setAttribute('width', this.comp.data.w);
+        alphaRect.setAttribute('height', this.comp.data.h);
+        alphaRect.setAttribute('x', '0');
+        alphaRect.setAttribute('y', '0');
+        alphaRect.setAttribute('fill', '#ffffff');
+        alphaRect.setAttribute('opacity', '0');
+        maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        maskGrouper.appendChild(alphaRect);
+        maskGrouper.appendChild(this.layerElement);
+        layerElementParent = maskGrouper;
+        if (!featureSupport.maskType) {
+          maskGroup.setAttribute('mask-type', 'luminance');
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          maskGrouper.appendChild(alphaRect);
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          maskGrouper.appendChild(gg);
         }
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id', this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
-        if (this.data.ty === 0 && !this.data.hd) {
-            var cp = createNS( 'clipPath');
-            var pt = createNS('path');
-            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
-            var clipId = createElementID();
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-
-            if (this.checkMasks()) {
-                var cpGroup = createNS('g');
-                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
-                cpGroup.appendChild(this.layerElement);
-                this.transformedElement = cpGroup;
-                if (layerElementParent) {
-                    layerElementParent.appendChild(this.transformedElement);
-                } else {
-                    this.baseElement = this.transformedElement;
-                }
-            } else {
-                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
-            }
-            
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-
-    },
-    renderElement: function() {
-        if (this.finalTransform._matMdf) {
-            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
-        }
-        if (this.finalTransform._opMdf) {
-            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
-        }
-    },
-    destroyBaseElement: function() {
-        this.layerElement = null;
-        this.matteElement = null;
-        this.maskManager.destroy();
-    },
-    getBaseElement: function() {
-        if (this.data.hd) {
-            return null;
-        }
-        return this.baseElement;
-    },
-    createRenderableComponents: function() {
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-        this.renderableEffectsManager = new SVGEffects(this);
-    },
-    setMatte: function(id) {
-        if (!this.matteElement) {
-            return;
-        }
-        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
+        this.globalData.defs.appendChild(maskGroup);
+      }
+    } else if (this.data.tt) {
+      this.matteElement.appendChild(this.layerElement);
+      layerElementParent = this.matteElement;
+      this.baseElement = this.matteElement;
+    } else {
+      this.baseElement = this.layerElement;
     }
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+    if (this.data.ty === 0 && !this.data.hd) {
+      var cp = createNS('clipPath');
+      var pt = createNS('path');
+      pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+      var clipId = createElementID();
+      cp.setAttribute('id', clipId);
+      cp.appendChild(pt);
+      this.globalData.defs.appendChild(cp);
+
+      if (this.checkMasks()) {
+        var cpGroup = createNS('g');
+        cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+        cpGroup.appendChild(this.layerElement);
+        this.transformedElement = cpGroup;
+        if (layerElementParent) {
+          layerElementParent.appendChild(this.transformedElement);
+        } else {
+          this.baseElement = this.transformedElement;
+        }
+      } else {
+        this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+      }
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    if (this.finalTransform._matMdf) {
+      this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+    }
+    if (this.finalTransform._opMdf) {
+      this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+    }
+  },
+  destroyBaseElement: function () {
+    this.layerElement = null;
+    this.matteElement = null;
+    this.maskManager.destroy();
+  },
+  getBaseElement: function () {
+    if (this.data.hd) {
+      return null;
+    }
+    return this.baseElement;
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+    this.renderableEffectsManager = new SVGEffects(this);
+  },
+  setMatte: function (id) {
+    if (!this.matteElement) {
+      return;
+    }
+    this.matteElement.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+  },
 };
-function IShapeElement(){
+
+/* global ProcessedElement */
+
+function IShapeElement() {
 }
 
 IShapeElement.prototype = {
-    addShapeToModifiers: function(data) {
-        var i, len = this.shapeModifiers.length;
-        for(i=0;i<len;i+=1){
-            this.shapeModifiers[i].addShape(data);
-        }
-    },
-    isShapeInAnimatedModifiers: function(data) {
-        var i = 0, len = this.shapeModifiers.length;
-        while(i < len) {
-            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
-                return true;
-            }
-        }
-        return false;
-    },
-    renderModifiers: function() {
-        if(!this.shapeModifiers.length){
-            return;
-        }
-        var i, len = this.shapes.length;
-        for(i=0;i<len;i+=1){
-            this.shapes[i].sh.reset();
-        }
-
-        len = this.shapeModifiers.length;
-        for(i=len-1;i>=0;i-=1){
-            this.shapeModifiers[i].processShapes(this._isFirstFrame);
-        }
-    },
-    lcEnum: {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'square'
-    },
-    ljEnum: {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    },
-    searchProcessedElement: function(elem){
-        var elements = this.processedElements;
-        var i = 0, len = elements.length;
-        while (i < len) {
-            if (elements[i].elem === elem) {
-                return elements[i].pos;
-            }
-            i += 1;
-        }
-        return 0;
-    },
-    addProcessedElement: function(elem, pos){
-        var elements = this.processedElements;
-        var i = elements.length;
-        while(i) {
-            i -= 1;
-            if (elements[i].elem === elem) {
-                elements[i].pos = pos;
-                return;
-            }
-        }
-        elements.push(new ProcessedElement(elem, pos));
-    },
-    prepareFrame: function(num) {
-        this.prepareRenderableFrame(num);
-        this.prepareProperties(num, this.isInRange);
+  addShapeToModifiers: function (data) {
+    var i;
+    var len = this.shapeModifiers.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapeModifiers[i].addShape(data);
     }
-};
-function ITextElement(){
-}
+  },
+  isShapeInAnimatedModifiers: function (data) {
+    var i = 0;
+    var len = this.shapeModifiers.length;
+    while (i < len) {
+      if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  renderModifiers: function () {
+    if (!this.shapeModifiers.length) {
+      return;
+    }
+    var i;
+    var len = this.shapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].sh.reset();
+    }
 
-ITextElement.prototype.initElement = function(data,globalData,comp){
-    this.lettersChangedFlag = true;
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
-    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
-    this.initRenderable();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    this.createContent();
-    this.hide();
-    this.textAnimator.searchProperties(this.dynamicProperties);
-};
-
-ITextElement.prototype.prepareFrame = function(num) {
-    this._mdf = false;
+    len = this.shapeModifiers.length;
+    for (i = len - 1; i >= 0; i -= 1) {
+      this.shapeModifiers[i].processShapes(this._isFirstFrame);
+    }
+  },
+  lcEnum: {
+    1: 'butt',
+    2: 'round',
+    3: 'square',
+  },
+  ljEnum: {
+    1: 'miter',
+    2: 'round',
+    3: 'bevel',
+  },
+  searchProcessedElement: function (elem) {
+    var elements = this.processedElements;
+    var i = 0;
+    var len = elements.length;
+    while (i < len) {
+      if (elements[i].elem === elem) {
+        return elements[i].pos;
+      }
+      i += 1;
+    }
+    return 0;
+  },
+  addProcessedElement: function (elem, pos) {
+    var elements = this.processedElements;
+    var i = elements.length;
+    while (i) {
+      i -= 1;
+      if (elements[i].elem === elem) {
+        elements[i].pos = pos;
+        return;
+      }
+    }
+    elements.push(new ProcessedElement(elem, pos));
+  },
+  prepareFrame: function (num) {
     this.prepareRenderableFrame(num);
     this.prepareProperties(num, this.isInRange);
-    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
-        this.buildNewText();
-        this.textProperty._isFirstFrame = false;
-        this.textProperty._mdf = false;
-    }
+  },
 };
 
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        pathNodes = shapes[j].ks.k;
-        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
-    }
-    return shapeStr;
+/* global TextProperty, TextAnimatorProperty, buildShapeString, LetterProps */
+
+function ITextElement() {
+}
+
+ITextElement.prototype.initElement = function (data, globalData, comp) {
+  this.lettersChangedFlag = true;
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+  this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
+  this.initRenderable();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  this.createContent();
+  this.hide();
+  this.textAnimator.searchProperties(this.dynamicProperties);
 };
 
-ITextElement.prototype.updateDocumentData = function(newData, index) {
-    this.textProperty.updateDocumentData(newData, index);
+ITextElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
+    this.buildNewText();
+    this.textProperty._isFirstFrame = false;
+    this.textProperty._mdf = false;
+  }
 };
 
-ITextElement.prototype.canResizeFont = function(_canResize) {
-    this.textProperty.canResizeFont(_canResize);
+ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
+  var j;
+  var jLen = shapes.length;
+  var pathNodes;
+  var shapeStr = '';
+  for (j = 0; j < jLen; j += 1) {
+    pathNodes = shapes[j].ks.k;
+    shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
+  }
+  return shapeStr;
 };
 
-ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
-    this.textProperty.setMinimumFontSize(_fontSize);
+ITextElement.prototype.updateDocumentData = function (newData, index) {
+  this.textProperty.updateDocumentData(newData, index);
 };
 
-ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
-    if(documentData.ps){
-        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-    }
-    matrixHelper.translate(0,-documentData.ls,0);
-    switch(documentData.j){
-        case 1:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
-            break;
-        case 2:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
-            break;
-    }
-    matrixHelper.translate(xPos, yPos, 0);
+ITextElement.prototype.canResizeFont = function (_canResize) {
+  this.textProperty.canResizeFont(_canResize);
 };
 
+ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
+  this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-ITextElement.prototype.buildColor = function(colorData) {
-    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
+ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
+  if (documentData.ps) {
+    matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+  }
+  matrixHelper.translate(0, -documentData.ls, 0);
+  switch (documentData.j) {
+    case 1:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
+      break;
+    case 2:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
+      break;
+    default:
+      break;
+  }
+  matrixHelper.translate(xPos, yPos, 0);
+};
+
+ITextElement.prototype.buildColor = function (colorData) {
+  return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
 
-ITextElement.prototype.destroy = function(){
-    
+ITextElement.prototype.destroy = function () {
+
 };
-function ICompElement(){}
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement */
+
+function ICompElement() {}
 
 extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
 
-ICompElement.prototype.initElement = function(data,globalData,comp) {
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.initTransform(data, globalData, comp);
-    this.initRenderable();
-    this.initHierarchy();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-    this.hide();
+ICompElement.prototype.initElement = function (data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initTransform(data, globalData, comp);
+  this.initRenderable();
+  this.initHierarchy();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  if (this.data.xt || !globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+  this.hide();
 };
 
-/*ICompElement.prototype.hide = function(){
+/* ICompElement.prototype.hide = function(){
     if(!this.hidden){
         this.hideElement();
         var i,len = this.elements.length;
@@ -8120,1141 +8604,1206 @@
             }
         }
     }
-};*/
+}; */
 
-ICompElement.prototype.prepareFrame = function(num){
-    this._mdf = false;
-    this.prepareRenderableFrame(num);
-    this.prepareProperties(num, this.isInRange);
-    if(!this.isInRange && !this.data.xt){
-        return;
-    }
+ICompElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (!this.isInRange && !this.data.xt) {
+    return;
+  }
 
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    if (timeRemapped === this.data.op) {
+      timeRemapped = this.data.op - 1;
     }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
+    this.renderedFrame = timeRemapped;
+  } else {
+    this.renderedFrame = num / this.data.sr;
+  }
+  var i;
+  var len = this.elements.length;
+  if (!this.completeLayers) {
+    this.checkLayers(this.renderedFrame);
+  }
+  // This iteration needs to be backwards because of how expressions connect between each other
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+      if (this.elements[i]._mdf) {
+        this._mdf = true;
+      }
     }
-    //This iteration needs to be backwards because of how expressions connect between each other
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-            if(this.elements[i]._mdf) {
-                this._mdf = true;
-            }
-        }
-    }
+  }
 };
 
-ICompElement.prototype.renderInnerContent = function() {
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i += 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+ICompElement.prototype.renderInnerContent = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
+ICompElement.prototype.setElements = function (elems) {
+  this.elements = elems;
 };
 
-ICompElement.prototype.getElements = function(){
-    return this.elements;
+ICompElement.prototype.getElements = function () {
+  return this.elements;
 };
 
-ICompElement.prototype.destroyElements = function(){
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
+ICompElement.prototype.destroyElements = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
+  }
 };
 
-ICompElement.prototype.destroy = function(){
-    this.destroyElements();
-    this.destroyBaseElement();
+ICompElement.prototype.destroy = function () {
+  this.destroyElements();
+  this.destroyBaseElement();
 };
 
-function IImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
-    this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, createNS */
+
+function IImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
+  this.sourceRect = {
+    top: 0, left: 0, width: this.assetData.w, height: this.assetData.h,
+  };
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
 
-IImageElement.prototype.createContent = function(){
+IImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.innerElem = createNS('image');
+  this.innerElem.setAttribute('width', this.assetData.w + 'px');
+  this.innerElem.setAttribute('height', this.assetData.h + 'px');
+  this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
+  this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
 
-    this.innerElem = createNS('image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    
-    this.layerElement.appendChild(this.innerElem);
+  this.layerElement.appendChild(this.innerElem);
 };
 
-IImageElement.prototype.sourceRectAtTime = function() {
-	return this.sourceRect;
-}
-function ISolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
+IImageElement.prototype.sourceRectAtTime = function () {
+  return this.sourceRect;
+};
+
+/* global extendPrototype, IImageElement, createNS */
+
+function ISolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createContent = function(){
-
-    var rect = createNS('rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
+ISolidElement.prototype.createContent = function () {
+  var rect = createNS('rect');
+  /// /rect.style.width = this.data.sw;
+  /// /rect.style.height = this.data.sh;
+  /// /rect.style.fill = this.data.sc;
+  rect.setAttribute('width', this.data.sw);
+  rect.setAttribute('height', this.data.sh);
+  rect.setAttribute('fill', this.data.sc);
+  this.layerElement.appendChild(rect);
 };
-function AudioElement(data,globalData,comp){
-    this.initFrame();
-    this.initRenderable();
-    this.assetData = globalData.getAssetData(data.refId);
-	this.initBaseData(data, globalData, comp);
-	this._isPlaying = false;
-	this._canPlay = false;
-	var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.audio = this.globalData.audioController.createAudio(assetPath);
-    this._currentTime = 0;
-    this.globalData.audioController.addAudio(this);
-    this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate,this) : {_placeholder:true};
+
+/* global PropertyFactory, extendPrototype, RenderableElement, BaseElement, FrameElement */
+
+function AudioElement(data, globalData, comp) {
+  this.initFrame();
+  this.initRenderable();
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initBaseData(data, globalData, comp);
+  this._isPlaying = false;
+  this._canPlay = false;
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.audio = this.globalData.audioController.createAudio(assetPath);
+  this._currentTime = 0;
+  this.globalData.audioController.addAudio(this);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
-AudioElement.prototype.prepareFrame = function(num) {
-    this.prepareRenderableFrame(num, true);
-    this.prepareProperties(num, true);
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        this._currentTime = timeRemapped;
-    } else {
-        this._currentTime = num / this.data.sr;
+AudioElement.prototype.prepareFrame = function (num) {
+  this.prepareRenderableFrame(num, true);
+  this.prepareProperties(num, true);
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    this._currentTime = timeRemapped;
+  } else {
+    this._currentTime = num / this.data.sr;
+  }
+};
+
+extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
+
+AudioElement.prototype.renderFrame = function () {
+  if (this.isInRange && this._canPlay) {
+    if (!this._isPlaying) {
+      this.audio.play();
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
+      this._isPlaying = true;
+    } else if (!this.audio.playing()
+      || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
+    ) {
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
     }
+  }
 };
 
-extendPrototype([RenderableElement,BaseElement,FrameElement], AudioElement);
-
-AudioElement.prototype.renderFrame = function() {
-	if (this.isInRange && this._canPlay) {
-		if (!this._isPlaying) {
-			this.audio.play();
-			this.audio.seek(this._currentTime / this.globalData.frameRate);
-			this._isPlaying = true;
-		} else if (!this.audio.playing()
-			|| Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
-		) {
-			this.audio.seek(this._currentTime / this.globalData.frameRate)
-		}
-	}
+AudioElement.prototype.show = function () {
+  // this.audio.play()
 };
 
-AudioElement.prototype.show = function() {
-	// this.audio.play()
+AudioElement.prototype.hide = function () {
+  this.audio.pause();
+  this._isPlaying = false;
 };
 
-AudioElement.prototype.hide = function() {
-	this.audio.pause();
-	this._isPlaying = false;
+AudioElement.prototype.pause = function () {
+  this.audio.pause();
+  this._isPlaying = false;
+  this._canPlay = false;
 };
 
-AudioElement.prototype.pause = function() {
-	this.audio.pause();
-	this._isPlaying = false;
-	this._canPlay = false;
+AudioElement.prototype.resume = function () {
+  this._canPlay = true;
 };
 
-AudioElement.prototype.resume = function() {
-	this._canPlay = true;
+AudioElement.prototype.setRate = function (rateValue) {
+  this.audio.rate(rateValue);
 };
 
-AudioElement.prototype.setRate = function(rateValue) {
-	this.audio.rate(rateValue);
+AudioElement.prototype.volume = function (volumeValue) {
+  this.audio.volume(volumeValue);
 };
 
-AudioElement.prototype.volume = function(volumeValue) {
-	this.audio.volume(volumeValue);
+AudioElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-AudioElement.prototype.getBaseElement = function() {
-	return null;
+AudioElement.prototype.destroy = function () {
 };
 
-AudioElement.prototype.destroy = function() {
+AudioElement.prototype.sourceRectAtTime = function () {
 };
 
-AudioElement.prototype.sourceRectAtTime = function() {
+AudioElement.prototype.initExpressions = function () {
 };
 
-AudioElement.prototype.initExpressions = function() {
-};
+/* global createSizedArray, PropertyFactory, extendPrototype, SVGRenderer, ICompElement, SVGBaseElement */
 
-
-function SVGCompElement(data,globalData,comp){
-    this.layers = data.layers;
-    this.supports3d = true;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
-    //this.layerElement = createNS('g');
-    this.initElement(data,globalData,comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+function SVGCompElement(data, globalData, comp) {
+  this.layers = data.layers;
+  this.supports3d = true;
+  this.completeLayers = false;
+  this.pendingElements = [];
+  this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+  // this.layerElement = createNS('g');
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement);
-function SVGTextElement(data,globalData,comp){
-    this.textSpans = [];
-    this.renderType = 'svg';
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, ITextElement, createSizedArray, createNS */
+
+function SVGTextLottieElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.renderType = 'svg';
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], SVGTextElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement);
 
-SVGTextElement.prototype.createContent = function(){
-
-    if (this.data.singleShape && !this.globalData.fontManager.chars) {
-        this.textContainer = createNS('text');
-    }
+SVGTextLottieElement.prototype.createContent = function () {
+  if (this.data.singleShape && !this.globalData.fontManager.chars) {
+    this.textContainer = createNS('text');
+  }
 };
 
-SVGTextElement.prototype.buildTextContents = function(textArray) {
-    var i = 0, len = textArray.length;
-    var textContents = [], currentTextContent = '';
-    while (i < len) {
-        if(textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
-            textContents.push(currentTextContent);
-            currentTextContent = '';
+SVGTextLottieElement.prototype.buildTextContents = function (textArray) {
+  var i = 0;
+  var len = textArray.length;
+  var textContents = [];
+  var currentTextContent = '';
+  while (i < len) {
+    if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
+      textContents.push(currentTextContent);
+      currentTextContent = '';
+    } else {
+      currentTextContent += textArray[i];
+    }
+    i += 1;
+  }
+  textContents.push(currentTextContent);
+  return textContents;
+};
+
+SVGTextLottieElement.prototype.buildNewText = function () {
+  var i;
+  var len;
+
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
+  if (documentData.fc) {
+    this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
+  } else {
+    this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
+  }
+  if (documentData.sc) {
+    this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
+    this.layerElement.setAttribute('stroke-width', documentData.sw);
+  }
+  this.layerElement.setAttribute('font-size', documentData.finalSize);
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  if (fontData.fClass) {
+    this.layerElement.setAttribute('class', fontData.fClass);
+  } else {
+    this.layerElement.setAttribute('font-family', fontData.fFamily);
+    var fWeight = documentData.fWeight;
+    var fStyle = documentData.fStyle;
+    this.layerElement.setAttribute('font-style', fStyle);
+    this.layerElement.setAttribute('font-weight', fWeight);
+  }
+  this.layerElement.setAttribute('aria-label', documentData.t);
+
+  var letters = documentData.l || [];
+  var usesGlyphs = !!this.globalData.fontManager.chars;
+  len = letters.length;
+
+  var tSpan;
+  var matrixHelper = this.mHelper;
+  var shapes;
+  var shapeStr = '';
+  var singleShape = this.data.singleShape;
+  var xPos = 0;
+  var yPos = 0;
+  var firstLine = true;
+  var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
+  if (singleShape && !usesGlyphs && !documentData.sz) {
+    var tElement = this.textContainer;
+    var justify = 'start';
+    switch (documentData.j) {
+      case 1:
+        justify = 'end';
+        break;
+      case 2:
+        justify = 'middle';
+        break;
+      default:
+        justify = 'start';
+        break;
+    }
+    tElement.setAttribute('text-anchor', justify);
+    tElement.setAttribute('letter-spacing', trackingOffset);
+    var textContent = this.buildTextContents(documentData.finalText);
+    len = textContent.length;
+    yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
+    for (i = 0; i < len; i += 1) {
+      tSpan = this.textSpans[i] || createNS('tspan');
+      tSpan.textContent = textContent[i];
+      tSpan.setAttribute('x', 0);
+      tSpan.setAttribute('y', yPos);
+      tSpan.style.display = 'inherit';
+      tElement.appendChild(tSpan);
+      this.textSpans[i] = tSpan;
+      yPos += documentData.finalLineHeight;
+    }
+
+    this.layerElement.appendChild(tElement);
+  } else {
+    var cachedSpansLength = this.textSpans.length;
+    var shapeData;
+    var charData;
+    for (i = 0; i < len; i += 1) {
+      if (!usesGlyphs || !singleShape || i === 0) {
+        tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs ? 'path' : 'text');
+        if (cachedSpansLength <= i) {
+          tSpan.setAttribute('stroke-linecap', 'butt');
+          tSpan.setAttribute('stroke-linejoin', 'round');
+          tSpan.setAttribute('stroke-miterlimit', '4');
+          this.textSpans[i] = tSpan;
+          this.layerElement.appendChild(tSpan);
+        }
+        tSpan.style.display = 'inherit';
+      }
+
+      matrixHelper.reset();
+      matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+      if (singleShape) {
+        if (letters[i].n) {
+          xPos = -trackingOffset;
+          yPos += documentData.yOffset;
+          yPos += firstLine ? 1 : 0;
+          firstLine = false;
+        }
+        this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
+        xPos += letters[i].l || 0;
+        // xPos += letters[i].val === ' ' ? 0 : trackingOffset;
+        xPos += trackingOffset;
+      }
+      if (usesGlyphs) {
+        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+        shapeData = (charData && charData.data) || {};
+        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+        if (!singleShape) {
+          tSpan.setAttribute('d', this.createPathShape(matrixHelper, shapes));
         } else {
-            currentTextContent += textArray[i];
+          shapeStr += this.createPathShape(matrixHelper, shapes);
         }
-        i += 1;
+      } else {
+        if (singleShape) {
+          tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')');
+        }
+        tSpan.textContent = letters[i].val;
+        tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
+      }
+      //
     }
-    textContents.push(currentTextContent);
-    return textContents;
+    if (singleShape && tSpan) {
+      tSpan.setAttribute('d', shapeStr);
+    }
+  }
+  while (i < this.textSpans.length) {
+    this.textSpans[i].style.display = 'none';
+    i += 1;
+  }
+
+  this._sizeChanged = true;
+};
+
+SVGTextLottieElement.prototype.sourceRectAtTime = function () {
+  this.prepareFrame(this.comp.renderedFrame - this.data.st);
+  this.renderInnerContent();
+  if (this._sizeChanged) {
+    this._sizeChanged = false;
+    var textBox = this.layerElement.getBBox();
+    this.bbox = {
+      top: textBox.y,
+      left: textBox.x,
+      width: textBox.width,
+      height: textBox.height,
+    };
+  }
+  return this.bbox;
+};
+
+SVGTextLottieElement.prototype.renderInnerContent = function () {
+  if (!this.data.singleShape) {
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+    if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
+      this._sizeChanged = true;
+      var i;
+      var len;
+      var renderedLetters = this.textAnimator.renderedLetters;
+
+      var letters = this.textProperty.currentData.l;
+
+      len = letters.length;
+      var renderedLetter;
+      var textSpan;
+      for (i = 0; i < len; i += 1) {
+        if (!letters[i].n) {
+          renderedLetter = renderedLetters[i];
+          textSpan = this.textSpans[i];
+          if (renderedLetter._mdf.m) {
+            textSpan.setAttribute('transform', renderedLetter.m);
+          }
+          if (renderedLetter._mdf.o) {
+            textSpan.setAttribute('opacity', renderedLetter.o);
+          }
+          if (renderedLetter._mdf.sw) {
+            textSpan.setAttribute('stroke-width', renderedLetter.sw);
+          }
+          if (renderedLetter._mdf.sc) {
+            textSpan.setAttribute('stroke', renderedLetter.sc);
+          }
+          if (renderedLetter._mdf.fc) {
+            textSpan.setAttribute('fill', renderedLetter.fc);
+          }
+        }
+      }
+    }
+  }
+};
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement,
+FrameElement, RenderableDOMElement, Matrix, SVGStyleData, SVGStrokeStyleData, SVGFillStyleData,
+SVGGradientFillStyleData, SVGGradientStrokeStyleData, locationHref, getBlendMode, ShapeGroupData,
+TransformPropertyFactory, SVGTransformData, ShapePropertyFactory, SVGShapeData, SVGElementsRenderer, ShapeModifiers */
+
+function SVGShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
 }
 
-SVGTextElement.prototype.buildNewText = function(){
-    var i, len;
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
 
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
-    if(documentData.fc) {
-        this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
-    }else{
-        this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
-    }
-    if(documentData.sc){
-        this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
-        this.layerElement.setAttribute('stroke-width', documentData.sw);
-    }
-    this.layerElement.setAttribute('font-size', documentData.finalSize);
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(fontData.fClass){
-        this.layerElement.setAttribute('class',fontData.fClass);
-    } else {
-        this.layerElement.setAttribute('font-family', fontData.fFamily);
-        var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-        this.layerElement.setAttribute('font-style', fStyle);
-        this.layerElement.setAttribute('font-weight', fWeight);
-    }
-    this.layerElement.setAttribute('aria-label', documentData.t);
-
-    var letters = documentData.l || [];
-    var usesGlyphs = !!this.globalData.fontManager.chars;
-    len = letters.length;
-
-    var tSpan;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '', singleShape = this.data.singleShape;
-    var xPos = 0, yPos = 0, firstLine = true;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    if(singleShape && !usesGlyphs && !documentData.sz) {
-        var tElement = this.textContainer;
-        var justify = 'start';
-        switch(documentData.j) {
-            case 1:
-                justify = 'end';
-                break;
-            case 2:
-                justify = 'middle';
-                break;
-        }
-        tElement.setAttribute('text-anchor',justify);
-        tElement.setAttribute('letter-spacing',trackingOffset);
-        var textContent = this.buildTextContents(documentData.finalText);
-        len = textContent.length;
-        yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
-        for ( i = 0; i < len; i += 1) {
-            tSpan = this.textSpans[i] || createNS('tspan');
-            tSpan.textContent = textContent[i];
-            tSpan.setAttribute('x', 0);
-            tSpan.setAttribute('y', yPos);
-            tSpan.style.display = 'inherit';
-            tElement.appendChild(tSpan);
-            this.textSpans[i] = tSpan;
-            yPos += documentData.finalLineHeight;
-        }
-        
-        this.layerElement.appendChild(tElement);
-    } else {
-        var cachedSpansLength = this.textSpans.length;
-        var shapeData, charData;
-        for (i = 0; i < len; i += 1) {
-            if(!usesGlyphs || !singleShape || i === 0){
-                tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs?'path':'text');
-                if (cachedSpansLength <= i) {
-                    tSpan.setAttribute('stroke-linecap', 'butt');
-                    tSpan.setAttribute('stroke-linejoin','round');
-                    tSpan.setAttribute('stroke-miterlimit','4');
-                    this.textSpans[i] = tSpan;
-                    this.layerElement.appendChild(tSpan);
-                }
-                tSpan.style.display = 'inherit';
-            }
-            
-            matrixHelper.reset();
-            matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
-            if (singleShape) {
-                if(letters[i].n) {
-                    xPos = -trackingOffset;
-                    yPos += documentData.yOffset;
-                    yPos += firstLine ? 1 : 0;
-                    firstLine = false;
-                }
-                this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
-                xPos += letters[i].l || 0;
-                //xPos += letters[i].val === ' ' ? 0 : trackingOffset;
-                xPos += trackingOffset;
-            }
-            if(usesGlyphs) {
-                charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-                shapeData = charData && charData.data || {};
-                shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
-                if(!singleShape){
-                    tSpan.setAttribute('d',this.createPathShape(matrixHelper,shapes));
-                } else {
-                    shapeStr += this.createPathShape(matrixHelper,shapes);
-                }
-            } else {
-                if(singleShape) {
-                    tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")");
-                }
-                tSpan.textContent = letters[i].val;
-                tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            }
-            //
-        }
-        if (singleShape && tSpan) {
-            tSpan.setAttribute('d',shapeStr);
-        }
-    }
-    while (i < this.textSpans.length){
-        this.textSpans[i].style.display = 'none';
-        i += 1;
-    }
-    
-    this._sizeChanged = true;
-};
-
-SVGTextElement.prototype.sourceRectAtTime = function(time){
-    this.prepareFrame(this.comp.renderedFrame - this.data.st);
-    this.renderInnerContent();
-    if(this._sizeChanged){
-        this._sizeChanged = false;
-        var textBox = this.layerElement.getBBox();
-        this.bbox = {
-            top: textBox.y,
-            left: textBox.x,
-            width: textBox.width,
-            height: textBox.height
-        };
-    }
-    return this.bbox;
-};
-
-SVGTextElement.prototype.renderInnerContent = function(){
-
-    if(!this.data.singleShape){
-        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
-        if(this.lettersChangedFlag || this.textAnimator.lettersChangedFlag){
-            this._sizeChanged = true;
-            var  i,len;
-            var renderedLetters = this.textAnimator.renderedLetters;
-
-            var letters = this.textProperty.currentData.l;
-
-            len = letters.length;
-            var renderedLetter, textSpan;
-            for(i=0;i<len;i+=1){
-                if(letters[i].n){
-                    continue;
-                }
-                renderedLetter = renderedLetters[i];
-                textSpan = this.textSpans[i];
-                if(renderedLetter._mdf.m) {
-                    textSpan.setAttribute('transform',renderedLetter.m);
-                }
-                if(renderedLetter._mdf.o) {
-                    textSpan.setAttribute('opacity',renderedLetter.o);
-                }
-                if(renderedLetter._mdf.sw){
-                    textSpan.setAttribute('stroke-width',renderedLetter.sw);
-                }
-                if(renderedLetter._mdf.sc){
-                    textSpan.setAttribute('stroke',renderedLetter.sc);
-                }
-                if(renderedLetter._mdf.fc){
-                    textSpan.setAttribute('fill',renderedLetter.fc);
-                }
-            }
-        }
-    }
-};
-
-function SVGShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
-}
-
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
-
-SVGShapeElement.prototype.initSecondaryElement = function() {
+SVGShapeElement.prototype.initSecondaryElement = function () {
 };
 
 SVGShapeElement.prototype.identityMatrix = new Matrix();
 
-SVGShapeElement.prototype.buildExpressionInterface = function(){};
+SVGShapeElement.prototype.buildExpressionInterface = function () {};
 
-SVGShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
+SVGShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
 };
 
 /*
 This method searches for multiple shapes that affect a single element and one of them is animated
 */
-SVGShapeElement.prototype.filterUniqueShapes = function(){
-    var i, len = this.shapes.length, shape;
-    var j, jLen = this.stylesList.length;
-    var style, count = 0;
-    var tempShapes = [];
-    var areAnimated = false;
-    for(j = 0; j < jLen; j += 1) {
-        style = this.stylesList[j];
-        areAnimated = false;
-        tempShapes.length = 0;
-        for(i = 0; i < len; i += 1) {
-            shape = this.shapes[i];
-            if(shape.styles.indexOf(style) !== -1) {
-                tempShapes.push(shape);
-                areAnimated = shape._isAnimated || areAnimated;
-            }
-        }
-        if(tempShapes.length > 1 && areAnimated) {
-            this.setShapesAsAnimated(tempShapes);
-        }
-    }
-}
-
-SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
-    var i, len = shapes.length;
-    for(i = 0; i < len; i += 1) {
-        shapes[i].setAsAnimated();
-    }
-}
-
-SVGShapeElement.prototype.createStyleElement = function(data, level){
-    //TODO: prevent drawing of hidden styles
-    var elementData;
-    var styleOb = new SVGStyleData(data, level);
-
-    var pathElement = styleOb.pElem;
-    if(data.ty === 'st') {
-        elementData = new SVGStrokeStyleData(this, data, styleOb);
-    } else if(data.ty === 'fl') {
-        elementData = new SVGFillStyleData(this, data, styleOb);
-    } else if(data.ty === 'gf' || data.ty === 'gs') {
-        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
-        elementData = new gradientConstructor(this, data, styleOb);
-        this.globalData.defs.appendChild(elementData.gf);
-        if (elementData.maskId) {
-            this.globalData.defs.appendChild(elementData.ms);
-            this.globalData.defs.appendChild(elementData.of);
-            pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
-        }
-    }
-    
-    if(data.ty === 'st' || data.ty === 'gs') {
-        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
-        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
-        pathElement.setAttribute('fill-opacity','0');
-        if(data.lj === 1) {
-            pathElement.setAttribute('stroke-miterlimit',data.ml);
-        }
-    }
-
-    if(data.r === 2) {
-        pathElement.setAttribute('fill-rule', 'evenodd');
-    }
-
-    if(data.ln){
-        pathElement.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        pathElement.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    this.stylesList.push(styleOb);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = new ShapeGroupData();
-    if(data.ln){
-        elementData.gr.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        elementData.gr.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    return elementData;
-};
-
-SVGShapeElement.prototype.createTransformElement = function(data, container) {
-    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
-    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
-    var ty = 4;
-    if(data.ty === 'rc'){
-        ty = 5;
-    }else if(data.ty === 'el'){
-        ty = 6;
-    }else if(data.ty === 'sr'){
-        ty = 7;
-    }
-    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
-    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
-    var i = 0, len = this.animatedContents.length;
-    while(i < len) {
-        if(this.animatedContents[i].element === element) {
-            return;
-        }
-        i += 1;
-    }
-    this.animatedContents.push({
-        fn: SVGElementsRenderer.createRenderFunction(data),
-        element: element,
-        data: data
-    });
-};
-
-SVGShapeElement.prototype.setElementStyles = function(elementData){
-    var arr = elementData.styles;
-    var j, jLen = this.stylesList.length;
-    for (j = 0; j < jLen; j += 1) {
-        if (!this.stylesList[j].closed) {
-            arr.push(this.stylesList[j]);
-        }
-    }
-};
-
-SVGShapeElement.prototype.reloadShapes = function(){
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for( i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
-    len = this.dynamicProperties.length;
-    for(i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-};
-
-SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._render = render;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], level);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].style.pElem);
-            }
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].gr);
-            }
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                itemsData[i] = this.createTransformElement(arr[i], container);
-            }
-            currentTransform = itemsData[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
-            }
-            this.setElementStyles(itemsData[i]);
-
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        }else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                render = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    len = ownStyles.length;
-    for(i=0;i<len;i+=1){
-        ownStyles[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-SVGShapeElement.prototype.renderInnerContent = function() {
-    this.renderModifiers();
-    var i, len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        this.stylesList[i].reset();
-    }
-    this.renderShape();
-
+SVGShapeElement.prototype.filterUniqueShapes = function () {
+  var i;
+  var len = this.shapes.length;
+  var shape;
+  var j;
+  var jLen = this.stylesList.length;
+  var style;
+  var tempShapes = [];
+  var areAnimated = false;
+  for (j = 0; j < jLen; j += 1) {
+    style = this.stylesList[j];
+    areAnimated = false;
+    tempShapes.length = 0;
     for (i = 0; i < len; i += 1) {
-        if (this.stylesList[i]._mdf || this._isFirstFrame) {
-            if(this.stylesList[i].msElem){
-                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                //Adding M0 0 fixes same mask bug on all browsers
-                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
-            }
-            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
-        }
+      shape = this.shapes[i];
+      if (shape.styles.indexOf(style) !== -1) {
+        tempShapes.push(shape);
+        areAnimated = shape._isAnimated || areAnimated;
+      }
     }
+    if (tempShapes.length > 1 && areAnimated) {
+      this.setShapesAsAnimated(tempShapes);
+    }
+  }
 };
 
-SVGShapeElement.prototype.renderShape = function() {
-    var i, len = this.animatedContents.length;
-    var animatedContent;
-    for(i = 0; i < len; i += 1) {
-        animatedContent = this.animatedContents[i];
-        if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
-            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
-        }
-    }
-}
-
-SVGShapeElement.prototype.destroy = function(){
-    this.destroyBaseElement();
-    this.shapesData = null;
-    this.itemsData = null;
+SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
+  var i;
+  var len = shapes.length;
+  for (i = 0; i < len; i += 1) {
+    shapes[i].setAsAnimated();
+  }
 };
 
-function SVGTintFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    feColorMatrix.setAttribute('result','f2');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-    if(filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k){
-        var feMerge = createNS('feMerge');
-        filter.appendChild(feMerge);
-        var feMergeNode;
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','SourceGraphic');
-        feMerge.appendChild(feMergeNode);
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','f2');
-        feMerge.appendChild(feMergeNode);
-    }
-}
+SVGShapeElement.prototype.createStyleElement = function (data, level) {
+  // TODO: prevent drawing of hidden styles
+  var elementData;
+  var styleOb = new SVGStyleData(data, level);
 
-SVGTintFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var colorBlack = this.filterManager.effectElements[0].p.v;
-        var colorWhite = this.filterManager.effectElements[1].p.v;
-        var opacity = this.filterManager.effectElements[2].p.v/100;
-        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 ' + opacity + ' 0');
+  var pathElement = styleOb.pElem;
+  if (data.ty === 'st') {
+    elementData = new SVGStrokeStyleData(this, data, styleOb);
+  } else if (data.ty === 'fl') {
+    elementData = new SVGFillStyleData(this, data, styleOb);
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+    elementData = new GradientConstructor(this, data, styleOb);
+    this.globalData.defs.appendChild(elementData.gf);
+    if (elementData.maskId) {
+      this.globalData.defs.appendChild(elementData.ms);
+      this.globalData.defs.appendChild(elementData.of);
+      pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
     }
+  }
+
+  if (data.ty === 'st' || data.ty === 'gs') {
+    pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+    pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
+    pathElement.setAttribute('fill-opacity', '0');
+    if (data.lj === 1) {
+      pathElement.setAttribute('stroke-miterlimit', data.ml);
+    }
+  }
+
+  if (data.r === 2) {
+    pathElement.setAttribute('fill-rule', 'evenodd');
+  }
+
+  if (data.ln) {
+    pathElement.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    pathElement.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  this.stylesList.push(styleOb);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
 };
-function SVGFillFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-}
-SVGFillFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color = this.filterManager.effectElements[2].p.v;
-        var opacity = this.filterManager.effectElements[6].p.v;
-        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');
-    }
+
+SVGShapeElement.prototype.createGroupElement = function (data) {
+  var elementData = new ShapeGroupData();
+  if (data.ln) {
+    elementData.gr.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    elementData.gr.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  return elementData;
 };
-function SVGGaussianBlurEffect(filter, filterManager){
-    // Outset the filter region by 100% on all sides to accommodate blur expansion.
-    filter.setAttribute('x','-100%');
-    filter.setAttribute('y','-100%');
-    filter.setAttribute('width','300%');
-    filter.setAttribute('height','300%');
 
-    this.filterManager = filterManager;
-    var feGaussianBlur = createNS('feGaussianBlur');
-    filter.appendChild(feGaussianBlur);
-    this.feGaussianBlur = feGaussianBlur;
-}
+SVGShapeElement.prototype.createTransformElement = function (data, container) {
+  var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
+  var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-SVGGaussianBlurEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        // Empirical value, matching AE's blur appearance.
-        var kBlurrinessToSigma = 0.3;
-        var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
+  var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-        // Dimensions mapping:
-        //
-        //   1 -> horizontal & vertical
-        //   2 -> horizontal only
-        //   3 -> vertical only
-        //
-        var dimensions = this.filterManager.effectElements[1].p.v;
-        var sigmaX = (dimensions == 3) ? 0 : sigma;
-        var sigmaY = (dimensions == 2) ? 0 : sigma;
-
-        this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + " " + sigmaY);
-
-        // Repeat edges mapping:
-        //
-        //   0 -> off -> duplicate
-        //   1 -> on  -> wrap
-        var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate';
-        this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
+  var i = 0;
+  var len = this.animatedContents.length;
+  while (i < len) {
+    if (this.animatedContents[i].element === element) {
+      return;
     }
-}
-function SVGStrokeEffect(elem, filterManager){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.elem = elem;
-    this.paths = [];
-}
+    i += 1;
+  }
+  this.animatedContents.push({
+    fn: SVGElementsRenderer.createRenderFunction(data),
+    element: element,
+    data: data,
+  });
+};
 
-SVGStrokeEffect.prototype.initialize = function(){
+SVGShapeElement.prototype.setElementStyles = function (elementData) {
+  var arr = elementData.styles;
+  var j;
+  var jLen = this.stylesList.length;
+  for (j = 0; j < jLen; j += 1) {
+    if (!this.stylesList[j].closed) {
+      arr.push(this.stylesList[j]);
+    }
+  }
+};
 
-    var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-    var path,groupPath, i, len;
-    if(this.filterManager.effectElements[1].p.v === 1){
-        len = this.elem.maskManager.masksProperties.length;
-        i = 0;
+SVGShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
+  var ownTransformers = [].concat(transformers);
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var currentTransform;
+  var modifier;
+  var processedPos;
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._render = render;
     } else {
-        i = this.filterManager.effectElements[0].p.v - 1;
-        len = i + 1;
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    groupPath = createNS('g'); 
-    groupPath.setAttribute('fill','none');
-    groupPath.setAttribute('stroke-linecap','round');
-    groupPath.setAttribute('stroke-dashoffset',1);
-    for(i;i<len;i+=1){
-        path = createNS('path');
-        groupPath.appendChild(path);
-        this.paths.push({p:path,m:i});
-    }
-    if(this.filterManager.effectElements[10].p.v === 3){
-        var mask = createNS('mask');
-        var id = createElementID();
-        mask.setAttribute('id',id);
-        mask.setAttribute('mask-type','alpha');
-        mask.appendChild(groupPath);
-        this.elem.globalData.defs.appendChild(mask);
-        var g = createNS('g');
-        g.setAttribute('mask','url(' + locationHref + '#'+id+')');
-        while (elemChildren[0]) {
-            g.appendChild(elemChildren[0]);
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], level);
+      } else {
+        itemsData[i].style.closed = false;
+      }
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].style.pElem);
+      }
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
+        for (j = 0; j < jLen; j += 1) {
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        this.elem.layerElement.appendChild(g);
-        this.masker = mask;
-        groupPath.setAttribute('stroke','#fff');
-    } else if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(this.filterManager.effectElements[10].p.v === 2){
-            elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-            while(elemChildren.length){
-                this.elem.layerElement.removeChild(elemChildren[0]);
-            }
-        }
-        this.elem.layerElement.appendChild(groupPath);
-        this.elem.layerElement.removeAttribute('mask');
-        groupPath.setAttribute('stroke','#fff');
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].gr);
+      }
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        itemsData[i] = this.createTransformElement(arr[i], container);
+      }
+      currentTransform = itemsData[i].transform;
+      ownTransformers.push(currentTransform);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+      }
+      this.setElementStyles(itemsData[i]);
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        render = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-    this.initialized = true;
-    this.pathMasker = groupPath;
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  len = ownStyles.length;
+  for (i = 0; i < len; i += 1) {
+    ownStyles[i].closed = true;
+  }
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
 };
 
-SVGStrokeEffect.prototype.renderFrame = function(forceRender){
-    if(!this.initialized){
-        this.initialize();
-    }
-    var i, len = this.paths.length;
-    var mask, path;
-    for(i=0;i<len;i+=1){
-        if(this.paths[i].m === -1) {
-            continue;
-        }
-        mask = this.elem.maskManager.viewData[this.paths[i].m];
-        path = this.paths[i].p;
-        if(forceRender || this.filterManager._mdf || mask.prop._mdf){
-            path.setAttribute('d',mask.lastPath);
-        }
-        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){
-            var dasharrayValue;
-            if(this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100){
-                var s = Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var e = Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var l = path.getTotalLength();
-                dasharrayValue = '0 0 0 ' + l*s + ' ';
-                var lineLength = l*(e-s);
-                var segment = 1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-                var units = Math.floor(lineLength/segment);
-                var j;
-                for(j=0;j<units;j+=1){
-                    dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100 + ' ';
-                }
-                dasharrayValue += '0 ' + l*10 + ' 0 0';
-            } else {
-                dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-            }
-            path.setAttribute('stroke-dasharray',dasharrayValue);
-        }
-    }
-    if(forceRender || this.filterManager.effectElements[4].p._mdf){
-        this.pathMasker.setAttribute('stroke-width',this.filterManager.effectElements[4].p.v*2);
-    }
-    
-    if(forceRender || this.filterManager.effectElements[6].p._mdf){
-        this.pathMasker.setAttribute('opacity',this.filterManager.effectElements[6].p.v);
-    }
-    if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(forceRender || this.filterManager.effectElements[3].p._mdf){
-            var color = this.filterManager.effectElements[3].p.v;
-            this.pathMasker.setAttribute('stroke','rgb('+bm_floor(color[0]*255)+','+bm_floor(color[1]*255)+','+bm_floor(color[2]*255)+')');
-        }
-    }
-};
-function SVGTritoneFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    var feComponentTransfer = createNS('feComponentTransfer');
-    feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-    filter.appendChild(feComponentTransfer);
-    this.matrixFilter = feComponentTransfer;
-    var feFuncR = createNS('feFuncR');
-    feFuncR.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncR);
-    this.feFuncR = feFuncR;
-    var feFuncG = createNS('feFuncG');
-    feFuncG.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncG);
-    this.feFuncG = feFuncG;
-    var feFuncB = createNS('feFuncB');
-    feFuncB.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncB);
-    this.feFuncB = feFuncB;
-}
+SVGShapeElement.prototype.renderInnerContent = function () {
+  this.renderModifiers();
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    this.stylesList[i].reset();
+  }
+  this.renderShape();
 
-SVGTritoneFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color1 = this.filterManager.effectElements[0].p.v;
-        var color2 = this.filterManager.effectElements[1].p.v;
-        var color3 = this.filterManager.effectElements[2].p.v;
-        var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
-        var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
-        var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
-        this.feFuncR.setAttribute('tableValues', tableR);
-        this.feFuncG.setAttribute('tableValues', tableG);
-        this.feFuncB.setAttribute('tableValues', tableB);
-        //var opacity = this.filterManager.effectElements[2].p.v/100;
-        //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 ' + opacity + ' 0');
+  for (i = 0; i < len; i += 1) {
+    if (this.stylesList[i]._mdf || this._isFirstFrame) {
+      if (this.stylesList[i].msElem) {
+        this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+        // Adding M0 0 fixes same mask bug on all browsers
+        this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+      }
+      this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
     }
-};
-function SVGProLevelsFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var effectElements = this.filterManager.effectElements;
-    var feComponentTransfer = createNS('feComponentTransfer');
-    var feFuncR, feFuncG, feFuncB;
-    
-    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){
-        this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
-    }
-    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){
-        this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
-    }
-    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){
-        this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-    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){
-        this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
-    }
-    
-    if(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA){
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        feComponentTransfer = createNS('feComponentTransfer');
-    }
-
-    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){
-
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
-        this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
-        this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-}
-
-SVGProLevelsFilter.prototype.createFeFunc = function(type, feComponentTransfer) {
-    var feFunc = createNS(type);
-    feFunc.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFunc);
-    return feFunc;
+  }
 };
 
-SVGProLevelsFilter.prototype.getTableValue = function(inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
-    var cnt = 0;
-    var segments = 256;
-    var perc;
-    var min = Math.min(inputBlack, inputWhite);
-    var max = Math.max(inputBlack, inputWhite);
-    var table = Array.call(null,{length:segments});
-    var colorValue;
-    var pos = 0;
-    var outputDelta = outputWhite - outputBlack; 
-    var inputDelta = inputWhite - inputBlack; 
-    while(cnt <= 256) {
-        perc = cnt/256;
-        if(perc <= min){
-            colorValue = inputDelta < 0 ? outputWhite : outputBlack;
-        } else if(perc >= max){
-            colorValue = inputDelta < 0 ? outputBlack : outputWhite;
-        } else {
-            colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
-        }
-        table[pos++] = colorValue;
-        cnt += 256/(segments-1);
+SVGShapeElement.prototype.renderShape = function () {
+  var i;
+  var len = this.animatedContents.length;
+  var animatedContent;
+  for (i = 0; i < len; i += 1) {
+    animatedContent = this.animatedContents[i];
+    if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
+      animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
     }
-    return table.join(' ');
+  }
 };
 
-SVGProLevelsFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var val, cnt, perc, bezier;
-        var effectElements = this.filterManager.effectElements;
-        if(this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)){
-            val = this.getTableValue(effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v,effectElements[7].p.v);
-            this.feFuncRComposed.setAttribute('tableValues',val);
-            this.feFuncGComposed.setAttribute('tableValues',val);
-            this.feFuncBComposed.setAttribute('tableValues',val);
-        }
-
-
-        if(this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)){
-            val = this.getTableValue(effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v,effectElements[14].p.v);
-            this.feFuncR.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)){
-            val = this.getTableValue(effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v,effectElements[21].p.v);
-            this.feFuncG.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)){
-            val = this.getTableValue(effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v,effectElements[28].p.v);
-            this.feFuncB.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)){
-            val = this.getTableValue(effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v,effectElements[35].p.v);
-            this.feFuncA.setAttribute('tableValues',val);
-        }
-        
-    }
+SVGShapeElement.prototype.destroy = function () {
+  this.destroyBaseElement();
+  this.shapesData = null;
+  this.itemsData = null;
 };
-function SVGDropShadowEffect(filter, filterManager) {
-    var filterSize = filterManager.container.globalData.renderConfig.filterSize
-    filter.setAttribute('x', filterSize.x);
-    filter.setAttribute('y', filterSize.y);
-    filter.setAttribute('width', filterSize.width);
-    filter.setAttribute('height', filterSize.height);
-    this.filterManager = filterManager;
 
-    var feGaussianBlur = createNS('feGaussianBlur');
-    feGaussianBlur.setAttribute('in','SourceAlpha');
-    feGaussianBlur.setAttribute('result','drop_shadow_1');
-    feGaussianBlur.setAttribute('stdDeviation','0');
-    this.feGaussianBlur = feGaussianBlur;
-    filter.appendChild(feGaussianBlur);
+/* global createNS */
 
-    var feOffset = createNS('feOffset');
-    feOffset.setAttribute('dx','25');
-    feOffset.setAttribute('dy','0');
-    feOffset.setAttribute('in','drop_shadow_1');
-    feOffset.setAttribute('result','drop_shadow_2');
-    this.feOffset = feOffset;
-    filter.appendChild(feOffset);
-    var feFlood = createNS('feFlood');
-    feFlood.setAttribute('flood-color','#00ff00');
-    feFlood.setAttribute('flood-opacity','1');
-    feFlood.setAttribute('result','drop_shadow_3');
-    this.feFlood = feFlood;
-    filter.appendChild(feFlood);
-
-    var feComposite = createNS('feComposite');
-    feComposite.setAttribute('in','drop_shadow_3');
-    feComposite.setAttribute('in2','drop_shadow_2');
-    feComposite.setAttribute('operator','in');
-    feComposite.setAttribute('result','drop_shadow_4');
-    filter.appendChild(feComposite);
-
-
+function SVGTintFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  feColorMatrix.setAttribute('result', 'f2');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+  if (filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k) {
     var feMerge = createNS('feMerge');
     filter.appendChild(feMerge);
     var feMergeNode;
     feMergeNode = createNS('feMergeNode');
+    feMergeNode.setAttribute('in', 'SourceGraphic');
     feMerge.appendChild(feMergeNode);
     feMergeNode = createNS('feMergeNode');
-    feMergeNode.setAttribute('in','SourceGraphic');
-    this.feMergeNode = feMergeNode;
-    this.feMerge = feMerge;
-    this.originalNodeAdded = false;
+    feMergeNode.setAttribute('in', 'f2');
     feMerge.appendChild(feMergeNode);
+  }
 }
 
-SVGDropShadowEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        if(forceRender || this.filterManager.effectElements[4].p._mdf){
-            this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+SVGTintFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var colorBlack = this.filterManager.effectElements[0].p.v;
+    var colorWhite = this.filterManager.effectElements[1].p.v;
+    var opacity = this.filterManager.effectElements[2].p.v / 100;
+    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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGFillFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+}
+SVGFillFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color = this.filterManager.effectElements[2].p.v;
+    var opacity = this.filterManager.effectElements[6].p.v;
+    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');
+  }
+};
+
+/* global createNS */
+
+function SVGGaussianBlurEffect(filter, filterManager) {
+  // Outset the filter region by 100% on all sides to accommodate blur expansion.
+  filter.setAttribute('x', '-100%');
+  filter.setAttribute('y', '-100%');
+  filter.setAttribute('width', '300%');
+  filter.setAttribute('height', '300%');
+
+  this.filterManager = filterManager;
+  var feGaussianBlur = createNS('feGaussianBlur');
+  filter.appendChild(feGaussianBlur);
+  this.feGaussianBlur = feGaussianBlur;
+}
+
+SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    // Empirical value, matching AE's blur appearance.
+    var kBlurrinessToSigma = 0.3;
+    var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+
+    // Dimensions mapping:
+    //
+    //   1 -> horizontal & vertical
+    //   2 -> horizontal only
+    //   3 -> vertical only
+    //
+    var dimensions = this.filterManager.effectElements[1].p.v;
+    var sigmaX = (dimensions == 3) ? 0 : sigma; // eslint-disable-line eqeqeq
+    var sigmaY = (dimensions == 2) ? 0 : sigma; // eslint-disable-line eqeqeq
+
+    this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + ' ' + sigmaY);
+
+    // Repeat edges mapping:
+    //
+    //   0 -> off -> duplicate
+    //   1 -> on  -> wrap
+    var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate'; // eslint-disable-line eqeqeq
+    this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+  }
+};
+
+/* global createNS, createElementID, locationHref, bmFloor */
+
+function SVGStrokeEffect(elem, filterManager) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.elem = elem;
+  this.paths = [];
+}
+
+SVGStrokeEffect.prototype.initialize = function () {
+  var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+  var path;
+  var groupPath;
+  var i;
+  var len;
+  if (this.filterManager.effectElements[1].p.v === 1) {
+    len = this.elem.maskManager.masksProperties.length;
+    i = 0;
+  } else {
+    i = this.filterManager.effectElements[0].p.v - 1;
+    len = i + 1;
+  }
+  groupPath = createNS('g');
+  groupPath.setAttribute('fill', 'none');
+  groupPath.setAttribute('stroke-linecap', 'round');
+  groupPath.setAttribute('stroke-dashoffset', 1);
+  for (i; i < len; i += 1) {
+    path = createNS('path');
+    groupPath.appendChild(path);
+    this.paths.push({ p: path, m: i });
+  }
+  if (this.filterManager.effectElements[10].p.v === 3) {
+    var mask = createNS('mask');
+    var id = createElementID();
+    mask.setAttribute('id', id);
+    mask.setAttribute('mask-type', 'alpha');
+    mask.appendChild(groupPath);
+    this.elem.globalData.defs.appendChild(mask);
+    var g = createNS('g');
+    g.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+    while (elemChildren[0]) {
+      g.appendChild(elemChildren[0]);
+    }
+    this.elem.layerElement.appendChild(g);
+    this.masker = mask;
+    groupPath.setAttribute('stroke', '#fff');
+  } else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (this.filterManager.effectElements[10].p.v === 2) {
+      elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+      while (elemChildren.length) {
+        this.elem.layerElement.removeChild(elemChildren[0]);
+      }
+    }
+    this.elem.layerElement.appendChild(groupPath);
+    this.elem.layerElement.removeAttribute('mask');
+    groupPath.setAttribute('stroke', '#fff');
+  }
+  this.initialized = true;
+  this.pathMasker = groupPath;
+};
+
+SVGStrokeEffect.prototype.renderFrame = function (forceRender) {
+  if (!this.initialized) {
+    this.initialize();
+  }
+  var i;
+  var len = this.paths.length;
+  var mask;
+  var path;
+  for (i = 0; i < len; i += 1) {
+    if (this.paths[i].m !== -1) {
+      mask = this.elem.maskManager.viewData[this.paths[i].m];
+      path = this.paths[i].p;
+      if (forceRender || this.filterManager._mdf || mask.prop._mdf) {
+        path.setAttribute('d', mask.lastPath);
+      }
+      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) {
+        var dasharrayValue;
+        if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) {
+          var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var l = path.getTotalLength();
+          dasharrayValue = '0 0 0 ' + l * s + ' ';
+          var lineLength = l * (e - s);
+          var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
+          var units = Math.floor(lineLength / segment);
+          var j;
+          for (j = 0; j < units; j += 1) {
+            dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' ';
+          }
+          dasharrayValue += '0 ' + l * 10 + ' 0 0';
+        } else {
+          dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
         }
-        if(forceRender || this.filterManager.effectElements[0].p._mdf){
-            var col = this.filterManager.effectElements[0].p.v;
-            this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255)));
-        }
-        if(forceRender || this.filterManager.effectElements[1].p._mdf){
-            this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255);
-        }
-        if(forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf){
-            var distance = this.filterManager.effectElements[3].p.v;
-            var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
-            var x = distance * Math.cos(angle);
-            var y = distance * Math.sin(angle);
-            this.feOffset.setAttribute('dx', x);
-            this.feOffset.setAttribute('dy', y);
-        }
-        /*if(forceRender || this.filterManager.effectElements[5].p._mdf){
+        path.setAttribute('stroke-dasharray', dasharrayValue);
+      }
+    }
+  }
+  if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+    this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2);
+  }
+
+  if (forceRender || this.filterManager.effectElements[6].p._mdf) {
+    this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v);
+  }
+  if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (forceRender || this.filterManager.effectElements[3].p._mdf) {
+      var color = this.filterManager.effectElements[3].p.v;
+      this.pathMasker.setAttribute('stroke', 'rgb(' + bmFloor(color[0] * 255) + ',' + bmFloor(color[1] * 255) + ',' + bmFloor(color[2] * 255) + ')');
+    }
+  }
+};
+
+/* global createNS */
+
+function SVGTritoneFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  var feComponentTransfer = createNS('feComponentTransfer');
+  feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+  filter.appendChild(feComponentTransfer);
+  this.matrixFilter = feComponentTransfer;
+  var feFuncR = createNS('feFuncR');
+  feFuncR.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncR);
+  this.feFuncR = feFuncR;
+  var feFuncG = createNS('feFuncG');
+  feFuncG.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncG);
+  this.feFuncG = feFuncG;
+  var feFuncB = createNS('feFuncB');
+  feFuncB.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncB);
+  this.feFuncB = feFuncB;
+}
+
+SVGTritoneFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color1 = this.filterManager.effectElements[0].p.v;
+    var color2 = this.filterManager.effectElements[1].p.v;
+    var color3 = this.filterManager.effectElements[2].p.v;
+    var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
+    var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
+    var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
+    this.feFuncR.setAttribute('tableValues', tableR);
+    this.feFuncG.setAttribute('tableValues', tableG);
+    this.feFuncB.setAttribute('tableValues', tableB);
+    // var opacity = this.filterManager.effectElements[2].p.v/100;
+    // 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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGProLevelsFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var effectElements = this.filterManager.effectElements;
+  var feComponentTransfer = createNS('feComponentTransfer');
+
+  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) {
+    this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
+  }
+  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) {
+    this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
+  }
+  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) {
+    this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+  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) {
+    this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
+  }
+
+  if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    feComponentTransfer = createNS('feComponentTransfer');
+  }
+
+  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) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
+    this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
+    this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+}
+
+SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) {
+  var feFunc = createNS(type);
+  feFunc.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFunc);
+  return feFunc;
+};
+
+SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
+  var cnt = 0;
+  var segments = 256;
+  var perc;
+  var min = Math.min(inputBlack, inputWhite);
+  var max = Math.max(inputBlack, inputWhite);
+  var table = Array.call(null, { length: segments });
+  var colorValue;
+  var pos = 0;
+  var outputDelta = outputWhite - outputBlack;
+  var inputDelta = inputWhite - inputBlack;
+  while (cnt <= 256) {
+    perc = cnt / 256;
+    if (perc <= min) {
+      colorValue = inputDelta < 0 ? outputWhite : outputBlack;
+    } else if (perc >= max) {
+      colorValue = inputDelta < 0 ? outputBlack : outputWhite;
+    } else {
+      colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
+    }
+    table[pos] = colorValue;
+    pos += 1;
+    cnt += 256 / (segments - 1);
+  }
+  return table.join(' ');
+};
+
+SVGProLevelsFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var val;
+    var effectElements = this.filterManager.effectElements;
+    if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) {
+      val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v);
+      this.feFuncRComposed.setAttribute('tableValues', val);
+      this.feFuncGComposed.setAttribute('tableValues', val);
+      this.feFuncBComposed.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) {
+      val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v);
+      this.feFuncR.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) {
+      val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v);
+      this.feFuncG.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) {
+      val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v);
+      this.feFuncB.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) {
+      val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v);
+      this.feFuncA.setAttribute('tableValues', val);
+    }
+  }
+};
+
+/* global createNS, rgbToHex, degToRads */
+
+function SVGDropShadowEffect(filter, filterManager) {
+  var filterSize = filterManager.container.globalData.renderConfig.filterSize;
+  filter.setAttribute('x', filterSize.x);
+  filter.setAttribute('y', filterSize.y);
+  filter.setAttribute('width', filterSize.width);
+  filter.setAttribute('height', filterSize.height);
+  this.filterManager = filterManager;
+
+  var feGaussianBlur = createNS('feGaussianBlur');
+  feGaussianBlur.setAttribute('in', 'SourceAlpha');
+  feGaussianBlur.setAttribute('result', 'drop_shadow_1');
+  feGaussianBlur.setAttribute('stdDeviation', '0');
+  this.feGaussianBlur = feGaussianBlur;
+  filter.appendChild(feGaussianBlur);
+
+  var feOffset = createNS('feOffset');
+  feOffset.setAttribute('dx', '25');
+  feOffset.setAttribute('dy', '0');
+  feOffset.setAttribute('in', 'drop_shadow_1');
+  feOffset.setAttribute('result', 'drop_shadow_2');
+  this.feOffset = feOffset;
+  filter.appendChild(feOffset);
+  var feFlood = createNS('feFlood');
+  feFlood.setAttribute('flood-color', '#00ff00');
+  feFlood.setAttribute('flood-opacity', '1');
+  feFlood.setAttribute('result', 'drop_shadow_3');
+  this.feFlood = feFlood;
+  filter.appendChild(feFlood);
+
+  var feComposite = createNS('feComposite');
+  feComposite.setAttribute('in', 'drop_shadow_3');
+  feComposite.setAttribute('in2', 'drop_shadow_2');
+  feComposite.setAttribute('operator', 'in');
+  feComposite.setAttribute('result', 'drop_shadow_4');
+  filter.appendChild(feComposite);
+
+  var feMerge = createNS('feMerge');
+  filter.appendChild(feMerge);
+  var feMergeNode;
+  feMergeNode = createNS('feMergeNode');
+  feMerge.appendChild(feMergeNode);
+  feMergeNode = createNS('feMergeNode');
+  feMergeNode.setAttribute('in', 'SourceGraphic');
+  this.feMergeNode = feMergeNode;
+  this.feMerge = feMerge;
+  this.originalNodeAdded = false;
+  feMerge.appendChild(feMergeNode);
+}
+
+SVGDropShadowEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+      this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+    }
+    if (forceRender || this.filterManager.effectElements[0].p._mdf) {
+      var col = this.filterManager.effectElements[0].p.v;
+      this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255)));
+    }
+    if (forceRender || this.filterManager.effectElements[1].p._mdf) {
+      this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255);
+    }
+    if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {
+      var distance = this.filterManager.effectElements[3].p.v;
+      var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
+      var x = distance * Math.cos(angle);
+      var y = distance * Math.sin(angle);
+      this.feOffset.setAttribute('dx', x);
+      this.feOffset.setAttribute('dy', y);
+    }
+    /* if(forceRender || this.filterManager.effectElements[5].p._mdf){
             if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
                 this.feMerge.removeChild(this.feMergeNode);
                 this.originalNodeAdded = false;
@@ -9262,1841 +9811,1982 @@
                 this.feMerge.appendChild(this.feMergeNode);
                 this.originalNodeAdded = true;
             }
-        }*/
-    }
+        } */
+  }
 };
+
+/* global createElementID, createNS */
+
 var _svgMatteSymbols = [];
 
-function SVGMatte3Effect(filterElem, filterManager, elem){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.filterElem = filterElem;
-    this.elem = elem;
-    elem.matteElement = createNS('g');
-    elem.matteElement.appendChild(elem.layerElement);
-    elem.matteElement.appendChild(elem.transformedElement);
-    elem.baseElement = elem.matteElement;
+function SVGMatte3Effect(filterElem, filterManager, elem) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.filterElem = filterElem;
+  this.elem = elem;
+  elem.matteElement = createNS('g');
+  elem.matteElement.appendChild(elem.layerElement);
+  elem.matteElement.appendChild(elem.transformedElement);
+  elem.baseElement = elem.matteElement;
 }
 
-SVGMatte3Effect.prototype.findSymbol = function(mask) {
-    var i = 0, len = _svgMatteSymbols.length;
-    while(i < len) {
-        if(_svgMatteSymbols[i] === mask) {
-            return _svgMatteSymbols[i];
-        }
-        i += 1;
+SVGMatte3Effect.prototype.findSymbol = function (mask) {
+  var i = 0;
+  var len = _svgMatteSymbols.length;
+  while (i < len) {
+    if (_svgMatteSymbols[i] === mask) {
+      return _svgMatteSymbols[i];
     }
-    return null;
+    i += 1;
+  }
+  return null;
 };
 
-SVGMatte3Effect.prototype.replaceInParent = function(mask, symbolId) {
-    var parentNode = mask.layerElement.parentNode;
-    if(!parentNode) {
-        return;
+SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) {
+  var parentNode = mask.layerElement.parentNode;
+  if (!parentNode) {
+    return;
+  }
+  var children = parentNode.children;
+  var i = 0;
+  var len = children.length;
+  while (i < len) {
+    if (children[i] === mask.layerElement) {
+      break;
     }
-    var children = parentNode.children;
-    var i = 0, len = children.length;
-    while (i < len) {
-        if (children[i] === mask.layerElement) {
-            break;
-        }
-        i += 1;
-    }
-    var nextChild;
-    if (i <= len - 2) {
-        nextChild = children[i + 1];
-    }
+    i += 1;
+  }
+  var nextChild;
+  if (i <= len - 2) {
+    nextChild = children[i + 1];
+  }
+  var useElem = createNS('use');
+  useElem.setAttribute('href', '#' + symbolId);
+  if (nextChild) {
+    parentNode.insertBefore(useElem, nextChild);
+  } else {
+    parentNode.appendChild(useElem);
+  }
+};
+
+SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) {
+  if (!this.findSymbol(mask)) {
+    var symbolId = createElementID();
+    var masker = createNS('mask');
+    masker.setAttribute('id', mask.layerId);
+    masker.setAttribute('mask-type', 'alpha');
+    _svgMatteSymbols.push(mask);
+    var defs = elem.globalData.defs;
+    defs.appendChild(masker);
+    var symbol = createNS('symbol');
+    symbol.setAttribute('id', symbolId);
+    this.replaceInParent(mask, symbolId);
+    symbol.appendChild(mask.layerElement);
+    defs.appendChild(symbol);
     var useElem = createNS('use');
     useElem.setAttribute('href', '#' + symbolId);
-    if(nextChild) {
-        parentNode.insertBefore(useElem, nextChild);
-    } else {
-        parentNode.appendChild(useElem);
-    }
+    masker.appendChild(useElem);
+    mask.data.hd = false;
+    mask.show();
+  }
+  elem.setMatte(mask.layerId);
 };
 
-SVGMatte3Effect.prototype.setElementAsMask = function(elem, mask) {
-    if(!this.findSymbol(mask)) {
-        var symbolId = createElementID();
-        var masker = createNS('mask');
-        masker.setAttribute('id', mask.layerId);
-        masker.setAttribute('mask-type', 'alpha');
-        _svgMatteSymbols.push(mask);
-        var defs = elem.globalData.defs;
-        defs.appendChild(masker);
-        var symbol = createNS('symbol');
-        symbol.setAttribute('id', symbolId);
-        this.replaceInParent(mask, symbolId);
-        symbol.appendChild(mask.layerElement);
-        defs.appendChild(symbol);
-        var useElem = createNS('use');
-        useElem.setAttribute('href', '#' + symbolId);
-        masker.appendChild(useElem);
-        mask.data.hd = false;
-        mask.show();
+SVGMatte3Effect.prototype.initialize = function () {
+  var ind = this.filterManager.effectElements[0].p.v;
+  var elements = this.elem.comp.elements;
+  var i = 0;
+  var len = elements.length;
+  while (i < len) {
+    if (elements[i] && elements[i].data.ind === ind) {
+      this.setElementAsMask(this.elem, elements[i]);
     }
-    elem.setMatte(mask.layerId);
+    i += 1;
+  }
+  this.initialized = true;
 };
 
-SVGMatte3Effect.prototype.initialize = function() {
-    var ind = this.filterManager.effectElements[0].p.v;
-    var elements = this.elem.comp.elements;
-    var i = 0, len = elements.length;
-    while (i < len) {
-    	if (elements[i] && elements[i].data.ind === ind) {
-    		this.setElementAsMask(this.elem, elements[i]);
-    	}
-    	i += 1;
-    }
-    this.initialized = true;
+SVGMatte3Effect.prototype.renderFrame = function () {
+  if (!this.initialized) {
+    this.initialize();
+  }
 };
 
-SVGMatte3Effect.prototype.renderFrame = function() {
-	if(!this.initialized) {
-		this.initialize();
-	}
-};
-function SVGEffects(){}
+/* exported SVGEffects */
+
+function SVGEffects() {}
+
 function CVEffects() {
 
 }
-CVEffects.prototype.renderFrame = function(){};
-function HBaseElement(data,globalData,comp){}
+CVEffects.prototype.renderFrame = function () {};
+
+/* global createTag, createNS, styleDiv, CVEffects, MaskElement, SVGBaseElement, HybridRenderer */
+
+function HBaseElement() {}
 HBaseElement.prototype = {
-    checkBlendMode: function(){},
-    initRendererElement: function(){
-        this.baseElement = createTag(this.data.tg || 'div');
-        if(this.data.hasMask) {
-            this.svgElement = createNS('svg');
-            this.layerElement = createNS('g');
-            this.maskedElement = this.layerElement;
-            this.svgElement.appendChild(this.layerElement);
-            this.baseElement.appendChild(this.svgElement);
-        } else {
-            this.layerElement = this.baseElement;
-        }
-        styleDiv(this.baseElement);
-    },
-    createContainerElements: function(){
-        this.renderableEffectsManager = new CVEffects(this);
-        this.transformedElement = this.baseElement;
-        this.maskedElement = this.layerElement;
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id',this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-    },
-    renderElement: function() {
-        if(this.finalTransform._matMdf){
-            this.transformedElement.style.transform = this.transformedElement.style.webkitTransform = this.finalTransform.mat.toCSS();
-        }
-        if(this.finalTransform._opMdf){
-            this.transformedElement.style.opacity = this.finalTransform.mProp.o.v;
-        }
-    },
-    renderFrame: function() {
-        //If it is exported as hidden (data.hd === true) no need to render
-        //If it is not visible no need to render
-        if (this.data.hd || this.hidden) {
-            return;
-        }
-        this.renderTransform();
-        this.renderRenderable();
-        this.renderElement();
-        this.renderInnerContent();
-        if (this._isFirstFrame) {
-            this._isFirstFrame = false;
-        }
-    },
-    destroy: function(){
-        this.layerElement = null;
-        this.transformedElement = null;
-        if(this.matteElement) {
-            this.matteElement = null;
-        }
-        if(this.maskManager) {
-            this.maskManager.destroy();
-            this.maskManager = null;
-        }
-    },
-    createRenderableComponents: function(){
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-    },
-    addEffects: function(){
-    },
-    setMatte: function(){}
+  checkBlendMode: function () {},
+  initRendererElement: function () {
+    this.baseElement = createTag(this.data.tg || 'div');
+    if (this.data.hasMask) {
+      this.svgElement = createNS('svg');
+      this.layerElement = createNS('g');
+      this.maskedElement = this.layerElement;
+      this.svgElement.appendChild(this.layerElement);
+      this.baseElement.appendChild(this.svgElement);
+    } else {
+      this.layerElement = this.baseElement;
+    }
+    styleDiv(this.baseElement);
+  },
+  createContainerElements: function () {
+    this.renderableEffectsManager = new CVEffects(this);
+    this.transformedElement = this.baseElement;
+    this.maskedElement = this.layerElement;
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    var transformedElementStyle = this.transformedElement ? this.transformedElement.style : {};
+    if (this.finalTransform._matMdf) {
+      var matrixValue = this.finalTransform.mat.toCSS();
+      transformedElementStyle.transform = matrixValue;
+      transformedElementStyle.webkitTransform = matrixValue;
+    }
+    if (this.finalTransform._opMdf) {
+      transformedElementStyle.opacity = this.finalTransform.mProp.o.v;
+    }
+  },
+  renderFrame: function () {
+    // If it is exported as hidden (data.hd === true) no need to render
+    // If it is not visible no need to render
+    if (this.data.hd || this.hidden) {
+      return;
+    }
+    this.renderTransform();
+    this.renderRenderable();
+    this.renderElement();
+    this.renderInnerContent();
+    if (this._isFirstFrame) {
+      this._isFirstFrame = false;
+    }
+  },
+  destroy: function () {
+    this.layerElement = null;
+    this.transformedElement = null;
+    if (this.matteElement) {
+      this.matteElement = null;
+    }
+    if (this.maskManager) {
+      this.maskManager.destroy();
+      this.maskManager = null;
+    }
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+  },
+  addEffects: function () {
+  },
+  setMatte: function () {},
 };
 HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;
 HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;
 HBaseElement.prototype.buildElementParenting = HybridRenderer.prototype.buildElementParenting;
-function HSolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
-}
-extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], HSolidElement);
 
-HSolidElement.prototype.createContent = function(){
-    var rect;
-    if(this.data.hasMask){
-        rect = createNS('rect');
-        rect.setAttribute('width',this.data.sw);
-        rect.setAttribute('height',this.data.sh);
-        rect.setAttribute('fill',this.data.sc);
-        this.svgElement.setAttribute('width',this.data.sw);
-        this.svgElement.setAttribute('height',this.data.sh);
-    } else {
-        rect = createTag('div');
-        rect.style.width = this.data.sw + 'px';
-        rect.style.height = this.data.sh + 'px';
-        rect.style.backgroundColor = this.data.sc;
-    }
-    this.layerElement.appendChild(rect);
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, createNS, createTag */
+
+function HSolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
+}
+extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement);
+
+HSolidElement.prototype.createContent = function () {
+  var rect;
+  if (this.data.hasMask) {
+    rect = createNS('rect');
+    rect.setAttribute('width', this.data.sw);
+    rect.setAttribute('height', this.data.sh);
+    rect.setAttribute('fill', this.data.sc);
+    this.svgElement.setAttribute('width', this.data.sw);
+    this.svgElement.setAttribute('height', this.data.sh);
+  } else {
+    rect = createTag('div');
+    rect.style.width = this.data.sw + 'px';
+    rect.style.height = this.data.sh + 'px';
+    rect.style.backgroundColor = this.data.sc;
+  }
+  this.layerElement.appendChild(rect);
 };
 
-function HCompElement(data,globalData,comp){
-    this.layers = data.layers;
-    this.supports3d = !data.hasMask;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
-    this.initElement(data,globalData,comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+/* global createSizedArray, PropertyFactory, extendPrototype, HybridRenderer, ICompElement, HBaseElement */
+
+function HCompElement(data, globalData, comp) {
+  this.layers = data.layers;
+  this.supports3d = !data.hasMask;
+  this.completeLayers = false;
+  this.pendingElements = [];
+  this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([HybridRenderer, ICompElement, HBaseElement], HCompElement);
 HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements;
 
-HCompElement.prototype.createContainerElements = function(){
-    this._createBaseContainerElements();
-    //divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
-    if(this.data.hasMask){
-        this.svgElement.setAttribute('width',this.data.w);
-        this.svgElement.setAttribute('height',this.data.h);
-        this.transformedElement = this.baseElement;
-    } else {
-        this.transformedElement = this.layerElement;
-    }
+HCompElement.prototype.createContainerElements = function () {
+  this._createBaseContainerElements();
+  // divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
+  if (this.data.hasMask) {
+    this.svgElement.setAttribute('width', this.data.w);
+    this.svgElement.setAttribute('height', this.data.h);
+    this.transformedElement = this.baseElement;
+  } else {
+    this.transformedElement = this.layerElement;
+  }
 };
 
-HCompElement.prototype.addTo3dContainer = function(elem,pos) {
-    var j = 0;
-    var nextElement;
-    while(j<pos){
-        if(this.elements[j] && this.elements[j].getBaseElement){
-            nextElement = this.elements[j].getBaseElement();
-        }
-        j += 1;
+HCompElement.prototype.addTo3dContainer = function (elem, pos) {
+  var j = 0;
+  var nextElement;
+  while (j < pos) {
+    if (this.elements[j] && this.elements[j].getBaseElement) {
+      nextElement = this.elements[j].getBaseElement();
     }
-    if(nextElement){
-        this.layerElement.insertBefore(elem, nextElement);
-    } else {
-        this.layerElement.appendChild(elem);
-    }
-}
+    j += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(elem, nextElement);
+  } else {
+    this.layerElement.appendChild(elem);
+  }
+};
 
-function HShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    this.shapesContainer = createNS('g');
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    this.currentBBox = {
-        x:999999,
-        y: -999999,
-        h: 0,
-        w: 0
-    };
+/* global createNS, extendPrototype, BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement,
+HierarchyElement, FrameElement, RenderableElement, createNS, bmMin, bmSqrt, bmMin, bmMax, bmPow */
+
+function HShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  this.shapesContainer = createNS('g');
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  this.currentBBox = {
+    x: 999999,
+    y: -999999,
+    h: 0,
+    w: 0,
+  };
 }
-extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement], HShapeElement);
+extendPrototype([BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement], HShapeElement);
 HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent;
 
-HShapeElement.prototype.createContent = function(){
-    var cont;
-    this.baseElement.style.fontSize = 0;
-    if (this.data.hasMask) {
-        this.layerElement.appendChild(this.shapesContainer);
-        cont = this.svgElement;
-    } else {
-        cont = createNS('svg');
-        var size = this.comp.data ? this.comp.data : this.globalData.compSize;
-        cont.setAttribute('width',size.w);
-        cont.setAttribute('height',size.h);
-        cont.appendChild(this.shapesContainer);
-        this.layerElement.appendChild(cont);
-    }
-
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0, [], true);
-    this.filterUniqueShapes();
-    this.shapeCont = cont;
-};
-
-HShapeElement.prototype.getTransformedPoint = function(transformers, point) {
-    var i, len = transformers.length;
-    for(i = 0; i < len; i += 1) {
-        point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
-    }
-    return point;
-}
-
-HShapeElement.prototype.calculateShapeBoundingBox = function(item, boundingBox) {
-    var shape = item.sh.v;
-    var transformers = item.transformers;
-    var i, len = shape._length, vPoint, oPoint, nextIPoint, nextVPoint, bounds;
-    if (len <= 1) {
-        return;
-    }
-    for (i = 0; i < len - 1; i += 1) {
-        vPoint = this.getTransformedPoint(transformers, shape.v[i]);
-        oPoint = this.getTransformedPoint(transformers, shape.o[i]);
-        nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
-        nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
-        this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
-    }
-    if(shape.c) {
-        vPoint = this.getTransformedPoint(transformers, shape.v[i]);
-        oPoint = this.getTransformedPoint(transformers, shape.o[i]);
-        nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
-        nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
-        this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
-    }
-}
-
-HShapeElement.prototype.checkBounds = function(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
-    this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
-    var bounds = this.shapeBoundingBox;
-    boundingBox.x = bm_min(bounds.left, boundingBox.x);
-    boundingBox.xMax = bm_max(bounds.right, boundingBox.xMax);
-    boundingBox.y = bm_min(bounds.top, boundingBox.y);
-    boundingBox.yMax = bm_max(bounds.bottom, boundingBox.yMax);
-}
-
-HShapeElement.prototype.shapeBoundingBox = {
-    left:0,
-    right:0,
-    top:0,
-    bottom:0,
-}
-
-HShapeElement.prototype.tempBoundingBox = {
-    x:0,
-    xMax:0,
-    y:0,
-    yMax:0,
-    width:0,
-    height:0
-}
-
-HShapeElement.prototype.getBoundsOfCurve = function(p0, p1, p2, p3) {
-
-    var bounds = [[p0[0],p3[0]], [p0[1],p3[1]]];
-
-    for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) {
-
-      b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
-      a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
-      c = 3 * p1[i] - 3 * p0[i];
-
-      b = b | 0;
-      a = a | 0;
-      c = c | 0;
-
-      if (a === 0) {
-
-        if (b === 0) {
-          continue;
-        }
-
-        t = -c / b;
-
-        if (0 < t && t < 1) {
-          bounds[i].push(this.calculateF(t,p0,p1,p2,p3,i));
-        }
-        continue;
-      }
-
-      b2ac = b * b - 4 * c * a;
-
-      if (b2ac < 0) {
-        continue;
-      }
-
-      t1 = (-b + bm_sqrt(b2ac))/(2 * a);
-      if (0 < t1 && t1 < 1) bounds[i].push(this.calculateF(t1,p0,p1,p2,p3,i));
-
-      t2 = (-b - bm_sqrt(b2ac))/(2 * a);
-      if (0 < t2 && t2 < 1) bounds[i].push(this.calculateF(t2,p0,p1,p2,p3,i));
-
-    }
-
-    this.shapeBoundingBox.left = bm_min.apply(null, bounds[0]);
-    this.shapeBoundingBox.top = bm_min.apply(null, bounds[1]);
-    this.shapeBoundingBox.right = bm_max.apply(null, bounds[0]);
-    this.shapeBoundingBox.bottom = bm_max.apply(null, bounds[1]);
-  };
-
-  HShapeElement.prototype.calculateF = function(t, p0, p1, p2, p3, i) {
-    return bm_pow(1-t, 3) * p0[i]
-        + 3 * bm_pow(1-t, 2) * t * p1[i]
-        + 3 * (1-t) * bm_pow(t, 2) * p2[i]
-        + bm_pow(t, 3) * p3[i];
+HShapeElement.prototype.createContent = function () {
+  var cont;
+  this.baseElement.style.fontSize = 0;
+  if (this.data.hasMask) {
+    this.layerElement.appendChild(this.shapesContainer);
+    cont = this.svgElement;
+  } else {
+    cont = createNS('svg');
+    var size = this.comp.data ? this.comp.data : this.globalData.compSize;
+    cont.setAttribute('width', size.w);
+    cont.setAttribute('height', size.h);
+    cont.appendChild(this.shapesContainer);
+    this.layerElement.appendChild(cont);
   }
 
-HShapeElement.prototype.calculateBoundingBox = function(itemsData, boundingBox) {
-    var i, len = itemsData.length, path;
-    for(i = 0; i < len; i += 1) {
-        if(itemsData[i] && itemsData[i].sh) {
-            this.calculateShapeBoundingBox(itemsData[i], boundingBox)
-        } else if(itemsData[i] && itemsData[i].it) {
-            this.calculateBoundingBox(itemsData[i].it, boundingBox)
-        }
-    }
-}
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], true);
+  this.filterUniqueShapes();
+  this.shapeCont = cont;
+};
 
-HShapeElement.prototype.currentBoxContains = function(box) {
-    return this.currentBBox.x <= box.x 
-    && this.currentBBox.y <= box.y 
+HShapeElement.prototype.getTransformedPoint = function (transformers, point) {
+  var i;
+  var len = transformers.length;
+  for (i = 0; i < len; i += 1) {
+    point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
+  }
+  return point;
+};
+
+HShapeElement.prototype.calculateShapeBoundingBox = function (item, boundingBox) {
+  var shape = item.sh.v;
+  var transformers = item.transformers;
+  var i;
+  var len = shape._length;
+  var vPoint;
+  var oPoint;
+  var nextIPoint;
+  var nextVPoint;
+  if (len <= 1) {
+    return;
+  }
+  for (i = 0; i < len - 1; i += 1) {
+    vPoint = this.getTransformedPoint(transformers, shape.v[i]);
+    oPoint = this.getTransformedPoint(transformers, shape.o[i]);
+    nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
+    nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
+    this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
+  }
+  if (shape.c) {
+    vPoint = this.getTransformedPoint(transformers, shape.v[i]);
+    oPoint = this.getTransformedPoint(transformers, shape.o[i]);
+    nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
+    nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
+    this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
+  }
+};
+
+HShapeElement.prototype.checkBounds = function (vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
+  this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
+  var bounds = this.shapeBoundingBox;
+  boundingBox.x = bmMin(bounds.left, boundingBox.x);
+  boundingBox.xMax = bmMax(bounds.right, boundingBox.xMax);
+  boundingBox.y = bmMin(bounds.top, boundingBox.y);
+  boundingBox.yMax = bmMax(bounds.bottom, boundingBox.yMax);
+};
+
+HShapeElement.prototype.shapeBoundingBox = {
+  left: 0,
+  right: 0,
+  top: 0,
+  bottom: 0,
+};
+
+HShapeElement.prototype.tempBoundingBox = {
+  x: 0,
+  xMax: 0,
+  y: 0,
+  yMax: 0,
+  width: 0,
+  height: 0,
+};
+
+HShapeElement.prototype.getBoundsOfCurve = function (p0, p1, p2, p3) {
+  var bounds = [[p0[0], p3[0]], [p0[1], p3[1]]];
+
+  for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) { // eslint-disable-line no-plusplus
+    b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
+    a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
+    c = 3 * p1[i] - 3 * p0[i];
+
+    b |= 0; // eslint-disable-line no-bitwise
+    a |= 0; // eslint-disable-line no-bitwise
+    c |= 0; // eslint-disable-line no-bitwise
+
+    if (a === 0 && b === 0) {
+      //
+    } else if (a === 0) {
+      t = -c / b;
+
+      if (t > 0 && t < 1) {
+        bounds[i].push(this.calculateF(t, p0, p1, p2, p3, i));
+      }
+    } else {
+      b2ac = b * b - 4 * c * a;
+
+      if (b2ac >= 0) {
+        t1 = (-b + bmSqrt(b2ac)) / (2 * a);
+        if (t1 > 0 && t1 < 1) bounds[i].push(this.calculateF(t1, p0, p1, p2, p3, i));
+        t2 = (-b - bmSqrt(b2ac)) / (2 * a);
+        if (t2 > 0 && t2 < 1) bounds[i].push(this.calculateF(t2, p0, p1, p2, p3, i));
+      }
+    }
+  }
+
+  this.shapeBoundingBox.left = bmMin.apply(null, bounds[0]);
+  this.shapeBoundingBox.top = bmMin.apply(null, bounds[1]);
+  this.shapeBoundingBox.right = bmMax.apply(null, bounds[0]);
+  this.shapeBoundingBox.bottom = bmMax.apply(null, bounds[1]);
+};
+
+HShapeElement.prototype.calculateF = function (t, p0, p1, p2, p3, i) {
+  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];
+};
+
+HShapeElement.prototype.calculateBoundingBox = function (itemsData, boundingBox) {
+  var i;
+  var len = itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    if (itemsData[i] && itemsData[i].sh) {
+      this.calculateShapeBoundingBox(itemsData[i], boundingBox);
+    } else if (itemsData[i] && itemsData[i].it) {
+      this.calculateBoundingBox(itemsData[i].it, boundingBox);
+    }
+  }
+};
+
+HShapeElement.prototype.currentBoxContains = function (box) {
+  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
-}
-
-HShapeElement.prototype.renderInnerContent = function() {
-    this._renderShapeFrame();
-
-    if(!this.hidden && (this._isFirstFrame || this._mdf)) {
-        var tempBoundingBox = this.tempBoundingBox;
-        var max = 999999;
-        tempBoundingBox.x = max;
-        tempBoundingBox.xMax = -max;
-        tempBoundingBox.y = max;
-        tempBoundingBox.yMax = -max;
-        this.calculateBoundingBox(this.itemsData, tempBoundingBox);
-        tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
-        tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
-        //var tempBoundingBox = this.shapeCont.getBBox();
-        if(this.currentBoxContains(tempBoundingBox)) {
-            return;
-        }
-        var changed = false;
-        if(this.currentBBox.w !== tempBoundingBox.width){
-            this.currentBBox.w = tempBoundingBox.width;
-            this.shapeCont.setAttribute('width',tempBoundingBox.width);
-            changed = true;
-        }
-        if(this.currentBBox.h !== tempBoundingBox.height){
-            this.currentBBox.h = tempBoundingBox.height;
-            this.shapeCont.setAttribute('height',tempBoundingBox.height);
-            changed = true;
-        }
-        if(changed  || this.currentBBox.x !== tempBoundingBox.x  || this.currentBBox.y !== tempBoundingBox.y){
-            this.currentBBox.w = tempBoundingBox.width;
-            this.currentBBox.h = tempBoundingBox.height;
-            this.currentBBox.x = tempBoundingBox.x;
-            this.currentBBox.y = tempBoundingBox.y;
-
-            this.shapeCont.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
-            this.shapeCont.style.transform = this.shapeCont.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
-        }
-    }
-
+    && this.currentBBox.height + this.currentBBox.y >= box.y + box.height;
 };
-function HTextElement(data,globalData,comp){
-    this.textSpans = [];
-    this.textPaths = [];
-    this.currentBBox = {
-        x:999999,
-        y: -999999,
-        h: 0,
-        w: 0
-    };
+
+HShapeElement.prototype.renderInnerContent = function () {
+  this._renderShapeFrame();
+
+  if (!this.hidden && (this._isFirstFrame || this._mdf)) {
+    var tempBoundingBox = this.tempBoundingBox;
+    var max = 999999;
+    tempBoundingBox.x = max;
+    tempBoundingBox.xMax = -max;
+    tempBoundingBox.y = max;
+    tempBoundingBox.yMax = -max;
+    this.calculateBoundingBox(this.itemsData, tempBoundingBox);
+    tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
+    tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y;
+    // var tempBoundingBox = this.shapeCont.getBBox();
+    if (this.currentBoxContains(tempBoundingBox)) {
+      return;
+    }
+    var changed = false;
+    if (this.currentBBox.w !== tempBoundingBox.width) {
+      this.currentBBox.w = tempBoundingBox.width;
+      this.shapeCont.setAttribute('width', tempBoundingBox.width);
+      changed = true;
+    }
+    if (this.currentBBox.h !== tempBoundingBox.height) {
+      this.currentBBox.h = tempBoundingBox.height;
+      this.shapeCont.setAttribute('height', tempBoundingBox.height);
+      changed = true;
+    }
+    if (changed || this.currentBBox.x !== tempBoundingBox.x || this.currentBBox.y !== tempBoundingBox.y) {
+      this.currentBBox.w = tempBoundingBox.width;
+      this.currentBBox.h = tempBoundingBox.height;
+      this.currentBBox.x = tempBoundingBox.x;
+      this.currentBBox.y = tempBoundingBox.y;
+
+      this.shapeCont.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
+      var shapeStyle = this.shapeCont.style;
+      var shapeTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
+      shapeStyle.transform = shapeTransform;
+      shapeStyle.webkitTransform = shapeTransform;
+    }
+  }
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, ITextElement, createSizedArray, createTag, styleDiv, createNS */
+
+function HTextElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.textPaths = [];
+  this.currentBBox = {
+    x: 999999,
+    y: -999999,
+    h: 0,
+    w: 0,
+  };
+  this.renderType = 'svg';
+  this.isMasked = false;
+  this.initElement(data, globalData, comp);
+}
+extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement);
+
+HTextElement.prototype.createContent = function () {
+  this.isMasked = this.checkMasks();
+  if (this.isMasked) {
     this.renderType = 'svg';
-    this.isMasked = false;
-    this.initElement(data,globalData,comp);
+    this.compW = this.comp.data.w;
+    this.compH = this.comp.data.h;
+    this.svgElement.setAttribute('width', this.compW);
+    this.svgElement.setAttribute('height', this.compH);
+    var g = createNS('g');
+    this.maskedElement.appendChild(g);
+    this.innerElem = g;
+  } else {
+    this.renderType = 'html';
+    this.innerElem = this.layerElement;
+  }
 
-}
-extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], HTextElement);
-
-HTextElement.prototype.createContent = function(){
-    this.isMasked = this.checkMasks();
-    if(this.isMasked){
-        this.renderType = 'svg';
-        this.compW = this.comp.data.w;
-        this.compH = this.comp.data.h;
-        this.svgElement.setAttribute('width',this.compW);
-        this.svgElement.setAttribute('height',this.compH);
-        var g = createNS('g');
-        this.maskedElement.appendChild(g);
-        this.innerElem = g;
-    } else {
-        this.renderType = 'html';
-        this.innerElem = this.layerElement;
-    }
-
-    this.checkParenting();
-
+  this.checkParenting();
 };
 
-HTextElement.prototype.buildNewText = function(){
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
-    var innerElemStyle = this.innerElem.style;
-    innerElemStyle.color = innerElemStyle.fill = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
-    if(documentData.sc){
-        innerElemStyle.stroke = this.buildColor(documentData.sc);
-        innerElemStyle.strokeWidth = documentData.sw+'px';
+HTextElement.prototype.buildNewText = function () {
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
+  var innerElemStyle = this.innerElem.style;
+  var textColor = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
+  innerElemStyle.fill = textColor;
+  innerElemStyle.color = textColor;
+  if (documentData.sc) {
+    innerElemStyle.stroke = this.buildColor(documentData.sc);
+    innerElemStyle.strokeWidth = documentData.sw + 'px';
+  }
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  if (!this.globalData.fontManager.chars) {
+    innerElemStyle.fontSize = documentData.finalSize + 'px';
+    innerElemStyle.lineHeight = documentData.finalSize + 'px';
+    if (fontData.fClass) {
+      this.innerElem.className = fontData.fClass;
+    } else {
+      innerElemStyle.fontFamily = fontData.fFamily;
+      var fWeight = documentData.fWeight;
+      var fStyle = documentData.fStyle;
+      innerElemStyle.fontStyle = fStyle;
+      innerElemStyle.fontWeight = fWeight;
     }
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(!this.globalData.fontManager.chars){
-        innerElemStyle.fontSize = documentData.finalSize+'px';
-        innerElemStyle.lineHeight = documentData.finalSize+'px';
-        if(fontData.fClass){
-            this.innerElem.className = fontData.fClass;
+  }
+  var i;
+  var len;
+
+  var letters = documentData.l;
+  len = letters.length;
+  var tSpan;
+  var tParent;
+  var tCont;
+  var matrixHelper = this.mHelper;
+  var shapes;
+  var shapeStr = '';
+  var cnt = 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.globalData.fontManager.chars) {
+      if (!this.textPaths[cnt]) {
+        tSpan = createNS('path');
+        tSpan.setAttribute('stroke-linecap', 'butt');
+        tSpan.setAttribute('stroke-linejoin', 'round');
+        tSpan.setAttribute('stroke-miterlimit', '4');
+      } else {
+        tSpan = this.textPaths[cnt];
+      }
+      if (!this.isMasked) {
+        if (this.textSpans[cnt]) {
+          tParent = this.textSpans[cnt];
+          tCont = tParent.children[0];
         } else {
-            innerElemStyle.fontFamily = fontData.fFamily;
-            var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-            innerElemStyle.fontStyle = fStyle;
-            innerElemStyle.fontWeight = fWeight;
+          tParent = createTag('div');
+          tParent.style.lineHeight = 0;
+          tCont = createNS('svg');
+          tCont.appendChild(tSpan);
+          styleDiv(tParent);
         }
+      }
+    } else if (!this.isMasked) {
+      if (this.textSpans[cnt]) {
+        tParent = this.textSpans[cnt];
+        tSpan = this.textPaths[cnt];
+      } else {
+        tParent = createTag('span');
+        styleDiv(tParent);
+        tSpan = createTag('span');
+        styleDiv(tSpan);
+        tParent.appendChild(tSpan);
+      }
+    } else {
+      tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
     }
-    var i, len;
+    // tSpan.setAttribute('visibility', 'hidden');
+    if (this.globalData.fontManager.chars) {
+      var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+      var shapeData;
+      if (charData) {
+        shapeData = charData.data;
+      } else {
+        shapeData = null;
+      }
+      matrixHelper.reset();
+      if (shapeData && shapeData.shapes) {
+        shapes = shapeData.shapes[0].it;
+        matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+        shapeStr = this.createPathShape(matrixHelper, shapes);
+        tSpan.setAttribute('d', shapeStr);
+      }
+      if (!this.isMasked) {
+        this.innerElem.appendChild(tParent);
+        if (shapeData && shapeData.shapes) {
+          // document.body.appendChild is needed to get exact measure of shape
+          document.body.appendChild(tCont);
+          var boundingBox = tCont.getBBox();
+          tCont.setAttribute('width', boundingBox.width + 2);
+          tCont.setAttribute('height', boundingBox.height + 2);
+          tCont.setAttribute('viewBox', (boundingBox.x - 1) + ' ' + (boundingBox.y - 1) + ' ' + (boundingBox.width + 2) + ' ' + (boundingBox.height + 2));
+          var tContStyle = tCont.style;
+          var tContTranslation = 'translate(' + (boundingBox.x - 1) + 'px,' + (boundingBox.y - 1) + 'px)';
+          tContStyle.transform = tContTranslation;
+          tContStyle.webkitTransform = tContTranslation;
 
-    var letters = documentData.l;
-    len = letters.length;
-    var tSpan,tParent,tCont;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '';
-    var cnt = 0;
-    for (i = 0;i < len ;i += 1) {
-        if(this.globalData.fontManager.chars){
-            if(!this.textPaths[cnt]){
-                tSpan = createNS('path');
-                tSpan.setAttribute('stroke-linecap', 'butt');
-                tSpan.setAttribute('stroke-linejoin','round');
-                tSpan.setAttribute('stroke-miterlimit','4');
-            } else {
-                tSpan = this.textPaths[cnt];
-            }
-            if(!this.isMasked){
-                if(this.textSpans[cnt]){
-                    tParent = this.textSpans[cnt];
-                    tCont = tParent.children[0];
-                } else {
-
-                    tParent = createTag('div');
-                    tParent.style.lineHeight = 0;
-                    tCont = createNS('svg');
-                    tCont.appendChild(tSpan);
-                    styleDiv(tParent);
-                }
-            }
-        }else{
-            if(!this.isMasked){
-                if(this.textSpans[cnt]){
-                    tParent = this.textSpans[cnt];
-                    tSpan = this.textPaths[cnt];
-                } else {
-                    tParent = createTag('span');
-                    styleDiv(tParent);
-                    tSpan = createTag('span');
-                    styleDiv(tSpan);
-                    tParent.appendChild(tSpan);
-                }
-            } else {
-                tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
-            }
+          letters[i].yOffset = boundingBox.y - 1;
+        } else {
+          tCont.setAttribute('width', 1);
+          tCont.setAttribute('height', 1);
         }
-        //tSpan.setAttribute('visibility', 'hidden');
-        if(this.globalData.fontManager.chars){
-            var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-            var shapeData;
-            if(charData){
-                shapeData = charData.data;
-            } else {
-                shapeData = null;
-            }
-            matrixHelper.reset();
-            if(shapeData && shapeData.shapes){
-                shapes = shapeData.shapes[0].it;
-                matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100);
-                shapeStr = this.createPathShape(matrixHelper,shapes);
-                tSpan.setAttribute('d',shapeStr);
-            }
-            if(!this.isMasked){
-                this.innerElem.appendChild(tParent);
-                if(shapeData && shapeData.shapes){
-
-                    //document.body.appendChild is needed to get exact measure of shape
-                    document.body.appendChild(tCont);
-                    var boundingBox = tCont.getBBox();
-                    tCont.setAttribute('width',boundingBox.width + 2);
-                    tCont.setAttribute('height',boundingBox.height + 2);
-                    tCont.setAttribute('viewBox',(boundingBox.x-1)+' '+ (boundingBox.y-1)+' '+ (boundingBox.width+2)+' '+ (boundingBox.height+2));
-                    tCont.style.transform = tCont.style.webkitTransform = 'translate(' + (boundingBox.x-1) + 'px,' + (boundingBox.y-1) + 'px)';
-
-                    letters[i].yOffset = boundingBox.y-1;
-
-                } else{
-                    tCont.setAttribute('width',1);
-                    tCont.setAttribute('height',1);
-                }
-                    tParent.appendChild(tCont);
-            }else{
-                this.innerElem.appendChild(tSpan);
-            }
-        }else{
-            tSpan.textContent = letters[i].val;
-            tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            if(!this.isMasked){
-                this.innerElem.appendChild(tParent);
-                //
-                tSpan.style.transform = tSpan.style.webkitTransform = 'translate3d(0,'+ -documentData.finalSize/1.2+'px,0)';
-            } else {
-                this.innerElem.appendChild(tSpan);
-            }
-        }
+        tParent.appendChild(tCont);
+      } else {
+        this.innerElem.appendChild(tSpan);
+      }
+    } else {
+      tSpan.textContent = letters[i].val;
+      tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
+      if (!this.isMasked) {
+        this.innerElem.appendChild(tParent);
         //
-        if(!this.isMasked){
-            this.textSpans[cnt] = tParent;
-        }else{
-            this.textSpans[cnt] = tSpan;
-        }
-        this.textSpans[cnt].style.display = 'block';
-        this.textPaths[cnt] = tSpan;
-        cnt += 1;
+        var tStyle = tSpan.style;
+        var tSpanTranslation = 'translate3d(0,' + -documentData.finalSize / 1.2 + 'px,0)';
+        tStyle.transform = tSpanTranslation;
+        tStyle.webkitTransform = tSpanTranslation;
+      } else {
+        this.innerElem.appendChild(tSpan);
+      }
     }
-    while(cnt < this.textSpans.length){
-        this.textSpans[cnt].style.display = 'none';
-        cnt += 1;
+    //
+    if (!this.isMasked) {
+      this.textSpans[cnt] = tParent;
+    } else {
+      this.textSpans[cnt] = tSpan;
     }
+    this.textSpans[cnt].style.display = 'block';
+    this.textPaths[cnt] = tSpan;
+    cnt += 1;
+  }
+  while (cnt < this.textSpans.length) {
+    this.textSpans[cnt].style.display = 'none';
+    cnt += 1;
+  }
 };
 
-HTextElement.prototype.renderInnerContent = function() {
+HTextElement.prototype.renderInnerContent = function () {
+  var svgStyle;
+  if (this.data.singleShape) {
+    if (!this._isFirstFrame && !this.lettersChangedFlag) {
+      return;
+    } if (this.isMasked && this.finalTransform._matMdf) {
+      // Todo Benchmark if using this is better than getBBox
+      this.svgElement.setAttribute('viewBox', -this.finalTransform.mProp.p.v[0] + ' ' + -this.finalTransform.mProp.p.v[1] + ' ' + this.compW + ' ' + this.compH);
+      svgStyle = this.svgElement.style;
+      var translation = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
+      svgStyle.transform = translation;
+      svgStyle.webkitTransform = translation;
+    }
+  }
 
-    if(this.data.singleShape){
-        if(!this._isFirstFrame && !this.lettersChangedFlag){
-            return;
+  this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+  if (!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag) {
+    return;
+  }
+  var i;
+  var len;
+  var count = 0;
+  var renderedLetters = this.textAnimator.renderedLetters;
+
+  var letters = this.textProperty.currentData.l;
+
+  len = letters.length;
+  var renderedLetter;
+  var textSpan;
+  var textPath;
+  for (i = 0; i < len; i += 1) {
+    if (letters[i].n) {
+      count += 1;
+    } else {
+      textSpan = this.textSpans[i];
+      textPath = this.textPaths[i];
+      renderedLetter = renderedLetters[count];
+      count += 1;
+      if (renderedLetter._mdf.m) {
+        if (!this.isMasked) {
+          textSpan.style.webkitTransform = renderedLetter.m;
+          textSpan.style.transform = renderedLetter.m;
         } else {
-            // Todo Benchmark if using this is better than getBBox
-             if(this.isMasked && this.finalTransform._matMdf){
-                 this.svgElement.setAttribute('viewBox',-this.finalTransform.mProp.p.v[0]+' '+ -this.finalTransform.mProp.p.v[1]+' '+this.compW+' '+this.compH);
-                this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
-             }
+          textSpan.setAttribute('transform', renderedLetter.m);
         }
+      }
+      /// /textSpan.setAttribute('opacity',renderedLetter.o);
+      textSpan.style.opacity = renderedLetter.o;
+      if (renderedLetter.sw && renderedLetter._mdf.sw) {
+        textPath.setAttribute('stroke-width', renderedLetter.sw);
+      }
+      if (renderedLetter.sc && renderedLetter._mdf.sc) {
+        textPath.setAttribute('stroke', renderedLetter.sc);
+      }
+      if (renderedLetter.fc && renderedLetter._mdf.fc) {
+        textPath.setAttribute('fill', renderedLetter.fc);
+        textPath.style.color = renderedLetter.fc;
+      }
+    }
+  }
+
+  if (this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)) {
+    var boundingBox = this.innerElem.getBBox();
+
+    if (this.currentBBox.w !== boundingBox.width) {
+      this.currentBBox.w = boundingBox.width;
+      this.svgElement.setAttribute('width', boundingBox.width);
+    }
+    if (this.currentBBox.h !== boundingBox.height) {
+      this.currentBBox.h = boundingBox.height;
+      this.svgElement.setAttribute('height', boundingBox.height);
     }
 
-    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
-    if(!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag){
-        return;
+    var margin = 1;
+    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)) {
+      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;
+
+      this.svgElement.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
+      svgStyle = this.svgElement.style;
+      var svgTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
+      svgStyle.transform = svgTransform;
+      svgStyle.webkitTransform = svgTransform;
     }
-    var  i,len, count = 0;
-    var renderedLetters = this.textAnimator.renderedLetters;
-
-    var letters = this.textProperty.currentData.l;
-
-    len = letters.length;
-    var renderedLetter, textSpan, textPath;
-    for(i=0;i<len;i+=1){
-        if(letters[i].n){
-            count += 1;
-            continue;
-        }
-        textSpan = this.textSpans[i];
-        textPath = this.textPaths[i];
-        renderedLetter = renderedLetters[count];
-        count += 1;
-        if(renderedLetter._mdf.m) {
-            if(!this.isMasked){
-                textSpan.style.transform = textSpan.style.webkitTransform = renderedLetter.m;
-            }else{
-                textSpan.setAttribute('transform',renderedLetter.m);
-            }
-        }
-        ////textSpan.setAttribute('opacity',renderedLetter.o);
-        textSpan.style.opacity = renderedLetter.o;
-        if(renderedLetter.sw && renderedLetter._mdf.sw){
-            textPath.setAttribute('stroke-width',renderedLetter.sw);
-        }
-        if(renderedLetter.sc && renderedLetter._mdf.sc){
-            textPath.setAttribute('stroke',renderedLetter.sc);
-        }
-        if(renderedLetter.fc && renderedLetter._mdf.fc){
-            textPath.setAttribute('fill',renderedLetter.fc);
-            textPath.style.color = renderedLetter.fc;
-        }
-    }
-
-    if(this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)){
-        var boundingBox = this.innerElem.getBBox();
-
-        if(this.currentBBox.w !== boundingBox.width){
-            this.currentBBox.w = boundingBox.width;
-            this.svgElement.setAttribute('width',boundingBox.width);
-        }
-        if(this.currentBBox.h !== boundingBox.height){
-            this.currentBBox.h = boundingBox.height;
-            this.svgElement.setAttribute('height',boundingBox.height);
-        }
-
-        var margin = 1;
-        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)){
-            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;
-
-            this.svgElement.setAttribute('viewBox',this.currentBBox.x+' '+this.currentBBox.y+' '+this.currentBBox.w+' '+this.currentBBox.h);
-            this.svgElement.style.transform = this.svgElement.style.webkitTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
-        }
-    }
+  }
 };
-function HImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement,
+FrameElement, RenderableElement, createNS */
+
+function HImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement], HImageElement);
+extendPrototype([BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement);
 
+HImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  var img = new Image();
 
-HImageElement.prototype.createContent = function(){
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
-    var img = new Image();
-
-    if(this.data.hasMask){
-        this.imageElem = createNS('image');
-        this.imageElem.setAttribute('width',this.assetData.w+"px");
-        this.imageElem.setAttribute('height',this.assetData.h+"px");
-        this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-        this.layerElement.appendChild(this.imageElem);
-        this.baseElement.setAttribute('width',this.assetData.w);
-        this.baseElement.setAttribute('height',this.assetData.h);
-    } else {
-        this.layerElement.appendChild(img);
-    }
-    img.crossOrigin = 'anonymous';
-    img.src = assetPath;
-    if(this.data.ln){
-        this.baseElement.setAttribute('id',this.data.ln);
-    }
+  if (this.data.hasMask) {
+    this.imageElem = createNS('image');
+    this.imageElem.setAttribute('width', this.assetData.w + 'px');
+    this.imageElem.setAttribute('height', this.assetData.h + 'px');
+    this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
+    this.layerElement.appendChild(this.imageElem);
+    this.baseElement.setAttribute('width', this.assetData.w);
+    this.baseElement.setAttribute('height', this.assetData.h);
+  } else {
+    this.layerElement.appendChild(img);
+  }
+  img.crossOrigin = 'anonymous';
+  img.src = assetPath;
+  if (this.data.ln) {
+    this.baseElement.setAttribute('id', this.data.ln);
+  }
 };
-function HCameraElement(data,globalData,comp){
-    this.initFrame();
-    this.initBaseData(data,globalData,comp);
-    this.initHierarchy();
-    var getProp = PropertyFactory.getProp;
-    this.pe = getProp(this,data.pe,0,0,this);
-    if(data.ks.p.s){
-        this.px = getProp(this,data.ks.p.x,1,0,this);
-        this.py = getProp(this,data.ks.p.y,1,0,this);
-        this.pz = getProp(this,data.ks.p.z,1,0,this);
-    }else{
-        this.p = getProp(this,data.ks.p,1,0,this);
+
+/* global PropertyFactory, degToRads, Matrix, extendPrototype, BaseElement, FrameElement, HierarchyElement */
+
+function HCameraElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initHierarchy();
+  var getProp = PropertyFactory.getProp;
+  this.pe = getProp(this, data.pe, 0, 0, this);
+  if (data.ks.p.s) {
+    this.px = getProp(this, data.ks.p.x, 1, 0, this);
+    this.py = getProp(this, data.ks.p.y, 1, 0, this);
+    this.pz = getProp(this, data.ks.p.z, 1, 0, this);
+  } else {
+    this.p = getProp(this, data.ks.p, 1, 0, this);
+  }
+  if (data.ks.a) {
+    this.a = getProp(this, data.ks.a, 1, 0, this);
+  }
+  if (data.ks.or.k.length && data.ks.or.k[0].to) {
+    var i;
+    var len = data.ks.or.k.length;
+    for (i = 0; i < len; i += 1) {
+      data.ks.or.k[i].to = null;
+      data.ks.or.k[i].ti = null;
     }
-    if(data.ks.a){
-        this.a = getProp(this,data.ks.a,1,0,this);
-    }
-    if(data.ks.or.k.length && data.ks.or.k[0].to){
-        var i,len = data.ks.or.k.length;
-        for(i=0;i<len;i+=1){
-            data.ks.or.k[i].to = null;
-            data.ks.or.k[i].ti = null;
-        }
-    }
-    this.or = getProp(this,data.ks.or,1,degToRads,this);
-    this.or.sh = true;
-    this.rx = getProp(this,data.ks.rx,0,degToRads,this);
-    this.ry = getProp(this,data.ks.ry,0,degToRads,this);
-    this.rz = getProp(this,data.ks.rz,0,degToRads,this);
-    this.mat = new Matrix();
-    this._prevMat = new Matrix();
-    this._isFirstFrame = true;
-    
-    // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
-    this.finalTransform = {
-        mProp: this
-    };
+  }
+  this.or = getProp(this, data.ks.or, 1, degToRads, this);
+  this.or.sh = true;
+  this.rx = getProp(this, data.ks.rx, 0, degToRads, this);
+  this.ry = getProp(this, data.ks.ry, 0, degToRads, this);
+  this.rz = getProp(this, data.ks.rz, 0, degToRads, this);
+  this.mat = new Matrix();
+  this._prevMat = new Matrix();
+  this._isFirstFrame = true;
+
+  // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
+  this.finalTransform = {
+    mProp: this,
+  };
 }
 extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement);
 
-HCameraElement.prototype.setup = function() {
-    var i, len = this.comp.threeDElements.length, comp;
-    for(i=0;i<len;i+=1){
-        //[perspectiveElem,container]
+HCameraElement.prototype.setup = function () {
+  var i;
+  var len = this.comp.threeDElements.length;
+  var comp;
+  var perspectiveStyle;
+  var containerStyle;
+  for (i = 0; i < len; i += 1) {
+    // [perspectiveElem,container]
+    comp = this.comp.threeDElements[i];
+    if (comp.type === '3d') {
+      perspectiveStyle = comp.perspectiveElem.style;
+      containerStyle = comp.container.style;
+      var perspective = this.pe.v + 'px';
+      var origin = '0px 0px 0px';
+      var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+      perspectiveStyle.perspective = perspective;
+      perspectiveStyle.webkitPerspective = perspective;
+      containerStyle.transformOrigin = origin;
+      containerStyle.mozTransformOrigin = origin;
+      containerStyle.webkitTransformOrigin = origin;
+      perspectiveStyle.transform = matrix;
+      perspectiveStyle.webkitTransform = matrix;
+    }
+  }
+};
+
+HCameraElement.prototype.createElements = function () {
+};
+
+HCameraElement.prototype.hide = function () {
+};
+
+HCameraElement.prototype.renderFrame = function () {
+  var _mdf = this._isFirstFrame;
+  var i;
+  var len;
+  if (this.hierarchy) {
+    len = this.hierarchy.length;
+    for (i = 0; i < len; i += 1) {
+      _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
+    }
+  }
+  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)) {
+    this.mat.reset();
+
+    if (this.hierarchy) {
+      len = this.hierarchy.length - 1;
+      for (i = len; i >= 0; i -= 1) {
+        var mTransf = this.hierarchy[i].finalTransform.mProp;
+        this.mat.translate(-mTransf.p.v[0], -mTransf.p.v[1], mTransf.p.v[2]);
+        this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
+        this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
+        this.mat.scale(1 / mTransf.s.v[0], 1 / mTransf.s.v[1], 1 / mTransf.s.v[2]);
+        this.mat.translate(mTransf.a.v[0], mTransf.a.v[1], mTransf.a.v[2]);
+      }
+    }
+    if (this.p) {
+      this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]);
+    } else {
+      this.mat.translate(-this.px.v, -this.py.v, this.pz.v);
+    }
+    if (this.a) {
+      var diffVector;
+      if (this.p) {
+        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]];
+      } else {
+        diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
+      }
+      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));
+      var lookDir = [diffVector[0] / mag, diffVector[1] / mag, diffVector[2] / mag];
+      var lookLengthOnXZ = Math.sqrt(lookDir[2] * lookDir[2] + lookDir[0] * lookDir[0]);
+      var mRotationX = (Math.atan2(lookDir[1], lookLengthOnXZ));
+      var mRotationY = (Math.atan2(lookDir[0], -lookDir[2]));
+      this.mat.rotateY(mRotationY).rotateX(-mRotationX);
+    }
+    this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
+    this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
+    this.mat.translate(this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0);
+    this.mat.translate(0, 0, this.pe.v);
+
+    var hasMatrixChanged = !this._prevMat.equals(this.mat);
+    if ((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
+      len = this.comp.threeDElements.length;
+      var comp;
+      var perspectiveStyle;
+      var containerStyle;
+      for (i = 0; i < len; i += 1) {
         comp = this.comp.threeDElements[i];
-        if(comp.type === '3d') {
-            comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
-            comp.container.style.transformOrigin = comp.container.style.mozTransformOrigin = comp.container.style.webkitTransformOrigin = "0px 0px 0px";
-            comp.perspectiveElem.style.transform = comp.perspectiveElem.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
+        if (comp.type === '3d') {
+          if (hasMatrixChanged) {
+            var matValue = this.mat.toCSS();
+            containerStyle = comp.container.style;
+            containerStyle.transform = matValue;
+            containerStyle.webkitTransform = matValue;
+          }
+          if (this.pe._mdf) {
+            perspectiveStyle = comp.perspectiveElem.style;
+            perspectiveStyle.perspective = this.pe.v + 'px';
+            perspectiveStyle.webkitPerspective = this.pe.v + 'px';
+          }
         }
+      }
+      this.mat.clone(this._prevMat);
     }
+  }
+  this._isFirstFrame = false;
 };
 
-HCameraElement.prototype.createElements = function(){
+HCameraElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-HCameraElement.prototype.hide = function(){
+HCameraElement.prototype.destroy = function () {
 };
+HCameraElement.prototype.getBaseElement = function () { return null; };
 
-HCameraElement.prototype.renderFrame = function(){
-    var _mdf = this._isFirstFrame;
-    var i, len;
-    if(this.hierarchy){
-        len = this.hierarchy.length;
-        for(i=0;i<len;i+=1){
-            _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
-        }
-    }
-    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)) {
-        this.mat.reset();
-
-        if(this.hierarchy){
-            var mat;
-            len = this.hierarchy.length - 1;
-            for (i = len; i >= 0; i -= 1) {
-                var mTransf = this.hierarchy[i].finalTransform.mProp;
-                this.mat.translate(-mTransf.p.v[0],-mTransf.p.v[1],mTransf.p.v[2]);
-                this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
-                this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
-                this.mat.scale(1/mTransf.s.v[0],1/mTransf.s.v[1],1/mTransf.s.v[2]);
-                this.mat.translate(mTransf.a.v[0],mTransf.a.v[1],mTransf.a.v[2]);
-            }
-        }
-        if (this.p) {
-            this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]);
-        } else {
-            this.mat.translate(-this.px.v,-this.py.v,this.pz.v);
-        }
-        if (this.a) {
-            var diffVector
-            if (this.p) {
-                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]];
-            } else {
-                diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
-            }
-            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));
-            var lookDir = [diffVector[0]/mag,diffVector[1]/mag,diffVector[2]/mag];
-            var lookLengthOnXZ = Math.sqrt( lookDir[2]*lookDir[2] + lookDir[0]*lookDir[0] );
-            var m_rotationX = (Math.atan2( lookDir[1], lookLengthOnXZ ));
-            var m_rotationY = (Math.atan2( lookDir[0], -lookDir[2]));
-            this.mat.rotateY(m_rotationY).rotateX(-m_rotationX);
-
-        }
-        this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
-        this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
-        this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0);
-        this.mat.translate(0,0,this.pe.v);
-
-
-        
-
-        var hasMatrixChanged = !this._prevMat.equals(this.mat);
-        if((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
-            len = this.comp.threeDElements.length;
-            var comp;
-            for(i=0;i<len;i+=1){
-                comp = this.comp.threeDElements[i];
-                if(comp.type === '3d') {
-                    if(hasMatrixChanged) {
-                        comp.container.style.transform = comp.container.style.webkitTransform = this.mat.toCSS();
-                    }
-                    if(this.pe._mdf) {
-                        comp.perspectiveElem.style.perspective = comp.perspectiveElem.style.webkitPerspective = this.pe.v+'px';
-                    }
-                }
-            }
-            this.mat.clone(this._prevMat);
-        }
-    }
-    this._isFirstFrame = false;
-};
-
-HCameraElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
-};
-
-HCameraElement.prototype.destroy = function(){
-};
-HCameraElement.prototype.getBaseElement = function(){return null;};
 function HEffects() {
 }
-HEffects.prototype.renderFrame = function(){};
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
+HEffects.prototype.renderFrame = function () {};
 
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+/* global createTag, AnimationItem */
+/* exported animationManager */
+
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
+    while (i < len) {
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      window.requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            window.requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    window.requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        window.requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations(animationData, standalone, renderer) {
+    var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+      [].slice.call(document.getElementsByClassName('bodymovin')));
+    var i;
+    var lenAnims = animElements.length;
+    for (i = 0; i < lenAnims; i += 1) {
+      if (renderer) {
+        animElements[i].setAttribute('data-bm-type', renderer);
+      }
+      registerAnimation(animElements[i], animationData);
     }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
-                  [].slice.call(document.getElementsByClassName('bodymovin')));
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerText = '';
-            var div = createTag('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
+    if (standalone && lenAnims === 0) {
+      if (!renderer) {
+        renderer = 'svg';
+      }
+      var body = document.getElementsByTagName('body')[0];
+      body.innerText = '';
+      var div = createTag('div');
+      div.style.width = '100%';
+      div.style.height = '100%';
+      div.setAttribute('data-bm-type', renderer);
+      body.appendChild(div);
+      registerAnimation(div, animationData);
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                window.requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        window.requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function freeze() {
-        _isFrozen = true;
+  function freeze() {
+    _isFrozen = true;
+  }
+
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
+
+  function setVolume(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setVolume(val, animation);
     }
+  }
 
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
+  function mute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.mute(animation);
     }
+  }
 
-    function setVolume(val,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setVolume(val, animation);
-        }
+  function unmute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.unmute(animation);
     }
+  }
 
-    function mute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.mute(animation);
-        }
-    }
-
-    function unmute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.unmute(animation);
-        }
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.setVolume = setVolume;
-    moduleOb.mute = mute;
-    moduleOb.unmute = unmute;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.setVolume = setVolume;
+  moduleOb.mute = mute;
+  moduleOb.unmute = unmute;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
+/* global createElementID, subframeEnabled, ProjectInterface, ImagePreloader, audioControllerFactory, extendPrototype, BaseEvent,
+CanvasRenderer, SVGRenderer, HybridRenderer, assetLoader, dataManager, expressionsPlugin, BMEnterFrameEvent, BMCompleteLoopEvent,
+BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent,
+BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent */
+
 var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.firstFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.playCount = 0;
-    this.animationData = {};
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = createElementID();
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.isSubframeEnabled = subframeEnabled;
-    this.segments = [];
-    this._idle = true;
-    this._completedLoop = false;
-    this.projectInterface = ProjectInterface();
-    this.imagePreloader = new ImagePreloader();
-    this.audioController = audioControllerFactory();
+  this._cbs = [];
+  this.name = '';
+  this.path = '';
+  this.isLoaded = false;
+  this.currentFrame = 0;
+  this.currentRawFrame = 0;
+  this.firstFrame = 0;
+  this.totalFrames = 0;
+  this.frameRate = 0;
+  this.frameMult = 0;
+  this.playSpeed = 1;
+  this.playDirection = 1;
+  this.playCount = 0;
+  this.animationData = {};
+  this.assets = [];
+  this.isPaused = true;
+  this.autoplay = false;
+  this.loop = true;
+  this.renderer = null;
+  this.animationID = createElementID();
+  this.assetsPath = '';
+  this.timeCompleted = 0;
+  this.segmentPos = 0;
+  this.isSubframeEnabled = subframeEnabled;
+  this.segments = [];
+  this._idle = true;
+  this._completedLoop = false;
+  this.projectInterface = ProjectInterface();
+  this.imagePreloader = new ImagePreloader();
+  this.audioController = audioControllerFactory();
 };
 
 extendPrototype([BaseEvent], AnimationItem);
 
-AnimationItem.prototype.setParams = function(params) {
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-    if (params.loop === ''
+AnimationItem.prototype.setParams = function (params) {
+  if (params.wrapper || params.container) {
+    this.wrapper = params.wrapper || params.container;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    case 'svg':
+      this.renderer = new SVGRenderer(this, params.rendererSettings);
+      break;
+    default:
+      this.renderer = new HybridRenderer(this, params.rendererSettings);
+      break;
+  }
+  this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+  if (params.loop === ''
         || params.loop === null
         || params.loop === undefined
-        || params.loop === true)
-    {
-        this.loop = true;
-    } else if (params.loop === false) {
-        this.loop = false;
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = params.assetsPath;
+  this.initialSegment = params.initialSegment;
+  if (params.audioFactory) {
+    this.audioController.setAudioFactory(params.audioFactory);
+  }
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    if (params.path.lastIndexOf('\\') !== -1) {
+      this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
     } else {
-        this.loop = parseInt(params.loop);
+      this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
     }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = params.assetsPath;
-    this.initialSegment = params.initialSegment;
-    if (params.audioFactory) {
-        this.audioController.setAudioFactory(params.audioFactory);
-    }
-    if (params.animationData) {
-        this.configAnimation(params.animationData);
-    } else if(params.path){
+    this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
+    this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
 
-        if( params.path.lastIndexOf('\\') !== -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        } else {
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-
-        assetLoader.load(params.path, this.configAnimation.bind(this), function() {
-            this.trigger('data_failed');
-        }.bind(this));
-    }
-
+    assetLoader.load(params.path, this.configAnimation.bind(this), function () {
+      this.trigger('data_failed');
+    }.bind(this));
+  }
 };
 
 AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
+  if (animationData) {
+    if (typeof animationData !== 'object') {
+      animationData = JSON.parse(animationData);
     }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
+  }
+  var params = {
+    wrapper: wrapper,
+    animationData: animationData,
+  };
+  var wrapperAttributes = wrapper.attributes;
 
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
+  params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-animation-path').value
+    : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-path').value
+      : wrapperAttributes.getNamedItem('bm-path')
+        ? wrapperAttributes.getNamedItem('bm-path').value
+        : '';
+  params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-type').value
+    : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-type').value
+      : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
+        ? wrapperAttributes.getNamedItem('bm-type').value
+        : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
+          ? wrapperAttributes.getNamedItem('data-bm-renderer').value
+          : wrapperAttributes.getNamedItem('bm-renderer')
+            ? wrapperAttributes.getNamedItem('bm-renderer').value
+            : 'canvas';
 
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
+  var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-loop').value
+    : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-loop').value
+      : wrapperAttributes.getNamedItem('bm-loop')
+        ? wrapperAttributes.getNamedItem('bm-loop').value
+        : '';
+  if (loop === 'false') {
+    params.loop = false;
+  } else if (loop === 'true') {
+    params.loop = true;
+  } else if (loop !== '') {
+    params.loop = parseInt(loop, 10);
+  }
+  var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-autoplay').value
+    : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-autoplay').value
+      : wrapperAttributes.getNamedItem('bm-autoplay')
+        ? wrapperAttributes.getNamedItem('bm-autoplay').value
+        : true;
+  params.autoplay = autoplay !== 'false';
+
+  params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-name').value
+    : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-name').value
+      : wrapperAttributes.getNamedItem('bm-name')
+        ? wrapperAttributes.getNamedItem('bm-name').value
+        : '';
+  var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-prerender').value
+    : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-prerender').value
+      : wrapperAttributes.getNamedItem('bm-prerender')
+        ? wrapperAttributes.getNamedItem('bm-prerender').value
+        : '';
+
+  if (prerender === 'false') {
+    params.prerender = false;
+  }
+  this.setParams(params);
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
+  }
+  if (data.chars || data.fonts) {
+    this.renderer.globalData.fontManager.addChars(data.chars);
+    this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
+  }
+  if (data.assets) {
+    len = data.assets.length;
+    for (i = 0; i < len; i += 1) {
+      this.animationData.assets.push(data.assets[i]);
     }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
-        this.trigger('data_failed');
-    }.bind(this));
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.trigger('data_ready');
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  var segment = segments.shift();
+  this.timeCompleted = segment.time * this.frameRate;
+  var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
+  this.segmentPos += 1;
+  assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
+    this.trigger('data_failed');
+  }.bind(this));
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
-    }
-    this.loadNextSegment();
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.imagesLoaded = function() {
-    this.trigger('loaded_images');
-    this.checkLoaded()
-}
+AnimationItem.prototype.imagesLoaded = function () {
+  this.trigger('loaded_images');
+  this.checkLoaded();
+};
 
-AnimationItem.prototype.preloadImages = function() {
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
-}
+AnimationItem.prototype.preloadImages = function () {
+  this.imagePreloader.setAssetsPath(this.assetsPath);
+  this.imagePreloader.setPath(this.path);
+  this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
+};
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    try {
-        this.animationData = animData;
+  if (!this.renderer) {
+    return;
+  }
+  try {
+    this.animationData = animData;
 
-        if (this.initialSegment) {
-            this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
-            this.firstFrame = Math.round(this.initialSegment[0]);
-        } else {
-            this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-            this.firstFrame = Math.round(this.animationData.ip);
-        }
-        this.renderer.configAnimation(animData);
-        if(!animData.assets){
-            animData.assets = [];
-        }
-
-        this.assets = this.animationData.assets;
-        this.frameRate = this.animationData.fr;
-        this.frameMult = this.animationData.fr / 1000;
-        this.renderer.searchExtraCompositions(animData.assets);
-        this.trigger('config_ready');
-        this.preloadImages();
-        this.loadSegments();
-        this.updaFrameModifier();
-        this.waitForFontsLoaded();
-        if (this.isPaused) {
-            this.audioController.pause();
-        }
-    } catch(error) {
-        this.triggerConfigError(error);
+    if (this.initialSegment) {
+      this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+      this.firstFrame = Math.round(this.initialSegment[0]);
+    } else {
+      this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+      this.firstFrame = Math.round(this.animationData.ip);
     }
+    this.renderer.configAnimation(animData);
+    if (!animData.assets) {
+      animData.assets = [];
+    }
+
+    this.assets = this.animationData.assets;
+    this.frameRate = this.animationData.fr;
+    this.frameMult = this.animationData.fr / 1000;
+    this.renderer.searchExtraCompositions(animData.assets);
+    this.trigger('config_ready');
+    this.preloadImages();
+    this.loadSegments();
+    this.updaFrameModifier();
+    this.waitForFontsLoaded();
+    if (this.isPaused) {
+      this.audioController.pause();
+    }
+  } catch (error) {
+    this.triggerConfigError(error);
+  }
 };
 
-AnimationItem.prototype.waitForFontsLoaded = function(){
-    if(!this.renderer) {
-        return;
-    }
-    if(this.renderer.globalData.fontManager.isLoaded){
-        this.checkLoaded();
-    }else{
-        setTimeout(this.waitForFontsLoaded.bind(this),20);
-    }
-}
+AnimationItem.prototype.waitForFontsLoaded = function () {
+  if (!this.renderer) {
+    return;
+  }
+  if (this.renderer.globalData.fontManager.isLoaded) {
+    this.checkLoaded();
+  } else {
+    setTimeout(this.waitForFontsLoaded.bind(this), 20);
+  }
+};
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded 
+  if (!this.isLoaded
         && this.renderer.globalData.fontManager.isLoaded
         && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')
-    ) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function() {
-            this.trigger('DOMLoaded');
-        }.bind(this), 0);
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
+  ) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    setTimeout(function () {
+      this.trigger('DOMLoaded');
+    }.bind(this), 0);
+    this.gotoFrame();
+    if (this.autoplay) {
+      this.play();
+    }
+  }
 };
 
 AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
+  this.renderer.updateContainerSize();
 };
 
-AnimationItem.prototype.setSubframe = function(flag){
-    this.isSubframeEnabled = !!flag;
+AnimationItem.prototype.setSubframe = function (flag) {
+  this.isSubframeEnabled = !!flag;
 };
 
 AnimationItem.prototype.gotoFrame = function () {
-    this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
+  this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
 
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
+  if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
+    this.currentFrame = this.timeCompleted;
+  }
+  this.trigger('enterFrame');
+  this.renderFrame();
 };
 
 AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    try {
-        this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-    } catch(error) {
-        this.triggerRenderFrameError(error);
-    }
+  if (this.isLoaded === false) {
+    return;
+  }
+  try {
+    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
+  } catch (error) {
+    this.triggerRenderFrameError(error);
+  }
 };
 
 AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.isPaused = false;
+    this.audioController.resume();
+    if (this._idle) {
+      this._idle = false;
+      this.trigger('_active');
     }
-    if (this.isPaused === true) {
-        this.isPaused = false;
-        this.audioController.resume();
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
+  }
 };
 
 AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        this._idle = true;
-        this.trigger('_idle');
-        this.audioController.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === false) {
+    this.isPaused = true;
+    this._idle = true;
+    this.trigger('_idle');
+    this.audioController.pause();
+  }
 };
 
 AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.play();
+  } else {
+    this.pause();
+  }
 };
 
 AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.playCount = 0;
-    this._completedLoop = false;
-    this.setCurrentRawFrameValue(0);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.pause();
+  this.playCount = 0;
+  this._completedLoop = false;
+  this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
+  if (name && this.name !== name) {
+    return;
+  }
+  if (isFrame) {
+    this.setCurrentRawFrameValue(value);
+  } else {
+    this.setCurrentRawFrameValue(value * this.frameModifier);
+  }
+  this.pause();
 };
 
 AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
+  this.goToAndStop(value, isFrame, name);
+  this.play();
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    var nextValue = this.currentRawFrame + value * this.frameModifier;
-    var _isComplete = false;
-    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
-    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
-    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
-        if (!this.loop || this.playCount === this.loop) {
-            if (!this.checkSegments(nextValue >  this.totalFrames ? nextValue % this.totalFrames : 0)) {
-                _isComplete = true;
-                nextValue = this.totalFrames - 1;
-            }
-        } else if (nextValue >= this.totalFrames) {
-            this.playCount += 1;
-            if (!this.checkSegments(nextValue % this.totalFrames)) {
-                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
-                this._completedLoop = true;
-                this.trigger('loopComplete');
-            }
-        } else {
-            this.setCurrentRawFrameValue(nextValue);
-        }
-    } else if(nextValue < 0) {
-        if (!this.checkSegments(nextValue % this.totalFrames)) {
-            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
-                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
-                if(!this._completedLoop) {
-                    this._completedLoop = true;
-                } else {
-                    this.trigger('loopComplete');
-                }
-            } else {
-                _isComplete = true;
-                nextValue = 0;
-            }
-        }
+  if (this.isPaused === true || this.isLoaded === false) {
+    return;
+  }
+  var nextValue = this.currentRawFrame + value * this.frameModifier;
+  var _isComplete = false;
+  // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+  // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+  if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+    if (!this.loop || this.playCount === this.loop) {
+      if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
+        _isComplete = true;
+        nextValue = this.totalFrames - 1;
+      }
+    } else if (nextValue >= this.totalFrames) {
+      this.playCount += 1;
+      if (!this.checkSegments(nextValue % this.totalFrames)) {
+        this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+        this._completedLoop = true;
+        this.trigger('loopComplete');
+      }
     } else {
-        this.setCurrentRawFrameValue(nextValue);
+      this.setCurrentRawFrameValue(nextValue);
     }
-    if (_isComplete) {
-        this.setCurrentRawFrameValue(nextValue);
-        this.pause();
-        this.trigger('complete');
+  } else if (nextValue < 0) {
+    if (!this.checkSegments(nextValue % this.totalFrames)) {
+      if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) { // eslint-disable-line no-plusplus
+        this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+        if (!this._completedLoop) {
+          this._completedLoop = true;
+        } else {
+          this.trigger('loopComplete');
+        }
+      } else {
+        _isComplete = true;
+        nextValue = 0;
+      }
     }
+  } else {
+    this.setCurrentRawFrameValue(nextValue);
+  }
+  if (_isComplete) {
+    this.setCurrentRawFrameValue(nextValue);
+    this.pause();
+    this.trigger('complete');
+  }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr, offset){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0.001 + offset);
+AnimationItem.prototype.adjustSegment = function (arr, offset) {
+  this.playCount = 0;
+  if (arr[1] < arr[0]) {
+    if (this.frameModifier > 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(-1);
+      }
     }
-    this.trigger('segmentStart');
+    this.totalFrames = arr[0] - arr[1];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[1];
+    this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
+  } else if (arr[1] > arr[0]) {
+    if (this.frameModifier < 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(1);
+      }
+    }
+    this.totalFrames = arr[1] - arr[0];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[0];
+    this.setCurrentRawFrameValue(0.001 + offset);
+  }
+  this.trigger('segmentStart');
 };
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init;
-        }
+AnimationItem.prototype.setSegment = function (init, end) {
+  var pendingFrame = -1;
+  if (this.isPaused) {
+    if (this.currentRawFrame + this.firstFrame < init) {
+      pendingFrame = init;
+    } else if (this.currentRawFrame + this.firstFrame > end) {
+      pendingFrame = end - init;
     }
+  }
 
-    this.firstFrame = init;
-    this.timeCompleted = this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
+  this.firstFrame = init;
+  this.totalFrames = end - init;
+  this.timeCompleted = this.totalFrames;
+  if (pendingFrame !== -1) {
+    this.goToAndStop(pendingFrame, true);
+  }
 };
 
 AnimationItem.prototype.playSegments = function (arr, forceFlag) {
-    if (forceFlag) {
-        this.segments.length = 0;
+  if (forceFlag) {
+    this.segments.length = 0;
+  }
+  if (typeof arr[0] === 'object') {
+    var i;
+    var len = arr.length;
+    for (i = 0; i < len; i += 1) {
+      this.segments.push(arr[i]);
     }
-    if (typeof arr[0] === 'object') {
-        var i, len = arr.length;
-        for (i = 0; i < len; i += 1) {
-            this.segments.push(arr[i]);
-        }
-    } else {
-        this.segments.push(arr);
-    }
-    if (this.segments.length && forceFlag) {
-        this.adjustSegment(this.segments.shift(), 0);
-    }
-    if (this.isPaused) {
-        this.play();
-    }
+  } else {
+    this.segments.push(arr);
+  }
+  if (this.segments.length && forceFlag) {
+    this.adjustSegment(this.segments.shift(), 0);
+  }
+  if (this.isPaused) {
+    this.play();
+  }
 };
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip,this.animationData.op]);
-    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if (forceFlag) {
-        this.checkSegments(0);
-    }
+  this.segments.length = 0;
+  this.segments.push([this.animationData.ip, this.animationData.op]);
+  // this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+  if (forceFlag) {
+    this.checkSegments(0);
+  }
 };
-AnimationItem.prototype.checkSegments = function(offset) {
-    if (this.segments.length) {
-        this.adjustSegment(this.segments.shift(), offset);
-        return true;
-    }
-    return false;
+AnimationItem.prototype.checkSegments = function (offset) {
+  if (this.segments.length) {
+    this.adjustSegment(this.segments.shift(), offset);
+    return true;
+  }
+  return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this.imagePreloader.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this.imagePreloader.destroy();
+  this.trigger('destroy');
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
+  this.renderer = null;
+  this.imagePreloader = null;
+  this.projectInterface = null;
 };
 
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    this.gotoFrame();
+AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
+  this.currentRawFrame = value;
+  this.gotoFrame();
 };
 
 AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
+  this.playSpeed = val;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
+  this.playDirection = val < 0 ? -1 : 1;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setVolume = function (val, name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.setVolume(val);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.setVolume(val);
 };
 
 AnimationItem.prototype.getVolume = function () {
-    return this.audioController.getVolume();
+  return this.audioController.getVolume();
 };
 
 AnimationItem.prototype.mute = function (name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.mute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.mute();
 };
 
 AnimationItem.prototype.unmute = function (name) {
-    if(name && this.name !== name){
-        return;
-    }
-    this.audioController.unmute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.unmute();
 };
 
 AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-    this.audioController.setRate(this.playSpeed * this.playDirection)
+  this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
+  this.audioController.setRate(this.playSpeed * this.playDirection);
 };
 
 AnimationItem.prototype.getPath = function () {
-    return this.path;
+  return this.path;
 };
 
 AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(assetData.e) {
-        path = assetData.p;
-    } else if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
+  var path = '';
+  if (assetData.e) {
+    path = assetData.p;
+  } else if (this.assetsPath) {
+    var imagePath = assetData.p;
+    if (imagePath.indexOf('images/') !== -1) {
+      imagePath = imagePath.split('/')[1];
     }
-    return path;
+    path = this.assetsPath + imagePath;
+  } else {
+    path = this.path;
+    path += assetData.u ? assetData.u : '';
+    path += assetData.p;
+  }
+  return path;
 };
 
 AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
+  var i = 0;
+  var len = this.assets.length;
+  while (i < len) {
+    if (id === this.assets[i].id) {
+      return this.assets[i];
     }
+    i += 1;
+  }
+  return null;
 };
 
 AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
+  this.renderer.hide();
 };
 
 AnimationItem.prototype.show = function () {
-    this.renderer.show();
+  this.renderer.show();
 };
 
 AnimationItem.prototype.getDuration = function (isFrame) {
-    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+  return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
 };
 
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
+AnimationItem.prototype.trigger = function (name) {
+  if (this._cbs && this._cbs[name]) {
+    switch (name) {
+      case 'enterFrame':
+        this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
+        break;
+      case 'loopComplete':
+        this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+        break;
+      case 'complete':
+        this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
+        break;
+      case 'segmentStart':
+        this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+        break;
+      case 'destroy':
+        this.triggerEvent(name, new BMDestroyEvent(name, this));
+        break;
+      default:
+        this.triggerEvent(name);
     }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
+  }
+  if (name === 'enterFrame' && this.onEnterFrame) {
+    this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
+  }
+  if (name === 'loopComplete' && this.onLoopComplete) {
+    this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+  }
+  if (name === 'complete' && this.onComplete) {
+    this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
+  }
+  if (name === 'segmentStart' && this.onSegmentStart) {
+    this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+  }
+  if (name === 'destroy' && this.onDestroy) {
+    this.onDestroy.call(this, new BMDestroyEvent(name, this));
+  }
 };
 
-AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
+AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
+  var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-    var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
 
-    if (this.onError) {
-        this.onError.call(this, error);
-    }
+AnimationItem.prototype.triggerConfigError = function (nativeError) {
+  var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
+
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
+
+/* exported EffectsManager */
+
+function EffectsManager() {
+  this.effectElements = [];
 }
 
-AnimationItem.prototype.triggerConfigError = function(nativeError) {
-
-    var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
-    }
-}
-function EffectsManager(){
-    this.effectElements = [];
-}
 
 var lottie = {};
 
-var _isFrozen = false;
-
-function setLocationHref (href) {
-    locationHref = href;
+function setLocationHref(href) {
+  locationHref = href;
 }
 
 function searchAnimations() {
-    if (standalone === true) {
-        animationManager.searchAnimations(animationData, standalone, renderer);
-    } else {
-        animationManager.searchAnimations();
-    }
+  if (standalone === true) {
+    animationManager.searchAnimations(animationData, standalone, renderer);
+  } else {
+    animationManager.searchAnimations();
+  }
 }
 
 function setSubframeRendering(flag) {
-    subframeEnabled = flag;
+  subframeEnabled = flag;
 }
 
 function loadAnimation(params) {
-    if (standalone === true) {
-        params.animationData = JSON.parse(animationData);
-    }
-    return animationManager.loadAnimation(params);
+  if (standalone === true) {
+    params.animationData = JSON.parse(animationData);
+  }
+  return animationManager.loadAnimation(params);
 }
 
 function setQuality(value) {
-    if (typeof value === 'string') {
-        switch (value) {
-            case 'high':
-                defaultCurveSegments = 200;
-                break;
-            case 'medium':
-                defaultCurveSegments = 50;
-                break;
-            case 'low':
-                defaultCurveSegments = 10;
-                break;
-        }
-    } else if (!isNaN(value) && value > 1) {
-        defaultCurveSegments = value;
+  if (typeof value === 'string') {
+    switch (value) {
+      case 'high':
+        defaultCurveSegments = 200;
+        break;
+      default:
+      case 'medium':
+        defaultCurveSegments = 50;
+        break;
+      case 'low':
+        defaultCurveSegments = 10;
+        break;
     }
-    if (defaultCurveSegments >= 50) {
-        roundValues(false);
-    } else {
-        roundValues(true);
-    }
+  } else if (!isNaN(value) && value > 1) {
+    defaultCurveSegments = value;
+  }
+  if (defaultCurveSegments >= 50) {
+    roundValues(false);
+  } else {
+    roundValues(true);
+  }
 }
 
 function inBrowser() {
-    return typeof navigator !== 'undefined';
+  return typeof navigator !== 'undefined';
 }
 
 function installPlugin(type, plugin) {
-    if (type === 'expressions') {
-        expressionsPlugin = plugin;
-    }
+  if (type === 'expressions') {
+    expressionsPlugin = plugin;
+  }
 }
 
 function getFactory(name) {
-    switch (name) {
-        case "propertyFactory":
-            return PropertyFactory;
-        case "shapePropertyFactory":
-            return ShapePropertyFactory;
-        case "matrix":
-            return Matrix;
-    }
+  switch (name) {
+    case 'propertyFactory':
+      return PropertyFactory;
+    case 'shapePropertyFactory':
+      return ShapePropertyFactory;
+    case 'matrix':
+      return Matrix;
+    default:
+      return null;
+  }
 }
 
 lottie.play = animationManager.play;
@@ -11111,7 +11801,7 @@
 lottie.loadAnimation = loadAnimation;
 lottie.setSubframeRendering = setSubframeRendering;
 lottie.resize = animationManager.resize;
-//lottie.start = start;
+// lottie.start = start;
 lottie.goToAndStop = animationManager.goToAndStop;
 lottie.destroy = animationManager.destroy;
 lottie.setQuality = setQuality;
@@ -11124,35 +11814,37 @@
 lottie.unmute = animationManager.unmute;
 lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
 lottie.__getFactory = getFactory;
-lottie.version = '5.7.5';
+lottie.version = '5.7.6';
 
 function checkReady() {
-    if (document.readyState === "complete") {
-        clearInterval(readyStateCheckInterval);
-        searchAnimations();
-    }
+  if (document.readyState === 'complete') {
+    clearInterval(readyStateCheckInterval);
+    searchAnimations();
+  }
 }
 
 function getQueryVariable(variable) {
-    var vars = queryString.split('&');
-    for (var i = 0; i < vars.length; i++) {
-        var pair = vars[i].split('=');
-        if (decodeURIComponent(pair[0]) == variable) {
-            return decodeURIComponent(pair[1]);
-        }
+  var vars = queryString.split('&');
+  for (var i = 0; i < vars.length; i += 1) {
+    var pair = vars[i].split('=');
+    if (decodeURIComponent(pair[0]) == variable) { // eslint-disable-line eqeqeq
+      return decodeURIComponent(pair[1]);
     }
+  }
+  return null;
 }
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
+var queryString;
 if (standalone) {
-    var scripts = document.getElementsByTagName('script');
-    var index = scripts.length - 1;
-    var myScript = scripts[index] || {
-        src: ''
-    };
-    var queryString = myScript.src.replace(/^[^\?]+\??/, '');
-    renderer = getQueryVariable('renderer');
+  var scripts = document.getElementsByTagName('script');
+  var index = scripts.length - 1;
+  var myScript = scripts[index] || {
+    src: '',
+  };
+  queryString = myScript.src.replace(/^[^\?]+\??/, ''); // eslint-disable-line no-useless-escape
+  renderer = getQueryVariable('renderer');
 }
 var readyStateCheckInterval = setInterval(checkReady, 100);
 
diff --git a/build/player/lottie_light_html.min.js b/build/player/lottie_light_html.min.js
index 0adbf65..9351e71 100644
--- a/build/player/lottie_light_html.min.js
+++ b/build/player/lottie_light_html.min.js
@@ -10,6 +10,6 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";var h,e="http://www.w3.org/2000/svg",k="",s=-999999,i=!0,n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),_=(Math.round,Math.pow),x=Math.sqrt,f=(Math.abs,Math.floor),d=Math.max,c=Math.min,a={};!function(){var t,e=["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"],s=e.length;for(t=0;t<s;t+=1)a[e[t]]=Math[e[t]]}(),a.random=Math.random,a.abs=function(t){if("object"===typeof t&&t.length){var e,s=S(t.length),i=t.length;for(e=0;e<i;e+=1)s[e]=Math.abs(t[e]);return s}return Math.abs(t)};var w=150,q=Math.PI/180,v=.5519;function r(t){t?Math.round:function(t){return t}}function b(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function o(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function l(t,e){this.type=t,this.direction=e<0?-1:1}function p(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}function m(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function u(t,e){this.type=t,this.target=e}function g(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function y(t){this.type="configError",this.nativeError=t}r(!1);var t,A=(t=0,function(){return"__lottie_element_"+ ++t});function P(t,e,s){var i,a,r,n,h,o,l,p;switch(o=s*(1-e),l=s*(1-(h=6*t-(n=Math.floor(6*t)))*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function C(t,e,s){var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function lt(t,e){var s=C(255*t[0],255*t[1],255*t[2]);return s[1]+=e,1<s[1]?s[1]=1:s[1]<=0&&(s[1]=0),P(s[0],s[1],s[2])}function pt(t,e){var s=C(255*t[0],255*t[1],255*t[2]);return s[2]+=e,1<s[2]?s[2]=1:s[2]<0&&(s[2]=0),P(s[0],s[1],s[2])}function ft(t,e){var s=C(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,1<s[0]?s[0]-=1:s[0]<0&&(s[0]+=1),P(s[0],s[1],s[2])}!function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1==e.length?"0"+e:e}();function D(){}D.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;i<s;i++)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s-=1,i-=1),s+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var j="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var s,i=0,a=[];switch(t){case"int16":case"uint8c":s=1;break;default:s=1.1}for(i=0;i<e;i+=1)a.push(s);return a};function S(t){return Array.apply(null,{length:t})}function E(t){return document.createElementNS(e,t)}function T(t){return document.createElement(t)}function M(){}M.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var F,I=(F={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return F[t]||""}),L=function(){var a=Math.cos,r=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function s(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var s=a(e),i=r(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}function m(t,e,s){return s||0===s||(s=1),1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}function d(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=a,this.props[5]=r,this.props[6]=n,this.props[7]=h,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=d,this.props[14]=c,this.props[15]=u,this}function c(t,e,s){return s=s||0,0!==t||0!==e||0!==s?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1):this}function u(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){var g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===a&&1===r&&0===n&&0===h&&0===o&&0===l&&1===p&&0===f)return g[12]=g[12]*t+g[15]*m,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*c,g[15]=g[15]*u,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],_=g[3],x=g[4],k=g[5],w=g[6],A=g[7],P=g[8],C=g[9],D=g[10],S=g[11],E=g[12],T=g[13],M=g[14],F=g[15];return g[0]=y*t+v*a+b*o+_*m,g[1]=y*e+v*r+b*l+_*d,g[2]=y*s+v*n+b*p+_*c,g[3]=y*i+v*h+b*f+_*u,g[4]=x*t+k*a+w*o+A*m,g[5]=x*e+k*r+w*l+A*d,g[6]=x*s+k*n+w*p+A*c,g[7]=x*i+k*h+w*f+A*u,g[8]=P*t+C*a+D*o+S*m,g[9]=P*e+C*r+D*l+S*d,g[10]=P*s+C*n+D*p+S*c,g[11]=P*i+C*h+D*f+S*u,g[12]=E*t+T*a+M*o+F*m,g[13]=E*e+T*r+M*l+F*d,g[14]=E*s+T*n+M*p+F*c,g[15]=E*i+T*h+M*f+F*u,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function _(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}function x(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function k(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function w(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function A(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,a=this.props[0]/t,r=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,h=new L;return h.props[0]=e,h.props[1]=s,h.props[4]=i,h.props[5]=a,h.props[12]=r,h.props[13]=n,h}function P(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function C(t){var e,s=t.length,i=[];for(e=0;e<s;e+=1)i[e]=P(t[e]);return i}function D(t,e,s){var i=j("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=s[0],i[5]=s[1];else{var a=this.props[0],r=this.props[1],n=this.props[4],h=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*a+t[1]*n+o,i[1]=t[0]*r+t[1]*h+l,i[2]=e[0]*a+e[1]*n+o,i[3]=e[0]*r+e[1]*h+l,i[4]=s[0]*a+s[1]*n+o,i[5]=s[0]*r+s[1]*h+l}return i}function S(t,e,s){return this.isIdentity()?[t,e,s]:[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}function E(t,e){if(this.isIdentity())return t+","+e;var s=this.props;return Math.round(100*(t*s[0]+e*s[4]+s[12]))/100+","+Math.round(100*(t*s[1]+e*s[5]+s[13]))/100}function T(){for(var t=0,e=this.props,s="matrix3d(";t<16;)s+=i(1e4*e[t])/1e4,s+=15===t?")":",",t+=1;return s}function M(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function F(){var t=this.props;return"matrix("+M(t[0])+","+M(t[1])+","+M(t[4])+","+M(t[5])+","+M(t[12])+","+M(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=s,this.rotateY=h,this.rotateZ=o,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=d,this.translate=c,this.transform=u,this.applyToPoint=_,this.applyToX=x,this.applyToY=k,this.applyToZ=w,this.applyToPointArray=S,this.applyToTriplePoints=D,this.applyToPointStringified=E,this.toCSS=T,this.to2dCSS=F,this.clone=v,this.cloneFromProps=b,this.equals=y,this.inversePoints=C,this.inversePoint=P,this.getInverseMatrix=A,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=j("float32",16),this.reset()}}();!function(h,o){var l,p=this,f=256,m=6,d="random",c=o.pow(f,m),u=o.pow(2,52),g=2*u,y=f-1;function v(t){var e,s=t.length,n=this,i=0,a=n.i=n.j=0,r=n.S=[];for(s||(t=[s++]);i<f;)r[i]=i++;for(i=0;i<f;i++)r[i]=r[a=y&a+t[i%s]+(e=r[i])],r[a]=e;n.g=function(t){for(var e,s=0,i=n.i,a=n.j,r=n.S;t--;)e=r[i=y&i+1],s=s*f+r[y&(r[i]=r[a=y&a+e])+(r[a]=e)];return n.i=i,n.j=a,s}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function _(t,e){for(var s,i=t+"",a=0;a<i.length;)e[y&a]=y&(s^=19*e[y&a])+i.charCodeAt(a++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}o["seed"+d]=function(t,e,s){var i=[],a=_(function t(e,s){var i,a=[],r=typeof e;if(s&&"object"==r)for(i in e)try{a.push(t(e[i],s-1))}catch(t){}return a.length?a:"string"==r?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,x(h)]:null===t?function(){try{if(l)return x(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),x(t)}catch(t){var e=p.navigator,s=e&&e.plugins;return[+new Date,p,s,p.screen,x(h)]}}():t,3),i),r=new v(i),n=function(){for(var t=r.g(m),e=c,s=0;t<u;)t=(t+s)*f,e*=f,s=r.g(1);for(;g<=t;)t/=2,e/=2,s>>>=1;return(t+s)/e};return n.int32=function(){return 0|r.g(4)},n.quick=function(){return r.g(4)/4294967296},n.double=n,_(x(r.S),h),(e.pass||s||function(t,e,s,i){return i&&(i.S&&b(i,r),t.state=function(){return b(r,{})}),s?(o[d]=t,e):t})(n,a,"global"in e?e.global:this==o,e.state)},_(o.random(),h)}([],a);var W=function(){var t={getBezierEasing:function(t,e,s,i,a){var r=a||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");if(h[r])return h[r];var n=new o([t,e,s,i]);return h[r]=n}},h={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function a(t,e){return 3*e-6*t}function r(t){return 3*t}function f(t,e,s){return((i(e,s)*t+a(e,s))*t+r(e))*t}function m(t,e,s){return 3*i(e,s)*t*t+2*a(e,s)*t+r(e)}function o(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return o.prototype={get:function(t){var e=this._p[0],s=this._p[1],i=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===s&&i===a?t:0===t?0:1===t?1:f(this._getTForX(t),s,a)},_precompute:function(){var t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&s===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;s<l;++s)this._mSampleValues[s]=f(s*p,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,a=0,r=1,n=l-1;r!==n&&i[r]<=t;++r)a+=p;var h=a+(t-i[--r])/(i[r+1]-i[r])*p,o=m(h,e,s);return.001<=o?function(t,e,s,i){for(var a=0;a<4;++a){var r=m(e,s,i);if(0===r)return e;e-=(f(e,s,i)-t)/r}return e}(t,h,e,s):0===o?h:function(t,e,s,i,a){for(var r,n,h=0;0<(r=f(n=e+(s-e)/2,i,a)-t)?s=n:e=n,1e-7<Math.abs(r)&&++h<10;);return n}(t,a,a+p,e,s)}},t}();function B(t,e){var s,i,a=t.length;for(s=0;s<a;s+=1)for(var r in i=t[s].prototype)i.hasOwnProperty(r)&&(e.prototype[r]=i[r])}!function(){for(var r=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var s=(new Date).getTime(),i=Math.max(0,16-(s-r)),a=setTimeout(function(){t(s+i)},i);return r=s+i,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var mt=function(){function g(t,e,s,i,a,r){var n=t*i+e*a+s*r-a*i-r*t-s*e;return-.001<n&&n<.001}Math;var p=function(t,e,s,i){var a,r,n,h,o,l,p=w,f=0,m=[],d=[],c=Tt.newElement();for(n=s.length,a=0;a<p;a+=1){for(o=a/(p-1),r=l=0;r<n;r+=1)h=_(1-o,3)*t[r]+3*_(1-o,2)*o*s[r]+3*(1-o)*_(o,2)*i[r]+_(o,3)*e[r],m[r]=h,null!==d[r]&&(l+=_(m[r]-d[r],2)),d[r]=m[r];l&&(f+=l=x(l)),c.percents[a]=o,c.lengths[a]=f}return c.addedLength=f,c};function y(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,s,i){var a=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+s[0]+"_"+s[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!b[a]){var r,n,h,o,l,p,f,m=w,d=0,c=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&g(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&g(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var u=new y(m);for(h=s.length,r=0;r<m;r+=1){for(f=S(h),l=r/(m-1),n=p=0;n<h;n+=1)o=_(1-l,3)*t[n]+3*_(1-l,2)*l*(t[n]+s[n])+3*(1-l)*_(l,2)*(e[n]+i[n])+_(l,3)*e[n],f[n]=o,null!==c&&(p+=_(f[n]-c[n],2));d+=p=x(p),u.points[r]=new v(p,f),c=f}u.segmentLength=d,b[a]=u}return b[a]});function E(t,e){var s=e.percents,i=e.lengths,a=s.length,r=f((a-1)*t),n=t*e.addedLength,h=0;if(r===a-1||0===r||n===i[r])return s[r];for(var o=i[r]>n?-1:1,l=!0;l;)if(i[r]<=n&&i[r+1]>n?(h=(n-i[r])/(i[r+1]-i[r]),l=!1):r+=o,r<0||a-1<=r){if(r===a-1)return s[r];l=!1}return s[r]+(s[r+1]-s[r])*h}var T=j("float32",8);return{getSegmentsLength:function(t){var e,s=Et.newElement(),i=t.c,a=t.v,r=t.o,n=t.i,h=t._length,o=s.lengths,l=0;for(e=0;e<h-1;e+=1)o[e]=p(a[e],a[e+1],r[e],n[e+1]),l+=o[e].addedLength;return i&&h&&(o[e]=p(a[e],a[0],r[e],n[0]),l+=o[e].addedLength),s.totalLength=l,s},getNewSegment:function(t,e,s,i,a,r,n){var h,o=E(a=a<0?0:1<a?1:a,n),l=E(r=1<r?1:r,n),p=t.length,f=1-o,m=1-l,d=f*f*f,c=o*f*f*3,u=o*o*f*3,g=o*o*o,y=f*f*m,v=o*f*m+f*o*m+f*f*l,b=o*o*m+f*o*l+o*f*l,_=o*o*l,x=f*m*m,k=o*m*m+f*l*m+f*m*l,w=o*l*m+f*l*l+o*m*l,A=o*l*l,P=m*m*m,C=l*m*m+m*l*m+m*m*l,D=l*l*m+m*l*l+l*m*l,S=l*l*l;for(h=0;h<p;h+=1)T[4*h]=Math.round(1e3*(d*t[h]+c*s[h]+u*i[h]+g*e[h]))/1e3,T[4*h+1]=Math.round(1e3*(y*t[h]+v*s[h]+b*i[h]+_*e[h]))/1e3,T[4*h+2]=Math.round(1e3*(x*t[h]+k*s[h]+w*i[h]+A*e[h]))/1e3,T[4*h+3]=Math.round(1e3*(P*t[h]+C*s[h]+D*i[h]+S*e[h]))/1e3;return T},getPointInSegment:function(t,e,s,i,a,r){var n=E(a,r),h=1-n;return[Math.round(1e3*(h*h*h*t[0]+(n*h*h+h*n*h+h*h*n)*s[0]+(n*n*h+h*n*n+n*h*n)*i[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(h*h*h*t[1]+(n*h*h+h*n*h+h*h*n)*s[1]+(n*n*h+h*n*n+n*h*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:g,pointOnLine3D:function(t,e,s,i,a,r,n,h,o){if(0===s&&0===r&&0===o)return g(t,e,i,a,n,h);var l,p=Math.sqrt(Math.pow(i-t,2)+Math.pow(a-e,2)+Math.pow(r-s,2)),f=Math.sqrt(Math.pow(n-t,2)+Math.pow(h-e,2)+Math.pow(o-s,2)),m=Math.sqrt(Math.pow(n-i,2)+Math.pow(h-a,2)+Math.pow(o-r,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}();var z=function(){function m(t,e,s){var i,a,r,n,h,o,l,p=t.length;for(a=0;a<p;a+=1)if("ks"in(i=t[a])&&!i.completed){if(i.completed=!0,i.tt&&(t[a-1].td=i.tt),i.hasMask){var f=i.masksProperties;for(n=f.length,r=0;r<n;r+=1)if(f[r].pt.k.i)u(f[r].pt.k);else for(o=f[r].pt.k.length,h=0;h<o;h+=1)f[r].pt.k[h].s&&u(f[r].pt.k[h].s[0]),f[r].pt.k[h].e&&u(f[r].pt.k[h].e[0])}0===i.ty?(i.layers=d(i.refId,e),m(i.layers,e,s)):4===i.ty?c(i.shapes):5==i.ty&&(0!==(l=i).t.a.length||"m"in l.t.p||(l.singleShape=!0))}}function d(t,e){for(var s=0,i=e.length;s<i;){if(e[s].id===t)return e[s].layers.__used?JSON.parse(JSON.stringify(e[s].layers)):(e[s].layers.__used=!0,e[s].layers);s+=1}}function c(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)u(t[e].ks.k);else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&u(t[e].ks.k[s].s[0]),t[e].ks.k[s].e&&u(t[e].ks.k[s].e[0]);else"gr"==t[e].ty&&c(t[e].it)}function u(t){var e,s=t.i.length;for(e=0;e<s;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function h(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&void 0))}var o,s=function(){var i=[4,4,14];function a(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)5===t[e].ty&&(s=t[e],i=s.t.d,s.t.d={k:[{s:i,t:0}]})}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),i=(o=[4,7,99],function(t){if(t.chars&&!h(o,t.v)){var e,s,i,a,r,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(r=t.chars[e].data.shapes[0].it).length,s=0;s<i;s+=1)(a=r[s].ks.k).__converted||(u(r[s].ks.k),a.__converted=!0)}}),a=function(){var i=[4,1,9];function r(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)if("gr"===t[e].ty)r(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,s=0;s<i;s+=1)t[e].c.k[s].s&&(t[e].c.k[s].s[0]/=255,t[e].c.k[s].s[1]/=255,t[e].c.k[s].s[2]/=255,t[e].c.k[s].s[3]/=255),t[e].c.k[s].e&&(t[e].c.k[s].e[0]/=255,t[e].c.k[s].e[1]/=255,t[e].c.k[s].e[2]/=255,t[e].c.k[s].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function a(t){var e,s=t.length;for(e=0;e<s;e+=1)4===t[e].ty&&r(t[e].shapes)}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),r=function(){var i=[4,4,18];function l(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&(t[e].ks.k[s].s[0].c=t[e].closed),t[e].ks.k[s].e&&(t[e].ks.k[s].e[0].c=t[e].closed);else"gr"==t[e].ty&&l(t[e].it)}function a(t){var e,s,i,a,r,n,h=t.length;for(s=0;s<h;s+=1){if((e=t[s]).hasMask){var o=e.masksProperties;for(a=o.length,i=0;i<a;i+=1)if(o[i].pt.k.i)o[i].pt.k.c=o[i].cl;else for(n=o[i].pt.k.length,r=0;r<n;r+=1)o[i].pt.k[r].s&&(o[i].pt.k[r].s[0].c=o[i].cl),o[i].pt.k[r].e&&(o[i].pt.k[r].e[0].c=o[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}();var t={completeData:function(t,e){t.__complete||(a(t),s(t),i(t),r(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=a,t.checkChars=i,t.checkShapes=r,t.completeLayers=m,t}(),V=function(){var r={w:0,size:0,shapes:[]},t=[];function u(t,e){var s=T("span");s.style.fontFamily=e;var i=T("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);var a=i.offsetWidth;return i.style.fontFamily=function(t){var e,s=t.split(","),i=s.length,a=[];for(e=0;e<i;e+=1)"sans-serif"!==s[e]&&"monospace"!==s[e]&&a.push(s[e]);return a.join(",")}(t)+", "+e,{node:i,w:a,parent:s}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){this.chars||(this.chars=[]);var e,s,i,a=t.length,r=this.chars.length;for(e=0;e<a;e+=1){for(s=0,i=!1;s<r;)this.chars[s].style===t[e].style&&this.chars[s].fFamily===t[e].fFamily&&this.chars[s].ch===t[e].ch&&(i=!0),s+=1;i||(this.chars.push(t[e]),r+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var s,i,a,r,n=t.list,h=n.length,o=h;for(s=0;s<h;s+=1){var l,p,f=!0;if(n[s].loaded=!1,n[s].monoCase=u(n[s].fFamily,"monospace"),n[s].sansCase=u(n[s].fFamily,"sans-serif"),n[s].fPath){if("p"===n[s].fOrigin||3===n[s].origin){if(0<(l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[s].fFamily+'"], style[f-origin="3"][f-family="'+n[s].fFamily+'"]')).length&&(f=!1),f){var m=T("style");m.setAttribute("f-forigin",n[s].fOrigin),m.setAttribute("f-origin",n[s].origin),m.setAttribute("f-family",n[s].fFamily),m.type="text/css",m.innerText="@font-face {font-family: "+n[s].fFamily+"; font-style: normal; src: url('"+n[s].fPath+"');}",e.appendChild(m)}}else if("g"===n[s].fOrigin||1===n[s].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),p=0;p<l.length;p++)-1!==l[p].href.indexOf(n[s].fPath)&&(f=!1);if(f){var d=T("link");d.setAttribute("f-forigin",n[s].fOrigin),d.setAttribute("f-origin",n[s].origin),d.type="text/css",d.rel="stylesheet",d.href=n[s].fPath,document.body.appendChild(d)}}else if("t"===n[s].fOrigin||2===n[s].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),p=0;p<l.length;p++)n[s].fPath===l[p].src&&(f=!1);if(f){var c=T("link");c.setAttribute("f-forigin",n[s].fOrigin),c.setAttribute("f-origin",n[s].origin),c.setAttribute("rel","stylesheet"),c.setAttribute("href",n[s].fPath),e.appendChild(c)}}}else n[s].loaded=!0,o-=1;n[s].helper=(i=e,a=n[s],r=void 0,(r=E("text")).style.fontSize="100px",r.setAttribute("font-family",a.fFamily),r.setAttribute("font-style",a.fStyle),r.setAttribute("font-weight",a.fWeight),r.textContent="1",a.fClass?(r.style.fontFamily="inherit",r.setAttribute("class",a.fClass)):r.style.fontFamily=a.fFamily,i.appendChild(r),T("canvas").getContext("2d").font=a.fWeight+" "+a.fStyle+" 100px "+a.fFamily,r),n[s].cache={},this.fonts.push(n[s])}0===o?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,s){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),r},getFontByName:function(t){for(var e=0,s=this.fonts.length;e<s;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,s){var i=this.getFontByName(e),a=t.charCodeAt(0);if(!i.cache[a+1]){var r=i.helper;if(" "===t){r.textContent="|"+t+"|";var n=r.getComputedTextLength();r.textContent="||";var h=r.getComputedTextLength();i.cache[a+1]=(n-h)/100}else r.textContent=t,i.cache[a+1]=r.getComputedTextLength()/100}return i.cache[a+1]*s},checkLoadedFonts:function(){var t,e,s,i=this.fonts.length,a=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?a-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,s=this.fonts[t].monoCase.w,e.offsetWidth!==s?(a-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,s=this.fonts[t].sansCase.w,e.offsetWidth!==s&&(a-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==a&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),R=function(){var f=s,a=Math.abs;function m(t,e){var s,i=this.offsetTime;"multidimensional"===this.propType&&(s=j("float32",this.pv.length));for(var a,r,n,h,o,l,p,f,m=e.lastIndex,d=m,c=this.keyframes.length-1,u=!0;u;){if(a=this.keyframes[d],r=this.keyframes[d+1],d===c-1&&t>=r.t-i){a.h&&(a=r),m=0;break}if(r.t-i>t){m=d;break}d<c-1?d+=1:(m=0,u=!1)}var g,y,v,b,_,x,k,w,A,P,C=r.t-i,D=a.t-i;if(a.to){a.bezierData||(a.bezierData=mt.buildBezierData(a.s,r.s||a.e,a.to,a.ti));var S=a.bezierData;if(C<=t||t<D){var E=C<=t?S.points.length-1:0;for(h=S.points[E].point.length,n=0;n<h;n+=1)s[n]=S.points[E].point[n]}else{a.__fnct?f=a.__fnct:(f=W.getBezierEasing(a.o.x,a.o.y,a.i.x,a.i.y,a.n).get,a.__fnct=f),o=f((t-D)/(C-D));var T,M=S.segmentLength*o,F=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastPoint:0,u=!0,l=S.points.length;u;){if(F+=S.points[p].partialLength,0===M||0===o||p===S.points.length-1){for(h=S.points[p].point.length,n=0;n<h;n+=1)s[n]=S.points[p].point[n];break}if(F<=M&&M<F+S.points[p+1].partialLength){for(T=(M-F)/S.points[p+1].partialLength,h=S.points[p].point.length,n=0;n<h;n+=1)s[n]=S.points[p].point[n]+(S.points[p+1].point[n]-S.points[p].point[n])*T;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=F-S.points[p].partialLength,e._lastKeyframeIndex=d}}else{var I,L,B,z,V;if(c=a.s.length,g=r.s||a.e,this.sh&&1!==a.h)if(C<=t)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=D)s[0]=a.s[0],s[1]=a.s[1],s[2]=a.s[2];else{var R=O(a.s),N=O(g);y=s,v=function(t,e,s){var i,a,r,n,h,o=[],l=t[0],p=t[1],f=t[2],m=t[3],d=e[0],c=e[1],u=e[2],g=e[3];(a=l*d+p*c+f*u+m*g)<0&&(a=-a,d=-d,c=-c,u=-u,g=-g);h=1e-6<1-a?(i=Math.acos(a),r=Math.sin(i),n=Math.sin((1-s)*i)/r,Math.sin(s*i)/r):(n=1-s,s);return o[0]=n*l+h*d,o[1]=n*p+h*c,o[2]=n*f+h*u,o[3]=n*m+h*g,o}(R,N,(t-D)/(C-D)),b=v[0],_=v[1],x=v[2],k=v[3],w=Math.atan2(2*_*k-2*b*x,1-2*_*_-2*x*x),A=Math.asin(2*b*_+2*x*k),P=Math.atan2(2*b*k-2*_*x,1-2*b*b-2*x*x),y[0]=w/q,y[1]=A/q,y[2]=P/q}else for(d=0;d<c;d+=1)1!==a.h&&(o=C<=t?1:t<D?0:(a.o.x.constructor===Array?(a.__fnct||(a.__fnct=[]),a.__fnct[d]?f=a.__fnct[d]:(I=void 0===a.o.x[d]?a.o.x[0]:a.o.x[d],L=void 0===a.o.y[d]?a.o.y[0]:a.o.y[d],B=void 0===a.i.x[d]?a.i.x[0]:a.i.x[d],z=void 0===a.i.y[d]?a.i.y[0]:a.i.y[d],f=W.getBezierEasing(I,L,B,z).get,a.__fnct[d]=f)):a.__fnct?f=a.__fnct:(I=a.o.x,L=a.o.y,B=a.i.x,z=a.i.y,f=W.getBezierEasing(I,L,B,z).get,a.__fnct=f),f((t-D)/(C-D)))),g=r.s||a.e,V=1===a.h?a.s[d]:a.s[d]+(g[d]-a.s[d])*o,"multidimensional"===this.propType?s[d]=V:s=V}return e.lastIndex=m,s}function O(t){var e=t[0]*q,s=t[1]*q,i=t[2]*q,a=Math.cos(e/2),r=Math.cos(s/2),n=Math.cos(i/2),h=Math.sin(e/2),o=Math.sin(s/2),l=Math.sin(i/2);return[h*o*n+a*r*l,h*r*n+a*o*l,a*o*n-h*r*l,a*r*n-h*o*l]}function d(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=s&&s<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function c(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<a(this.v-e)&&(this.v=e,this._mdf=!0);else for(var s=0,i=this.v.length;s<i;)e=t[s]*this.mult,1e-5<a(this.v[s]-e)&&(this.v[s]=e,this._mdf=!0),s+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,s=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)s=this.effectsSequence[t](s);this.setVValue(s),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function g(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,s,i){this.propType="unidimensional",this.mult=s||1,this.data=e,this.v=s?e.k*s:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.addEffect=g}function h(t,e,s,i){this.propType="multidimensional",this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a,r=e.k.length;this.v=j("float32",r),this.pv=j("float32",r);j("float32",r);for(this.vel=j("float32",r),a=0;a<r;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=c,this.addEffect=g}function o(t,e,s,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.effectsSequence=[d.bind(this)],this.addEffect=g}function l(t,e,s,i){this.propType="multidimensional";var a,r,n,h,o,l=e.k.length;for(a=0;a<l-1;a+=1)e.k[a].to&&e.k[a].s&&e.k[a+1]&&e.k[a+1].s&&(r=e.k[a].s,n=e.k[a+1].s,h=e.k[a].to,o=e.k[a].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+h[0],r[1]+h[1],r[2]+h[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(e.k[a].to=null,e.k[a].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===h[0]&&0===h[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===n[2]&&0===h[2]&&0===o[2])&&(e.k[a].to=null,e.k[a].ti=null));this.effectsSequence=[d.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=j("float32",p),this.pv=j("float32",p),a=0;a<p;a+=1)this.v[a]=f,this.pv[a]=f;this._caching={lastFrame:f,lastIndex:0,value:j("float32",p)},this.addEffect=g}return{getProp:function(t,e,s,i,a){var r;if(e.k.length)if("number"==typeof e.k[0])r=new h(t,e,i,a);else switch(s){case 0:r=new o(t,e,i,a);break;case 1:r=new l(t,e,i,a)}else r=new n(t,e,i,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}}}(),N=function(){var n=[0,0];function i(t,e,s){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new L,this.pre=new L,this.appliedTransformations=0,this.initDynamicPropertyContainer(s||t),e.p&&e.p.s?(this.px=R.getProp(t,e.p.x,0,0,this),this.py=R.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=R.getProp(t,e.p.z,0,0,this))):this.p=R.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=R.getProp(t,e.rx,0,q,this),this.ry=R.getProp(t,e.ry,0,q,this),this.rz=R.getProp(t,e.rz,0,q,this),e.or.k[0].ti){var i,a=e.or.k.length;for(i=0;i<a;i+=1)e.or.k[i].to=e.or.k[i].ti=null}this.or=R.getProp(t,e.or,1,q,this),this.or.sh=!0}else this.r=R.getProp(t,e.r||{k:0},0,q,this);e.sk&&(this.sk=R.getProp(t,e.sk,0,q,this),this.sa=R.getProp(t,e.sa,0,q,this)),this.a=R.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=R.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=R.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,s,i=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)s=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],s=[];var a=this.px,r=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(e[0]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),e[1]=r.getValueAtTime((r.keyframes[0].t+.01)/i,0),s[0]=a.getValueAtTime(a.keyframes[0].t/i,0),s[1]=r.getValueAtTime(r.keyframes[0].t/i,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(e[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),e[1]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/i,0),s[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0),s[1]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/i,0)):(e=[a.pv,r.pv],s[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime),s[1]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/i,r.offsetTime))}else e=s=n;this.v.rotate(-Math.atan2(e[1]-s[1],e[0]-s[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},B([M],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=M.prototype.addDynamicProperty,{getTransformProperty:function(t,e,s){return new i(t,e,s)}}}();function O(){this.c=!1,this._length=0,this._maxLength=8,this.v=S(this._maxLength),this.o=S(this._maxLength),this.i=S(this._maxLength)}O.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var s=0;s<e;)this.v[s]=Ct.newElement(),this.o[s]=Ct.newElement(),this.i[s]=Ct.newElement(),s+=1},O.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},O.prototype.doubleArrayLength=function(){this.v=this.v.concat(S(this._maxLength)),this.i=this.i.concat(S(this._maxLength)),this.o=this.o.concat(S(this._maxLength)),this._maxLength*=2},O.prototype.setXYAt=function(t,e,s,i,a){var r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o}(!r[i]||r[i]&&!a)&&(r[i]=Ct.newElement()),r[i][0]=t,r[i][1]=e},O.prototype.setTripleAt=function(t,e,s,i,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(s,i,"o",n,h),this.setXYAt(a,r,"i",n,h)},O.prototype.reverse=function(){var t=new O;t.setPathData(this.c,this._length);var e=this.v,s=this.o,i=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],s[0][0],s[0][1],0,!1),a=1);var r,n=this._length-1,h=this._length;for(r=a;r<h;r+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],s[n][0],s[n][1],r,!1),n-=1;return t};var X,Y,H=function(){var a=-999999;function t(t,e,s){var i,a,r,n,h,o,l,p,f,m=s.lastIndex,d=this.keyframes;if(t<d[0].t-this.offsetTime)i=d[0].s[0],r=!0,m=0;else if(t>=d[d.length-1].t-this.offsetTime)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var c,u,g=m,y=d.length-1,v=!0;v&&(c=d[g],!((u=d[g+1]).t-this.offsetTime>t));)g<y-1?g+=1:v=!1;if(m=g,!(r=1===c.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<c.t-this.offsetTime)p=0;else{var b;c.__fnct?b=c.__fnct:(b=W.getBezierEasing(c.o.x,c.o.y,c.i.x,c.i.y).get,c.__fnct=b),p=b((t-(c.t-this.offsetTime))/(u.t-this.offsetTime-(c.t-this.offsetTime)))}a=u.s?u.s[0]:c.e[0]}i=c.s[0]}for(o=e._length,l=i.i[0].length,s.lastIndex=m,n=0;n<o;n+=1)for(h=0;h<l;h+=1)f=r?i.i[n][h]:i.i[n][h]+(a.i[n][h]-i.i[n][h])*p,e.i[n][h]=f,f=r?i.o[n][h]:i.o[n][h]+(a.o[n][h]-i.o[n][h])*p,e.o[n][h]=f,f=r?i.v[n][h]:i.v[n][h]+(a.v[n][h]-i.v[n][h])*p,e.v[n][h]=f}function r(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var s,i=t._length;for(s=0;s<i;s+=1)if(t.v[s][0]!==e.v[s][0]||t.v[s][1]!==e.v[s][1]||t.o[s][0]!==e.o[s][0]||t.o[s][1]!==e.o[s][1]||t.i[s][0]!==e.i[s][0]||t.i[s][1]!==e.i[s][1])return!1;return!0})(this.v,t)||(this.v=Dt.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,s=this.effectsSequence.length;for(t=0;t<s;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,s){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===s?e.pt.k:e.ks.k;this.v=Dt.clone(i),this.pv=Dt.clone(this.v),this.localShapeCollection=St.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function h(t,e,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=Dt.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=Dt.clone(this.v),this.localShapeCollection=St.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=a,this.reset=r,this._caching={lastFrame:a,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==a&&(i<e&&t<e||s<i&&s<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=s,n.prototype.setVValue=e,n.prototype.addEffect=i,h.prototype.getValue=s,h.prototype.interpolateShape=t,h.prototype.setVValue=e,h.prototype.addEffect=i;var o=function(){var n=v;function t(t,e){this.v=Dt.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=St.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=R.getProp(t,e.p,1,0,this),this.s=R.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=3!==this.d,r=this.v;r.v[0][0]=t,r.v[0][1]=e-i,r.v[1][0]=a?t+s:t-s,r.v[1][1]=e,r.v[2][0]=t,r.v[2][1]=e+i,r.v[3][0]=a?t-s:t+s,r.v[3][1]=e,r.i[0][0]=a?t-s*n:t+s*n,r.i[0][1]=e-i,r.i[1][0]=a?t+s:t-s,r.i[1][1]=e-i*n,r.i[2][0]=a?t+s*n:t-s*n,r.i[2][1]=e+i,r.i[3][0]=a?t-s:t+s,r.i[3][1]=e+i*n,r.o[0][0]=a?t+s*n:t-s*n,r.o[0][1]=e-i,r.o[1][0]=a?t+s:t-s,r.o[1][1]=e+i*n,r.o[2][0]=a?t-s*n:t+s*n,r.o[2][1]=e+i,r.o[3][0]=a?t-s:t+s,r.o[3][1]=e-i*n}},B([M],t),t}(),l=function(){function t(t,e){this.v=Dt.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=R.getProp(t,e.ir,0,0,this),this.is=R.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=R.getProp(t,e.pt,0,0,this),this.p=R.getProp(t,e.p,1,0,this),this.r=R.getProp(t,e.r,0,q,this),this.or=R.getProp(t,e.or,0,0,this),this.os=R.getProp(t,e.os,0,.01,this),this.localShapeCollection=St.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,s,i,a=2*Math.floor(this.pt.v),r=2*Math.PI/a,n=!0,h=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*h/(2*a),m=2*Math.PI*o/(2*a),d=-Math.PI/2;d+=this.r.v;var c=3===this.data.d?-1:1;for(t=this.v._length=0;t<a;t+=1){s=n?l:p,i=n?f:m;var u=(e=n?h:o)*Math.cos(d),g=e*Math.sin(d),y=0===u&&0===g?0:g/Math.sqrt(u*u+g*g),v=0===u&&0===g?0:-u/Math.sqrt(u*u+g*g);u+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(u,g,u-y*i*s*c,g-v*i*s*c,u+y*i*s*c,g+v*i*s*c,t,!0),n=!n,d+=r*c}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),s=2*Math.PI/e,i=this.or.v,a=this.os.v,r=2*Math.PI*i/(4*e),n=-Math.PI/2,h=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var o=i*Math.cos(n),l=i*Math.sin(n),p=0===o&&0===l?0:l/Math.sqrt(o*o+l*l),f=0===o&&0===l?0:-o/Math.sqrt(o*o+l*l);o+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(o,l,o-p*r*a*h,l-f*r*a*h,o+p*r*a*h,l+f*r*a*h,t,!0),n+=s*h}this.paths.length=0,this.paths[0]=this.v}},B([M],t),t}(),p=function(){function t(t,e){this.v=Dt.newElement(),this.v.c=!0,this.localShapeCollection=St.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=R.getProp(t,e.p,1,0,this),this.s=R.getProp(t,e.s,1,0,this),this.r=R.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=c(s,i,this.r.v),r=a*(1-v);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+a,t+s,e-i+r,0,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-r,t+s,e+i-a,1,!0),0!==a?(this.v.setTripleAt(t+s-a,e+i,t+s-a,e+i,t+s-r,e+i,2,!0),this.v.setTripleAt(t-s+a,e+i,t-s+r,e+i,t-s+a,e+i,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-a,t-s,e+i-r,4,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+r,t-s,e-i+a,5,!0),this.v.setTripleAt(t-s+a,e-i,t-s+a,e-i,t-s+r,e-i,6,!0),this.v.setTripleAt(t+s-a,e-i,t+s-r,e-i,t+s-a,e-i,7,!0)):(this.v.setTripleAt(t-s,e+i,t-s+r,e+i,t-s,e+i,2),this.v.setTripleAt(t-s,e-i,t-s,e-i+r,t-s,e-i,3))):(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+r,t+s,e-i+a,0,!0),0!==a?(this.v.setTripleAt(t+s-a,e-i,t+s-a,e-i,t+s-r,e-i,1,!0),this.v.setTripleAt(t-s+a,e-i,t-s+r,e-i,t-s+a,e-i,2,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+a,t-s,e-i+r,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-r,t-s,e+i-a,4,!0),this.v.setTripleAt(t-s+a,e+i,t-s+a,e+i,t-s+r,e+i,5,!0),this.v.setTripleAt(t+s-a,e+i,t+s-r,e+i,t+s-a,e+i,6,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-a,t+s,e+i-r,7,!0)):(this.v.setTripleAt(t-s,e-i,t-s+r,e-i,t-s,e-i,1,!0),this.v.setTripleAt(t-s,e+i,t-s,e+i-r,t-s,e+i,2,!0),this.v.setTripleAt(t+s,e+i,t+s-r,e+i,t+s,e+i,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:r},B([M],t),t}();var f={getShapeProp:function(t,e,s){var i;return 3===s||4===s?i=(3===s?e.pt:e.ks).k.length?new h(t,e,s):new n(t,e,s):5===s?i=new p(t,e):6===s?i=new o(t,e):7===s&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return h}};return f}(),G=(Y={},(X={}).registerModifier=function(t,e){Y[t]||(Y[t]=e)},X.getModifier=function(t,e,s){return new Y[t](e,s)},X);function K(){}function U(){}function Z(){}function J(){}function Q(){}function $(){this._length=0,this._maxLength=4,this.shapes=S(this._maxLength)}function tt(t,e,s,i){this.elem=t,this.frameId=-1,this.dataProps=S(e.length),this.renderer=s,this.k=!1,this.dashStr="",this.dashArray=j("float32",e.length?e.length-1:0),this.dashoffset=j("float32",1),this.initDynamicPropertyContainer(i);var a,r,n=e.length||0;for(a=0;a<n;a+=1)r=R.getProp(t,e[a].v,0,0,this),this.k=r.k||this.k,this.dataProps[a]={n:e[a].n,p:r};this.k||this.getValue(!0),this._isAnimated=this.k}function et(t,e,s){this.data=e,this.c=j("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=j("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=R.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}K.prototype.initModifierProperties=function(){},K.prototype.addShapeToModifier=function(){},K.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:St.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},K.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=s,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},K.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},B([M],K),B([K],U),U.prototype.initModifierProperties=function(t,e){this.s=R.getProp(t,e.s,0,.01,this),this.e=R.getProp(t,e.e,0,.01,this),this.o=R.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},U.prototype.addShapeToModifier=function(t){t.pathsData=[]},U.prototype.calculateShapeEdges=function(t,e,s,i,a){var r=[];e<=1?r.push({s:t,e:e}):1<=t?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],l=r.length;for(n=0;n<l;n+=1){var p,f;if((h=r[n]).e*a<i||h.s*a>i+s);else p=h.s*a<=i?0:(h.s*a-i)/s,f=h.e*a>=i+s?1:(h.e*a-i)/s,o.push([p,f])}return o.length||o.push([0,0]),o},U.prototype.releasePathsData=function(t){var e,s=t.length;for(e=0;e<s;e+=1)Et.release(t[e]);return t.length=0,t},U.prototype.processShapes=function(t){var e,s,i;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+a,(s=(1<this.e.v?1:this.e.v<0?0:this.e.v)+a)<e){var r=e;e=s,s=r}e=1e-4*Math.round(1e4*e),s=1e-4*Math.round(1e4*s),this.sValue=e,this.eValue=s}else e=this.sValue,s=this.eValue;var n,h,o,l,p,f,m=this.shapes.length,d=0;if(s===e)for(n=0;n<m;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===s&&0===e||0===s&&1===e){if(this._mdf)for(n=0;n<m;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var c,u,g=[];for(n=0;n<m;n+=1)if((c=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(o=(i=c.shape.paths)._length,f=0,!c.shape._mdf&&c.pathsData.length)f=c.totalShapeLength;else{for(l=this.releasePathsData(c.pathsData),h=0;h<o;h+=1)p=mt.getSegmentsLength(i.shapes[h]),l.push(p),f+=p.totalLength;c.totalShapeLength=f,c.pathsData=l}d+=f,c.shape._mdf=!0}else c.shape.paths=c.localShapeCollection;var y,v=e,b=s,_=0;for(n=m-1;0<=n;n-=1)if((c=this.shapes[n]).shape._mdf){for((u=c.localShapeCollection).releaseShapes(),2===this.m&&1<m?(y=this.calculateShapeEdges(e,s,c.totalShapeLength,_,d),_+=c.totalShapeLength):y=[[v,b]],o=y.length,h=0;h<o;h+=1){v=y[h][0],b=y[h][1],g.length=0,b<=1?g.push({s:c.totalShapeLength*v,e:c.totalShapeLength*b}):1<=v?g.push({s:c.totalShapeLength*(v-1),e:c.totalShapeLength*(b-1)}):(g.push({s:c.totalShapeLength*v,e:c.totalShapeLength}),g.push({s:0,e:c.totalShapeLength*(b-1)}));var x=this.addShapes(c,g[0]);if(g[0].s!==g[0].e){if(1<g.length)if(c.shape.paths.shapes[c.shape.paths._length-1].c){var k=x.pop();this.addPaths(x,u),x=this.addShapes(c,g[1],k)}else this.addPaths(x,u),x=this.addShapes(c,g[1]);this.addPaths(x,u)}}c.shape.paths=u}}},U.prototype.addPaths=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e.addShape(t[s])},U.prototype.addSegment=function(t,e,s,i,a,r,n){a.setXYAt(e[0],e[1],"o",r),a.setXYAt(s[0],s[1],"i",r+1),n&&a.setXYAt(t[0],t[1],"v",r),a.setXYAt(i[0],i[1],"v",r+1)},U.prototype.addSegmentFromArray=function(t,e,s,i){e.setXYAt(t[1],t[5],"o",s),e.setXYAt(t[2],t[6],"i",s+1),i&&e.setXYAt(t[0],t[4],"v",s),e.setXYAt(t[3],t[7],"v",s+1)},U.prototype.addShapes=function(t,e,s){var i,a,r,n,h,o,l,p,f=t.pathsData,m=t.shape.paths.shapes,d=t.shape.paths._length,c=0,u=[],g=!0;for(p=s?(h=s._length,s._length):(s=Dt.newElement(),h=0),u.push(s),i=0;i<d;i+=1){for(o=f[i].lengths,s.c=m[i].c,r=m[i].c?o.length:o.length+1,a=1;a<r;a+=1)if(c+(n=o[a-1]).addedLength<e.s)c+=n.addedLength,s.c=!1;else{if(c>e.e){s.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[a],m[i].v[a],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[a],m[i].o[a-1],m[i].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1),c+=n.addedLength,h+=1}if(m[i].c&&o.length){if(n=o[a-1],c<=e.e){var y=o[a-1].addedLength;e.s<=c&&e.e>=c+y?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[0],m[i].v[0],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[0],m[i].o[a-1],m[i].i[0],(e.s-c)/y,(e.e-c)/y,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1)}else s.c=!1;c+=n.addedLength,h+=1}if(s._length&&(s.setXYAt(s.v[p][0],s.v[p][1],"i",p),s.setXYAt(s.v[s._length-1][0],s.v[s._length-1][1],"o",s._length-1)),c>e.e)break;i<d-1&&(s=Dt.newElement(),g=!0,u.push(s),h=0)}return u},G.registerModifier("tm",U),B([K],Z),Z.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=R.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},Z.prototype.processPath=function(t,e){var s=Dt.newElement();s.c=t.c;var i,a,r,n,h,o,l,p,f,m,d,c,u,g=t._length,y=0;for(i=0;i<g;i+=1)a=t.v[i],n=t.o[i],r=t.i[i],a[0]===n[0]&&a[1]===n[1]&&a[0]===r[0]&&a[1]===r[1]?0!==i&&i!==g-1||t.c?(h=0===i?t.v[g-1]:t.v[i-1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=c=a[0]+(h[0]-a[0])*l,f=u=a[1]-(a[1]-h[1])*l,m=p-(p-a[0])*v,d=f-(f-a[1])*v,s.setTripleAt(p,f,m,d,c,u,y),y+=1,h=i===g-1?t.v[0]:t.v[i+1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=m=a[0]+(h[0]-a[0])*l,f=d=a[1]+(h[1]-a[1])*l,c=p-(p-a[0])*v,u=f-(f-a[1])*v,s.setTripleAt(p,f,m,d,c,u,y)):s.setTripleAt(a[0],a[1],n[0],n[1],r[0],r[1],y):s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],y),y+=1;return s},Z.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.rd.v;if(0!==o)for(s=0;s<h;s+=1){if((r=this.shapes[s]).shape.paths,n=r.localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},G.registerModifier("rd",Z),B([K],J),J.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=R.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},J.prototype.processPath=function(t,e){var s=e/100,i=[0,0],a=t._length,r=0;for(r=0;r<a;r+=1)i[0]+=t.v[r][0],i[1]+=t.v[r][1];i[0]/=a,i[1]/=a;var n,h,o,l,p,f,m=Dt.newElement();for(m.c=t.c,r=0;r<a;r+=1)n=t.v[r][0]+(i[0]-t.v[r][0])*s,h=t.v[r][1]+(i[1]-t.v[r][1])*s,o=t.o[r][0]+(i[0]-t.o[r][0])*-s,l=t.o[r][1]+(i[1]-t.o[r][1])*-s,p=t.i[r][0]+(i[0]-t.i[r][0])*-s,f=t.i[r][1]+(i[1]-t.i[r][1])*-s,m.setTripleAt(n,h,o,l,p,f,r);return m},J.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.amount.v;if(0!==o)for(s=0;s<h;s+=1){if((r=this.shapes[s]).shape.paths,n=r.localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},G.registerModifier("pb",J),B([K],Q),Q.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=R.getProp(t,e.c,0,null,this),this.o=R.getProp(t,e.o,0,null,this),this.tr=N.getTransformProperty(t,e.tr,this),this.so=R.getProp(t,e.tr.so,0,.01,this),this.eo=R.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new L,this.rMatrix=new L,this.sMatrix=new L,this.tMatrix=new L,this.matrix=new L},Q.prototype.applyTransforms=function(t,e,s,i,a,r){var n=r?-1:1,h=i.s.v[0]+(1-i.s.v[0])*(1-a),o=i.s.v[1]+(1-i.s.v[1])*(1-a);t.translate(i.p.v[0]*n*a,i.p.v[1]*n*a,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*a),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.scale(r?1/h:h,r?1/o:o),s.translate(i.a.v[0],i.a.v[1],i.a.v[2])},Q.prototype.init=function(t,e,s,i){this.elem=t,this.arr=e,this.pos=s,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[s]);for(;0<s;)s-=1,this._elements.unshift(e[s]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},Q.prototype.resetElements=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},Q.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},Q.prototype.changeGroupRender=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]._render=e,"gr"===t[s].ty&&this.changeGroupRender(t[s].it,e)},Q.prototype.processShapes=function(t){var e,s,i,a,r;if(this._mdf||t){var n,h=Math.ceil(this.c.v);if(this._groups.length<h){for(;this._groups.length<h;){var o={it:this.cloneElements(this._elements),ty:"gr"};o.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,o),this._groups.splice(0,0,o),this._currentCopies+=1}this.elem.reloadShapes()}for(i=r=0;i<=this._groups.length-1;i+=1)n=r<h,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),r+=1;this._currentCopies=h;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=(this.tr.v.props,this.pMatrix.props),d=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,g,y=0;if(0<l){for(;y<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),y+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),y+=p)}else if(l<0){for(;f<y;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),y-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),y-=p)}for(i=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,r=this._currentCopies;r;){if(g=(s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==y){for((0!==i&&1===a||i!==this._currentCopies-1&&-1===a)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),u=0;u<g;u+=1)s[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<g;u+=1)s[u]=this.matrix.props[u];y+=1,r-=1,i+=a}}else for(r=this._currentCopies,i=0,a=1;r;)s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,r-=1,i+=a},Q.prototype.addShape=function(){},G.registerModifier("rp",Q),$.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(S(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},$.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)Dt.release(this.shapes[t]);this._length=0},tt.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,s=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<s;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},B([M],tt),et.prototype.comparePoints=function(t,e){for(var s=0,i=this.o.length/2;s<i;){if(.01<Math.abs(t[4*s]-t[4*e+2*s]))return!1;s+=1}return!0},et.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},et.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,s,i,a=4*this.data.p;for(e=0;e<a;e+=1)s=e%4==0?100:255,i=Math.round(this.prop.v[e]*s),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(a=this.prop.v.length,e=4*this.data.p;e<a;e+=1)s=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},B([M],et);var st,it,at=function(t,e,s,i){if(0===e)return"";var a,r=t.o,n=t.i,h=t.v,o=" M"+i.applyToPointStringified(h[0][0],h[0][1]);for(a=1;a<e;a+=1)o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[a][0],n[a][1])+" "+i.applyToPointStringified(h[a][0],h[a][1]);return s&&e&&(o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(h[0][0],h[0][1]),o+="z"),o},rt=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,s=this.audios.length;for(e=0;e<s;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(t){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),nt=function(){var a=function(){var t=T("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(t,e,s){var i="";if(t.e)i=t.p;else if(e){var a=t.p;-1!==a.indexOf("images/")&&(a=a.split("/")[1]),i=e+a}else i=s,i+=t.u?t.u:"",i+=t.p;return i}function t(t){this._imageLoaded=e.bind(this),this.testImageLoaded=function(t){var e=0,s=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(s)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return t.prototype={loadAssets:function(t,e){this.imagesLoadedCb=e;var s,i=t.length;for(s=0;s<i;s+=1)t[s].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[s])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,s=this.images.length;e<s;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}},createImgData:function(t){var e=r(t,this.assetsPath,this.path),s=T("img");s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.src=e;var i={img:s,assetData:t};return i},createImageData:function(t){var e=r(t,this.assetsPath,this.path),s=E("image");n?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(s);var i={img:s,assetData:t};return i},imageLoaded:e,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},t}(),ht=(st={maskType:!0},(/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))&&(st.maskType=!1),st),ot=((it={}).createFilter=function(t){var e=E("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},it.createAlphaToLuminanceFilter=function(){var t=E("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},it),dt=function(){function r(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,s){var i,a=new XMLHttpRequest;a.open("GET",t,!0);try{a.responseType="json"}catch(t){}a.send(),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status)i=r(a),e(i);else try{i=r(a),e(i)}catch(t){s&&s(t)}}}}}();function ct(t,e,s){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=S(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(s)}function ut(t,e,s){var i={propType:!1},a=R.getProp,r=e.a;this.a={r:r.r?a(t,r.r,0,q,s):i,rx:r.rx?a(t,r.rx,0,q,s):i,ry:r.ry?a(t,r.ry,0,q,s):i,sk:r.sk?a(t,r.sk,0,q,s):i,sa:r.sa?a(t,r.sa,0,q,s):i,s:r.s?a(t,r.s,1,.01,s):i,a:r.a?a(t,r.a,1,0,s):i,o:r.o?a(t,r.o,0,.01,s):i,p:r.p?a(t,r.p,1,0,s):i,sw:r.sw?a(t,r.sw,0,0,s):i,sc:r.sc?a(t,r.sc,1,0,s):i,fc:r.fc?a(t,r.fc,1,0,s):i,fh:r.fh?a(t,r.fh,0,0,s):i,fs:r.fs?a(t,r.fs,0,.01,s):i,fb:r.fb?a(t,r.fb,0,.01,s):i,t:r.t?a(t,r.t,0,0,s):i},this.s=wt.getTextSelectorProp(t,e.s,s),this.s.t=e.s.t}function gt(t,e,s,i,a,r){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=a,this.p=r,this._mdf={o:!0,sw:!!e,sc:!!s,fc:!!i,m:!0,p:!0}}function yt(t,e){this._frameId=s,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}ct.prototype.searchProperties=function(){var t,e,s=this._textData.a.length,i=R.getProp;for(t=0;t<s;t+=1)e=this._textData.a[t],this._animatorsData[t]=new ut(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},ct.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var s,i,a,r,n,h,o,l,p,f,m,d,c,u,g,y,v,b,_,x=this._moreOptions.alignment.v,k=this._animatorsData,w=this._textData,A=this.mHelper,P=this._renderType,C=this.renderedLetters.length,D=(this.data,t.l);if(this._hasMaskedPath){if(_=this._pathData.m,!this._pathData.n||this._pathData._mdf){var S,E=_.v;for(this._pathData.r&&(E=E.reverse()),n={tLength:0,segments:[]},r=E._length-1,a=y=0;a<r;a+=1)S=mt.buildBezierData(E.v[a],E.v[a+1],[E.o[a][0]-E.v[a][0],E.o[a][1]-E.v[a][1]],[E.i[a+1][0]-E.v[a+1][0],E.i[a+1][1]-E.v[a+1][1]]),n.tLength+=S.segmentLength,n.segments.push(S),y+=S.segmentLength;a=r,_.v.c&&(S=mt.buildBezierData(E.v[a],E.v[0],[E.o[a][0]-E.v[a][0],E.o[a][1]-E.v[a][1]],[E.i[0][0]-E.v[0][0],E.i[0][1]-E.v[0][1]]),n.tLength+=S.segmentLength,n.segments.push(S),y+=S.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,h=this._pathData.f.v,f=1,p=!(l=m=0),u=n.segments,h<0&&_.v.c)for(n.tLength<Math.abs(h)&&(h=-Math.abs(h)%n.tLength),f=(c=u[m=u.length-1].points).length-1;h<0;)h+=c[f].partialLength,(f-=1)<0&&(f=(c=u[m-=1].points).length-1);d=(c=u[m].points)[f-1],g=(o=c[f]).partialLength}r=D.length,i=s=0;var T,M,F,I,L=1.2*t.finalSize*.714,B=!0;F=k.length;var z,V,R,N,O,q,j,W,X,Y,H,G,K,U=-1,Z=h,J=m,Q=f,$=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var st=0,it=0,at=2===t.j?-.5:-1,rt=0,nt=!0;for(a=0;a<r;a+=1)if(D[a].n){for(st&&(st+=it);rt<a;)D[rt].animatorJustifyOffset=st,rt+=1;nt=!(st=0)}else{for(M=0;M<F;M+=1)(T=k[M].a).t.propType&&(nt&&2===t.j&&(it+=T.t.v*at),(z=k[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?st+=T.t.v*z[0]*at:st+=T.t.v*z*at);nt=!1}for(st&&(st+=it);rt<a;)D[rt].animatorJustifyOffset=st,rt+=1}for(a=0;a<r;a+=1){if(A.reset(),O=1,D[a].n)s=0,i+=t.yOffset,i+=B?1:0,h=Z,B=!1,0,this._hasMaskedPath&&(f=Q,d=(c=u[m=J].points)[f-1],g=(o=c[f]).partialLength,l=0),K=Y=G=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if($!==D[a].line){switch(t.j){case 1:h+=y-t.lineWidths[D[a].line];break;case 2:h+=(y-t.lineWidths[D[a].line])/2}$=D[a].line}U!==D[a].ind&&(D[U]&&(h+=D[U].extra),h+=D[a].an/2,U=D[a].ind),h+=x[0]*D[a].an/200;var ht=0;for(M=0;M<F;M+=1)(T=k[M].a).p.propType&&((z=k[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?ht+=T.p.v[0]*z[0]:ht+=T.p.v[0]*z),T.a.propType&&((z=k[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?ht+=T.a.v[0]*z[0]:ht+=T.a.v[0]*z);for(p=!0;p;)h+ht<=l+g||!c?(v=(h+ht-l)/o.partialLength,R=d.point[0]+(o.point[0]-d.point[0])*v,N=d.point[1]+(o.point[1]-d.point[1])*v,A.translate(-x[0]*D[a].an/200,-x[1]*L/100),p=!1):c&&(l+=o.partialLength,(f+=1)>=c.length&&(f=0,c=u[m+=1]?u[m].points:_.v.c?u[m=f=0].points:(l-=o.partialLength,null)),c&&(d=o,g=(o=c[f]).partialLength));V=D[a].an/2-D[a].add,A.translate(-V,0,0)}else V=D[a].an/2-D[a].add,A.translate(-V,0,0),A.translate(-x[0]*D[a].an/200,-x[1]*L/100,0);for(D[a].l/2,M=0;M<F;M+=1)(T=k[M].a).t.propType&&(z=k[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars),0===s&&0===t.j||(this._hasMaskedPath?z.length?h+=T.t.v*z[0]:h+=T.t.v*z:z.length?s+=T.t.v*z[0]:s+=T.t.v*z));for(D[a].l/2,t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(q=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(W=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<F;M+=1)(T=k[M].a).a.propType&&((z=k[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?A.translate(-T.a.v[0]*z[0],-T.a.v[1]*z[1],T.a.v[2]*z[2]):A.translate(-T.a.v[0]*z,-T.a.v[1]*z,T.a.v[2]*z));for(M=0;M<F;M+=1)(T=k[M].a).s.propType&&((z=k[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?A.scale(1+(T.s.v[0]-1)*z[0],1+(T.s.v[1]-1)*z[1],1):A.scale(1+(T.s.v[0]-1)*z,1+(T.s.v[1]-1)*z,1));for(M=0;M<F;M+=1){if(T=k[M].a,z=k[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars),T.sk.propType&&(z.length?A.skewFromAxis(-T.sk.v*z[0],T.sa.v*z[1]):A.skewFromAxis(-T.sk.v*z,T.sa.v*z)),T.r.propType&&(z.length?A.rotateZ(-T.r.v*z[2]):A.rotateZ(-T.r.v*z)),T.ry.propType&&(z.length?A.rotateY(T.ry.v*z[1]):A.rotateY(T.ry.v*z)),T.rx.propType&&(z.length?A.rotateX(T.rx.v*z[0]):A.rotateX(T.rx.v*z)),T.o.propType&&(z.length?O+=(T.o.v*z[0]-O)*z[0]:O+=(T.o.v*z-O)*z),t.strokeWidthAnim&&T.sw.propType&&(z.length?j+=T.sw.v*z[0]:j+=T.sw.v*z),t.strokeColorAnim&&T.sc.propType)for(X=0;X<3;X+=1)z.length?q[X]=q[X]+(T.sc.v[X]-q[X])*z[0]:q[X]=q[X]+(T.sc.v[X]-q[X])*z;if(t.fillColorAnim&&t.fc){if(T.fc.propType)for(X=0;X<3;X+=1)z.length?W[X]=W[X]+(T.fc.v[X]-W[X])*z[0]:W[X]=W[X]+(T.fc.v[X]-W[X])*z;T.fh.propType&&(W=z.length?ft(W,T.fh.v*z[0]):ft(W,T.fh.v*z)),T.fs.propType&&(W=z.length?lt(W,T.fs.v*z[0]):lt(W,T.fs.v*z)),T.fb.propType&&(W=z.length?pt(W,T.fb.v*z[0]):pt(W,T.fb.v*z))}}for(M=0;M<F;M+=1)(T=k[M].a).p.propType&&(z=k[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars),this._hasMaskedPath?z.length?A.translate(0,T.p.v[1]*z[0],-T.p.v[2]*z[1]):A.translate(0,T.p.v[1]*z,-T.p.v[2]*z):z.length?A.translate(T.p.v[0]*z[0],T.p.v[1]*z[1],-T.p.v[2]*z[2]):A.translate(T.p.v[0]*z,T.p.v[1]*z,-T.p.v[2]*z));if(t.strokeWidthAnim&&(Y=j<0?0:j),t.strokeColorAnim&&(H="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),t.fillColorAnim&&t.fc&&(G="rgb("+Math.round(255*W[0])+","+Math.round(255*W[1])+","+Math.round(255*W[2])+")"),this._hasMaskedPath){if(A.translate(0,-t.ls),A.translate(0,x[1]*L/100+i,0),w.p.p){b=(o.point[1]-d.point[1])/(o.point[0]-d.point[0]);var ot=180*Math.atan(b)/Math.PI;o.point[0]<d.point[0]&&(ot+=180),A.rotate(-ot*Math.PI/180)}A.translate(R,N,0),h-=x[0]*D[a].an/200,D[a+1]&&U!==D[a+1].ind&&(h+=D[a].an/2,h+=t.tr/1e3*t.finalSize)}else{switch(A.translate(s,i,0),t.ps&&A.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:A.translate(D[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[a].line]),0,0);break;case 2:A.translate(D[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[a].line])/2,0,0)}A.translate(0,-t.ls),A.translate(V,0,0),A.translate(x[0]*D[a].an/200,x[1]*L/100,0),s+=D[a].l+t.tr/1e3*t.finalSize}"html"===P?tt=A.toCSS():"svg"===P?tt=A.to2dCSS():et=[A.props[0],A.props[1],A.props[2],A.props[3],A.props[4],A.props[5],A.props[6],A.props[7],A.props[8],A.props[9],A.props[10],A.props[11],A.props[12],A.props[13],A.props[14],A.props[15]],K=O}this.lettersChangedFlag=C<=a?(I=new gt(K,Y,H,G,tt,et),this.renderedLetters.push(I),C+=1,!0):(I=this.renderedLetters[a]).update(K,Y,H,G,tt,et)||this.lettersChangedFlag}}},ct.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},ct.prototype.mHelper=new L,ct.prototype.defaultPropsArray=[],B([M],ct),gt.prototype.update=function(t,e,s,i,a,r){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==s&&(this.sc=s,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==a&&(this.m=a,n=this._mdf.m=!0),!r.length||this.p[0]===r[0]&&this.p[1]===r[1]&&this.p[4]===r[4]&&this.p[5]===r[5]&&this.p[12]===r[12]&&this.p[13]===r[13]||(this.p=r,n=this._mdf.p=!0),n},yt.prototype.defaultBoxWidth=[0,0],yt.prototype.copyData=function(t,e){for(var s in e)e.hasOwnProperty(s)&&(t[s]=e[s]);return t},yt.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},yt.prototype.searchProperty=function(){return this.searchKeyframes()},yt.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},yt.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},yt.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,s=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var i,a=this.effectsSequence.length,r=t||this.data.d.k[this.keysIndex].s;for(i=0;i<a;i+=1)r=s!==this.keysIndex?this.effectsSequence[i](r,r.t):this.effectsSequence[i](this.currentData,r.t);e!==r&&this.setCurrentData(r),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},yt.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,s=0,i=t.length;s<=i-1&&(t[s].s,!(s===i-1||t[s+1].t>e));)s+=1;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d.k[this.keysIndex].s},yt.prototype.buildFinalText=function(t){for(var e,s=V.getCombinedCharacterCodes(),i=[],a=0,r=t.length;a<r;)e=t.charCodeAt(a),-1!==s.indexOf(e)?i[i.length-1]+=t.charAt(a):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(a+1))&&e<=57343?(i.push(t.substr(a,2)),++a):i.push(t.charAt(a)),a+=1;return i},yt.prototype.completeTextData=function(t){t.__complete=!0;var e,s,i,a,r,n,h,o=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,d=0,c=0,u=0,g=[],y=0,v=0,b=o.getFontByName(t.f),_=0,x=b.fStyle?b.fStyle.split(" "):[],k="normal",w="normal";for(s=x.length,e=0;e<s;e+=1)switch(x[e].toLowerCase()){case"italic":w="italic";break;case"bold":k="700";break;case"black":k="900";break;case"medium":k="500";break;case"regular":case"normal":k="400";break;case"light":case"thin":k="200"}t.fWeight=b.fWeight||k,t.fStyle=w,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),s=t.finalText.length,t.finalLineHeight=t.lh;var A,P=t.tr/1e3*t.finalSize;if(t.sz)for(var C,D,S=!0,E=t.sz[0],T=t.sz[1];S;){y=C=0,s=(D=this.buildFinalText(t.t)).length,P=t.tr/1e3*t.finalSize;var M=-1;for(e=0;e<s;e+=1)A=D[e].charCodeAt(0),i=!1," "===D[e]?M=e:13!==A&&3!==A||(i=!(y=0),C+=t.finalLineHeight||1.2*t.finalSize),E<y+(_=o.chars?(h=o.getCharData(D[e],b.fStyle,b.fFamily),i?0:h.w*t.finalSize/100):o.measureText(D[e],t.f,t.finalSize))&&" "!==D[e]?(-1===M?s+=1:e=M,C+=t.finalLineHeight||1.2*t.finalSize,D.splice(e,M===e?1:0,"\r"),M=-1,y=0):(y+=_,y+=P);C+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&T<C?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=D,s=t.finalText.length,S=!1)}y=-P;var F,I=_=0;for(e=0;e<s;e+=1)if(i=!1,13===(A=(F=t.finalText[e]).charCodeAt(0))||3===A?(I=0,g.push(y),v=v<y?y:v,y=-2*P,i=!(a=""),u+=1):a=F,_=o.chars?(h=o.getCharData(F,b.fStyle,o.getFontByName(t.f).fFamily),i?0:h.w*t.finalSize/100):o.measureText(a,t.f,t.finalSize)," "===F?I+=_+P:(y+=_+P+I,I=0),p.push({l:_,an:_,add:d,n:i,anIndexes:[],val:a,line:u,animatorJustifyOffset:0}),2==m){if(d+=_,""===a||" "===a||e===s-1){for(""!==a&&" "!==a||(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;f+=1,d=0}}else if(3==m){if(d+=_,""===a||e===s-1){for(""===a&&(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;d=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<y?y:v,g.push(y),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var L,B,z=l.a;n=z.length;var V,R,N=[];for(r=0;r<n;r+=1){for((L=z[r]).a.sc&&(t.strokeColorAnim=!0),L.a.sw&&(t.strokeWidthAnim=!0),(L.a.fc||L.a.fh||L.a.fs||L.a.fb)&&(t.fillColorAnim=!0),R=0,V=L.s.b,e=0;e<s;e+=1)(B=p[e]).anIndexes[r]=R,(1==V&&""!==B.val||2==V&&""!==B.val&&" "!==B.val||3==V&&(B.n||" "==B.val||e==s-1)||4==V&&(B.n||e==s-1))&&(1===L.s.rn&&N.push(R),R+=1);l.a[r].s.totalChars=R;var O,q=-1;if(1===L.s.rn)for(e=0;e<s;e+=1)q!=(B=p[e]).anIndexes[r]&&(q=B.anIndexes[r],O=N.splice(Math.floor(Math.random()*N.length),1)[0]),B.anIndexes[r]=O}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},yt.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var s=this.copyData({},this.data.d.k[e].s);s=this.copyData(s,t),this.data.d.k[e].s=s,this.recalculate(e),this.elem.addDynamicProperty(this)},yt.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},yt.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},yt.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var vt,bt,_t,xt,kt,wt=function(){var d=Math.max,c=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=R.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?R.getProp(t,e.e,0,0,this):{v:100},this.o=R.getProp(t,e.o||{k:0},0,0,this),this.xe=R.getProp(t,e.xe||{k:0},0,0,this),this.ne=R.getProp(t,e.ne||{k:0},0,0,this),this.a=R.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,s=0,i=1,a=1;0<this.ne.v?e=this.ne.v/100:s=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:a=1+this.xe.v/100;var r=W.getBezierEasing(e,s,i,a).get,n=0,h=this.finalS,o=this.finalE,l=this.data.sh;if(2===l)n=r(n=o===h?o<=t?1:0:d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(3===l)n=r(n=o===h?o<=t?0:1:1-d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(4===l)o===h?n=0:(n=d(0,c(.5/(o-h)+(t-h)/(o-h),1)))<.5?n*=2:n=1-2*(n-.5),n=r(n);else if(5===l){if(o===h)n=0;else{var p=o-h,f=-p/2+(t=c(d(0,t+.5-h),o-h)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=r(n)}else n=6===l?r(n=o===h?0:(t=c(d(0,t+.5-h),o-h),(1+Math.cos(Math.PI+2*Math.PI*t/(o-h)))/2)):(t>=u(h)&&(n=d(0,c(t-h<0?c(o,1)-(h-t):o-t,1))),r(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,s=this.o.v/e,i=this.s.v/e+s,a=this.e.v/e+s;if(a<i){var r=i;i=a,a=r}this.finalS=i,this.finalE=a}},B([M],i),{getTextSelectorProp:function(t,e,s){return new i(t,e,s)}}}(),At=function(t,e,s,i){var a=0,r=t,n=S(r);function h(){return a?n[a-=1]:e()}return{newElement:h,release:function(t){a===r&&(n=Pt.double(n),r*=2),s&&s(t),n[a]=t,a+=1}}},Pt={double:function(t){return t.concat(S(t.length))}},Ct=At(8,function(){return j("float32",2)}),Dt=((vt=At(4,function(){return new O},function(t){var e,s=t._length;for(e=0;e<s;e+=1)Ct.release(t.v[e]),Ct.release(t.i[e]),Ct.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1})).clone=function(t){var e,s=vt.newElement(),i=void 0===t._length?t.v.length:t._length;for(s.setLength(i),s.c=t.c,e=0;e<i;e+=1)s.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return s},vt),St=(bt={newShapeCollection:function(){var t;t=_t?kt[_t-=1]:new $;return t},release:function(t){var e,s=t._length;for(e=0;e<s;e+=1)Dt.release(t.shapes[e]);t._length=0,_t===xt&&(kt=Pt.double(kt),xt*=2);kt[_t]=t,_t+=1}},_t=0,kt=S(xt=4),bt),Et=At(8,function(){return{lengths:[],totalLength:0}},function(t){var e,s=t.lengths.length;for(e=0;e<s;e+=1)Tt.release(t.lengths[e]);t.lengths.length=0}),Tt=At(8,function(){return{addedLength:0,percents:j("float32",w),lengths:j("float32",w)}});function Mt(){}function Ft(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=E("svg");var s="";if(e&&e.title){var i=E("title"),a=A();i.setAttribute("id",a),i.textContent=e.title,this.svgElement.appendChild(i),s+=a}if(e&&e.description){var r=E("desc"),n=A();r.setAttribute("id",n),r.textContent=e.description,this.svgElement.appendChild(r),s+=" "+n}s&&this.svgElement.setAttribute("aria-labelledby",s);var h=E("defs");this.svgElement.appendChild(h);var o=E("g");this.svgElement.appendChild(o),this.layerElement=o,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:h,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function It(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!e||!1!==e.hideOnTransparent,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function Lt(t,e,s){this.data=t,this.element=e,this.globalData=s,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,a=this.globalData.defs,r=this.masksProperties?this.masksProperties.length:0;this.viewData=S(r),this.solidPath="";var n,h,o,l,p,f,m,d=this.masksProperties,c=0,u=[],g=A(),y="clipPath",v="clip-path";for(i=0;i<r;i++)if(("a"!==d[i].mode&&"n"!==d[i].mode||d[i].inv||100!==d[i].o.k||d[i].o.x)&&(v=y="mask"),"s"!=d[i].mode&&"i"!=d[i].mode||0!==c?l=null:((l=E("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),n=E("path"),"n"!=d[i].mode){var b;if(c+=1,n.setAttribute("fill","s"===d[i].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==d[i].x.k?(v=y="mask",m=R.getProp(this.element,d[i].x,0,null,this.element),b=A(),(p=E("filter")).setAttribute("id",b),(f=E("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),a.appendChild(p),n.setAttribute("stroke","s"===d[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:n,x:m,expan:f,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==d[i].mode){o=u.length;var _=E("g");for(h=0;h<o;h+=1)_.appendChild(u[h]);var x=E("mask");x.setAttribute("mask-type","alpha"),x.setAttribute("id",g+"_"+c),x.appendChild(n),a.appendChild(x),_.setAttribute("mask","url("+k+"#"+g+"_"+c+")"),u.length=0,u.push(_)}else u.push(n);d[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:n,lastPath:"",op:R.getProp(this.element,d[i].o,0,.01,this.element),prop:H.getShapeProp(this.element,d[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(d[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:R.getProp(this.element,d[i].o,0,.01,this.element),prop:H.getShapeProp(this.element,d[i],3),elem:n,lastPath:""},a.appendChild(n);for(this.maskElement=E(y),r=u.length,i=0;i<r;i+=1)this.maskElement.appendChild(u[i]);0<c&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+k+"#"+g+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function Bt(){}function zt(){}function Vt(){}function Rt(){}function Nt(){}function Ot(t,e){this.elem=t,this.pos=e}function qt(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=E("path"),this.msElem=null}function jt(t,e,s){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;for(var i=0,a=t.length;i<a;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function Wt(t,e,s){this.transform={mProps:t,op:e,container:s},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function Xt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=R.getProp(t,e.o,0,.01,this),this.w=R.getProp(t,e.w,0,null,this),this.d=new tt(t,e.d||{},"svg",this),this.c=R.getProp(t,e.c,1,255,this),this.style=s,this._isAnimated=!!this._isAnimated}function Yt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=R.getProp(t,e.o,0,.01,this),this.c=R.getProp(t,e.c,1,255,this),this.style=s}function Ht(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,s)}function Gt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=R.getProp(t,e.w,0,null,this),this.d=new tt(t,e.d||{},"svg",this),this.initGradientData(t,e,s),this._isAnimated=!!this._isAnimated}function Kt(){this.it=[],this.prevViewData=[],this.gr=E("g")}Mt.prototype.checkLayers=function(t){var e,s,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e--)this.elements[e]||(s=this.layers[e]).ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},Mt.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t)}return this.createNull(t)},Mt.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Mt.prototype.createAudio=function(t){return new ae(t,this.globalData,this)},Mt.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},Mt.prototype.includeLayers=function(t){this.completeLayers=!1;var e,s,i=t.length,a=this.layers.length;for(e=0;e<i;e+=1)for(s=0;s<a;){if(this.layers[s].id==t[e].id){this.layers[s]=t[e];break}s+=1}},Mt.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},Mt.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},Mt.prototype.buildElementParenting=function(t,e,s){for(var i=this.elements,a=this.layers,r=0,n=a.length;r<n;)a[r].ind==e&&(i[r]&&!0!==i[r]?(s.push(i[r]),i[r].setAsParent(),void 0!==a[r].parent?this.buildElementParenting(t,a[r].parent,s):t.setHierarchy(s)):(this.buildItem(r),this.addPendingElement(t))),r+=1},Mt.prototype.addPendingElement=function(t){this.pendingElements.push(t)},Mt.prototype.searchExtraCompositions=function(t){var e,s=t.length;for(e=0;e<s;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},Mt.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new V,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},B([Mt],Ft),Ft.prototype.createNull=function(t){return new Jt(t,this.globalData,this)},Ft.prototype.createShape=function(t){return new he(t,this.globalData,this)},Ft.prototype.createText=function(t){return new ne(t,this.globalData,this)},Ft.prototype.createImage=function(t){return new se(t,this.globalData,this)},Ft.prototype.createComp=function(t){return new re(t,this.globalData,this)},Ft.prototype.createSolid=function(t){return new ie(t,this.globalData,this)},Ft.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var s=E("clipPath"),i=E("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var a=A();s.setAttribute("id",a),s.appendChild(i),this.layerElement.setAttribute("clip-path","url("+k+"#"+a+")"),e.appendChild(s),this.layers=t.layers,this.elements=S(t.layers.length)},Ft.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},Ft.prototype.updateContainerSize=function(){},Ft.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var s=this.createItem(this.layers[t]);e[t]=s,h&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(s),s.initExpressions()),this.appendElementInPos(s,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?s.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(s)))}},Ft.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,s=this.elements.length;e<s;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},Ft.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=s-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<s;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},Ft.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){for(var i,a=0;a<e;)this.elements[a]&&!0!==this.elements[a]&&this.elements[a].getBaseElement()&&(i=this.elements[a].getBaseElement()),a+=1;i?this.layerElement.insertBefore(s,i):this.layerElement.appendChild(s)}},Ft.prototype.hide=function(){this.layerElement.style.display="none"},Ft.prototype.show=function(){this.layerElement.style.display="block"},B([Mt],It),It.prototype.buildItem=Ft.prototype.buildItem,It.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},It.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){var i=this.layers[e];if(i.ddd&&this.supports3d)this.addTo3dContainer(s,e);else if(this.threeDElements)this.addTo3dContainer(s,e);else{for(var a,r,n=0;n<e;)this.elements[n]&&!0!==this.elements[n]&&this.elements[n].getBaseElement&&(r=this.elements[n],a=(this.layers[n].ddd?this.getThreeDContainerByPos(n):r.getBaseElement())||a),n+=1;a?i.ddd&&this.supports3d||this.layerElement.insertBefore(s,a):i.ddd&&this.supports3d||this.layerElement.appendChild(s)}}},It.prototype.createShape=function(t){return this.supports3d?new ce(t,this.globalData,this):new he(t,this.globalData,this)},It.prototype.createText=function(t){return this.supports3d?new ue(t,this.globalData,this):new ne(t,this.globalData,this)},It.prototype.createCamera=function(t){return this.camera=new ye(t,this.globalData,this),this.camera},It.prototype.createImage=function(t){return this.supports3d?new ge(t,this.globalData,this):new se(t,this.globalData,this)},It.prototype.createComp=function(t){return this.supports3d?new de(t,this.globalData,this):new re(t,this.globalData,this)},It.prototype.createSolid=function(t){return this.supports3d?new me(t,this.globalData,this):new ie(t,this.globalData,this)},It.prototype.createNull=Ft.prototype.createNull,It.prototype.getThreeDContainerByPos=function(t){for(var e=0,s=this.threeDElements.length;e<s;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}},It.prototype.createThreeDContainer=function(t,e){var s=T("div");b(s);var i=T("div");b(i),"3d"===e&&(s.style.width=this.globalData.compSize.w+"px",s.style.height=this.globalData.compSize.h+"px",s.style.transformOrigin=s.style.mozTransformOrigin=s.style.webkitTransformOrigin="50% 50%",i.style.transform=i.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)"),s.appendChild(i);var a={container:i,perspectiveElem:s,startPos:t,endPos:t,type:e};return this.threeDElements.push(a),a},It.prototype.build3dContainers=function(){var t,e,s=this.layers.length,i="";for(t=0;t<s;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?"3d"!==i&&(i="3d",e=this.createThreeDContainer(t,"3d")):"2d"!==i&&(i="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t);for(t=(s=this.threeDElements.length)-1;0<=t;t--)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},It.prototype.addTo3dContainer=function(t,e){for(var s=0,i=this.threeDElements.length;s<i;){if(e<=this.threeDElements[s].endPos){for(var a,r=this.threeDElements[s].startPos;r<e;)this.elements[r]&&this.elements[r].getBaseElement&&(a=this.elements[r].getBaseElement()),r+=1;a?this.threeDElements[s].container.insertBefore(t,a):this.threeDElements[s].container.appendChild(t);break}s+=1}},It.prototype.configAnimation=function(t){var e=T("div"),s=this.animationItem.wrapper;e.style.width=t.w+"px",e.style.height=t.h+"px",b(this.resizerElem=e),e.style.transformStyle=e.style.webkitTransformStyle=e.style.mozTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),s.appendChild(e),e.style.overflow="hidden";var i=E("svg");i.setAttribute("width","1"),i.setAttribute("height","1"),b(i),this.resizerElem.appendChild(i);var a=E("defs");i.appendChild(a),this.data=t,this.setupGlobalData(t,i),this.globalData.defs=a,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},It.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},It.prototype.updateContainerSize=function(){var t,e,s,i,a=this.animationItem.wrapper.offsetWidth,r=this.animationItem.wrapper.offsetHeight;i=a/r<this.globalData.compSize.w/this.globalData.compSize.h?(t=a/this.globalData.compSize.w,e=a/this.globalData.compSize.w,s=0,(r-this.globalData.compSize.h*(a/this.globalData.compSize.w))/2):(t=r/this.globalData.compSize.h,e=r/this.globalData.compSize.h,s=(a-this.globalData.compSize.w*(r/this.globalData.compSize.h))/2,0),this.resizerElem.style.transform=this.resizerElem.style.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+s+","+i+",0,1)"},It.prototype.renderFrame=Ft.prototype.renderFrame,It.prototype.hide=function(){this.resizerElem.style.display="none"},It.prototype.show=function(){this.resizerElem.style.display="block"},It.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,s=this.globalData.compSize.h,i=this.threeDElements.length;for(t=0;t<i;t+=1)this.threeDElements[t].perspectiveElem.style.perspective=this.threeDElements[t].perspectiveElem.style.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(s,2))+"px"}},It.prototype.searchExtraCompositions=function(t){var e,s=t.length,i=T("div");for(e=0;e<s;e+=1)if(t[e].xt){var a=this.createComp(t[e],i,this.globalData.comp,null);a.initExpressions(),this.globalData.projectInterface.registerComposition(a)}},Lt.prototype.getMaskProperty=function(t){return this.viewData[t].prop},Lt.prototype.renderFrame=function(t){var e,s=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",s.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var a=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+k+"#"+this.storedData[e].filterId+")")),a.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},Lt.prototype.getMaskelement=function(){return this.maskElement},Lt.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},Lt.prototype.drawPath=function(t,e,s){var i,a,r=" M"+e.v[0][0]+","+e.v[0][1];for(a=e._length,i=1;i<a;i+=1)r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<a&&(r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),s.lastPath!==r){var n="";s.elem&&(e.c&&(n=t.inv?this.solidPath+r:r),s.elem.setAttribute("d",n)),s.lastPath=r}},Lt.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},Bt.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},zt.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var s,i=this.dynamicProperties.length;for(s=0;s<i;s+=1)(e||this._isParent&&"transform"===this.dynamicProperties[s].propType)&&(this.dynamicProperties[s].getValue(),this.dynamicProperties[s]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},Vt.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?N.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new L},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,s=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;s<i;){if(this.hierarchy[s].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}s+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),s=0;s<i;s+=1)t=this.hierarchy[s].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var s=!0,i=this.comp;s;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):s=!1;var a,r,n=e.length;for(a=0;a<n;a+=1)r=e[a].mat.applyToPointArray(0,0,0),t=[t[0]-r[0],t[1]-r[1],0];return t},mHelper:new L},Rt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},B([Rt,function(t){function e(){}return e.prototype=t,e}({initElement:function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],Nt),qt.prototype.reset=function(){this.d="",this._mdf=!1},jt.prototype.setAsAnimated=function(){this._isAnimated=!0},B([M],Xt),B([M],Yt),Ht.prototype.initGradientData=function(t,e,s){this.o=R.getProp(t,e.o,0,.01,this),this.s=R.getProp(t,e.s,1,null,this),this.e=R.getProp(t,e.e,1,null,this),this.h=R.getProp(t,e.h||{k:0},0,.01,this),this.a=R.getProp(t,e.a||{k:0},0,q,this),this.g=new et(t,e.g,this),this.style=s,this.stops=[],this.setGradientData(s.pElem,e),this.setGradientOpacity(e,s),this._isAnimated=!!this._isAnimated},Ht.prototype.setGradientData=function(t,e){var s=A(),i=E(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",s),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var a,r,n,h=[];for(n=4*e.g.p,r=0;r<n;r+=4)a=E("stop"),i.appendChild(a),h.push(a);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+k+"#"+s+")"),this.gf=i,this.cst=h},Ht.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var s,i,a,r=E("mask"),n=E("path");r.appendChild(n);var h=A(),o=A();r.setAttribute("id",o);var l=E(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",h),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),a=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(i=4*t.g.p;i<a;i+=2)(s=E("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(s),p.push(s);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+k+"#"+h+")"),this.of=l,this.ms=r,this.ost=p,this.maskId=o,e.msElem=n}},B([M],Ht),B([Ht,M],Gt);var Ut=function(){var g=new L,y=new L;function e(t,e,s){(s||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(s||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function s(t,e,s){var i,a,r,n,h,o,l,p,f,m,d,c=e.styles.length,u=e.lvl;for(o=0;o<c;o+=1){if(n=e.sh._mdf||s,e.styles[o].lvl<u){for(p=y.reset(),m=u-e.styles[o].lvl,d=e.transformers.length-1;!n&&0<m;)n=e.transformers[d].mProps._mdf||n,m--,d--;if(n)for(m=u-e.styles[o].lvl,d=e.transformers.length-1;0<m;)f=e.transformers[d].mProps.v.props,p.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),m--,d--}else p=g;if(a=(l=e.sh.paths)._length,n){for(r="",i=0;i<a;i+=1)(h=l.shapes[i])&&h._length&&(r+=at(h,h._length,h.c,p));e.caches[o]=r}else r=e.caches[o];e.styles[o].d+=!0===t.hd?"":r,e.styles[o]._mdf=n||e.styles[o]._mdf}}function i(t,e,s){var i=e.style;(e.c._mdf||s)&&i.pElem.setAttribute("fill","rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function a(t,e,s){r(t,e,s),n(t,e,s)}function r(t,e,s){var i,a,r,n,h,o=e.gf,l=e.g._hasOpacity,p=e.s.v,f=e.e.v;if(e.o._mdf||s){var m="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(m,e.o.v)}if(e.s._mdf||s){var d=1===t.t?"x1":"cx",c="x1"===d?"y1":"cy";o.setAttribute(d,p[0]),o.setAttribute(c,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(d,p[0]),e.of.setAttribute(c,p[1]))}if(e.g._cmdf||s){i=e.cst;var u=e.g.c;for(r=i.length,a=0;a<r;a+=1)(n=i[a]).setAttribute("offset",u[4*a]+"%"),n.setAttribute("stop-color","rgb("+u[4*a+1]+","+u[4*a+2]+","+u[4*a+3]+")")}if(l&&(e.g._omdf||s)){var g=e.g.o;for(r=(i=e.g._collapsable?e.cst:e.ost).length,a=0;a<r;a+=1)n=i[a],e.g._collapsable||n.setAttribute("offset",g[2*a]+"%"),n.setAttribute("stop-opacity",g[2*a+1])}if(1===t.t)(e.e._mdf||s)&&(o.setAttribute("x2",f[0]),o.setAttribute("y2",f[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",f[0]),e.of.setAttribute("y2",f[1])));else if((e.s._mdf||e.e._mdf||s)&&(h=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)),o.setAttribute("r",h),l&&!e.g._collapsable&&e.of.setAttribute("r",h)),e.e._mdf||e.h._mdf||e.a._mdf||s){h||(h=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)));var y=Math.atan2(f[1]-p[1],f[0]-p[0]),v=h*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),b=Math.cos(y+e.a.v)*v+p[0],_=Math.sin(y+e.a.v)*v+p[1];o.setAttribute("fx",b),o.setAttribute("fy",_),l&&!e.g._collapsable&&(e.of.setAttribute("fx",b),e.of.setAttribute("fy",_))}}function n(t,e,s){var i=e.style,a=e.d;a&&(a._mdf||s)&&a.dashStr&&(i.pElem.setAttribute("stroke-dasharray",a.dashStr),i.pElem.setAttribute("stroke-dashoffset",a.dashoffset[0])),e.c&&(e.c._mdf||s)&&i.pElem.setAttribute("stroke","rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||s)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){t.ty;switch(t.ty){case"fl":return i;case"gf":return r;case"gs":return a;case"st":return n;case"sh":case"el":case"rc":case"sr":return s;case"tr":return e}}}}();function Zt(){}function Jt(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initFrame(),this.initTransform(t,e,s),this.initHierarchy()}function Qt(){}function $t(){}function te(){}function ee(){}function se(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ie(t,e,s){this.initElement(t,e,s)}function ae(t,e,s){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,s),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function re(t,e,s){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?S(this.layers.length):[],this.initElement(t,e,s),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ne(t,e,s){this.textSpans=[],this.renderType="svg",this.initElement(t,e,s)}function he(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,s),this.prevViewData=[]}Zt.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=I(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=A(),this.data.sr||(this.data.sr=1),this.effectsManager=new _e(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},Jt.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},Jt.prototype.renderFrame=function(){},Jt.prototype.getBaseElement=function(){return null},Jt.prototype.destroy=function(){},Jt.prototype.sourceRectAtTime=function(){},Jt.prototype.hide=function(){},B([Zt,Vt,Bt,zt],Jt),Qt.prototype={initRendererElement:function(){this.layerElement=E("g")},createContainerElements:function(){this.matteElement=E("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,s,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var a=E("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),a.appendChild(this.layerElement),i=a,this.globalData.defs.appendChild(a),ht.maskType||1!=this.data.td||(a.setAttribute("mask-type","luminance"),t=A(),e=ot.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(ot.createAlphaToLuminanceFilter()),(s=E("g")).appendChild(this.layerElement),i=s,a.appendChild(s),s.setAttribute("filter","url("+k+"#"+t+")"))}else if(2==this.data.td){var r=E("mask");r.setAttribute("id",this.layerId),r.setAttribute("mask-type","alpha");var n=E("g");r.appendChild(n),t=A(),e=ot.createFilter(t);var h=E("feComponentTransfer");h.setAttribute("in","SourceGraphic"),e.appendChild(h);var o=E("feFuncA");o.setAttribute("type","table"),o.setAttribute("tableValues","1.0 0.0"),h.appendChild(o),this.globalData.defs.appendChild(e);var l=E("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+k+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,ht.maskType||(r.setAttribute("mask-type","luminance"),e.appendChild(ot.createAlphaToLuminanceFilter()),s=E("g"),n.appendChild(l),s.appendChild(this.layerElement),i=s,n.appendChild(s)),this.globalData.defs.appendChild(r)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=E("clipPath"),f=E("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=A();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var d=E("g");d.setAttribute("clip-path","url("+k+"#"+m+")"),d.appendChild(this.layerElement),this.transformedElement=d,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+k+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new Lt(this.data,this,this.globalData),this.renderableEffectsManager=new le(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+k+"#"+t+")")}},$t.prototype={addShapeToModifiers:function(t){var e,s=this.shapeModifiers.length;for(e=0;e<s;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,s=0,i=e.length;s<i;){if(e[s].elem===t)return e[s].pos;s+=1}return 0},addProcessedElement:function(t,e){for(var s=this.processedElements,i=s.length;i;)if(s[i-=1].elem===t)return void(s[i].pos=e);s.push(new Ot(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},te.prototype.initElement=function(t,e,s){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new yt(this,t.t,this.dynamicProperties),this.textAnimator=new ct(t.t,this.renderType,this),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},te.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},te.prototype.createPathShape=function(t,e){var s,i,a=e.length,r="";for(s=0;s<a;s+=1)i=e[s].ks.k,r+=at(i,i.i.length,!0,t);return r},te.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},te.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},te.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},te.prototype.applyTextPropertiesToMatrix=function(t,e,s,i,a){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s])/2,0,0)}e.translate(i,a,0)},te.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},te.prototype.emptyProp=new gt,te.prototype.destroy=function(){},B([Zt,Vt,Bt,zt,Nt],ee),ee.prototype.initElement=function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ee.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var s,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),s=i-1;0<=s;s-=1)(this.completeLayers||this.elements[s])&&(this.elements[s].prepareFrame(this.renderedFrame-this.layers[s].st),this.elements[s]._mdf&&(this._mdf=!0))}},ee.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ee.prototype.setElements=function(t){this.elements=t},ee.prototype.getElements=function(){return this.elements},ee.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ee.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},B([Zt,Vt,Qt,Bt,zt,Nt],se),se.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=E("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},se.prototype.sourceRectAtTime=function(){return this.sourceRect},B([se],ie),ie.prototype.createContent=function(){var t=E("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},ae.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},B([Rt,Zt,zt],ae),ae.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},ae.prototype.show=function(){},ae.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},ae.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},ae.prototype.resume=function(){this._canPlay=!0},ae.prototype.setRate=function(t){this.audio.rate(t)},ae.prototype.volume=function(t){this.audio.volume(t)},ae.prototype.getBaseElement=function(){return null},ae.prototype.destroy=function(){},ae.prototype.sourceRectAtTime=function(){},ae.prototype.initExpressions=function(){},B([Ft,ee,Qt],re),B([Zt,Vt,Qt,Bt,zt,Nt,te],ne),ne.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=E("text"))},ne.prototype.buildTextContents=function(t){for(var e=0,s=t.length,i=[],a="";e<s;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(a),a=""):a+=t[e],e+=1;return i.push(a),i},ne.prototype.buildNewText=function(){var t,e,s=this.textProperty.currentData;this.renderedLetters=S(s?s.l.length:0),s.fc?this.layerElement.setAttribute("fill",this.buildColor(s.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(s.sc)),this.layerElement.setAttribute("stroke-width",s.sw)),this.layerElement.setAttribute("font-size",s.finalSize);var i=this.globalData.fontManager.getFontByName(s.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var a=s.fWeight,r=s.fStyle;this.layerElement.setAttribute("font-style",r),this.layerElement.setAttribute("font-weight",a)}this.layerElement.setAttribute("aria-label",s.t);var n,h=s.l||[],o=!!this.globalData.fontManager.chars;e=h.length;var l,p=this.mHelper,f="",m=this.data.singleShape,d=0,c=0,u=!0,g=s.tr/1e3*s.finalSize;if(!m||o||s.sz){var y,v,b=this.textSpans.length;for(t=0;t<e;t+=1)o&&m&&0!==t||(n=t<b?this.textSpans[t]:E(o?"path":"text"),b<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(s.finalSize/100,s.finalSize/100),m&&(h[t].n&&(d=-g,c+=s.yOffset,c+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(s,p,h[t].line,d,c),d+=h[t].l||0,d+=g),o?(l=(y=(v=this.globalData.fontManager.getCharData(s.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily))&&v.data||{}).shapes?y.shapes[0].it:[],m?f+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(m&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=h[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&n&&n.setAttribute("d",f)}else{var _=this.textContainer,x="start";switch(s.j){case 1:x="end";break;case 2:x="middle"}_.setAttribute("text-anchor",x),_.setAttribute("letter-spacing",g);var k=this.buildTextContents(s.finalText);for(e=k.length,c=s.ps?s.ps[1]+s.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||E("tspan")).textContent=k[t],n.setAttribute("x",0),n.setAttribute("y",c),n.style.display="inherit",_.appendChild(n),this.textSpans[t]=n,c+=s.finalLineHeight;this.layerElement.appendChild(_)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},ne.prototype.sourceRectAtTime=function(t){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},ne.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var s,i,a=this.textAnimator.renderedLetters,r=this.textProperty.currentData.l;for(e=r.length,t=0;t<e;t+=1)r[t].n||(s=a[t],i=this.textSpans[t],s._mdf.m&&i.setAttribute("transform",s.m),s._mdf.o&&i.setAttribute("opacity",s.o),s._mdf.sw&&i.setAttribute("stroke-width",s.sw),s._mdf.sc&&i.setAttribute("stroke",s.sc),s._mdf.fc&&i.setAttribute("fill",s.fc))}},B([Zt,Vt,Qt,$t,Bt,zt,Nt],he),he.prototype.initSecondaryElement=function(){},he.prototype.identityMatrix=new L,he.prototype.buildExpressionInterface=function(){},he.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},he.prototype.filterUniqueShapes=function(){var t,e,s,i,a=this.shapes.length,r=this.stylesList.length,n=[],h=!1;for(s=0;s<r;s+=1){for(i=this.stylesList[s],h=!1,t=n.length=0;t<a;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),h=e._isAnimated||h);1<n.length&&h&&this.setShapesAsAnimated(n)}},he.prototype.setShapesAsAnimated=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].setAsAnimated()},he.prototype.createStyleElement=function(t,e){var s,i=new qt(t,e),a=i.pElem;if("st"===t.ty)s=new Xt(this,t,i);else if("fl"===t.ty)s=new Yt(this,t,i);else if("gf"===t.ty||"gs"===t.ty){s=new("gf"===t.ty?Ht:Gt)(this,t,i),this.globalData.defs.appendChild(s.gf),s.maskId&&(this.globalData.defs.appendChild(s.ms),this.globalData.defs.appendChild(s.of),a.setAttribute("mask","url("+k+"#"+s.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(a.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),a.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),a.setAttribute("fill-opacity","0"),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&a.setAttribute("fill-rule","evenodd"),t.ln&&a.setAttribute("id",t.ln),t.cl&&a.setAttribute("class",t.cl),t.bm&&(a.style["mix-blend-mode"]=I(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,s),s},he.prototype.createGroupElement=function(t){var e=new Kt;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=I(t.bm)),e},he.prototype.createTransformElement=function(t,e){var s=N.getTransformProperty(this,t,this),i=new Wt(s,s.o,e);return this.addToAnimatedContents(t,i),i},he.prototype.createShapeElement=function(t,e,s){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var a=new jt(e,s,H.getShapeProp(this,t,i,this));return this.shapes.push(a),this.addShapeToModifiers(a),this.addToAnimatedContents(t,a),a},he.prototype.addToAnimatedContents=function(t,e){for(var s=0,i=this.animatedContents.length;s<i;){if(this.animatedContents[s].element===e)return;s+=1}this.animatedContents.push({fn:Ut.createRenderFunction(t),element:e,data:t})},he.prototype.setElementStyles=function(t){var e,s=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||s.push(this.stylesList[e])},he.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},he.prototype.searchShapes=function(t,e,s,i,a,r,n){var h,o,l,p,f,m,d=[].concat(r),c=t.length-1,u=[],g=[];for(h=c;0<=h;h-=1){if((m=this.searchProcessedElement(t[h]))?e[h]=s[m-1]:t[h]._render=n,"fl"==t[h].ty||"st"==t[h].ty||"gf"==t[h].ty||"gs"==t[h].ty)m?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],a),t[h]._render&&i.appendChild(e[h].style.pElem),u.push(e[h].style);else if("gr"==t[h].ty){if(m)for(l=e[h].it.length,o=0;o<l;o+=1)e[h].prevViewData[o]=e[h].it[o];else e[h]=this.createGroupElement(t[h]);this.searchShapes(t[h].it,e[h].it,e[h].prevViewData,e[h].gr,a+1,d,n),t[h]._render&&i.appendChild(e[h].gr)}else"tr"==t[h].ty?(m||(e[h]=this.createTransformElement(t[h],i)),p=e[h].transform,d.push(p)):"sh"==t[h].ty||"rc"==t[h].ty||"el"==t[h].ty||"sr"==t[h].ty?(m||(e[h]=this.createShapeElement(t[h],d,a)),this.setElementStyles(e[h])):"tm"==t[h].ty||"rd"==t[h].ty||"ms"==t[h].ty||"pb"==t[h].ty?(m?(f=e[h]).closed=!1:((f=G.getModifier(t[h].ty)).init(this,t[h]),e[h]=f,this.shapeModifiers.push(f)),g.push(f)):"rp"==t[h].ty&&(m?(f=e[h]).closed=!0:(f=G.getModifier(t[h].ty),(e[h]=f).init(this,t,h,e),this.shapeModifiers.push(f),n=!1),g.push(f));this.addProcessedElement(t[h],h+1)}for(c=u.length,h=0;h<c;h+=1)u[h].closed=!0;for(c=g.length,h=0;h<c;h+=1)g[h].closed=!0},he.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},he.prototype.renderShape=function(){var t,e,s=this.animatedContents.length;for(t=0;t<s;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},he.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null};var oe=[];function le(){}function pe(){}function fe(t,e,s){}function me(t,e,s){this.initElement(t,e,s)}function de(t,e,s){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?S(this.layers.length):[],this.initElement(t,e,s),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ce(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=E("g"),this.initElement(t,e,s),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function ue(t,e,s){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,s)}function ge(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s)}function ye(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initHierarchy();var i=R.getProp;if(this.pe=i(this,t.pe,0,0,this),t.ks.p.s?(this.px=i(this,t.ks.p.x,1,0,this),this.py=i(this,t.ks.p.y,1,0,this),this.pz=i(this,t.ks.p.z,1,0,this)):this.p=i(this,t.ks.p,1,0,this),t.ks.a&&(this.a=i(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var a,r=t.ks.or.k.length;for(a=0;a<r;a+=1)t.ks.or.k[a].to=null,t.ks.or.k[a].ti=null}this.or=i(this,t.ks.or,1,q,this),this.or.sh=!0,this.rx=i(this,t.ks.rx,0,q,this),this.ry=i(this,t.ks.ry,0,q,this),this.rz=i(this,t.ks.rz,0,q,this),this.mat=new L,this._prevMat=new L,this._isFirstFrame=!0,this.finalTransform={mProp:this}}pe.prototype.renderFrame=function(){},(fe.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=T(this.data.tg||"div"),this.data.hasMask?(this.svgElement=E("svg"),this.layerElement=E("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,b(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new pe(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&(this.transformedElement.style.transform=this.transformedElement.style.webkitTransform=this.finalTransform.mat.toCSS()),this.finalTransform._opMdf&&(this.transformedElement.style.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new Lt(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}}).getBaseElement=Qt.prototype.getBaseElement,fe.prototype.destroyBaseElement=fe.prototype.destroy,fe.prototype.buildElementParenting=It.prototype.buildElementParenting,B([Zt,Vt,fe,Bt,zt,Nt],me),me.prototype.createContent=function(){var t;this.data.hasMask?((t=E("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=T("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},B([It,ee,fe],de),de.prototype._createBaseContainerElements=de.prototype.createContainerElements,de.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},de.prototype.addTo3dContainer=function(t,e){for(var s,i=0;i<e;)this.elements[i]&&this.elements[i].getBaseElement&&(s=this.elements[i].getBaseElement()),i+=1;s?this.layerElement.insertBefore(t,s):this.layerElement.appendChild(t)},B([Zt,Vt,me,he,fe,Bt,zt,Rt],ce),ce.prototype._renderShapeFrame=ce.prototype.renderInnerContent,ce.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=E("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},ce.prototype.getTransformedPoint=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e=t[s].mProps.v.applyToPointArray(e[0],e[1],0);return e},ce.prototype.calculateShapeBoundingBox=function(t,e){var s,i,a,r,n,h=t.sh.v,o=t.transformers,l=h._length;if(!(l<=1)){for(s=0;s<l-1;s+=1)i=this.getTransformedPoint(o,h.v[s]),a=this.getTransformedPoint(o,h.o[s]),r=this.getTransformedPoint(o,h.i[s+1]),n=this.getTransformedPoint(o,h.v[s+1]),this.checkBounds(i,a,r,n,e);h.c&&(i=this.getTransformedPoint(o,h.v[s]),a=this.getTransformedPoint(o,h.o[s]),r=this.getTransformedPoint(o,h.i[0]),n=this.getTransformedPoint(o,h.v[0]),this.checkBounds(i,a,r,n,e))}},ce.prototype.checkBounds=function(t,e,s,i,a){this.getBoundsOfCurve(t,e,s,i);var r=this.shapeBoundingBox;a.x=c(r.left,a.x),a.xMax=d(r.right,a.xMax),a.y=c(r.top,a.y),a.yMax=d(r.bottom,a.yMax)},ce.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},ce.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},ce.prototype.getBoundsOfCurve=function(t,e,s,i){for(var a,r,n,h,o,l,p,f=[[t[0],i[0]],[t[1],i[1]]],m=0;m<2;++m)if(r=6*t[m]-12*e[m]+6*s[m],a=-3*t[m]+9*e[m]-9*s[m]+3*i[m],n=3*e[m]-3*t[m],r|=0,n|=0,0!==(a|=0))(o=r*r-4*n*a)<0||(0<(l=(-r+x(o))/(2*a))&&l<1&&f[m].push(this.calculateF(l,t,e,s,i,m)),0<(p=(-r-x(o))/(2*a))&&p<1&&f[m].push(this.calculateF(p,t,e,s,i,m)));else{if(0===r)continue;0<(h=-n/r)&&h<1&&f[m].push(this.calculateF(h,t,e,s,i,m))}this.shapeBoundingBox.left=c.apply(null,f[0]),this.shapeBoundingBox.top=c.apply(null,f[1]),this.shapeBoundingBox.right=d.apply(null,f[0]),this.shapeBoundingBox.bottom=d.apply(null,f[1])},ce.prototype.calculateF=function(t,e,s,i,a,r){return _(1-t,3)*e[r]+3*_(1-t,2)*t*s[r]+3*(1-t)*_(t,2)*i[r]+_(t,3)*a[r]},ce.prototype.calculateBoundingBox=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]&&t[s].sh?this.calculateShapeBoundingBox(t[s],e):t[s]&&t[s].it&&this.calculateBoundingBox(t[s].it,e)},ce.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},ce.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var s=!1;this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),s=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),s=!0),(s||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y)&&(this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.shapeCont.style.transform=this.shapeCont.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}},B([Zt,Vt,fe,Bt,zt,Nt,te],ue),ue.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=E("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},ue.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=S(t.l?t.l.length:0);var e=this.innerElem.style;e.color=e.fill=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)",t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var s,i,a=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",a.fClass)this.innerElem.className=a.fClass;else{e.fontFamily=a.fFamily;var r=t.fWeight,n=t.fStyle;e.fontStyle=n,e.fontWeight=r}var h,o,l,p=t.l;i=p.length;var f,m=this.mHelper,d="",c=0;for(s=0;s<i;s+=1){if(this.globalData.fontManager.chars?(this.textPaths[c]?h=this.textPaths[c]:((h=E("path")).setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[c]?l=(o=this.textSpans[c]).children[0]:((o=T("div")).style.lineHeight=0,(l=E("svg")).appendChild(h),b(o)))):this.isMasked?h=this.textPaths[c]?this.textPaths[c]:E("text"):this.textSpans[c]?(o=this.textSpans[c],h=this.textPaths[c]):(b(o=T("span")),b(h=T("span")),o.appendChild(h)),this.globalData.fontManager.chars){var u,g=this.globalData.fontManager.getCharData(t.finalText[s],a.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(u=g?g.data:null,m.reset(),u&&u.shapes&&(f=u.shapes[0].it,m.scale(t.finalSize/100,t.finalSize/100),d=this.createPathShape(m,f),h.setAttribute("d",d)),this.isMasked)this.innerElem.appendChild(h);else{if(this.innerElem.appendChild(o),u&&u.shapes){document.body.appendChild(l);var y=l.getBBox();l.setAttribute("width",y.width+2),l.setAttribute("height",y.height+2),l.setAttribute("viewBox",y.x-1+" "+(y.y-1)+" "+(y.width+2)+" "+(y.height+2)),l.style.transform=l.style.webkitTransform="translate("+(y.x-1)+"px,"+(y.y-1)+"px)",p[s].yOffset=y.y-1}else l.setAttribute("width",1),l.setAttribute("height",1);o.appendChild(l)}}else h.textContent=p[s].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked?this.innerElem.appendChild(h):(this.innerElem.appendChild(o),h.style.transform=h.style.webkitTransform="translate3d(0,"+-t.finalSize/1.2+"px,0)");this.isMasked?this.textSpans[c]=h:this.textSpans[c]=o,this.textSpans[c].style.display="block",this.textPaths[c]=h,c+=1}for(;c<this.textSpans.length;)this.textSpans[c].style.display="none",c+=1},ue.prototype.renderInnerContent=function(){if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;this.isMasked&&this.finalTransform._matMdf&&(this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)")}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var t,e,s,i,a,r=0,n=this.textAnimator.renderedLetters,h=this.textProperty.currentData.l;for(e=h.length,t=0;t<e;t+=1)h[t].n?r+=1:(i=this.textSpans[t],a=this.textPaths[t],s=n[r],r+=1,s._mdf.m&&(this.isMasked?i.setAttribute("transform",s.m):i.style.transform=i.style.webkitTransform=s.m),i.style.opacity=s.o,s.sw&&s._mdf.sw&&a.setAttribute("stroke-width",s.sw),s.sc&&s._mdf.sc&&a.setAttribute("stroke",s.sc),s.fc&&s._mdf.fc&&(a.setAttribute("fill",s.fc),a.style.color=s.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var o=this.innerElem.getBBox();this.currentBBox.w!==o.width&&(this.currentBBox.w=o.width,this.svgElement.setAttribute("width",o.width)),this.currentBBox.h!==o.height&&(this.currentBBox.h=o.height,this.svgElement.setAttribute("height",o.height));this.currentBBox.w===o.width+2&&this.currentBBox.h===o.height+2&&this.currentBBox.x===o.x-1&&this.currentBBox.y===o.y-1||(this.currentBBox.w=o.width+2,this.currentBBox.h=o.height+2,this.currentBBox.x=o.x-1,this.currentBBox.y=o.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),this.svgElement.style.transform=this.svgElement.style.webkitTransform="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)")}}},B([Zt,Vt,fe,me,Bt,zt,Rt],ge),ge.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=E("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},B([Zt,zt,Bt],ye),ye.prototype.setup=function(){var t,e,s=this.comp.threeDElements.length;for(t=0;t<s;t+=1)"3d"===(e=this.comp.threeDElements[t]).type&&(e.perspectiveElem.style.perspective=e.perspectiveElem.style.webkitPerspective=this.pe.v+"px",e.container.style.transformOrigin=e.container.style.mozTransformOrigin=e.container.style.webkitTransformOrigin="0px 0px 0px",e.perspectiveElem.style.transform=e.perspectiveElem.style.webkitTransform="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)")},ye.prototype.createElements=function(){},ye.prototype.hide=function(){},ye.prototype.renderFrame=function(){var t,e,s=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)s=this.hierarchy[t].finalTransform.mProp._mdf||s;if(s||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){if(this.mat.reset(),this.hierarchy)for(t=e=this.hierarchy.length-1;0<=t;t-=1){var i=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-i.p.v[0],-i.p.v[1],i.p.v[2]),this.mat.rotateX(-i.or.v[0]).rotateY(-i.or.v[1]).rotateZ(i.or.v[2]),this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v),this.mat.scale(1/i.s.v[0],1/i.s.v[1],1/i.s.v[2]),this.mat.translate(i.a.v[0],i.a.v[1],i.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var a;a=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var r=Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)),n=[a[0]/r,a[1]/r,a[2]/r],h=Math.sqrt(n[2]*n[2]+n[0]*n[0]),o=Math.atan2(n[1],h),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-o)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var f;for(e=this.comp.threeDElements.length,t=0;t<e;t+=1)"3d"===(f=this.comp.threeDElements[t]).type&&(p&&(f.container.style.transform=f.container.style.webkitTransform=this.mat.toCSS()),this.pe._mdf&&(f.perspectiveElem.style.perspective=f.perspectiveElem.style.webkitPerspective=this.pe.v+"px"));this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},ye.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},ye.prototype.destroy=function(){},ye.prototype.getBaseElement=function(){return null};var ve=function(){var t={},a=[],i=0,r=0,n=0,h=!0,o=!1;function s(t){for(var e=0,s=t.target;e<r;)a[e].animation===s&&(a.splice(e,1),e-=1,r-=1,s.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var s=0;s<r;){if(a[s].elem==t&&null!==a[s].elem)return a[s].animation;s+=1}var i=new be;return m(i,t),i.setData(t,e),i}function p(){n+=1,c()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",s),t.addEventListener("_active",p),t.addEventListener("_idle",f),a.push({elem:e,animation:t}),r+=1}function d(t){var e,s=t-i;for(e=0;e<r;e+=1)a[e].animation.advanceTime(s);i=t,n&&!o?window.requestAnimationFrame(d):h=!0}function e(t){i=t,window.requestAnimationFrame(d)}function c(){!o&&n&&h&&(window.requestAnimationFrame(e),h=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new be;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setSpeed(t,e)},t.setDirection=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.togglePause(t)},t.searchAnimations=function(t,e,s){var i,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),r=a.length;for(i=0;i<r;i+=1)s&&a[i].setAttribute("data-bm-type",s),l(a[i],t);if(e&&0===r){s||(s="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var h=T("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",s),n.appendChild(h),l(h,t)}},t.resize=function(){var t;for(t=0;t<r;t+=1)a[t].animation.resize()},t.goToAndStop=function(t,e,s){var i;for(i=0;i<r;i+=1)a[i].animation.goToAndStop(t,e,s)},t.destroy=function(t){var e;for(e=r-1;0<=e;e-=1)a[e].animation.destroy(t)},t.freeze=function(){o=!0},t.unfreeze=function(){o=!1,c()},t.setVolume=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=a.length,s=[];for(t=0;t<e;t+=1)s.push(a[t].animation);return s},t}(),be=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=A(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=i,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface={},this.imagePreloader=new nt,this.audioController=rt()};function _e(){this.effectElements=[]}B([D],be),be.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new Ft(this,t.rendererSettings);break;default:this.renderer=new It(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dt.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},be.prototype.setData=function(t,e){var s={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;s.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",s.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===a||(s.loop="false"!==a&&("true"===a||parseInt(a)));var r=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;s.autoplay="false"!==r,s.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(s.prerender=!1),this.setParams(s)},be.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,s,i=this.animationData.layers,a=i.length,r=t.layers,n=r.length;for(s=0;s<n;s+=1)for(e=0;e<a;){if(i[e].id==r[s].id){i[e]=r[s];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,z.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),h&&h.initExpressions(this),this.loadNextSegment()},be.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dt.load(s,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},be.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},be.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},be.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},be.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},be.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},be.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,z.completeData(this.animationData,this.renderer.globalData.fontManager),h&&h.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},be.prototype.resize=function(){this.renderer.updateContainerSize()},be.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},be.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},be.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},be.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},be.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},be.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},be.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},be.prototype.goToAndStop=function(t,e,s){s&&this.name!=s||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},be.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},be.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(s=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},be.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},be.prototype.setSegment=function(t,e){var s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==s&&this.goToAndStop(s,!0)},be.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var s,i=t.length;for(s=0;s<i;s+=1)this.segments.push(t[s])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},be.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},be.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},be.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},be.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},be.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},be.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},be.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},be.prototype.getVolume=function(){return this.audioController.getVolume()},be.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},be.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},be.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},be.prototype.getPath=function(){return this.path},be.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},be.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;e<s;){if(t==this.assets[e].id)return this.assets[e];e+=1}},be.prototype.hide=function(){this.renderer.hide()},be.prototype.show=function(){this.renderer.show()},be.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},be.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new o(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new p(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new l(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new m(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new u(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new o(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new p(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new l(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new m(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new u(t,this))},be.prototype.triggerRenderFrameError=function(t){var e=new g(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var lottie={};be.prototype.triggerConfigError=function(t){var e=new y(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};function xe(){!0===ke?ve.searchAnimations(we,ke,Ae):ve.searchAnimations()}lottie.play=ve.play,lottie.pause=ve.pause,lottie.setLocationHref=function(t){k=t},lottie.togglePause=ve.togglePause,lottie.setSpeed=ve.setSpeed,lottie.setDirection=ve.setDirection,lottie.stop=ve.stop,lottie.searchAnimations=xe,lottie.registerAnimation=ve.registerAnimation,lottie.loadAnimation=function(t){return!0===ke&&(t.animationData=JSON.parse(we)),ve.loadAnimation(t)},lottie.setSubframeRendering=function(t){i=t},lottie.resize=ve.resize,lottie.goToAndStop=ve.goToAndStop,lottie.destroy=ve.destroy,lottie.setQuality=function(t){if("string"==typeof t)switch(t){case"high":w=200;break;case"medium":w=50;break;case"low":w=10}else!isNaN(t)&&1<t&&(w=t);r(!(50<=w))},lottie.inBrowser=function(){return"undefined"!=typeof navigator},lottie.installPlugin=function(t,e){"expressions"===t&&(h=e)},lottie.freeze=ve.freeze,lottie.unfreeze=ve.unfreeze,lottie.setVolume=ve.setVolume,lottie.mute=ve.mute,lottie.unmute=ve.unmute,lottie.getRegisteredAnimations=ve.getRegisteredAnimations,lottie.__getFactory=function(t){switch(t){case"propertyFactory":return R;case"shapePropertyFactory":return H;case"matrix":return L}},lottie.version="5.7.5";var ke="__[STANDALONE]__",we="__[ANIMATIONDATA]__",Ae="";if(ke){var Pe=document.getElementsByTagName("script"),Ce=(Pe[Pe.length-1]||{src:""}).src.replace(/^[^\?]+\??/,"");Ae=function(t){for(var e=Ce.split("&"),s=0;s<e.length;s++){var i=e[s].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}}("renderer")}var De=setInterval(function(){"complete"===document.readyState&&(clearInterval(De),xe())},100);
+	"use strict";var h,e="http://www.w3.org/2000/svg",x="",s=-999999,i=!0,n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),_=Math.pow,k=Math.sqrt,f=Math.floor,d=Math.max,c=Math.min,a={};!function(){var t,e=["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"],s=e.length;for(t=0;t<s;t+=1)a[e[t]]=Math[e[t]]}(),a.random=Math.random,a.abs=function(t){if("object"===typeof t&&t.length){var e,s=S(t.length),i=t.length;for(e=0;e<i;e+=1)s[e]=Math.abs(t[e]);return s}return Math.abs(t)};var w=150,q=Math.PI/180,v=.5519;function r(t){t?Math.round:function(t){return t}}function A(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function o(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=i<0?-1:1}function l(t,e){this.type=t,this.direction=e<0?-1:1}function p(t,e,s,i){this.type=t,this.currentLoop=s,this.totalLoops=e,this.direction=i<0?-1:1}function m(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function u(t,e){this.type=t,this.target=e}function g(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function y(t){this.type="configError",this.nativeError=t}r(!1);var t,P=(t=0,function(){return"__lottie_element_"+(t+=1)});function b(t,e,s){var i,a,r,n,h,o,l,p;switch(o=s*(1-e),l=s*(1-(h=6*t-(n=Math.floor(6*t)))*e),p=s*(1-(1-h)*e),n%6){case 0:i=s,a=p,r=o;break;case 1:i=l,a=s,r=o;break;case 2:i=o,a=s,r=p;break;case 3:i=o,a=l,r=s;break;case 4:i=p,a=o,r=s;break;case 5:i=s,a=o,r=l}return[i,a,r]}function C(t,e,s){var i,a=Math.max(t,e,s),r=Math.min(t,e,s),n=a-r,h=0===a?0:n/a,o=a/255;switch(a){case r:i=0;break;case t:i=e-s+n*(e<s?6:0),i/=6*n;break;case e:i=s-t+2*n,i/=6*n;break;case s:i=t-e+4*n,i/=6*n}return[i,h,o]}function lt(t,e){var s=C(255*t[0],255*t[1],255*t[2]);return s[1]+=e,1<s[1]?s[1]=1:s[1]<=0&&(s[1]=0),b(s[0],s[1],s[2])}function pt(t,e){var s=C(255*t[0],255*t[1],255*t[2]);return s[2]+=e,1<s[2]?s[2]=1:s[2]<0&&(s[2]=0),b(s[0],s[1],s[2])}function ft(t,e){var s=C(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,1<s[0]?s[0]-=1:s[0]<0&&(s[0]+=1),b(s[0],s[1],s[2])}!function(){var t,e,s=[];for(t=0;t<256;t+=1)e=t.toString(16),s[t]=1===e.length?"0"+e:e}();function D(){}D.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;i<s;i+=1)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;s<i;)this._cbs[t][s]===e&&(this._cbs[t].splice(s,1),s-=1,i-=1),s+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var j=function(){function s(t,e){var s,i=0,a=[];switch(t){case"int16":case"uint8c":s=1;break;default:s=1.1}for(i=0;i<e;i+=1)a.push(s);return a}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):s(t,e)}:s}();function S(t){return Array.apply(null,{length:t})}function E(t){return document.createElementNS(e,t)}function T(t){return document.createElement(t)}function M(){}M.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var F,I=(F={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return F[t]||""}),L=function(){var a=Math.cos,r=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function s(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=a(t),s=r(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var s=a(e),i=r(e);return this._t(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(s,-i,0,0,i,s,0,0,0,0,1,0,0,0,0,1)}function m(t,e,s){return s||0===s||(s=1),1===t&&1===e&&1===s?this:this._t(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1)}function d(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=a,this.props[5]=r,this.props[6]=n,this.props[7]=h,this.props[8]=o,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=d,this.props[14]=c,this.props[15]=u,this}function c(t,e,s){return s=s||0,0!==t||0!==e||0!==s?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1):this}function u(t,e,s,i,a,r,n,h,o,l,p,f,m,d,c,u){var g=this.props;if(1===t&&0===e&&0===s&&0===i&&0===a&&1===r&&0===n&&0===h&&0===o&&0===l&&1===p&&0===f)return g[12]=g[12]*t+g[15]*m,g[13]=g[13]*r+g[15]*d,g[14]=g[14]*p+g[15]*c,g[15]*=u,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],_=g[3],k=g[4],x=g[5],w=g[6],A=g[7],P=g[8],C=g[9],D=g[10],S=g[11],E=g[12],T=g[13],M=g[14],F=g[15];return g[0]=y*t+v*a+b*o+_*m,g[1]=y*e+v*r+b*l+_*d,g[2]=y*s+v*n+b*p+_*c,g[3]=y*i+v*h+b*f+_*u,g[4]=k*t+x*a+w*o+A*m,g[5]=k*e+x*r+w*l+A*d,g[6]=k*s+x*n+w*p+A*c,g[7]=k*i+x*h+w*f+A*u,g[8]=P*t+C*a+D*o+S*m,g[9]=P*e+C*r+D*l+S*d,g[10]=P*s+C*n+D*p+S*c,g[11]=P*i+C*h+D*f+S*u,g[12]=E*t+T*a+M*o+F*m,g[13]=E*e+T*r+M*l+F*d,g[14]=E*s+T*n+M*p+F*c,g[15]=E*i+T*h+M*f+F*u,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function _(t,e,s){return{x:t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}}function k(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function x(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function w(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function A(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,s=-this.props[1]/t,i=-this.props[4]/t,a=this.props[0]/t,r=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,h=new L;return h.props[0]=e,h.props[1]=s,h.props[4]=i,h.props[5]=a,h.props[12]=r,h.props[13]=n,h}function P(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function C(t){var e,s=t.length,i=[];for(e=0;e<s;e+=1)i[e]=P(t[e]);return i}function D(t,e,s){var i=j("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=s[0],i[5]=s[1];else{var a=this.props[0],r=this.props[1],n=this.props[4],h=this.props[5],o=this.props[12],l=this.props[13];i[0]=t[0]*a+t[1]*n+o,i[1]=t[0]*r+t[1]*h+l,i[2]=e[0]*a+e[1]*n+o,i[3]=e[0]*r+e[1]*h+l,i[4]=s[0]*a+s[1]*n+o,i[5]=s[0]*r+s[1]*h+l}return i}function S(t,e,s){return this.isIdentity()?[t,e,s]:[t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]]}function E(t,e){if(this.isIdentity())return t+","+e;var s=this.props;return Math.round(100*(t*s[0]+e*s[4]+s[12]))/100+","+Math.round(100*(t*s[1]+e*s[5]+s[13]))/100}function T(){for(var t=0,e=this.props,s="matrix3d(";t<16;)s+=i(1e4*e[t])/1e4,s+=15===t?")":",",t+=1;return s}function M(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function F(){var t=this.props;return"matrix("+M(t[0])+","+M(t[1])+","+M(t[4])+","+M(t[5])+","+M(t[12])+","+M(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=s,this.rotateY=h,this.rotateZ=o,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=d,this.translate=c,this.transform=u,this.applyToPoint=_,this.applyToX=k,this.applyToY=x,this.applyToZ=w,this.applyToPointArray=S,this.applyToTriplePoints=D,this.applyToPointStringified=E,this.toCSS=T,this.to2dCSS=F,this.clone=v,this.cloneFromProps=b,this.equals=y,this.inversePoints=C,this.inversePoint=P,this.getInverseMatrix=A,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=j("float32",16),this.reset()}}();!function(h,o){var l,p=this,f=256,m=6,d="random",c=o.pow(f,m),u=o.pow(2,52),g=2*u,y=f-1;function v(t){var e,s=t.length,n=this,i=0,a=n.i=n.j=0,r=n.S=[];for(s||(t=[s++]);i<f;)r[i]=i++;for(i=0;i<f;i++)r[i]=r[a=y&a+t[i%s]+(e=r[i])],r[a]=e;n.g=function(t){for(var e,s=0,i=n.i,a=n.j,r=n.S;t--;)e=r[i=y&i+1],s=s*f+r[y&(r[i]=r[a=y&a+e])+(r[a]=e)];return n.i=i,n.j=a,s}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function _(t,e){for(var s,i=t+"",a=0;a<i.length;)e[y&a]=y&(s^=19*e[y&a])+i.charCodeAt(a++);return k(e)}function k(t){return String.fromCharCode.apply(0,t)}o["seed"+d]=function(t,e,s){var i=[],a=_(function t(e,s){var i,a=[],r=typeof e;if(s&&"object"==r)for(i in e)try{a.push(t(e[i],s-1))}catch(t){}return a.length?a:"string"==r?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,k(h)]:null===t?function(){try{if(l)return k(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),k(t)}catch(t){var e=p.navigator,s=e&&e.plugins;return[+new Date,p,s,p.screen,k(h)]}}():t,3),i),r=new v(i),n=function(){for(var t=r.g(m),e=c,s=0;t<u;)t=(t+s)*f,e*=f,s=r.g(1);for(;g<=t;)t/=2,e/=2,s>>>=1;return(t+s)/e};return n.int32=function(){return 0|r.g(4)},n.quick=function(){return r.g(4)/4294967296},n.double=n,_(k(r.S),h),(e.pass||s||function(t,e,s,i){return i&&(i.S&&b(i,r),t.state=function(){return b(r,{})}),s?(o[d]=t,e):t})(n,a,"global"in e?e.global:this==o,e.state)},_(o.random(),h)}([],a);var W=function(){var t={getBezierEasing:function(t,e,s,i,a){var r=a||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");if(h[r])return h[r];var n=new o([t,e,s,i]);return h[r]=n}},h={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function a(t,e){return 3*e-6*t}function r(t){return 3*t}function f(t,e,s){return((i(e,s)*t+a(e,s))*t+r(e))*t}function m(t,e,s){return 3*i(e,s)*t*t+2*a(e,s)*t+r(e)}function o(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return o.prototype={get:function(t){var e=this._p[0],s=this._p[1],i=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===s&&i===a?t:0===t?0:1===t?1:f(this._getTForX(t),s,a)},_precompute:function(){var t=this._p[0],e=this._p[1],s=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&s===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;s<l;++s)this._mSampleValues[s]=f(s*p,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,a=0,r=1,n=l-1;r!==n&&i[r]<=t;++r)a+=p;var h=a+(t-i[--r])/(i[r+1]-i[r])*p,o=m(h,e,s);return.001<=o?function(t,e,s,i){for(var a=0;a<4;++a){var r=m(e,s,i);if(0===r)return e;e-=(f(e,s,i)-t)/r}return e}(t,h,e,s):0===o?h:function(t,e,s,i,a){for(var r,n,h=0;0<(r=f(n=e+(s-e)/2,i,a)-t)?s=n:e=n,1e-7<Math.abs(r)&&++h<10;);return n}(t,a,a+p,e,s)}},t}();function B(t,e){var s,i,a=t.length;for(s=0;s<a;s+=1)for(var r in i=t[s].prototype)Object.prototype.hasOwnProperty.call(i,r)&&(e.prototype[r]=i[r])}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),s=Math.max(0,16-(e-a)),i=setTimeout(function(){t(e+s)},s);return a=e+s,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var mt=function(){var E=Math;function g(t,e,s,i,a,r){var n=t*i+e*a+s*r-a*i-r*t-s*e;return-.001<n&&n<.001}var p=function(t,e,s,i){var a,r,n,h,o,l,p=w,f=0,m=[],d=[],c=Mt.newElement();for(n=s.length,a=0;a<p;a+=1){for(o=a/(p-1),r=l=0;r<n;r+=1)h=_(1-o,3)*t[r]+3*_(1-o,2)*o*s[r]+3*(1-o)*_(o,2)*i[r]+_(o,3)*e[r],m[r]=h,null!==d[r]&&(l+=_(m[r]-d[r],2)),d[r]=m[r];l&&(f+=l=k(l)),c.percents[a]=o,c.lengths[a]=f}return c.addedLength=f,c};function y(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,s,i){var a=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+s[0]+"_"+s[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!b[a]){var r,n,h,o,l,p,f,m=w,d=0,c=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&g(t[0],t[1],e[0],e[1],t[0]+s[0],t[1]+s[1])&&g(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var u=new y(m);for(h=s.length,r=0;r<m;r+=1){for(f=S(h),l=r/(m-1),n=p=0;n<h;n+=1)o=_(1-l,3)*t[n]+3*_(1-l,2)*l*(t[n]+s[n])+3*(1-l)*_(l,2)*(e[n]+i[n])+_(l,3)*e[n],f[n]=o,null!==c&&(p+=_(f[n]-c[n],2));d+=p=k(p),u.points[r]=new v(p,f),c=f}u.segmentLength=d,b[a]=u}return b[a]});function T(t,e){var s=e.percents,i=e.lengths,a=s.length,r=f((a-1)*t),n=t*e.addedLength,h=0;if(r===a-1||0===r||n===i[r])return s[r];for(var o=i[r]>n?-1:1,l=!0;l;)if(i[r]<=n&&i[r+1]>n?(h=(n-i[r])/(i[r+1]-i[r]),l=!1):r+=o,r<0||a-1<=r){if(r===a-1)return s[r];l=!1}return s[r]+(s[r+1]-s[r])*h}var M=j("float32",8);return{getSegmentsLength:function(t){var e,s=Tt.newElement(),i=t.c,a=t.v,r=t.o,n=t.i,h=t._length,o=s.lengths,l=0;for(e=0;e<h-1;e+=1)o[e]=p(a[e],a[e+1],r[e],n[e+1]),l+=o[e].addedLength;return i&&h&&(o[e]=p(a[e],a[0],r[e],n[0]),l+=o[e].addedLength),s.totalLength=l,s},getNewSegment:function(t,e,s,i,a,r,n){a<0?a=0:1<a&&(a=1);var h,o=T(a,n),l=T(r=1<r?1:r,n),p=t.length,f=1-o,m=1-l,d=f*f*f,c=o*f*f*3,u=o*o*f*3,g=o*o*o,y=f*f*m,v=o*f*m+f*o*m+f*f*l,b=o*o*m+f*o*l+o*f*l,_=o*o*l,k=f*m*m,x=o*m*m+f*l*m+f*m*l,w=o*l*m+f*l*l+o*m*l,A=o*l*l,P=m*m*m,C=l*m*m+m*l*m+m*m*l,D=l*l*m+m*l*l+l*m*l,S=l*l*l;for(h=0;h<p;h+=1)M[4*h]=E.round(1e3*(d*t[h]+c*s[h]+u*i[h]+g*e[h]))/1e3,M[4*h+1]=E.round(1e3*(y*t[h]+v*s[h]+b*i[h]+_*e[h]))/1e3,M[4*h+2]=E.round(1e3*(k*t[h]+x*s[h]+w*i[h]+A*e[h]))/1e3,M[4*h+3]=E.round(1e3*(P*t[h]+C*s[h]+D*i[h]+S*e[h]))/1e3;return M},getPointInSegment:function(t,e,s,i,a,r){var n=T(a,r),h=1-n;return[E.round(1e3*(h*h*h*t[0]+(n*h*h+h*n*h+h*h*n)*s[0]+(n*n*h+h*n*n+n*h*n)*i[0]+n*n*n*e[0]))/1e3,E.round(1e3*(h*h*h*t[1]+(n*h*h+h*n*h+h*h*n)*s[1]+(n*n*h+h*n*n+n*h*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:g,pointOnLine3D:function(t,e,s,i,a,r,n,h,o){if(0===s&&0===r&&0===o)return g(t,e,i,a,n,h);var l,p=E.sqrt(E.pow(i-t,2)+E.pow(a-e,2)+E.pow(r-s,2)),f=E.sqrt(E.pow(n-t,2)+E.pow(h-e,2)+E.pow(o-s,2)),m=E.sqrt(E.pow(n-i,2)+E.pow(h-a,2)+E.pow(o-r,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}();var z=function(){function m(t,e,s){var i,a,r,n,h,o,l,p=t.length;for(a=0;a<p;a+=1)if("ks"in(i=t[a])&&!i.completed){if(i.completed=!0,i.tt&&(t[a-1].td=i.tt),i.hasMask){var f=i.masksProperties;for(n=f.length,r=0;r<n;r+=1)if(f[r].pt.k.i)u(f[r].pt.k);else for(o=f[r].pt.k.length,h=0;h<o;h+=1)f[r].pt.k[h].s&&u(f[r].pt.k[h].s[0]),f[r].pt.k[h].e&&u(f[r].pt.k[h].e[0])}0===i.ty?(i.layers=d(i.refId,e),m(i.layers,e,s)):4===i.ty?c(i.shapes):5===i.ty&&(0!==(l=i).t.a.length||"m"in l.t.p||(l.singleShape=!0))}}function d(t,e){for(var s=0,i=e.length;s<i;){if(e[s].id===t)return e[s].layers.__used?JSON.parse(JSON.stringify(e[s].layers)):(e[s].layers.__used=!0,e[s].layers);s+=1}return null}function c(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)u(t[e].ks.k);else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&u(t[e].ks.k[s].s[0]),t[e].ks.k[s].e&&u(t[e].ks.k[s].e[0]);else"gr"===t[e].ty&&c(t[e].it)}function u(t){var e,s=t.i.length;for(e=0;e<s;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function h(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]||!(s[0]>t[0])&&(t[1]>s[1]||!(s[1]>t[1])&&(t[2]>s[2]||!(s[2]>t[2])&&null))}var o,s=function(){var i=[4,4,14];function a(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)5===t[e].ty&&(s=t[e],i=s.t.d,s.t.d={k:[{s:i,t:0}]})}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),i=(o=[4,7,99],function(t){if(t.chars&&!h(o,t.v)){var e,s,i,a,r,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(r=t.chars[e].data.shapes[0].it).length,s=0;s<i;s+=1)(a=r[s].ks.k).__converted||(u(r[s].ks.k),a.__converted=!0)}}),a=function(){var i=[4,1,9];function r(t){var e,s,i,a=t.length;for(e=0;e<a;e+=1)if("gr"===t[e].ty)r(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,s=0;s<i;s+=1)t[e].c.k[s].s&&(t[e].c.k[s].s[0]/=255,t[e].c.k[s].s[1]/=255,t[e].c.k[s].s[2]/=255,t[e].c.k[s].s[3]/=255),t[e].c.k[s].e&&(t[e].c.k[s].e[0]/=255,t[e].c.k[s].e[1]/=255,t[e].c.k[s].e[2]/=255,t[e].c.k[s].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function a(t){var e,s=t.length;for(e=0;e<s;e+=1)4===t[e].ty&&r(t[e].shapes)}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}(),r=function(){var i=[4,4,18];function l(t){var e,s,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,s=0;s<i;s+=1)t[e].ks.k[s].s&&(t[e].ks.k[s].s[0].c=t[e].closed),t[e].ks.k[s].e&&(t[e].ks.k[s].e[0].c=t[e].closed);else"gr"===t[e].ty&&l(t[e].it)}function a(t){var e,s,i,a,r,n,h=t.length;for(s=0;s<h;s+=1){if((e=t[s]).hasMask){var o=e.masksProperties;for(a=o.length,i=0;i<a;i+=1)if(o[i].pt.k.i)o[i].pt.k.c=o[i].cl;else for(n=o[i].pt.k.length,r=0;r<n;r+=1)o[i].pt.k[r].s&&(o[i].pt.k[r].s[0].c=o[i].cl),o[i].pt.k[r].e&&(o[i].pt.k[r].e[0].c=o[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(h(i,t.v)&&(a(t.layers),t.assets)){var e,s=t.assets.length;for(e=0;e<s;e+=1)t.assets[e].layers&&a(t.assets[e].layers)}}}();var t={completeData:function(t,e){t.__complete||(a(t),s(t),i(t),r(t),m(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=a,t.checkChars=i,t.checkShapes=r,t.completeLayers=m,t}();function O(t){for(var e=t.fStyle?t.fStyle.split(" "):[],s="normal",i="normal",a=e.length,r=0;r<a;r+=1)switch(e[r].toLowerCase()){case"italic":i="italic";break;case"bold":s="700";break;case"black":s="900";break;case"medium":s="500";break;case"regular":case"normal":s="400";break;case"light":case"thin":s="200"}return{style:i,weight:t.fWeight||s}}var V=function(){var r={w:0,size:0,shapes:[]},t=[];function m(t,e){var s=T("span");s.style.fontFamily=e;var i=T("span");i.innerText="giItT1WQy@!-/#",s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",s.style.fontSize="300px",s.style.fontVariant="normal",s.style.fontStyle="normal",s.style.fontWeight="normal",s.style.letterSpacing="0",s.appendChild(i),document.body.appendChild(s);var a=i.offsetWidth;return i.style.fontFamily=function(t){var e,s=t.split(","),i=s.length,a=[];for(e=0;e<i;e+=1)"sans-serif"!==s[e]&&"monospace"!==s[e]&&a.push(s[e]);return a.join(",")}(t)+", "+e,{node:i,w:a,parent:s}}function d(t,e){var s=E("text");s.style.fontSize="100px";var i=O(e);return s.setAttribute("font-family",e.fFamily),s.setAttribute("font-style",i.style),s.setAttribute("font-weight",i.weight),s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.setAttribute("class",e.fClass)):s.style.fontFamily=e.fFamily,t.appendChild(s),T("canvas").getContext("2d").font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,s}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var s,i,a=t.length,r=this.chars.length;for(e=0;e<a;e+=1){for(s=0,i=!1;s<r;)this.chars[s].style===t[e].style&&this.chars[s].fFamily===t[e].fFamily&&this.chars[s].ch===t[e].ch&&(i=!0),s+=1;i||(this.chars.push(t[e]),r+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var s,i=t.list,a=i.length,r=a;for(s=0;s<a;s+=1){var n,h,o=!0;if(i[s].loaded=!1,i[s].monoCase=m(i[s].fFamily,"monospace"),i[s].sansCase=m(i[s].fFamily,"sans-serif"),i[s].fPath){if("p"===i[s].fOrigin||3===i[s].origin){if(0<(n=document.querySelectorAll('style[f-forigin="p"][f-family="'+i[s].fFamily+'"], style[f-origin="3"][f-family="'+i[s].fFamily+'"]')).length&&(o=!1),o){var l=T("style");l.setAttribute("f-forigin",i[s].fOrigin),l.setAttribute("f-origin",i[s].origin),l.setAttribute("f-family",i[s].fFamily),l.type="text/css",l.innerText="@font-face {font-family: "+i[s].fFamily+"; font-style: normal; src: url('"+i[s].fPath+"');}",e.appendChild(l)}}else if("g"===i[s].fOrigin||1===i[s].origin){for(n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),h=0;h<n.length;h+=1)-1!==n[h].href.indexOf(i[s].fPath)&&(o=!1);if(o){var p=T("link");p.setAttribute("f-forigin",i[s].fOrigin),p.setAttribute("f-origin",i[s].origin),p.type="text/css",p.rel="stylesheet",p.href=i[s].fPath,document.body.appendChild(p)}}else if("t"===i[s].fOrigin||2===i[s].origin){for(n=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),h=0;h<n.length;h+=1)i[s].fPath===n[h].src&&(o=!1);if(o){var f=T("link");f.setAttribute("f-forigin",i[s].fOrigin),f.setAttribute("f-origin",i[s].origin),f.setAttribute("rel","stylesheet"),f.setAttribute("href",i[s].fPath),e.appendChild(f)}}}else i[s].loaded=!0,r-=1;i[s].helper=d(e,i[s]),i[s].cache={},this.fonts.push(i[s])}0===r?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,s){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,s)),r},getFontByName:function(t){for(var e=0,s=this.fonts.length;e<s;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,s){var i=this.getFontByName(e),a=t.charCodeAt(0);if(!i.cache[a+1]){var r=i.helper;if(" "===t){r.textContent="|"+t+"|";var n=r.getComputedTextLength();r.textContent="||";var h=r.getComputedTextLength();i.cache[a+1]=(n-h)/100}else r.textContent=t,i.cache[a+1]=r.getComputedTextLength()/100}return i.cache[a+1]*s},checkLoadedFonts:function(){var t,e,s,i=this.fonts.length,a=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?a-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,s=this.fonts[t].monoCase.w,e.offsetWidth!==s?(a-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,s=this.fonts[t].sansCase.w,e.offsetWidth!==s&&(a-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==a&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),R=function(){var f=s,a=Math.abs;function m(t,e){var s,i=this.offsetTime;"multidimensional"===this.propType&&(s=j("float32",this.pv.length));for(var a,r,n,h,o,l,p,f,m=e.lastIndex,d=m,c=this.keyframes.length-1,u=!0;u;){if(a=this.keyframes[d],r=this.keyframes[d+1],d===c-1&&t>=r.t-i){a.h&&(a=r),m=0;break}if(r.t-i>t){m=d;break}d<c-1?d+=1:(m=0,u=!1)}var g,y,v,b,_,k,x,w,A,P,C=r.t-i,D=a.t-i;if(a.to){a.bezierData||(a.bezierData=mt.buildBezierData(a.s,r.s||a.e,a.to,a.ti));var S=a.bezierData;if(C<=t||t<D){var E=C<=t?S.points.length-1:0;for(h=S.points[E].point.length,n=0;n<h;n+=1)s[n]=S.points[E].point[n]}else{a.__fnct?f=a.__fnct:(f=W.getBezierEasing(a.o.x,a.o.y,a.i.x,a.i.y,a.n).get,a.__fnct=f),o=f((t-D)/(C-D));var T,M=S.segmentLength*o,F=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===d?e._lastPoint:0,u=!0,l=S.points.length;u;){if(F+=S.points[p].partialLength,0===M||0===o||p===S.points.length-1){for(h=S.points[p].point.length,n=0;n<h;n+=1)s[n]=S.points[p].point[n];break}if(F<=M&&M<F+S.points[p+1].partialLength){for(T=(M-F)/S.points[p+1].partialLength,h=S.points[p].point.length,n=0;n<h;n+=1)s[n]=S.points[p].point[n]+(S.points[p+1].point[n]-S.points[p].point[n])*T;break}p<l-1?p+=1:u=!1}e._lastPoint=p,e._lastAddedLength=F-S.points[p].partialLength,e._lastKeyframeIndex=d}}else{var I,L,B,z,V;if(c=a.s.length,g=r.s||a.e,this.sh&&1!==a.h)if(C<=t)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=D)s[0]=a.s[0],s[1]=a.s[1],s[2]=a.s[2];else{var R=O(a.s),N=O(g);y=s,v=function(t,e,s){var i,a,r,n,h,o=[],l=t[0],p=t[1],f=t[2],m=t[3],d=e[0],c=e[1],u=e[2],g=e[3];(a=l*d+p*c+f*u+m*g)<0&&(a=-a,d=-d,c=-c,u=-u,g=-g);h=1e-6<1-a?(i=Math.acos(a),r=Math.sin(i),n=Math.sin((1-s)*i)/r,Math.sin(s*i)/r):(n=1-s,s);return o[0]=n*l+h*d,o[1]=n*p+h*c,o[2]=n*f+h*u,o[3]=n*m+h*g,o}(R,N,(t-D)/(C-D)),b=v[0],_=v[1],k=v[2],x=v[3],w=Math.atan2(2*_*x-2*b*k,1-2*_*_-2*k*k),A=Math.asin(2*b*_+2*k*x),P=Math.atan2(2*b*x-2*_*k,1-2*b*b-2*k*k),y[0]=w/q,y[1]=A/q,y[2]=P/q}else for(d=0;d<c;d+=1)1!==a.h&&(o=C<=t?1:t<D?0:(a.o.x.constructor===Array?(a.__fnct||(a.__fnct=[]),a.__fnct[d]?f=a.__fnct[d]:(I=void 0===a.o.x[d]?a.o.x[0]:a.o.x[d],L=void 0===a.o.y[d]?a.o.y[0]:a.o.y[d],B=void 0===a.i.x[d]?a.i.x[0]:a.i.x[d],z=void 0===a.i.y[d]?a.i.y[0]:a.i.y[d],f=W.getBezierEasing(I,L,B,z).get,a.__fnct[d]=f)):a.__fnct?f=a.__fnct:(I=a.o.x,L=a.o.y,B=a.i.x,z=a.i.y,f=W.getBezierEasing(I,L,B,z).get,a.__fnct=f),f((t-D)/(C-D)))),g=r.s||a.e,V=1===a.h?a.s[d]:a.s[d]+(g[d]-a.s[d])*o,"multidimensional"===this.propType?s[d]=V:s=V}return e.lastIndex=m,s}function O(t){var e=t[0]*q,s=t[1]*q,i=t[2]*q,a=Math.cos(e/2),r=Math.cos(s/2),n=Math.cos(i/2),h=Math.sin(e/2),o=Math.sin(s/2),l=Math.sin(i/2);return[h*o*n+a*r*l,h*r*n+a*o*l,a*o*n-h*r*l,a*r*n-h*o*l]}function d(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=s&&s<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function c(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<a(this.v-e)&&(this.v=e,this._mdf=!0);else for(var s=0,i=this.v.length;s<i;)e=t[s]*this.mult,1e-5<a(this.v[s]-e)&&(this.v[s]=e,this._mdf=!0),s+=1}function u(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,s=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)s=this.effectsSequence[t](s);this.setVValue(s),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function g(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,s,i){this.propType="unidimensional",this.mult=s||1,this.data=e,this.v=s?e.k*s:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.addEffect=g}function h(t,e,s,i){var a;this.propType="multidimensional",this.mult=s||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var r=e.k.length;for(this.v=j("float32",r),this.pv=j("float32",r),this.vel=j("float32",r),a=0;a<r;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=u,this.setVValue=c,this.addEffect=g}function o(t,e,s,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.effectsSequence=[d.bind(this)],this.addEffect=g}function l(t,e,s,i){var a;this.propType="multidimensional";var r,n,h,o,l=e.k.length;for(a=0;a<l-1;a+=1)e.k[a].to&&e.k[a].s&&e.k[a+1]&&e.k[a+1].s&&(r=e.k[a].s,n=e.k[a+1].s,h=e.k[a].to,o=e.k[a].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+h[0],r[1]+h[1])&&mt.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+o[0],n[1]+o[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+h[0],r[1]+h[1],r[2]+h[2])&&mt.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+o[0],n[1]+o[1],n[2]+o[2]))&&(e.k[a].to=null,e.k[a].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===h[0]&&0===h[1]&&0===o[0]&&0===o[1]&&(2===r.length||r[2]===n[2]&&0===h[2]&&0===o[2])&&(e.k[a].to=null,e.k[a].ti=null));this.effectsSequence=[d.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=s||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=u,this.setVValue=c,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=j("float32",p),this.pv=j("float32",p),a=0;a<p;a+=1)this.v[a]=f,this.pv[a]=f;this._caching={lastFrame:f,lastIndex:0,value:j("float32",p)},this.addEffect=g}return{getProp:function(t,e,s,i,a){var r;if(e.k.length)if("number"==typeof e.k[0])r=new h(t,e,i,a);else switch(s){case 0:r=new o(t,e,i,a);break;case 1:r=new l(t,e,i,a)}else r=new n(t,e,i,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}}}(),N=function(){var n=[0,0];function i(t,e,s){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new L,this.pre=new L,this.appliedTransformations=0,this.initDynamicPropertyContainer(s||t),e.p&&e.p.s?(this.px=R.getProp(t,e.p.x,0,0,this),this.py=R.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=R.getProp(t,e.p.z,0,0,this))):this.p=R.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=R.getProp(t,e.rx,0,q,this),this.ry=R.getProp(t,e.ry,0,q,this),this.rz=R.getProp(t,e.rz,0,q,this),e.or.k[0].ti){var i,a=e.or.k.length;for(i=0;i<a;i+=1)e.or.k[i].to=null,e.or.k[i].ti=null}this.or=R.getProp(t,e.or,1,q,this),this.or.sh=!0}else this.r=R.getProp(t,e.r||{k:0},0,q,this);e.sk&&(this.sk=R.getProp(t,e.sk,0,q,this),this.sa=R.getProp(t,e.sa,0,q,this)),this.a=R.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=R.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=R.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var e;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var s,i;if(e=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(s=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(s=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){s=[],i=[];var a=this.px,r=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(s[0]=a.getValueAtTime((a.keyframes[0].t+.01)/e,0),s[1]=r.getValueAtTime((r.keyframes[0].t+.01)/e,0),i[0]=a.getValueAtTime(a.keyframes[0].t/e,0),i[1]=r.getValueAtTime(r.keyframes[0].t/e,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(s[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/e,0),s[1]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/e,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/e,0),i[1]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/e,0)):(s=[a.pv,r.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/e,a.offsetTime),i[1]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/e,r.offsetTime))}else s=i=n;this.v.rotate(-Math.atan2(s[1]-i[1],s[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},B([M],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=M.prototype.addDynamicProperty,{getTransformProperty:function(t,e,s){return new i(t,e,s)}}}();function X(){this.c=!1,this._length=0,this._maxLength=8,this.v=S(this._maxLength),this.o=S(this._maxLength),this.i=S(this._maxLength)}X.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var s=0;s<e;)this.v[s]=Dt.newElement(),this.o[s]=Dt.newElement(),this.i[s]=Dt.newElement(),s+=1},X.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},X.prototype.doubleArrayLength=function(){this.v=this.v.concat(S(this._maxLength)),this.i=this.i.concat(S(this._maxLength)),this.o=this.o.concat(S(this._maxLength)),this._maxLength*=2},X.prototype.setXYAt=function(t,e,s,i,a){var r;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),s){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o;break;default:r=[]}(!r[i]||r[i]&&!a)&&(r[i]=Dt.newElement()),r[i][0]=t,r[i][1]=e},X.prototype.setTripleAt=function(t,e,s,i,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(s,i,"o",n,h),this.setXYAt(a,r,"i",n,h)},X.prototype.reverse=function(){var t=new X;t.setPathData(this.c,this._length);var e=this.v,s=this.o,i=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],s[0][0],s[0][1],0,!1),a=1);var r,n=this._length-1,h=this._length;for(r=a;r<h;r+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],s[n][0],s[n][1],r,!1),n-=1;return t};var Y,H,G=function(){var a=-999999;function t(t,e,s){var i,a,r,n,h,o,l,p,f,m=s.lastIndex,d=this.keyframes;if(t<d[0].t-this.offsetTime)i=d[0].s[0],r=!0,m=0;else if(t>=d[d.length-1].t-this.offsetTime)i=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var c,u,g=m,y=d.length-1,v=!0;v&&(c=d[g],!((u=d[g+1]).t-this.offsetTime>t));)g<y-1?g+=1:v=!1;if(m=g,!(r=1===c.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<c.t-this.offsetTime)p=0;else{var b;c.__fnct?b=c.__fnct:(b=W.getBezierEasing(c.o.x,c.o.y,c.i.x,c.i.y).get,c.__fnct=b),p=b((t-(c.t-this.offsetTime))/(u.t-this.offsetTime-(c.t-this.offsetTime)))}a=u.s?u.s[0]:c.e[0]}i=c.s[0]}for(o=e._length,l=i.i[0].length,s.lastIndex=m,n=0;n<o;n+=1)for(h=0;h<l;h+=1)f=r?i.i[n][h]:i.i[n][h]+(a.i[n][h]-i.i[n][h])*p,e.i[n][h]=f,f=r?i.o[n][h]:i.o[n][h]+(a.o[n][h]-i.o[n][h])*p,e.o[n][h]=f,f=r?i.v[n][h]:i.v[n][h]+(a.v[n][h]-i.v[n][h])*p,e.v[n][h]=f}function r(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var s,i=t._length;for(s=0;s<i;s+=1)if(t.v[s][0]!==e.v[s][0]||t.v[s][1]!==e.v[s][1]||t.o[s][0]!==e.o[s][0]||t.o[s][1]!==e.o[s][1]||t.i[s][0]!==e.i[s][0]||t.i[s][1]!==e.i[s][1])return!1;return!0})(this.v,t)||(this.v=St.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var s=this.effectsSequence.length;for(e=0;e<s;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,s){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===s?e.pt.k:e.ks.k;this.v=St.clone(i),this.pv=St.clone(this.v),this.localShapeCollection=Et.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=r,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function h(t,e,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.v=St.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=St.clone(this.v),this.localShapeCollection=Et.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=a,this.reset=r,this._caching={lastFrame:a,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==a&&(i<e&&t<e||s<i&&s<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=s,n.prototype.setVValue=e,n.prototype.addEffect=i,h.prototype.getValue=s,h.prototype.interpolateShape=t,h.prototype.setVValue=e,h.prototype.addEffect=i;var o=function(){var n=v;function t(t,e){this.v=St.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=Et.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=R.getProp(t,e.p,1,0,this),this.s=R.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=3!==this.d,r=this.v;r.v[0][0]=t,r.v[0][1]=e-i,r.v[1][0]=a?t+s:t-s,r.v[1][1]=e,r.v[2][0]=t,r.v[2][1]=e+i,r.v[3][0]=a?t-s:t+s,r.v[3][1]=e,r.i[0][0]=a?t-s*n:t+s*n,r.i[0][1]=e-i,r.i[1][0]=a?t+s:t-s,r.i[1][1]=e-i*n,r.i[2][0]=a?t+s*n:t-s*n,r.i[2][1]=e+i,r.i[3][0]=a?t-s:t+s,r.i[3][1]=e+i*n,r.o[0][0]=a?t+s*n:t-s*n,r.o[0][1]=e-i,r.o[1][0]=a?t+s:t-s,r.o[1][1]=e+i*n,r.o[2][0]=a?t-s*n:t+s*n,r.o[2][1]=e+i,r.o[3][0]=a?t-s:t+s,r.o[3][1]=e-i*n}},B([M],t),t}(),l=function(){function t(t,e){this.v=St.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=R.getProp(t,e.ir,0,0,this),this.is=R.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=R.getProp(t,e.pt,0,0,this),this.p=R.getProp(t,e.p,1,0,this),this.r=R.getProp(t,e.r,0,q,this),this.or=R.getProp(t,e.or,0,0,this),this.os=R.getProp(t,e.os,0,.01,this),this.localShapeCollection=Et.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:r,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,s,i,a=2*Math.floor(this.pt.v),r=2*Math.PI/a,n=!0,h=this.or.v,o=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*h/(2*a),m=2*Math.PI*o/(2*a),d=-Math.PI/2;d+=this.r.v;var c=3===this.data.d?-1:1;for(t=this.v._length=0;t<a;t+=1){s=n?l:p,i=n?f:m;var u=(e=n?h:o)*Math.cos(d),g=e*Math.sin(d),y=0===u&&0===g?0:g/Math.sqrt(u*u+g*g),v=0===u&&0===g?0:-u/Math.sqrt(u*u+g*g);u+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(u,g,u-y*i*s*c,g-v*i*s*c,u+y*i*s*c,g+v*i*s*c,t,!0),n=!n,d+=r*c}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),s=2*Math.PI/e,i=this.or.v,a=this.os.v,r=2*Math.PI*i/(4*e),n=.5*-Math.PI,h=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var o=i*Math.cos(n),l=i*Math.sin(n),p=0===o&&0===l?0:l/Math.sqrt(o*o+l*l),f=0===o&&0===l?0:-o/Math.sqrt(o*o+l*l);o+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(o,l,o-p*r*a*h,l-f*r*a*h,o+p*r*a*h,l+f*r*a*h,t,!0),n+=s*h}this.paths.length=0,this.paths[0]=this.v}},B([M],t),t}(),p=function(){function t(t,e){this.v=St.newElement(),this.v.c=!0,this.localShapeCollection=Et.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=R.getProp(t,e.p,1,0,this),this.s=R.getProp(t,e.s,1,0,this),this.r=R.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,a=c(s,i,this.r.v),r=a*(1-v);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+a,t+s,e-i+r,0,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-r,t+s,e+i-a,1,!0),0!==a?(this.v.setTripleAt(t+s-a,e+i,t+s-a,e+i,t+s-r,e+i,2,!0),this.v.setTripleAt(t-s+a,e+i,t-s+r,e+i,t-s+a,e+i,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-a,t-s,e+i-r,4,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+r,t-s,e-i+a,5,!0),this.v.setTripleAt(t-s+a,e-i,t-s+a,e-i,t-s+r,e-i,6,!0),this.v.setTripleAt(t+s-a,e-i,t+s-r,e-i,t+s-a,e-i,7,!0)):(this.v.setTripleAt(t-s,e+i,t-s+r,e+i,t-s,e+i,2),this.v.setTripleAt(t-s,e-i,t-s,e-i+r,t-s,e-i,3))):(this.v.setTripleAt(t+s,e-i+a,t+s,e-i+r,t+s,e-i+a,0,!0),0!==a?(this.v.setTripleAt(t+s-a,e-i,t+s-a,e-i,t+s-r,e-i,1,!0),this.v.setTripleAt(t-s+a,e-i,t-s+r,e-i,t-s+a,e-i,2,!0),this.v.setTripleAt(t-s,e-i+a,t-s,e-i+a,t-s,e-i+r,3,!0),this.v.setTripleAt(t-s,e+i-a,t-s,e+i-r,t-s,e+i-a,4,!0),this.v.setTripleAt(t-s+a,e+i,t-s+a,e+i,t-s+r,e+i,5,!0),this.v.setTripleAt(t+s-a,e+i,t+s-r,e+i,t+s-a,e+i,6,!0),this.v.setTripleAt(t+s,e+i-a,t+s,e+i-a,t+s,e+i-r,7,!0)):(this.v.setTripleAt(t-s,e-i,t-s+r,e-i,t-s,e-i,1,!0),this.v.setTripleAt(t-s,e+i,t-s,e+i-r,t-s,e+i,2,!0),this.v.setTripleAt(t+s,e+i,t+s-r,e+i,t+s,e+i,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:r},B([M],t),t}();var f={getShapeProp:function(t,e,s){var i;return 3===s||4===s?i=(3===s?e.pt:e.ks).k.length?new h(t,e,s):new n(t,e,s):5===s?i=new p(t,e):6===s?i=new o(t,e):7===s&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return h}};return f}(),K=(H={},(Y={}).registerModifier=function(t,e){H[t]||(H[t]=e)},Y.getModifier=function(t,e,s){return new H[t](e,s)},Y);function U(){}function Z(){}function J(){}function Q(){}function $(){}function tt(){this._length=0,this._maxLength=4,this.shapes=S(this._maxLength)}function et(t,e,s,i){var a;this.elem=t,this.frameId=-1,this.dataProps=S(e.length),this.renderer=s,this.k=!1,this.dashStr="",this.dashArray=j("float32",e.length?e.length-1:0),this.dashoffset=j("float32",1),this.initDynamicPropertyContainer(i);var r,n=e.length||0;for(a=0;a<n;a+=1)r=R.getProp(t,e[a].v,0,0,this),this.k=r.k||this.k,this.dataProps[a]={n:e[a].n,p:r};this.k||this.getValue(!0),this._isAnimated=this.k}function st(t,e,s){this.data=e,this.c=j("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=j("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(s),this.prop=R.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}U.prototype.initModifierProperties=function(){},U.prototype.addShapeToModifier=function(){},U.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:Et.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},U.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=s,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},U.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},B([M],U),B([U],Z),Z.prototype.initModifierProperties=function(t,e){this.s=R.getProp(t,e.s,0,.01,this),this.e=R.getProp(t,e.e,0,.01,this),this.o=R.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},Z.prototype.addShapeToModifier=function(t){t.pathsData=[]},Z.prototype.calculateShapeEdges=function(t,e,s,i,a){var r=[];e<=1?r.push({s:t,e:e}):1<=t?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],l=r.length;for(n=0;n<l;n+=1){var p,f;if(!((h=r[n]).e*a<i||h.s*a>i+s))p=h.s*a<=i?0:(h.s*a-i)/s,f=h.e*a>=i+s?1:(h.e*a-i)/s,o.push([p,f])}return o.length||o.push([0,0]),o},Z.prototype.releasePathsData=function(t){var e,s=t.length;for(e=0;e<s;e+=1)Tt.release(t[e]);return t.length=0,t},Z.prototype.processShapes=function(t){var e,s,i,a;if(this._mdf||t){var r=this.o.v%360/360;if(r<0&&(r+=1),e=1<this.s.v?1+r:this.s.v<0?0+r:this.s.v+r,(s=1<this.e.v?1+r:this.e.v<0?0+r:this.e.v+r)<e){var n=e;e=s,s=n}e=1e-4*Math.round(1e4*e),s=1e-4*Math.round(1e4*s),this.sValue=e,this.eValue=s}else e=this.sValue,s=this.eValue;var h,o,l,p,f,m=this.shapes.length,d=0;if(s===e)for(a=0;a<m;a+=1)this.shapes[a].localShapeCollection.releaseShapes(),this.shapes[a].shape._mdf=!0,this.shapes[a].shape.paths=this.shapes[a].localShapeCollection,this._mdf&&(this.shapes[a].pathsData.length=0);else if(1===s&&0===e||0===s&&1===e){if(this._mdf)for(a=0;a<m;a+=1)this.shapes[a].pathsData.length=0,this.shapes[a].shape._mdf=!0}else{var c,u,g=[];for(a=0;a<m;a+=1)if((c=this.shapes[a]).shape._mdf||this._mdf||t||2===this.m){if(o=(i=c.shape.paths)._length,f=0,!c.shape._mdf&&c.pathsData.length)f=c.totalShapeLength;else{for(l=this.releasePathsData(c.pathsData),h=0;h<o;h+=1)p=mt.getSegmentsLength(i.shapes[h]),l.push(p),f+=p.totalLength;c.totalShapeLength=f,c.pathsData=l}d+=f,c.shape._mdf=!0}else c.shape.paths=c.localShapeCollection;var y,v=e,b=s,_=0;for(a=m-1;0<=a;a-=1)if((c=this.shapes[a]).shape._mdf){for((u=c.localShapeCollection).releaseShapes(),2===this.m&&1<m?(y=this.calculateShapeEdges(e,s,c.totalShapeLength,_,d),_+=c.totalShapeLength):y=[[v,b]],o=y.length,h=0;h<o;h+=1){v=y[h][0],b=y[h][1],g.length=0,b<=1?g.push({s:c.totalShapeLength*v,e:c.totalShapeLength*b}):1<=v?g.push({s:c.totalShapeLength*(v-1),e:c.totalShapeLength*(b-1)}):(g.push({s:c.totalShapeLength*v,e:c.totalShapeLength}),g.push({s:0,e:c.totalShapeLength*(b-1)}));var k=this.addShapes(c,g[0]);if(g[0].s!==g[0].e){if(1<g.length)if(c.shape.paths.shapes[c.shape.paths._length-1].c){var x=k.pop();this.addPaths(k,u),k=this.addShapes(c,g[1],x)}else this.addPaths(k,u),k=this.addShapes(c,g[1]);this.addPaths(k,u)}}c.shape.paths=u}}},Z.prototype.addPaths=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e.addShape(t[s])},Z.prototype.addSegment=function(t,e,s,i,a,r,n){a.setXYAt(e[0],e[1],"o",r),a.setXYAt(s[0],s[1],"i",r+1),n&&a.setXYAt(t[0],t[1],"v",r),a.setXYAt(i[0],i[1],"v",r+1)},Z.prototype.addSegmentFromArray=function(t,e,s,i){e.setXYAt(t[1],t[5],"o",s),e.setXYAt(t[2],t[6],"i",s+1),i&&e.setXYAt(t[0],t[4],"v",s),e.setXYAt(t[3],t[7],"v",s+1)},Z.prototype.addShapes=function(t,e,s){var i,a,r,n,h,o,l,p,f=t.pathsData,m=t.shape.paths.shapes,d=t.shape.paths._length,c=0,u=[],g=!0;for(p=s?(h=s._length,s._length):(s=St.newElement(),h=0),u.push(s),i=0;i<d;i+=1){for(o=f[i].lengths,s.c=m[i].c,r=m[i].c?o.length:o.length+1,a=1;a<r;a+=1)if(c+(n=o[a-1]).addedLength<e.s)c+=n.addedLength,s.c=!1;else{if(c>e.e){s.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[a],m[i].v[a],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[a],m[i].o[a-1],m[i].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1),c+=n.addedLength,h+=1}if(m[i].c&&o.length){if(n=o[a-1],c<=e.e){var y=o[a-1].addedLength;e.s<=c&&e.e>=c+y?(this.addSegment(m[i].v[a-1],m[i].o[a-1],m[i].i[0],m[i].v[0],s,h,g),g=!1):(l=mt.getNewSegment(m[i].v[a-1],m[i].v[0],m[i].o[a-1],m[i].i[0],(e.s-c)/y,(e.e-c)/y,o[a-1]),this.addSegmentFromArray(l,s,h,g),g=!1,s.c=!1)}else s.c=!1;c+=n.addedLength,h+=1}if(s._length&&(s.setXYAt(s.v[p][0],s.v[p][1],"i",p),s.setXYAt(s.v[s._length-1][0],s.v[s._length-1][1],"o",s._length-1)),c>e.e)break;i<d-1&&(s=St.newElement(),g=!0,u.push(s),h=0)}return u},K.registerModifier("tm",Z),B([U],J),J.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=R.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},J.prototype.processPath=function(t,e){var s,i=St.newElement();i.c=t.c;var a,r,n,h,o,l,p,f,m,d,c,u,g=t._length,y=0;for(s=0;s<g;s+=1)a=t.v[s],n=t.o[s],r=t.i[s],a[0]===n[0]&&a[1]===n[1]&&a[0]===r[0]&&a[1]===r[1]?0!==s&&s!==g-1||t.c?(h=0===s?t.v[g-1]:t.v[s-1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=c=a[0]+(h[0]-a[0])*l,f=u=a[1]-(a[1]-h[1])*l,m=p-(p-a[0])*v,d=f-(f-a[1])*v,i.setTripleAt(p,f,m,d,c,u,y),y+=1,h=s===g-1?t.v[0]:t.v[s+1],l=(o=Math.sqrt(Math.pow(a[0]-h[0],2)+Math.pow(a[1]-h[1],2)))?Math.min(o/2,e)/o:0,p=m=a[0]+(h[0]-a[0])*l,f=d=a[1]+(h[1]-a[1])*l,c=p-(p-a[0])*v,u=f-(f-a[1])*v,i.setTripleAt(p,f,m,d,c,u,y)):i.setTripleAt(a[0],a[1],n[0],n[1],r[0],r[1],y):i.setTripleAt(t.v[s][0],t.v[s][1],t.o[s][0],t.o[s][1],t.i[s][0],t.i[s][1],y),y+=1;return i},J.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.rd.v;if(0!==o)for(s=0;s<h;s+=1){if(n=(r=this.shapes[s]).localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},K.registerModifier("rd",J),B([U],Q),Q.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=R.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},Q.prototype.processPath=function(t,e){var s=e/100,i=[0,0],a=t._length,r=0;for(r=0;r<a;r+=1)i[0]+=t.v[r][0],i[1]+=t.v[r][1];i[0]/=a,i[1]/=a;var n,h,o,l,p,f,m=St.newElement();for(m.c=t.c,r=0;r<a;r+=1)n=t.v[r][0]+(i[0]-t.v[r][0])*s,h=t.v[r][1]+(i[1]-t.v[r][1])*s,o=t.o[r][0]+(i[0]-t.o[r][0])*-s,l=t.o[r][1]+(i[1]-t.o[r][1])*-s,p=t.i[r][0]+(i[0]-t.i[r][0])*-s,f=t.i[r][1]+(i[1]-t.i[r][1])*-s,m.setTripleAt(n,h,o,l,p,f,r);return m},Q.prototype.processShapes=function(t){var e,s,i,a,r,n,h=this.shapes.length,o=this.amount.v;if(0!==o)for(s=0;s<h;s+=1){if(n=(r=this.shapes[s]).localShapeCollection,r.shape._mdf||this._mdf||t)for(n.releaseShapes(),r.shape._mdf=!0,e=r.shape.paths.shapes,a=r.shape.paths._length,i=0;i<a;i+=1)n.addShape(this.processPath(e[i],o));r.shape.paths=r.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},K.registerModifier("pb",Q),B([U],$),$.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=R.getProp(t,e.c,0,null,this),this.o=R.getProp(t,e.o,0,null,this),this.tr=N.getTransformProperty(t,e.tr,this),this.so=R.getProp(t,e.tr.so,0,.01,this),this.eo=R.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new L,this.rMatrix=new L,this.sMatrix=new L,this.tMatrix=new L,this.matrix=new L},$.prototype.applyTransforms=function(t,e,s,i,a,r){var n=r?-1:1,h=i.s.v[0]+(1-i.s.v[0])*(1-a),o=i.s.v[1]+(1-i.s.v[1])*(1-a);t.translate(i.p.v[0]*n*a,i.p.v[1]*n*a,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*a),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),s.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),s.scale(r?1/h:h,r?1/o:o),s.translate(i.a.v[0],i.a.v[1],i.a.v[2])},$.prototype.init=function(t,e,s,i){for(this.elem=t,this.arr=e,this.pos=s,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[s]);0<s;)s-=1,this._elements.unshift(e[s]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},$.prototype.resetElements=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},$.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},$.prototype.changeGroupRender=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]._render=e,"gr"===t[s].ty&&this.changeGroupRender(t[s].it,e)},$.prototype.processShapes=function(t){var e,s,i,a,r;if(this._mdf||t){var n,h=Math.ceil(this.c.v);if(this._groups.length<h){for(;this._groups.length<h;){var o={it:this.cloneElements(this._elements),ty:"gr"};o.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,o),this._groups.splice(0,0,o),this._currentCopies+=1}this.elem.reloadShapes()}for(i=r=0;i<=this._groups.length-1;i+=1)n=r<h,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),r+=1;this._currentCopies=h;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=this.pMatrix.props,d=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var u,g,y=0;if(0<l){for(;y<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),y+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),y+=p)}else if(l<0){for(;f<y;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),y-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),y-=p)}for(i=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,r=this._currentCopies;r;){if(g=(s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==y){for((0!==i&&1===a||i!==this._currentCopies-1&&-1===a)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),u=0;u<g;u+=1)s[u]=this.matrix.props[u];this.matrix.reset()}else for(this.matrix.reset(),u=0;u<g;u+=1)s[u]=this.matrix.props[u];y+=1,r-=1,i+=a}}else for(r=this._currentCopies,i=0,a=1;r;)s=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,r-=1,i+=a},$.prototype.addShape=function(){},K.registerModifier("rp",$),tt.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(S(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},tt.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)St.release(this.shapes[t]);this._length=0},et.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,s=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<s;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},B([M],et),st.prototype.comparePoints=function(t,e){for(var s=0,i=this.o.length/2;s<i;){if(.01<Math.abs(t[4*s]-t[4*e+2*s]))return!1;s+=1}return!0},st.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},st.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,s,i,a=4*this.data.p;for(e=0;e<a;e+=1)s=e%4==0?100:255,i=Math.round(this.prop.v[e]*s),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(a=this.prop.v.length,e=4*this.data.p;e<a;e+=1)s=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},B([M],st);var it,at,rt=function(t,e,s,i){if(0===e)return"";var a,r=t.o,n=t.i,h=t.v,o=" M"+i.applyToPointStringified(h[0][0],h[0][1]);for(a=1;a<e;a+=1)o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[a][0],n[a][1])+" "+i.applyToPointStringified(h[a][0],h[a][1]);return s&&e&&(o+=" C"+i.applyToPointStringified(r[a-1][0],r[a-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(h[0][0],h[0][1]),o+="z"),o},nt=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,s=this.audios.length;for(e=0;e<s;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ht=function(){var a=function(){var t=T("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(t,e,s){var i="";if(t.e)i=t.p;else if(e){var a=t.p;-1!==a.indexOf("images/")&&(a=a.split("/")[1]),i=e+a}else i=s,i+=t.u?t.u:"",i+=t.p;return i}function e(){this._imageLoaded=t.bind(this),this.testImageLoaded=function(t){var e=0,s=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(s)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return e.prototype={loadAssets:function(t,e){var s;this.imagesLoadedCb=e;var i=t.length;for(s=0;s<i;s+=1)t[s].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[s])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,s=this.images.length;e<s;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function(t){var e=r(t,this.assetsPath,this.path),s=T("img");s.crossOrigin="anonymous",s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.src=e;var i={img:s,assetData:t};return i},createImageData:function(t){var e=r(t,this.assetsPath,this.path),s=E("image");n?this.testImageLoaded(s):s.addEventListener("load",this._imageLoaded,!1),s.addEventListener("error",function(){i.img=a,this._imageLoaded()}.bind(this),!1),s.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(s);var i={img:s,assetData:t};return i},imageLoaded:t,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},e}(),ot=(it={maskType:!0},(/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))&&(it.maskType=!1),it),dt=((at={}).createFilter=function(t){var e=E("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},at.createAlphaToLuminanceFilter=function(){var t=E("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},at),ct=function(){function r(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function(t,e,s){var i,a=new XMLHttpRequest;a.open("GET",t,!0);try{a.responseType="json"}catch(t){}a.send(),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)i=r(a),e(i);else try{i=r(a),e(i)}catch(t){s&&s(t)}}}}}();function ut(t,e,s){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=s,this._animatorsData=S(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(s)}function gt(t,e,s){var i={propType:!1},a=R.getProp,r=e.a;this.a={r:r.r?a(t,r.r,0,q,s):i,rx:r.rx?a(t,r.rx,0,q,s):i,ry:r.ry?a(t,r.ry,0,q,s):i,sk:r.sk?a(t,r.sk,0,q,s):i,sa:r.sa?a(t,r.sa,0,q,s):i,s:r.s?a(t,r.s,1,.01,s):i,a:r.a?a(t,r.a,1,0,s):i,o:r.o?a(t,r.o,0,.01,s):i,p:r.p?a(t,r.p,1,0,s):i,sw:r.sw?a(t,r.sw,0,0,s):i,sc:r.sc?a(t,r.sc,1,0,s):i,fc:r.fc?a(t,r.fc,1,0,s):i,fh:r.fh?a(t,r.fh,0,0,s):i,fs:r.fs?a(t,r.fs,0,.01,s):i,fb:r.fb?a(t,r.fb,0,.01,s):i,t:r.t?a(t,r.t,0,0,s):i},this.s=At.getTextSelectorProp(t,e.s,s),this.s.t=e.s.t}function yt(t,e,s,i,a,r){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=a,this.p=r,this._mdf={o:!0,sw:!!e,sc:!!s,fc:!!i,m:!0,p:!0}}function vt(t,e){this._frameId=s,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}ut.prototype.searchProperties=function(){var t,e,s=this._textData.a.length,i=R.getProp;for(t=0;t<s;t+=1)e=this._textData.a[t],this._animatorsData[t]=new gt(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},ut.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var s,i,a,r,n,h,o,l,p,f,m,d,c,u,g,y,v,b,_,k=this._moreOptions.alignment.v,x=this._animatorsData,w=this._textData,A=this.mHelper,P=this._renderType,C=this.renderedLetters.length,D=t.l;if(this._hasMaskedPath){if(_=this._pathData.m,!this._pathData.n||this._pathData._mdf){var S,E=_.v;for(this._pathData.r&&(E=E.reverse()),n={tLength:0,segments:[]},r=E._length-1,a=y=0;a<r;a+=1)S=mt.buildBezierData(E.v[a],E.v[a+1],[E.o[a][0]-E.v[a][0],E.o[a][1]-E.v[a][1]],[E.i[a+1][0]-E.v[a+1][0],E.i[a+1][1]-E.v[a+1][1]]),n.tLength+=S.segmentLength,n.segments.push(S),y+=S.segmentLength;a=r,_.v.c&&(S=mt.buildBezierData(E.v[a],E.v[0],[E.o[a][0]-E.v[a][0],E.o[a][1]-E.v[a][1]],[E.i[0][0]-E.v[0][0],E.i[0][1]-E.v[0][1]]),n.tLength+=S.segmentLength,n.segments.push(S),y+=S.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,h=this._pathData.f.v,f=1,p=!(l=m=0),u=n.segments,h<0&&_.v.c)for(n.tLength<Math.abs(h)&&(h=-Math.abs(h)%n.tLength),f=(c=u[m=u.length-1].points).length-1;h<0;)h+=c[f].partialLength,(f-=1)<0&&(f=(c=u[m-=1].points).length-1);d=(c=u[m].points)[f-1],g=(o=c[f]).partialLength}r=D.length,i=s=0;var T,M,F,I,L,B=1.2*t.finalSize*.714,z=!0;F=x.length;var V,R,N,O,q,j,W,X,Y,H,G,K,U=-1,Z=h,J=m,Q=f,$=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var st=0,it=0,at=2===t.j?-.5:-1,rt=0,nt=!0;for(a=0;a<r;a+=1)if(D[a].n){for(st&&(st+=it);rt<a;)D[rt].animatorJustifyOffset=st,rt+=1;nt=!(st=0)}else{for(M=0;M<F;M+=1)(T=x[M].a).t.propType&&(nt&&2===t.j&&(it+=T.t.v*at),(L=x[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?st+=T.t.v*L[0]*at:st+=T.t.v*L*at);nt=!1}for(st&&(st+=it);rt<a;)D[rt].animatorJustifyOffset=st,rt+=1}for(a=0;a<r;a+=1){if(A.reset(),O=1,D[a].n)s=0,i+=t.yOffset,i+=z?1:0,h=Z,z=!1,this._hasMaskedPath&&(f=Q,d=(c=u[m=J].points)[f-1],g=(o=c[f]).partialLength,l=0),K=Y=G=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if($!==D[a].line){switch(t.j){case 1:h+=y-t.lineWidths[D[a].line];break;case 2:h+=(y-t.lineWidths[D[a].line])/2}$=D[a].line}U!==D[a].ind&&(D[U]&&(h+=D[U].extra),h+=D[a].an/2,U=D[a].ind),h+=k[0]*D[a].an*.005;var ht=0;for(M=0;M<F;M+=1)(T=x[M].a).p.propType&&((L=x[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?ht+=T.p.v[0]*L[0]:ht+=T.p.v[0]*L),T.a.propType&&((L=x[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?ht+=T.a.v[0]*L[0]:ht+=T.a.v[0]*L);for(p=!0;p;)h+ht<=l+g||!c?(v=(h+ht-l)/o.partialLength,R=d.point[0]+(o.point[0]-d.point[0])*v,N=d.point[1]+(o.point[1]-d.point[1])*v,A.translate(-k[0]*D[a].an*.005,-k[1]*B*.01),p=!1):c&&(l+=o.partialLength,(f+=1)>=c.length&&(f=0,c=u[m+=1]?u[m].points:_.v.c?u[m=f=0].points:(l-=o.partialLength,null)),c&&(d=o,g=(o=c[f]).partialLength));V=D[a].an/2-D[a].add,A.translate(-V,0,0)}else V=D[a].an/2-D[a].add,A.translate(-V,0,0),A.translate(-k[0]*D[a].an*.005,-k[1]*B*.01,0);for(M=0;M<F;M+=1)(T=x[M].a).t.propType&&(L=x[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars),0===s&&0===t.j||(this._hasMaskedPath?L.length?h+=T.t.v*L[0]:h+=T.t.v*L:L.length?s+=T.t.v*L[0]:s+=T.t.v*L));for(t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(q=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(W=[t.fc[0],t.fc[1],t.fc[2]]),M=0;M<F;M+=1)(T=x[M].a).a.propType&&((L=x[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?A.translate(-T.a.v[0]*L[0],-T.a.v[1]*L[1],T.a.v[2]*L[2]):A.translate(-T.a.v[0]*L,-T.a.v[1]*L,T.a.v[2]*L));for(M=0;M<F;M+=1)(T=x[M].a).s.propType&&((L=x[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars)).length?A.scale(1+(T.s.v[0]-1)*L[0],1+(T.s.v[1]-1)*L[1],1):A.scale(1+(T.s.v[0]-1)*L,1+(T.s.v[1]-1)*L,1));for(M=0;M<F;M+=1){if(T=x[M].a,L=x[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars),T.sk.propType&&(L.length?A.skewFromAxis(-T.sk.v*L[0],T.sa.v*L[1]):A.skewFromAxis(-T.sk.v*L,T.sa.v*L)),T.r.propType&&(L.length?A.rotateZ(-T.r.v*L[2]):A.rotateZ(-T.r.v*L)),T.ry.propType&&(L.length?A.rotateY(T.ry.v*L[1]):A.rotateY(T.ry.v*L)),T.rx.propType&&(L.length?A.rotateX(T.rx.v*L[0]):A.rotateX(T.rx.v*L)),T.o.propType&&(L.length?O+=(T.o.v*L[0]-O)*L[0]:O+=(T.o.v*L-O)*L),t.strokeWidthAnim&&T.sw.propType&&(L.length?j+=T.sw.v*L[0]:j+=T.sw.v*L),t.strokeColorAnim&&T.sc.propType)for(X=0;X<3;X+=1)L.length?q[X]+=(T.sc.v[X]-q[X])*L[0]:q[X]+=(T.sc.v[X]-q[X])*L;if(t.fillColorAnim&&t.fc){if(T.fc.propType)for(X=0;X<3;X+=1)L.length?W[X]+=(T.fc.v[X]-W[X])*L[0]:W[X]+=(T.fc.v[X]-W[X])*L;T.fh.propType&&(W=L.length?ft(W,T.fh.v*L[0]):ft(W,T.fh.v*L)),T.fs.propType&&(W=L.length?lt(W,T.fs.v*L[0]):lt(W,T.fs.v*L)),T.fb.propType&&(W=L.length?pt(W,T.fb.v*L[0]):pt(W,T.fb.v*L))}}for(M=0;M<F;M+=1)(T=x[M].a).p.propType&&(L=x[M].s.getMult(D[a].anIndexes[M],w.a[M].s.totalChars),this._hasMaskedPath?L.length?A.translate(0,T.p.v[1]*L[0],-T.p.v[2]*L[1]):A.translate(0,T.p.v[1]*L,-T.p.v[2]*L):L.length?A.translate(T.p.v[0]*L[0],T.p.v[1]*L[1],-T.p.v[2]*L[2]):A.translate(T.p.v[0]*L,T.p.v[1]*L,-T.p.v[2]*L));if(t.strokeWidthAnim&&(Y=j<0?0:j),t.strokeColorAnim&&(H="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),t.fillColorAnim&&t.fc&&(G="rgb("+Math.round(255*W[0])+","+Math.round(255*W[1])+","+Math.round(255*W[2])+")"),this._hasMaskedPath){if(A.translate(0,-t.ls),A.translate(0,k[1]*B*.01+i,0),w.p.p){b=(o.point[1]-d.point[1])/(o.point[0]-d.point[0]);var ot=180*Math.atan(b)/Math.PI;o.point[0]<d.point[0]&&(ot+=180),A.rotate(-ot*Math.PI/180)}A.translate(R,N,0),h-=k[0]*D[a].an*.005,D[a+1]&&U!==D[a+1].ind&&(h+=D[a].an/2,h+=.001*t.tr*t.finalSize)}else{switch(A.translate(s,i,0),t.ps&&A.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:A.translate(D[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[a].line]),0,0);break;case 2:A.translate(D[a].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[D[a].line])/2,0,0)}A.translate(0,-t.ls),A.translate(V,0,0),A.translate(k[0]*D[a].an*.005,k[1]*B*.01,0),s+=D[a].l+.001*t.tr*t.finalSize}"html"===P?tt=A.toCSS():"svg"===P?tt=A.to2dCSS():et=[A.props[0],A.props[1],A.props[2],A.props[3],A.props[4],A.props[5],A.props[6],A.props[7],A.props[8],A.props[9],A.props[10],A.props[11],A.props[12],A.props[13],A.props[14],A.props[15]],K=O}this.lettersChangedFlag=C<=a?(I=new yt(K,Y,H,G,tt,et),this.renderedLetters.push(I),C+=1,!0):(I=this.renderedLetters[a]).update(K,Y,H,G,tt,et)||this.lettersChangedFlag}}},ut.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},ut.prototype.mHelper=new L,ut.prototype.defaultPropsArray=[],B([M],ut),yt.prototype.update=function(t,e,s,i,a,r){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==s&&(this.sc=s,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==a&&(this.m=a,n=this._mdf.m=!0),!r.length||this.p[0]===r[0]&&this.p[1]===r[1]&&this.p[4]===r[4]&&this.p[5]===r[5]&&this.p[12]===r[12]&&this.p[13]===r[13]||(this.p=r,n=this._mdf.p=!0),n},vt.prototype.defaultBoxWidth=[0,0],vt.prototype.copyData=function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},vt.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},vt.prototype.searchProperty=function(){return this.searchKeyframes()},vt.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},vt.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},vt.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,s=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var a=this.effectsSequence.length,r=t||this.data.d.k[this.keysIndex].s;for(i=0;i<a;i+=1)r=s!==this.keysIndex?this.effectsSequence[i](r,r.t):this.effectsSequence[i](this.currentData,r.t);e!==r&&this.setCurrentData(r),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},vt.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,s=0,i=t.length;s<=i-1&&!(s===i-1||t[s+1].t>e);)s+=1;return this.keysIndex!==s&&(this.keysIndex=s),this.data.d.k[this.keysIndex].s},vt.prototype.buildFinalText=function(t){for(var e,s=V.getCombinedCharacterCodes(),i=[],a=0,r=t.length;a<r;)e=t.charCodeAt(a),-1!==s.indexOf(e)?i[i.length-1]+=t.charAt(a):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(a+1))&&e<=57343?(i.push(t.substr(a,2)),a+=1):i.push(t.charAt(a)),a+=1;return i},vt.prototype.completeTextData=function(t){t.__complete=!0;var e,s,i,a,r,n,h,o=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,d=0,c=0,u=0,g=[],y=0,v=0,b=o.getFontByName(t.f),_=0,k=O(b);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),s=t.finalText.length,t.finalLineHeight=t.lh;var x,w=t.tr/1e3*t.finalSize;if(t.sz)for(var A,P,C=!0,D=t.sz[0],S=t.sz[1];C;){y=A=0,s=(P=this.buildFinalText(t.t)).length,w=t.tr/1e3*t.finalSize;var E=-1;for(e=0;e<s;e+=1)x=P[e].charCodeAt(0),i=!1," "===P[e]?E=e:13!==x&&3!==x||(i=!(y=0),A+=t.finalLineHeight||1.2*t.finalSize),D<y+(_=o.chars?(h=o.getCharData(P[e],b.fStyle,b.fFamily),i?0:h.w*t.finalSize/100):o.measureText(P[e],t.f,t.finalSize))&&" "!==P[e]?(-1===E?s+=1:e=E,A+=t.finalLineHeight||1.2*t.finalSize,P.splice(e,E===e?1:0,"\r"),E=-1,y=0):(y+=_,y+=w);A+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&S<A?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=P,s=t.finalText.length,C=!1)}y=-w;var T,M=_=0;for(e=0;e<s;e+=1)if(i=!1,13===(x=(T=t.finalText[e]).charCodeAt(0))||3===x?(M=0,g.push(y),v=v<y?y:v,y=-2*w,i=!(a=""),u+=1):a=T,_=o.chars?(h=o.getCharData(T,b.fStyle,o.getFontByName(t.f).fFamily),i?0:h.w*t.finalSize/100):o.measureText(a,t.f,t.finalSize)," "===T?M+=_+w:(y+=_+w+M,M=0),p.push({l:_,an:_,add:d,n:i,anIndexes:[],val:a,line:u,animatorJustifyOffset:0}),2==m){if(d+=_,""===a||" "===a||e===s-1){for(""!==a&&" "!==a||(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;f+=1,d=0}}else if(3==m){if(d+=_,""===a||e===s-1){for(""===a&&(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;d=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<y?y:v,g.push(y),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var F,I,L,B,z=l.a;n=z.length;var V=[];for(r=0;r<n;r+=1){for((F=z[r]).a.sc&&(t.strokeColorAnim=!0),F.a.sw&&(t.strokeWidthAnim=!0),(F.a.fc||F.a.fh||F.a.fs||F.a.fb)&&(t.fillColorAnim=!0),B=0,L=F.s.b,e=0;e<s;e+=1)(I=p[e]).anIndexes[r]=B,(1==L&&""!==I.val||2==L&&""!==I.val&&" "!==I.val||3==L&&(I.n||" "==I.val||e==s-1)||4==L&&(I.n||e==s-1))&&(1===F.s.rn&&V.push(B),B+=1);l.a[r].s.totalChars=B;var R,N=-1;if(1===F.s.rn)for(e=0;e<s;e+=1)N!=(I=p[e]).anIndexes[r]&&(N=I.anIndexes[r],R=V.splice(Math.floor(Math.random()*V.length),1)[0]),I.anIndexes[r]=R}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},vt.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var s=this.copyData({},this.data.d.k[e].s);s=this.copyData(s,t),this.data.d.k[e].s=s,this.recalculate(e),this.elem.addDynamicProperty(this)},vt.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},vt.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},vt.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var bt,_t,kt,xt,wt,At=function(){var d=Math.max,c=Math.min,u=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=R.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?R.getProp(t,e.e,0,0,this):{v:100},this.o=R.getProp(t,e.o||{k:0},0,0,this),this.xe=R.getProp(t,e.xe||{k:0},0,0,this),this.ne=R.getProp(t,e.ne||{k:0},0,0,this),this.a=R.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,s=0,i=1,a=1;0<this.ne.v?e=this.ne.v/100:s=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:a=1+this.xe.v/100;var r=W.getBezierEasing(e,s,i,a).get,n=0,h=this.finalS,o=this.finalE,l=this.data.sh;if(2===l)n=r(n=o===h?o<=t?1:0:d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(3===l)n=r(n=o===h?o<=t?0:1:1-d(0,c(.5/(o-h)+(t-h)/(o-h),1)));else if(4===l)o===h?n=0:(n=d(0,c(.5/(o-h)+(t-h)/(o-h),1)))<.5?n*=2:n=1-2*(n-.5),n=r(n);else if(5===l){if(o===h)n=0;else{var p=o-h,f=-p/2+(t=c(d(0,t+.5-h),o-h)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=r(n)}else n=6===l?r(n=o===h?0:(t=c(d(0,t+.5-h),o-h),(1+Math.cos(Math.PI+2*Math.PI*t/(o-h)))/2)):(t>=u(h)&&(n=d(0,c(t-h<0?c(o,1)-(h-t):o-t,1))),r(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,s=this.o.v/e,i=this.s.v/e+s,a=this.e.v/e+s;if(a<i){var r=i;i=a,a=r}this.finalS=i,this.finalE=a}},B([M],i),{getTextSelectorProp:function(t,e,s){return new i(t,e,s)}}}(),Pt=function(t,e,s){var i=0,a=t,r=S(a);return{newElement:function(){return i?r[i-=1]:e()},release:function(t){i===a&&(r=Ct.double(r),a*=2),s&&s(t),r[i]=t,i+=1}}},Ct={double:function(t){return t.concat(S(t.length))}},Dt=Pt(8,function(){return j("float32",2)}),St=((bt=Pt(4,function(){return new X},function(t){var e,s=t._length;for(e=0;e<s;e+=1)Dt.release(t.v[e]),Dt.release(t.i[e]),Dt.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1})).clone=function(t){var e,s=bt.newElement(),i=void 0===t._length?t.v.length:t._length;for(s.setLength(i),s.c=t.c,e=0;e<i;e+=1)s.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return s},bt),Et=(_t={newShapeCollection:function(){var t;t=kt?wt[kt-=1]:new tt;return t},release:function(t){var e,s=t._length;for(e=0;e<s;e+=1)St.release(t.shapes[e]);t._length=0,kt===xt&&(wt=Ct.double(wt),xt*=2);wt[kt]=t,kt+=1}},kt=0,wt=S(xt=4),_t),Tt=Pt(8,function(){return{lengths:[],totalLength:0}},function(t){var e,s=t.lengths.length;for(e=0;e<s;e+=1)Mt.release(t.lengths[e]);t.lengths.length=0}),Mt=Pt(8,function(){return{addedLength:0,percents:j("float32",w),lengths:j("float32",w)}});function Ft(){}function It(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=E("svg");var s="";if(e&&e.title){var i=E("title"),a=P();i.setAttribute("id",a),i.textContent=e.title,this.svgElement.appendChild(i),s+=a}if(e&&e.description){var r=E("desc"),n=P();r.setAttribute("id",n),r.textContent=e.description,this.svgElement.appendChild(r),s+=" "+n}s&&this.svgElement.setAttribute("aria-labelledby",s);var h=E("defs");this.svgElement.appendChild(h);var o=E("g");this.svgElement.appendChild(o),this.layerElement=o,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:h,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function Lt(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&!1===e.hideOnTransparent),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function Bt(t,e,s){this.data=t,this.element=e,this.globalData=s,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,a,r=this.globalData.defs,n=this.masksProperties?this.masksProperties.length:0;this.viewData=S(n),this.solidPath="";var h,o,l,p,f,m,d=this.masksProperties,c=0,u=[],g=P(),y="clipPath",v="clip-path";for(i=0;i<n;i+=1)if(("a"!==d[i].mode&&"n"!==d[i].mode||d[i].inv||100!==d[i].o.k||d[i].o.x)&&(v=y="mask"),"s"!==d[i].mode&&"i"!==d[i].mode||0!==c?l=null:((l=E("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),u.push(l)),a=E("path"),"n"===d[i].mode)this.viewData[i]={op:R.getProp(this.element,d[i].o,0,.01,this.element),prop:G.getShapeProp(this.element,d[i],3),elem:a,lastPath:""},r.appendChild(a);else{var b;if(c+=1,a.setAttribute("fill","s"===d[i].mode?"#000000":"#ffffff"),a.setAttribute("clip-rule","nonzero"),0!==d[i].x.k?(v=y="mask",m=R.getProp(this.element,d[i].x,0,null,this.element),b=P(),(p=E("filter")).setAttribute("id",b),(f=E("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),r.appendChild(p),a.setAttribute("stroke","s"===d[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:a,x:m,expan:f,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===d[i].mode){o=u.length;var _=E("g");for(h=0;h<o;h+=1)_.appendChild(u[h]);var k=E("mask");k.setAttribute("mask-type","alpha"),k.setAttribute("id",g+"_"+c),k.appendChild(a),r.appendChild(k),_.setAttribute("mask","url("+x+"#"+g+"_"+c+")"),u.length=0,u.push(_)}else u.push(a);d[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:a,lastPath:"",op:R.getProp(this.element,d[i].o,0,.01,this.element),prop:G.getShapeProp(this.element,d[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(d[i],this.viewData[i].prop.v,this.viewData[i])}for(this.maskElement=E(y),n=u.length,i=0;i<n;i+=1)this.maskElement.appendChild(u[i]);0<c&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+x+"#"+g+")"),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function zt(){}function Vt(){}function Rt(){}function Nt(){}function Ot(){}function qt(t,e){this.elem=t,this.pos=e}function jt(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=E("path"),this.msElem=null}function Wt(t,e,s){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=s,this.lvl=e,this._isAnimated=!!s.k;for(var i=0,a=t.length;i<a;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function Xt(t,e,s){this.transform={mProps:t,op:e,container:s},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function Yt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=R.getProp(t,e.o,0,.01,this),this.w=R.getProp(t,e.w,0,null,this),this.d=new et(t,e.d||{},"svg",this),this.c=R.getProp(t,e.c,1,255,this),this.style=s,this._isAnimated=!!this._isAnimated}function Ht(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=R.getProp(t,e.o,0,.01,this),this.c=R.getProp(t,e.c,1,255,this),this.style=s}function Gt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,s)}function Kt(t,e,s){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=R.getProp(t,e.w,0,null,this),this.d=new et(t,e.d||{},"svg",this),this.initGradientData(t,e,s),this._isAnimated=!!this._isAnimated}function Ut(){this.it=[],this.prevViewData=[],this.gr=E("g")}Ft.prototype.checkLayers=function(t){var e,s,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e-=1)this.elements[e]||(s=this.layers[e]).ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},Ft.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);default:return this.createNull(t)}},Ft.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Ft.prototype.createAudio=function(t){return new re(t,this.globalData,this)},Ft.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},Ft.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var s,i=t.length,a=this.layers.length;for(e=0;e<i;e+=1)for(s=0;s<a;){if(this.layers[s].id===t[e].id){this.layers[s]=t[e];break}s+=1}},Ft.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},Ft.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},Ft.prototype.buildElementParenting=function(t,e,s){for(var i=this.elements,a=this.layers,r=0,n=a.length;r<n;)a[r].ind==e&&(i[r]&&!0!==i[r]?(s.push(i[r]),i[r].setAsParent(),void 0!==a[r].parent?this.buildElementParenting(t,a[r].parent,s):t.setHierarchy(s)):(this.buildItem(r),this.addPendingElement(t))),r+=1},Ft.prototype.addPendingElement=function(t){this.pendingElements.push(t)},Ft.prototype.searchExtraCompositions=function(t){var e,s=t.length;for(e=0;e<s;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},Ft.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new V,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},B([Ft],It),It.prototype.createNull=function(t){return new Qt(t,this.globalData,this)},It.prototype.createShape=function(t){return new oe(t,this.globalData,this)},It.prototype.createText=function(t){return new he(t,this.globalData,this)},It.prototype.createImage=function(t){return new ie(t,this.globalData,this)},It.prototype.createComp=function(t){return new ne(t,this.globalData,this)},It.prototype.createSolid=function(t){return new ae(t,this.globalData,this)},It.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var s=E("clipPath"),i=E("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var a=P();s.setAttribute("id",a),s.appendChild(i),this.layerElement.setAttribute("clip-path","url("+x+"#"+a+")"),e.appendChild(s),this.layers=t.layers,this.elements=S(t.layers.length)},It.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},It.prototype.updateContainerSize=function(){},It.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var s=this.createItem(this.layers[t]);e[t]=s,h&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(s),s.initExpressions()),this.appendElementInPos(s,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?s.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(s)))}},It.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,s=this.elements.length;e<s;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},It.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var s=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=s-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<s;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},It.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){for(var i,a=0;a<e;)this.elements[a]&&!0!==this.elements[a]&&this.elements[a].getBaseElement()&&(i=this.elements[a].getBaseElement()),a+=1;i?this.layerElement.insertBefore(s,i):this.layerElement.appendChild(s)}},It.prototype.hide=function(){this.layerElement.style.display="none"},It.prototype.show=function(){this.layerElement.style.display="block"},B([Ft],Lt),Lt.prototype.buildItem=It.prototype.buildItem,Lt.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},Lt.prototype.appendElementInPos=function(t,e){var s=t.getBaseElement();if(s){var i=this.layers[e];if(i.ddd&&this.supports3d)this.addTo3dContainer(s,e);else if(this.threeDElements)this.addTo3dContainer(s,e);else{for(var a,r,n=0;n<e;)this.elements[n]&&!0!==this.elements[n]&&this.elements[n].getBaseElement&&(r=this.elements[n],a=(this.layers[n].ddd?this.getThreeDContainerByPos(n):r.getBaseElement())||a),n+=1;a?i.ddd&&this.supports3d||this.layerElement.insertBefore(s,a):i.ddd&&this.supports3d||this.layerElement.appendChild(s)}}},Lt.prototype.createShape=function(t){return this.supports3d?new ue(t,this.globalData,this):new oe(t,this.globalData,this)},Lt.prototype.createText=function(t){return this.supports3d?new ge(t,this.globalData,this):new he(t,this.globalData,this)},Lt.prototype.createCamera=function(t){return this.camera=new ve(t,this.globalData,this),this.camera},Lt.prototype.createImage=function(t){return this.supports3d?new ye(t,this.globalData,this):new ie(t,this.globalData,this)},Lt.prototype.createComp=function(t){return this.supports3d?new ce(t,this.globalData,this):new ne(t,this.globalData,this)},Lt.prototype.createSolid=function(t){return this.supports3d?new de(t,this.globalData,this):new ae(t,this.globalData,this)},Lt.prototype.createNull=It.prototype.createNull,Lt.prototype.getThreeDContainerByPos=function(t){for(var e=0,s=this.threeDElements.length;e<s;){if(this.threeDElements[e].startPos<=t&&this.threeDElements[e].endPos>=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},Lt.prototype.createThreeDContainer=function(t,e){var s,i,a=T("div");A(a);var r=T("div");if(A(r),"3d"===e){(s=a.style).width=this.globalData.compSize.w+"px",s.height=this.globalData.compSize.h+"px";var n="50% 50%";s.webkitTransformOrigin=n,s.mozTransformOrigin=n,s.transformOrigin=n;var h="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(i=r.style).transform=h,i.webkitTransform=h}a.appendChild(r);var o={container:r,perspectiveElem:a,startPos:t,endPos:t,type:e};return this.threeDElements.push(o),o},Lt.prototype.build3dContainers=function(){var t,e,s=this.layers.length,i="";for(t=0;t<s;t+=1)this.layers[t].ddd&&3!==this.layers[t].ty?"3d"!==i&&(i="3d",e=this.createThreeDContainer(t,"3d")):"2d"!==i&&(i="2d",e=this.createThreeDContainer(t,"2d")),e.endPos=Math.max(e.endPos,t);for(t=(s=this.threeDElements.length)-1;0<=t;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},Lt.prototype.addTo3dContainer=function(t,e){for(var s=0,i=this.threeDElements.length;s<i;){if(e<=this.threeDElements[s].endPos){for(var a,r=this.threeDElements[s].startPos;r<e;)this.elements[r]&&this.elements[r].getBaseElement&&(a=this.elements[r].getBaseElement()),r+=1;a?this.threeDElements[s].container.insertBefore(t,a):this.threeDElements[s].container.appendChild(t);break}s+=1}},Lt.prototype.configAnimation=function(t){var e=T("div"),s=this.animationItem.wrapper,i=e.style;i.width=t.w+"px",i.height=t.h+"px",A(this.resizerElem=e),i.transformStyle="flat",i.mozTransformStyle="flat",i.webkitTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),s.appendChild(e),i.overflow="hidden";var a=E("svg");a.setAttribute("width","1"),a.setAttribute("height","1"),A(a),this.resizerElem.appendChild(a);var r=E("defs");a.appendChild(r),this.data=t,this.setupGlobalData(t,a),this.globalData.defs=r,this.layers=t.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},Lt.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},Lt.prototype.updateContainerSize=function(){var t,e,s,i,a=this.animationItem.wrapper.offsetWidth,r=this.animationItem.wrapper.offsetHeight;i=a/r<this.globalData.compSize.w/this.globalData.compSize.h?(t=a/this.globalData.compSize.w,e=a/this.globalData.compSize.w,s=0,(r-this.globalData.compSize.h*(a/this.globalData.compSize.w))/2):(t=r/this.globalData.compSize.h,e=r/this.globalData.compSize.h,s=(a-this.globalData.compSize.w*(r/this.globalData.compSize.h))/2,0);var n=this.resizerElem.style;n.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+s+","+i+",0,1)",n.transform=n.webkitTransform},Lt.prototype.renderFrame=It.prototype.renderFrame,Lt.prototype.hide=function(){this.resizerElem.style.display="none"},Lt.prototype.show=function(){this.resizerElem.style.display="block"},Lt.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,s=this.globalData.compSize.h,i=this.threeDElements.length;for(t=0;t<i;t+=1){var a=this.threeDElements[t].perspectiveElem.style;a.webkitPerspective=Math.sqrt(Math.pow(e,2)+Math.pow(s,2))+"px",a.perspective=a.webkitPerspective}}},Lt.prototype.searchExtraCompositions=function(t){var e,s=t.length,i=T("div");for(e=0;e<s;e+=1)if(t[e].xt){var a=this.createComp(t[e],i,this.globalData.comp,null);a.initExpressions(),this.globalData.projectInterface.registerComposition(a)}},Bt.prototype.getMaskProperty=function(t){return this.viewData[t].prop},Bt.prototype.renderFrame=function(t){var e,s=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",s.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var a=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+x+"#"+this.storedData[e].filterId+")")),a.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},Bt.prototype.getMaskelement=function(){return this.maskElement},Bt.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},Bt.prototype.drawPath=function(t,e,s){var i,a,r=" M"+e.v[0][0]+","+e.v[0][1];for(a=e._length,i=1;i<a;i+=1)r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<a&&(r+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),s.lastPath!==r){var n="";s.elem&&(e.c&&(n=t.inv?this.solidPath+r:r),s.elem.setAttribute("d",n)),s.lastPath=r}},Bt.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},zt.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},Vt.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var s,i=this.dynamicProperties.length;for(s=0;s<i;s+=1)(e||this._isParent&&"transform"===this.dynamicProperties[s].propType)&&(this.dynamicProperties[s].getValue(),this.dynamicProperties[s]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},Rt.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?N.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new L},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,s=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;s<i;){if(this.hierarchy[s].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}s+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),s=0;s<i;s+=1)t=this.hierarchy[s].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var s,i=!0,a=this.comp;i;)a.finalTransform?(a.data.hasMask&&e.splice(0,0,a.finalTransform),a=a.comp):i=!1;var r,n=e.length;for(s=0;s<n;s+=1)r=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-r[0],t[1]-r[1],0];return t},mHelper:new L},Nt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},B([Nt,function(t){function e(){}return e.prototype=t,e}({initElement:function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],Ot),jt.prototype.reset=function(){this.d="",this._mdf=!1},Wt.prototype.setAsAnimated=function(){this._isAnimated=!0},B([M],Yt),B([M],Ht),Gt.prototype.initGradientData=function(t,e,s){this.o=R.getProp(t,e.o,0,.01,this),this.s=R.getProp(t,e.s,1,null,this),this.e=R.getProp(t,e.e,1,null,this),this.h=R.getProp(t,e.h||{k:0},0,.01,this),this.a=R.getProp(t,e.a||{k:0},0,q,this),this.g=new st(t,e.g,this),this.style=s,this.stops=[],this.setGradientData(s.pElem,e),this.setGradientOpacity(e,s),this._isAnimated=!!this._isAnimated},Gt.prototype.setGradientData=function(t,e){var s=P(),i=E(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",s),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var a,r,n,h=[];for(n=4*e.g.p,r=0;r<n;r+=4)a=E("stop"),i.appendChild(a),h.push(a);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+x+"#"+s+")"),this.gf=i,this.cst=h},Gt.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var s,i,a,r=E("mask"),n=E("path");r.appendChild(n);var h=P(),o=P();r.setAttribute("id",o);var l=E(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",h),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),a=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(i=4*t.g.p;i<a;i+=2)(s=E("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(s),p.push(s);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+x+"#"+h+")"),this.of=l,this.ms=r,this.ost=p,this.maskId=o,e.msElem=n}},B([M],Gt),B([Gt,M],Kt);var Zt=function(){var g=new L,y=new L;function e(t,e,s){(s||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(s||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function s(t,e,s){var i,a,r,n,h,o,l,p,f,m,d,c=e.styles.length,u=e.lvl;for(o=0;o<c;o+=1){if(n=e.sh._mdf||s,e.styles[o].lvl<u){for(p=y.reset(),m=u-e.styles[o].lvl,d=e.transformers.length-1;!n&&0<m;)n=e.transformers[d].mProps._mdf||n,m-=1,d-=1;if(n)for(m=u-e.styles[o].lvl,d=e.transformers.length-1;0<m;)f=e.transformers[d].mProps.v.props,p.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),m-=1,d-=1}else p=g;if(a=(l=e.sh.paths)._length,n){for(r="",i=0;i<a;i+=1)(h=l.shapes[i])&&h._length&&(r+=rt(h,h._length,h.c,p));e.caches[o]=r}else r=e.caches[o];e.styles[o].d+=!0===t.hd?"":r,e.styles[o]._mdf=n||e.styles[o]._mdf}}function i(t,e,s){var i=e.style;(e.c._mdf||s)&&i.pElem.setAttribute("fill","rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function a(t,e,s){r(t,e,s),n(t,e,s)}function r(t,e,s){var i,a,r,n,h,o=e.gf,l=e.g._hasOpacity,p=e.s.v,f=e.e.v;if(e.o._mdf||s){var m="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(m,e.o.v)}if(e.s._mdf||s){var d=1===t.t?"x1":"cx",c="x1"===d?"y1":"cy";o.setAttribute(d,p[0]),o.setAttribute(c,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(d,p[0]),e.of.setAttribute(c,p[1]))}if(e.g._cmdf||s){i=e.cst;var u=e.g.c;for(r=i.length,a=0;a<r;a+=1)(n=i[a]).setAttribute("offset",u[4*a]+"%"),n.setAttribute("stop-color","rgb("+u[4*a+1]+","+u[4*a+2]+","+u[4*a+3]+")")}if(l&&(e.g._omdf||s)){var g=e.g.o;for(r=(i=e.g._collapsable?e.cst:e.ost).length,a=0;a<r;a+=1)n=i[a],e.g._collapsable||n.setAttribute("offset",g[2*a]+"%"),n.setAttribute("stop-opacity",g[2*a+1])}if(1===t.t)(e.e._mdf||s)&&(o.setAttribute("x2",f[0]),o.setAttribute("y2",f[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",f[0]),e.of.setAttribute("y2",f[1])));else if((e.s._mdf||e.e._mdf||s)&&(h=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)),o.setAttribute("r",h),l&&!e.g._collapsable&&e.of.setAttribute("r",h)),e.e._mdf||e.h._mdf||e.a._mdf||s){h||(h=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)));var y=Math.atan2(f[1]-p[1],f[0]-p[0]),v=e.h.v;1<=v?v=.99:v<=-1&&(v=-.99);var b=h*v,_=Math.cos(y+e.a.v)*b+p[0],k=Math.sin(y+e.a.v)*b+p[1];o.setAttribute("fx",_),o.setAttribute("fy",k),l&&!e.g._collapsable&&(e.of.setAttribute("fx",_),e.of.setAttribute("fy",k))}}function n(t,e,s){var i=e.style,a=e.d;a&&(a._mdf||s)&&a.dashStr&&(i.pElem.setAttribute("stroke-dasharray",a.dashStr),i.pElem.setAttribute("stroke-dashoffset",a.dashoffset[0])),e.c&&(e.c._mdf||s)&&i.pElem.setAttribute("stroke","rgb("+f(e.c.v[0])+","+f(e.c.v[1])+","+f(e.c.v[2])+")"),(e.o._mdf||s)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||s)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return i;case"gf":return r;case"gs":return a;case"st":return n;case"sh":case"el":case"rc":case"sr":return s;case"tr":return e;default:return null}}}}();function Jt(){}function Qt(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initFrame(),this.initTransform(t,e,s),this.initHierarchy()}function $t(){}function te(){}function ee(){}function se(){}function ie(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ae(t,e,s){this.initElement(t,e,s)}function re(t,e,s){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,s),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ne(t,e,s){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?S(this.layers.length):[],this.initElement(t,e,s),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function he(t,e,s){this.textSpans=[],this.renderType="svg",this.initElement(t,e,s)}function oe(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,s),this.prevViewData=[]}Jt.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=I(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,s){this.globalData=e,this.comp=s,this.data=t,this.layerId=P(),this.data.sr||(this.data.sr=1),this.effectsManager=new ke(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},Qt.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},Qt.prototype.renderFrame=function(){},Qt.prototype.getBaseElement=function(){return null},Qt.prototype.destroy=function(){},Qt.prototype.sourceRectAtTime=function(){},Qt.prototype.hide=function(){},B([Jt,Rt,zt,Vt],Qt),$t.prototype={initRendererElement:function(){this.layerElement=E("g")},createContainerElements:function(){this.matteElement=E("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,s,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var a=E("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),a.appendChild(this.layerElement),i=a,this.globalData.defs.appendChild(a),ot.maskType||1!=this.data.td||(a.setAttribute("mask-type","luminance"),t=P(),e=dt.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(dt.createAlphaToLuminanceFilter()),(s=E("g")).appendChild(this.layerElement),i=s,a.appendChild(s),s.setAttribute("filter","url("+x+"#"+t+")"))}else if(2==this.data.td){var r=E("mask");r.setAttribute("id",this.layerId),r.setAttribute("mask-type","alpha");var n=E("g");r.appendChild(n),t=P(),e=dt.createFilter(t);var h=E("feComponentTransfer");h.setAttribute("in","SourceGraphic"),e.appendChild(h);var o=E("feFuncA");o.setAttribute("type","table"),o.setAttribute("tableValues","1.0 0.0"),h.appendChild(o),this.globalData.defs.appendChild(e);var l=E("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+x+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,ot.maskType||(r.setAttribute("mask-type","luminance"),e.appendChild(dt.createAlphaToLuminanceFilter()),s=E("g"),n.appendChild(l),s.appendChild(this.layerElement),i=s,n.appendChild(s)),this.globalData.defs.appendChild(r)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=E("clipPath"),f=E("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=P();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var d=E("g");d.setAttribute("clip-path","url("+x+"#"+m+")"),d.appendChild(this.layerElement),this.transformedElement=d,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+x+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new Bt(this.data,this,this.globalData),this.renderableEffectsManager=new pe(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+x+"#"+t+")")}},te.prototype={addShapeToModifiers:function(t){var e,s=this.shapeModifiers.length;for(e=0;e<s;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,s=0,i=e.length;s<i;){if(e[s].elem===t)return e[s].pos;s+=1}return 0},addProcessedElement:function(t,e){for(var s=this.processedElements,i=s.length;i;)if(s[i-=1].elem===t)return void(s[i].pos=e);s.push(new qt(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ee.prototype.initElement=function(t,e,s){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,s),this.textProperty=new vt(this,t.t,this.dynamicProperties),this.textAnimator=new ut(t.t,this.renderType,this),this.initTransform(t,e,s),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ee.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ee.prototype.createPathShape=function(t,e){var s,i,a=e.length,r="";for(s=0;s<a;s+=1)i=e[s].ks.k,r+=rt(i,i.i.length,!0,t);return r},ee.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ee.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ee.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ee.prototype.applyTextPropertiesToMatrix=function(t,e,s,i,a){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[s])/2,0,0)}e.translate(i,a,0)},ee.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ee.prototype.emptyProp=new yt,ee.prototype.destroy=function(){},B([Jt,Rt,zt,Vt,Ot],se),se.prototype.initElement=function(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initTransform(t,e,s),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},se.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var s,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),s=i-1;0<=s;s-=1)(this.completeLayers||this.elements[s])&&(this.elements[s].prepareFrame(this.renderedFrame-this.layers[s].st),this.elements[s]._mdf&&(this._mdf=!0))}},se.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},se.prototype.setElements=function(t){this.elements=t},se.prototype.getElements=function(){return this.elements},se.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},se.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},B([Jt,Rt,$t,zt,Vt,Ot],ie),ie.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=E("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},ie.prototype.sourceRectAtTime=function(){return this.sourceRect},B([ie],ae),ae.prototype.createContent=function(){var t=E("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},re.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},B([Nt,Jt,Vt],re),re.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},re.prototype.show=function(){},re.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},re.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},re.prototype.resume=function(){this._canPlay=!0},re.prototype.setRate=function(t){this.audio.rate(t)},re.prototype.volume=function(t){this.audio.volume(t)},re.prototype.getBaseElement=function(){return null},re.prototype.destroy=function(){},re.prototype.sourceRectAtTime=function(){},re.prototype.initExpressions=function(){},B([It,se,$t],ne),B([Jt,Rt,$t,zt,Vt,Ot,ee],he),he.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=E("text"))},he.prototype.buildTextContents=function(t){for(var e=0,s=t.length,i=[],a="";e<s;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(a),a=""):a+=t[e],e+=1;return i.push(a),i},he.prototype.buildNewText=function(){var t,e,s=this.textProperty.currentData;this.renderedLetters=S(s?s.l.length:0),s.fc?this.layerElement.setAttribute("fill",this.buildColor(s.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),s.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(s.sc)),this.layerElement.setAttribute("stroke-width",s.sw)),this.layerElement.setAttribute("font-size",s.finalSize);var i=this.globalData.fontManager.getFontByName(s.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var a=s.fWeight,r=s.fStyle;this.layerElement.setAttribute("font-style",r),this.layerElement.setAttribute("font-weight",a)}this.layerElement.setAttribute("aria-label",s.t);var n,h=s.l||[],o=!!this.globalData.fontManager.chars;e=h.length;var l,p=this.mHelper,f="",m=this.data.singleShape,d=0,c=0,u=!0,g=.001*s.tr*s.finalSize;if(!m||o||s.sz){var y,v,b=this.textSpans.length;for(t=0;t<e;t+=1)o&&m&&0!==t||(n=t<b?this.textSpans[t]:E(o?"path":"text"),b<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(s.finalSize/100,s.finalSize/100),m&&(h[t].n&&(d=-g,c+=s.yOffset,c+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(s,p,h[t].line,d,c),d+=h[t].l||0,d+=g),o?(l=(y=(v=this.globalData.fontManager.getCharData(s.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(s.f).fFamily))&&v.data||{}).shapes?y.shapes[0].it:[],m?f+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(m&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=h[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&n&&n.setAttribute("d",f)}else{var _=this.textContainer,k="start";switch(s.j){case 1:k="end";break;case 2:k="middle";break;default:k="start"}_.setAttribute("text-anchor",k),_.setAttribute("letter-spacing",g);var x=this.buildTextContents(s.finalText);for(e=x.length,c=s.ps?s.ps[1]+s.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||E("tspan")).textContent=x[t],n.setAttribute("x",0),n.setAttribute("y",c),n.style.display="inherit",_.appendChild(n),this.textSpans[t]=n,c+=s.finalLineHeight;this.layerElement.appendChild(_)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},he.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var t=this.layerElement.getBBox();this.bbox={top:t.y,left:t.x,width:t.width,height:t.height}}return this.bbox},he.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var s,i,a=this.textAnimator.renderedLetters,r=this.textProperty.currentData.l;for(e=r.length,t=0;t<e;t+=1)r[t].n||(s=a[t],i=this.textSpans[t],s._mdf.m&&i.setAttribute("transform",s.m),s._mdf.o&&i.setAttribute("opacity",s.o),s._mdf.sw&&i.setAttribute("stroke-width",s.sw),s._mdf.sc&&i.setAttribute("stroke",s.sc),s._mdf.fc&&i.setAttribute("fill",s.fc))}},B([Jt,Rt,$t,te,zt,Vt,Ot],oe),oe.prototype.initSecondaryElement=function(){},oe.prototype.identityMatrix=new L,oe.prototype.buildExpressionInterface=function(){},oe.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},oe.prototype.filterUniqueShapes=function(){var t,e,s,i,a=this.shapes.length,r=this.stylesList.length,n=[],h=!1;for(s=0;s<r;s+=1){for(i=this.stylesList[s],h=!1,t=n.length=0;t<a;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),h=e._isAnimated||h);1<n.length&&h&&this.setShapesAsAnimated(n)}},oe.prototype.setShapesAsAnimated=function(t){var e,s=t.length;for(e=0;e<s;e+=1)t[e].setAsAnimated()},oe.prototype.createStyleElement=function(t,e){var s,i=new jt(t,e),a=i.pElem;if("st"===t.ty)s=new Yt(this,t,i);else if("fl"===t.ty)s=new Ht(this,t,i);else if("gf"===t.ty||"gs"===t.ty){s=new("gf"===t.ty?Gt:Kt)(this,t,i),this.globalData.defs.appendChild(s.gf),s.maskId&&(this.globalData.defs.appendChild(s.ms),this.globalData.defs.appendChild(s.of),a.setAttribute("mask","url("+x+"#"+s.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(a.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),a.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),a.setAttribute("fill-opacity","0"),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&a.setAttribute("fill-rule","evenodd"),t.ln&&a.setAttribute("id",t.ln),t.cl&&a.setAttribute("class",t.cl),t.bm&&(a.style["mix-blend-mode"]=I(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,s),s},oe.prototype.createGroupElement=function(t){var e=new Ut;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=I(t.bm)),e},oe.prototype.createTransformElement=function(t,e){var s=N.getTransformProperty(this,t,this),i=new Xt(s,s.o,e);return this.addToAnimatedContents(t,i),i},oe.prototype.createShapeElement=function(t,e,s){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var a=new Wt(e,s,G.getShapeProp(this,t,i,this));return this.shapes.push(a),this.addShapeToModifiers(a),this.addToAnimatedContents(t,a),a},oe.prototype.addToAnimatedContents=function(t,e){for(var s=0,i=this.animatedContents.length;s<i;){if(this.animatedContents[s].element===e)return;s+=1}this.animatedContents.push({fn:Zt.createRenderFunction(t),element:e,data:t})},oe.prototype.setElementStyles=function(t){var e,s=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||s.push(this.stylesList[e])},oe.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},oe.prototype.searchShapes=function(t,e,s,i,a,r,n){var h,o,l,p,f,m,d=[].concat(r),c=t.length-1,u=[],g=[];for(h=c;0<=h;h-=1){if((m=this.searchProcessedElement(t[h]))?e[h]=s[m-1]:t[h]._render=n,"fl"===t[h].ty||"st"===t[h].ty||"gf"===t[h].ty||"gs"===t[h].ty)m?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],a),t[h]._render&&i.appendChild(e[h].style.pElem),u.push(e[h].style);else if("gr"===t[h].ty){if(m)for(l=e[h].it.length,o=0;o<l;o+=1)e[h].prevViewData[o]=e[h].it[o];else e[h]=this.createGroupElement(t[h]);this.searchShapes(t[h].it,e[h].it,e[h].prevViewData,e[h].gr,a+1,d,n),t[h]._render&&i.appendChild(e[h].gr)}else"tr"===t[h].ty?(m||(e[h]=this.createTransformElement(t[h],i)),p=e[h].transform,d.push(p)):"sh"===t[h].ty||"rc"===t[h].ty||"el"===t[h].ty||"sr"===t[h].ty?(m||(e[h]=this.createShapeElement(t[h],d,a)),this.setElementStyles(e[h])):"tm"===t[h].ty||"rd"===t[h].ty||"ms"===t[h].ty||"pb"===t[h].ty?(m?(f=e[h]).closed=!1:((f=K.getModifier(t[h].ty)).init(this,t[h]),e[h]=f,this.shapeModifiers.push(f)),g.push(f)):"rp"===t[h].ty&&(m?(f=e[h]).closed=!0:(f=K.getModifier(t[h].ty),(e[h]=f).init(this,t,h,e),this.shapeModifiers.push(f),n=!1),g.push(f));this.addProcessedElement(t[h],h+1)}for(c=u.length,h=0;h<c;h+=1)u[h].closed=!0;for(c=g.length,h=0;h<c;h+=1)g[h].closed=!0},oe.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},oe.prototype.renderShape=function(){var t,e,s=this.animatedContents.length;for(t=0;t<s;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},oe.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null};var le=[];function pe(){}function fe(){}function me(){}function de(t,e,s){this.initElement(t,e,s)}function ce(t,e,s){this.layers=t.layers,this.supports3d=!t.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?S(this.layers.length):[],this.initElement(t,e,s),this.tm=t.tm?R.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function ue(t,e,s){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=E("g"),this.initElement(t,e,s),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function ge(t,e,s){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(t,e,s)}function ye(t,e,s){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,s)}function ve(t,e,s){this.initFrame(),this.initBaseData(t,e,s),this.initHierarchy();var i=R.getProp;if(this.pe=i(this,t.pe,0,0,this),t.ks.p.s?(this.px=i(this,t.ks.p.x,1,0,this),this.py=i(this,t.ks.p.y,1,0,this),this.pz=i(this,t.ks.p.z,1,0,this)):this.p=i(this,t.ks.p,1,0,this),t.ks.a&&(this.a=i(this,t.ks.a,1,0,this)),t.ks.or.k.length&&t.ks.or.k[0].to){var a,r=t.ks.or.k.length;for(a=0;a<r;a+=1)t.ks.or.k[a].to=null,t.ks.or.k[a].ti=null}this.or=i(this,t.ks.or,1,q,this),this.or.sh=!0,this.rx=i(this,t.ks.rx,0,q,this),this.ry=i(this,t.ks.ry,0,q,this),this.rz=i(this,t.ks.rz,0,q,this),this.mat=new L,this._prevMat=new L,this._isFirstFrame=!0,this.finalTransform={mProp:this}}fe.prototype.renderFrame=function(){},(me.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=T(this.data.tg||"div"),this.data.hasMask?(this.svgElement=E("svg"),this.layerElement=E("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,A(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new fe(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new Bt(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}}).getBaseElement=$t.prototype.getBaseElement,me.prototype.destroyBaseElement=me.prototype.destroy,me.prototype.buildElementParenting=Lt.prototype.buildElementParenting,B([Jt,Rt,me,zt,Vt,Ot],de),de.prototype.createContent=function(){var t;this.data.hasMask?((t=E("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=T("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},B([Lt,se,me],ce),ce.prototype._createBaseContainerElements=ce.prototype.createContainerElements,ce.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},ce.prototype.addTo3dContainer=function(t,e){for(var s,i=0;i<e;)this.elements[i]&&this.elements[i].getBaseElement&&(s=this.elements[i].getBaseElement()),i+=1;s?this.layerElement.insertBefore(t,s):this.layerElement.appendChild(t)},B([Jt,Rt,de,oe,me,zt,Vt,Nt],ue),ue.prototype._renderShapeFrame=ue.prototype.renderInnerContent,ue.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=E("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},ue.prototype.getTransformedPoint=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)e=t[s].mProps.v.applyToPointArray(e[0],e[1],0);return e},ue.prototype.calculateShapeBoundingBox=function(t,e){var s,i,a,r,n,h=t.sh.v,o=t.transformers,l=h._length;if(!(l<=1)){for(s=0;s<l-1;s+=1)i=this.getTransformedPoint(o,h.v[s]),a=this.getTransformedPoint(o,h.o[s]),r=this.getTransformedPoint(o,h.i[s+1]),n=this.getTransformedPoint(o,h.v[s+1]),this.checkBounds(i,a,r,n,e);h.c&&(i=this.getTransformedPoint(o,h.v[s]),a=this.getTransformedPoint(o,h.o[s]),r=this.getTransformedPoint(o,h.i[0]),n=this.getTransformedPoint(o,h.v[0]),this.checkBounds(i,a,r,n,e))}},ue.prototype.checkBounds=function(t,e,s,i,a){this.getBoundsOfCurve(t,e,s,i);var r=this.shapeBoundingBox;a.x=c(r.left,a.x),a.xMax=d(r.right,a.xMax),a.y=c(r.top,a.y),a.yMax=d(r.bottom,a.yMax)},ue.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},ue.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},ue.prototype.getBoundsOfCurve=function(t,e,s,i){for(var a,r,n,h,o,l,p,f=[[t[0],i[0]],[t[1],i[1]]],m=0;m<2;++m)r=6*t[m]-12*e[m]+6*s[m],a=-3*t[m]+9*e[m]-9*s[m]+3*i[m],n=3*e[m]-3*t[m],r|=0,n|=0,0===(a|=0)&&0===r||(0===a?0<(h=-n/r)&&h<1&&f[m].push(this.calculateF(h,t,e,s,i,m)):0<=(o=r*r-4*n*a)&&(0<(l=(-r+k(o))/(2*a))&&l<1&&f[m].push(this.calculateF(l,t,e,s,i,m)),0<(p=(-r-k(o))/(2*a))&&p<1&&f[m].push(this.calculateF(p,t,e,s,i,m))));this.shapeBoundingBox.left=c.apply(null,f[0]),this.shapeBoundingBox.top=c.apply(null,f[1]),this.shapeBoundingBox.right=d.apply(null,f[0]),this.shapeBoundingBox.bottom=d.apply(null,f[1])},ue.prototype.calculateF=function(t,e,s,i,a,r){return _(1-t,3)*e[r]+3*_(1-t,2)*t*s[r]+3*(1-t)*_(t,2)*i[r]+_(t,3)*a[r]},ue.prototype.calculateBoundingBox=function(t,e){var s,i=t.length;for(s=0;s<i;s+=1)t[s]&&t[s].sh?this.calculateShapeBoundingBox(t[s],e):t[s]&&t[s].it&&this.calculateBoundingBox(t[s].it,e)},ue.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},ue.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax<t.x?0:t.xMax-t.x,t.height=t.yMax<t.y?0:t.yMax-t.y,this.currentBoxContains(t))return;var s=!1;if(this.currentBBox.w!==t.width&&(this.currentBBox.w=t.width,this.shapeCont.setAttribute("width",t.width),s=!0),this.currentBBox.h!==t.height&&(this.currentBBox.h=t.height,this.shapeCont.setAttribute("height",t.height),s=!0),s||this.currentBBox.x!==t.x||this.currentBBox.y!==t.y){this.currentBBox.w=t.width,this.currentBBox.h=t.height,this.currentBBox.x=t.x,this.currentBBox.y=t.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var i=this.shapeCont.style,a="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";i.transform=a,i.webkitTransform=a}}},B([Jt,Rt,me,zt,Vt,Ot,ee],ge),ge.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var t=E("g");this.maskedElement.appendChild(t),this.innerElem=t}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},ge.prototype.buildNewText=function(){var t=this.textProperty.currentData;this.renderedLetters=S(t.l?t.l.length:0);var e=this.innerElem.style,s=t.fc?this.buildColor(t.fc):"rgba(0,0,0,0)";e.fill=s,e.color=s,t.sc&&(e.stroke=this.buildColor(t.sc),e.strokeWidth=t.sw+"px");var i,a,r=this.globalData.fontManager.getFontByName(t.f);if(!this.globalData.fontManager.chars)if(e.fontSize=t.finalSize+"px",e.lineHeight=t.finalSize+"px",r.fClass)this.innerElem.className=r.fClass;else{e.fontFamily=r.fFamily;var n=t.fWeight,h=t.fStyle;e.fontStyle=h,e.fontWeight=n}var o,l,p,f=t.l;a=f.length;var m,d=this.mHelper,c="",u=0;for(i=0;i<a;i+=1){if(this.globalData.fontManager.chars?(this.textPaths[u]?o=this.textPaths[u]:((o=E("path")).setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[u]?p=(l=this.textSpans[u]).children[0]:((l=T("div")).style.lineHeight=0,(p=E("svg")).appendChild(o),A(l)))):this.isMasked?o=this.textPaths[u]?this.textPaths[u]:E("text"):this.textSpans[u]?(l=this.textSpans[u],o=this.textPaths[u]):(A(l=T("span")),A(o=T("span")),l.appendChild(o)),this.globalData.fontManager.chars){var g,y=this.globalData.fontManager.getCharData(t.finalText[i],r.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);if(g=y?y.data:null,d.reset(),g&&g.shapes&&(m=g.shapes[0].it,d.scale(t.finalSize/100,t.finalSize/100),c=this.createPathShape(d,m),o.setAttribute("d",c)),this.isMasked)this.innerElem.appendChild(o);else{if(this.innerElem.appendChild(l),g&&g.shapes){document.body.appendChild(p);var v=p.getBBox();p.setAttribute("width",v.width+2),p.setAttribute("height",v.height+2),p.setAttribute("viewBox",v.x-1+" "+(v.y-1)+" "+(v.width+2)+" "+(v.height+2));var b=p.style,_="translate("+(v.x-1)+"px,"+(v.y-1)+"px)";b.transform=_,b.webkitTransform=_,f[i].yOffset=v.y-1}else p.setAttribute("width",1),p.setAttribute("height",1);l.appendChild(p)}}else if(o.textContent=f[i].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(o);else{this.innerElem.appendChild(l);var k=o.style,x="translate3d(0,"+-t.finalSize/1.2+"px,0)";k.transform=x,k.webkitTransform=x}this.isMasked?this.textSpans[u]=o:this.textSpans[u]=l,this.textSpans[u].style.display="block",this.textPaths[u]=o,u+=1}for(;u<this.textSpans.length;)this.textSpans[u].style.display="none",u+=1},ge.prototype.renderInnerContent=function(){var t;if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),t=this.svgElement.style;var e="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";t.transform=e,t.webkitTransform=e}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var s,i,a,r,n,h=0,o=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;for(i=l.length,s=0;s<i;s+=1)l[s].n?h+=1:(r=this.textSpans[s],n=this.textPaths[s],a=o[h],h+=1,a._mdf.m&&(this.isMasked?r.setAttribute("transform",a.m):(r.style.webkitTransform=a.m,r.style.transform=a.m)),r.style.opacity=a.o,a.sw&&a._mdf.sw&&n.setAttribute("stroke-width",a.sw),a.sc&&a._mdf.sc&&n.setAttribute("stroke",a.sc),a.fc&&a._mdf.fc&&(n.setAttribute("fill",a.fc),n.style.color=a.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var p=this.innerElem.getBBox();this.currentBBox.w!==p.width&&(this.currentBBox.w=p.width,this.svgElement.setAttribute("width",p.width)),this.currentBBox.h!==p.height&&(this.currentBBox.h=p.height,this.svgElement.setAttribute("height",p.height));if(this.currentBBox.w!==p.width+2||this.currentBBox.h!==p.height+2||this.currentBBox.x!==p.x-1||this.currentBBox.y!==p.y-1){this.currentBBox.w=p.width+2,this.currentBBox.h=p.height+2,this.currentBBox.x=p.x-1,this.currentBBox.y=p.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),t=this.svgElement.style;var f="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";t.transform=f,t.webkitTransform=f}}}},B([Jt,Rt,me,de,zt,Vt,Nt],ye),ye.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=E("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=t,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},B([Jt,Vt,zt],ve),ve.prototype.setup=function(){var t,e,s,i,a=this.comp.threeDElements.length;for(t=0;t<a;t+=1)if("3d"===(e=this.comp.threeDElements[t]).type){s=e.perspectiveElem.style,i=e.container.style;var r=this.pe.v+"px",n="0px 0px 0px",h="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";s.perspective=r,s.webkitPerspective=r,i.transformOrigin=n,i.mozTransformOrigin=n,i.webkitTransformOrigin=n,s.transform=h,s.webkitTransform=h}},ve.prototype.createElements=function(){},ve.prototype.hide=function(){},ve.prototype.renderFrame=function(){var t,e,s=this._isFirstFrame;if(this.hierarchy)for(e=this.hierarchy.length,t=0;t<e;t+=1)s=this.hierarchy[t].finalTransform.mProp._mdf||s;if(s||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){if(this.mat.reset(),this.hierarchy)for(t=e=this.hierarchy.length-1;0<=t;t-=1){var i=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-i.p.v[0],-i.p.v[1],i.p.v[2]),this.mat.rotateX(-i.or.v[0]).rotateY(-i.or.v[1]).rotateZ(i.or.v[2]),this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v),this.mat.scale(1/i.s.v[0],1/i.s.v[1],1/i.s.v[2]),this.mat.translate(i.a.v[0],i.a.v[1],i.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var a;a=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var r=Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)),n=[a[0]/r,a[1]/r,a[2]/r],h=Math.sqrt(n[2]*n[2]+n[0]*n[0]),o=Math.atan2(n[1],h),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-o)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var f,m,d;for(e=this.comp.threeDElements.length,t=0;t<e;t+=1)if("3d"===(f=this.comp.threeDElements[t]).type){if(p){var c=this.mat.toCSS();(d=f.container.style).transform=c,d.webkitTransform=c}this.pe._mdf&&((m=f.perspectiveElem.style).perspective=this.pe.v+"px",m.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},ve.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},ve.prototype.destroy=function(){},ve.prototype.getBaseElement=function(){return null};var be=function(){var t={},a=[],i=0,r=0,n=0,h=!0,o=!1;function s(t){for(var e=0,s=t.target;e<r;)a[e].animation===s&&(a.splice(e,1),e-=1,r-=1,s.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var s=0;s<r;){if(a[s].elem===t&&null!==a[s].elem)return a[s].animation;s+=1}var i=new _e;return m(i,t),i.setData(t,e),i}function p(){n+=1,c()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",s),t.addEventListener("_active",p),t.addEventListener("_idle",f),a.push({elem:e,animation:t}),r+=1}function d(t){var e,s=t-i;for(e=0;e<r;e+=1)a[e].animation.advanceTime(s);i=t,n&&!o?window.requestAnimationFrame(d):h=!0}function e(t){i=t,window.requestAnimationFrame(d)}function c(){!o&&n&&h&&(window.requestAnimationFrame(e),h=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new _e;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setSpeed(t,e)},t.setDirection=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.togglePause(t)},t.searchAnimations=function(t,e,s){var i,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),r=a.length;for(i=0;i<r;i+=1)s&&a[i].setAttribute("data-bm-type",s),l(a[i],t);if(e&&0===r){s||(s="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var h=T("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",s),n.appendChild(h),l(h,t)}},t.resize=function(){var t;for(t=0;t<r;t+=1)a[t].animation.resize()},t.goToAndStop=function(t,e,s){var i;for(i=0;i<r;i+=1)a[i].animation.goToAndStop(t,e,s)},t.destroy=function(t){var e;for(e=r-1;0<=e;e-=1)a[e].animation.destroy(t)},t.freeze=function(){o=!0},t.unfreeze=function(){o=!1,c()},t.setVolume=function(t,e){var s;for(s=0;s<r;s+=1)a[s].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<r;e+=1)a[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=a.length,s=[];for(t=0;t<e;t+=1)s.push(a[t].animation);return s},t}(),_e=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=P(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=i,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface={},this.imagePreloader=new ht,this.audioController=nt()};function ke(){this.effectElements=[]}B([D],_e),_e.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new It(this,t.rendererSettings);break;default:this.renderer=new Lt(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),ct.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},_e.prototype.setData=function(t,e){e&&"object"!=typeof e&&(e=JSON.parse(e));var s={wrapper:t,animationData:e},i=t.attributes;s.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",s.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";"false"===a?s.loop=!1:"true"===a?s.loop=!0:""!==a&&(s.loop=parseInt(a,10));var r=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;s.autoplay="false"!==r,s.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(s.prerender=!1),this.setParams(s)},_e.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,s,i=this.animationData.layers,a=i.length,r=t.layers,n=r.length;for(s=0;s<n;s+=1)for(e=0;e<a;){if(i[e].id===r[s].id){i[e]=r[s];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,z.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),h&&h.initExpressions(this),this.loadNextSegment()},_e.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,ct.load(s,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},_e.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},_e.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},_e.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},_e.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},_e.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},_e.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,z.completeData(this.animationData,this.renderer.globalData.fontManager),h&&h.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},_e.prototype.resize=function(){this.renderer.updateContainerSize()},_e.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},_e.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},_e.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},_e.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},_e.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},_e.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},_e.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},_e.prototype.goToAndStop=function(t,e,s){s&&this.name!==s||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},_e.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},_e.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,s=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(s=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(s=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),s&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},_e.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},_e.prototype.setSegment=function(t,e){var s=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?s=t:this.currentRawFrame+this.firstFrame>e&&(s=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==s&&this.goToAndStop(s,!0)},_e.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var s,i=t.length;for(s=0;s<i;s+=1)this.segments.push(t[s])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},_e.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},_e.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},_e.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},_e.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},_e.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},_e.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},_e.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},_e.prototype.getVolume=function(){return this.audioController.getVolume()},_e.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},_e.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},_e.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},_e.prototype.getPath=function(){return this.path},_e.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),e=this.assetsPath+s}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},_e.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;e<s;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},_e.prototype.hide=function(){this.renderer.hide()},_e.prototype.show=function(){this.renderer.show()},_e.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},_e.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new o(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new p(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new l(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new m(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new u(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new o(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new p(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new l(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new m(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new u(t,this))},_e.prototype.triggerRenderFrameError=function(t){var e=new g(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},_e.prototype.triggerConfigError=function(t){var e=new y(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var lottie={};function xe(){!0===Ae?be.searchAnimations(Pe,Ae,Ce):be.searchAnimations()}lottie.play=be.play,lottie.pause=be.pause,lottie.setLocationHref=function(t){x=t},lottie.togglePause=be.togglePause,lottie.setSpeed=be.setSpeed,lottie.setDirection=be.setDirection,lottie.stop=be.stop,lottie.searchAnimations=xe,lottie.registerAnimation=be.registerAnimation,lottie.loadAnimation=function(t){return!0===Ae&&(t.animationData=JSON.parse(Pe)),be.loadAnimation(t)},lottie.setSubframeRendering=function(t){i=t},lottie.resize=be.resize,lottie.goToAndStop=be.goToAndStop,lottie.destroy=be.destroy,lottie.setQuality=function(t){if("string"==typeof t)switch(t){case"high":w=200;break;default:case"medium":w=50;break;case"low":w=10}else!isNaN(t)&&1<t&&(w=t);r(!(50<=w))},lottie.inBrowser=function(){return"undefined"!=typeof navigator},lottie.installPlugin=function(t,e){"expressions"===t&&(h=e)},lottie.freeze=be.freeze,lottie.unfreeze=be.unfreeze,lottie.setVolume=be.setVolume,lottie.mute=be.mute,lottie.unmute=be.unmute,lottie.getRegisteredAnimations=be.getRegisteredAnimations,lottie.__getFactory=function(t){switch(t){case"propertyFactory":return R;case"shapePropertyFactory":return G;case"matrix":return L;default:return null}},lottie.version="5.7.6";var we,Ae="__[STANDALONE]__",Pe="__[ANIMATIONDATA]__",Ce="";if(Ae){var De=document.getElementsByTagName("script"),Se=De[De.length-1]||{src:""};we=Se.src.replace(/^[^\?]+\??/,""),Ce=function(t){for(var e=we.split("&"),s=0;s<e.length;s+=1){var i=e[s].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}return null}("renderer")}var Ee=setInterval(function(){"complete"===document.readyState&&(clearInterval(Ee),xe())},100);
 return lottie;
 }));
\ No newline at end of file
diff --git a/build/player/lottie_svg.js b/build/player/lottie_svg.js
index f462697..0be68e7 100644
--- a/build/player/lottie_svg.js
+++ b/build/player/lottie_svg.js
@@ -10,364 +10,407 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";
-var svgNS = "http://www.w3.org/2000/svg";
+	/* global locationHref:writable, animationManager, subframeEnabled:writable, defaultCurveSegments:writable, roundValues,
+expressionsPlugin:writable, PropertyFactory, ShapePropertyFactory, Matrix */
+/* exported locationHref, subframeEnabled, expressionsPlugin */
+
+'use strict';
+
+/* exported svgNS, locationHref, initialDefaultFrame */
+
+var svgNS = 'http://www.w3.org/2000/svg';
 
 var locationHref = '';
 
 var initialDefaultFrame = -999999;
 
+/* global createSizedArray */
+/* exported subframeEnabled, expressionsPlugin, isSafari, cachedColors, bmPow, bmSqrt, bmFloor, bmMax, bmMin, ProjectInterface,
+defaultCurveSegments, degToRads, roundCorner, bmRnd, styleDiv, BMEnterFrameEvent, BMCompleteEvent, BMCompleteLoopEvent,
+BMSegmentStartEvent, BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent, BMAnimationConfigErrorEvent, createElementID,
+addSaturationToRGB, addBrightnessToRGB, addHueToRGB, rgbToHex */
+
 var subframeEnabled = true;
 var expressionsPlugin;
 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
 var cachedColors = {};
-var bm_rounder = Math.round;
-var bm_rnd;
-var bm_pow = Math.pow;
-var bm_sqrt = Math.sqrt;
-var bm_abs = Math.abs;
-var bm_floor = Math.floor;
-var bm_max = Math.max;
-var bm_min = Math.min;
-var blitter = 10;
+var bmRnd;
+var bmPow = Math.pow;
+var bmSqrt = Math.sqrt;
+var bmFloor = Math.floor;
+var bmMax = Math.max;
+var bmMin = Math.min;
 
 var BMMath = {};
-(function(){
-    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"];
-    var i, len = propertyNames.length;
-    for(i=0;i<len;i+=1){
-        BMMath[propertyNames[i]] = Math[propertyNames[i]];
-    }
+(function () {
+  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'];
+  var i;
+  var len = propertyNames.length;
+  for (i = 0; i < len; i += 1) {
+    BMMath[propertyNames[i]] = Math[propertyNames[i]];
+  }
 }());
 
-function ProjectInterface(){return {};}
+function ProjectInterface() { return {}; }
 
 BMMath.random = Math.random;
-BMMath.abs = function(val){
-    var tOfVal = typeof val;
-    if(tOfVal === 'object' && val.length){
-        var absArr = createSizedArray(val.length);
-        var i, len = val.length;
-        for(i=0;i<len;i+=1){
-            absArr[i] = Math.abs(val[i]);
-        }
-        return absArr;
+BMMath.abs = function (val) {
+  var tOfVal = typeof val;
+  if (tOfVal === 'object' && val.length) {
+    var absArr = createSizedArray(val.length);
+    var i;
+    var len = val.length;
+    for (i = 0; i < len; i += 1) {
+      absArr[i] = Math.abs(val[i]);
     }
-    return Math.abs(val);
-
+    return absArr;
+  }
+  return Math.abs(val);
 };
 var defaultCurveSegments = 150;
-var degToRads = Math.PI/180;
+var degToRads = Math.PI / 180;
 var roundCorner = 0.5519;
 
-function roundValues(flag){
-    if(flag){
-        bm_rnd = Math.round;
-    }else{
-        bm_rnd = function(val){
-            return val;
-        };
-    }
+function roundValues(flag) {
+  if (flag) {
+    bmRnd = Math.round;
+  } else {
+    bmRnd = function (val) {
+      return val;
+    };
+  }
 }
 roundValues(false);
 
-function styleDiv(element){
-    element.style.position = 'absolute';
-    element.style.top = 0;
-    element.style.left = 0;
-    element.style.display = 'block';
-    element.style.transformOrigin = element.style.webkitTransformOrigin = '0 0';
-    element.style.backfaceVisibility  = element.style.webkitBackfaceVisibility = 'visible';
-    element.style.transformStyle = element.style.webkitTransformStyle = element.style.mozTransformStyle = "preserve-3d";
+function styleDiv(element) {
+  element.style.position = 'absolute';
+  element.style.top = 0;
+  element.style.left = 0;
+  element.style.display = 'block';
+  element.style.transformOrigin = '0 0';
+  element.style.webkitTransformOrigin = '0 0';
+  element.style.backfaceVisibility = 'visible';
+  element.style.webkitBackfaceVisibility = 'visible';
+  element.style.transformStyle = 'preserve-3d';
+  element.style.webkitTransformStyle = 'preserve-3d';
+  element.style.mozTransformStyle = 'preserve-3d';
 }
 
-function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier){
-    this.type = type;
-    this.currentTime = currentTime;
-    this.totalTime = totalTime;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
+  this.type = type;
+  this.currentTime = currentTime;
+  this.totalTime = totalTime;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteEvent(type, frameMultiplier){
-    this.type = type;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteEvent(type, frameMultiplier) {
+  this.type = type;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier){
-    this.type = type;
-    this.currentLoop = currentLoop;
-    this.totalLoops = totalLoops;
-    this.direction = frameMultiplier < 0 ? -1 : 1;
+function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
+  this.type = type;
+  this.currentLoop = currentLoop;
+  this.totalLoops = totalLoops;
+  this.direction = frameMultiplier < 0 ? -1 : 1;
 }
 
-function BMSegmentStartEvent(type, firstFrame, totalFrames){
-    this.type = type;
-    this.firstFrame = firstFrame;
-    this.totalFrames = totalFrames;
+function BMSegmentStartEvent(type, firstFrame, totalFrames) {
+  this.type = type;
+  this.firstFrame = firstFrame;
+  this.totalFrames = totalFrames;
 }
 
-function BMDestroyEvent(type, target){
-    this.type = type;
-    this.target = target;
+function BMDestroyEvent(type, target) {
+  this.type = type;
+  this.target = target;
 }
 
 function BMRenderFrameErrorEvent(nativeError, currentTime) {
-    this.type = 'renderFrameError';
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = 'renderFrameError';
+  this.nativeError = nativeError;
+  this.currentTime = currentTime;
 }
 
 function BMConfigErrorEvent(nativeError) {
-    this.type = 'configError';
-    this.nativeError = nativeError;
+  this.type = 'configError';
+  this.nativeError = nativeError;
 }
 
 function BMAnimationConfigErrorEvent(type, nativeError) {
-    this.type = type;
-    this.nativeError = nativeError;
-    this.currentTime = currentTime;
+  this.type = type;
+  this.nativeError = nativeError;
 }
 
-var createElementID = (function(){
-    var _count = 0;
-    return function createID() {
-        return '__lottie_element_' + ++_count
-    }
-}())
+var createElementID = (function () {
+  var _count = 0;
+  return function createID() {
+    _count += 1;
+    return '__lottie_element_' + _count;
+  };
+}());
 
 function HSVtoRGB(h, s, v) {
-    var r, g, b, i, f, p, q, t;
-    i = Math.floor(h * 6);
-    f = h * 6 - i;
-    p = v * (1 - s);
-    q = v * (1 - f * s);
-    t = v * (1 - (1 - f) * s);
-    switch (i % 6) {
-        case 0: r = v; g = t; b = p; break;
-        case 1: r = q; g = v; b = p; break;
-        case 2: r = p; g = v; b = t; break;
-        case 3: r = p; g = q; b = v; break;
-        case 4: r = t; g = p; b = v; break;
-        case 5: r = v; g = p; b = q; break;
-    }
-    return [ r,
-        g,
-         b ];
+  var r;
+  var g;
+  var b;
+  var i;
+  var f;
+  var p;
+  var q;
+  var t;
+  i = Math.floor(h * 6);
+  f = h * 6 - i;
+  p = v * (1 - s);
+  q = v * (1 - f * s);
+  t = v * (1 - (1 - f) * s);
+  switch (i % 6) {
+    case 0: r = v; g = t; b = p; break;
+    case 1: r = q; g = v; b = p; break;
+    case 2: r = p; g = v; b = t; break;
+    case 3: r = p; g = q; b = v; break;
+    case 4: r = t; g = p; b = v; break;
+    case 5: r = v; g = p; b = q; break;
+    default: break;
+  }
+  return [r,
+    g,
+    b];
 }
 
 function RGBtoHSV(r, g, b) {
-    var max = Math.max(r, g, b), min = Math.min(r, g, b),
-        d = max - min,
-        h,
-        s = (max === 0 ? 0 : d / max),
-        v = max / 255;
+  var max = Math.max(r, g, b);
+  var min = Math.min(r, g, b);
+  var d = max - min;
+  var h;
+  var s = (max === 0 ? 0 : d / max);
+  var v = max / 255;
 
-    switch (max) {
-        case min: h = 0; break;
-        case r: h = (g - b) + d * (g < b ? 6: 0); h /= 6 * d; break;
-        case g: h = (b - r) + d * 2; h /= 6 * d; break;
-        case b: h = (r - g) + d * 4; h /= 6 * d; break;
-    }
+  switch (max) {
+    case min: h = 0; break;
+    case r: h = (g - b) + d * (g < b ? 6 : 0); h /= 6 * d; break;
+    case g: h = (b - r) + d * 2; h /= 6 * d; break;
+    case b: h = (r - g) + d * 4; h /= 6 * d; break;
+    default: break;
+  }
 
-    return [
-         h,
-         s,
-         v
-    ];
+  return [
+    h,
+    s,
+    v,
+  ];
 }
 
-function addSaturationToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[1] += offset;
-    if (hsv[1] > 1) {
-        hsv[1] = 1;
-    }
-    else if (hsv[1] <= 0) {
-        hsv[1] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addSaturationToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[1] += offset;
+  if (hsv[1] > 1) {
+    hsv[1] = 1;
+  } else if (hsv[1] <= 0) {
+    hsv[1] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addBrightnessToRGB(color,offset){
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[2] += offset;
-    if (hsv[2] > 1) {
-        hsv[2] = 1;
-    }
-    else if (hsv[2] < 0) {
-        hsv[2] = 0;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addBrightnessToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[2] += offset;
+  if (hsv[2] > 1) {
+    hsv[2] = 1;
+  } else if (hsv[2] < 0) {
+    hsv[2] = 0;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-function addHueToRGB(color,offset) {
-    var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255);
-    hsv[0] += offset/360;
-    if (hsv[0] > 1) {
-        hsv[0] -= 1;
-    }
-    else if (hsv[0] < 0) {
-        hsv[0] += 1;
-    }
-    return HSVtoRGB(hsv[0],hsv[1],hsv[2]);
+function addHueToRGB(color, offset) {
+  var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
+  hsv[0] += offset / 360;
+  if (hsv[0] > 1) {
+    hsv[0] -= 1;
+  } else if (hsv[0] < 0) {
+    hsv[0] += 1;
+  }
+  return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
 }
 
-var rgbToHex = (function(){
-    var colorMap = [];
-    var i;
-    var hex;
-    for(i=0;i<256;i+=1){
-        hex = i.toString(16);
-        colorMap[i] = hex.length == 1 ? '0' + hex : hex;
-    }
+var rgbToHex = (function () {
+  var colorMap = [];
+  var i;
+  var hex;
+  for (i = 0; i < 256; i += 1) {
+    hex = i.toString(16);
+    colorMap[i] = hex.length === 1 ? '0' + hex : hex;
+  }
 
-    return function(r, g, b) {
-        if(r<0){
-            r = 0;
-        }
-        if(g<0){
-            g = 0;
-        }
-        if(b<0){
-            b = 0;
-        }
-        return '#' + colorMap[r] + colorMap[g] + colorMap[b];
-    };
+  return function (r, g, b) {
+    if (r < 0) {
+      r = 0;
+    }
+    if (g < 0) {
+      g = 0;
+    }
+    if (b < 0) {
+      b = 0;
+    }
+    return '#' + colorMap[r] + colorMap[g] + colorMap[b];
+  };
 }());
-function BaseEvent(){}
-BaseEvent.prototype = {
-	triggerEvent: function (eventName, args) {
-	    if (this._cbs[eventName]) {
-	        var len = this._cbs[eventName].length;
-	        for (var i = 0; i < len; i++){
-	            this._cbs[eventName][i](args);
-	        }
-	    }
-	},
-	addEventListener: function (eventName, callback) {
-	    if (!this._cbs[eventName]){
-	        this._cbs[eventName] = [];
-	    }
-	    this._cbs[eventName].push(callback);
 
-		return function() {
-			this.removeEventListener(eventName, callback);
-		}.bind(this);
-	},
-	removeEventListener: function (eventName,callback){
-	    if (!callback){
-	        this._cbs[eventName] = null;
-	    }else if(this._cbs[eventName]){
-	        var i = 0, len = this._cbs[eventName].length;
-	        while(i<len){
-	            if(this._cbs[eventName][i] === callback){
-	                this._cbs[eventName].splice(i,1);
-	                i -=1;
-	                len -= 1;
-	            }
-	            i += 1;
-	        }
-	        if(!this._cbs[eventName].length){
-	            this._cbs[eventName] = null;
-	        }
-	    }
-	}
+function BaseEvent() {}
+BaseEvent.prototype = {
+  triggerEvent: function (eventName, args) {
+    if (this._cbs[eventName]) {
+      var len = this._cbs[eventName].length;
+      for (var i = 0; i < len; i += 1) {
+        this._cbs[eventName][i](args);
+      }
+    }
+  },
+  addEventListener: function (eventName, callback) {
+    if (!this._cbs[eventName]) {
+      this._cbs[eventName] = [];
+    }
+    this._cbs[eventName].push(callback);
+
+    return function () {
+      this.removeEventListener(eventName, callback);
+    }.bind(this);
+  },
+  removeEventListener: function (eventName, callback) {
+    if (!callback) {
+      this._cbs[eventName] = null;
+    } else if (this._cbs[eventName]) {
+      var i = 0;
+      var len = this._cbs[eventName].length;
+      while (i < len) {
+        if (this._cbs[eventName][i] === callback) {
+          this._cbs[eventName].splice(i, 1);
+          i -= 1;
+          len -= 1;
+        }
+        i += 1;
+      }
+      if (!this._cbs[eventName].length) {
+        this._cbs[eventName] = null;
+      }
+    }
+  },
 };
-var createTypedArray = (function(){
-	function createRegularArray(type, len){
-		var i = 0, arr = [], value;
-		switch(type) {
-			case 'int16':
-			case 'uint8c':
-				value = 1;
-				break;
-			default:
-				value = 1.1;
-				break;
-		}
-		for(i = 0; i < len; i += 1) {
-			arr.push(value);
-		}
-		return arr;
-	}
-	function createTypedArray(type, len){
-		if(type === 'float32') {
-			return new Float32Array(len);
-		} else if(type === 'int16') {
-			return new Int16Array(len);
-		} else if(type === 'uint8c') {
-			return new Uint8ClampedArray(len);
-		}
-	}
-	if(typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
-		return createTypedArray;
-	} else {
-		return createRegularArray;
-	}
+
+/* exported createTypedArray, createSizedArray */
+
+var createTypedArray = (function () {
+  function createRegularArray(type, len) {
+    var i = 0;
+    var arr = [];
+    var value;
+    switch (type) {
+      case 'int16':
+      case 'uint8c':
+        value = 1;
+        break;
+      default:
+        value = 1.1;
+        break;
+    }
+    for (i = 0; i < len; i += 1) {
+      arr.push(value);
+    }
+    return arr;
+  }
+  function createTypedArrayFactory(type, len) {
+    if (type === 'float32') {
+      return new Float32Array(len);
+    } if (type === 'int16') {
+      return new Int16Array(len);
+    } if (type === 'uint8c') {
+      return new Uint8ClampedArray(len);
+    }
+    return createRegularArray(type, len);
+  }
+  if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
+    return createTypedArrayFactory;
+  }
+  return createRegularArray;
 }());
 
 function createSizedArray(len) {
-	return Array.apply(null,{length:len});
+  return Array.apply(null, { length: len });
 }
+
+/* global svgNS */
+/* exported createNS */
+
 function createNS(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElementNS(svgNS, type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElementNS(svgNS, type);
 }
+
+/* exported createTag */
+
 function createTag(type) {
-	//return {appendChild:function(){},setAttribute:function(){},style:{}}
-	return document.createElement(type);
+  // return {appendChild:function(){},setAttribute:function(){},style:{}}
+  return document.createElement(type);
 }
-function DynamicPropertyContainer(){};
+
+function DynamicPropertyContainer() {}
 DynamicPropertyContainer.prototype = {
-	addDynamicProperty: function(prop) {
-		if(this.dynamicProperties.indexOf(prop) === -1) {
-	        this.dynamicProperties.push(prop);
-	        this.container.addDynamicProperty(this);
-	    	this._isAnimated = true;
-	    }
-	},
-	iterateDynamicProperties: function(){
-	    this._mdf = false;
-	    var i, len = this.dynamicProperties.length;
-	    for(i=0;i<len;i+=1){
-	        this.dynamicProperties[i].getValue();
-	        if(this.dynamicProperties[i]._mdf) {
-	            this._mdf = true;
-	        }
-	    }
-	},
-	initDynamicPropertyContainer: function(container){
-	    this.container = container;
-	    this.dynamicProperties = [];
-	    this._mdf = false;
-	    this._isAnimated = false;
-	}
-}
-var getBlendMode = (function() {
-
-	var blendModeEnums = {
-        0:'source-over',
-        1:'multiply',
-        2:'screen',
-        3:'overlay',
-        4:'darken',
-        5:'lighten',
-        6:'color-dodge',
-        7:'color-burn',
-        8:'hard-light',
-        9:'soft-light',
-        10:'difference',
-        11:'exclusion',
-        12:'hue',
-        13:'saturation',
-        14:'color',
-        15:'luminosity'
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+      this.container.addDynamicProperty(this);
+      this._isAnimated = true;
     }
+  },
+  iterateDynamicProperties: function () {
+    this._mdf = false;
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      this.dynamicProperties[i].getValue();
+      if (this.dynamicProperties[i]._mdf) {
+        this._mdf = true;
+      }
+    }
+  },
+  initDynamicPropertyContainer: function (container) {
+    this.container = container;
+    this.dynamicProperties = [];
+    this._mdf = false;
+    this._isAnimated = false;
+  },
+};
 
-	return function(mode) {
-		return blendModeEnums[mode] || '';
-	}
-}())
+/* exported getBlendMode */
+
+var getBlendMode = (function () {
+  var blendModeEnums = {
+    0: 'source-over',
+    1: 'multiply',
+    2: 'screen',
+    3: 'overlay',
+    4: 'darken',
+    5: 'lighten',
+    6: 'color-dodge',
+    7: 'color-burn',
+    8: 'hard-light',
+    9: 'soft-light',
+    10: 'difference',
+    11: 'exclusion',
+    12: 'hue',
+    13: 'saturation',
+    14: 'color',
+    15: 'luminosity',
+  };
+
+  return function (mode) {
+    return blendModeEnums[mode] || '';
+  };
+}());
+
+/* global createTypedArray */
+
 /*!
  Transformation Matrix v2.0
  (c) Epistemex 2014-2015
@@ -397,394 +440,399 @@
  * @constructor
  */
 
-var Matrix = (function(){
+var Matrix = (function () {
+  var _cos = Math.cos;
+  var _sin = Math.sin;
+  var _tan = Math.tan;
+  var _rnd = Math.round;
 
-    var _cos = Math.cos;
-    var _sin = Math.sin;
-    var _tan = Math.tan;
-    var _rnd = Math.round;
+  function reset() {
+    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;
+    return this;
+  }
 
-    function reset(){
-        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;
-        return this;
+  function rotate(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function rotateX(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateY(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
+  }
+
+  function rotateZ(angle) {
+    if (angle === 0) {
+      return this;
+    }
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+  }
+
+  function shear(sx, sy) {
+    return this._t(1, sy, sx, 1, 0, 0);
+  }
+
+  function skew(ax, ay) {
+    return this.shear(_tan(ax), _tan(ay));
+  }
+
+  function skewFromAxis(ax, angle) {
+    var mCos = _cos(angle);
+    var mSin = _sin(angle);
+    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);
+  }
+
+  function scale(sx, sy, sz) {
+    if (!sz && sz !== 0) {
+      sz = 1;
+    }
+    if (sx === 1 && sy === 1 && sz === 1) {
+      return this;
+    }
+    return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
+  }
+
+  function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
+    this.props[0] = a;
+    this.props[1] = b;
+    this.props[2] = c;
+    this.props[3] = d;
+    this.props[4] = e;
+    this.props[5] = f;
+    this.props[6] = g;
+    this.props[7] = h;
+    this.props[8] = i;
+    this.props[9] = j;
+    this.props[10] = k;
+    this.props[11] = l;
+    this.props[12] = m;
+    this.props[13] = n;
+    this.props[14] = o;
+    this.props[15] = p;
+    return this;
+  }
+
+  function translate(tx, ty, tz) {
+    tz = tz || 0;
+    if (tx !== 0 || ty !== 0 || tz !== 0) {
+      return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
+    }
+    return this;
+  }
+
+  function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
+    var _p = this.props;
+
+    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) {
+      // NOTE: commenting this condition because TurboFan deoptimizes code when present
+      // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
+      _p[12] = _p[12] * a2 + _p[15] * m2;
+      _p[13] = _p[13] * f2 + _p[15] * n2;
+      _p[14] = _p[14] * k2 + _p[15] * o2;
+      _p[15] *= p2;
+      // }
+      this._identityCalculated = false;
+      return this;
     }
 
-    function rotate(angle) {
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
+    var a1 = _p[0];
+    var b1 = _p[1];
+    var c1 = _p[2];
+    var d1 = _p[3];
+    var e1 = _p[4];
+    var f1 = _p[5];
+    var g1 = _p[6];
+    var h1 = _p[7];
+    var i1 = _p[8];
+    var j1 = _p[9];
+    var k1 = _p[10];
+    var l1 = _p[11];
+    var m1 = _p[12];
+    var n1 = _p[13];
+    var o1 = _p[14];
+    var p1 = _p[15];
 
-    function rotateX(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateY(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos,  0,  mSin, 0, 0, 1, 0, 0, -mSin,  0,  mCos, 0, 0, 0, 0, 1);
-    }
-
-    function rotateZ(angle){
-        if(angle === 0){
-            return this;
-        }
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        return this._t(mCos, -mSin,  0, 0, mSin,  mCos, 0, 0, 0,  0,  1, 0, 0, 0, 0, 1);
-    }
-
-    function shear(sx,sy){
-        return this._t(1, sy, sx, 1, 0, 0);
-    }
-
-    function skew(ax, ay){
-        return this.shear(_tan(ax), _tan(ay));
-    }
-
-    function skewFromAxis(ax, angle){
-        var mCos = _cos(angle);
-        var mSin = _sin(angle);
-        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);
-    }
-
-    function scale(sx, sy, sz) {
-        if(!sz && sz !== 0) {
-            sz = 1;
-        }
-        if(sx === 1 && sy === 1 && sz === 1){
-            return this;
-        }
-        return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
-    }
-
-    function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
-        this.props[0] = a;
-        this.props[1] = b;
-        this.props[2] = c;
-        this.props[3] = d;
-        this.props[4] = e;
-        this.props[5] = f;
-        this.props[6] = g;
-        this.props[7] = h;
-        this.props[8] = i;
-        this.props[9] = j;
-        this.props[10] = k;
-        this.props[11] = l;
-        this.props[12] = m;
-        this.props[13] = n;
-        this.props[14] = o;
-        this.props[15] = p;
-        return this;
-    }
-
-    function translate(tx, ty, tz) {
-        tz = tz || 0;
-        if(tx !== 0 || ty !== 0 || tz !== 0){
-            return this._t(1,0,0,0,0,1,0,0,0,0,1,0,tx,ty,tz,1);
-        }
-        return this;
-    }
-
-    function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
-
-        var _p = this.props;
-
-        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){
-            //NOTE: commenting this condition because TurboFan deoptimizes code when present
-            //if(m2 !== 0 || n2 !== 0 || o2 !== 0){
-                _p[12] = _p[12] * a2 + _p[15] * m2;
-                _p[13] = _p[13] * f2 + _p[15] * n2;
-                _p[14] = _p[14] * k2 + _p[15] * o2;
-                _p[15] = _p[15] * p2;
-            //}
-            this._identityCalculated = false;
-            return this;
-        }
-
-        var a1 = _p[0];
-        var b1 = _p[1];
-        var c1 = _p[2];
-        var d1 = _p[3];
-        var e1 = _p[4];
-        var f1 = _p[5];
-        var g1 = _p[6];
-        var h1 = _p[7];
-        var i1 = _p[8];
-        var j1 = _p[9];
-        var k1 = _p[10];
-        var l1 = _p[11];
-        var m1 = _p[12];
-        var n1 = _p[13];
-        var o1 = _p[14];
-        var p1 = _p[15];
-
-        /* matrix order (canvas compatible):
+    /* matrix order (canvas compatible):
          * ace
          * bdf
          * 001
          */
-        _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
-        _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2 ;
-        _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2 ;
-        _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2 ;
+    _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
+    _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
+    _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
+    _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
 
-        _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2 ;
-        _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2 ;
-        _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2 ;
-        _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2 ;
+    _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
+    _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
+    _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
+    _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
 
-        _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2 ;
-        _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2 ;
-        _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2 ;
-        _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2 ;
+    _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
+    _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
+    _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
+    _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
 
-        _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2 ;
-        _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2 ;
-        _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2 ;
-        _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2 ;
+    _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
+    _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
+    _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
+    _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
 
-        this._identityCalculated = false;
-        return this;
+    this._identityCalculated = false;
+    return this;
+  }
+
+  function isIdentity() {
+    if (!this._identityCalculated) {
+      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);
+      this._identityCalculated = true;
     }
+    return this._identity;
+  }
 
-    function isIdentity() {
-        if(!this._identityCalculated){
-            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);
-            this._identityCalculated = true;
-        }
-        return this._identity;
+  function equals(matr) {
+    var i = 0;
+    while (i < 16) {
+      if (matr.props[i] !== this.props[i]) {
+        return false;
+      }
+      i += 1;
     }
+    return true;
+  }
 
-    function equals(matr){
-        var i = 0;
-        while (i < 16) {
-            if(matr.props[i] !== this.props[i]) {
-                return false;
-            }
-            i+=1;
-        }
-        return true;
+  function clone(matr) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      matr.props[i] = this.props[i];
     }
+    return matr;
+  }
 
-    function clone(matr){
-        var i;
-        for(i=0;i<16;i+=1){
-            matr.props[i] = this.props[i];
-        }
-        return matr;
+  function cloneFromProps(props) {
+    var i;
+    for (i = 0; i < 16; i += 1) {
+      this.props[i] = props[i];
     }
+  }
 
-    function cloneFromProps(props){
-        var i;
-        for(i=0;i<16;i+=1){
-            this.props[i] = props[i];
-        }
-    }
-
-    function applyToPoint(x, y, z) {
-
-        return {
-            x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
-            y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
-            z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
-        };
-        /*return {
+  function applyToPoint(x, y, z) {
+    return {
+      x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
+      y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
+      z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14],
+    };
+    /* return {
          x: x * me.a + y * me.c + me.e,
          y: x * me.b + y * me.d + me.f
-         };*/
-    }
-    function applyToX(x, y, z) {
-        return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
-    }
-    function applyToY(x, y, z) {
-        return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
-    }
-    function applyToZ(x, y, z) {
-        return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
-    }
+         }; */
+  }
+  function applyToX(x, y, z) {
+    return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
+  }
+  function applyToY(x, y, z) {
+    return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
+  }
+  function applyToZ(x, y, z) {
+    return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
+  }
 
-    function getInverseMatrix() {
-        var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
-        var a = this.props[5]/determinant;
-        var b = - this.props[1]/determinant;
-        var c = - this.props[4]/determinant;
-        var d = this.props[0]/determinant;
-        var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12])/determinant;
-        var f = - (this.props[0] * this.props[13] - this.props[1] * this.props[12])/determinant;
-        var inverseMatrix = new Matrix();
-        inverseMatrix.props[0] = a;
-        inverseMatrix.props[1] = b;
-        inverseMatrix.props[4] = c;
-        inverseMatrix.props[5] = d;
-        inverseMatrix.props[12] = e;
-        inverseMatrix.props[13] = f;
-        return inverseMatrix;
-    }
+  function getInverseMatrix() {
+    var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
+    var a = this.props[5] / determinant;
+    var b = -this.props[1] / determinant;
+    var c = -this.props[4] / determinant;
+    var d = this.props[0] / determinant;
+    var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
+    var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
+    var inverseMatrix = new Matrix();
+    inverseMatrix.props[0] = a;
+    inverseMatrix.props[1] = b;
+    inverseMatrix.props[4] = c;
+    inverseMatrix.props[5] = d;
+    inverseMatrix.props[12] = e;
+    inverseMatrix.props[13] = f;
+    return inverseMatrix;
+  }
 
-    function inversePoint(pt) {
-        var inverseMatrix = this.getInverseMatrix();
-        return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0)
-    }
+  function inversePoint(pt) {
+    var inverseMatrix = this.getInverseMatrix();
+    return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
+  }
 
-    function inversePoints(pts){
-        var i, len = pts.length, retPts = [];
-        for(i=0;i<len;i+=1){
-            retPts[i] = inversePoint(pts[i]);
-        }
-        return retPts;
+  function inversePoints(pts) {
+    var i;
+    var len = pts.length;
+    var retPts = [];
+    for (i = 0; i < len; i += 1) {
+      retPts[i] = inversePoint(pts[i]);
     }
+    return retPts;
+  }
 
-    function applyToTriplePoints(pt1, pt2, pt3) {
-        var arr = createTypedArray('float32', 6);
-        if(this.isIdentity()) {
-            arr[0] = pt1[0];
-            arr[1] = pt1[1];
-            arr[2] = pt2[0];
-            arr[3] = pt2[1];
-            arr[4] = pt3[0];
-            arr[5] = pt3[1];
-        } else {
-            var p0 = this.props[0], p1 = this.props[1], p4 = this.props[4], p5 = this.props[5], p12 = this.props[12], p13 = this.props[13];
-            arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
-            arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
-            arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
-            arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
-            arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
-            arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
-        }
-        return arr;
+  function applyToTriplePoints(pt1, pt2, pt3) {
+    var arr = createTypedArray('float32', 6);
+    if (this.isIdentity()) {
+      arr[0] = pt1[0];
+      arr[1] = pt1[1];
+      arr[2] = pt2[0];
+      arr[3] = pt2[1];
+      arr[4] = pt3[0];
+      arr[5] = pt3[1];
+    } else {
+      var p0 = this.props[0];
+      var p1 = this.props[1];
+      var p4 = this.props[4];
+      var p5 = this.props[5];
+      var p12 = this.props[12];
+      var p13 = this.props[13];
+      arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
+      arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
+      arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
+      arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
+      arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
+      arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
     }
+    return arr;
+  }
 
-    function applyToPointArray(x,y,z){
-        var arr;
-        if(this.isIdentity()) {
-            arr = [x,y,z];
-        } else {
-            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]
-            ];
-        }
-        return arr;
+  function applyToPointArray(x, y, z) {
+    var arr;
+    if (this.isIdentity()) {
+      arr = [x, y, z];
+    } else {
+      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],
+      ];
     }
+    return arr;
+  }
 
-    function applyToPointStringified(x, y) {
-        if(this.isIdentity()) {
-            return x + ',' + y;
-        }
-        var _p = this.props;
-        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;
+  function applyToPointStringified(x, y) {
+    if (this.isIdentity()) {
+      return x + ',' + y;
     }
+    var _p = this.props;
+    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;
+  }
 
-    function toCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function toCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var i = 0;
-        var props = this.props;
-        var cssValue = 'matrix3d(';
-        var v = 10000;
-        while(i<16){
-            cssValue += _rnd(props[i]*v)/v;
-            cssValue += i === 15 ? ')':',';
-            i += 1;
-        }
-        return cssValue;
+        } */
+    var i = 0;
+    var props = this.props;
+    var cssValue = 'matrix3d(';
+    var v = 10000;
+    while (i < 16) {
+      cssValue += _rnd(props[i] * v) / v;
+      cssValue += i === 15 ? ')' : ',';
+      i += 1;
     }
+    return cssValue;
+  }
 
-    function roundMatrixProperty(val) {
-        var v = 10000;
-        if((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
-            return _rnd(val * v) / v;
-        }
-        return val;
+  function roundMatrixProperty(val) {
+    var v = 10000;
+    if ((val < 0.000001 && val > 0) || (val > -0.000001 && val < 0)) {
+      return _rnd(val * v) / v;
     }
+    return val;
+  }
 
-    function to2dCSS() {
-        //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.
-        /*if(this.isIdentity()) {
+  function to2dCSS() {
+    // 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.
+    /* if(this.isIdentity()) {
             return '';
-        }*/
-        var props = this.props;
-        var _a = roundMatrixProperty(props[0]);
-        var _b = roundMatrixProperty(props[1]);
-        var _c = roundMatrixProperty(props[4]);
-        var _d = roundMatrixProperty(props[5]);
-        var _e = roundMatrixProperty(props[12]);
-        var _f = roundMatrixProperty(props[13]);
-        return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")";
-    }
+        } */
+    var props = this.props;
+    var _a = roundMatrixProperty(props[0]);
+    var _b = roundMatrixProperty(props[1]);
+    var _c = roundMatrixProperty(props[4]);
+    var _d = roundMatrixProperty(props[5]);
+    var _e = roundMatrixProperty(props[12]);
+    var _f = roundMatrixProperty(props[13]);
+    return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
+  }
 
-    return function(){
-        this.reset = reset;
-        this.rotate = rotate;
-        this.rotateX = rotateX;
-        this.rotateY = rotateY;
-        this.rotateZ = rotateZ;
-        this.skew = skew;
-        this.skewFromAxis = skewFromAxis;
-        this.shear = shear;
-        this.scale = scale;
-        this.setTransform = setTransform;
-        this.translate = translate;
-        this.transform = transform;
-        this.applyToPoint = applyToPoint;
-        this.applyToX = applyToX;
-        this.applyToY = applyToY;
-        this.applyToZ = applyToZ;
-        this.applyToPointArray = applyToPointArray;
-        this.applyToTriplePoints = applyToTriplePoints;
-        this.applyToPointStringified = applyToPointStringified;
-        this.toCSS = toCSS;
-        this.to2dCSS = to2dCSS;
-        this.clone = clone;
-        this.cloneFromProps = cloneFromProps;
-        this.equals = equals;
-        this.inversePoints = inversePoints;
-        this.inversePoint = inversePoint;
-        this.getInverseMatrix = getInverseMatrix;
-        this._t = this.transform;
-        this.isIdentity = isIdentity;
-        this._identity = true;
-        this._identityCalculated = false;
+  return function () {
+    this.reset = reset;
+    this.rotate = rotate;
+    this.rotateX = rotateX;
+    this.rotateY = rotateY;
+    this.rotateZ = rotateZ;
+    this.skew = skew;
+    this.skewFromAxis = skewFromAxis;
+    this.shear = shear;
+    this.scale = scale;
+    this.setTransform = setTransform;
+    this.translate = translate;
+    this.transform = transform;
+    this.applyToPoint = applyToPoint;
+    this.applyToX = applyToX;
+    this.applyToY = applyToY;
+    this.applyToZ = applyToZ;
+    this.applyToPointArray = applyToPointArray;
+    this.applyToTriplePoints = applyToTriplePoints;
+    this.applyToPointStringified = applyToPointStringified;
+    this.toCSS = toCSS;
+    this.to2dCSS = to2dCSS;
+    this.clone = clone;
+    this.cloneFromProps = cloneFromProps;
+    this.equals = equals;
+    this.inversePoints = inversePoints;
+    this.inversePoint = inversePoint;
+    this.getInverseMatrix = getInverseMatrix;
+    this._t = this.transform;
+    this.isIdentity = isIdentity;
+    this._identity = true;
+    this._identityCalculated = false;
 
-        this.props = createTypedArray('float32', 16);
-        this.reset();
-    };
+    this.props = createTypedArray('float32', 16);
+    this.reset();
+  };
 }());
 
+/* eslint-disable */
 /*
  Copyright 2014 David Bau.
 
@@ -1018,8 +1066,9 @@
     [],     // pool: entropy pool starts empty
     BMMath    // math: package containing random, pow, and seedrandom
 );
-var BezierFactory = (function(){
-    /**
+/* eslint-disable */
+var BezierFactory = (function () {
+  /**
      * BezierEasing - use bezier curve for transition easing function
      * by Gaëtan Renaudeau 2014 - 2015 – MIT License
      *
@@ -1030,6782 +1079,7190 @@
      *
      */
 
-        var ob = {};
-    ob.getBezierEasing = getBezierEasing;
-    var beziers = {};
+  var ob = {};
+  ob.getBezierEasing = getBezierEasing;
+  var beziers = {};
 
-    function getBezierEasing(a,b,c,d,nm){
-        var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p');
-        if(beziers[str]){
-            return beziers[str];
-        }
-        var bezEasing = new BezierEasing([a,b,c,d]);
-        beziers[str] = bezEasing;
-        return bezEasing;
+  function getBezierEasing(a, b, c, d, nm) {
+    var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
+    if (beziers[str]) {
+      return beziers[str];
     }
+    var bezEasing = new BezierEasing([a, b, c, d]);
+    beziers[str] = bezEasing;
+    return bezEasing;
+  }
 
-// These values are established by empiricism with tests (tradeoff: performance VS precision)
-    var NEWTON_ITERATIONS = 4;
-    var NEWTON_MIN_SLOPE = 0.001;
-    var SUBDIVISION_PRECISION = 0.0000001;
-    var SUBDIVISION_MAX_ITERATIONS = 10;
+  // These values are established by empiricism with tests (tradeoff: performance VS precision)
+  var NEWTON_ITERATIONS = 4;
+  var NEWTON_MIN_SLOPE = 0.001;
+  var SUBDIVISION_PRECISION = 0.0000001;
+  var SUBDIVISION_MAX_ITERATIONS = 10;
 
-    var kSplineTableSize = 11;
-    var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
+  var kSplineTableSize = 11;
+  var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
 
-    var float32ArraySupported = typeof Float32Array === "function";
+  var float32ArraySupported = typeof Float32Array === 'function';
 
-    function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
-    function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
-    function C (aA1)      { return 3.0 * aA1; }
+  function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
+  function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
+  function C(aA1) { return 3.0 * aA1; }
 
-// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
-    function calcBezier (aT, aA1, aA2) {
-        return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
+  // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
+  function calcBezier(aT, aA1, aA2) {
+    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
+  }
+
+  // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
+  function getSlope(aT, aA1, aA2) {
+    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
+  }
+
+  function binarySubdivide(aX, aA, aB, mX1, mX2) {
+    var currentX,
+      currentT,
+      i = 0;
+    do {
+      currentT = aA + (aB - aA) / 2.0;
+      currentX = calcBezier(currentT, mX1, mX2) - aX;
+      if (currentX > 0.0) {
+        aB = currentT;
+      } else {
+        aA = currentT;
+      }
+    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
+    return currentT;
+  }
+
+  function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
+    for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
+      var currentSlope = getSlope(aGuessT, mX1, mX2);
+      if (currentSlope === 0.0) return aGuessT;
+      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
+      aGuessT -= currentX / currentSlope;
     }
+    return aGuessT;
+  }
 
-// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
-    function getSlope (aT, aA1, aA2) {
-        return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
-    }
-
-    function binarySubdivide (aX, aA, aB, mX1, mX2) {
-        var currentX, currentT, i = 0;
-        do {
-            currentT = aA + (aB - aA) / 2.0;
-            currentX = calcBezier(currentT, mX1, mX2) - aX;
-            if (currentX > 0.0) {
-                aB = currentT;
-            } else {
-                aA = currentT;
-            }
-        } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
-        return currentT;
-    }
-
-    function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
-        for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
-            var currentSlope = getSlope(aGuessT, mX1, mX2);
-            if (currentSlope === 0.0) return aGuessT;
-            var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
-            aGuessT -= currentX / currentSlope;
-        }
-        return aGuessT;
-    }
-
-    /**
+  /**
      * points is an array of [ mX1, mY1, mX2, mY2 ]
      */
-    function BezierEasing (points) {
-        this._p = points;
-        this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
-        this._precomputed = false;
+  function BezierEasing(points) {
+    this._p = points;
+    this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
+    this._precomputed = false;
 
-        this.get = this.get.bind(this);
-    }
+    this.get = this.get.bind(this);
+  }
 
-    BezierEasing.prototype = {
+  BezierEasing.prototype = {
 
-        get: function (x) {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            if (!this._precomputed) this._precompute();
-            if (mX1 === mY1 && mX2 === mY2) return x; // linear
-            // Because JavaScript number are imprecise, we should guarantee the extremes are right.
-            if (x === 0) return 0;
-            if (x === 1) return 1;
-            return calcBezier(this._getTForX(x), mY1, mY2);
-        },
+    get: function (x) {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      if (!this._precomputed) this._precompute();
+      if (mX1 === mY1 && mX2 === mY2) return x; // linear
+      // Because JavaScript number are imprecise, we should guarantee the extremes are right.
+      if (x === 0) return 0;
+      if (x === 1) return 1;
+      return calcBezier(this._getTForX(x), mY1, mY2);
+    },
 
-        // Private part
+    // Private part
 
-        _precompute: function () {
-            var mX1 = this._p[0],
-                mY1 = this._p[1],
-                mX2 = this._p[2],
-                mY2 = this._p[3];
-            this._precomputed = true;
-            if (mX1 !== mY1 || mX2 !== mY2)
-                this._calcSampleValues();
-        },
+    _precompute: function () {
+      var mX1 = this._p[0],
+        mY1 = this._p[1],
+        mX2 = this._p[2],
+        mY2 = this._p[3];
+      this._precomputed = true;
+      if (mX1 !== mY1 || mX2 !== mY2) { this._calcSampleValues(); }
+    },
 
-        _calcSampleValues: function () {
-            var mX1 = this._p[0],
-                mX2 = this._p[2];
-            for (var i = 0; i < kSplineTableSize; ++i) {
-                this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
-            }
-        },
+    _calcSampleValues: function () {
+      var mX1 = this._p[0],
+        mX2 = this._p[2];
+      for (var i = 0; i < kSplineTableSize; ++i) {
+        this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
+      }
+    },
 
-        /**
+    /**
          * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
          */
-        _getTForX: function (aX) {
-            var mX1 = this._p[0],
-                mX2 = this._p[2],
-                mSampleValues = this._mSampleValues;
+    _getTForX: function (aX) {
+      var mX1 = this._p[0],
+        mX2 = this._p[2],
+        mSampleValues = this._mSampleValues;
 
-            var intervalStart = 0.0;
-            var currentSample = 1;
-            var lastSample = kSplineTableSize - 1;
+      var intervalStart = 0.0;
+      var currentSample = 1;
+      var lastSample = kSplineTableSize - 1;
 
-            for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
-                intervalStart += kSampleStepSize;
-            }
-            --currentSample;
+      for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
+        intervalStart += kSampleStepSize;
+      }
+      --currentSample;
 
-            // Interpolate to provide an initial guess for t
-            var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]);
-            var guessForT = intervalStart + dist * kSampleStepSize;
+      // Interpolate to provide an initial guess for t
+      var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
+      var guessForT = intervalStart + dist * kSampleStepSize;
 
-            var initialSlope = getSlope(guessForT, mX1, mX2);
-            if (initialSlope >= NEWTON_MIN_SLOPE) {
-                return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
-            } else if (initialSlope === 0.0) {
-                return guessForT;
-            } else {
-                return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
-            }
-        }
-    };
+      var initialSlope = getSlope(guessForT, mX1, mX2);
+      if (initialSlope >= NEWTON_MIN_SLOPE) {
+        return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
+      } if (initialSlope === 0.0) {
+        return guessForT;
+      }
+      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
+    },
+  };
 
-    return ob;
-
+  return ob;
 }());
+
 (function () {
-    var lastTime = 0;
-    var vendors = ['ms', 'moz', 'webkit', 'o'];
-    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
-        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
-        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
-    }
-    if(!window.requestAnimationFrame)
-        window.requestAnimationFrame = function (callback, element) {
-            var currTime = new Date().getTime();
-            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
-            var id = setTimeout(function () {
-                    callback(currTime + timeToCall);
-                },
-                timeToCall);
-            lastTime = currTime + timeToCall;
-            return id;
-        };
-    if(!window.cancelAnimationFrame)
-        window.cancelAnimationFrame = function (id) {
-            clearTimeout(id);
-        };
+  var lastTime = 0;
+  var vendors = ['ms', 'moz', 'webkit', 'o'];
+  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { // eslint-disable-line no-plusplus
+    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
+    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
+  }
+  if (!window.requestAnimationFrame) {
+    window.requestAnimationFrame = function (callback) {
+      var currTime = new Date().getTime();
+      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+      var id = setTimeout(function () {
+        callback(currTime + timeToCall);
+      },
+      timeToCall);
+      lastTime = currTime + timeToCall;
+      return id;
+    };
+  }
+  if (!window.cancelAnimationFrame) {
+    window.cancelAnimationFrame = function (id) {
+      clearTimeout(id);
+    };
+  }
 }());
 
-function extendPrototype(sources,destination){
-    var i, len = sources.length, sourcePrototype;
-    for (i = 0;i < len;i += 1) {
-        sourcePrototype = sources[i].prototype;
-        for (var attr in sourcePrototype) {
-            if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
-        }
+/* exported extendPrototype, getDescriptor, createProxyFunction */
+
+function extendPrototype(sources, destination) {
+  var i;
+  var len = sources.length;
+  var sourcePrototype;
+  for (i = 0; i < len; i += 1) {
+    sourcePrototype = sources[i].prototype;
+    for (var attr in sourcePrototype) {
+      if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
     }
+  }
 }
 
 function getDescriptor(object, prop) {
-    return Object.getOwnPropertyDescriptor(object, prop);
+  return Object.getOwnPropertyDescriptor(object, prop);
 }
 
 function createProxyFunction(prototype) {
-	function ProxyFunction(){}
-	ProxyFunction.prototype = prototype;
-	return ProxyFunction;
+  function ProxyFunction() {}
+  ProxyFunction.prototype = prototype;
+  return ProxyFunction;
 }
-function bezFunction(){
 
-    var easingFunctions = [];
-    var math = Math;
+/* global segmentsLengthPool, defaultCurveSegments, createSizedArray, bmPow, bmSqrt, bmFloor, createTypedArray, bezierLengthPool */
+/* exported bez */
 
-    function pointOnLine2D(x1,y1, x2,y2, x3,y3){
-        var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1);
-        return det1 > -0.001 && det1 < 0.001;
+function bezFunction() {
+  var math = Math;
+
+  function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
+    var det1 = (x1 * y2) + (y1 * x3) + (x2 * y3) - (x3 * y2) - (y3 * x1) - (x2 * y1);
+    return det1 > -0.001 && det1 < 0.001;
+  }
+
+  function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
+    if (z1 === 0 && z2 === 0 && z3 === 0) {
+      return pointOnLine2D(x1, y1, x2, y2, x3, y3);
     }
+    var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
+    var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
+    var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
+    var diffDist;
+    if (dist1 > dist2) {
+      if (dist1 > dist3) {
+        diffDist = dist1 - dist2 - dist3;
+      } else {
+        diffDist = dist3 - dist2 - dist1;
+      }
+    } else if (dist3 > dist2) {
+      diffDist = dist3 - dist2 - dist1;
+    } else {
+      diffDist = dist2 - dist1 - dist3;
+    }
+    return diffDist > -0.0001 && diffDist < 0.0001;
+  }
 
-    function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){
-        if(z1 === 0 && z2 === 0 && z3 === 0) {
-            return pointOnLine2D(x1,y1, x2,y2, x3,y3);
+  var getBezierLength = (function () {
+    return function (pt1, pt2, pt3, pt4) {
+      var curveSegments = defaultCurveSegments;
+      var k;
+      var i;
+      var len;
+      var ptCoord;
+      var perc;
+      var addedLength = 0;
+      var ptDistance;
+      var point = [];
+      var lastPoint = [];
+      var lengthData = bezierLengthPool.newElement();
+      len = pt3.length;
+      for (k = 0; k < curveSegments; k += 1) {
+        perc = k / (curveSegments - 1);
+        ptDistance = 0;
+        for (i = 0; i < len; i += 1) {
+          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];
+          point[i] = ptCoord;
+          if (lastPoint[i] !== null) {
+            ptDistance += bmPow(point[i] - lastPoint[i], 2);
+          }
+          lastPoint[i] = point[i];
         }
-        var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
-        var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2));
-        var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2));
-        var diffDist;
-        if(dist1 > dist2){
-            if(dist1 > dist3){
-                diffDist = dist1 - dist2 - dist3;
-            } else {
-                diffDist = dist3 - dist2 - dist1;
-            }
-        } else if(dist3 > dist2){
-            diffDist = dist3 - dist2 - dist1;
-        } else {
-            diffDist = dist2 - dist1 - dist3;
+        if (ptDistance) {
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
         }
-        return diffDist > -0.0001 && diffDist < 0.0001;
-    }
-
-    var getBezierLength = (function(){
-
-        return function(pt1,pt2,pt3,pt4){
-            var curveSegments = defaultCurveSegments;
-            var k;
-            var i, len;
-            var ptCoord,perc,addedLength = 0;
-            var ptDistance;
-            var point = [],lastPoint = [];
-            var lengthData = bezier_length_pool.newElement();
-            len = pt3.length;
-            for(k=0;k<curveSegments;k+=1){
-                perc = k/(curveSegments-1);
-                ptDistance = 0;
-                for(i=0;i<len;i+=1){
-                    ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*pt3[i]+3*(1-perc)*bm_pow(perc,2)*pt4[i]+bm_pow(perc,3)*pt2[i];
-                    point[i] = ptCoord;
-                    if(lastPoint[i] !== null){
-                        ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                    }
-                    lastPoint[i] = point[i];
-                }
-                if(ptDistance){
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                }
-                lengthData.percents[k] = perc;
-                lengthData.lengths[k] = addedLength;
-            }
-            lengthData.addedLength = addedLength;
-            return lengthData;
-        };
-    }());
-
-    function getSegmentsLength(shapeData) {
-        var segmentsLength = segments_length_pool.newElement();
-        var closed = shapeData.c;
-        var pathV = shapeData.v;
-        var pathO = shapeData.o;
-        var pathI = shapeData.i;
-        var i, len = shapeData._length;
-        var lengths = segmentsLength.lengths;
-        var totalLength = 0;
-        for(i=0;i<len-1;i+=1){
-            lengths[i] = getBezierLength(pathV[i],pathV[i+1],pathO[i],pathI[i+1]);
-            totalLength += lengths[i].addedLength;
-        }
-        if(closed && len){
-            lengths[i] = getBezierLength(pathV[i],pathV[0],pathO[i],pathI[0]);
-            totalLength += lengths[i].addedLength;
-        }
-        segmentsLength.totalLength = totalLength;
-        return segmentsLength;
-    }
-
-    function BezierData(length){
-        this.segmentLength = 0;
-        this.points = new Array(length);
-    }
-
-    function PointData(partial,point){
-        this.partialLength = partial;
-        this.point = point;
-    }
-
-    var buildBezierData = (function(){
-
-        var storedData = {};
-
-        return function (pt1, pt2, pt3, pt4){
-            var bezierName = (pt1[0]+'_'+pt1[1]+'_'+pt2[0]+'_'+pt2[1]+'_'+pt3[0]+'_'+pt3[1]+'_'+pt4[0]+'_'+pt4[1]).replace(/\./g, 'p');
-            if(!storedData[bezierName]){
-                var curveSegments = defaultCurveSegments;
-                var k, i, len;
-                var ptCoord,perc,addedLength = 0;
-                var ptDistance;
-                var point,lastPoint = null;
-                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])){
-                    curveSegments = 2;
-                }
-                var bezierData = new BezierData(curveSegments);
-                len = pt3.length;
-                for (k = 0; k < curveSegments; k += 1) {
-                    point = createSizedArray(len);
-                    perc = k / (curveSegments - 1);
-                    ptDistance = 0;
-                    for (i = 0; i < len; i += 1){
-                        ptCoord = bm_pow(1-perc,3)*pt1[i]+3*bm_pow(1-perc,2)*perc*(pt1[i] + pt3[i])+3*(1-perc)*bm_pow(perc,2)*(pt2[i] + pt4[i])+bm_pow(perc,3)*pt2[i];
-                        point[i] = ptCoord;
-                        if(lastPoint !== null){
-                            ptDistance += bm_pow(point[i] - lastPoint[i],2);
-                        }
-                    }
-                    ptDistance = bm_sqrt(ptDistance);
-                    addedLength += ptDistance;
-                    bezierData.points[k] = new PointData(ptDistance, point);
-                    lastPoint = point;
-                }
-                bezierData.segmentLength = addedLength;
-                storedData[bezierName] = bezierData;
-            }
-            return storedData[bezierName];
-        };
-    }());
-
-    function getDistancePerc(perc,bezierData){
-        var percents = bezierData.percents;
-        var lengths = bezierData.lengths;
-        var len = percents.length;
-        var initPos = bm_floor((len-1)*perc);
-        var lengthPos = perc*bezierData.addedLength;
-        var lPerc = 0;
-        if(initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]){
-            return percents[initPos];
-        }else{
-            var dir = lengths[initPos] > lengthPos ? -1 : 1;
-            var flag = true;
-            while(flag){
-                if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){
-                    lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]);
-                    flag = false;
-                }else{
-                    initPos += dir;
-                }
-                if(initPos < 0 || initPos >= len - 1){
-                    //FIX for TypedArrays that don't store floating point values with enough accuracy
-                    if(initPos === len - 1) {
-                        return percents[initPos];
-                    }
-                    flag = false;
-                }
-            }
-            return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc;
-        }
-    }
-
-    function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
-        var t1 = getDistancePerc(percent,bezierData);
-        var u0 = 1;
-        var u1 = 1 - t1;
-        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;
-        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;
-        return [ptX, ptY];
-    }
-
-    function getSegmentArray() {
-
-    }
-
-    var bezier_segment_points = createTypedArray('float32', 8);
-
-    function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){
-
-        startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc;
-        var t0 = getDistancePerc(startPerc,bezierData);
-        endPerc = endPerc > 1 ? 1 : endPerc;
-        var t1 = getDistancePerc(endPerc,bezierData);
-        var i, len = pt1.length;
-        var u0 = 1 - t0;
-        var u1 = 1 - t1;
-        var u0u0u0 = u0*u0*u0;
-        var t0u0u0_3 = t0*u0*u0*3;
-        var t0t0u0_3 = t0*t0*u0*3;
-        var t0t0t0 = t0*t0*t0;
-        //
-        var u0u0u1 = u0*u0*u1;
-        var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1;
-        var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1;
-        var t0t0t1 = t0*t0*t1;
-        //
-        var u0u1u1 = u0*u1*u1;
-        var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1;
-        var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1;
-        var t0t1t1 = t0*t1*t1;
-        //
-        var u1u1u1 = u1*u1*u1;
-        var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1;
-        var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1;
-        var t1t1t1 = t1*t1*t1;
-        for(i=0;i<len;i+=1){
-            bezier_segment_points[i * 4] = Math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 1] = Math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 2] = Math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000;
-            bezier_segment_points[i * 4 + 3] = Math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000;
-        }
-
-        return bezier_segment_points;
-    }
-
-    return {
-        getSegmentsLength : getSegmentsLength,
-        getNewSegment : getNewSegment,
-        getPointInSegment : getPointInSegment,
-        buildBezierData : buildBezierData,
-        pointOnLine2D : pointOnLine2D,
-        pointOnLine3D : pointOnLine3D
+        lengthData.percents[k] = perc;
+        lengthData.lengths[k] = addedLength;
+      }
+      lengthData.addedLength = addedLength;
+      return lengthData;
     };
+  }());
+
+  function getSegmentsLength(shapeData) {
+    var segmentsLength = segmentsLengthPool.newElement();
+    var closed = shapeData.c;
+    var pathV = shapeData.v;
+    var pathO = shapeData.o;
+    var pathI = shapeData.i;
+    var i;
+    var len = shapeData._length;
+    var lengths = segmentsLength.lengths;
+    var totalLength = 0;
+    for (i = 0; i < len - 1; i += 1) {
+      lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
+      totalLength += lengths[i].addedLength;
+    }
+    if (closed && len) {
+      lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
+      totalLength += lengths[i].addedLength;
+    }
+    segmentsLength.totalLength = totalLength;
+    return segmentsLength;
+  }
+
+  function BezierData(length) {
+    this.segmentLength = 0;
+    this.points = new Array(length);
+  }
+
+  function PointData(partial, point) {
+    this.partialLength = partial;
+    this.point = point;
+  }
+
+  var buildBezierData = (function () {
+    var storedData = {};
+
+    return function (pt1, pt2, pt3, pt4) {
+      var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
+      if (!storedData[bezierName]) {
+        var curveSegments = defaultCurveSegments;
+        var k;
+        var i;
+        var len;
+        var ptCoord;
+        var perc;
+        var addedLength = 0;
+        var ptDistance;
+        var point;
+        var lastPoint = null;
+        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])) {
+          curveSegments = 2;
+        }
+        var bezierData = new BezierData(curveSegments);
+        len = pt3.length;
+        for (k = 0; k < curveSegments; k += 1) {
+          point = createSizedArray(len);
+          perc = k / (curveSegments - 1);
+          ptDistance = 0;
+          for (i = 0; i < len; i += 1) {
+            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];
+            point[i] = ptCoord;
+            if (lastPoint !== null) {
+              ptDistance += bmPow(point[i] - lastPoint[i], 2);
+            }
+          }
+          ptDistance = bmSqrt(ptDistance);
+          addedLength += ptDistance;
+          bezierData.points[k] = new PointData(ptDistance, point);
+          lastPoint = point;
+        }
+        bezierData.segmentLength = addedLength;
+        storedData[bezierName] = bezierData;
+      }
+      return storedData[bezierName];
+    };
+  }());
+
+  function getDistancePerc(perc, bezierData) {
+    var percents = bezierData.percents;
+    var lengths = bezierData.lengths;
+    var len = percents.length;
+    var initPos = bmFloor((len - 1) * perc);
+    var lengthPos = perc * bezierData.addedLength;
+    var lPerc = 0;
+    if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
+      return percents[initPos];
+    }
+    var dir = lengths[initPos] > lengthPos ? -1 : 1;
+    var flag = true;
+    while (flag) {
+      if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
+        lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
+        flag = false;
+      } else {
+        initPos += dir;
+      }
+      if (initPos < 0 || initPos >= len - 1) {
+        // FIX for TypedArrays that don't store floating point values with enough accuracy
+        if (initPos === len - 1) {
+          return percents[initPos];
+        }
+        flag = false;
+      }
+    }
+    return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
+  }
+
+  function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
+    var t1 = getDistancePerc(percent, bezierData);
+    var u1 = 1 - t1;
+    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;
+    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;
+    return [ptX, ptY];
+  }
+
+  var bezierSegmentPoints = createTypedArray('float32', 8);
+
+  function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
+    if (startPerc < 0) {
+      startPerc = 0;
+    } else if (startPerc > 1) {
+      startPerc = 1;
+    }
+    var t0 = getDistancePerc(startPerc, bezierData);
+    endPerc = endPerc > 1 ? 1 : endPerc;
+    var t1 = getDistancePerc(endPerc, bezierData);
+    var i;
+    var len = pt1.length;
+    var u0 = 1 - t0;
+    var u1 = 1 - t1;
+    var u0u0u0 = u0 * u0 * u0;
+    var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
+    var t0t0t0 = t0 * t0 * t0;
+    //
+    var u0u0u1 = u0 * u0 * u1;
+    var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
+    var t0t0t1 = t0 * t0 * t1;
+    //
+    var u0u1u1 = u0 * u1 * u1;
+    var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
+    var t0t1t1 = t0 * t1 * t1;
+    //
+    var u1u1u1 = u1 * u1 * u1;
+    var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
+    var t1t1t1 = t1 * t1 * t1;
+    for (i = 0; i < len; i += 1) {
+      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
+      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
+      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
+      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
+    }
+
+    return bezierSegmentPoints;
+  }
+
+  return {
+    getSegmentsLength: getSegmentsLength,
+    getNewSegment: getNewSegment,
+    getPointInSegment: getPointInSegment,
+    buildBezierData: buildBezierData,
+    pointOnLine2D: pointOnLine2D,
+    pointOnLine3D: pointOnLine3D,
+  };
 }
 
 var bez = bezFunction();
-function dataFunctionManager(){
 
-    //var tCanvasHelper = createTag('canvas').getContext('2d');
+/* exported dataManager */
 
-    function completeLayers(layers, comps, fontManager){
-        var layerData;
-        var animArray, lastFrame;
-        var i, len = layers.length;
-        var j, jLen, k, kLen;
-        for(i=0;i<len;i+=1){
-            layerData = layers[i];
-            if(!('ks' in layerData) || layerData.completed){
-                continue;
-            }
-            layerData.completed = true;
-            if(layerData.tt){
-                layers[i-1].td = layerData.tt;
-            }
-            animArray = [];
-            lastFrame = -1;
-            if(layerData.hasMask){
-                var maskProps = layerData.masksProperties;
-                jLen = maskProps.length;
-                for(j=0;j<jLen;j+=1){
-                    if(maskProps[j].pt.k.i){
-                        convertPathsToAbsoluteValues(maskProps[j].pt.k);
-                    }else{
-                        kLen = maskProps[j].pt.k.length;
-                        for(k=0;k<kLen;k+=1){
-                            if(maskProps[j].pt.k[k].s){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
-                            }
-                            if(maskProps[j].pt.k[k].e){
-                                convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
-                            }
-                        }
-                    }
-                }
-            }
-            if(layerData.ty===0){
-                layerData.layers = findCompLayers(layerData.refId, comps);
-                completeLayers(layerData.layers,comps, fontManager);
-            }else if(layerData.ty === 4){
-                completeShapes(layerData.shapes);
-            }else if(layerData.ty == 5){
-                completeText(layerData, fontManager);
-            }
+function dataFunctionManager() {
+  // var tCanvasHelper = createTag('canvas').getContext('2d');
+
+  function completeLayers(layers, comps, fontManager) {
+    var layerData;
+    var i;
+    var len = layers.length;
+    var j;
+    var jLen;
+    var k;
+    var kLen;
+    for (i = 0; i < len; i += 1) {
+      layerData = layers[i];
+      if (('ks' in layerData) && !layerData.completed) {
+        layerData.completed = true;
+        if (layerData.tt) {
+          layers[i - 1].td = layerData.tt;
         }
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              convertPathsToAbsoluteValues(maskProps[j].pt.k);
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
+                }
+              }
+            }
+          }
+        }
+        if (layerData.ty === 0) {
+          layerData.layers = findCompLayers(layerData.refId, comps);
+          completeLayers(layerData.layers, comps, fontManager);
+        } else if (layerData.ty === 4) {
+          completeShapes(layerData.shapes);
+        } else if (layerData.ty === 5) {
+          completeText(layerData, fontManager);
+        }
+      }
+    }
+  }
+
+  function findCompLayers(id, comps) {
+    var i = 0;
+    var len = comps.length;
+    while (i < len) {
+      if (comps[i].id === id) {
+        if (!comps[i].layers.__used) {
+          comps[i].layers.__used = true;
+          return comps[i].layers;
+        }
+        return JSON.parse(JSON.stringify(comps[i].layers));
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function completeShapes(arr) {
+    var i;
+    var len = arr.length;
+    var j;
+    var jLen;
+    for (i = len - 1; i >= 0; i -= 1) {
+      if (arr[i].ty === 'sh') {
+        if (arr[i].ks.k.i) {
+          convertPathsToAbsoluteValues(arr[i].ks.k);
+        } else {
+          jLen = arr[i].ks.k.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (arr[i].ks.k[j].s) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
+            }
+            if (arr[i].ks.k[j].e) {
+              convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
+            }
+          }
+        }
+      } else if (arr[i].ty === 'gr') {
+        completeShapes(arr[i].it);
+      }
+    }
+  }
+
+  function convertPathsToAbsoluteValues(path) {
+    var i;
+    var len = path.i.length;
+    for (i = 0; i < len; i += 1) {
+      path.i[i][0] += path.v[i][0];
+      path.i[i][1] += path.v[i][1];
+      path.o[i][0] += path.v[i][0];
+      path.o[i][1] += path.v[i][1];
+    }
+  }
+
+  function checkVersion(minimum, animVersionString) {
+    var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
+    if (minimum[0] > animVersion[0]) {
+      return true;
+    } if (animVersion[0] > minimum[0]) {
+      return false;
+    }
+    if (minimum[1] > animVersion[1]) {
+      return true;
+    } if (animVersion[1] > minimum[1]) {
+      return false;
+    }
+    if (minimum[2] > animVersion[2]) {
+      return true;
+    } if (animVersion[2] > minimum[2]) {
+      return false;
+    }
+    return null;
+  }
+
+  var checkText = (function () {
+    var minimumVersion = [4, 4, 14];
+
+    function updateTextLayer(textLayer) {
+      var documentData = textLayer.t.d;
+      textLayer.t.d = {
+        k: [
+          {
+            s: documentData,
+            t: 0,
+          },
+        ],
+      };
     }
 
-    function findCompLayers(id,comps){
-        var i = 0, len = comps.length;
-        while(i<len){
-            if(comps[i].id === id){
-                if(!comps[i].layers.__used) {
-                    comps[i].layers.__used = true;
-                    return comps[i].layers;
-                }
-                return JSON.parse(JSON.stringify(comps[i].layers));
-            }
-            i += 1;
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 5) {
+          updateTextLayer(layers[i]);
         }
+      }
     }
 
-    function completeShapes(arr){
-        var i, len = arr.length;
-        var j, jLen;
-        var hasPaths = false;
-        for(i=len-1;i>=0;i-=1){
-            if(arr[i].ty == 'sh'){
-                if(arr[i].ks.k.i){
-                    convertPathsToAbsoluteValues(arr[i].ks.k);
-                }else{
-                    jLen = arr[i].ks.k.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(arr[i].ks.k[j].s){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
-                        }
-                        if(arr[i].ks.k[j].e){
-                            convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
-                        }
-                    }
-                }
-                hasPaths = true;
-            }else if(arr[i].ty == 'gr'){
-                completeShapes(arr[i].it);
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
             }
+          }
         }
-        /*if(hasPaths){
-            //mx: distance
-            //ss: sensitivity
-            //dc: decay
-            arr.splice(arr.length-1,0,{
-                "ty": "ms",
-                "mx":20,
-                "ss":10,
-                 "dc":0.001,
-                "maxDist":200
-            });
-        }*/
+      }
+    };
+  }());
+
+  var checkChars = (function () {
+    var minimumVersion = [4, 7, 99];
+    return function (animationData) {
+      if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
+        var i;
+        var len = animationData.chars.length;
+        var j;
+        var jLen;
+        var pathData;
+        var paths;
+        for (i = 0; i < len; i += 1) {
+          if (animationData.chars[i].data && animationData.chars[i].data.shapes) {
+            paths = animationData.chars[i].data.shapes[0].it;
+            jLen = paths.length;
+
+            for (j = 0; j < jLen; j += 1) {
+              pathData = paths[j].ks.k;
+              if (!pathData.__converted) {
+                convertPathsToAbsoluteValues(paths[j].ks.k);
+                pathData.__converted = true;
+              }
+            }
+          }
+        }
+      }
+    };
+  }());
+
+  var checkColors = (function () {
+    var minimumVersion = [4, 1, 9];
+
+    function iterateShapes(shapes) {
+      var i;
+      var len = shapes.length;
+      var j;
+      var jLen;
+      for (i = 0; i < len; i += 1) {
+        if (shapes[i].ty === 'gr') {
+          iterateShapes(shapes[i].it);
+        } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
+          if (shapes[i].c.k && shapes[i].c.k[0].i) {
+            jLen = shapes[i].c.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (shapes[i].c.k[j].s) {
+                shapes[i].c.k[j].s[0] /= 255;
+                shapes[i].c.k[j].s[1] /= 255;
+                shapes[i].c.k[j].s[2] /= 255;
+                shapes[i].c.k[j].s[3] /= 255;
+              }
+              if (shapes[i].c.k[j].e) {
+                shapes[i].c.k[j].e[0] /= 255;
+                shapes[i].c.k[j].e[1] /= 255;
+                shapes[i].c.k[j].e[2] /= 255;
+                shapes[i].c.k[j].e[3] /= 255;
+              }
+            }
+          } else {
+            shapes[i].c.k[0] /= 255;
+            shapes[i].c.k[1] /= 255;
+            shapes[i].c.k[2] /= 255;
+            shapes[i].c.k[3] /= 255;
+          }
+        }
+      }
     }
 
-    function convertPathsToAbsoluteValues(path){
-        var i, len = path.i.length;
-        for(i=0;i<len;i+=1){
-            path.i[i][0] += path.v[i][0];
-            path.i[i][1] += path.v[i][1];
-            path.o[i][0] += path.v[i][0];
-            path.o[i][1] += path.v[i][1];
+    function iterateLayers(layers) {
+      var i;
+      var len = layers.length;
+      for (i = 0; i < len; i += 1) {
+        if (layers[i].ty === 4) {
+          iterateShapes(layers[i].shapes);
         }
+      }
     }
 
-    function checkVersion(minimum,animVersionString){
-        var animVersion = animVersionString ? animVersionString.split('.') : [100,100,100];
-        if(minimum[0]>animVersion[0]){
-            return true;
-        } else if(animVersion[0] > minimum[0]){
-            return false;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
-        if(minimum[1]>animVersion[1]){
-            return true;
-        } else if(animVersion[1] > minimum[1]){
-            return false;
+      }
+    };
+  }());
+
+  var checkShapes = (function () {
+    var minimumVersion = [4, 4, 18];
+
+    function completeClosingShapes(arr) {
+      var i;
+      var len = arr.length;
+      var j;
+      var jLen;
+      for (i = len - 1; i >= 0; i -= 1) {
+        if (arr[i].ty === 'sh') {
+          if (arr[i].ks.k.i) {
+            arr[i].ks.k.c = arr[i].closed;
+          } else {
+            jLen = arr[i].ks.k.length;
+            for (j = 0; j < jLen; j += 1) {
+              if (arr[i].ks.k[j].s) {
+                arr[i].ks.k[j].s[0].c = arr[i].closed;
+              }
+              if (arr[i].ks.k[j].e) {
+                arr[i].ks.k[j].e[0].c = arr[i].closed;
+              }
+            }
+          }
+        } else if (arr[i].ty === 'gr') {
+          completeClosingShapes(arr[i].it);
         }
-        if(minimum[2]>animVersion[2]){
-            return true;
-        } else if(animVersion[2] > minimum[2]){
-            return false;
-        }
+      }
     }
 
-    var checkText = (function(){
-        var minimumVersion = [4,4,14];
-
-        function updateTextLayer(textLayer){
-            var documentData = textLayer.t.d;
-            textLayer.t.d = {
-                k: [
-                    {
-                        s:documentData,
-                        t:0
-                    }
-                ]
-            };
+    function iterateLayers(layers) {
+      var layerData;
+      var i;
+      var len = layers.length;
+      var j;
+      var jLen;
+      var k;
+      var kLen;
+      for (i = 0; i < len; i += 1) {
+        layerData = layers[i];
+        if (layerData.hasMask) {
+          var maskProps = layerData.masksProperties;
+          jLen = maskProps.length;
+          for (j = 0; j < jLen; j += 1) {
+            if (maskProps[j].pt.k.i) {
+              maskProps[j].pt.k.c = maskProps[j].cl;
+            } else {
+              kLen = maskProps[j].pt.k.length;
+              for (k = 0; k < kLen; k += 1) {
+                if (maskProps[j].pt.k[k].s) {
+                  maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
+                }
+                if (maskProps[j].pt.k[k].e) {
+                  maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
+                }
+              }
+            }
+          }
         }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 5){
-                    updateTextLayer(layers[i]);
-                }
-            }
+        if (layerData.ty === 4) {
+          completeClosingShapes(layerData.shapes);
         }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkChars = (function() {
-        var minimumVersion = [4,7,99];
-        return function (animationData){
-            if(animationData.chars && !checkVersion(minimumVersion,animationData.v)){
-                var i, len = animationData.chars.length, j, jLen, k, kLen;
-                var pathData, paths;
-                for(i = 0; i < len; i += 1) {
-                    if(animationData.chars[i].data && animationData.chars[i].data.shapes) {
-                        paths = animationData.chars[i].data.shapes[0].it;
-                        jLen = paths.length;
-
-                        for(j = 0; j < jLen; j += 1) {
-                            pathData = paths[j].ks.k;
-                            if(!pathData.__converted) {
-                                convertPathsToAbsoluteValues(paths[j].ks.k);
-                                pathData.__converted = true;
-                            }
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkColors = (function(){
-        var minimumVersion = [4,1,9];
-
-        function iterateShapes(shapes){
-            var i, len = shapes.length;
-            var j, jLen;
-            for(i=0;i<len;i+=1){
-                if(shapes[i].ty === 'gr'){
-                    iterateShapes(shapes[i].it);
-                }else if(shapes[i].ty === 'fl' || shapes[i].ty === 'st'){
-                    if(shapes[i].c.k && shapes[i].c.k[0].i){
-                        jLen = shapes[i].c.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(shapes[i].c.k[j].s){
-                                shapes[i].c.k[j].s[0] /= 255;
-                                shapes[i].c.k[j].s[1] /= 255;
-                                shapes[i].c.k[j].s[2] /= 255;
-                                shapes[i].c.k[j].s[3] /= 255;
-                            }
-                            if(shapes[i].c.k[j].e){
-                                shapes[i].c.k[j].e[0] /= 255;
-                                shapes[i].c.k[j].e[1] /= 255;
-                                shapes[i].c.k[j].e[2] /= 255;
-                                shapes[i].c.k[j].e[3] /= 255;
-                            }
-                        }
-                    } else {
-                        shapes[i].c.k[0] /= 255;
-                        shapes[i].c.k[1] /= 255;
-                        shapes[i].c.k[2] /= 255;
-                        shapes[i].c.k[3] /= 255;
-                    }
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var i, len = layers.length;
-            for(i=0;i<len;i+=1){
-                if(layers[i].ty === 4){
-                    iterateShapes(layers[i].shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    var checkShapes = (function(){
-        var minimumVersion = [4,4,18];
-
-
-
-        function completeShapes(arr){
-            var i, len = arr.length;
-            var j, jLen;
-            var hasPaths = false;
-            for(i=len-1;i>=0;i-=1){
-                if(arr[i].ty == 'sh'){
-                    if(arr[i].ks.k.i){
-                        arr[i].ks.k.c = arr[i].closed;
-                    }else{
-                        jLen = arr[i].ks.k.length;
-                        for(j=0;j<jLen;j+=1){
-                            if(arr[i].ks.k[j].s){
-                                arr[i].ks.k[j].s[0].c = arr[i].closed;
-                            }
-                            if(arr[i].ks.k[j].e){
-                                arr[i].ks.k[j].e[0].c = arr[i].closed;
-                            }
-                        }
-                    }
-                    hasPaths = true;
-                }else if(arr[i].ty == 'gr'){
-                    completeShapes(arr[i].it);
-                }
-            }
-        }
-
-        function iterateLayers(layers){
-            var layerData;
-            var i, len = layers.length;
-            var j, jLen, k, kLen;
-            for(i=0;i<len;i+=1){
-                layerData = layers[i];
-                if(layerData.hasMask){
-                    var maskProps = layerData.masksProperties;
-                    jLen = maskProps.length;
-                    for(j=0;j<jLen;j+=1){
-                        if(maskProps[j].pt.k.i){
-                            maskProps[j].pt.k.c = maskProps[j].cl;
-                        }else{
-                            kLen = maskProps[j].pt.k.length;
-                            for(k=0;k<kLen;k+=1){
-                                if(maskProps[j].pt.k[k].s){
-                                    maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
-                                }
-                                if(maskProps[j].pt.k[k].e){
-                                    maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
-                                }
-                            }
-                        }
-                    }
-                }
-                if(layerData.ty === 4){
-                    completeShapes(layerData.shapes);
-                }
-            }
-        }
-
-        return function (animationData){
-            if(checkVersion(minimumVersion,animationData.v)){
-                iterateLayers(animationData.layers);
-                if(animationData.assets){
-                    var i, len = animationData.assets.length;
-                    for(i=0;i<len;i+=1){
-                        if(animationData.assets[i].layers){
-                            iterateLayers(animationData.assets[i].layers);
-
-                        }
-                    }
-                }
-            }
-        };
-    }());
-
-    function completeData(animationData, fontManager){
-        if(animationData.__complete){
-            return;
-        }
-        checkColors(animationData);
-        checkText(animationData);
-        checkChars(animationData);
-        checkShapes(animationData);
-        completeLayers(animationData.layers, animationData.assets, fontManager);
-        animationData.__complete = true;
-        //blitAnimation(animationData, animationData.assets, fontManager);
+      }
     }
 
-    function completeText(data, fontManager){
-        if(data.t.a.length === 0 && !('m' in data.t.p)){
-            data.singleShape = true;
+    return function (animationData) {
+      if (checkVersion(minimumVersion, animationData.v)) {
+        iterateLayers(animationData.layers);
+        if (animationData.assets) {
+          var i;
+          var len = animationData.assets.length;
+          for (i = 0; i < len; i += 1) {
+            if (animationData.assets[i].layers) {
+              iterateLayers(animationData.assets[i].layers);
+            }
+          }
         }
+      }
+    };
+  }());
+
+  function completeData(animationData, fontManager) {
+    if (animationData.__complete) {
+      return;
     }
+    checkColors(animationData);
+    checkText(animationData);
+    checkChars(animationData);
+    checkShapes(animationData);
+    completeLayers(animationData.layers, animationData.assets, fontManager);
+    animationData.__complete = true;
+  }
 
-    var moduleOb = {};
-    moduleOb.completeData = completeData;
-    moduleOb.checkColors = checkColors;
-    moduleOb.checkChars = checkChars;
-    moduleOb.checkShapes = checkShapes;
-    moduleOb.completeLayers = completeLayers;
+  function completeText(data) {
+    if (data.t.a.length === 0 && !('m' in data.t.p)) {
+      data.singleShape = true;
+    }
+  }
 
-    return moduleOb;
+  var moduleOb = {};
+  moduleOb.completeData = completeData;
+  moduleOb.checkColors = checkColors;
+  moduleOb.checkChars = checkChars;
+  moduleOb.checkShapes = checkShapes;
+  moduleOb.completeLayers = completeLayers;
+
+  return moduleOb;
 }
 
 var dataManager = dataFunctionManager();
 
-var FontManager = (function(){
+/* exported getFontProperties */
 
-    var maxWaitingTime = 5000;
-    var emptyChar = {
-        w: 0,
-        size:0,
-        shapes:[]
-    };
-    var combinedCharacters = [];
-    //Hindi characters
-    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]);
+function getFontProperties(fontData) {
+  var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
 
-    function trimFontOptions(font) {
-        var familyArray = font.split(',');
-        var i, len = familyArray.length;
-        var enabledFamilies = [];
-        for (i = 0; i < len; i += 1) {
-            if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
-                enabledFamilies.push(familyArray[i]);
-            }
-        }
-        return enabledFamilies.join(',');
+  var fWeight = 'normal'; var
+    fStyle = 'normal';
+  var len = styles.length;
+  var styleName;
+  for (var i = 0; i < len; i += 1) {
+    styleName = styles[i].toLowerCase();
+    switch (styleName) {
+      case 'italic':
+        fStyle = 'italic';
+        break;
+      case 'bold':
+        fWeight = '700';
+        break;
+      case 'black':
+        fWeight = '900';
+        break;
+      case 'medium':
+        fWeight = '500';
+        break;
+      case 'regular':
+      case 'normal':
+        fWeight = '400';
+        break;
+      case 'light':
+      case 'thin':
+        fWeight = '200';
+        break;
+      default:
+        break;
     }
+  }
 
-    function setUpNode(font, family){
-        var parentNode = createTag('span');
-        parentNode.style.fontFamily    = family;
-        var node = createTag('span');
-        // Characters that vary significantly among different fonts
-        node.innerText = 'giItT1WQy@!-/#';
-        // Visible - so we can measure it - but not on the screen
-        parentNode.style.position      = 'absolute';
-        parentNode.style.left          = '-10000px';
-        parentNode.style.top           = '-10000px';
-        // Large font size makes even subtle changes obvious
-        parentNode.style.fontSize      = '300px';
-        // Reset any font properties
-        parentNode.style.fontVariant   = 'normal';
-        parentNode.style.fontStyle     = 'normal';
-        parentNode.style.fontWeight    = 'normal';
-        parentNode.style.letterSpacing = '0';
-        parentNode.appendChild(node);
-        document.body.appendChild(parentNode);
-
-        // Remember width with no applied web font
-        var width = node.offsetWidth;
-        node.style.fontFamily = trimFontOptions(font) + ', ' + family;
-        return {node:node, w:width, parent:parentNode};
-    }
-
-    function checkLoadedFonts() {
-        var i, len = this.fonts.length;
-        var node, w;
-        var loadedCount = len;
-        for(i=0;i<len; i+= 1){
-            if(this.fonts[i].loaded){
-                loadedCount -= 1;
-                continue;
-            }
-            if(this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0){
-                this.fonts[i].loaded = true;
-            } else{
-                node = this.fonts[i].monoCase.node;
-                w = this.fonts[i].monoCase.w;
-                if(node.offsetWidth !== w){
-                    loadedCount -= 1;
-                    this.fonts[i].loaded = true;
-                }else{
-                    node = this.fonts[i].sansCase.node;
-                    w = this.fonts[i].sansCase.w;
-                    if(node.offsetWidth !== w){
-                        loadedCount -= 1;
-                        this.fonts[i].loaded = true;
-                    }
-                }
-                if(this.fonts[i].loaded){
-                    this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
-                    this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
-                }
-            }
-        }
-
-        if(loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime){
-            setTimeout(this.checkLoadedFontsBinded, 20);
-        }else{
-            setTimeout(this.setIsLoadedBinded, 10);
-
-        }
-    }
-
-    function createHelper(def, fontData){
-        var tHelper = createNS('text');
-        tHelper.style.fontSize = '100px';
-        //tHelper.style.fontFamily = fontData.fFamily;
-        tHelper.setAttribute('font-family', fontData.fFamily);
-        tHelper.setAttribute('font-style', fontData.fStyle);
-        tHelper.setAttribute('font-weight', fontData.fWeight);
-        tHelper.textContent = '1';
-        if(fontData.fClass){
-            tHelper.style.fontFamily = 'inherit';
-            tHelper.setAttribute('class', fontData.fClass);
-        } else {
-            tHelper.style.fontFamily = fontData.fFamily;
-        }
-        def.appendChild(tHelper);
-        var tCanvasHelper = createTag('canvas').getContext('2d');
-        tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px '+ fontData.fFamily;
-        //tCanvasHelper.font = ' 100px '+ fontData.fFamily;
-        return tHelper;
-    }
-
-    function addFonts(fontData, defs){
-        if(!fontData){
-            this.isLoaded = true;
-            return;
-        }
-        if(this.chars){
-            this.isLoaded = true;
-            this.fonts = fontData.list;
-            return;
-        }
-
-
-        var fontArr = fontData.list;
-        var i, len = fontArr.length;
-        var _pendingFonts = len;
-        for(i=0; i<len; i+= 1){
-            var shouldLoadFont = true;
-            var loadedSelector;
-            var j;
-            fontArr[i].loaded = false;
-            fontArr[i].monoCase = setUpNode(fontArr[i].fFamily,'monospace');
-            fontArr[i].sansCase = setUpNode(fontArr[i].fFamily,'sans-serif');
-            if(!fontArr[i].fPath) {
-                fontArr[i].loaded = true;
-                _pendingFonts -= 1;
-            }else if(fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3){
-                loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="'+ fontArr[i].fFamily +'"], style[f-origin="3"][f-family="'+ fontArr[i].fFamily +'"]');
-
-                if (loadedSelector.length > 0) {
-                    shouldLoadFont = false;
-                }
-
-                if (shouldLoadFont) {
-                    var s = createTag('style');
-                    s.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    s.setAttribute('f-origin', fontArr[i].origin);
-                    s.setAttribute('f-family', fontArr[i].fFamily);
-                    s.type = "text/css";
-                    s.innerText = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}";
-                    defs.appendChild(s);
-                }
-            } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){
-                loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var l = createTag('link');
-                    l.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    l.setAttribute('f-origin', fontArr[i].origin);
-                    l.type = "text/css";
-                    l.rel = "stylesheet";
-                    l.href = fontArr[i].fPath;
-                    document.body.appendChild(l);
-                }
-            } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){
-                loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
-
-                for (j = 0; j < loadedSelector.length; j++) {
-                    if (fontArr[i].fPath === loadedSelector[j].src) {
-                        // Font is already loaded
-                        shouldLoadFont = false;
-                    }
-                }
-
-                if (shouldLoadFont) {
-                    var sc = createTag('link');
-                    sc.setAttribute('f-forigin', fontArr[i].fOrigin);
-                    sc.setAttribute('f-origin', fontArr[i].origin);
-                    sc.setAttribute('rel','stylesheet');
-                    sc.setAttribute('href',fontArr[i].fPath);
-                    defs.appendChild(sc);
-                }
-            }
-            fontArr[i].helper = createHelper(defs,fontArr[i]);
-            fontArr[i].cache = {};
-            this.fonts.push(fontArr[i]);
-        }
-        if (_pendingFonts === 0) {
-            this.isLoaded = true;
-        } else {
-            //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
-            //Adding this timeout seems to fix it
-           setTimeout(this.checkLoadedFonts.bind(this), 100);
-        }
-    }
-
-    function addChars(chars){
-        if(!chars){
-            return;
-        }
-        if(!this.chars){
-            this.chars = [];
-        }
-        var i, len = chars.length;
-        var j, jLen = this.chars.length, found;
-        for(i=0;i<len;i+=1){
-            j = 0;
-            found = false;
-            while(j<jLen){
-                if(this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch){
-                    found = true;
-                }
-                j += 1;
-            }
-            if(!found){
-                this.chars.push(chars[i]);
-                jLen += 1;
-            }
-        }
-    }
-
-    function getCharData(char, style, font){
-        var i = 0, len = this.chars.length;
-        while( i < len) {
-            if(this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font){
-
-                return this.chars[i];
-            }
-            i+= 1;
-        }
-        if ((typeof char === 'string' && char.charCodeAt(0) !== 13 || !char)
-            && console
-            && console.warn
-            && !this._warned
-           ) {
-            this._warned = true
-            console.warn('Missing character from exported characters list: ', char, style, font);
-        }
-        return emptyChar;
-    }
-
-    function measureText(char, fontName, size) {
-        var fontData = this.getFontByName(fontName);
-        var index = char.charCodeAt(0);
-        if(!fontData.cache[index + 1]) {
-            var tHelper = fontData.helper;
-            //Canvas version
-            //fontData.cache[index] = tHelper.measureText(char).width / 100;
-            //SVG version
-            //console.log(tHelper.getBBox().width)
-            if (char === ' ') {
-                tHelper.textContent = '|' + char + '|';
-                var doubleSize = tHelper.getComputedTextLength();
-                tHelper.textContent = '||';
-                var singleSize = tHelper.getComputedTextLength();
-                fontData.cache[index + 1] = (doubleSize - singleSize)/100;
-            } else {
-                tHelper.textContent = char;
-                fontData.cache[index + 1] = (tHelper.getComputedTextLength())/100;
-            }
-        }
-        return fontData.cache[index + 1] * size;
-    }
-
-    function getFontByName(name){
-        var i = 0, len = this.fonts.length;
-        while(i<len){
-            if(this.fonts[i].fName === name) {
-                return this.fonts[i];
-            }
-            i += 1;
-        }
-        return this.fonts[0];
-    }
-
-    function getCombinedCharacterCodes() {
-        return combinedCharacters;
-    }
-
-    function setIsLoaded() {
-        this.isLoaded = true
-    }
-
-    var Font = function(){
-        this.fonts = [];
-        this.chars = null;
-        this.typekitLoaded = 0;
-        this.isLoaded = false;
-        this._warned = false;
-        this.initTime = Date.now();
-        this.setIsLoadedBinded = this.setIsLoaded.bind(this)
-        this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this)
-    };
-    //TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it. 
-    Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
-
-    var fontPrototype = {
-        addChars: addChars,
-        addFonts: addFonts,
-        getCharData: getCharData,
-        getFontByName: getFontByName,
-        measureText: measureText,
-        checkLoadedFonts: checkLoadedFonts,
-        setIsLoaded: setIsLoaded,
-    }
-
-    Font.prototype = fontPrototype;
-
-    return Font;
-
-}());
-
-var PropertyFactory = (function(){
-
-    var initFrame = initialDefaultFrame;
-    var math_abs = Math.abs;
-
-    function interpolateValue(frameNum, caching) {
-        var offsetTime = this.offsetTime;
-        var newValue;
-        if (this.propType === 'multidimensional') {
-            newValue = createTypedArray('float32', this.pv.length);
-        }
-        var iterationIndex = caching.lastIndex;
-        var i = iterationIndex;
-        var len = this.keyframes.length - 1, flag = true;
-        var keyData, nextKeyData;
-
-        while (flag) {
-            keyData = this.keyframes[i];
-            nextKeyData = this.keyframes[i + 1];
-            if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime){
-                if(keyData.h){
-                    keyData = nextKeyData;
-                }
-                iterationIndex = 0;
-                break;
-            }
-            if ((nextKeyData.t - offsetTime) > frameNum){
-                iterationIndex = i;
-                break;
-            }
-            if (i < len - 1){
-                i += 1;
-            } else {
-                iterationIndex = 0;
-                flag = false;
-            }
-        }
-
-        var k, kLen, perc, jLen, j, fnc;
-        var nextKeyTime = nextKeyData.t - offsetTime;
-        var keyTime = keyData.t - offsetTime;
-        var endValue;
-        if (keyData.to) {
-            if (!keyData.bezierData) {
-                keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
-            }
-            var bezierData = keyData.bezierData;
-            if (frameNum >= nextKeyTime || frameNum < keyTime) {
-                var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
-                kLen = bezierData.points[ind].point.length;
-                for (k = 0; k < kLen; k += 1) {
-                    newValue[k] = bezierData.points[ind].point[k];
-                }
-                // caching._lastKeyframeIndex = -1;
-            } else {
-                if (keyData.__fnct) {
-                    fnc = keyData.__fnct;
-                } else {
-                    fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
-                    keyData.__fnct = fnc;
-                }
-                perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
-                var distanceInLine = bezierData.segmentLength*perc;
-
-                var segmentPerc;
-                var addedLength =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
-                j =  (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
-                flag = true;
-                jLen = bezierData.points.length;
-                while (flag) {
-                    addedLength += bezierData.points[j].partialLength;
-                    if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k];
-                        }
-                        break;
-                    } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
-                        segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
-                        kLen = bezierData.points[j].point.length;
-                        for (k = 0; k < kLen; k += 1) {
-                            newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
-                        }
-                        break;
-                    }
-                    if (j < jLen - 1){
-                        j += 1;
-                    } else {
-                        flag = false;
-                    }
-                }
-                caching._lastPoint = j;
-                caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
-                caching._lastKeyframeIndex = i;
-            }
-        } else {
-            var outX, outY, inX, inY, keyValue;
-            len = keyData.s.length;
-            endValue = nextKeyData.s || keyData.e;
-            if (this.sh && keyData.h !== 1) {
-                if (frameNum >= nextKeyTime) {
-                    newValue[0] = endValue[0];
-                    newValue[1] = endValue[1];
-                    newValue[2] = endValue[2];
-                } else if (frameNum <= keyTime) {
-                    newValue[0] = keyData.s[0];
-                    newValue[1] = keyData.s[1];
-                    newValue[2] = keyData.s[2];
-                } else {
-                    var quatStart = createQuaternion(keyData.s);
-                    var quatEnd = createQuaternion(endValue);
-                    var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
-                    quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
-                }
-                
-            } else {
-                for(i = 0; i < len; i += 1) {
-                    if (keyData.h !== 1) {
-                        if (frameNum >= nextKeyTime) {
-                            perc = 1;
-                        } else if(frameNum < keyTime) {
-                            perc = 0;
-                        } else {
-                            if(keyData.o.x.constructor === Array) {
-                                if (!keyData.__fnct) {
-                                    keyData.__fnct = [];
-                                }
-                                if (!keyData.__fnct[i]) {
-                                    outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
-                                    outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
-                                    inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
-                                    inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct[i] = fnc;
-                                } else {
-                                    fnc = keyData.__fnct[i];
-                                }
-                            } else {
-                                if (!keyData.__fnct) {
-                                    outX = keyData.o.x;
-                                    outY = keyData.o.y;
-                                    inX = keyData.i.x;
-                                    inY = keyData.i.y;
-                                    fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
-                                    keyData.__fnct = fnc;
-                                } else {
-                                    fnc = keyData.__fnct;
-                                }
-                            }
-                            perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime ));
-                        }
-                    }
-
-                    endValue = nextKeyData.s || keyData.e;
-                    keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
-
-                    if (this.propType === 'multidimensional') {
-                        newValue[i] = keyValue;
-                    } else {
-                        newValue = keyValue;
-                    }
-                }
-            }
-        }
-        caching.lastIndex = iterationIndex;
-        return newValue;
-    }
-
-    //based on @Toji's https://github.com/toji/gl-matrix/
-    function slerp(a, b, t) {
-        var out = [];
-        var ax = a[0], ay = a[1], az = a[2], aw = a[3],
-        bx = b[0], by = b[1], bz = b[2], bw = b[3]
-
-        var omega, cosom, sinom, scale0, scale1;
-
-        cosom = ax * bx + ay * by + az * bz + aw * bw;
-        if (cosom < 0.0) {
-            cosom = -cosom;
-            bx = -bx;
-            by = -by;
-            bz = -bz;
-            bw = -bw;
-        }
-        if ((1.0 - cosom) > 0.000001) {
-            omega = Math.acos(cosom);
-            sinom = Math.sin(omega);
-            scale0 = Math.sin((1.0 - t) * omega) / sinom;
-            scale1 = Math.sin(t * omega) / sinom;
-        } else {
-            scale0 = 1.0 - t;
-            scale1 = t;
-        }
-        out[0] = scale0 * ax + scale1 * bx;
-        out[1] = scale0 * ay + scale1 * by;
-        out[2] = scale0 * az + scale1 * bz;
-        out[3] = scale0 * aw + scale1 * bw;
-
-        return out;
-    }
-
-    function quaternionToEuler(out, quat) {
-        var qx = quat[0];
-        var qy = quat[1];
-        var qz = quat[2];
-        var qw = quat[3];
-        var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz)
-        var attitude = Math.asin(2*qx*qy + 2*qz*qw) 
-        var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz);
-        out[0] = heading/degToRads;
-        out[1] = attitude/degToRads;
-        out[2] = bank/degToRads;
-    }
-
-    function createQuaternion(values) {
-        var heading = values[0] * degToRads;
-        var attitude = values[1] * degToRads;
-        var bank = values[2] * degToRads;
-        var c1 = Math.cos(heading / 2);
-        var c2 = Math.cos(attitude / 2);
-        var c3 = Math.cos(bank / 2);
-        var s1 = Math.sin(heading / 2);
-        var s2 = Math.sin(attitude / 2);
-        var s3 = Math.sin(bank / 2);
-        var w = c1 * c2 * c3 - s1 * s2 * s3;
-        var x = s1 * s2 * c3 + c1 * c2 * s3;
-        var y = s1 * c2 * c3 + c1 * s2 * s3;
-        var z = c1 * s2 * c3 - s1 * c2 * s3;
-
-        return [x,y,z,w];
-    }
-
-    function getValueAtCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
-        if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
-            if(this._caching.lastFrame >= frameNum) {
-                this._caching._lastKeyframeIndex = -1;
-                this._caching.lastIndex = 0;
-            }
-
-            var renderResult = this.interpolateValue(frameNum, this._caching);
-            this.pv = renderResult;
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
-    }
-
-    function setVValue(val) {
-        var multipliedValue;
-        if(this.propType === 'unidimensional') {
-            multipliedValue = val * this.mult;
-            if(math_abs(this.v - multipliedValue) > 0.00001) {
-                this.v = multipliedValue;
-                this._mdf = true;
-            }
-        } else {
-            var i = 0, len = this.v.length;
-            while (i < len) {
-                multipliedValue = val[i] * this.mult;
-                if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
-                    this.v[i] = multipliedValue;
-                    this._mdf = true;
-                }
-                i += 1;
-            }
-        }
-    }
-
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
-            return;
-        }
-        if(this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = this._isFirstFrame;
-        var multipliedValue;
-        var i, len = this.effectsSequence.length;
-        var finalValue = this.kf ? this.pv : this.data.k;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this._isFirstFrame = false;
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
-    }
-
-    function ValueProperty(elem, data, mult, container){
-        this.propType = 'unidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this.v = mult ? data.k * mult : data.k;
-        this.pv = data.k;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.vel = 0;
-        this.effectsSequence = [];
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function MultiDimensionalProperty(elem, data, mult, container) {
-        this.propType = 'multidimensional';
-        this.mult = mult || 1;
-        this.data = data;
-        this._mdf = false;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.k = false;
-        this.kf = false;
-        this.frameId = -1;
-        var i, len = data.k.length;
-        this.v = createTypedArray('float32', len);
-        this.pv = createTypedArray('float32', len);
-        var arr = createTypedArray('float32', len);
-        this.vel = createTypedArray('float32', len);
-        for (i = 0; i < len; i += 1) {
-            this.v[i] = data.k[i] * this.mult;
-            this.pv[i] = data.k[i];
-        }
-        this._isFirstFrame = true;
-        this.effectsSequence = [];
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedValueProperty(elem, data, mult, container) {
-        this.propType = 'unidimensional';
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.frameId = -1;
-        this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
-        this.k = true;
-        this.kf = true;
-        this.data = data;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.v = initFrame;
-        this.pv = initFrame;
-        this._isFirstFrame = true;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.addEffect = addEffect;
-    }
-
-    function KeyframedMultidimensionalProperty(elem, data, mult, container){
-        this.propType = 'multidimensional';
-        var i, len = data.k.length;
-        var s, e,to,ti;
-        for (i = 0; i < len - 1; i += 1) {
-            if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
-                s = data.k[i].s;
-                e = data.k[i + 1].s;
-                to = data.k[i].to;
-                ti = data.k[i].ti;
-                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]))){
-                    data.k[i].to = null;
-                    data.k[i].ti = null;
-                }
-                if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
-                    if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
-                        data.k[i].to = null;
-                        data.k[i].ti = null;
-                    }
-                }
-            }
-        }
-        this.effectsSequence = [getValueAtCurrentTime.bind(this)];
-        this.data = data;
-        this.keyframes = data.k;
-        this.offsetTime = elem.data.st;
-        this.k = true;
-        this.kf = true;
-        this._isFirstFrame = true;
-        this.mult = mult || 1;
-        this.elem = elem;
-        this.container = container;
-        this.comp = elem.comp;
-        this.getValue = processEffectsSequence;
-        this.setVValue = setVValue;
-        this.interpolateValue = interpolateValue;
-        this.frameId = -1;
-        var arrLen = data.k[0].s.length;
-        this.v = createTypedArray('float32', arrLen);
-        this.pv = createTypedArray('float32', arrLen);
-        for (i = 0; i < arrLen; i += 1) {
-            this.v[i] = initFrame;
-            this.pv[i] = initFrame;
-        }
-        this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)};
-        this.addEffect = addEffect;
-    }
-
-    function getProp(elem,data,type, mult, container) {
-        var p;
-        if(!data.k.length){
-            p = new ValueProperty(elem,data, mult, container);
-        }else if(typeof(data.k[0]) === 'number'){
-            p = new MultiDimensionalProperty(elem,data, mult, container);
-        }else{
-            switch(type){
-                case 0:
-                    p = new KeyframedValueProperty(elem,data,mult, container);
-                    break;
-                case 1:
-                    p = new KeyframedMultidimensionalProperty(elem,data,mult, container);
-                    break;
-            }
-        }
-        if(p.effectsSequence.length){
-            container.addDynamicProperty(p);
-        }
-        return p;
-    }
-
-    var ob = {
-        getProp: getProp
-    };
-    return ob;
-}());
-var TransformPropertyFactory = (function() {
-
-    var defaultVector = [0,0]
-
-    function applyToMatrix(mat) {
-        var _mdf = this._mdf;
-        this.iterateDynamicProperties();
-        this._mdf = this._mdf || _mdf;
-        if (this.a) {
-            mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-        }
-        if (this.s) {
-            mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-        }
-        if (this.sk) {
-            mat.skewFromAxis(-this.sk.v, this.sa.v);
-        }
-        if (this.r) {
-            mat.rotate(-this.r.v);
-        } else {
-            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]);
-        }
-        if (this.data.p.s) {
-            if (this.data.p.z) {
-                mat.translate(this.px.v, this.py.v, -this.pz.v);
-            } else {
-                mat.translate(this.px.v, this.py.v, 0);
-            }
-        } else {
-            mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
-        }
-    }
-    function processKeys(forceRender){
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        }
-        if(this._isDirty) {
-            this.precalculateMatrix();
-            this._isDirty = false;
-        }
-
-        this.iterateDynamicProperties();
-
-        if (this._mdf || forceRender) {
-            this.v.cloneFromProps(this.pre.props);
-            if (this.appliedTransformations < 1) {
-                this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            }
-            if(this.appliedTransformations < 2) {
-                this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            }
-            if (this.sk && this.appliedTransformations < 3) {
-                this.v.skewFromAxis(-this.sk.v, this.sa.v);
-            }
-            if (this.r && this.appliedTransformations < 4) {
-                this.v.rotate(-this.r.v);
-            } else if (!this.r && this.appliedTransformations < 4){
-                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]);
-            }
-            if (this.autoOriented) {
-                var v1,v2, frameRate = this.elem.globalData.frameRate;
-                if(this.p && this.p.keyframes && this.p.getValueAtTime) {
-                    if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0);
-                        v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
-                    } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
-                        v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
-                        v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
-                    } else {
-                        v1 = this.p.pv;
-                        v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
-                    }
-                } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
-                    v1 = [];
-                    v2 = [];
-                    var px = this.px, py = this.py, frameRate;
-                    if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0);
-                        v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0);
-                        v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0);
-                    } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
-                        v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0);
-                        v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0);
-                        v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0);
-                        v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0);
-                    } else {
-                        v1 = [px.pv, py.pv];
-                        v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime);
-                        v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime);
-                    }
-                } else {
-                    v1 = v2 = defaultVector
-                }
-                this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
-            }
-            if(this.data.p && this.data.p.s){
-                if(this.data.p.z) {
-                    this.v.translate(this.px.v, this.py.v, -this.pz.v);
-                } else {
-                    this.v.translate(this.px.v, this.py.v, 0);
-                }
-            }else{
-                this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
-            }
-        }
-        this.frameId = this.elem.globalData.frameId;
-    }
-
-    function precalculateMatrix() {
-        if(!this.a.k) {
-            this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
-            this.appliedTransformations = 1;
-        } else {
-            return;
-        }
-        if(!this.s.effectsSequence.length) {
-            this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
-            this.appliedTransformations = 2;
-        } else {
-            return;
-        }
-        if(this.sk) {
-            if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
-                this.pre.skewFromAxis(-this.sk.v, this.sa.v);
-            this.appliedTransformations = 3;
-            } else {
-                return;
-            }
-        }
-        if (this.r) {
-            if(!this.r.effectsSequence.length) {
-                this.pre.rotate(-this.r.v);
-                this.appliedTransformations = 4;
-            } else {
-                return;
-            }
-        } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
-            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]);
-            this.appliedTransformations = 4;
-        }
-    }
-
-    function autoOrient(){
-        //
-        //var prevP = this.getValueAtTime();
-    }
-
-    function addDynamicProperty(prop) {
-        this._addDynamicProperty(prop);
-        this.elem.addDynamicProperty(prop);
-        this._isDirty = true;
-    }
-
-    function TransformProperty(elem,data,container){
-        this.elem = elem;
-        this.frameId = -1;
-        this.propType = 'transform';
-        this.data = data;
-        this.v = new Matrix();
-        //Precalculated matrix with non animated properties
-        this.pre = new Matrix();
-        this.appliedTransformations = 0;
-        this.initDynamicPropertyContainer(container || elem);
-        if(data.p && data.p.s){
-            this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
-            this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
-            if(data.p.z){
-                this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this);
-            }
-        }else{
-            this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this);
-        }
-        if(data.rx) {
-            this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
-            this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
-            this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
-            if(data.or.k[0].ti) {
-                var i, len = data.or.k.length;
-                for(i=0;i<len;i+=1) {
-                    data.or.k[i].to = data.or.k[i].ti = null;
-                }
-            }
-            this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
-            //sh Indicates it needs to be capped between -180 and 180
-            this.or.sh = true;
-        } else {
-            this.r = PropertyFactory.getProp(elem, data.r || {k: 0}, 0, degToRads, this);
-        }
-        if(data.sk){
-            this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
-            this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
-        }
-        this.a = PropertyFactory.getProp(elem,data.a || {k:[0,0,0]},1,0,this);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:[100,100,100]},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.
-        if(data.o){
-            this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
-        } else {
-            this.o = {_mdf:false,v:1};
-        }
-        this._isDirty = true;
-        if(!this.dynamicProperties.length){
-            this.getValue(true);
-        }
-    }
-
-    TransformProperty.prototype = {
-        applyToMatrix: applyToMatrix,
-        getValue: processKeys,
-        precalculateMatrix: precalculateMatrix,
-        autoOrient: autoOrient
-    }
-
-    extendPrototype([DynamicPropertyContainer], TransformProperty);
-    TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
-    TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
-
-    function getTransformProperty(elem,data,container){
-        return new TransformProperty(elem,data,container);
-    }
-
-    return {
-        getTransformProperty: getTransformProperty
-    };
-
-}());
-function ShapePath(){
-	this.c = false;
-	this._length = 0;
-	this._maxLength = 8;
-	this.v = createSizedArray(this._maxLength);
-	this.o = createSizedArray(this._maxLength);
-	this.i = createSizedArray(this._maxLength);
+  return {
+    style: fStyle,
+    weight: fontData.fWeight || fWeight,
+  };
 }
 
-ShapePath.prototype.setPathData = function(closed, len) {
-	this.c = closed;
-	this.setLength(len);
-	var i = 0;
-	while(i < len){
-		this.v[i] = point_pool.newElement();
-		this.o[i] = point_pool.newElement();
-		this.i[i] = point_pool.newElement();
-		i += 1;
-	}
-};
+/* global createNS, createTag, getFontProperties */
+/* exported FontManager */
 
-ShapePath.prototype.setLength = function(len) {
-	while(this._maxLength < len) {
-		this.doubleArrayLength();
-	}
-	this._length = len;
-};
+var FontManager = (function () {
+  var maxWaitingTime = 5000;
+  var emptyChar = {
+    w: 0,
+    size: 0,
+    shapes: [],
+  };
+  var combinedCharacters = [];
+  // Hindi characters
+  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]);
 
-ShapePath.prototype.doubleArrayLength = function() {
-	this.v = this.v.concat(createSizedArray(this._maxLength));
-	this.i = this.i.concat(createSizedArray(this._maxLength));
-	this.o = this.o.concat(createSizedArray(this._maxLength));
-	this._maxLength *= 2;
-};
-
-ShapePath.prototype.setXYAt = function(x, y, type, pos, replace) {
-	var arr;
-	this._length = Math.max(this._length, pos + 1);
-	if(this._length >= this._maxLength) {
-		this.doubleArrayLength();
-	}
-	switch(type){
-		case 'v':
-			arr = this.v;
-			break;
-		case 'i':
-			arr = this.i;
-			break;
-		case 'o':
-			arr = this.o;
-			break;
-	}
-	if(!arr[pos] || (arr[pos] && !replace)){
-		arr[pos] = point_pool.newElement();
-	}
-	arr[pos][0] = x;
-	arr[pos][1] = y;
-};
-
-ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) {
-	this.setXYAt(vX,vY,'v',pos, replace);
-	this.setXYAt(oX,oY,'o',pos, replace);
-	this.setXYAt(iX,iY,'i',pos, replace);
-};
-
-ShapePath.prototype.reverse = function() {
-	var newPath = new ShapePath();
-	newPath.setPathData(this.c, this._length);
-	var vertices = this.v, outPoints = this.o, inPoints = this.i;
-	var init = 0;
-	if (this.c) {
-		newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
-        init = 1;
-    }
-    var cnt = this._length - 1;
-    var len = this._length;
-
+  function trimFontOptions(font) {
+    var familyArray = font.split(',');
     var i;
-    for (i = init; i < len; i += 1) {
-    	newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
-        cnt -= 1;
+    var len = familyArray.length;
+    var enabledFamilies = [];
+    for (i = 0; i < len; i += 1) {
+      if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
+        enabledFamilies.push(familyArray[i]);
+      }
     }
-    return newPath;
+    return enabledFamilies.join(',');
+  }
+
+  function setUpNode(font, family) {
+    var parentNode = createTag('span');
+    parentNode.style.fontFamily = family;
+    var node = createTag('span');
+    // Characters that vary significantly among different fonts
+    node.innerText = 'giItT1WQy@!-/#';
+    // Visible - so we can measure it - but not on the screen
+    parentNode.style.position = 'absolute';
+    parentNode.style.left = '-10000px';
+    parentNode.style.top = '-10000px';
+    // Large font size makes even subtle changes obvious
+    parentNode.style.fontSize = '300px';
+    // Reset any font properties
+    parentNode.style.fontVariant = 'normal';
+    parentNode.style.fontStyle = 'normal';
+    parentNode.style.fontWeight = 'normal';
+    parentNode.style.letterSpacing = '0';
+    parentNode.appendChild(node);
+    document.body.appendChild(parentNode);
+
+    // Remember width with no applied web font
+    var width = node.offsetWidth;
+    node.style.fontFamily = trimFontOptions(font) + ', ' + family;
+    return { node: node, w: width, parent: parentNode };
+  }
+
+  function checkLoadedFonts() {
+    var i;
+    var len = this.fonts.length;
+    var node;
+    var w;
+    var loadedCount = len;
+    for (i = 0; i < len; i += 1) {
+      if (this.fonts[i].loaded) {
+        loadedCount -= 1;
+      } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
+        this.fonts[i].loaded = true;
+      } else {
+        node = this.fonts[i].monoCase.node;
+        w = this.fonts[i].monoCase.w;
+        if (node.offsetWidth !== w) {
+          loadedCount -= 1;
+          this.fonts[i].loaded = true;
+        } else {
+          node = this.fonts[i].sansCase.node;
+          w = this.fonts[i].sansCase.w;
+          if (node.offsetWidth !== w) {
+            loadedCount -= 1;
+            this.fonts[i].loaded = true;
+          }
+        }
+        if (this.fonts[i].loaded) {
+          this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
+          this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
+        }
+      }
+    }
+
+    if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
+      setTimeout(this.checkLoadedFontsBinded, 20);
+    } else {
+      setTimeout(this.setIsLoadedBinded, 10);
+    }
+  }
+
+  function createHelper(def, fontData) {
+    var tHelper = createNS('text');
+    tHelper.style.fontSize = '100px';
+    // tHelper.style.fontFamily = fontData.fFamily;
+
+    var fontProps = getFontProperties(fontData);
+    tHelper.setAttribute('font-family', fontData.fFamily);
+    tHelper.setAttribute('font-style', fontProps.style);
+    tHelper.setAttribute('font-weight', fontProps.weight);
+    tHelper.textContent = '1';
+    if (fontData.fClass) {
+      tHelper.style.fontFamily = 'inherit';
+      tHelper.setAttribute('class', fontData.fClass);
+    } else {
+      tHelper.style.fontFamily = fontData.fFamily;
+    }
+    def.appendChild(tHelper);
+    var tCanvasHelper = createTag('canvas').getContext('2d');
+    tCanvasHelper.font = fontData.fWeight + ' ' + fontData.fStyle + ' 100px ' + fontData.fFamily;
+    // tCanvasHelper.font = ' 100px '+ fontData.fFamily;
+    return tHelper;
+  }
+
+  function addFonts(fontData, defs) {
+    if (!fontData) {
+      this.isLoaded = true;
+      return;
+    }
+    if (this.chars) {
+      this.isLoaded = true;
+      this.fonts = fontData.list;
+      return;
+    }
+
+    var fontArr = fontData.list;
+    var i;
+    var len = fontArr.length;
+    var _pendingFonts = len;
+    for (i = 0; i < len; i += 1) {
+      var shouldLoadFont = true;
+      var loadedSelector;
+      var j;
+      fontArr[i].loaded = false;
+      fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
+      fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
+      if (!fontArr[i].fPath) {
+        fontArr[i].loaded = true;
+        _pendingFonts -= 1;
+      } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
+        loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
+
+        if (loadedSelector.length > 0) {
+          shouldLoadFont = false;
+        }
+
+        if (shouldLoadFont) {
+          var s = createTag('style');
+          s.setAttribute('f-forigin', fontArr[i].fOrigin);
+          s.setAttribute('f-origin', fontArr[i].origin);
+          s.setAttribute('f-family', fontArr[i].fFamily);
+          s.type = 'text/css';
+          s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
+          defs.appendChild(s);
+        }
+      } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
+        loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var l = createTag('link');
+          l.setAttribute('f-forigin', fontArr[i].fOrigin);
+          l.setAttribute('f-origin', fontArr[i].origin);
+          l.type = 'text/css';
+          l.rel = 'stylesheet';
+          l.href = fontArr[i].fPath;
+          document.body.appendChild(l);
+        }
+      } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
+        loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
+
+        for (j = 0; j < loadedSelector.length; j += 1) {
+          if (fontArr[i].fPath === loadedSelector[j].src) {
+            // Font is already loaded
+            shouldLoadFont = false;
+          }
+        }
+
+        if (shouldLoadFont) {
+          var sc = createTag('link');
+          sc.setAttribute('f-forigin', fontArr[i].fOrigin);
+          sc.setAttribute('f-origin', fontArr[i].origin);
+          sc.setAttribute('rel', 'stylesheet');
+          sc.setAttribute('href', fontArr[i].fPath);
+          defs.appendChild(sc);
+        }
+      }
+      fontArr[i].helper = createHelper(defs, fontArr[i]);
+      fontArr[i].cache = {};
+      this.fonts.push(fontArr[i]);
+    }
+    if (_pendingFonts === 0) {
+      this.isLoaded = true;
+    } else {
+      // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
+      // Adding this timeout seems to fix it
+      setTimeout(this.checkLoadedFonts.bind(this), 100);
+    }
+  }
+
+  function addChars(chars) {
+    if (!chars) {
+      return;
+    }
+    if (!this.chars) {
+      this.chars = [];
+    }
+    var i;
+    var len = chars.length;
+    var j;
+    var jLen = this.chars.length;
+    var found;
+    for (i = 0; i < len; i += 1) {
+      j = 0;
+      found = false;
+      while (j < jLen) {
+        if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
+          found = true;
+        }
+        j += 1;
+      }
+      if (!found) {
+        this.chars.push(chars[i]);
+        jLen += 1;
+      }
+    }
+  }
+
+  function getCharData(char, style, font) {
+    var i = 0;
+    var len = this.chars.length;
+    while (i < len) {
+      if (this.chars[i].ch === char && this.chars[i].style === style && this.chars[i].fFamily === font) {
+        return this.chars[i];
+      }
+      i += 1;
+    }
+    if (((typeof char === 'string' && char.charCodeAt(0) !== 13) || !char)
+            && console
+            && console.warn // eslint-disable-line no-console
+            && !this._warned
+    ) {
+      this._warned = true;
+      console.warn('Missing character from exported characters list: ', char, style, font); // eslint-disable-line no-console
+    }
+    return emptyChar;
+  }
+
+  function measureText(char, fontName, size) {
+    var fontData = this.getFontByName(fontName);
+    var index = char.charCodeAt(0);
+    if (!fontData.cache[index + 1]) {
+      var tHelper = fontData.helper;
+      // Canvas version
+      // fontData.cache[index] = tHelper.measureText(char).width / 100;
+      // SVG version
+      // console.log(tHelper.getBBox().width)
+      if (char === ' ') {
+        tHelper.textContent = '|' + char + '|';
+        var doubleSize = tHelper.getComputedTextLength();
+        tHelper.textContent = '||';
+        var singleSize = tHelper.getComputedTextLength();
+        fontData.cache[index + 1] = (doubleSize - singleSize) / 100;
+      } else {
+        tHelper.textContent = char;
+        fontData.cache[index + 1] = (tHelper.getComputedTextLength()) / 100;
+      }
+    }
+    return fontData.cache[index + 1] * size;
+  }
+
+  function getFontByName(name) {
+    var i = 0;
+    var len = this.fonts.length;
+    while (i < len) {
+      if (this.fonts[i].fName === name) {
+        return this.fonts[i];
+      }
+      i += 1;
+    }
+    return this.fonts[0];
+  }
+
+  function getCombinedCharacterCodes() {
+    return combinedCharacters;
+  }
+
+  function setIsLoaded() {
+    this.isLoaded = true;
+  }
+
+  var Font = function () {
+    this.fonts = [];
+    this.chars = null;
+    this.typekitLoaded = 0;
+    this.isLoaded = false;
+    this._warned = false;
+    this.initTime = Date.now();
+    this.setIsLoadedBinded = this.setIsLoaded.bind(this);
+    this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
+  };
+    // TODO: for now I'm adding these methods to the Class and not the prototype. Think of a better way to implement it.
+  Font.getCombinedCharacterCodes = getCombinedCharacterCodes;
+
+  var fontPrototype = {
+    addChars: addChars,
+    addFonts: addFonts,
+    getCharData: getCharData,
+    getFontByName: getFontByName,
+    measureText: measureText,
+    checkLoadedFonts: checkLoadedFonts,
+    setIsLoaded: setIsLoaded,
+  };
+
+  Font.prototype = fontPrototype;
+
+  return Font;
+}());
+
+/* global initialDefaultFrame, BezierFactory, degToRads, bez, createTypedArray */
+/* exported PropertyFactory */
+
+var PropertyFactory = (function () {
+  var initFrame = initialDefaultFrame;
+  var mathAbs = Math.abs;
+
+  function interpolateValue(frameNum, caching) {
+    var offsetTime = this.offsetTime;
+    var newValue;
+    if (this.propType === 'multidimensional') {
+      newValue = createTypedArray('float32', this.pv.length);
+    }
+    var iterationIndex = caching.lastIndex;
+    var i = iterationIndex;
+    var len = this.keyframes.length - 1;
+    var flag = true;
+    var keyData;
+    var nextKeyData;
+
+    while (flag) {
+      keyData = this.keyframes[i];
+      nextKeyData = this.keyframes[i + 1];
+      if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
+        if (keyData.h) {
+          keyData = nextKeyData;
+        }
+        iterationIndex = 0;
+        break;
+      }
+      if ((nextKeyData.t - offsetTime) > frameNum) {
+        iterationIndex = i;
+        break;
+      }
+      if (i < len - 1) {
+        i += 1;
+      } else {
+        iterationIndex = 0;
+        flag = false;
+      }
+    }
+
+    var k;
+    var kLen;
+    var perc;
+    var jLen;
+    var j;
+    var fnc;
+    var nextKeyTime = nextKeyData.t - offsetTime;
+    var keyTime = keyData.t - offsetTime;
+    var endValue;
+    if (keyData.to) {
+      if (!keyData.bezierData) {
+        keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
+      }
+      var bezierData = keyData.bezierData;
+      if (frameNum >= nextKeyTime || frameNum < keyTime) {
+        var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
+        kLen = bezierData.points[ind].point.length;
+        for (k = 0; k < kLen; k += 1) {
+          newValue[k] = bezierData.points[ind].point[k];
+        }
+        // caching._lastKeyframeIndex = -1;
+      } else {
+        if (keyData.__fnct) {
+          fnc = keyData.__fnct;
+        } else {
+          fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
+          keyData.__fnct = fnc;
+        }
+        perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+        var distanceInLine = bezierData.segmentLength * perc;
+
+        var segmentPerc;
+        var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+        j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
+        flag = true;
+        jLen = bezierData.points.length;
+        while (flag) {
+          addedLength += bezierData.points[j].partialLength;
+          if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k];
+            }
+            break;
+          } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
+            segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
+            kLen = bezierData.points[j].point.length;
+            for (k = 0; k < kLen; k += 1) {
+              newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
+            }
+            break;
+          }
+          if (j < jLen - 1) {
+            j += 1;
+          } else {
+            flag = false;
+          }
+        }
+        caching._lastPoint = j;
+        caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
+        caching._lastKeyframeIndex = i;
+      }
+    } else {
+      var outX;
+      var outY;
+      var inX;
+      var inY;
+      var keyValue;
+      len = keyData.s.length;
+      endValue = nextKeyData.s || keyData.e;
+      if (this.sh && keyData.h !== 1) {
+        if (frameNum >= nextKeyTime) {
+          newValue[0] = endValue[0];
+          newValue[1] = endValue[1];
+          newValue[2] = endValue[2];
+        } else if (frameNum <= keyTime) {
+          newValue[0] = keyData.s[0];
+          newValue[1] = keyData.s[1];
+          newValue[2] = keyData.s[2];
+        } else {
+          var quatStart = createQuaternion(keyData.s);
+          var quatEnd = createQuaternion(endValue);
+          var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
+          quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
+        }
+      } else {
+        for (i = 0; i < len; i += 1) {
+          if (keyData.h !== 1) {
+            if (frameNum >= nextKeyTime) {
+              perc = 1;
+            } else if (frameNum < keyTime) {
+              perc = 0;
+            } else {
+              if (keyData.o.x.constructor === Array) {
+                if (!keyData.__fnct) {
+                  keyData.__fnct = [];
+                }
+                if (!keyData.__fnct[i]) {
+                  outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+                  outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+                  inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+                  inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
+                  fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                  keyData.__fnct[i] = fnc;
+                } else {
+                  fnc = keyData.__fnct[i];
+                }
+              } else if (!keyData.__fnct) {
+                outX = keyData.o.x;
+                outY = keyData.o.y;
+                inX = keyData.i.x;
+                inY = keyData.i.y;
+                fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
+                keyData.__fnct = fnc;
+              } else {
+                fnc = keyData.__fnct;
+              }
+              perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
+            }
+          }
+
+          endValue = nextKeyData.s || keyData.e;
+          keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
+
+          if (this.propType === 'multidimensional') {
+            newValue[i] = keyValue;
+          } else {
+            newValue = keyValue;
+          }
+        }
+      }
+    }
+    caching.lastIndex = iterationIndex;
+    return newValue;
+  }
+
+  // based on @Toji's https://github.com/toji/gl-matrix/
+  function slerp(a, b, t) {
+    var out = [];
+    var ax = a[0];
+    var ay = a[1];
+    var az = a[2];
+    var aw = a[3];
+    var bx = b[0];
+    var by = b[1];
+    var bz = b[2];
+    var bw = b[3];
+
+    var omega;
+    var cosom;
+    var sinom;
+    var scale0;
+    var scale1;
+
+    cosom = ax * bx + ay * by + az * bz + aw * bw;
+    if (cosom < 0.0) {
+      cosom = -cosom;
+      bx = -bx;
+      by = -by;
+      bz = -bz;
+      bw = -bw;
+    }
+    if ((1.0 - cosom) > 0.000001) {
+      omega = Math.acos(cosom);
+      sinom = Math.sin(omega);
+      scale0 = Math.sin((1.0 - t) * omega) / sinom;
+      scale1 = Math.sin(t * omega) / sinom;
+    } else {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+    out[0] = scale0 * ax + scale1 * bx;
+    out[1] = scale0 * ay + scale1 * by;
+    out[2] = scale0 * az + scale1 * bz;
+    out[3] = scale0 * aw + scale1 * bw;
+
+    return out;
+  }
+
+  function quaternionToEuler(out, quat) {
+    var qx = quat[0];
+    var qy = quat[1];
+    var qz = quat[2];
+    var qw = quat[3];
+    var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
+    var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
+    var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
+    out[0] = heading / degToRads;
+    out[1] = attitude / degToRads;
+    out[2] = bank / degToRads;
+  }
+
+  function createQuaternion(values) {
+    var heading = values[0] * degToRads;
+    var attitude = values[1] * degToRads;
+    var bank = values[2] * degToRads;
+    var c1 = Math.cos(heading / 2);
+    var c2 = Math.cos(attitude / 2);
+    var c3 = Math.cos(bank / 2);
+    var s1 = Math.sin(heading / 2);
+    var s2 = Math.sin(attitude / 2);
+    var s3 = Math.sin(bank / 2);
+    var w = c1 * c2 * c3 - s1 * s2 * s3;
+    var x = s1 * s2 * c3 + c1 * c2 * s3;
+    var y = s1 * c2 * c3 + c1 * s2 * s3;
+    var z = c1 * s2 * c3 - s1 * c2 * s3;
+
+    return [x, y, z, w];
+  }
+
+  function getValueAtCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    if (!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))) {
+      if (this._caching.lastFrame >= frameNum) {
+        this._caching._lastKeyframeIndex = -1;
+        this._caching.lastIndex = 0;
+      }
+
+      var renderResult = this.interpolateValue(frameNum, this._caching);
+      this.pv = renderResult;
+    }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
+
+  function setVValue(val) {
+    var multipliedValue;
+    if (this.propType === 'unidimensional') {
+      multipliedValue = val * this.mult;
+      if (mathAbs(this.v - multipliedValue) > 0.00001) {
+        this.v = multipliedValue;
+        this._mdf = true;
+      }
+    } else {
+      var i = 0;
+      var len = this.v.length;
+      while (i < len) {
+        multipliedValue = val[i] * this.mult;
+        if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
+          this.v[i] = multipliedValue;
+          this._mdf = true;
+        }
+        i += 1;
+      }
+    }
+  }
+
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
+      return;
+    }
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
+    }
+    this.lock = true;
+    this._mdf = this._isFirstFrame;
+    var i;
+    var len = this.effectsSequence.length;
+    var finalValue = this.kf ? this.pv : this.data.k;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this._isFirstFrame = false;
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
+
+  function ValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this.v = mult ? data.k * mult : data.k;
+    this.pv = data.k;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.vel = 0;
+    this.effectsSequence = [];
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function MultiDimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    this.mult = mult || 1;
+    this.data = data;
+    this._mdf = false;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.k = false;
+    this.kf = false;
+    this.frameId = -1;
+    var i;
+    var len = data.k.length;
+    this.v = createTypedArray('float32', len);
+    this.pv = createTypedArray('float32', len);
+    this.vel = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      this.v[i] = data.k[i] * this.mult;
+      this.pv[i] = data.k[i];
+    }
+    this._isFirstFrame = true;
+    this.effectsSequence = [];
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedValueProperty(elem, data, mult, container) {
+    this.propType = 'unidimensional';
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.frameId = -1;
+    this._caching = {
+      lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1,
+    };
+    this.k = true;
+    this.kf = true;
+    this.data = data;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.v = initFrame;
+    this.pv = initFrame;
+    this._isFirstFrame = true;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.addEffect = addEffect;
+  }
+
+  function KeyframedMultidimensionalProperty(elem, data, mult, container) {
+    this.propType = 'multidimensional';
+    var i;
+    var len = data.k.length;
+    var s;
+    var e;
+    var to;
+    var ti;
+    for (i = 0; i < len - 1; i += 1) {
+      if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
+        s = data.k[i].s;
+        e = data.k[i + 1].s;
+        to = data.k[i].to;
+        ti = data.k[i].ti;
+        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]))) {
+          data.k[i].to = null;
+          data.k[i].ti = null;
+        }
+        if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
+          if (s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) {
+            data.k[i].to = null;
+            data.k[i].ti = null;
+          }
+        }
+      }
+    }
+    this.effectsSequence = [getValueAtCurrentTime.bind(this)];
+    this.data = data;
+    this.keyframes = data.k;
+    this.offsetTime = elem.data.st;
+    this.k = true;
+    this.kf = true;
+    this._isFirstFrame = true;
+    this.mult = mult || 1;
+    this.elem = elem;
+    this.container = container;
+    this.comp = elem.comp;
+    this.getValue = processEffectsSequence;
+    this.setVValue = setVValue;
+    this.interpolateValue = interpolateValue;
+    this.frameId = -1;
+    var arrLen = data.k[0].s.length;
+    this.v = createTypedArray('float32', arrLen);
+    this.pv = createTypedArray('float32', arrLen);
+    for (i = 0; i < arrLen; i += 1) {
+      this.v[i] = initFrame;
+      this.pv[i] = initFrame;
+    }
+    this._caching = { lastFrame: initFrame, lastIndex: 0, value: createTypedArray('float32', arrLen) };
+    this.addEffect = addEffect;
+  }
+
+  function getProp(elem, data, type, mult, container) {
+    var p;
+    if (!data.k.length) {
+      p = new ValueProperty(elem, data, mult, container);
+    } else if (typeof (data.k[0]) === 'number') {
+      p = new MultiDimensionalProperty(elem, data, mult, container);
+    } else {
+      switch (type) {
+        case 0:
+          p = new KeyframedValueProperty(elem, data, mult, container);
+          break;
+        case 1:
+          p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
+          break;
+        default:
+          break;
+      }
+    }
+    if (p.effectsSequence.length) {
+      container.addDynamicProperty(p);
+    }
+    return p;
+  }
+
+  var ob = {
+    getProp: getProp,
+  };
+  return ob;
+}());
+
+/* global Matrix, degToRads, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+/* exported TransformPropertyFactory */
+
+var TransformPropertyFactory = (function () {
+  var defaultVector = [0, 0];
+
+  function applyToMatrix(mat) {
+    var _mdf = this._mdf;
+    this.iterateDynamicProperties();
+    this._mdf = this._mdf || _mdf;
+    if (this.a) {
+      mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+    }
+    if (this.s) {
+      mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+    }
+    if (this.sk) {
+      mat.skewFromAxis(-this.sk.v, this.sa.v);
+    }
+    if (this.r) {
+      mat.rotate(-this.r.v);
+    } else {
+      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]);
+    }
+    if (this.data.p.s) {
+      if (this.data.p.z) {
+        mat.translate(this.px.v, this.py.v, -this.pz.v);
+      } else {
+        mat.translate(this.px.v, this.py.v, 0);
+      }
+    } else {
+      mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+    }
+  }
+  function processKeys(forceRender) {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    }
+    if (this._isDirty) {
+      this.precalculateMatrix();
+      this._isDirty = false;
+    }
+
+    this.iterateDynamicProperties();
+
+    if (this._mdf || forceRender) {
+      var frameRate;
+      this.v.cloneFromProps(this.pre.props);
+      if (this.appliedTransformations < 1) {
+        this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      }
+      if (this.appliedTransformations < 2) {
+        this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      }
+      if (this.sk && this.appliedTransformations < 3) {
+        this.v.skewFromAxis(-this.sk.v, this.sa.v);
+      }
+      if (this.r && this.appliedTransformations < 4) {
+        this.v.rotate(-this.r.v);
+      } else if (!this.r && this.appliedTransformations < 4) {
+        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]);
+      }
+      if (this.autoOriented) {
+        var v1;
+        var v2;
+        frameRate = this.elem.globalData.frameRate;
+        if (this.p && this.p.keyframes && this.p.getValueAtTime) {
+          if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
+            v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
+          } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
+            v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0);
+            v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
+          } else {
+            v1 = this.p.pv;
+            v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
+          }
+        } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
+          v1 = [];
+          v2 = [];
+          var px = this.px;
+          var py = this.py;
+          if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
+            v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
+            v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate, 0);
+          } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
+            v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate), 0);
+            v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate), 0);
+            v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
+            v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
+          } else {
+            v1 = [px.pv, py.pv];
+            v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
+            v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
+          }
+        } else {
+          v2 = defaultVector;
+          v1 = v2;
+        }
+        this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
+      }
+      if (this.data.p && this.data.p.s) {
+        if (this.data.p.z) {
+          this.v.translate(this.px.v, this.py.v, -this.pz.v);
+        } else {
+          this.v.translate(this.px.v, this.py.v, 0);
+        }
+      } else {
+        this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
+      }
+    }
+    this.frameId = this.elem.globalData.frameId;
+  }
+
+  function precalculateMatrix() {
+    if (!this.a.k) {
+      this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
+      this.appliedTransformations = 1;
+    } else {
+      return;
+    }
+    if (!this.s.effectsSequence.length) {
+      this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
+      this.appliedTransformations = 2;
+    } else {
+      return;
+    }
+    if (this.sk) {
+      if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
+        this.pre.skewFromAxis(-this.sk.v, this.sa.v);
+        this.appliedTransformations = 3;
+      } else {
+        return;
+      }
+    }
+    if (this.r) {
+      if (!this.r.effectsSequence.length) {
+        this.pre.rotate(-this.r.v);
+        this.appliedTransformations = 4;
+      }
+    } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
+      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]);
+      this.appliedTransformations = 4;
+    }
+  }
+
+  function autoOrient() {
+    //
+    // var prevP = this.getValueAtTime();
+  }
+
+  function addDynamicProperty(prop) {
+    this._addDynamicProperty(prop);
+    this.elem.addDynamicProperty(prop);
+    this._isDirty = true;
+  }
+
+  function TransformProperty(elem, data, container) {
+    this.elem = elem;
+    this.frameId = -1;
+    this.propType = 'transform';
+    this.data = data;
+    this.v = new Matrix();
+    // Precalculated matrix with non animated properties
+    this.pre = new Matrix();
+    this.appliedTransformations = 0;
+    this.initDynamicPropertyContainer(container || elem);
+    if (data.p && data.p.s) {
+      this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
+      this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
+      if (data.p.z) {
+        this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
+      }
+    } else {
+      this.p = PropertyFactory.getProp(elem, data.p || { k: [0, 0, 0] }, 1, 0, this);
+    }
+    if (data.rx) {
+      this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
+      this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
+      this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
+      if (data.or.k[0].ti) {
+        var i;
+        var len = data.or.k.length;
+        for (i = 0; i < len; i += 1) {
+          data.or.k[i].to = null;
+          data.or.k[i].ti = null;
+        }
+      }
+      this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this);
+      // sh Indicates it needs to be capped between -180 and 180
+      this.or.sh = true;
+    } else {
+      this.r = PropertyFactory.getProp(elem, data.r || { k: 0 }, 0, degToRads, this);
+    }
+    if (data.sk) {
+      this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
+      this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
+    }
+    this.a = PropertyFactory.getProp(elem, data.a || { k: [0, 0, 0] }, 1, 0, this);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: [100, 100, 100] }, 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.
+    if (data.o) {
+      this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
+    } else {
+      this.o = { _mdf: false, v: 1 };
+    }
+    this._isDirty = true;
+    if (!this.dynamicProperties.length) {
+      this.getValue(true);
+    }
+  }
+
+  TransformProperty.prototype = {
+    applyToMatrix: applyToMatrix,
+    getValue: processKeys,
+    precalculateMatrix: precalculateMatrix,
+    autoOrient: autoOrient,
+  };
+
+  extendPrototype([DynamicPropertyContainer], TransformProperty);
+  TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
+  TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
+
+  function getTransformProperty(elem, data, container) {
+    return new TransformProperty(elem, data, container);
+  }
+
+  return {
+    getTransformProperty: getTransformProperty,
+  };
+}());
+
+/* global createSizedArray, createSizedArray, pointPool */
+
+function ShapePath() {
+  this.c = false;
+  this._length = 0;
+  this._maxLength = 8;
+  this.v = createSizedArray(this._maxLength);
+  this.o = createSizedArray(this._maxLength);
+  this.i = createSizedArray(this._maxLength);
+}
+
+ShapePath.prototype.setPathData = function (closed, len) {
+  this.c = closed;
+  this.setLength(len);
+  var i = 0;
+  while (i < len) {
+    this.v[i] = pointPool.newElement();
+    this.o[i] = pointPool.newElement();
+    this.i[i] = pointPool.newElement();
+    i += 1;
+  }
 };
-var ShapePropertyFactory = (function(){
 
-    var initFrame = -999999;
+ShapePath.prototype.setLength = function (len) {
+  while (this._maxLength < len) {
+    this.doubleArrayLength();
+  }
+  this._length = len;
+};
 
-    function interpolateShape(frameNum, previousValue, caching) {
-        var iterationIndex = caching.lastIndex;
-        var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue;
-        var kf = this.keyframes;
-        if(frameNum < kf[0].t-this.offsetTime){
-            keyPropS = kf[0].s[0];
-            isHold = true;
-            iterationIndex = 0;
-        }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){
-            keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
-            /*if(kf[kf.length - 1].s){
+ShapePath.prototype.doubleArrayLength = function () {
+  this.v = this.v.concat(createSizedArray(this._maxLength));
+  this.i = this.i.concat(createSizedArray(this._maxLength));
+  this.o = this.o.concat(createSizedArray(this._maxLength));
+  this._maxLength *= 2;
+};
+
+ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
+  var arr;
+  this._length = Math.max(this._length, pos + 1);
+  if (this._length >= this._maxLength) {
+    this.doubleArrayLength();
+  }
+  switch (type) {
+    case 'v':
+      arr = this.v;
+      break;
+    case 'i':
+      arr = this.i;
+      break;
+    case 'o':
+      arr = this.o;
+      break;
+    default:
+      arr = [];
+      break;
+  }
+  if (!arr[pos] || (arr[pos] && !replace)) {
+    arr[pos] = pointPool.newElement();
+  }
+  arr[pos][0] = x;
+  arr[pos][1] = y;
+};
+
+ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
+  this.setXYAt(vX, vY, 'v', pos, replace);
+  this.setXYAt(oX, oY, 'o', pos, replace);
+  this.setXYAt(iX, iY, 'i', pos, replace);
+};
+
+ShapePath.prototype.reverse = function () {
+  var newPath = new ShapePath();
+  newPath.setPathData(this.c, this._length);
+  var vertices = this.v;
+  var outPoints = this.o;
+  var inPoints = this.i;
+  var init = 0;
+  if (this.c) {
+    newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
+    init = 1;
+  }
+  var cnt = this._length - 1;
+  var len = this._length;
+
+  var i;
+  for (i = init; i < len; i += 1) {
+    newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
+    cnt -= 1;
+  }
+  return newPath;
+};
+
+/* global extendPrototype, roundCorner, BezierFactory, shapePool, degToRads,
+  shapeCollectionPool, PropertyFactory, bmMin, DynamicPropertyContainer */
+/* exported ShapePropertyFactory */
+
+var ShapePropertyFactory = (function () {
+  var initFrame = -999999;
+
+  function interpolateShape(frameNum, previousValue, caching) {
+    var iterationIndex = caching.lastIndex;
+    var keyPropS;
+    var keyPropE;
+    var isHold;
+    var j;
+    var k;
+    var jLen;
+    var kLen;
+    var perc;
+    var vertexValue;
+    var kf = this.keyframes;
+    if (frameNum < kf[0].t - this.offsetTime) {
+      keyPropS = kf[0].s[0];
+      isHold = true;
+      iterationIndex = 0;
+    } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
+      keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
+      /* if(kf[kf.length - 1].s){
                 keyPropS = kf[kf.length - 1].s[0];
             }else{
                 keyPropS = kf[kf.length - 2].e[0];
-            }*/
-            isHold = true;
-        }else{
-            var i = iterationIndex;
-            var len = kf.length- 1,flag = true,keyData,nextKeyData;
-            while(flag){
-                keyData = kf[i];
-                nextKeyData = kf[i+1];
-                if((nextKeyData.t - this.offsetTime) > frameNum){
-                    break;
-                }
-                if(i < len - 1){
-                    i += 1;
-                }else{
-                    flag = false;
-                }
-            }
-            isHold = keyData.h === 1;
-            iterationIndex = i;
-            if(!isHold){
-                if(frameNum >= nextKeyData.t-this.offsetTime){
-                    perc = 1;
-                }else if(frameNum < keyData.t-this.offsetTime){
-                    perc = 0;
-                }else{
-                    var fnc;
-                    if(keyData.__fnct){
-                        fnc = keyData.__fnct;
-                    }else{
-                        fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get;
-                        keyData.__fnct = fnc;
-                    }
-                    perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime)));
-                }
-                keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
-            }
-            keyPropS = keyData.s[0];
+            } */
+      isHold = true;
+    } else {
+      var i = iterationIndex;
+      var len = kf.length - 1;
+      var flag = true;
+      var keyData;
+      var nextKeyData;
+      while (flag) {
+        keyData = kf[i];
+        nextKeyData = kf[i + 1];
+        if ((nextKeyData.t - this.offsetTime) > frameNum) {
+          break;
         }
-        jLen = previousValue._length;
-        kLen = keyPropS.i[0].length;
-        caching.lastIndex = iterationIndex;
-
-        for(j=0;j<jLen;j+=1){
-            for(k=0;k<kLen;k+=1){
-                vertexValue = isHold ? keyPropS.i[j][k] :  keyPropS.i[j][k]+(keyPropE.i[j][k]-keyPropS.i[j][k])*perc;
-                previousValue.i[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.o[j][k] :  keyPropS.o[j][k]+(keyPropE.o[j][k]-keyPropS.o[j][k])*perc;
-                previousValue.o[j][k] = vertexValue;
-                vertexValue = isHold ? keyPropS.v[j][k] :  keyPropS.v[j][k]+(keyPropE.v[j][k]-keyPropS.v[j][k])*perc;
-                previousValue.v[j][k] = vertexValue;
-            }
+        if (i < len - 1) {
+          i += 1;
+        } else {
+          flag = false;
         }
+      }
+      isHold = keyData.h === 1;
+      iterationIndex = i;
+      if (!isHold) {
+        if (frameNum >= nextKeyData.t - this.offsetTime) {
+          perc = 1;
+        } else if (frameNum < keyData.t - this.offsetTime) {
+          perc = 0;
+        } else {
+          var fnc;
+          if (keyData.__fnct) {
+            fnc = keyData.__fnct;
+          } else {
+            fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
+            keyData.__fnct = fnc;
+          }
+          perc = fnc((frameNum - (keyData.t - this.offsetTime)) / ((nextKeyData.t - this.offsetTime) - (keyData.t - this.offsetTime)));
+        }
+        keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
+      }
+      keyPropS = keyData.s[0];
     }
+    jLen = previousValue._length;
+    kLen = keyPropS.i[0].length;
+    caching.lastIndex = iterationIndex;
 
-    function interpolateShapeCurrentTime(){
-        var frameNum = this.comp.renderedFrame - this.offsetTime;
-        var initTime = this.keyframes[0].t - this.offsetTime;
-        var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
-        var lastFrame = this._caching.lastFrame;
-        if(!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))){
-            ////
-            this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
-            this.interpolateShape(frameNum, this.pv, this._caching);
-            ////
-        }
-        this._caching.lastFrame = frameNum;
-        return this.pv;
+    for (j = 0; j < jLen; j += 1) {
+      for (k = 0; k < kLen; k += 1) {
+        vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
+        previousValue.i[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
+        previousValue.o[j][k] = vertexValue;
+        vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
+        previousValue.v[j][k] = vertexValue;
+      }
     }
+  }
 
-    function resetShape(){
-        this.paths = this.localShapeCollection;
+  function interpolateShapeCurrentTime() {
+    var frameNum = this.comp.renderedFrame - this.offsetTime;
+    var initTime = this.keyframes[0].t - this.offsetTime;
+    var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
+    var lastFrame = this._caching.lastFrame;
+    if (!(lastFrame !== initFrame && ((lastFrame < initTime && frameNum < initTime) || (lastFrame > endTime && frameNum > endTime)))) {
+      /// /
+      this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
+      this.interpolateShape(frameNum, this.pv, this._caching);
+      /// /
     }
+    this._caching.lastFrame = frameNum;
+    return this.pv;
+  }
 
-    function shapesEqual(shape1, shape2) {
-        if(shape1._length !== shape2._length || shape1.c !== shape2.c){
-            return false;
-        }
-        var i, len = shape1._length;
-        for(i = 0; i < len; i += 1) {
-            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] 
+  function resetShape() {
+    this.paths = this.localShapeCollection;
+  }
+
+  function shapesEqual(shape1, shape2) {
+    if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
+      return false;
+    }
+    var i;
+    var len = shape1._length;
+    for (i = 0; i < len; i += 1) {
+      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]) {
-                return false;
-            }
-        }
-        return true;
+        return false;
+      }
     }
+    return true;
+  }
 
-    function setVValue(newPath) {
-        if(!shapesEqual(this.v, newPath)) {
-            this.v = shape_pool.clone(newPath);
-            this.localShapeCollection.releaseShapes();
-            this.localShapeCollection.addShape(this.v);
-            this._mdf = true;
-            this.paths = this.localShapeCollection;
-        }
+  function setVValue(newPath) {
+    if (!shapesEqual(this.v, newPath)) {
+      this.v = shapePool.clone(newPath);
+      this.localShapeCollection.releaseShapes();
+      this.localShapeCollection.addShape(this.v);
+      this._mdf = true;
+      this.paths = this.localShapeCollection;
     }
+  }
 
-    function processEffectsSequence() {
-        if (this.elem.globalData.frameId === this.frameId) {
-            return;
-        } else if (!this.effectsSequence.length) {
-            this._mdf = false;
-            return;
-        }
-        if (this.lock) {
-            this.setVValue(this.pv);
-            return;
-        }
-        this.lock = true;
-        this._mdf = false;
-        var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
-        var i, len = this.effectsSequence.length;
-        for(i = 0; i < len; i += 1) {
-            finalValue = this.effectsSequence[i](finalValue);
-        }
-        this.setVValue(finalValue);
-        this.lock = false;
-        this.frameId = this.elem.globalData.frameId;
-    };
-
-    function ShapeProperty(elem, data, type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.container = elem;
-        this.elem = elem;
-        this.data = data;
-        this.k = false;
-        this.kf = false;
-        this._mdf = false;
-        var pathData = type === 3 ? data.pt.k : data.ks.k;
-        this.v = shape_pool.clone(pathData);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.reset = resetShape;
-        this.effectsSequence = [];
+  function processEffectsSequence() {
+    if (this.elem.globalData.frameId === this.frameId) {
+      return;
+    } if (!this.effectsSequence.length) {
+      this._mdf = false;
+      return;
     }
-
-    function addEffect(effectFunction) {
-        this.effectsSequence.push(effectFunction);
-        this.container.addDynamicProperty(this);
+    if (this.lock) {
+      this.setVValue(this.pv);
+      return;
     }
-
-    ShapeProperty.prototype.interpolateShape = interpolateShape;
-    ShapeProperty.prototype.getValue = processEffectsSequence;
-    ShapeProperty.prototype.setVValue = setVValue;
-    ShapeProperty.prototype.addEffect = addEffect;
-
-    function KeyframedShapeProperty(elem,data,type){
-        this.propType = 'shape';
-        this.comp = elem.comp;
-        this.elem = elem;
-        this.container = elem;
-        this.offsetTime = elem.data.st;
-        this.keyframes = type === 3 ? data.pt.k : data.ks.k;
-        this.k = true;
-        this.kf = true;
-        var i, len = this.keyframes[0].s[0].i.length;
-        var jLen = this.keyframes[0].s[0].i[0].length;
-        this.v = shape_pool.newElement();
-        this.v.setPathData(this.keyframes[0].s[0].c, len);
-        this.pv = shape_pool.clone(this.v);
-        this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-        this.paths = this.localShapeCollection;
-        this.paths.addShape(this.v);
-        this.lastFrame = initFrame;
-        this.reset = resetShape;
-        this._caching = {lastFrame: initFrame, lastIndex: 0};
-        this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+    this.lock = true;
+    this._mdf = false;
+    var finalValue;
+    if (this.kf) {
+      finalValue = this.pv;
+    } else if (this.data.ks) {
+      finalValue = this.data.ks.k;
+    } else {
+      finalValue = this.data.pt.k;
     }
-    KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
-    KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
-    KeyframedShapeProperty.prototype.setVValue = setVValue;
-    KeyframedShapeProperty.prototype.addEffect = addEffect;
+    var i;
+    var len = this.effectsSequence.length;
+    for (i = 0; i < len; i += 1) {
+      finalValue = this.effectsSequence[i](finalValue);
+    }
+    this.setVValue(finalValue);
+    this.lock = false;
+    this.frameId = this.elem.globalData.frameId;
+  }
 
-    var EllShapeProperty = (function(){
+  function ShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.container = elem;
+    this.elem = elem;
+    this.data = data;
+    this.k = false;
+    this.kf = false;
+    this._mdf = false;
+    var pathData = type === 3 ? data.pt.k : data.ks.k;
+    this.v = shapePool.clone(pathData);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.reset = resetShape;
+    this.effectsSequence = [];
+  }
 
-        var cPoint = roundCorner;
+  function addEffect(effectFunction) {
+    this.effectsSequence.push(effectFunction);
+    this.container.addDynamicProperty(this);
+  }
 
-        function EllShapeProperty(elem,data) {
-            /*this.v = {
+  ShapeProperty.prototype.interpolateShape = interpolateShape;
+  ShapeProperty.prototype.getValue = processEffectsSequence;
+  ShapeProperty.prototype.setVValue = setVValue;
+  ShapeProperty.prototype.addEffect = addEffect;
+
+  function KeyframedShapeProperty(elem, data, type) {
+    this.propType = 'shape';
+    this.comp = elem.comp;
+    this.elem = elem;
+    this.container = elem;
+    this.offsetTime = elem.data.st;
+    this.keyframes = type === 3 ? data.pt.k : data.ks.k;
+    this.k = true;
+    this.kf = true;
+    var len = this.keyframes[0].s[0].i.length;
+    this.v = shapePool.newElement();
+    this.v.setPathData(this.keyframes[0].s[0].c, len);
+    this.pv = shapePool.clone(this.v);
+    this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+    this.paths = this.localShapeCollection;
+    this.paths.addShape(this.v);
+    this.lastFrame = initFrame;
+    this.reset = resetShape;
+    this._caching = { lastFrame: initFrame, lastIndex: 0 };
+    this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
+  }
+  KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
+  KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
+  KeyframedShapeProperty.prototype.setVValue = setVValue;
+  KeyframedShapeProperty.prototype.addEffect = addEffect;
+
+  var EllShapeProperty = (function () {
+    var cPoint = roundCorner;
+
+    function EllShapePropertyFactory(elem, data) {
+      /* this.v = {
                 v: createSizedArray(4),
                 i: createSizedArray(4),
                 o: createSizedArray(4),
                 c: true
-            };*/
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 4);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.paths = this.localShapeCollection;
-            this.localShapeCollection.addShape(this.v);
-            this.d = data.d;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertEllToPath();
-            }
-        };
+            }; */
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 4);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.paths = this.localShapeCollection;
+      this.localShapeCollection.addShape(this.v);
+      this.d = data.d;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertEllToPath();
+      }
+    }
 
-        EllShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function (){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-
-                if(this._mdf){
-                    this.convertEllToPath();
-                }
-            },
-            convertEllToPath: function() {
-                var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2;
-                var _cw = this.d !== 3;
-                var _v = this.v;
-                _v.v[0][0] = p0;
-                _v.v[0][1] = p1 - s1;
-                _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.v[1][1] = p1;
-                _v.v[2][0] = p0;
-                _v.v[2][1] = p1 + s1;
-                _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.v[3][1] = p1;
-                _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.i[0][1] = p1 - s1;
-                _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.i[1][1] = p1 - s1 * cPoint;
-                _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.i[2][1] = p1 + s1;
-                _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.i[3][1] = p1 + s1 * cPoint;
-                _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
-                _v.o[0][1] = p1 - s1;
-                _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
-                _v.o[1][1] = p1 + s1 * cPoint;
-                _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
-                _v.o[2][1] = p1 + s1;
-                _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
-                _v.o[3][1] = p1 - s1 * cPoint;
-            }
+    EllShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
         }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
 
-        extendPrototype([DynamicPropertyContainer], EllShapeProperty);
+        if (this._mdf) {
+          this.convertEllToPath();
+        }
+      },
+      convertEllToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var s0 = this.s.v[0] / 2;
+        var s1 = this.s.v[1] / 2;
+        var _cw = this.d !== 3;
+        var _v = this.v;
+        _v.v[0][0] = p0;
+        _v.v[0][1] = p1 - s1;
+        _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.v[1][1] = p1;
+        _v.v[2][0] = p0;
+        _v.v[2][1] = p1 + s1;
+        _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.v[3][1] = p1;
+        _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.i[0][1] = p1 - s1;
+        _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.i[1][1] = p1 - s1 * cPoint;
+        _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.i[2][1] = p1 + s1;
+        _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.i[3][1] = p1 + s1 * cPoint;
+        _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
+        _v.o[0][1] = p1 - s1;
+        _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
+        _v.o[1][1] = p1 + s1 * cPoint;
+        _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
+        _v.o[2][1] = p1 + s1;
+        _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
+        _v.o[3][1] = p1 - s1 * cPoint;
+      },
+    };
 
-        return EllShapeProperty;
-    }());
+    extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
 
-    var StarShapeProperty = (function() {
+    return EllShapePropertyFactory;
+  }());
 
-        function StarShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.setPathData(true, 0);
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.data = data;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            if(data.sy === 1){
-                this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
-                this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
-                this.convertToPath = this.convertStarToPath;
-            } else {
-                this.convertToPath = this.convertPolygonToPath;
-            }
-            this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this);
-            this.or = PropertyFactory.getProp(elem,data.or,0,0,this);
-            this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this);
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertToPath();
-            }
-        };
+  var StarShapeProperty = (function () {
+    function StarShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.setPathData(true, 0);
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.data = data;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      if (data.sy === 1) {
+        this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
+        this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
+        this.convertToPath = this.convertStarToPath;
+      } else {
+        this.convertToPath = this.convertPolygonToPath;
+      }
+      this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
+      this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
+      this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      if (this.dynamicProperties.length) {
+        this.k = true;
+      } else {
+        this.k = false;
+        this.convertToPath();
+      }
+    }
 
-        StarShapeProperty.prototype = {
-            reset: resetShape,
-            getValue: function() {
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertToPath();
-                }
-            },
-            convertStarToPath: function() {
-                var numPts = Math.floor(this.pt.v)*2;
-                var angle = Math.PI*2/numPts;
-                /*this.v.v.length = numPts;
+    StarShapePropertyFactory.prototype = {
+      reset: resetShape,
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertToPath();
+        }
+      },
+      convertStarToPath: function () {
+        var numPts = Math.floor(this.pt.v) * 2;
+        var angle = (Math.PI * 2) / numPts;
+        /* this.v.v.length = numPts;
                 this.v.i.length = numPts;
-                this.v.o.length = numPts;*/
-                var longFlag = true;
-                var longRad = this.or.v;
-                var shortRad = this.ir.v;
-                var longRound = this.os.v;
-                var shortRound = this.is.v;
-                var longPerimSegment = 2*Math.PI*longRad/(numPts*2);
-                var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2);
-                var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2;
-                currentAng += this.r.v;
-                var dir = this.data.d === 3 ? -1 : 1;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    rad = longFlag ? longRad : shortRad;
-                    roundness = longFlag ? longRound : shortRound;
-                    perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
+                this.v.o.length = numPts; */
+        var longFlag = true;
+        var longRad = this.or.v;
+        var shortRad = this.ir.v;
+        var longRound = this.os.v;
+        var shortRound = this.is.v;
+        var longPerimSegment = (2 * Math.PI * longRad) / (numPts * 2);
+        var shortPerimSegment = (2 * Math.PI * shortRad) / (numPts * 2);
+        var i;
+        var rad;
+        var roundness;
+        var perimSegment;
+        var currentAng = -Math.PI / 2;
+        currentAng += this.r.v;
+        var dir = this.data.d === 3 ? -1 : 1;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          rad = longFlag ? longRad : shortRad;
+          roundness = longFlag ? longRound : shortRound;
+          perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
 
-                    /*this.v.v[i] = [x,y];
+          /* this.v.v[i] = [x,y];
                     this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
                     this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
-                    this.v._length = numPts;*/
-                    longFlag = !longFlag;
-                    currentAng += angle*dir;
-                }
-            },
-            convertPolygonToPath: function() {
-                var numPts = Math.floor(this.pt.v);
-                var angle = Math.PI*2/numPts;
-                var rad = this.or.v;
-                var roundness = this.os.v;
-                var perimSegment = 2*Math.PI*rad/(numPts*4);
-                var i, currentAng = -Math.PI/ 2;
-                var dir = this.data.d === 3 ? -1 : 1;
-                currentAng += this.r.v;
-                this.v._length = 0;
-                for(i=0;i<numPts;i+=1){
-                    var x = rad * Math.cos(currentAng);
-                    var y = rad * Math.sin(currentAng);
-                    var ox = x === 0 && y === 0 ? 0 : y/Math.sqrt(x*x + y*y);
-                    var oy = x === 0 && y === 0 ? 0 : -x/Math.sqrt(x*x + y*y);
-                    x +=  + this.p.v[0];
-                    y +=  + this.p.v[1];
-                    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);
-                    currentAng += angle*dir;
-                }
-                this.paths.length = 0;
-                this.paths[0] = this.v;
-            }
-
+                    this.v._length = numPts; */
+          longFlag = !longFlag;
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], StarShapeProperty);
-
-        return StarShapeProperty;
-    }());
-
-    var RectShapeProperty = (function() {
-
-         function RectShapeProperty(elem,data) {
-            this.v = shape_pool.newElement();
-            this.v.c = true;
-            this.localShapeCollection = shapeCollection_pool.newShapeCollection();
-            this.localShapeCollection.addShape(this.v);
-            this.paths = this.localShapeCollection;
-            this.elem = elem;
-            this.comp = elem.comp;
-            this.frameId = -1;
-            this.d = data.d;
-            this.initDynamicPropertyContainer(elem);
-            this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
-            this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
-            this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
-            if(this.dynamicProperties.length){
-                this.k = true;
-            }else{
-                this.k = false;
-                this.convertRectToPath();
-            }
-        };
-
-        RectShapeProperty.prototype = {
-            convertRectToPath: function (){
-                var p0 = this.p.v[0], p1 = this.p.v[1], v0 = this.s.v[0]/2, v1 = this.s.v[1]/2;
-                var round = bm_min(v0,v1,this.r.v);
-                var cPoint = round*(1-roundCorner);
-                this.v._length = 0;
-
-                if(this.d === 2 || this.d === 1) {
-                    this.v.setTripleAt(p0+v0, p1-v1+round,p0+v0, p1-v1+round,p0+v0,p1-v1+cPoint,0, true);
-                    this.v.setTripleAt(p0+v0, p1+v1-round,p0+v0, p1+v1-cPoint,p0+v0, p1+v1-round,1, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round, p1+v1,p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,2, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,p0-v0+round,p1+v1,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,4, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,p0-v0,p1-v1+round,5, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,6, true);
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,p0+v0-round,p1-v1,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0+cPoint,p1+v1,p0-v0,p1+v1,2);
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0,p1-v1+cPoint,p0-v0,p1-v1,3);
-                    }
-                }else{
-                    this.v.setTripleAt(p0+v0,p1-v1+round,p0+v0,p1-v1+cPoint,p0+v0,p1-v1+round,0, true);
-                    if(round!== 0){
-                        this.v.setTripleAt(p0+v0-round,p1-v1,p0+v0-round,p1-v1,p0+v0-cPoint,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0+round,p1-v1,p0-v0+cPoint,p1-v1,p0-v0+round,p1-v1,2, true);
-                        this.v.setTripleAt(p0-v0,p1-v1+round,p0-v0,p1-v1+round,p0-v0,p1-v1+cPoint,3, true);
-                        this.v.setTripleAt(p0-v0,p1+v1-round,p0-v0,p1+v1-cPoint,p0-v0,p1+v1-round,4, true);
-                        this.v.setTripleAt(p0-v0+round,p1+v1,p0-v0+round,p1+v1,p0-v0+cPoint,p1+v1,5, true);
-                        this.v.setTripleAt(p0+v0-round,p1+v1,p0+v0-cPoint,p1+v1,p0+v0-round,p1+v1,6, true);
-                        this.v.setTripleAt(p0+v0,p1+v1-round,p0+v0,p1+v1-round,p0+v0,p1+v1-cPoint,7, true);
-                    } else {
-                        this.v.setTripleAt(p0-v0,p1-v1,p0-v0+cPoint,p1-v1,p0-v0,p1-v1,1, true);
-                        this.v.setTripleAt(p0-v0,p1+v1,p0-v0,p1+v1-cPoint,p0-v0,p1+v1,2, true);
-                        this.v.setTripleAt(p0+v0,p1+v1,p0+v0-cPoint,p1+v1,p0+v0,p1+v1,3, true);
-
-                    }
-                }
-            },
-            getValue: function(frameNum){
-                if(this.elem.globalData.frameId === this.frameId){
-                    return;
-                }
-                this.frameId = this.elem.globalData.frameId;
-                this.iterateDynamicProperties();
-                if(this._mdf){
-                    this.convertRectToPath();
-                }
-
-            },
-            reset: resetShape
+      },
+      convertPolygonToPath: function () {
+        var numPts = Math.floor(this.pt.v);
+        var angle = (Math.PI * 2) / numPts;
+        var rad = this.or.v;
+        var roundness = this.os.v;
+        var perimSegment = (2 * Math.PI * rad) / (numPts * 4);
+        var i;
+        var currentAng = -Math.PI * 0.5;
+        var dir = this.data.d === 3 ? -1 : 1;
+        currentAng += this.r.v;
+        this.v._length = 0;
+        for (i = 0; i < numPts; i += 1) {
+          var x = rad * Math.cos(currentAng);
+          var y = rad * Math.sin(currentAng);
+          var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
+          var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
+          x += +this.p.v[0];
+          y += +this.p.v[1];
+          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);
+          currentAng += angle * dir;
         }
-        extendPrototype([DynamicPropertyContainer], RectShapeProperty);
+        this.paths.length = 0;
+        this.paths[0] = this.v;
+      },
 
-        return RectShapeProperty;
-    }());
+    };
+    extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
 
-    function getShapeProp(elem,data,type){
-        var prop;
-        if(type === 3 || type === 4){
-            var dataProp = type === 3 ? data.pt : data.ks;
-            var keys = dataProp.k;
-            if(keys.length){
-                prop = new KeyframedShapeProperty(elem, data, type);
-            }else{
-                prop = new ShapeProperty(elem, data, type);
-            }
-        }else if(type === 5){
-            prop = new RectShapeProperty(elem, data);
-        }else if(type === 6){
-            prop = new EllShapeProperty(elem, data);
-        }else if(type === 7){
-            prop = new StarShapeProperty(elem, data);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    }
+    return StarShapePropertyFactory;
+  }());
 
-    function getConstructorFunction() {
-        return ShapeProperty;
-    }
-
-    function getKeyframedConstructorFunction() {
-        return KeyframedShapeProperty;
-    }
-
-    var ob = {};
-    ob.getShapeProp = getShapeProp;
-    ob.getConstructorFunction = getConstructorFunction;
-    ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
-    return ob;
-}());
-var ShapeModifiers = (function(){
-    var ob = {};
-    var modifiers = {};
-    ob.registerModifier = registerModifier;
-    ob.getModifier = getModifier;
-
-    function registerModifier(nm,factory){
-        if(!modifiers[nm]){
-            modifiers[nm] = factory;
-        }
-    }
-
-    function getModifier(nm,elem, data){
-        return new modifiers[nm](elem, data);
-    }
-
-    return ob;
-}());
-
-function ShapeModifier(){}
-ShapeModifier.prototype.initModifierProperties = function(){};
-ShapeModifier.prototype.addShapeToModifier = function(){};
-ShapeModifier.prototype.addShape = function(data){
-    if (!this.closed) {
-        // 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.
-        data.sh.container.addDynamicProperty(data.sh);
-        var shapeData = {shape:data.sh, data: data, localShapeCollection:shapeCollection_pool.newShapeCollection()};
-        this.shapes.push(shapeData);
-        this.addShapeToModifier(shapeData);
-        if (this._isAnimated) {
-            data.setAsAnimated();
-        }
-    }
-};
-ShapeModifier.prototype.init = function(elem,data){
-    this.shapes = [];
-    this.elem = elem;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,data);
-    this.frameId = initialDefaultFrame;
-    this.closed = false;
-    this.k = false;
-    if(this.dynamicProperties.length){
+  var RectShapeProperty = (function () {
+    function RectShapePropertyFactory(elem, data) {
+      this.v = shapePool.newElement();
+      this.v.c = true;
+      this.localShapeCollection = shapeCollectionPool.newShapeCollection();
+      this.localShapeCollection.addShape(this.v);
+      this.paths = this.localShapeCollection;
+      this.elem = elem;
+      this.comp = elem.comp;
+      this.frameId = -1;
+      this.d = data.d;
+      this.initDynamicPropertyContainer(elem);
+      this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
+      this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
+      this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
+      if (this.dynamicProperties.length) {
         this.k = true;
-    }else{
-        this.getValue(true);
+      } else {
+        this.k = false;
+        this.convertRectToPath();
+      }
     }
+
+    RectShapePropertyFactory.prototype = {
+      convertRectToPath: function () {
+        var p0 = this.p.v[0];
+        var p1 = this.p.v[1];
+        var v0 = this.s.v[0] / 2;
+        var v1 = this.s.v[1] / 2;
+        var round = bmMin(v0, v1, this.r.v);
+        var cPoint = round * (1 - roundCorner);
+        this.v._length = 0;
+
+        if (this.d === 2 || this.d === 1) {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
+          this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
+          }
+        } else {
+          this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
+          if (round !== 0) {
+            this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
+            this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
+            this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
+            this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
+          } else {
+            this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
+            this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
+            this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
+          }
+        }
+      },
+      getValue: function () {
+        if (this.elem.globalData.frameId === this.frameId) {
+          return;
+        }
+        this.frameId = this.elem.globalData.frameId;
+        this.iterateDynamicProperties();
+        if (this._mdf) {
+          this.convertRectToPath();
+        }
+      },
+      reset: resetShape,
+    };
+    extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
+
+    return RectShapePropertyFactory;
+  }());
+
+  function getShapeProp(elem, data, type) {
+    var prop;
+    if (type === 3 || type === 4) {
+      var dataProp = type === 3 ? data.pt : data.ks;
+      var keys = dataProp.k;
+      if (keys.length) {
+        prop = new KeyframedShapeProperty(elem, data, type);
+      } else {
+        prop = new ShapeProperty(elem, data, type);
+      }
+    } else if (type === 5) {
+      prop = new RectShapeProperty(elem, data);
+    } else if (type === 6) {
+      prop = new EllShapeProperty(elem, data);
+    } else if (type === 7) {
+      prop = new StarShapeProperty(elem, data);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  }
+
+  function getConstructorFunction() {
+    return ShapeProperty;
+  }
+
+  function getKeyframedConstructorFunction() {
+    return KeyframedShapeProperty;
+  }
+
+  var ob = {};
+  ob.getShapeProp = getShapeProp;
+  ob.getConstructorFunction = getConstructorFunction;
+  ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
+  return ob;
+}());
+
+/* global shapeCollectionPool, initialDefaultFrame, extendPrototype, DynamicPropertyContainer */
+/* exported ShapeModifiers */
+
+var ShapeModifiers = (function () {
+  var ob = {};
+  var modifiers = {};
+  ob.registerModifier = registerModifier;
+  ob.getModifier = getModifier;
+
+  function registerModifier(nm, factory) {
+    if (!modifiers[nm]) {
+      modifiers[nm] = factory;
+    }
+  }
+
+  function getModifier(nm, elem, data) {
+    return new modifiers[nm](elem, data);
+  }
+
+  return ob;
+}());
+
+function ShapeModifier() {}
+ShapeModifier.prototype.initModifierProperties = function () {};
+ShapeModifier.prototype.addShapeToModifier = function () {};
+ShapeModifier.prototype.addShape = function (data) {
+  if (!this.closed) {
+    // 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.
+    data.sh.container.addDynamicProperty(data.sh);
+    var shapeData = { shape: data.sh, data: data, localShapeCollection: shapeCollectionPool.newShapeCollection() };
+    this.shapes.push(shapeData);
+    this.addShapeToModifier(shapeData);
+    if (this._isAnimated) {
+      data.setAsAnimated();
+    }
+  }
 };
-ShapeModifier.prototype.processKeys = function(){
-    if(this.elem.globalData.frameId === this.frameId){
-        return;
-    }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
+ShapeModifier.prototype.init = function (elem, data) {
+  this.shapes = [];
+  this.elem = elem;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, data);
+  this.frameId = initialDefaultFrame;
+  this.closed = false;
+  this.k = false;
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
+};
+ShapeModifier.prototype.processKeys = function () {
+  if (this.elem.globalData.frameId === this.frameId) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 extendPrototype([DynamicPropertyContainer], ShapeModifier);
-function TrimModifier(){
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, segmentsLengthPool, bez, shapePool, ShapeModifiers */
+
+function TrimModifier() {
 }
 extendPrototype([ShapeModifier], TrimModifier);
-TrimModifier.prototype.initModifierProperties = function(elem, data) {
-    this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
-    this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
-    this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
-    this.sValue = 0;
-    this.eValue = 0;
-    this.getValue = this.processKeys;
-    this.m = data.m;
-    this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
+TrimModifier.prototype.initModifierProperties = function (elem, data) {
+  this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
+  this.sValue = 0;
+  this.eValue = 0;
+  this.getValue = this.processKeys;
+  this.m = data.m;
+  this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
 };
 
-TrimModifier.prototype.addShapeToModifier = function(shapeData){
-    shapeData.pathsData = [];
+TrimModifier.prototype.addShapeToModifier = function (shapeData) {
+  shapeData.pathsData = [];
 };
 
-TrimModifier.prototype.calculateShapeEdges = function(s, e, shapeLength, addedLength, totalModifierLength) {
+TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
+  var segments = [];
+  if (e <= 1) {
+    segments.push({
+      s: s,
+      e: e,
+    });
+  } else if (s >= 1) {
+    segments.push({
+      s: s - 1,
+      e: e - 1,
+    });
+  } else {
+    segments.push({
+      s: s,
+      e: 1,
+    });
+    segments.push({
+      s: 0,
+      e: e - 1,
+    });
+  }
+  var shapeSegments = [];
+  var i;
+  var len = segments.length;
+  var segmentOb;
+  for (i = 0; i < len; i += 1) {
+    segmentOb = segments[i];
+    if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
+      var shapeS;
+      var shapeE;
+      if (segmentOb.s * totalModifierLength <= addedLength) {
+        shapeS = 0;
+      } else {
+        shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
+      }
+      if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
+        shapeE = 1;
+      } else {
+        shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
+      }
+      shapeSegments.push([shapeS, shapeE]);
+    }
+  }
+  if (!shapeSegments.length) {
+    shapeSegments.push([0, 0]);
+  }
+  return shapeSegments;
+};
+
+TrimModifier.prototype.releasePathsData = function (pathsData) {
+  var i;
+  var len = pathsData.length;
+  for (i = 0; i < len; i += 1) {
+    segmentsLengthPool.release(pathsData[i]);
+  }
+  pathsData.length = 0;
+  return pathsData;
+};
+
+TrimModifier.prototype.processShapes = function (_isFirstFrame) {
+  var s;
+  var e;
+  if (this._mdf || _isFirstFrame) {
+    var o = (this.o.v % 360) / 360;
+    if (o < 0) {
+      o += 1;
+    }
+    if (this.s.v > 1) {
+      s = 1 + o;
+    } else if (this.s.v < 0) {
+      s = 0 + o;
+    } else {
+      s = this.s.v + o;
+    }
+    if (this.e.v > 1) {
+      e = 1 + o;
+    } else if (this.e.v < 0) {
+      e = 0 + o;
+    } else {
+      e = this.e.v + o;
+    }
+
+    if (s > e) {
+      var _s = s;
+      s = e;
+      e = _s;
+    }
+    s = Math.round(s * 10000) * 0.0001;
+    e = Math.round(e * 10000) * 0.0001;
+    this.sValue = s;
+    this.eValue = e;
+  } else {
+    s = this.sValue;
+    e = this.eValue;
+  }
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var pathsData;
+  var pathData;
+  var totalShapeLength;
+  var totalModifierLength = 0;
+
+  if (e === s) {
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].localShapeCollection.releaseShapes();
+      this.shapes[i].shape._mdf = true;
+      this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+      if (this._mdf) {
+        this.shapes[i].pathsData.length = 0;
+      }
+    }
+  } else if (!((e === 1 && s === 0) || (e === 0 && s === 1))) {
     var segments = [];
-    if (e <= 1) {
-        segments.push({
-            s: s,
-            e: e
-        });
-    } else if (s >= 1) {
-        segments.push({
-            s: s - 1,
-            e: e - 1
-        });
-    } else {
-        segments.push({
-            s: s,
-            e: 1
-        });
-        segments.push({
-            s: 0,
-            e: e - 1
-        });
-    }
-    var shapeSegments = [];
-    var i, len = segments.length, segmentOb;
+    var shapeData;
+    var localShapeCollection;
     for (i = 0; i < len; i += 1) {
-        segmentOb = segments[i];
-        if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) {
-            
+      shapeData = this.shapes[i];
+      // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
+      if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
+        shapeData.shape.paths = shapeData.localShapeCollection;
+      } else {
+        shapePaths = shapeData.shape.paths;
+        jLen = shapePaths._length;
+        totalShapeLength = 0;
+        if (!shapeData.shape._mdf && shapeData.pathsData.length) {
+          totalShapeLength = shapeData.totalShapeLength;
         } else {
-            var shapeS, shapeE;
-            if (segmentOb.s * totalModifierLength <= addedLength) {
-                shapeS = 0;
-            } else {
-                shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
-            }
-            if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
-                shapeE = 1;
-            } else {
-                shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength);
-            }
-            shapeSegments.push([shapeS, shapeE]);
+          pathsData = this.releasePathsData(shapeData.pathsData);
+          for (j = 0; j < jLen; j += 1) {
+            pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
+            pathsData.push(pathData);
+            totalShapeLength += pathData.totalLength;
+          }
+          shapeData.totalShapeLength = totalShapeLength;
+          shapeData.pathsData = pathsData;
         }
+
+        totalModifierLength += totalShapeLength;
+        shapeData.shape._mdf = true;
+      }
     }
-    if (!shapeSegments.length) {
-        shapeSegments.push([0, 0]);
-    }
-    return shapeSegments;
-};
-
-TrimModifier.prototype.releasePathsData = function(pathsData) {
-    var i, len = pathsData.length;
-    for (i = 0; i < len; i += 1) {
-        segments_length_pool.release(pathsData[i]);
-    }
-    pathsData.length = 0;
-    return pathsData;
-};
-
-TrimModifier.prototype.processShapes = function(_isFirstFrame) {
-    var s, e;
-    if (this._mdf || _isFirstFrame) {
-        var o = (this.o.v % 360) / 360;
-        if (o < 0) {
-            o += 1;
-        }
-        s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o;
-        e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o;
-        if (s === e) {
-
-        }
-        if (s > e) {
-            var _s = s;
-            s = e;
-            e = _s;
-        }
-        s = Math.round(s * 10000) * 0.0001;
-        e = Math.round(e * 10000) * 0.0001;
-        this.sValue = s;
-        this.eValue = e;
-    } else {
-        s = this.sValue;
-        e = this.eValue;
-    }
-    var shapePaths;
-    var i, len = this.shapes.length, j, jLen;
-    var pathsData, pathData, totalShapeLength, totalModifierLength = 0;
-
-    if (e === s) {
-        for (i = 0; i < len; i += 1) {
-            this.shapes[i].localShapeCollection.releaseShapes();
-            this.shapes[i].shape._mdf = true;
-            this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
-            if (this._mdf) {
-                this.shapes[i].pathsData.length = 0;
-            }
-        }
-    } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
-        var segments = [], shapeData, localShapeCollection;
-        for (i = 0; i < len; i += 1) {
-            shapeData = this.shapes[i];
-            // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
-            if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
-                shapeData.shape.paths = shapeData.localShapeCollection;
-            } else {
-                shapePaths = shapeData.shape.paths;
-                jLen = shapePaths._length;
-                totalShapeLength = 0;
-                if (!shapeData.shape._mdf && shapeData.pathsData.length) {
-                    totalShapeLength = shapeData.totalShapeLength;
-                } else {
-                    pathsData = this.releasePathsData(shapeData.pathsData);
-                    for (j = 0; j < jLen; j += 1) {
-                        pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
-                        pathsData.push(pathData);
-                        totalShapeLength += pathData.totalLength;
-                    }
-                    shapeData.totalShapeLength = totalShapeLength;
-                    shapeData.pathsData = pathsData;
-                }
-
-                totalModifierLength += totalShapeLength;
-                shapeData.shape._mdf = true;
-            }
-        }
-        var shapeS = s, shapeE = e, addedLength = 0, edges;
-        for (i = len - 1; i >= 0; i -= 1) {
-            shapeData = this.shapes[i];
-            if (shapeData.shape._mdf) {
-                localShapeCollection = shapeData.localShapeCollection;
-                localShapeCollection.releaseShapes();
-                //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
-                if (this.m === 2 && len > 1) {
-                    edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
-                    addedLength += shapeData.totalShapeLength;
-                } else {
-                    edges = [[shapeS, shapeE]];
-                }
-                jLen = edges.length;
-                for (j = 0; j < jLen; j += 1) {
-                    shapeS = edges[j][0];
-                    shapeE = edges[j][1];
-                    segments.length = 0;
-                    if (shapeE <= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength * shapeE
-                        });
-                    } else if (shapeS >= 1) {
-                        segments.push({
-                            s:shapeData.totalShapeLength * (shapeS - 1),
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    } else {
-                        segments.push({
-                            s:shapeData.totalShapeLength * shapeS,
-                            e:shapeData.totalShapeLength
-                        });
-                        segments.push({
-                            s:0,
-                            e:shapeData.totalShapeLength * (shapeE - 1)
-                        });
-                    }
-                    var newShapesData = this.addShapes(shapeData,segments[0]);
-                    if (segments[0].s !== segments[0].e) {
-                        if (segments.length > 1) {
-                            var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
-                            if (lastShapeInCollection.c) {
-                                var lastShape = newShapesData.pop();
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
-                            } else {
-                                this.addPaths(newShapesData, localShapeCollection);
-                                newShapesData = this.addShapes(shapeData, segments[1]);
-                            }
-                        } 
-                        this.addPaths(newShapesData, localShapeCollection);
-                    }
-                    
-                }
-                shapeData.shape.paths = localShapeCollection;
-            }
-        }
-    } else if (this._mdf) {
-        for (i = 0; i < len; i += 1) {
-            //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
-            //Don't remove this even if it's losing cached info.
-            this.shapes[i].pathsData.length = 0;
-            this.shapes[i].shape._mdf = true;
-        }
-    }
-};
-
-TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) {
-    var i, len = newPaths.length;
-    for (i = 0; i < len; i += 1) {
-        localShapeCollection.addShape(newPaths[i]);
-    }
-};
-
-TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
-    shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
-    shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
-    }
-    shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) {
-    shapePath.setXYAt(points[1], points[5], 'o', pos);
-    shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
-    if(newShape){
-        shapePath.setXYAt(points[0], points[4], 'v', pos);
-    }
-    shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
-};
-
-TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) {
-    var pathsData = shapeData.pathsData;
-    var shapePaths = shapeData.shape.paths.shapes;
-    var i, len = shapeData.shape.paths._length, j, jLen;
+    var shapeS = s;
+    var shapeE = e;
     var addedLength = 0;
-    var currentLengthData,segmentCount;
-    var lengths;
-    var segment;
-    var shapes = [];
-    var initPos;
-    var newShape = true;
-    if (!shapePath) {
-        shapePath = shape_pool.newElement();
-        segmentCount = 0;
-        initPos = 0;
-    } else {
-        segmentCount = shapePath._length;
-        initPos = shapePath._length;
+    var edges;
+    for (i = len - 1; i >= 0; i -= 1) {
+      shapeData = this.shapes[i];
+      if (shapeData.shape._mdf) {
+        localShapeCollection = shapeData.localShapeCollection;
+        localShapeCollection.releaseShapes();
+        // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
+        if (this.m === 2 && len > 1) {
+          edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
+          addedLength += shapeData.totalShapeLength;
+        } else {
+          edges = [[shapeS, shapeE]];
+        }
+        jLen = edges.length;
+        for (j = 0; j < jLen; j += 1) {
+          shapeS = edges[j][0];
+          shapeE = edges[j][1];
+          segments.length = 0;
+          if (shapeE <= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength * shapeE,
+            });
+          } else if (shapeS >= 1) {
+            segments.push({
+              s: shapeData.totalShapeLength * (shapeS - 1),
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          } else {
+            segments.push({
+              s: shapeData.totalShapeLength * shapeS,
+              e: shapeData.totalShapeLength,
+            });
+            segments.push({
+              s: 0,
+              e: shapeData.totalShapeLength * (shapeE - 1),
+            });
+          }
+          var newShapesData = this.addShapes(shapeData, segments[0]);
+          if (segments[0].s !== segments[0].e) {
+            if (segments.length > 1) {
+              var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
+              if (lastShapeInCollection.c) {
+                var lastShape = newShapesData.pop();
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1], lastShape);
+              } else {
+                this.addPaths(newShapesData, localShapeCollection);
+                newShapesData = this.addShapes(shapeData, segments[1]);
+              }
+            }
+            this.addPaths(newShapesData, localShapeCollection);
+          }
+        }
+        shapeData.shape.paths = localShapeCollection;
+      }
     }
-    shapes.push(shapePath);
+  } else if (this._mdf) {
     for (i = 0; i < len; i += 1) {
-        lengths = pathsData[i].lengths;
-        shapePath.c = shapePaths[i].c;
-        jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
-        for (j = 1; j < jLen; j +=1) {
-            currentLengthData = lengths[j-1];
-            if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
-                addedLength += currentLengthData.addedLength;
-                shapePath.c = false;
-            } else if(addedLength > shapeSegment.e) {
-                shapePath.c = false;
-                break;
-            } else {
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-                addedLength += currentLengthData.addedLength;
-                segmentCount += 1;
-            }
-        }
-        if (shapePaths[i].c && lengths.length) {
-            currentLengthData = lengths[j - 1];
-            if (addedLength <= shapeSegment.e) {
-                var segmentLength = lengths[j - 1].addedLength;
-                if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
-                    this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
-                    newShape = false;
-                } else {
-                    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]);
-                    this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
-                    // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
-                    newShape = false;
-                    shapePath.c = false;
-                }
-            } else {
-                shapePath.c = false;
-            }
-            addedLength += currentLengthData.addedLength;
-            segmentCount += 1;
-        }
-        if (shapePath._length) {
-            shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
-            shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1);
-        }
-        if (addedLength > shapeSegment.e) {
-            break;
-        }
-        if (i < len - 1) {
-            shapePath = shape_pool.newElement();
-            newShape = true;
-            shapes.push(shapePath);
-            segmentCount = 0;
-        }
+      // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
+      // Don't remove this even if it's losing cached info.
+      this.shapes[i].pathsData.length = 0;
+      this.shapes[i].shape._mdf = true;
     }
-    return shapes;
+  }
 };
 
+TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
+  var i;
+  var len = newPaths.length;
+  for (i = 0; i < len; i += 1) {
+    localShapeCollection.addShape(newPaths[i]);
+  }
+};
+
+TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
+  shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
+  shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
+  }
+  shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
+  shapePath.setXYAt(points[1], points[5], 'o', pos);
+  shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
+  if (newShape) {
+    shapePath.setXYAt(points[0], points[4], 'v', pos);
+  }
+  shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
+};
+
+TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
+  var pathsData = shapeData.pathsData;
+  var shapePaths = shapeData.shape.paths.shapes;
+  var i;
+  var len = shapeData.shape.paths._length;
+  var j;
+  var jLen;
+  var addedLength = 0;
+  var currentLengthData;
+  var segmentCount;
+  var lengths;
+  var segment;
+  var shapes = [];
+  var initPos;
+  var newShape = true;
+  if (!shapePath) {
+    shapePath = shapePool.newElement();
+    segmentCount = 0;
+    initPos = 0;
+  } else {
+    segmentCount = shapePath._length;
+    initPos = shapePath._length;
+  }
+  shapes.push(shapePath);
+  for (i = 0; i < len; i += 1) {
+    lengths = pathsData[i].lengths;
+    shapePath.c = shapePaths[i].c;
+    jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
+    for (j = 1; j < jLen; j += 1) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
+        addedLength += currentLengthData.addedLength;
+        shapePath.c = false;
+      } else if (addedLength > shapeSegment.e) {
+        shapePath.c = false;
+        break;
+      } else {
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+        addedLength += currentLengthData.addedLength;
+        segmentCount += 1;
+      }
+    }
+    if (shapePaths[i].c && lengths.length) {
+      currentLengthData = lengths[j - 1];
+      if (addedLength <= shapeSegment.e) {
+        var segmentLength = lengths[j - 1].addedLength;
+        if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
+          this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
+          newShape = false;
+        } else {
+          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]);
+          this.addSegmentFromArray(segment, shapePath, segmentCount, newShape);
+          // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
+          newShape = false;
+          shapePath.c = false;
+        }
+      } else {
+        shapePath.c = false;
+      }
+      addedLength += currentLengthData.addedLength;
+      segmentCount += 1;
+    }
+    if (shapePath._length) {
+      shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
+      shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
+    }
+    if (addedLength > shapeSegment.e) {
+      break;
+    }
+    if (i < len - 1) {
+      shapePath = shapePool.newElement();
+      newShape = true;
+      shapes.push(shapePath);
+      segmentCount = 0;
+    }
+  }
+  return shapes;
+};
 
 ShapeModifiers.registerModifier('tm', TrimModifier);
-function RoundCornersModifier(){}
-extendPrototype([ShapeModifier],RoundCornersModifier);
-RoundCornersModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.rd = PropertyFactory.getProp(elem,data.r,0,null,this);
-    this._isAnimated = !!this.rd.effectsSequence.length;
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, roundCorner, ShapeModifiers */
+
+function RoundCornersModifier() {}
+extendPrototype([ShapeModifier], RoundCornersModifier);
+RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
+  this._isAnimated = !!this.rd.effectsSequence.length;
 };
 
-RoundCornersModifier.prototype.processPath = function(path, round){
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var i, len = path._length;
-    var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0;
-    var vX,vY,oX,oY,iX,iY;
-    for(i=0;i<len;i+=1){
-        currentV = path.v[i];
-        currentO = path.o[i];
-        currentI = path.i[i];
-        if(currentV[0]===currentO[0] && currentV[1]===currentO[1] && currentV[0]===currentI[0] && currentV[1]===currentI[1]){
-            if((i===0 || i === len - 1) && !path.c){
-                cloned_path.setTripleAt(currentV[0],currentV[1],currentO[0],currentO[1],currentI[0],currentI[1],index);
-                /*cloned_path.v[index] = currentV;
-                cloned_path.o[index] = currentO;
-                cloned_path.i[index] = currentI;*/
-                index += 1;
-            } else {
-                if(i===0){
-                    closerV = path.v[len-1];
-                } else {
-                    closerV = path.v[i-1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = iX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = iY = currentV[1]-(currentV[1]-closerV[1])*newPosPerc;
-                oX = vX-(vX-currentV[0])*roundCorner;
-                oY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-
-                if(i === len - 1){
-                    closerV = path.v[0];
-                } else {
-                    closerV = path.v[i+1];
-                }
-                distance = Math.sqrt(Math.pow(currentV[0]-closerV[0],2)+Math.pow(currentV[1]-closerV[1],2));
-                newPosPerc = distance ? Math.min(distance/2,round)/distance : 0;
-                vX = oX = currentV[0]+(closerV[0]-currentV[0])*newPosPerc;
-                vY = oY = currentV[1]+(closerV[1]-currentV[1])*newPosPerc;
-                iX = vX-(vX-currentV[0])*roundCorner;
-                iY = vY-(vY-currentV[1])*roundCorner;
-                cloned_path.setTripleAt(vX,vY,oX,oY,iX,iY,index);
-                index += 1;
-            }
+RoundCornersModifier.prototype.processPath = function (path, round) {
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var i;
+  var len = path._length;
+  var currentV;
+  var currentI;
+  var currentO;
+  var closerV;
+  var distance;
+  var newPosPerc;
+  var index = 0;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < len; i += 1) {
+    currentV = path.v[i];
+    currentO = path.o[i];
+    currentI = path.i[i];
+    if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
+      if ((i === 0 || i === len - 1) && !path.c) {
+        clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
+        /* clonedPath.v[index] = currentV;
+                clonedPath.o[index] = currentO;
+                clonedPath.i[index] = currentI; */
+        index += 1;
+      } else {
+        if (i === 0) {
+          closerV = path.v[len - 1];
         } else {
-            cloned_path.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);
-            index += 1;
+          closerV = path.v[i - 1];
         }
-    }
-    return cloned_path;
-};
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = iX;
+        iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
+        vY = iY;
+        oX = vX - (vX - currentV[0]) * roundCorner;
+        oY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
 
-RoundCornersModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var rd = this.rd.v;
-
-    if(rd !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j],rd));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+        if (i === len - 1) {
+          closerV = path.v[0];
+        } else {
+          closerV = path.v[i + 1];
         }
-
+        distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
+        newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
+        oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
+        vX = oX;
+        oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
+        vY = oY;
+        iX = vX - (vX - currentV[0]) * roundCorner;
+        iY = vY - (vY - currentV[1]) * roundCorner;
+        clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
+        index += 1;
+      }
+    } else {
+      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);
+      index += 1;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  return clonedPath;
 };
 
-ShapeModifiers.registerModifier('rd',RoundCornersModifier);
-function PuckerAndBloatModifier(){}
-extendPrototype([ShapeModifier],PuckerAndBloatModifier);
-PuckerAndBloatModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.amount = PropertyFactory.getProp(elem,data.a,0,null,this);
-    this._isAnimated = !!this.amount.effectsSequence.length;
-};
+RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var rd = this.rd.v;
 
-PuckerAndBloatModifier.prototype.processPath = function(path, amount){
-    var percent = amount / 100;
-    var centerPoint = [0, 0];
-    var pathLength = path._length, i = 0;
-    for (i = 0; i < pathLength; i += 1) {
-        centerPoint[0] += path.v[i][0];
-        centerPoint[1] += path.v[i][1];
-    }
-    centerPoint[0] /= pathLength;
-    centerPoint[1] /= pathLength;
-    var cloned_path = shape_pool.newElement();
-    cloned_path.c = path.c;
-    var vX, vY, oX, oY, iX, iY;
-    for(i = 0; i < pathLength; i += 1) {
-        vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
-        vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
-        oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
-        oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
-        iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
-        iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
-        cloned_path.setTripleAt(vX, vY, oX, oY, iX, iY, i);
-    }
-    return cloned_path;
-};
-
-PuckerAndBloatModifier.prototype.processShapes = function(_isFirstFrame){
-    var shapePaths;
-    var i, len = this.shapes.length;
-    var j, jLen;
-    var amount = this.amount.v;
-
-    if(amount !== 0){
-        var shapeData, newPaths, localShapeCollection;
-        for(i=0;i<len;i+=1){
-            shapeData = this.shapes[i];
-            newPaths = shapeData.shape.paths;
-            localShapeCollection = shapeData.localShapeCollection;
-            if(!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)){
-                localShapeCollection.releaseShapes();
-                shapeData.shape._mdf = true;
-                shapePaths = shapeData.shape.paths.shapes;
-                jLen = shapeData.shape.paths._length;
-                for(j=0;j<jLen;j+=1){
-                    localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
-                }
-            }
-            shapeData.shape.paths = shapeData.localShapeCollection;
+  if (rd !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
         }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
     }
-    if(!this.dynamicProperties.length){
-        this._mdf = false;
-    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
 };
-ShapeModifiers.registerModifier('pb',PuckerAndBloatModifier);
-function RepeaterModifier(){}
+
+ShapeModifiers.registerModifier('rd', RoundCornersModifier);
+
+/* global extendPrototype, ShapeModifier, PropertyFactory, shapePool, ShapeModifiers */
+
+function PuckerAndBloatModifier() {}
+extendPrototype([ShapeModifier], PuckerAndBloatModifier);
+PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
+  this._isAnimated = !!this.amount.effectsSequence.length;
+};
+
+PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
+  var percent = amount / 100;
+  var centerPoint = [0, 0];
+  var pathLength = path._length;
+  var i = 0;
+  for (i = 0; i < pathLength; i += 1) {
+    centerPoint[0] += path.v[i][0];
+    centerPoint[1] += path.v[i][1];
+  }
+  centerPoint[0] /= pathLength;
+  centerPoint[1] /= pathLength;
+  var clonedPath = shapePool.newElement();
+  clonedPath.c = path.c;
+  var vX;
+  var vY;
+  var oX;
+  var oY;
+  var iX;
+  var iY;
+  for (i = 0; i < pathLength; i += 1) {
+    vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
+    vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
+    oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
+    oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
+    iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
+    iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
+    clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
+  }
+  return clonedPath;
+};
+
+PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
+  var shapePaths;
+  var i;
+  var len = this.shapes.length;
+  var j;
+  var jLen;
+  var amount = this.amount.v;
+
+  if (amount !== 0) {
+    var shapeData;
+    var localShapeCollection;
+    for (i = 0; i < len; i += 1) {
+      shapeData = this.shapes[i];
+      localShapeCollection = shapeData.localShapeCollection;
+      if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
+        localShapeCollection.releaseShapes();
+        shapeData.shape._mdf = true;
+        shapePaths = shapeData.shape.paths.shapes;
+        jLen = shapeData.shape.paths._length;
+        for (j = 0; j < jLen; j += 1) {
+          localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
+        }
+      }
+      shapeData.shape.paths = shapeData.localShapeCollection;
+    }
+  }
+  if (!this.dynamicProperties.length) {
+    this._mdf = false;
+  }
+};
+ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
+
+/* global extendPrototype, ShapeModifier, TransformPropertyFactory, PropertyFactory, Matrix, ShapeModifiers */
+
+function RepeaterModifier() {}
 extendPrototype([ShapeModifier], RepeaterModifier);
 
-RepeaterModifier.prototype.initModifierProperties = function(elem,data){
-    this.getValue = this.processKeys;
-    this.c = PropertyFactory.getProp(elem,data.c,0,null,this);
-    this.o = PropertyFactory.getProp(elem,data.o,0,null,this);
-    this.tr = TransformPropertyFactory.getTransformProperty(elem,data.tr,this);
-    this.so = PropertyFactory.getProp(elem,data.tr.so,0,0.01,this);
-    this.eo = PropertyFactory.getProp(elem,data.tr.eo,0,0.01,this);
-    this.data = data;
-    if(!this.dynamicProperties.length){
-        this.getValue(true);
-    }
-    this._isAnimated = !!this.dynamicProperties.length;
-    this.pMatrix = new Matrix();
-    this.rMatrix = new Matrix();
-    this.sMatrix = new Matrix();
-    this.tMatrix = new Matrix();
-    this.matrix = new Matrix();
+RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
+  this.getValue = this.processKeys;
+  this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
+  this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
+  this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
+  this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
+  this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
+  this.data = data;
+  if (!this.dynamicProperties.length) {
+    this.getValue(true);
+  }
+  this._isAnimated = !!this.dynamicProperties.length;
+  this.pMatrix = new Matrix();
+  this.rMatrix = new Matrix();
+  this.sMatrix = new Matrix();
+  this.tMatrix = new Matrix();
+  this.matrix = new Matrix();
 };
 
-RepeaterModifier.prototype.applyTransforms = function(pMatrix, rMatrix, sMatrix, transform, perc, inv){
-    var dir = inv ? -1 : 1;
-    var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
-    var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
-    pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
-    rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    rMatrix.rotate(-transform.r.v * dir * perc);
-    rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
-    sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
-    sMatrix.scale(inv ? 1/scaleX : scaleX, inv ? 1/scaleY : scaleY);
-    sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
+  var dir = inv ? -1 : 1;
+  var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
+  var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
+  pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
+  rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  rMatrix.rotate(-transform.r.v * dir * perc);
+  rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
+  sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
+  sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
+  sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
 };
 
-RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
-    this.elem = elem;
-    this.arr = arr;
-    this.pos = pos;
-    this.elemsData = elemsData;
-    this._currentCopies = 0;
-    this._elements = [];
-    this._groups = [];
-    this.frameId = -1;
-    this.initDynamicPropertyContainer(elem);
-    this.initModifierProperties(elem,arr[pos]);
-    var cont = 0;
-    while(pos>0){
-        pos -= 1;
-        //this._elements.unshift(arr.splice(pos,1)[0]);
-        this._elements.unshift(arr[pos]);
-        cont += 1;
-    }
-    if(this.dynamicProperties.length){
-        this.k = true;
-    }else{
-        this.getValue(true);
-    }
+RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
+  this.elem = elem;
+  this.arr = arr;
+  this.pos = pos;
+  this.elemsData = elemsData;
+  this._currentCopies = 0;
+  this._elements = [];
+  this._groups = [];
+  this.frameId = -1;
+  this.initDynamicPropertyContainer(elem);
+  this.initModifierProperties(elem, arr[pos]);
+  while (pos > 0) {
+    pos -= 1;
+    // this._elements.unshift(arr.splice(pos,1)[0]);
+    this._elements.unshift(arr[pos]);
+  }
+  if (this.dynamicProperties.length) {
+    this.k = true;
+  } else {
+    this.getValue(true);
+  }
 };
 
-RepeaterModifier.prototype.resetElements = function(elements){
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._processed = false;
-        if(elements[i].ty === 'gr'){
-            this.resetElements(elements[i].it);
+RepeaterModifier.prototype.resetElements = function (elements) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._processed = false;
+    if (elements[i].ty === 'gr') {
+      this.resetElements(elements[i].it);
+    }
+  }
+};
+
+RepeaterModifier.prototype.cloneElements = function (elements) {
+  var newElements = JSON.parse(JSON.stringify(elements));
+  this.resetElements(newElements);
+  return newElements;
+};
+
+RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
+  var i;
+  var len = elements.length;
+  for (i = 0; i < len; i += 1) {
+    elements[i]._render = renderFlag;
+    if (elements[i].ty === 'gr') {
+      this.changeGroupRender(elements[i].it, renderFlag);
+    }
+  }
+};
+
+RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
+  var items;
+  var itemsTransform;
+  var i;
+  var dir;
+  var cont;
+  if (this._mdf || _isFirstFrame) {
+    var copies = Math.ceil(this.c.v);
+    if (this._groups.length < copies) {
+      while (this._groups.length < copies) {
+        var group = {
+          it: this.cloneElements(this._elements),
+          ty: 'gr',
+        };
+        group.it.push({
+          a: { a: 0, ix: 1, k: [0, 0] }, nm: 'Transform', o: { a: 0, ix: 7, k: 100 }, p: { a: 0, ix: 2, k: [0, 0] }, r: { a: 1, ix: 6, k: [{ s: 0, e: 0, t: 0 }, { s: 0, e: 0, t: 1 }] }, s: { a: 0, ix: 3, k: [100, 100] }, sa: { a: 0, ix: 5, k: 0 }, sk: { a: 0, ix: 4, k: 0 }, ty: 'tr',
+        });
+
+        this.arr.splice(0, 0, group);
+        this._groups.splice(0, 0, group);
+        this._currentCopies += 1;
+      }
+      this.elem.reloadShapes();
+    }
+    cont = 0;
+    var renderFlag;
+    for (i = 0; i <= this._groups.length - 1; i += 1) {
+      renderFlag = cont < copies;
+      this._groups[i]._render = renderFlag;
+      this.changeGroupRender(this._groups[i].it, renderFlag);
+      cont += 1;
+    }
+
+    this._currentCopies = copies;
+    /// /
+
+    var offset = this.o.v;
+    var offsetModulo = offset % 1;
+    var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
+    var pProps = this.pMatrix.props;
+    var rProps = this.rMatrix.props;
+    var sProps = this.sMatrix.props;
+    this.pMatrix.reset();
+    this.rMatrix.reset();
+    this.sMatrix.reset();
+    this.tMatrix.reset();
+    this.matrix.reset();
+    var iteration = 0;
+
+    if (offset > 0) {
+      while (iteration < roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
+        iteration += 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
+        iteration += offsetModulo;
+      }
+    } else if (offset < 0) {
+      while (iteration > roundOffset) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
+        iteration -= 1;
+      }
+      if (offsetModulo) {
+        this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
+        iteration -= offsetModulo;
+      }
+    }
+    i = this.data.m === 1 ? 0 : this._currentCopies - 1;
+    dir = this.data.m === 1 ? 1 : -1;
+    cont = this._currentCopies;
+    var j;
+    var jLen;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      jLen = itemsTransform.length;
+      items[items.length - 1].transform.mProps._mdf = true;
+      items[items.length - 1].transform.op._mdf = true;
+      items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
+      if (iteration !== 0) {
+        if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
+          this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
         }
-    }
-};
+        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]);
+        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]);
+        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]);
 
-RepeaterModifier.prototype.cloneElements = function(elements){
-    var i, len = elements.length;
-    var newElements = JSON.parse(JSON.stringify(elements));
-    this.resetElements(newElements);
-    return newElements;
-};
-
-RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) {
-    var i, len = elements.length;
-    for(i = 0; i < len; i += 1) {
-        elements[i]._render = renderFlag;
-        if(elements[i].ty === 'gr') {
-            this.changeGroupRender(elements[i].it, renderFlag);
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-    }
-};
-
-RepeaterModifier.prototype.processShapes = function(_isFirstFrame) {
-    var items, itemsTransform, i, dir, cont;
-    if(this._mdf || _isFirstFrame){
-        var copies = Math.ceil(this.c.v);
-        if(this._groups.length < copies){
-            while(this._groups.length < copies){
-                var group = {
-                    it:this.cloneElements(this._elements),
-                    ty:'gr'
-                };
-                group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"});
-                
-                this.arr.splice(0,0,group);
-                this._groups.splice(0,0,group);
-                this._currentCopies += 1;
-            }
-            this.elem.reloadShapes();
-        }
-        cont = 0;
-        var renderFlag;
-        for(i = 0; i  <= this._groups.length - 1; i += 1){
-            renderFlag = cont < copies;
-            this._groups[i]._render = renderFlag;
-            this.changeGroupRender(this._groups[i].it, renderFlag);
-            cont += 1;
-        }
-        
-        this._currentCopies = copies;
-        ////
-
-        var offset = this.o.v;
-        var offsetModulo = offset%1;
-        var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
-        var k;
-        var tMat = this.tr.v.props;
-        var pProps = this.pMatrix.props;
-        var rProps = this.rMatrix.props;
-        var sProps = this.sMatrix.props;
-        this.pMatrix.reset();
-        this.rMatrix.reset();
-        this.sMatrix.reset();
-        this.tMatrix.reset();
         this.matrix.reset();
-        var iteration = 0;
-
-        if(offset > 0) {
-            while(iteration<roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                iteration += 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
-                iteration += offsetModulo;
-            }
-        } else if(offset < 0) {
-            while(iteration>roundOffset){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
-                iteration -= 1;
-            }
-            if(offsetModulo){
-                this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true);
-                iteration -= offsetModulo;
-            }
+      } else {
+        this.matrix.reset();
+        for (j = 0; j < jLen; j += 1) {
+          itemsTransform[j] = this.matrix.props[j];
         }
-        i = this.data.m === 1 ? 0 : this._currentCopies - 1;
-        dir = this.data.m === 1 ? 1 : -1;
-        cont = this._currentCopies;
-        var j, jLen;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            jLen = itemsTransform.length;
-            items[items.length - 1].transform.mProps._mdf = true;
-            items[items.length - 1].transform.op._mdf = true;
-            items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
-            if(iteration !== 0){
-                if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){
-                    this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
-                }
-                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]);
-                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]);
-                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]);
-                
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-                this.matrix.reset();
-            } else {
-                this.matrix.reset();
-                for(j=0;j<jLen;j+=1) {
-                    itemsTransform[j] = this.matrix.props[j];
-                }
-            }
-            iteration += 1;
-            cont -= 1;
-            i += dir;
-        }
-    } else {
-        cont = this._currentCopies;
-        i = 0;
-        dir = 1;
-        while(cont){
-            items = this.elemsData[i].it;
-            itemsTransform = items[items.length - 1].transform.mProps.v.props;
-            items[items.length - 1].transform.mProps._mdf = false;
-            items[items.length - 1].transform.op._mdf = false;
-            cont -= 1;
-            i += dir;
-        }
+      }
+      iteration += 1;
+      cont -= 1;
+      i += dir;
     }
+  } else {
+    cont = this._currentCopies;
+    i = 0;
+    dir = 1;
+    while (cont) {
+      items = this.elemsData[i].it;
+      itemsTransform = items[items.length - 1].transform.mProps.v.props;
+      items[items.length - 1].transform.mProps._mdf = false;
+      items[items.length - 1].transform.op._mdf = false;
+      cont -= 1;
+      i += dir;
+    }
+  }
 };
 
-RepeaterModifier.prototype.addShape = function(){};
+RepeaterModifier.prototype.addShape = function () {};
 
-ShapeModifiers.registerModifier('rp',RepeaterModifier);
-function ShapeCollection(){
-	this._length = 0;
-	this._maxLength = 4;
-	this.shapes = createSizedArray(this._maxLength);
+ShapeModifiers.registerModifier('rp', RepeaterModifier);
+
+/* global createSizedArray, shapePool */
+
+function ShapeCollection() {
+  this._length = 0;
+  this._maxLength = 4;
+  this.shapes = createSizedArray(this._maxLength);
 }
 
-ShapeCollection.prototype.addShape = function(shapeData){
-	if(this._length === this._maxLength){
-		this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
-		this._maxLength *= 2;
-	}
-	this.shapes[this._length] = shapeData;
-	this._length += 1;
+ShapeCollection.prototype.addShape = function (shapeData) {
+  if (this._length === this._maxLength) {
+    this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
+    this._maxLength *= 2;
+  }
+  this.shapes[this._length] = shapeData;
+  this._length += 1;
 };
 
-ShapeCollection.prototype.releaseShapes = function(){
-	var i;
-	for(i = 0; i < this._length; i += 1) {
-		shape_pool.release(this.shapes[i]);
-	}
-	this._length = 0;
+ShapeCollection.prototype.releaseShapes = function () {
+  var i;
+  for (i = 0; i < this._length; i += 1) {
+    shapePool.release(this.shapes[i]);
+  }
+  this._length = 0;
 };
+
+/* global createSizedArray, createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
 function DashProperty(elem, data, renderer, container) {
-    this.elem = elem;
-    this.frameId = -1;
-    this.dataProps = createSizedArray(data.length);
-    this.renderer = renderer;
-    this.k = false;
-    this.dashStr = '';
-    this.dashArray = createTypedArray('float32',  data.length ? data.length - 1 : 0);
-    this.dashoffset = createTypedArray('float32',  1);
-    this.initDynamicPropertyContainer(container);
-    var i, len = data.length || 0, prop;
-    for(i = 0; i < len; i += 1) {
-        prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
-        this.k = prop.k || this.k;
-        this.dataProps[i] = {n:data[i].n,p:prop};
-    }
-    if(!this.k){
-        this.getValue(true);
-    }
-    this._isAnimated = this.k;
+  this.elem = elem;
+  this.frameId = -1;
+  this.dataProps = createSizedArray(data.length);
+  this.renderer = renderer;
+  this.k = false;
+  this.dashStr = '';
+  this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
+  this.dashoffset = createTypedArray('float32', 1);
+  this.initDynamicPropertyContainer(container);
+  var i;
+  var len = data.length || 0;
+  var prop;
+  for (i = 0; i < len; i += 1) {
+    prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
+    this.k = prop.k || this.k;
+    this.dataProps[i] = { n: data[i].n, p: prop };
+  }
+  if (!this.k) {
+    this.getValue(true);
+  }
+  this._isAnimated = this.k;
 }
 
-DashProperty.prototype.getValue = function(forceRender) {
-    if(this.elem.globalData.frameId === this.frameId && !forceRender){
-        return;
+DashProperty.prototype.getValue = function (forceRender) {
+  if (this.elem.globalData.frameId === this.frameId && !forceRender) {
+    return;
+  }
+  this.frameId = this.elem.globalData.frameId;
+  this.iterateDynamicProperties();
+  this._mdf = this._mdf || forceRender;
+  if (this._mdf) {
+    var i = 0;
+    var len = this.dataProps.length;
+    if (this.renderer === 'svg') {
+      this.dashStr = '';
     }
-    this.frameId = this.elem.globalData.frameId;
-    this.iterateDynamicProperties();
-    this._mdf = this._mdf || forceRender;
-    if (this._mdf) {
-        var i = 0, len = this.dataProps.length;
-        if(this.renderer === 'svg') {
-            this.dashStr = '';
+    for (i = 0; i < len; i += 1) {
+      if (this.dataProps[i].n !== 'o') {
+        if (this.renderer === 'svg') {
+          this.dashStr += ' ' + this.dataProps[i].p.v;
+        } else {
+          this.dashArray[i] = this.dataProps[i].p.v;
         }
-        for(i=0;i<len;i+=1){
-            if(this.dataProps[i].n != 'o'){
-                if(this.renderer === 'svg') {
-                    this.dashStr += ' ' + this.dataProps[i].p.v;
-                }else{
-                    this.dashArray[i] = this.dataProps[i].p.v;
-                }
-            }else{
-                this.dashoffset[0] = this.dataProps[i].p.v;
-            }
-        }
+      } else {
+        this.dashoffset[0] = this.dataProps[i].p.v;
+      }
     }
+  }
 };
 extendPrototype([DynamicPropertyContainer], DashProperty);
-function GradientProperty(elem,data,container){
-    this.data = data;
-    this.c = createTypedArray('uint8c', data.p*4);
-    var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
-    this.o = createTypedArray('float32', cLength);
-    this._cmdf = false;
-    this._omdf = false;
-    this._collapsable = this.checkCollapsable();
-    this._hasOpacity = cLength;
-    this.initDynamicPropertyContainer(container);
-    this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
-    this.k = this.prop.k;
-    this.getValue(true);
+
+/* global createTypedArray, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+function GradientProperty(elem, data, container) {
+  this.data = data;
+  this.c = createTypedArray('uint8c', data.p * 4);
+  var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;
+  this.o = createTypedArray('float32', cLength);
+  this._cmdf = false;
+  this._omdf = false;
+  this._collapsable = this.checkCollapsable();
+  this._hasOpacity = cLength;
+  this.initDynamicPropertyContainer(container);
+  this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
+  this.k = this.prop.k;
+  this.getValue(true);
 }
 
-GradientProperty.prototype.comparePoints = function(values, points) {
-    var i = 0, len = this.o.length/2, diff;
-    while(i < len) {
-        diff = Math.abs(values[i*4] - values[points*4 + i*2]);
-        if(diff > 0.01){
-            return false;
-        }
-        i += 1;
+GradientProperty.prototype.comparePoints = function (values, points) {
+  var i = 0;
+  var len = this.o.length / 2;
+  var diff;
+  while (i < len) {
+    diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
+    if (diff > 0.01) {
+      return false;
     }
-    return true;
+    i += 1;
+  }
+  return true;
 };
 
-GradientProperty.prototype.checkCollapsable = function() {
-    if (this.o.length/2 !== this.c.length/4) {
+GradientProperty.prototype.checkCollapsable = function () {
+  if (this.o.length / 2 !== this.c.length / 4) {
+    return false;
+  }
+  if (this.data.k.k[0].s) {
+    var i = 0;
+    var len = this.data.k.k.length;
+    while (i < len) {
+      if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
         return false;
+      }
+      i += 1;
     }
-    if (this.data.k.k[0].s) {
-        var i = 0, len = this.data.k.k.length;
-        while (i < len) {
-            if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
-                return false;
-            }
-            i += 1;
-        }
-    } else if(!this.comparePoints(this.data.k.k, this.data.p)) {
-        return false;
-    }
-    return true;
+  } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
+    return false;
+  }
+  return true;
 };
 
-GradientProperty.prototype.getValue = function(forceRender){
-    this.prop.getValue();
-    this._mdf = false;
-    this._cmdf = false;
-    this._omdf = false;
-    if(this.prop._mdf || forceRender){
-        var i, len = this.data.p*4;
-        var mult, val;
-        for(i=0;i<len;i+=1){
-            mult = i%4 === 0 ? 100 : 255;
-            val = Math.round(this.prop.v[i]*mult);
-            if(this.c[i] !== val){
-                this.c[i] = val;
-                this._cmdf = !forceRender;
-            }
-        }
-        if(this.o.length){
-            len = this.prop.v.length;
-            for(i=this.data.p*4;i<len;i+=1){
-                mult = i%2 === 0 ? 100 : 1;
-                val = i%2 === 0 ?  Math.round(this.prop.v[i]*100):this.prop.v[i];
-                if(this.o[i-this.data.p*4] !== val){
-                    this.o[i-this.data.p*4] = val;
-                    this._omdf = !forceRender;
-                }
-            }
-        }
-        this._mdf = !forceRender;
+GradientProperty.prototype.getValue = function (forceRender) {
+  this.prop.getValue();
+  this._mdf = false;
+  this._cmdf = false;
+  this._omdf = false;
+  if (this.prop._mdf || forceRender) {
+    var i;
+    var len = this.data.p * 4;
+    var mult;
+    var val;
+    for (i = 0; i < len; i += 1) {
+      mult = i % 4 === 0 ? 100 : 255;
+      val = Math.round(this.prop.v[i] * mult);
+      if (this.c[i] !== val) {
+        this.c[i] = val;
+        this._cmdf = !forceRender;
+      }
     }
+    if (this.o.length) {
+      len = this.prop.v.length;
+      for (i = this.data.p * 4; i < len; i += 1) {
+        mult = i % 2 === 0 ? 100 : 1;
+        val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
+        if (this.o[i - this.data.p * 4] !== val) {
+          this.o[i - this.data.p * 4] = val;
+          this._omdf = !forceRender;
+        }
+      }
+    }
+    this._mdf = !forceRender;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], GradientProperty);
-var buildShapeString = function(pathNodes, length, closed, mat) {
-	if(length === 0) {
-            return '';
-        }
-        var _o = pathNodes.o;
-        var _i = pathNodes.i;
-        var _v = pathNodes.v;
-        var i, shapeString = " M" + mat.applyToPointStringified(_v[0][0], _v[0][1]);
-        for(i = 1; i < length; i += 1) {
-            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]);
-        }
-        if (closed && length) {
-            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]);
-            shapeString += 'z';
-        }
-        return shapeString;
-}
-var audioControllerFactory = (function() {
 
-	function AudioController(audioFactory) {
-		this.audios = [];
-		this.audioFactory = audioFactory;
-		this._volume = 1;
-		this._isMuted = false;
-	}
+/* exported buildShapeString */
 
-	AudioController.prototype = {
-		addAudio: function(audio) {
-			this.audios.push(audio);
-		},
-		pause: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].pause()
-			}
-		},
-		resume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].resume()
-			}
-		},
-		setRate: function(rateValue) {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].setRate(rateValue)
-			}
-		},
-		createAudio: function(assetPath) {
-			if (this.audioFactory) {
-				return this.audioFactory(assetPath);
-			} else if (Howl) {
-				return new Howl({
-					src: [assetPath]
-				})
-			} else {
-				return {
-					isPlaying: false,
-					play: function(){this.isPlaying = true},
-					seek: function(){this.isPlaying = false},
-					playing: function(){},
-					rate: function(){},
-					setVolume: function(){},
-				}
-			}
-		},
-		setAudioFactory: function(audioFactory) {
-			this.audioFactory = audioFactory;
-		},
-		setVolume: function(value) {
-			this._volume = value;
-			this._updateVolume();
-		},
-		mute: function() {
-			this._isMuted = true;
-			this._updateVolume();
-		},
-		unmute: function() {
-			this._isMuted = false;
-			this._updateVolume();
-		},
-		getVolume: function(value) {
-			return this._volume;
-		},
-		_updateVolume: function() {
-			var i, len = this.audios.length;
-			for(i = 0; i < len; i += 1) {
-				this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1))
-			}
-		}
-	}
-
-	return function() {
-		return new AudioController()
-	}
-
-}())
-var ImagePreloader = (function(){
-
-    var proxyImage = (function(){
-        var canvas = createTag('canvas');
-        canvas.width = 1;
-        canvas.height = 1;
-        var ctx = canvas.getContext('2d');
-        ctx.fillStyle = 'rgba(0,0,0,0)';
-        ctx.fillRect(0, 0, 1, 1);
-        return canvas;
-    }())
-
-    function imageLoaded(){
-        this.loadedAssets += 1;
-        if(this.loadedAssets === this.totalImages){
-            if(this.imagesLoadedCb) {
-                this.imagesLoadedCb(null);
-            }
-        }
-    }
-
-    function getAssetsPath(assetData, assetsPath, original_path) {
-        var path = '';
-        if (assetData.e) {
-            path = assetData.p;
-        } else if(assetsPath) {
-            var imagePath = assetData.p;
-            if (imagePath.indexOf('images/') !== -1) {
-                imagePath = imagePath.split('/')[1];
-            }
-            path = assetsPath + imagePath;
-        } else {
-            path = original_path;
-            path += assetData.u ? assetData.u : '';
-            path += assetData.p;
-        }
-        return path;
-    }
-
-    function testImageLoaded(img) {
-        var _count = 0;
-        var intervalId = setInterval(function() {
-            var box = img.getBBox();
-            if (box.width || _count > 500) {
-                this._imageLoaded();
-                clearInterval(intervalId);
-            }
-            _count += 1;
-        }.bind(this), 50)
-    }
-
-    function createImageData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createNS('image');
-        if (isSafari) {
-            this.testImageLoaded(img)
-        } else {
-            img.addEventListener('load', this._imageLoaded, false);
-        }
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.setAttributeNS('http://www.w3.org/1999/xlink','href', path);
-        this._elementHelper.append(img);
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function createImgData(assetData) {
-        var path = getAssetsPath(assetData, this.assetsPath, this.path);
-        var img = createTag('img');
-        img.crossOrigin = 'anonymous';
-        img.addEventListener('load', this._imageLoaded, false);
-        img.addEventListener('error', function() {
-            ob.img = proxyImage;
-            this._imageLoaded();
-        }.bind(this), false);
-        img.src = path;
-        var ob = {
-            img: img,
-            assetData: assetData
-        }
-        return ob;
-    }
-
-    function loadAssets(assets, cb){
-        this.imagesLoadedCb = cb;
-        var i, len = assets.length;
-        for (i = 0; i < len; i += 1) {
-            if(!assets[i].layers){
-                this.totalImages += 1;
-                this.images.push(this._createImageData(assets[i]));
-            }
-        }
-    }
-
-    function setPath(path){
-        this.path = path || '';
-    }
-
-    function setAssetsPath(path){
-        this.assetsPath = path || '';
-    }
-
-    function getImage(assetData) {
-        var i = 0, len = this.images.length;
-        while (i < len) {
-            if (this.images[i].assetData === assetData) {
-                return this.images[i].img;
-            }
-            i += 1;
-        }
-    }
-
-    function destroy() {
-        this.imagesLoadedCb = null;
-        this.images.length = 0;
-    }
-
-    function loaded() {
-        return this.totalImages === this.loadedAssets;
-    }
-
-    function setCacheType(type, elementHelper) {
-        if (type === 'svg') {
-            this._elementHelper = elementHelper;
-            this._createImageData = this.createImageData.bind(this);
-        } else {
-            this._createImageData = this.createImgData.bind(this);
-        }
-    }
-
-    function ImagePreloader(type){
-        this._imageLoaded = imageLoaded.bind(this);
-        this.testImageLoaded = testImageLoaded.bind(this);
-        this.assetsPath = '';
-        this.path = '';
-        this.totalImages = 0;
-        this.loadedAssets = 0;
-        this.imagesLoadedCb = null;
-        this.images = [];
-    };
-
-    ImagePreloader.prototype = {
-        loadAssets: loadAssets,
-        setAssetsPath: setAssetsPath,
-        setPath: setPath,
-        loaded: loaded,
-        destroy: destroy,
-        getImage: getImage,
-        createImgData: createImgData,
-        createImageData: createImageData,
-        imageLoaded: imageLoaded,
-        setCacheType: setCacheType,
-    }
-
-    return ImagePreloader;
-}());
-var featureSupport = (function(){
-	var ob = {
-		maskType: true
-	};
-	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)) {
-	   ob.maskType = false;
-	}
-	return ob;
-}());
-var filtersFactory = (function(){
-	var ob = {};
-	ob.createFilter = createFilter;
-	ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
-
-	function createFilter(filId){
-        	var fil = createNS('filter');
-        	fil.setAttribute('id',filId);
-                fil.setAttribute('filterUnits','objectBoundingBox');
-                fil.setAttribute('x','0%');
-                fil.setAttribute('y','0%');
-                fil.setAttribute('width','100%');
-                fil.setAttribute('height','100%');
-                return fil;
-	}
-
-	function createAlphaToLuminanceFilter(){
-                var feColorMatrix = createNS('feColorMatrix');
-                feColorMatrix.setAttribute('type','matrix');
-                feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-                feColorMatrix.setAttribute('values','0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
-                return feColorMatrix;
-	}
-
-	return ob;
-}());
-var assetLoader = (function(){
-
-	function formatResponse(xhr) {
-		if(xhr.response && typeof xhr.response === 'object') {
-			return xhr.response;
-		} else if(xhr.response && typeof xhr.response === 'string') {
-			return JSON.parse(xhr.response);
-		} else if(xhr.responseText) {
-			return JSON.parse(xhr.responseText);
-		}
-	}
-
-	function loadAsset(path, callback, errorCallback) {
-		var response;
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', path, true);
-		// set responseType after calling open or IE will break.
-		try {
-		    // This crashes on Android WebView prior to KitKat
-		    xhr.responseType = "json";
-		} catch (err) {}
-	    xhr.send();
-	    xhr.onreadystatechange = function () {
-	        if (xhr.readyState == 4) {
-	            if(xhr.status == 200){
-	            	response = formatResponse(xhr);
-	            	callback(response);
-	            }else{
-	                try{
-	            		response = formatResponse(xhr);
-	            		callback(response);
-	                }catch(err){
-	                	if(errorCallback) {
-	                		errorCallback(err);
-	                	}
-	                }
-	            }
-	        }
-	    };
-	}
-	return {
-		load: loadAsset
-	}
-}())
-
-function TextAnimatorProperty(textData, renderType, elem){
-    this._isFirstFrame = true;
-	this._hasMaskedPath = false;
-	this._frameId = -1;
-	this._textData = textData;
-	this._renderType = renderType;
-    this._elem = elem;
-	this._animatorsData = createSizedArray(this._textData.a.length);
-	this._pathData = {};
-	this._moreOptions = {
-		alignment: {}
-	};
-	this.renderedLetters = [];
-    this.lettersChangedFlag = false;
-    this.initDynamicPropertyContainer(elem);
-
-}
-
-TextAnimatorProperty.prototype.searchProperties = function(){
-    var i, len = this._textData.a.length, animatorProps;
-    var getProp = PropertyFactory.getProp;
-    for(i=0;i<len;i+=1){
-        animatorProps = this._textData.a[i];
-        this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
-    }
-    if(this._textData.p && 'm' in this._textData.p){
-        this._pathData = {
-            f: getProp(this._elem,this._textData.p.f,0,0,this),
-            l: getProp(this._elem,this._textData.p.l,0,0,this),
-            r: this._textData.p.r,
-            m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
-        };
-        this._hasMaskedPath = true;
-    } else {
-        this._hasMaskedPath = false;
-    }
-    this._moreOptions.alignment = getProp(this._elem,this._textData.m.a,1,0,this);
+var buildShapeString = function (pathNodes, length, closed, mat) {
+  if (length === 0) {
+    return '';
+  }
+  var _o = pathNodes.o;
+  var _i = pathNodes.i;
+  var _v = pathNodes.v;
+  var i;
+  var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
+  for (i = 1; i < length; i += 1) {
+    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]);
+  }
+  if (closed && length) {
+    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]);
+    shapeString += 'z';
+  }
+  return shapeString;
 };
 
-TextAnimatorProperty.prototype.getMeasures = function(documentData, lettersChangedFlag){
-    this.lettersChangedFlag = lettersChangedFlag;
-    if(!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
-        return;
+/* global Howl */
+/* exported audioControllerFactory */
+
+var audioControllerFactory = (function () {
+  function AudioController(audioFactory) {
+    this.audios = [];
+    this.audioFactory = audioFactory;
+    this._volume = 1;
+    this._isMuted = false;
+  }
+
+  AudioController.prototype = {
+    addAudio: function (audio) {
+      this.audios.push(audio);
+    },
+    pause: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].pause();
+      }
+    },
+    resume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].resume();
+      }
+    },
+    setRate: function (rateValue) {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].setRate(rateValue);
+      }
+    },
+    createAudio: function (assetPath) {
+      if (this.audioFactory) {
+        return this.audioFactory(assetPath);
+      } if (Howl) {
+        return new Howl({
+          src: [assetPath],
+        });
+      }
+      return {
+        isPlaying: false,
+        play: function () { this.isPlaying = true; },
+        seek: function () { this.isPlaying = false; },
+        playing: function () {},
+        rate: function () {},
+        setVolume: function () {},
+      };
+    },
+    setAudioFactory: function (audioFactory) {
+      this.audioFactory = audioFactory;
+    },
+    setVolume: function (value) {
+      this._volume = value;
+      this._updateVolume();
+    },
+    mute: function () {
+      this._isMuted = true;
+      this._updateVolume();
+    },
+    unmute: function () {
+      this._isMuted = false;
+      this._updateVolume();
+    },
+    getVolume: function () {
+      return this._volume;
+    },
+    _updateVolume: function () {
+      var i;
+      var len = this.audios.length;
+      for (i = 0; i < len; i += 1) {
+        this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
+      }
+    },
+  };
+
+  return function () {
+    return new AudioController();
+  };
+}());
+
+/* global createTag, createNS, isSafari */
+/* exported ImagePreloader */
+
+var ImagePreloader = (function () {
+  var proxyImage = (function () {
+    var canvas = createTag('canvas');
+    canvas.width = 1;
+    canvas.height = 1;
+    var ctx = canvas.getContext('2d');
+    ctx.fillStyle = 'rgba(0,0,0,0)';
+    ctx.fillRect(0, 0, 1, 1);
+    return canvas;
+  }());
+
+  function imageLoaded() {
+    this.loadedAssets += 1;
+    if (this.loadedAssets === this.totalImages) {
+      if (this.imagesLoadedCb) {
+        this.imagesLoadedCb(null);
+      }
     }
-    this._isFirstFrame = false;
-    var alignment = this._moreOptions.alignment.v;
-    var animators = this._animatorsData;
-    var textData = this._textData;
-    var matrixHelper = this.mHelper;
-    var renderType = this._renderType;
-    var renderedLettersCount = this.renderedLetters.length;
-    var data = this.data;
-    var xPos,yPos;
-    var i, len;
-    var letters = documentData.l, pathInfo, currentLength, currentPoint, segmentLength, flag, pointInd, segmentInd, prevPoint, points, segments, partialLength, totalLength, perc, tanAngle, mask;
-    if(this._hasMaskedPath) {
-        mask = this._pathData.m;
-        if(!this._pathData.n || this._pathData._mdf){
-            var paths = mask.v;
-            if(this._pathData.r){
-                paths = paths.reverse();
-            }
-            // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
-            pathInfo = {
-                tLength: 0,
-                segments: []
-            };
-            len = paths._length - 1;
-            var bezierData;
-            totalLength = 0;
-            for (i = 0; i < len; i += 1) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            i = len;
-            if (mask.v.c) {
-                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]]);
-                pathInfo.tLength += bezierData.segmentLength;
-                pathInfo.segments.push(bezierData);
-                totalLength += bezierData.segmentLength;
-            }
-            this._pathData.pi = pathInfo;
-        }
-        pathInfo = this._pathData.pi;
+  }
 
-        currentLength = this._pathData.f.v;
-        segmentInd = 0;
-        pointInd = 1;
-        segmentLength = 0;
-        flag = true;
-        segments = pathInfo.segments;
-        if (currentLength < 0 && mask.v.c) {
-            if (pathInfo.tLength < Math.abs(currentLength)) {
-                currentLength = -Math.abs(currentLength) % pathInfo.tLength;
-            }
-            segmentInd = segments.length - 1;
-            points = segments[segmentInd].points;
-            pointInd = points.length - 1;
-            while (currentLength < 0) {
-                currentLength += points[pointInd].partialLength;
-                pointInd -= 1;
-                if (pointInd < 0) {
-                    segmentInd -= 1;
-                    points = segments[segmentInd].points;
-                    pointInd = points.length - 1;
-                }
-            }
+  function getAssetsPath(assetData, assetsPath, originalPath) {
+    var path = '';
+    if (assetData.e) {
+      path = assetData.p;
+    } else if (assetsPath) {
+      var imagePath = assetData.p;
+      if (imagePath.indexOf('images/') !== -1) {
+        imagePath = imagePath.split('/')[1];
+      }
+      path = assetsPath + imagePath;
+    } else {
+      path = originalPath;
+      path += assetData.u ? assetData.u : '';
+      path += assetData.p;
+    }
+    return path;
+  }
 
+  function testImageLoaded(img) {
+    var _count = 0;
+    var intervalId = setInterval(function () {
+      var box = img.getBBox();
+      if (box.width || _count > 500) {
+        this._imageLoaded();
+        clearInterval(intervalId);
+      }
+      _count += 1;
+    }.bind(this), 50);
+  }
+
+  function createImageData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createNS('image');
+    if (isSafari) {
+      this.testImageLoaded(img);
+    } else {
+      img.addEventListener('load', this._imageLoaded, false);
+    }
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
+    this._elementHelper.append(img);
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function createImgData(assetData) {
+    var path = getAssetsPath(assetData, this.assetsPath, this.path);
+    var img = createTag('img');
+    img.crossOrigin = 'anonymous';
+    img.addEventListener('load', this._imageLoaded, false);
+    img.addEventListener('error', function () {
+      ob.img = proxyImage;
+      this._imageLoaded();
+    }.bind(this), false);
+    img.src = path;
+    var ob = {
+      img: img,
+      assetData: assetData,
+    };
+    return ob;
+  }
+
+  function loadAssets(assets, cb) {
+    this.imagesLoadedCb = cb;
+    var i;
+    var len = assets.length;
+    for (i = 0; i < len; i += 1) {
+      if (!assets[i].layers) {
+        this.totalImages += 1;
+        this.images.push(this._createImageData(assets[i]));
+      }
+    }
+  }
+
+  function setPath(path) {
+    this.path = path || '';
+  }
+
+  function setAssetsPath(path) {
+    this.assetsPath = path || '';
+  }
+
+  function getImage(assetData) {
+    var i = 0;
+    var len = this.images.length;
+    while (i < len) {
+      if (this.images[i].assetData === assetData) {
+        return this.images[i].img;
+      }
+      i += 1;
+    }
+    return null;
+  }
+
+  function destroy() {
+    this.imagesLoadedCb = null;
+    this.images.length = 0;
+  }
+
+  function loaded() {
+    return this.totalImages === this.loadedAssets;
+  }
+
+  function setCacheType(type, elementHelper) {
+    if (type === 'svg') {
+      this._elementHelper = elementHelper;
+      this._createImageData = this.createImageData.bind(this);
+    } else {
+      this._createImageData = this.createImgData.bind(this);
+    }
+  }
+
+  function ImagePreloaderFactory() {
+    this._imageLoaded = imageLoaded.bind(this);
+    this.testImageLoaded = testImageLoaded.bind(this);
+    this.assetsPath = '';
+    this.path = '';
+    this.totalImages = 0;
+    this.loadedAssets = 0;
+    this.imagesLoadedCb = null;
+    this.images = [];
+  }
+
+  ImagePreloaderFactory.prototype = {
+    loadAssets: loadAssets,
+    setAssetsPath: setAssetsPath,
+    setPath: setPath,
+    loaded: loaded,
+    destroy: destroy,
+    getImage: getImage,
+    createImgData: createImgData,
+    createImageData: createImageData,
+    imageLoaded: imageLoaded,
+    setCacheType: setCacheType,
+  };
+
+  return ImagePreloaderFactory;
+}());
+
+/* exported featureSupport */
+
+var featureSupport = (function () {
+  var ob = {
+    maskType: true,
+  };
+  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)) {
+    ob.maskType = false;
+  }
+  return ob;
+}());
+
+/* global createNS */
+/* exported filtersFactory */
+
+var filtersFactory = (function () {
+  var ob = {};
+  ob.createFilter = createFilter;
+  ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
+
+  function createFilter(filId) {
+    var fil = createNS('filter');
+    fil.setAttribute('id', filId);
+    fil.setAttribute('filterUnits', 'objectBoundingBox');
+    fil.setAttribute('x', '0%');
+    fil.setAttribute('y', '0%');
+    fil.setAttribute('width', '100%');
+    fil.setAttribute('height', '100%');
+    return fil;
+  }
+
+  function createAlphaToLuminanceFilter() {
+    var feColorMatrix = createNS('feColorMatrix');
+    feColorMatrix.setAttribute('type', 'matrix');
+    feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+    feColorMatrix.setAttribute('values', '0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1');
+    return feColorMatrix;
+  }
+
+  return ob;
+}());
+
+/* exported assetLoader */
+
+var assetLoader = (function () {
+  function formatResponse(xhr) {
+    if (xhr.response && typeof xhr.response === 'object') {
+      return xhr.response;
+    } if (xhr.response && typeof xhr.response === 'string') {
+      return JSON.parse(xhr.response);
+    } if (xhr.responseText) {
+      return JSON.parse(xhr.responseText);
+    }
+    return null;
+  }
+
+  function loadAsset(path, callback, errorCallback) {
+    var response;
+    var xhr = new XMLHttpRequest();
+    xhr.open('GET', path, true);
+    // set responseType after calling open or IE will break.
+    try {
+      // This crashes on Android WebView prior to KitKat
+      xhr.responseType = 'json';
+    } catch (err) {} // eslint-disable-line no-empty
+    xhr.send();
+    xhr.onreadystatechange = function () {
+      if (xhr.readyState === 4) {
+        if (xhr.status === 200) {
+          response = formatResponse(xhr);
+          callback(response);
+        } else {
+          try {
+            response = formatResponse(xhr);
+            callback(response);
+          } catch (err) {
+            if (errorCallback) {
+              errorCallback(err);
+            }
+          }
         }
+      }
+    };
+  }
+  return {
+    load: loadAsset,
+  };
+}());
+
+/* global createSizedArray, PropertyFactory, TextAnimatorDataProperty, bez, addHueToRGB,
+  addSaturationToRGB, addBrightnessToRGB, LetterProps, Matrix, extendPrototype, DynamicPropertyContainer */
+
+function TextAnimatorProperty(textData, renderType, elem) {
+  this._isFirstFrame = true;
+  this._hasMaskedPath = false;
+  this._frameId = -1;
+  this._textData = textData;
+  this._renderType = renderType;
+  this._elem = elem;
+  this._animatorsData = createSizedArray(this._textData.a.length);
+  this._pathData = {};
+  this._moreOptions = {
+    alignment: {},
+  };
+  this.renderedLetters = [];
+  this.lettersChangedFlag = false;
+  this.initDynamicPropertyContainer(elem);
+}
+
+TextAnimatorProperty.prototype.searchProperties = function () {
+  var i;
+  var len = this._textData.a.length;
+  var animatorProps;
+  var getProp = PropertyFactory.getProp;
+  for (i = 0; i < len; i += 1) {
+    animatorProps = this._textData.a[i];
+    this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
+  }
+  if (this._textData.p && 'm' in this._textData.p) {
+    this._pathData = {
+      f: getProp(this._elem, this._textData.p.f, 0, 0, this),
+      l: getProp(this._elem, this._textData.p.l, 0, 0, this),
+      r: this._textData.p.r,
+      m: this._elem.maskManager.getMaskProperty(this._textData.p.m),
+    };
+    this._hasMaskedPath = true;
+  } else {
+    this._hasMaskedPath = false;
+  }
+  this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
+};
+
+TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
+  this.lettersChangedFlag = lettersChangedFlag;
+  if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
+    return;
+  }
+  this._isFirstFrame = false;
+  var alignment = this._moreOptions.alignment.v;
+  var animators = this._animatorsData;
+  var textData = this._textData;
+  var matrixHelper = this.mHelper;
+  var renderType = this._renderType;
+  var renderedLettersCount = this.renderedLetters.length;
+  var xPos;
+  var yPos;
+  var i;
+  var len;
+  var letters = documentData.l;
+  var pathInfo;
+  var currentLength;
+  var currentPoint;
+  var segmentLength;
+  var flag;
+  var pointInd;
+  var segmentInd;
+  var prevPoint;
+  var points;
+  var segments;
+  var partialLength;
+  var totalLength;
+  var perc;
+  var tanAngle;
+  var mask;
+  if (this._hasMaskedPath) {
+    mask = this._pathData.m;
+    if (!this._pathData.n || this._pathData._mdf) {
+      var paths = mask.v;
+      if (this._pathData.r) {
+        paths = paths.reverse();
+      }
+      // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
+      pathInfo = {
+        tLength: 0,
+        segments: [],
+      };
+      len = paths._length - 1;
+      var bezierData;
+      totalLength = 0;
+      for (i = 0; i < len; i += 1) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      i = len;
+      if (mask.v.c) {
+        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]]);
+        pathInfo.tLength += bezierData.segmentLength;
+        pathInfo.segments.push(bezierData);
+        totalLength += bezierData.segmentLength;
+      }
+      this._pathData.pi = pathInfo;
+    }
+    pathInfo = this._pathData.pi;
+
+    currentLength = this._pathData.f.v;
+    segmentInd = 0;
+    pointInd = 1;
+    segmentLength = 0;
+    flag = true;
+    segments = pathInfo.segments;
+    if (currentLength < 0 && mask.v.c) {
+      if (pathInfo.tLength < Math.abs(currentLength)) {
+        currentLength = -Math.abs(currentLength) % pathInfo.tLength;
+      }
+      segmentInd = segments.length - 1;
+      points = segments[segmentInd].points;
+      pointInd = points.length - 1;
+      while (currentLength < 0) {
+        currentLength += points[pointInd].partialLength;
+        pointInd -= 1;
+        if (pointInd < 0) {
+          segmentInd -= 1;
+          points = segments[segmentInd].points;
+          pointInd = points.length - 1;
+        }
+      }
+    }
+    points = segments[segmentInd].points;
+    prevPoint = points[pointInd - 1];
+    currentPoint = points[pointInd];
+    partialLength = currentPoint.partialLength;
+  }
+
+  len = letters.length;
+  xPos = 0;
+  yPos = 0;
+  var yOff = documentData.finalSize * 1.2 * 0.714;
+  var firstLine = true;
+  var animatorProps;
+  var animatorSelector;
+  var j;
+  var jLen;
+  var letterValue;
+
+  jLen = animators.length;
+
+  var mult;
+  var ind = -1;
+  var offf;
+  var xPathPos;
+  var yPathPos;
+  var initPathPos = currentLength;
+  var initSegmentInd = segmentInd;
+  var initPointInd = pointInd;
+  var currentLine = -1;
+  var elemOpacity;
+  var sc;
+  var sw;
+  var fc;
+  var k;
+  var letterSw;
+  var letterSc;
+  var letterFc;
+  var letterM = '';
+  var letterP = this.defaultPropsArray;
+  var letterO;
+
+  //
+  if (documentData.j === 2 || documentData.j === 1) {
+    var animatorJustifyOffset = 0;
+    var animatorFirstCharOffset = 0;
+    var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
+    var lastIndex = 0;
+    var isNewLine = true;
+
+    for (i = 0; i < len; i += 1) {
+      if (letters[i].n) {
+        if (animatorJustifyOffset) {
+          animatorJustifyOffset += animatorFirstCharOffset;
+        }
+        while (lastIndex < i) {
+          letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+          lastIndex += 1;
+        }
+        animatorJustifyOffset = 0;
+        isNewLine = true;
+      } else {
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.t.propType) {
+            if (isNewLine && documentData.j === 2) {
+              animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
+            }
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
+            } else {
+              animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
+            }
+          }
+        }
+        isNewLine = false;
+      }
+    }
+    if (animatorJustifyOffset) {
+      animatorJustifyOffset += animatorFirstCharOffset;
+    }
+    while (lastIndex < i) {
+      letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
+      lastIndex += 1;
+    }
+  }
+  //
+
+  for (i = 0; i < len; i += 1) {
+    matrixHelper.reset();
+    elemOpacity = 1;
+    if (letters[i].n) {
+      xPos = 0;
+      yPos += documentData.yOffset;
+      yPos += firstLine ? 1 : 0;
+      currentLength = initPathPos;
+      firstLine = false;
+      if (this._hasMaskedPath) {
+        segmentInd = initSegmentInd;
+        pointInd = initPointInd;
         points = segments[segmentInd].points;
         prevPoint = points[pointInd - 1];
         currentPoint = points[pointInd];
         partialLength = currentPoint.partialLength;
-    }
-
-
-    len = letters.length;
-    xPos = 0;
-    yPos = 0;
-    var yOff = documentData.finalSize * 1.2 * 0.714;
-    var firstLine = true;
-    var animatorProps, animatorSelector;
-    var j, jLen;
-    var letterValue;
-
-    jLen = animators.length;
-    var lastLetter;
-
-    var mult, ind = -1, offf, xPathPos, yPathPos;
-    var initPathPos = currentLength,initSegmentInd = segmentInd, initPointInd = pointInd, currentLine = -1;
-    var elemOpacity;
-    var sc,sw,fc,k;
-    var lineLength = 0;
-    var letterSw, letterSc, letterFc, letterM = '', letterP = this.defaultPropsArray, letterO;
-
-    //
-    if(documentData.j === 2 || documentData.j === 1) {
-        var animatorJustifyOffset = 0;
-        var animatorFirstCharOffset = 0;
-        var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
-        var lastIndex = 0;
-        var isNewLine = true;
-
-        for (i = 0; i < len; i += 1) {
-            if (letters[i].n) {
-                if(animatorJustifyOffset) {
-                    animatorJustifyOffset += animatorFirstCharOffset;
-                }
-                while (lastIndex < i) {
-                    letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-                    lastIndex += 1;
-                }
-                animatorJustifyOffset = 0;
-                isNewLine = true;
+        segmentLength = 0;
+      }
+      letterM = '';
+      letterFc = '';
+      letterSw = '';
+      letterO = '';
+      letterP = this.defaultPropsArray;
+    } else {
+      if (this._hasMaskedPath) {
+        if (currentLine !== letters[i].line) {
+          switch (documentData.j) {
+            case 1:
+              currentLength += totalLength - documentData.lineWidths[letters[i].line];
+              break;
+            case 2:
+              currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
+              break;
+            default:
+              break;
+          }
+          currentLine = letters[i].line;
+        }
+        if (ind !== letters[i].ind) {
+          if (letters[ind]) {
+            currentLength += letters[ind].extra;
+          }
+          currentLength += letters[i].an / 2;
+          ind = letters[i].ind;
+        }
+        currentLength += (alignment[0] * letters[i].an) * 0.005;
+        var animatorOffset = 0;
+        for (j = 0; j < jLen; j += 1) {
+          animatorProps = animators[j].a;
+          if (animatorProps.p.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.p.v[0] * mult[0];
             } else {
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.t.propType) {
-                        if (isNewLine && documentData.j === 2) {
-                            animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
-                        }
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
-                        if (mult.length) {
-                            animatorJustifyOffset += animatorProps.t.v*mult[0] * justifyOffsetMult;
-                        } else {
-                            animatorJustifyOffset += animatorProps.t.v*mult * justifyOffsetMult;
-                        }
-                    }
-                }
-                isNewLine = false;
+              animatorOffset += animatorProps.p.v[0] * mult;
             }
+          }
+          if (animatorProps.a.propType) {
+            animatorSelector = animators[j].s;
+            mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+            if (mult.length) {
+              animatorOffset += animatorProps.a.v[0] * mult[0];
+            } else {
+              animatorOffset += animatorProps.a.v[0] * mult;
+            }
+          }
         }
-        if(animatorJustifyOffset) {
-            animatorJustifyOffset += animatorFirstCharOffset;
-        }
-        while(lastIndex < i) {
-            letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
-            lastIndex += 1;
-        }
-    }
-    //
-
-    for( i = 0; i < len; i += 1) {
-
-        matrixHelper.reset();
-        elemOpacity = 1;
-        if(letters[i].n) {
-            xPos = 0;
-            yPos += documentData.yOffset;
-            yPos += firstLine ? 1 : 0;
-            currentLength = initPathPos ;
-            firstLine = false;
-            lineLength = 0;
-            if(this._hasMaskedPath) {
-                segmentInd = initSegmentInd;
-                pointInd = initPointInd;
+        flag = true;
+        while (flag) {
+          if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
+            perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
+            xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
+            yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
+            matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, -(alignment[1] * yOff) * 0.01);
+            flag = false;
+          } else if (points) {
+            segmentLength += currentPoint.partialLength;
+            pointInd += 1;
+            if (pointInd >= points.length) {
+              pointInd = 0;
+              segmentInd += 1;
+              if (!segments[segmentInd]) {
+                if (mask.v.c) {
+                  pointInd = 0;
+                  segmentInd = 0;
+                  points = segments[segmentInd].points;
+                } else {
+                  segmentLength -= currentPoint.partialLength;
+                  points = null;
+                }
+              } else {
                 points = segments[segmentInd].points;
-                prevPoint = points[pointInd - 1];
-                currentPoint = points[pointInd];
-                partialLength = currentPoint.partialLength;
-                segmentLength = 0;
+              }
             }
-            letterO = letterSw = letterFc = letterM = '';
-            letterP = this.defaultPropsArray;
-        }else{
-            if(this._hasMaskedPath) {
-                if(currentLine !== letters[i].line){
-                    switch(documentData.j){
-                        case 1:
-                            currentLength += totalLength - documentData.lineWidths[letters[i].line];
-                            break;
-                        case 2:
-                            currentLength += (totalLength - documentData.lineWidths[letters[i].line])/2;
-                            break;
-                    }
-                    currentLine = letters[i].line;
-                }
-                if (ind !== letters[i].ind) {
-                    if (letters[ind]) {
-                        currentLength += letters[ind].extra;
-                    }
-                    currentLength += letters[i].an / 2;
-                    ind = letters[i].ind;
-                }
-                currentLength += alignment[0] * letters[i].an / 200;
-                var animatorOffset = 0;
-                for (j = 0; j < jLen; j += 1) {
-                    animatorProps = animators[j].a;
-                    if (animatorProps.p.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.p.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.p.v[0] * mult;
-                        }
+            if (points) {
+              prevPoint = currentPoint;
+              currentPoint = points[pointInd];
+              partialLength = currentPoint.partialLength;
+            }
+          }
+        }
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
+      } else {
+        offf = letters[i].an / 2 - letters[i].add;
+        matrixHelper.translate(-offf, 0, 0);
 
-                    }
-                    if (animatorProps.a.propType) {
-                        animatorSelector = animators[j].s;
-                        mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                        if(mult.length){
-                            animatorOffset += animatorProps.a.v[0] * mult[0];
-                        } else{
-                            animatorOffset += animatorProps.a.v[0] * mult;
-                        }
+        // Grouping alignment
+        matrixHelper.translate((-alignment[0] * letters[i].an) * 0.005, (-alignment[1] * yOff) * 0.01, 0);
+      }
 
-                    }
-                }
-                flag = true;
-                while (flag) {
-                    if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
-                        perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
-                        xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
-                        yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
-                        matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100));
-                        flag = false;
-                    } else if (points) {
-                        segmentLength += currentPoint.partialLength;
-                        pointInd += 1;
-                        if (pointInd >= points.length) {
-                            pointInd = 0;
-                            segmentInd += 1;
-                            if (!segments[segmentInd]) {
-                                if (mask.v.c) {
-                                    pointInd = 0;
-                                    segmentInd = 0;
-                                    points = segments[segmentInd].points;
-                                } else {
-                                    segmentLength -= currentPoint.partialLength;
-                                    points = null;
-                                }
-                            } else {
-                                points = segments[segmentInd].points;
-                            }
-                        }
-                        if (points) {
-                            prevPoint = currentPoint;
-                            currentPoint = points[pointInd];
-                            partialLength = currentPoint.partialLength;
-                        }
-                    }
-                }
-                offf = letters[i].an / 2 - letters[i].add;
-                matrixHelper.translate(-offf, 0, 0);
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.t.propType) {
+          animatorSelector = animators[j].s;
+          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"
+          if (xPos !== 0 || documentData.j !== 0) {
+            if (this._hasMaskedPath) {
+              if (mult.length) {
+                currentLength += animatorProps.t.v * mult[0];
+              } else {
+                currentLength += animatorProps.t.v * mult;
+              }
+            } else if (mult.length) {
+              xPos += animatorProps.t.v * mult[0];
             } else {
-                offf = letters[i].an/2 - letters[i].add;
-                matrixHelper.translate(-offf,0,0);
-
-                // Grouping alignment
-                matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0);
+              xPos += animatorProps.t.v * mult;
             }
-
-            lineLength += letters[i].l/2;
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.t.propType) {
-                    animatorSelector = animators[j].s;
-                    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"
-                    if(xPos !== 0 || documentData.j !== 0) {
-                        if(this._hasMaskedPath) {
-                            if(mult.length) {
-                                currentLength += animatorProps.t.v*mult[0];
-                            } else {
-                                currentLength += animatorProps.t.v*mult;
-                            }
-                        }else{
-                            if(mult.length) {
-                                xPos += animatorProps.t.v*mult[0];
-                            } else {
-                                xPos += animatorProps.t.v*mult;
-                            }
-                        }
-                    }
-                }
-            }
-            lineLength += letters[i].l/2;
-            if(documentData.strokeWidthAnim) {
-                sw = documentData.sw || 0;
-            }
-            if(documentData.strokeColorAnim) {
-                if(documentData.sc){
-                    sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
-                }else{
-                    sc = [0,0,0];
-                }
-            }
-            if(documentData.fillColorAnim && documentData.fc) {
-                fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.a.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-
-                    if(mult.length){
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult[0], -animatorProps.a.v[1]*mult[1], animatorProps.a.v[2]*mult[2]);
-                    } else {
-                        matrixHelper.translate(-animatorProps.a.v[0]*mult, -animatorProps.a.v[1]*mult, animatorProps.a.v[2]*mult);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-                if (animatorProps.s.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(mult.length){
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult[0]),1+((animatorProps.s.v[1]-1)*mult[1]),1);
-                    } else {
-                        matrixHelper.scale(1+((animatorProps.s.v[0]-1)*mult),1+((animatorProps.s.v[1]-1)*mult),1);
-                    }
-                }
-            }
-            for(j=0;j<jLen;j+=1) {
-                animatorProps = animators[j].a;
-                animatorSelector = animators[j].s;
-                mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                if (animatorProps.sk.propType) {
-                    if(mult.length) {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
-                    } else {
-                        matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
-                    }
-                }
-                if (animatorProps.r.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
-                    } else {
-                        matrixHelper.rotateZ(-animatorProps.r.v * mult);
-                    }
-                }
-                if (animatorProps.ry.propType) {
-
-                    if(mult.length) {
-                        matrixHelper.rotateY(animatorProps.ry.v*mult[1]);
-                    }else{
-                        matrixHelper.rotateY(animatorProps.ry.v*mult);
-                    }
-                }
-                if (animatorProps.rx.propType) {
-                    if(mult.length) {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult[0]);
-                    } else {
-                        matrixHelper.rotateX(animatorProps.rx.v*mult);
-                    }
-                }
-                if (animatorProps.o.propType) {
-                    if(mult.length) {
-                        elemOpacity += ((animatorProps.o.v)*mult[0] - elemOpacity)*mult[0];
-                    } else {
-                        elemOpacity += ((animatorProps.o.v)*mult - elemOpacity)*mult;
-                    }
-                }
-                if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
-                    if(mult.length) {
-                        sw += animatorProps.sw.v*mult[0];
-                    } else {
-                        sw += animatorProps.sw.v*mult;
-                    }
-                }
-                if (documentData.strokeColorAnim && animatorProps.sc.propType) {
-                    for(k=0;k<3;k+=1){
-                        if(mult.length) {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult[0];
-                        } else {
-                            sc[k] = sc[k] + (animatorProps.sc.v[k] - sc[k])*mult;
-                        }
-                    }
-                }
-                if (documentData.fillColorAnim && documentData.fc) {
-                    if(animatorProps.fc.propType){
-                        for(k=0;k<3;k+=1){
-                            if(mult.length) {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult[0];
-                            } else {
-                                fc[k] = fc[k] + (animatorProps.fc.v[k] - fc[k])*mult;
-                            }
-                        }
-                    }
-                    if(animatorProps.fh.propType){
-                        if(mult.length) {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult[0]);
-                        } else {
-                            fc = addHueToRGB(fc,animatorProps.fh.v*mult);
-                        }
-                    }
-                    if(animatorProps.fs.propType){
-                        if(mult.length) {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult[0]);
-                        } else {
-                            fc = addSaturationToRGB(fc,animatorProps.fs.v*mult);
-                        }
-                    }
-                    if(animatorProps.fb.propType){
-                        if(mult.length) {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult[0]);
-                        } else {
-                            fc = addBrightnessToRGB(fc,animatorProps.fb.v*mult);
-                        }
-                    }
-                }
-            }
-
-            for(j=0;j<jLen;j+=1){
-                animatorProps = animators[j].a;
-
-                if (animatorProps.p.propType) {
-                    animatorSelector = animators[j].s;
-                    mult = animatorSelector.getMult(letters[i].anIndexes[j],textData.a[j].s.totalChars);
-                    if(this._hasMaskedPath) {
-                        if(mult.length) {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
-                        } else {
-                            matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        }
-                    }else{
-                        if(mult.length) {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
-                        } else {
-                            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
-                        
-                        }
-                    }
-                }
-            }
-            if(documentData.strokeWidthAnim){
-                letterSw = sw < 0 ? 0 : sw;
-            }
-            if(documentData.strokeColorAnim){
-                letterSc = 'rgb('+Math.round(sc[0]*255)+','+Math.round(sc[1]*255)+','+Math.round(sc[2]*255)+')';
-            }
-            if(documentData.fillColorAnim && documentData.fc){
-                letterFc = 'rgb('+Math.round(fc[0]*255)+','+Math.round(fc[1]*255)+','+Math.round(fc[2]*255)+')';
-            }
-
-            if(this._hasMaskedPath) {
-                matrixHelper.translate(0,-documentData.ls);
-
-                matrixHelper.translate(0, alignment[1]*yOff/100 + yPos,0);
-                if (textData.p.p) {
-                    tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
-                    var rot = Math.atan(tanAngle) * 180 / Math.PI;
-                    if (currentPoint.point[0] < prevPoint.point[0]) {
-                        rot += 180;
-                    }
-                    matrixHelper.rotate(-rot * Math.PI / 180);
-                }
-                matrixHelper.translate(xPathPos, yPathPos, 0);
-                currentLength -= alignment[0]*letters[i].an/200;
-                if(letters[i+1] && ind !== letters[i+1].ind){
-                    currentLength += letters[i].an / 2;
-                    currentLength += documentData.tr/1000*documentData.finalSize;
-                }
-            }else{
-
-                matrixHelper.translate(xPos,yPos,0);
-
-                if(documentData.ps){
-                    //matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
-                    matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-                }
-                switch(documentData.j){
-                    case 1:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]),0,0);
-                        break;
-                    case 2:
-                        matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line])/2,0,0);
-                        break;
-                }
-                matrixHelper.translate(0,-documentData.ls);
-                matrixHelper.translate(offf,0,0);
-                matrixHelper.translate(alignment[0]*letters[i].an/200,alignment[1]*yOff/100,0);
-                xPos += letters[i].l + documentData.tr/1000*documentData.finalSize;
-            }
-            if(renderType === 'html'){
-                letterM = matrixHelper.toCSS();
-            }else if(renderType === 'svg'){
-                letterM = matrixHelper.to2dCSS();
-            }else{
-                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]];
-            }
-            letterO = elemOpacity;
+          }
         }
-
-        if(renderedLettersCount <= i) {
-            letterValue = new LetterProps(letterO,letterSw,letterSc,letterFc,letterM,letterP);
-            this.renderedLetters.push(letterValue);
-            renderedLettersCount += 1;
-            this.lettersChangedFlag = true;
+      }
+      if (documentData.strokeWidthAnim) {
+        sw = documentData.sw || 0;
+      }
+      if (documentData.strokeColorAnim) {
+        if (documentData.sc) {
+          sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
         } else {
-            letterValue = this.renderedLetters[i];
-            this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+          sc = [0, 0, 0];
         }
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.a.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+
+          if (mult.length) {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        if (animatorProps.s.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (mult.length) {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult[0]), 1 + ((animatorProps.s.v[1] - 1) * mult[1]), 1);
+          } else {
+            matrixHelper.scale(1 + ((animatorProps.s.v[0] - 1) * mult), 1 + ((animatorProps.s.v[1] - 1) * mult), 1);
+          }
+        }
+      }
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+        animatorSelector = animators[j].s;
+        mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+        if (animatorProps.sk.propType) {
+          if (mult.length) {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
+          } else {
+            matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
+          }
+        }
+        if (animatorProps.r.propType) {
+          if (mult.length) {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
+          } else {
+            matrixHelper.rotateZ(-animatorProps.r.v * mult);
+          }
+        }
+        if (animatorProps.ry.propType) {
+          if (mult.length) {
+            matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
+          } else {
+            matrixHelper.rotateY(animatorProps.ry.v * mult);
+          }
+        }
+        if (animatorProps.rx.propType) {
+          if (mult.length) {
+            matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
+          } else {
+            matrixHelper.rotateX(animatorProps.rx.v * mult);
+          }
+        }
+        if (animatorProps.o.propType) {
+          if (mult.length) {
+            elemOpacity += ((animatorProps.o.v) * mult[0] - elemOpacity) * mult[0];
+          } else {
+            elemOpacity += ((animatorProps.o.v) * mult - elemOpacity) * mult;
+          }
+        }
+        if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
+          if (mult.length) {
+            sw += animatorProps.sw.v * mult[0];
+          } else {
+            sw += animatorProps.sw.v * mult;
+          }
+        }
+        if (documentData.strokeColorAnim && animatorProps.sc.propType) {
+          for (k = 0; k < 3; k += 1) {
+            if (mult.length) {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
+            } else {
+              sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
+            }
+          }
+        }
+        if (documentData.fillColorAnim && documentData.fc) {
+          if (animatorProps.fc.propType) {
+            for (k = 0; k < 3; k += 1) {
+              if (mult.length) {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
+              } else {
+                fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
+              }
+            }
+          }
+          if (animatorProps.fh.propType) {
+            if (mult.length) {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
+            } else {
+              fc = addHueToRGB(fc, animatorProps.fh.v * mult);
+            }
+          }
+          if (animatorProps.fs.propType) {
+            if (mult.length) {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
+            } else {
+              fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
+            }
+          }
+          if (animatorProps.fb.propType) {
+            if (mult.length) {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
+            } else {
+              fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
+            }
+          }
+        }
+      }
+
+      for (j = 0; j < jLen; j += 1) {
+        animatorProps = animators[j].a;
+
+        if (animatorProps.p.propType) {
+          animatorSelector = animators[j].s;
+          mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
+          if (this._hasMaskedPath) {
+            if (mult.length) {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
+            } else {
+              matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+            }
+          } else if (mult.length) {
+            matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
+          } else {
+            matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
+          }
+        }
+      }
+      if (documentData.strokeWidthAnim) {
+        letterSw = sw < 0 ? 0 : sw;
+      }
+      if (documentData.strokeColorAnim) {
+        letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
+      }
+      if (documentData.fillColorAnim && documentData.fc) {
+        letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
+      }
+
+      if (this._hasMaskedPath) {
+        matrixHelper.translate(0, -documentData.ls);
+
+        matrixHelper.translate(0, (alignment[1] * yOff) * 0.01 + yPos, 0);
+        if (textData.p.p) {
+          tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
+          var rot = (Math.atan(tanAngle) * 180) / Math.PI;
+          if (currentPoint.point[0] < prevPoint.point[0]) {
+            rot += 180;
+          }
+          matrixHelper.rotate((-rot * Math.PI) / 180);
+        }
+        matrixHelper.translate(xPathPos, yPathPos, 0);
+        currentLength -= (alignment[0] * letters[i].an) * 0.005;
+        if (letters[i + 1] && ind !== letters[i + 1].ind) {
+          currentLength += letters[i].an / 2;
+          currentLength += (documentData.tr * 0.001) * documentData.finalSize;
+        }
+      } else {
+        matrixHelper.translate(xPos, yPos, 0);
+
+        if (documentData.ps) {
+          // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
+          matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+        }
+        switch (documentData.j) {
+          case 1:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
+            break;
+          case 2:
+            matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
+            break;
+          default:
+            break;
+        }
+        matrixHelper.translate(0, -documentData.ls);
+        matrixHelper.translate(offf, 0, 0);
+        matrixHelper.translate((alignment[0] * letters[i].an) * 0.005, (alignment[1] * yOff) * 0.01, 0);
+        xPos += letters[i].l + (documentData.tr * 0.001) * documentData.finalSize;
+      }
+      if (renderType === 'html') {
+        letterM = matrixHelper.toCSS();
+      } else if (renderType === 'svg') {
+        letterM = matrixHelper.to2dCSS();
+      } else {
+        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]];
+      }
+      letterO = elemOpacity;
     }
+
+    if (renderedLettersCount <= i) {
+      letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
+      this.renderedLetters.push(letterValue);
+      renderedLettersCount += 1;
+      this.lettersChangedFlag = true;
+    } else {
+      letterValue = this.renderedLetters[i];
+      this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
+    }
+  }
 };
 
-TextAnimatorProperty.prototype.getValue = function(){
-	if(this._elem.globalData.frameId === this._frameId){
-        return;
-    }
-    this._frameId = this._elem.globalData.frameId;
-    this.iterateDynamicProperties();
+TextAnimatorProperty.prototype.getValue = function () {
+  if (this._elem.globalData.frameId === this._frameId) {
+    return;
+  }
+  this._frameId = this._elem.globalData.frameId;
+  this.iterateDynamicProperties();
 };
 
 TextAnimatorProperty.prototype.mHelper = new Matrix();
 TextAnimatorProperty.prototype.defaultPropsArray = [];
 extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
+
+/* global PropertyFactory, degToRads, TextSelectorProp */
+/* exported TextAnimatorDataProperty */
+
 function TextAnimatorDataProperty(elem, animatorProps, container) {
-	var defaultData = {propType:false};
-	var getProp = PropertyFactory.getProp;
-	var textAnimator_animatables = animatorProps.a;
-	this.a = {
-		r: textAnimator_animatables.r ? getProp(elem, textAnimator_animatables.r, 0, degToRads, container) : defaultData,
-		rx: textAnimator_animatables.rx ? getProp(elem, textAnimator_animatables.rx, 0, degToRads, container) : defaultData,
-		ry: textAnimator_animatables.ry ? getProp(elem, textAnimator_animatables.ry, 0, degToRads, container) : defaultData,
-		sk: textAnimator_animatables.sk ? getProp(elem, textAnimator_animatables.sk, 0, degToRads, container) : defaultData,
-		sa: textAnimator_animatables.sa ? getProp(elem, textAnimator_animatables.sa, 0, degToRads, container) : defaultData,
-		s: textAnimator_animatables.s ? getProp(elem, textAnimator_animatables.s, 1, 0.01, container) : defaultData,
-		a: textAnimator_animatables.a ? getProp(elem, textAnimator_animatables.a, 1, 0, container) : defaultData,
-		o: textAnimator_animatables.o ? getProp(elem, textAnimator_animatables.o, 0, 0.01, container) : defaultData,
-		p: textAnimator_animatables.p ? getProp(elem,textAnimator_animatables.p, 1, 0, container) : defaultData,
-		sw: textAnimator_animatables.sw ? getProp(elem, textAnimator_animatables.sw, 0, 0, container) : defaultData,
-		sc: textAnimator_animatables.sc ? getProp(elem, textAnimator_animatables.sc, 1, 0, container) : defaultData,
-		fc: textAnimator_animatables.fc ? getProp(elem, textAnimator_animatables.fc, 1, 0, container) : defaultData,
-		fh: textAnimator_animatables.fh ? getProp(elem, textAnimator_animatables.fh, 0, 0, container) : defaultData,
-		fs: textAnimator_animatables.fs ? getProp(elem, textAnimator_animatables.fs, 0, 0.01, container) : defaultData,
-		fb: textAnimator_animatables.fb ? getProp(elem, textAnimator_animatables.fb, 0, 0.01, container) : defaultData,
-		t: textAnimator_animatables.t ? getProp(elem, textAnimator_animatables.t, 0, 0, container) : defaultData
-	};
+  var defaultData = { propType: false };
+  var getProp = PropertyFactory.getProp;
+  var textAnimatorAnimatables = animatorProps.a;
+  this.a = {
+    r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
+    rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
+    ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
+    sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
+    sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
+    s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
+    a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
+    o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
+    p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
+    sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
+    sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
+    fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
+    fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
+    fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
+    fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
+    t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData,
+  };
 
-	this.s = TextSelectorProp.getTextSelectorProp(elem,animatorProps.s, container);
-    this.s.t = animatorProps.s.t;
+  this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
+  this.s.t = animatorProps.s.t;
 }
-function LetterProps(o, sw, sc, fc, m, p){
+
+function LetterProps(o, sw, sc, fc, m, p) {
+  this.o = o;
+  this.sw = sw;
+  this.sc = sc;
+  this.fc = fc;
+  this.m = m;
+  this.p = p;
+  this._mdf = {
+    o: true,
+    sw: !!sw,
+    sc: !!sc,
+    fc: !!fc,
+    m: true,
+    p: true,
+  };
+}
+
+LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
+  this._mdf.o = false;
+  this._mdf.sw = false;
+  this._mdf.sc = false;
+  this._mdf.fc = false;
+  this._mdf.m = false;
+  this._mdf.p = false;
+  var updated = false;
+
+  if (this.o !== o) {
     this.o = o;
+    this._mdf.o = true;
+    updated = true;
+  }
+  if (this.sw !== sw) {
     this.sw = sw;
+    this._mdf.sw = true;
+    updated = true;
+  }
+  if (this.sc !== sc) {
     this.sc = sc;
+    this._mdf.sc = true;
+    updated = true;
+  }
+  if (this.fc !== fc) {
     this.fc = fc;
+    this._mdf.fc = true;
+    updated = true;
+  }
+  if (this.m !== m) {
     this.m = m;
+    this._mdf.m = true;
+    updated = true;
+  }
+  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])) {
     this.p = p;
-    this._mdf = {
-    	o: true,
-    	sw: !!sw,
-    	sc: !!sc,
-    	fc: !!fc,
-    	m: true,
-    	p: true
-    };
-}
-
-LetterProps.prototype.update = function(o, sw, sc, fc, m, p) {
-	this._mdf.o = false;
-	this._mdf.sw = false;
-	this._mdf.sc = false;
-	this._mdf.fc = false;
-	this._mdf.m = false;
-	this._mdf.p = false;
-	var updated = false;
-
-	if(this.o !== o) {
-		this.o = o;
-		this._mdf.o = true;
-		updated = true;
-	}
-	if(this.sw !== sw) {
-		this.sw = sw;
-		this._mdf.sw = true;
-		updated = true;
-	}
-	if(this.sc !== sc) {
-		this.sc = sc;
-		this._mdf.sc = true;
-		updated = true;
-	}
-	if(this.fc !== fc) {
-		this.fc = fc;
-		this._mdf.fc = true;
-		updated = true;
-	}
-	if(this.m !== m) {
-		this.m = m;
-		this._mdf.m = true;
-		updated = true;
-	}
-	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])) {
-		this.p = p;
-		this._mdf.p = true;
-		updated = true;
-	}
-	return updated;
-};
-function TextProperty(elem, data){
-	this._frameId = initialDefaultFrame;
-	this.pv = '';
-	this.v = '';
-	this.kf = false;
-	this._isFirstFrame = true;
-	this._mdf = false;
-    this.data = data;
-	this.elem = elem;
-    this.comp = this.elem.comp;
-	this.keysIndex = 0;
-    this.canResize = false;
-    this.minimumFontSize = 1;
-    this.effectsSequence = [];
-	this.currentData = {
-		ascent: 0,
-        boxWidth: this.defaultBoxWidth,
-        f: '',
-        fStyle: '',
-        fWeight: '',
-        fc: '',
-        j: '',
-        justifyOffset: '',
-        l: [],
-        lh: 0,
-        lineWidths: [],
-        ls: '',
-        of: '',
-        s: '',
-        sc: '',
-        sw: 0,
-        t: 0,
-        tr: 0,
-        sz:0,
-        ps:null,
-        fillColorAnim: false,
-        strokeColorAnim: false,
-        strokeWidthAnim: false,
-        yOffset: 0,
-        finalSize:0,
-        finalText:[],
-        finalLineHeight: 0,
-        __complete: false
-
-	};
-    this.copyData(this.currentData, this.data.d.k[0].s);
-
-    if(!this.searchProperty()) {
-        this.completeTextData(this.currentData);
-    }
-}
-
-TextProperty.prototype.defaultBoxWidth = [0,0];
-
-TextProperty.prototype.copyData = function(obj, data) {
-    for(var s in data) {
-        if(data.hasOwnProperty(s)) {
-            obj[s] = data[s];
-        }
-    }
-    return obj;
-}
-
-TextProperty.prototype.setCurrentData = function(data){
-    if(!data.__complete) {
-        this.completeTextData(data);
-    }
-    this.currentData = data;
-    this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
-    this._mdf = true;
+    this._mdf.p = true;
+    updated = true;
+  }
+  return updated;
 };
 
-TextProperty.prototype.searchProperty = function() {
-    return this.searchKeyframes();
-};
+/* global FontManager, initialDefaultFrame, getFontProperties */
+/* exported TextProperty */
 
-TextProperty.prototype.searchKeyframes = function() {
-    this.kf = this.data.d.k.length > 1;
-    if(this.kf) {
-        this.addEffect(this.getKeyframeValue.bind(this));
-    }
-    return this.kf;
+function TextProperty(elem, data) {
+  this._frameId = initialDefaultFrame;
+  this.pv = '';
+  this.v = '';
+  this.kf = false;
+  this._isFirstFrame = true;
+  this._mdf = false;
+  this.data = data;
+  this.elem = elem;
+  this.comp = this.elem.comp;
+  this.keysIndex = 0;
+  this.canResize = false;
+  this.minimumFontSize = 1;
+  this.effectsSequence = [];
+  this.currentData = {
+    ascent: 0,
+    boxWidth: this.defaultBoxWidth,
+    f: '',
+    fStyle: '',
+    fWeight: '',
+    fc: '',
+    j: '',
+    justifyOffset: '',
+    l: [],
+    lh: 0,
+    lineWidths: [],
+    ls: '',
+    of: '',
+    s: '',
+    sc: '',
+    sw: 0,
+    t: 0,
+    tr: 0,
+    sz: 0,
+    ps: null,
+    fillColorAnim: false,
+    strokeColorAnim: false,
+    strokeWidthAnim: false,
+    yOffset: 0,
+    finalSize: 0,
+    finalText: [],
+    finalLineHeight: 0,
+    __complete: false,
+
+  };
+  this.copyData(this.currentData, this.data.d.k[0].s);
+
+  if (!this.searchProperty()) {
+    this.completeTextData(this.currentData);
+  }
 }
 
-TextProperty.prototype.addEffect = function(effectFunction) {
-	this.effectsSequence.push(effectFunction);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.defaultBoxWidth = [0, 0];
+
+TextProperty.prototype.copyData = function (obj, data) {
+  for (var s in data) {
+    if (Object.prototype.hasOwnProperty.call(data, s)) {
+      obj[s] = data[s];
+    }
+  }
+  return obj;
 };
 
-TextProperty.prototype.getValue = function(_finalValue) {
-    if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
-        return;
-    }
-    this.currentData.t = this.data.d.k[this.keysIndex].s.t;
-    var currentValue = this.currentData;
-    var currentIndex = this.keysIndex;
-    if(this.lock) {
-        this.setCurrentData(this.currentData);
-        return;
-    }
-    this.lock = true;
-    this._mdf = false;
-    var multipliedValue;
-    var i, len = this.effectsSequence.length;
-    var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
-    for(i = 0; i < len; i += 1) {
-        //Checking if index changed to prevent creating a new object every time the expression updates.
-        if(currentIndex !== this.keysIndex) {
-            finalValue = this.effectsSequence[i](finalValue, finalValue.t);
-        } else {
-            finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
-        }
-    }
-    if(currentValue !== finalValue) {
-        this.setCurrentData(finalValue);
-    }
-    this.pv = this.v = this.currentData;
-    this.lock = false;
-    this.frameId = this.elem.globalData.frameId;
-}
+TextProperty.prototype.setCurrentData = function (data) {
+  if (!data.__complete) {
+    this.completeTextData(data);
+  }
+  this.currentData = data;
+  this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
+  this._mdf = true;
+};
 
-TextProperty.prototype.getKeyframeValue = function() {
-    var textKeys = this.data.d.k, textDocumentData;
-    var frameNum = this.elem.comp.renderedFrame;
-    var i = 0, len = textKeys.length;
-    while(i <= len - 1) {
-        textDocumentData = textKeys[i].s;
-        if(i === len - 1 || textKeys[i+1].t > frameNum){
-            break;
-        }
+TextProperty.prototype.searchProperty = function () {
+  return this.searchKeyframes();
+};
+
+TextProperty.prototype.searchKeyframes = function () {
+  this.kf = this.data.d.k.length > 1;
+  if (this.kf) {
+    this.addEffect(this.getKeyframeValue.bind(this));
+  }
+  return this.kf;
+};
+
+TextProperty.prototype.addEffect = function (effectFunction) {
+  this.effectsSequence.push(effectFunction);
+  this.elem.addDynamicProperty(this);
+};
+
+TextProperty.prototype.getValue = function (_finalValue) {
+  if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
+    return;
+  }
+  this.currentData.t = this.data.d.k[this.keysIndex].s.t;
+  var currentValue = this.currentData;
+  var currentIndex = this.keysIndex;
+  if (this.lock) {
+    this.setCurrentData(this.currentData);
+    return;
+  }
+  this.lock = true;
+  this._mdf = false;
+  var i; var
+    len = this.effectsSequence.length;
+  var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
+  for (i = 0; i < len; i += 1) {
+    // Checking if index changed to prevent creating a new object every time the expression updates.
+    if (currentIndex !== this.keysIndex) {
+      finalValue = this.effectsSequence[i](finalValue, finalValue.t);
+    } else {
+      finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
+    }
+  }
+  if (currentValue !== finalValue) {
+    this.setCurrentData(finalValue);
+  }
+  this.v = this.currentData;
+  this.pv = this.v;
+  this.lock = false;
+  this.frameId = this.elem.globalData.frameId;
+};
+
+TextProperty.prototype.getKeyframeValue = function () {
+  var textKeys = this.data.d.k;
+  var frameNum = this.elem.comp.renderedFrame;
+  var i = 0; var
+    len = textKeys.length;
+  while (i <= len - 1) {
+    if (i === len - 1 || textKeys[i + 1].t > frameNum) {
+      break;
+    }
+    i += 1;
+  }
+  if (this.keysIndex !== i) {
+    this.keysIndex = i;
+  }
+  return this.data.d.k[this.keysIndex].s;
+};
+
+TextProperty.prototype.buildFinalText = function (text) {
+  var combinedCharacters = FontManager.getCombinedCharacterCodes();
+  var charactersArray = [];
+  var i = 0; var
+    len = text.length;
+  var charCode;
+  while (i < len) {
+    charCode = text.charCodeAt(i);
+    if (combinedCharacters.indexOf(charCode) !== -1) {
+      charactersArray[charactersArray.length - 1] += text.charAt(i);
+    } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      charCode = text.charCodeAt(i + 1);
+      if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
+        charactersArray.push(text.substr(i, 2));
         i += 1;
+      } else {
+        charactersArray.push(text.charAt(i));
+      }
+    } else {
+      charactersArray.push(text.charAt(i));
     }
-    if(this.keysIndex !== i) {
-        this.keysIndex = i;
-    }
-    return this.data.d.k[this.keysIndex].s;
+    i += 1;
+  }
+  return charactersArray;
 };
 
-TextProperty.prototype.buildFinalText = function(text) {
-    var combinedCharacters = FontManager.getCombinedCharacterCodes();
-    var charactersArray = [];
-    var i = 0, len = text.length;
-    var charCode;
-    while (i < len) {
-        charCode = text.charCodeAt(i);
-        if (combinedCharacters.indexOf(charCode) !== -1) {
-            charactersArray[charactersArray.length - 1] += text.charAt(i);
-        } else {
-            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
-                charCode = text.charCodeAt(i + 1);
-                if (charCode >= 0xDC00 && charCode <= 0xDFFF) {
-                    charactersArray.push(text.substr(i, 2));
-                    ++i;
-                } else {
-                    charactersArray.push(text.charAt(i));
-                }
-            } else {
-                charactersArray.push(text.charAt(i));
-            }
-        }
-        i += 1;
-    }
-    return charactersArray;
-}
-
-TextProperty.prototype.completeTextData = function(documentData) {
-    documentData.__complete = true;
-    var fontManager = this.elem.globalData.fontManager;
-    var data = this.data;
-    var letters = [];
-    var i, len;
-    var newLineFlag, index = 0, val;
-    var anchorGrouping = data.m.g;
-    var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = [];
-    var lineWidth = 0;
-    var maxLineWidth = 0;
-    var j, jLen;
-    var fontData = fontManager.getFontByName(documentData.f);
-    var charData, cLength = 0;
-    var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
-
-    var fWeight = 'normal', fStyle = 'normal';
-    len = styles.length;
-    var styleName;
-    for(i=0;i<len;i+=1){
-        styleName = styles[i].toLowerCase();
-        switch(styleName) {
-            case 'italic':
-            fStyle = 'italic';
-            break;
-            case 'bold':
-            fWeight = '700';
-            break;
-            case 'black':
-            fWeight = '900';
-            break;
-            case 'medium':
-            fWeight = '500';
-            break;
-            case 'regular':
-            case 'normal':
-            fWeight = '400';
-            break;
-            case 'light':
-            case 'thin':
-            fWeight = '200';
-            break;
-        }
-    }
-    documentData.fWeight = fontData.fWeight || fWeight;
-    documentData.fStyle = fStyle;
-    documentData.finalSize = documentData.s;
-    documentData.finalText = this.buildFinalText(documentData.t);
-    len = documentData.finalText.length;
-    documentData.finalLineHeight = documentData.lh;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    var charCode;
-    if(documentData.sz){
-        var flag = true;
-        var boxWidth = documentData.sz[0];
-        var boxHeight = documentData.sz[1];
-        var currentHeight, finalText;
-        while(flag) {
-            finalText = this.buildFinalText(documentData.t);
-            currentHeight = 0;
-            lineWidth = 0;
-            len = finalText.length;
-            trackingOffset = documentData.tr/1000*documentData.finalSize;
-            var lastSpaceIndex = -1;
-            for(i=0;i<len;i+=1){
-                charCode = finalText[i].charCodeAt(0);
-                newLineFlag = false;
-                if(finalText[i] === ' '){
-                    lastSpaceIndex = i;
-                }else if(charCode === 13 || charCode === 3){
-                    lineWidth = 0;
-                    newLineFlag = true;
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                }
-                if(fontManager.chars){
-                    charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
-                    cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-                }else{
-                    //tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
-                    cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
-                }
-                if(lineWidth + cLength > boxWidth && finalText[i] !== ' '){
-                    if(lastSpaceIndex === -1){
-                        len += 1;
-                    } else {
-                        i = lastSpaceIndex;
-                    }
-                    currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2;
-                    finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r");
-                    //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
-                    lastSpaceIndex = -1;
-                    lineWidth = 0;
-                }else {
-                    lineWidth += cLength;
-                    lineWidth += trackingOffset;
-                }
-            }
-            currentHeight += fontData.ascent*documentData.finalSize/100;
-            if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
-                documentData.finalSize -= 1;
-                documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
-            } else {
-                documentData.finalText = finalText;
-                len = documentData.finalText.length;
-                flag = false;
-            }
-        }
-
-    }
-    lineWidth = - trackingOffset;
+TextProperty.prototype.completeTextData = function (documentData) {
+  documentData.__complete = true;
+  var fontManager = this.elem.globalData.fontManager;
+  var data = this.data;
+  var letters = [];
+  var i; var
+    len;
+  var newLineFlag; var index = 0; var
+    val;
+  var anchorGrouping = data.m.g;
+  var currentSize = 0; var currentPos = 0; var currentLine = 0; var
+    lineWidths = [];
+  var lineWidth = 0;
+  var maxLineWidth = 0;
+  var j; var
+    jLen;
+  var fontData = fontManager.getFontByName(documentData.f);
+  var charData; var
     cLength = 0;
-    var uncollapsedSpaces = 0;
-    var currentChar;
-    for (i = 0;i < len ;i += 1) {
+
+  var fontProps = getFontProperties(fontData);
+  documentData.fWeight = fontProps.weight;
+  documentData.fStyle = fontProps.style;
+  documentData.finalSize = documentData.s;
+  documentData.finalText = this.buildFinalText(documentData.t);
+  len = documentData.finalText.length;
+  documentData.finalLineHeight = documentData.lh;
+  var trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+  var charCode;
+  if (documentData.sz) {
+    var flag = true;
+    var boxWidth = documentData.sz[0];
+    var boxHeight = documentData.sz[1];
+    var currentHeight; var
+      finalText;
+    while (flag) {
+      finalText = this.buildFinalText(documentData.t);
+      currentHeight = 0;
+      lineWidth = 0;
+      len = finalText.length;
+      trackingOffset = (documentData.tr / 1000) * documentData.finalSize;
+      var lastSpaceIndex = -1;
+      for (i = 0; i < len; i += 1) {
+        charCode = finalText[i].charCodeAt(0);
         newLineFlag = false;
-        currentChar = documentData.finalText[i];
-        charCode = currentChar.charCodeAt(0);
-        if (charCode === 13 || charCode === 3) {
-            uncollapsedSpaces = 0;
-            lineWidths.push(lineWidth);
-            maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-            lineWidth = - 2 * trackingOffset;
-            val = '';
-            newLineFlag = true;
-            currentLine += 1;
-        }else{
-            val = currentChar;
+        if (finalText[i] === ' ') {
+          lastSpaceIndex = i;
+        } else if (charCode === 13 || charCode === 3) {
+          lineWidth = 0;
+          newLineFlag = true;
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
         }
-        if(fontManager.chars){
-            charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
-            cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100;
-        }else{
-            //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
-            //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
-            cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
-        }
-
-        //
-        if(currentChar === ' '){
-            uncollapsedSpaces += cLength + trackingOffset;
+        if (fontManager.chars) {
+          charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
+          cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
         } else {
-            lineWidth += cLength + trackingOffset + uncollapsedSpaces;
-            uncollapsedSpaces = 0;
+          // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
+          cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
         }
-        letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0});
-        if(anchorGrouping == 2){
-            currentSize += cLength;
-            if(val === '' || val === ' ' || i === len - 1){
-                if(val === '' || val === ' '){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                index += 1;
-                currentSize = 0;
-            }
-        }else if(anchorGrouping == 3){
-            currentSize += cLength;
-            if(val === '' || i === len - 1){
-                if(val === ''){
-                    currentSize -= cLength;
-                }
-                while(currentPos<=i){
-                    letters[currentPos].an = currentSize;
-                    letters[currentPos].ind = index;
-                    letters[currentPos].extra = cLength;
-                    currentPos += 1;
-                }
-                currentSize = 0;
-                index += 1;
-            }
-        }else{
-            letters[index].ind = index;
-            letters[index].extra = 0;
-            index += 1;
+        if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
+          if (lastSpaceIndex === -1) {
+            len += 1;
+          } else {
+            i = lastSpaceIndex;
+          }
+          currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
+          finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r');
+          // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
+          lastSpaceIndex = -1;
+          lineWidth = 0;
+        } else {
+          lineWidth += cLength;
+          lineWidth += trackingOffset;
         }
+      }
+      currentHeight += (fontData.ascent * documentData.finalSize) / 100;
+      if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
+        documentData.finalSize -= 1;
+        documentData.finalLineHeight = (documentData.finalSize * documentData.lh) / documentData.s;
+      } else {
+        documentData.finalText = finalText;
+        len = documentData.finalText.length;
+        flag = false;
+      }
     }
-    documentData.l = letters;
-    maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
-    lineWidths.push(lineWidth);
-    if(documentData.sz){
-        documentData.boxWidth = documentData.sz[0];
+  }
+  lineWidth = -trackingOffset;
+  cLength = 0;
+  var uncollapsedSpaces = 0;
+  var currentChar;
+  for (i = 0; i < len; i += 1) {
+    newLineFlag = false;
+    currentChar = documentData.finalText[i];
+    charCode = currentChar.charCodeAt(0);
+    if (charCode === 13 || charCode === 3) {
+      uncollapsedSpaces = 0;
+      lineWidths.push(lineWidth);
+      maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+      lineWidth = -2 * trackingOffset;
+      val = '';
+      newLineFlag = true;
+      currentLine += 1;
+    } else {
+      val = currentChar;
+    }
+    if (fontManager.chars) {
+      charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
+      cLength = newLineFlag ? 0 : (charData.w * documentData.finalSize) / 100;
+    } else {
+      // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
+      // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
+      cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
+    }
+
+    //
+    if (currentChar === ' ') {
+      uncollapsedSpaces += cLength + trackingOffset;
+    } else {
+      lineWidth += cLength + trackingOffset + uncollapsedSpaces;
+      uncollapsedSpaces = 0;
+    }
+    letters.push({
+      l: cLength, an: cLength, add: currentSize, n: newLineFlag, anIndexes: [], val: val, line: currentLine, animatorJustifyOffset: 0,
+    });
+    if (anchorGrouping == 2) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || val === ' ' || i === len - 1) {
+        if (val === '' || val === ' ') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        index += 1;
+        currentSize = 0;
+      }
+    } else if (anchorGrouping == 3) { // eslint-disable-line eqeqeq
+      currentSize += cLength;
+      if (val === '' || i === len - 1) {
+        if (val === '') {
+          currentSize -= cLength;
+        }
+        while (currentPos <= i) {
+          letters[currentPos].an = currentSize;
+          letters[currentPos].ind = index;
+          letters[currentPos].extra = cLength;
+          currentPos += 1;
+        }
+        currentSize = 0;
+        index += 1;
+      }
+    } else {
+      letters[index].ind = index;
+      letters[index].extra = 0;
+      index += 1;
+    }
+  }
+  documentData.l = letters;
+  maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
+  lineWidths.push(lineWidth);
+  if (documentData.sz) {
+    documentData.boxWidth = documentData.sz[0];
+    documentData.justifyOffset = 0;
+  } else {
+    documentData.boxWidth = maxLineWidth;
+    switch (documentData.j) {
+      case 1:
+        documentData.justifyOffset = -documentData.boxWidth;
+        break;
+      case 2:
+        documentData.justifyOffset = -documentData.boxWidth / 2;
+        break;
+      default:
         documentData.justifyOffset = 0;
-    }else{
-        documentData.boxWidth = maxLineWidth;
-        switch(documentData.j){
-            case 1:
-                documentData.justifyOffset = - documentData.boxWidth;
-                break;
-            case 2:
-                documentData.justifyOffset = - documentData.boxWidth/2;
-                break;
-            default:
-                documentData.justifyOffset = 0;
-        }
     }
-    documentData.lineWidths = lineWidths;
+  }
+  documentData.lineWidths = lineWidths;
 
-    var animators = data.a, animatorData, letterData;
-    jLen = animators.length;
-    var based, ind, indexes = [];
-    for(j=0;j<jLen;j+=1){
-        animatorData = animators[j];
-        if(animatorData.a.sc){
-            documentData.strokeColorAnim = true;
-        }
-        if(animatorData.a.sw){
-            documentData.strokeWidthAnim = true;
-        }
-        if(animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb){
-            documentData.fillColorAnim = true;
-        }
-        ind = 0;
-        based = animatorData.s.b;
-        for(i=0;i<len;i+=1){
-            letterData = letters[i];
-            letterData.anIndexes[j] = ind;
-            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))){
-                if(animatorData.s.rn === 1){
-                    indexes.push(ind);
-                }
-                ind += 1;
-            }
-        }
-        data.a[j].s.totalChars = ind;
-        var currentInd = -1, newInd;
-        if(animatorData.s.rn === 1){
-            for(i = 0; i < len; i += 1){
-                letterData = letters[i];
-                if(currentInd != letterData.anIndexes[j]){
-                    currentInd = letterData.anIndexes[j];
-                    newInd = indexes.splice(Math.floor(Math.random()*indexes.length),1)[0];
-                }
-                letterData.anIndexes[j] = newInd;
-            }
-        }
+  var animators = data.a; var animatorData; var
+    letterData;
+  jLen = animators.length;
+  var based; var ind; var
+    indexes = [];
+  for (j = 0; j < jLen; j += 1) {
+    animatorData = animators[j];
+    if (animatorData.a.sc) {
+      documentData.strokeColorAnim = true;
     }
-    documentData.yOffset = documentData.finalLineHeight || documentData.finalSize*1.2;
-    documentData.ls = documentData.ls || 0;
-    documentData.ascent = fontData.ascent*documentData.finalSize/100;
+    if (animatorData.a.sw) {
+      documentData.strokeWidthAnim = true;
+    }
+    if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
+      documentData.fillColorAnim = true;
+    }
+    ind = 0;
+    based = animatorData.s.b;
+    for (i = 0; i < len; i += 1) {
+      letterData = letters[i];
+      letterData.anIndexes[j] = ind;
+      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))) { // eslint-disable-line eqeqeq
+        if (animatorData.s.rn === 1) {
+          indexes.push(ind);
+        }
+        ind += 1;
+      }
+    }
+    data.a[j].s.totalChars = ind;
+    var currentInd = -1; var
+      newInd;
+    if (animatorData.s.rn === 1) {
+      for (i = 0; i < len; i += 1) {
+        letterData = letters[i];
+        if (currentInd != letterData.anIndexes[j]) { // eslint-disable-line eqeqeq
+          currentInd = letterData.anIndexes[j];
+          newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
+        }
+        letterData.anIndexes[j] = newInd;
+      }
+    }
+  }
+  documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
+  documentData.ls = documentData.ls || 0;
+  documentData.ascent = (fontData.ascent * documentData.finalSize) / 100;
 };
 
-TextProperty.prototype.updateDocumentData = function(newData, index) {
-	index = index === undefined ? this.keysIndex : index;
-    var dData = this.copyData({}, this.data.d.k[index].s);
-    dData = this.copyData(dData, newData);
-    this.data.d.k[index].s = dData;
-    this.recalculate(index);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.updateDocumentData = function (newData, index) {
+  index = index === undefined ? this.keysIndex : index;
+  var dData = this.copyData({}, this.data.d.k[index].s);
+  dData = this.copyData(dData, newData);
+  this.data.d.k[index].s = dData;
+  this.recalculate(index);
+  this.elem.addDynamicProperty(this);
 };
 
-TextProperty.prototype.recalculate = function(index) {
-    var dData = this.data.d.k[index].s;
-    dData.__complete = false;
-    this.keysIndex = 0;
-    this._isFirstFrame = true;
-    this.getValue(dData);
-}
-
-TextProperty.prototype.canResizeFont = function(_canResize) {
-    this.canResize = _canResize;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.recalculate = function (index) {
+  var dData = this.data.d.k[index].s;
+  dData.__complete = false;
+  this.keysIndex = 0;
+  this._isFirstFrame = true;
+  this.getValue(dData);
 };
 
-TextProperty.prototype.setMinimumFontSize = function(_fontValue) {
-    this.minimumFontSize = Math.floor(_fontValue) || 1;
-    this.recalculate(this.keysIndex);
-    this.elem.addDynamicProperty(this);
+TextProperty.prototype.canResizeFont = function (_canResize) {
+  this.canResize = _canResize;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
 };
 
-var TextSelectorProp = (function(){
-    var max = Math.max;
-    var min = Math.min;
-    var floor = Math.floor;
+TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
+  this.minimumFontSize = Math.floor(_fontValue) || 1;
+  this.recalculate(this.keysIndex);
+  this.elem.addDynamicProperty(this);
+};
 
-    function TextSelectorProp(elem,data){
-        this._currentTextLength = -1;
-        this.k = false;
-        this.data = data;
-        this.elem = elem;
-        this.comp = elem.comp;
-        this.finalS = 0;
-        this.finalE = 0;
-        this.initDynamicPropertyContainer(elem);
-        this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
-        if('e' in data){
-            this.e = PropertyFactory.getProp(elem,data.e,0,0,this);
-        }else{
-            this.e = {v:100};
+/* global extendPrototype, BezierFactory, PropertyFactory, DynamicPropertyContainer */
+/* exported TextSelectorProp */
+
+var TextSelectorProp = (function () {
+  var max = Math.max;
+  var min = Math.min;
+  var floor = Math.floor;
+
+  function TextSelectorPropFactory(elem, data) {
+    this._currentTextLength = -1;
+    this.k = false;
+    this.data = data;
+    this.elem = elem;
+    this.comp = elem.comp;
+    this.finalS = 0;
+    this.finalE = 0;
+    this.initDynamicPropertyContainer(elem);
+    this.s = PropertyFactory.getProp(elem, data.s || { k: 0 }, 0, 0, this);
+    if ('e' in data) {
+      this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
+    } else {
+      this.e = { v: 100 };
+    }
+    this.o = PropertyFactory.getProp(elem, data.o || { k: 0 }, 0, 0, this);
+    this.xe = PropertyFactory.getProp(elem, data.xe || { k: 0 }, 0, 0, this);
+    this.ne = PropertyFactory.getProp(elem, data.ne || { k: 0 }, 0, 0, this);
+    this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
+    if (!this.dynamicProperties.length) {
+      this.getValue();
+    }
+  }
+
+  TextSelectorPropFactory.prototype = {
+    getMult: function (ind) {
+      if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
+        this.getValue();
+      }
+      // var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
+      var x1 = 0;
+      var y1 = 0;
+      var x2 = 1;
+      var y2 = 1;
+      if (this.ne.v > 0) {
+        x1 = this.ne.v / 100.0;
+      } else {
+        y1 = -this.ne.v / 100.0;
+      }
+      if (this.xe.v > 0) {
+        x2 = 1.0 - this.xe.v / 100.0;
+      } else {
+        y2 = 1.0 + this.xe.v / 100.0;
+      }
+      var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
+
+      var mult = 0;
+      var s = this.finalS;
+      var e = this.finalE;
+      var type = this.data.sh;
+      if (type === 2) {
+        if (e === s) {
+          mult = ind >= e ? 1 : 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
-        this.o = PropertyFactory.getProp(elem,data.o || {k:0},0,0,this);
-        this.xe = PropertyFactory.getProp(elem,data.xe || {k:0},0,0,this);
-        this.ne = PropertyFactory.getProp(elem,data.ne || {k:0},0,0,this);
-        this.a = PropertyFactory.getProp(elem,data.a,0,0.01,this);
-        if(!this.dynamicProperties.length){
-            this.getValue();
+        mult = easer(mult);
+      } else if (type === 3) {
+        if (e === s) {
+          mult = ind >= e ? 0 : 1;
+        } else {
+          mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
         }
+
+        mult = easer(mult);
+      } else if (type === 4) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
+          if (mult < 0.5) {
+            mult *= 2;
+          } else {
+            mult = 1 - 2 * (mult - 0.5);
+          }
+        }
+        mult = easer(mult);
+      } else if (type === 5) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          var tot = e - s;
+          /* ind += 0.5;
+                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          var x = -tot / 2 + ind;
+          var a = tot / 2;
+          mult = Math.sqrt(1 - (x * x) / (a * a));
+        }
+        mult = easer(mult);
+      } else if (type === 6) {
+        if (e === s) {
+          mult = 0;
+        } else {
+          ind = min(max(0, ind + 0.5 - s), e - s);
+          mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2; // eslint-disable-line
+        }
+        mult = easer(mult);
+      } else {
+        if (ind >= floor(s)) {
+          if (ind - s < 0) {
+            mult = max(0, min(min(e, 1) - (s - ind), 1));
+          } else {
+            mult = max(0, min(e - ind, 1));
+          }
+        }
+        mult = easer(mult);
+      }
+      return mult * this.a.v;
+    },
+    getValue: function (newCharsFlag) {
+      this.iterateDynamicProperties();
+      this._mdf = newCharsFlag || this._mdf;
+      this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
+      if (newCharsFlag && this.data.r === 2) {
+        this.e.v = this._currentTextLength;
+      }
+      var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
+      var o = this.o.v / divisor;
+      var s = this.s.v / divisor + o;
+      var e = (this.e.v / divisor) + o;
+      if (s > e) {
+        var _s = s;
+        s = e;
+        e = _s;
+      }
+      this.finalS = s;
+      this.finalE = e;
+    },
+  };
+  extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
+
+  function getTextSelectorProp(elem, data, arr) {
+    return new TextSelectorPropFactory(elem, data, arr);
+  }
+
+  return {
+    getTextSelectorProp: getTextSelectorProp,
+  };
+}());
+
+/* global createSizedArray, pooling */
+/* exported poolFactory */
+
+var poolFactory = (function () {
+  return function (initialLength, _create, _release) {
+    var _length = 0;
+    var _maxLength = initialLength;
+    var pool = createSizedArray(_maxLength);
+
+    var ob = {
+      newElement: newElement,
+      release: release,
+    };
+
+    function newElement() {
+      var element;
+      if (_length) {
+        _length -= 1;
+        element = pool[_length];
+      } else {
+        element = _create();
+      }
+      return element;
     }
 
-    TextSelectorProp.prototype = {
-        getMult: function(ind) {
-            if(this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
-                this.getValue();
-            }
-            //var easer = bez.getEasingCurve(this.ne.v/100,0,1-this.xe.v/100,1);
-            var x1 = 0;
-            var y1 = 0;
-            var x2 = 1;
-            var y2 = 1;
-            if(this.ne.v > 0) {
-                x1 = this.ne.v / 100.0;
-            }
-            else {
-                y1 = -this.ne.v / 100.0;
-            }
-            if(this.xe.v > 0) {
-                x2 = 1.0 - this.xe.v / 100.0;
-            }
-            else {
-                y2 = 1.0 + this.xe.v / 100.0;
-            }
-            var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
-
-            var mult = 0;
-            var s = this.finalS;
-            var e = this.finalE;
-            var type = this.data.sh;
-            if (type === 2){
-                if (e === s) {
-                    mult = ind >= e ? 1 : 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                }
-                mult = easer(mult);
-            } else if(type === 3) {
-                if (e === s) {
-                    mult = ind >= e ? 0 : 1;
-                }else{
-                    mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s),1));
-                }
-
-                mult = easer(mult);
-            } else if (type === 4) {
-                if (e === s) {
-                    mult = 0;
-                } else {
-                    mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
-                    if (mult < 0.5) {
-                        mult *= 2;
-                    } else {
-                        mult = 1 - 2 * (mult - 0.5);
-                    }
-                }
-                mult = easer(mult);
-            } else if (type === 5) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    var tot = e - s;
-                    /*ind += 0.5;
-                    mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    var x = -tot/2+ind;
-                    var a = tot/2;
-                    mult = Math.sqrt(1 - (x * x) / (a * a));
-                }
-                mult = easer(mult);
-            } else if (type === 6) {
-                if (e === s){
-                    mult = 0;
-                } else {
-                    ind = min(max(0, ind + 0.5 - s), e - s);
-                    mult = (1 + (Math.cos((Math.PI + Math.PI * 2 * (ind) / (e - s))))) / 2;
-                }
-                mult = easer(mult);
-            } else {
-                if (ind >= floor(s)) {
-                    if (ind - s < 0) {
-                        mult = max(0, min(min(e, 1) - (s - ind), 1));
-                    } else {
-                        mult = max(0, min(e - ind, 1));
-                    }
-                }
-                mult = easer(mult);
-            }
-            return mult*this.a.v;
-        },
-        getValue: function(newCharsFlag) {
-            this.iterateDynamicProperties();
-            this._mdf = newCharsFlag || this._mdf;
-            this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
-            if(newCharsFlag && this.data.r === 2) {
-                this.e.v = this._currentTextLength;
-            }
-            var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
-            var o = this.o.v/divisor;
-            var s = this.s.v/divisor + o;
-            var e = (this.e.v/divisor) + o;
-            if(s>e){
-                var _s = s;
-                s = e;
-                e = _s;
-            }
-            this.finalS = s;
-            this.finalE = e;
-        }
-    }
-    extendPrototype([DynamicPropertyContainer], TextSelectorProp);
-
-    function getTextSelectorProp(elem, data,arr) {
-        return new TextSelectorProp(elem, data, arr);
+    function release(element) {
+      if (_length === _maxLength) {
+        pool = pooling.double(pool);
+        _maxLength *= 2;
+      }
+      if (_release) {
+        _release(element);
+      }
+      pool[_length] = element;
+      _length += 1;
     }
 
+    return ob;
+  };
+}());
+
+/* global createSizedArray */
+/* exported pooling */
+
+var pooling = (function () {
+  function double(arr) {
+    return arr.concat(createSizedArray(arr.length));
+  }
+
+  return {
+    double: double,
+  };
+}());
+
+/* global createTypedArray, poolFactory */
+/* exported pointPool */
+
+var pointPool = (function () {
+  function create() {
+    return createTypedArray('float32', 2);
+  }
+  return poolFactory(8, create);
+}());
+
+/* global ShapePath, pointPool, poolFactory */
+/* exported shapePool */
+
+var shapePool = (function () {
+  function create() {
+    return new ShapePath();
+  }
+
+  function release(shapePath) {
+    var len = shapePath._length;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      pointPool.release(shapePath.v[i]);
+      pointPool.release(shapePath.i[i]);
+      pointPool.release(shapePath.o[i]);
+      shapePath.v[i] = null;
+      shapePath.i[i] = null;
+      shapePath.o[i] = null;
+    }
+    shapePath._length = 0;
+    shapePath.c = false;
+  }
+
+  function clone(shape) {
+    var cloned = factory.newElement();
+    var i;
+    var len = shape._length === undefined ? shape.v.length : shape._length;
+    cloned.setLength(len);
+    cloned.c = shape.c;
+
+    for (i = 0; i < len; i += 1) {
+      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);
+    }
+    return cloned;
+  }
+
+  var factory = poolFactory(4, create, release);
+  factory.clone = clone;
+
+  return factory;
+}());
+
+/* global createSizedArray, ShapeCollection, shapePool, pooling */
+/* exported shapeCollectionPool */
+
+var shapeCollectionPool = (function () {
+  var ob = {
+    newShapeCollection: newShapeCollection,
+    release: release,
+  };
+
+  var _length = 0;
+  var _maxLength = 4;
+  var pool = createSizedArray(_maxLength);
+
+  function newShapeCollection() {
+    var shapeCollection;
+    if (_length) {
+      _length -= 1;
+      shapeCollection = pool[_length];
+    } else {
+      shapeCollection = new ShapeCollection();
+    }
+    return shapeCollection;
+  }
+
+  function release(shapeCollection) {
+    var i;
+    var len = shapeCollection._length;
+    for (i = 0; i < len; i += 1) {
+      shapePool.release(shapeCollection.shapes[i]);
+    }
+    shapeCollection._length = 0;
+
+    if (_length === _maxLength) {
+      pool = pooling.double(pool);
+      _maxLength *= 2;
+    }
+    pool[_length] = shapeCollection;
+    _length += 1;
+  }
+
+  return ob;
+}());
+
+/* global poolFactory, bezierLengthPool */
+/* exported segmentsLengthPool */
+
+var segmentsLengthPool = (function () {
+  function create() {
     return {
-        getTextSelectorProp: getTextSelectorProp
+      lengths: [],
+      totalLength: 0,
     };
-}());
+  }
 
-    
-var pool_factory = (function() {
-	return function(initialLength, _create, _release, _clone) {
-
-		var _length = 0;
-		var _maxLength = initialLength;
-		var pool = createSizedArray(_maxLength);
-
-		var ob = {
-			newElement: newElement,
-			release: release
-		};
-
-		function newElement(){
-			var element;
-			if(_length){
-				_length -= 1;
-				element = pool[_length];
-			} else {
-				element = _create();
-			}
-			return element;
-		}
-
-		function release(element) {
-			if(_length === _maxLength) {
-				pool = pooling.double(pool);
-				_maxLength = _maxLength*2;
-			}
-			if (_release) {
-				_release(element);
-			}
-			pool[_length] = element;
-			_length += 1;
-		}
-
-		function clone() {
-			var clonedElement = newElement();
-			return _clone(clonedElement);
-		}
-
-		return ob;
-	};
-}());
-
-var pooling = (function(){
-
-	function double(arr){
-		return arr.concat(createSizedArray(arr.length));
-	}
-
-	return {
-		double: double
-	};
-}());
-var point_pool = (function(){
-
-	function create() {
-		return createTypedArray('float32', 2);
-	}
-	return pool_factory(8, create);
-}());
-var shape_pool = (function(){
-
-	function create() {
-		return new ShapePath();
-	}
-
-	function release(shapePath) {
-		var len = shapePath._length, i;
-		for(i = 0; i < len; i += 1) {
-			point_pool.release(shapePath.v[i]);
-			point_pool.release(shapePath.i[i]);
-			point_pool.release(shapePath.o[i]);
-			shapePath.v[i] = null;
-			shapePath.i[i] = null;
-			shapePath.o[i] = null;
-		}
-		shapePath._length = 0;
-		shapePath.c = false;
-	}
-
-	function clone(shape) {
-		var cloned = factory.newElement();
-		var i, len = shape._length === undefined ? shape.v.length : shape._length;
-		cloned.setLength(len);
-		cloned.c = shape.c;
-		var pt;
-		
-		for(i = 0; i < len; i += 1) {
-			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);
-		}
-		return cloned;
-	}
-
-	var factory = pool_factory(4, create, release);
-	factory.clone = clone;
-
-	return factory;
-}());
-var shapeCollection_pool = (function(){
-	var ob = {
-		newShapeCollection: newShapeCollection,
-		release: release
-	};
-
-	var _length = 0;
-	var _maxLength = 4;
-	var pool = createSizedArray(_maxLength);
-
-	function newShapeCollection(){
-		var shapeCollection;
-		if(_length){
-			_length -= 1;
-			shapeCollection = pool[_length];
-		} else {
-			shapeCollection = new ShapeCollection();
-		}
-		return shapeCollection;
-	}
-
-	function release(shapeCollection) {
-		var i, len = shapeCollection._length;
-		for(i = 0; i < len; i += 1) {
-			shape_pool.release(shapeCollection.shapes[i]);
-		}
-		shapeCollection._length = 0;
-
-		if(_length === _maxLength) {
-			pool = pooling.double(pool);
-			_maxLength = _maxLength*2;
-		}
-		pool[_length] = shapeCollection;
-		_length += 1;
-	}
-
-	return ob;
-}());
-var segments_length_pool = (function(){
-
-	function create() {
-		return {
-			lengths: [],
-			totalLength: 0
-		};
-	}
-
-	function release(element) {
-		var i, len = element.lengths.length;
-		for(i=0;i<len;i+=1) {
-			bezier_length_pool.release(element.lengths[i]);
-		}
-		element.lengths.length = 0;
-	}
-
-	return pool_factory(8, create, release);
-}());
-var bezier_length_pool = (function(){
-
-	function create() {
-		return {
-            addedLength: 0,
-            percents: createTypedArray('float32', defaultCurveSegments),
-            lengths: createTypedArray('float32', defaultCurveSegments),
-        };
-	}
-	return pool_factory(8, create);
-}());
-function BaseRenderer(){}
-BaseRenderer.prototype.checkLayers = function(num){
-    var i, len = this.layers.length, data;
-    this.completeLayers = true;
-    for (i = len - 1; i >= 0; i--) {
-        if (!this.elements[i]) {
-            data = this.layers[i];
-            if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st))
-            {
-                this.buildItem(i);
-            }
-        }
-        this.completeLayers = this.elements[i] ? this.completeLayers:false;
+  function release(element) {
+    var i;
+    var len = element.lengths.length;
+    for (i = 0; i < len; i += 1) {
+      bezierLengthPool.release(element.lengths[i]);
     }
-    this.checkPendingElements();
-};
+    element.lengths.length = 0;
+  }
 
-BaseRenderer.prototype.createItem = function(layer){
-    switch(layer.ty){
-        case 2:
-            return this.createImage(layer);
-        case 0:
-            return this.createComp(layer);
-        case 1:
-            return this.createSolid(layer);
-        case 3:
-            return this.createNull(layer);
-        case 4:
-            return this.createShape(layer);
-        case 5:
-            return this.createText(layer);
-        case 6:
-            return this.createAudio(layer);
-        case 13:
-            return this.createCamera(layer);
-    }
-    return this.createNull(layer);
-};
+  return poolFactory(8, create, release);
+}());
 
-BaseRenderer.prototype.createCamera = function(){
-    throw new Error('You\'re using a 3d camera. Try the html renderer.');
-};
+/* global createTypedArray, defaultCurveSegments, poolFactory */
+/* exported bezierLengthPool */
 
-BaseRenderer.prototype.createAudio = function(data){
-    return new AudioElement(data, this.globalData, this);
-};
+var bezierLengthPool = (function () {
+  function create() {
+    return {
+      addedLength: 0,
+      percents: createTypedArray('float32', defaultCurveSegments),
+      lengths: createTypedArray('float32', defaultCurveSegments),
+    };
+  }
+  return poolFactory(8, create);
+}());
 
-BaseRenderer.prototype.buildAllItems = function(){
-    var i, len = this.layers.length;
-    for(i=0;i<len;i+=1){
+/* global AudioElement, FontManager */
+
+function BaseRenderer() {}
+BaseRenderer.prototype.checkLayers = function (num) {
+  var i;
+  var len = this.layers.length;
+  var data;
+  this.completeLayers = true;
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (!this.elements[i]) {
+      data = this.layers[i];
+      if (data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) {
         this.buildItem(i);
+      }
     }
-    this.checkPendingElements();
+    this.completeLayers = this.elements[i] ? this.completeLayers : false;
+  }
+  this.checkPendingElements();
 };
 
-BaseRenderer.prototype.includeLayers = function(newLayers){
-    this.completeLayers = false;
-    var i, len = newLayers.length;
-    var j, jLen = this.layers.length;
-    for(i=0;i<len;i+=1){
-        j = 0;
-        while(j<jLen){
-            if(this.layers[j].id == newLayers[i].id){
-                this.layers[j] = newLayers[i];
-                break;
-            }
-            j += 1;
+BaseRenderer.prototype.createItem = function (layer) {
+  switch (layer.ty) {
+    case 2:
+      return this.createImage(layer);
+    case 0:
+      return this.createComp(layer);
+    case 1:
+      return this.createSolid(layer);
+    case 3:
+      return this.createNull(layer);
+    case 4:
+      return this.createShape(layer);
+    case 5:
+      return this.createText(layer);
+    case 6:
+      return this.createAudio(layer);
+    case 13:
+      return this.createCamera(layer);
+    default:
+      return this.createNull(layer);
+  }
+};
+
+BaseRenderer.prototype.createCamera = function () {
+  throw new Error('You\'re using a 3d camera. Try the html renderer.');
+};
+
+BaseRenderer.prototype.createAudio = function (data) {
+  return new AudioElement(data, this.globalData, this);
+};
+
+BaseRenderer.prototype.buildAllItems = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    this.buildItem(i);
+  }
+  this.checkPendingElements();
+};
+
+BaseRenderer.prototype.includeLayers = function (newLayers) {
+  this.completeLayers = false;
+  var i;
+  var len = newLayers.length;
+  var j;
+  var jLen = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    j = 0;
+    while (j < jLen) {
+      if (this.layers[j].id === newLayers[i].id) {
+        this.layers[j] = newLayers[i];
+        break;
+      }
+      j += 1;
+    }
+  }
+};
+
+BaseRenderer.prototype.setProjectInterface = function (pInterface) {
+  this.globalData.projectInterface = pInterface;
+};
+
+BaseRenderer.prototype.initItems = function () {
+  if (!this.globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+};
+BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
+  var elements = this.elements;
+  var layers = this.layers;
+  var i = 0;
+  var len = layers.length;
+  while (i < len) {
+    if (layers[i].ind == parentName) { // eslint-disable-line eqeqeq
+      if (!elements[i] || elements[i] === true) {
+        this.buildItem(i);
+        this.addPendingElement(element);
+      } else {
+        hierarchy.push(elements[i]);
+        elements[i].setAsParent();
+        if (layers[i].parent !== undefined) {
+          this.buildElementParenting(element, layers[i].parent, hierarchy);
+        } else {
+          element.setHierarchy(hierarchy);
         }
+      }
     }
+    i += 1;
+  }
 };
 
-BaseRenderer.prototype.setProjectInterface = function(pInterface){
-    this.globalData.projectInterface = pInterface;
+BaseRenderer.prototype.addPendingElement = function (element) {
+  this.pendingElements.push(element);
 };
 
-BaseRenderer.prototype.initItems = function(){
-    if(!this.globalData.progressiveLoad){
-        this.buildAllItems();
+BaseRenderer.prototype.searchExtraCompositions = function (assets) {
+  var i;
+  var len = assets.length;
+  for (i = 0; i < len; i += 1) {
+    if (assets[i].xt) {
+      var comp = this.createComp(assets[i]);
+      comp.initExpressions();
+      this.globalData.projectInterface.registerComposition(comp);
     }
-};
-BaseRenderer.prototype.buildElementParenting = function(element, parentName, hierarchy) {
-    var elements = this.elements;
-    var layers = this.layers;
-    var i=0, len = layers.length;
-    while (i < len) {
-        if (layers[i].ind == parentName) {
-            if (!elements[i] || elements[i] === true) {
-                this.buildItem(i);
-                this.addPendingElement(element);
-            } else {
-                hierarchy.push(elements[i]);
-                elements[i].setAsParent();
-                if(layers[i].parent !== undefined) {
-                    this.buildElementParenting(element, layers[i].parent, hierarchy);
-                } else {
-                    element.setHierarchy(hierarchy);
-                }
-            }
-        }
-        i += 1;
-    }
+  }
 };
 
-BaseRenderer.prototype.addPendingElement = function(element){
-    this.pendingElements.push(element);
+BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
+  this.globalData.fontManager = new FontManager();
+  this.globalData.fontManager.addChars(animData.chars);
+  this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
+  this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
+  this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
+  this.globalData.imageLoader = this.animationItem.imagePreloader;
+  this.globalData.audioController = this.animationItem.audioController;
+  this.globalData.frameId = 0;
+  this.globalData.frameRate = animData.fr;
+  this.globalData.nm = animData.nm;
+  this.globalData.compSize = {
+    w: animData.w,
+    h: animData.h,
+  };
 };
 
-BaseRenderer.prototype.searchExtraCompositions = function(assets){
-    var i, len = assets.length;
-    for(i=0;i<len;i+=1){
-        if(assets[i].xt){
-            var comp = this.createComp(assets[i]);
-            comp.initExpressions();
-            this.globalData.projectInterface.registerComposition(comp);
-        }
-    }
-};
+/* global createElementID, extendPrototype, BaseRenderer, NullElement, SVGShapeElement, SVGTextLottieElement,
+IImageElement, SVGCompElement, ISolidElement, createNS, locationHref, createSizedArray, expressionsPlugin */
 
-BaseRenderer.prototype.setupGlobalData = function(animData, fontsContainer) {
-    this.globalData.fontManager = new FontManager();
-    this.globalData.fontManager.addChars(animData.chars);
-    this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
-    this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
-    this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
-    this.globalData.imageLoader = this.animationItem.imagePreloader;
-    this.globalData.audioController = this.animationItem.audioController;
-    this.globalData.frameId = 0;
-    this.globalData.frameRate = animData.fr;
-    this.globalData.nm = animData.nm;
-    this.globalData.compSize = {
-        w: animData.w,
-        h: animData.h
-    }
-}
-function SVGRenderer(animationItem, config){
-    this.animationItem = animationItem;
-    this.layers = null;
-    this.renderedFrame = -1;
-    this.svgElement = createNS('svg');
-    var ariaLabel = '';
-    if (config && config.title) {
-        var titleElement = createNS('title');
-        var titleId = createElementID();
-        titleElement.setAttribute('id', titleId);
-        titleElement.textContent = config.title;
-        this.svgElement.appendChild(titleElement);
-        ariaLabel += titleId;
-    }
-    if (config && config.description) {
-        var descElement = createNS('desc');
-        var descId = createElementID();
-        descElement.setAttribute('id', descId);
-        descElement.textContent = config.description;
-        this.svgElement.appendChild(descElement);
-        ariaLabel += ' ' + descId;
-    }
-    if (ariaLabel) {
-        this.svgElement.setAttribute('aria-labelledby', ariaLabel)
-    }
-    var defs = createNS( 'defs');
-    this.svgElement.appendChild(defs);
-    var maskElement = createNS('g');
-    this.svgElement.appendChild(maskElement);
-    this.layerElement = maskElement;
-    this.renderConfig = {
-        preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
-        imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
-        progressiveLoad: (config && config.progressiveLoad) || false,
-        hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true,
-        viewBoxOnly: (config && config.viewBoxOnly) || false,
-        viewBoxSize: (config && config.viewBoxSize) || false,
-        className: (config && config.className) || '',
-        id: (config && config.id) || '',
-        focusable: config && config.focusable,
-        filterSize: {
-            width: config && config.filterSize && config.filterSize.width || '100%',
-            height: config && config.filterSize && config.filterSize.height || '100%',
-            x: config && config.filterSize && config.filterSize.x || '0%',
-            y: config && config.filterSize && config.filterSize.y || '0%',
-        }
-    };
+function SVGRenderer(animationItem, config) {
+  this.animationItem = animationItem;
+  this.layers = null;
+  this.renderedFrame = -1;
+  this.svgElement = createNS('svg');
+  var ariaLabel = '';
+  if (config && config.title) {
+    var titleElement = createNS('title');
+    var titleId = createElementID();
+    titleElement.setAttribute('id', titleId);
+    titleElement.textContent = config.title;
+    this.svgElement.appendChild(titleElement);
+    ariaLabel += titleId;
+  }
+  if (config && config.description) {
+    var descElement = createNS('desc');
+    var descId = createElementID();
+    descElement.setAttribute('id', descId);
+    descElement.textContent = config.description;
+    this.svgElement.appendChild(descElement);
+    ariaLabel += ' ' + descId;
+  }
+  if (ariaLabel) {
+    this.svgElement.setAttribute('aria-labelledby', ariaLabel);
+  }
+  var defs = createNS('defs');
+  this.svgElement.appendChild(defs);
+  var maskElement = createNS('g');
+  this.svgElement.appendChild(maskElement);
+  this.layerElement = maskElement;
+  this.renderConfig = {
+    preserveAspectRatio: (config && config.preserveAspectRatio) || 'xMidYMid meet',
+    imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice',
+    progressiveLoad: (config && config.progressiveLoad) || false,
+    hideOnTransparent: !((config && config.hideOnTransparent === false)),
+    viewBoxOnly: (config && config.viewBoxOnly) || false,
+    viewBoxSize: (config && config.viewBoxSize) || false,
+    className: (config && config.className) || '',
+    id: (config && config.id) || '',
+    focusable: config && config.focusable,
+    filterSize: {
+      width: (config && config.filterSize && config.filterSize.width) || '100%',
+      height: (config && config.filterSize && config.filterSize.height) || '100%',
+      x: (config && config.filterSize && config.filterSize.x) || '0%',
+      y: (config && config.filterSize && config.filterSize.y) || '0%',
+    },
+  };
 
-    this.globalData = {
-        _mdf: false,
-        frameNum: -1,
-        defs: defs,
-        renderConfig: this.renderConfig
-    };
-    this.elements = [];
-    this.pendingElements = [];
-    this.destroyed = false;
-    this.rendererType = 'svg';
-
+  this.globalData = {
+    _mdf: false,
+    frameNum: -1,
+    defs: defs,
+    renderConfig: this.renderConfig,
+  };
+  this.elements = [];
+  this.pendingElements = [];
+  this.destroyed = false;
+  this.rendererType = 'svg';
 }
 
-extendPrototype([BaseRenderer],SVGRenderer);
+extendPrototype([BaseRenderer], SVGRenderer);
 
 SVGRenderer.prototype.createNull = function (data) {
-    return new NullElement(data,this.globalData,this);
+  return new NullElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createShape = function (data) {
-    return new SVGShapeElement(data,this.globalData,this);
+  return new SVGShapeElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createText = function (data) {
-    return new SVGTextElement(data,this.globalData,this);
-
+  return new SVGTextLottieElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createImage = function (data) {
-    return new IImageElement(data,this.globalData,this);
+  return new IImageElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createComp = function (data) {
-    return new SVGCompElement(data,this.globalData,this);
-
+  return new SVGCompElement(data, this.globalData, this);
 };
 
 SVGRenderer.prototype.createSolid = function (data) {
-    return new ISolidElement(data,this.globalData,this);
+  return new ISolidElement(data, this.globalData, this);
 };
 
-SVGRenderer.prototype.configAnimation = function(animData){
-    this.svgElement.setAttribute('xmlns','http://www.w3.org/2000/svg');
-    if(this.renderConfig.viewBoxSize) {
-        this.svgElement.setAttribute('viewBox',this.renderConfig.viewBoxSize);
-    } else {
-        this.svgElement.setAttribute('viewBox','0 0 '+animData.w+' '+animData.h);
-    }
+SVGRenderer.prototype.configAnimation = function (animData) {
+  this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+  if (this.renderConfig.viewBoxSize) {
+    this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
+  } else {
+    this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
+  }
 
-    if(!this.renderConfig.viewBoxOnly) {
-        this.svgElement.setAttribute('width',animData.w);
-        this.svgElement.setAttribute('height',animData.h);
-        this.svgElement.style.width = '100%';
-        this.svgElement.style.height = '100%';
-        this.svgElement.style.transform = 'translate3d(0,0,0)';
-    }
-    if (this.renderConfig.className) {
-        this.svgElement.setAttribute('class', this.renderConfig.className);
-    }
-    if (this.renderConfig.id) {
-        this.svgElement.setAttribute('id', this.renderConfig.id);
-    }
-    if (this.renderConfig.focusable !== undefined) {
-        this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
-    }
-    this.svgElement.setAttribute('preserveAspectRatio',this.renderConfig.preserveAspectRatio);
-    //this.layerElement.style.transform = 'translate3d(0,0,0)';
-    //this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
-    this.animationItem.wrapper.appendChild(this.svgElement);
-    //Mask animation
-    var defs = this.globalData.defs;
+  if (!this.renderConfig.viewBoxOnly) {
+    this.svgElement.setAttribute('width', animData.w);
+    this.svgElement.setAttribute('height', animData.h);
+    this.svgElement.style.width = '100%';
+    this.svgElement.style.height = '100%';
+    this.svgElement.style.transform = 'translate3d(0,0,0)';
+  }
+  if (this.renderConfig.className) {
+    this.svgElement.setAttribute('class', this.renderConfig.className);
+  }
+  if (this.renderConfig.id) {
+    this.svgElement.setAttribute('id', this.renderConfig.id);
+  }
+  if (this.renderConfig.focusable !== undefined) {
+    this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
+  }
+  this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio);
+  // this.layerElement.style.transform = 'translate3d(0,0,0)';
+  // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
+  this.animationItem.wrapper.appendChild(this.svgElement);
+  // Mask animation
+  var defs = this.globalData.defs;
 
-    this.setupGlobalData(animData, defs);
-    this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
-    this.data = animData;
+  this.setupGlobalData(animData, defs);
+  this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
+  this.data = animData;
 
-    var maskElement = createNS( 'clipPath');
-    var rect = createNS('rect');
-    rect.setAttribute('width',animData.w);
-    rect.setAttribute('height',animData.h);
-    rect.setAttribute('x',0);
-    rect.setAttribute('y',0);
-    var maskId = createElementID();
-    maskElement.setAttribute('id', maskId);
-    maskElement.appendChild(rect);
-    this.layerElement.setAttribute("clip-path", "url(" + locationHref + "#"+maskId+")");
+  var maskElement = createNS('clipPath');
+  var rect = createNS('rect');
+  rect.setAttribute('width', animData.w);
+  rect.setAttribute('height', animData.h);
+  rect.setAttribute('x', 0);
+  rect.setAttribute('y', 0);
+  var maskId = createElementID();
+  maskElement.setAttribute('id', maskId);
+  maskElement.appendChild(rect);
+  this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + maskId + ')');
 
-    defs.appendChild(maskElement);
-    this.layers = animData.layers;
-    this.elements = createSizedArray(animData.layers.length);
+  defs.appendChild(maskElement);
+  this.layers = animData.layers;
+  this.elements = createSizedArray(animData.layers.length);
 };
 
-
 SVGRenderer.prototype.destroy = function () {
-    if (this.animationItem.wrapper) {
-        this.animationItem.wrapper.innerText = '';
+  if (this.animationItem.wrapper) {
+    this.animationItem.wrapper.innerText = '';
+  }
+  this.layerElement = null;
+  this.globalData.defs = null;
+  var i;
+  var len = this.layers ? this.layers.length : 0;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
-    this.layerElement = null;
-    this.globalData.defs = null;
-    var i, len = this.layers ? this.layers.length : 0;
-    for (i = 0; i < len; i++) {
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
-    }
-    this.elements.length = 0;
-    this.destroyed = true;
-    this.animationItem = null;
+  }
+  this.elements.length = 0;
+  this.destroyed = true;
+  this.animationItem = null;
 };
 
 SVGRenderer.prototype.updateContainerSize = function () {
 };
 
-SVGRenderer.prototype.buildItem  = function(pos){
-    var elements = this.elements;
-    if(elements[pos] || this.layers[pos].ty == 99){
-        return;
-    }
-    elements[pos] = true;
-    var element = this.createItem(this.layers[pos]);
+SVGRenderer.prototype.buildItem = function (pos) {
+  var elements = this.elements;
+  if (elements[pos] || this.layers[pos].ty === 99) {
+    return;
+  }
+  elements[pos] = true;
+  var element = this.createItem(this.layers[pos]);
 
-    elements[pos] = element;
-    if(expressionsPlugin){
-        if(this.layers[pos].ty === 0){
-            this.globalData.projectInterface.registerComposition(element);
-        }
-        element.initExpressions();
+  elements[pos] = element;
+  if (expressionsPlugin) {
+    if (this.layers[pos].ty === 0) {
+      this.globalData.projectInterface.registerComposition(element);
     }
-    this.appendElementInPos(element,pos);
-    if(this.layers[pos].tt){
-        if(!this.elements[pos - 1] || this.elements[pos - 1] === true){
-            this.buildItem(pos - 1);
-            this.addPendingElement(element);
-        } else {
-            element.setMatte(elements[pos - 1].layerId);
-        }
+    element.initExpressions();
+  }
+  this.appendElementInPos(element, pos);
+  if (this.layers[pos].tt) {
+    if (!this.elements[pos - 1] || this.elements[pos - 1] === true) {
+      this.buildItem(pos - 1);
+      this.addPendingElement(element);
+    } else {
+      element.setMatte(elements[pos - 1].layerId);
     }
+  }
 };
 
-SVGRenderer.prototype.checkPendingElements  = function(){
-    while(this.pendingElements.length){
-        var element = this.pendingElements.pop();
-        element.checkParenting();
-        if(element.data.tt){
-            var i = 0, len = this.elements.length;
-            while(i<len){
-                if(this.elements[i] === element){
-                    element.setMatte(this.elements[i - 1].layerId);
-                    break;
-                }
-                i += 1;
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.renderFrame = function(num){
-    if(this.renderedFrame === num || this.destroyed){
-        return;
-    }
-    if(num === null){
-        num = this.renderedFrame;
-    }else{
-        this.renderedFrame = num;
-    }
-    // console.log('-------');
-    // console.log('FRAME ',num);
-    this.globalData.frameNum = num;
-    this.globalData.frameId += 1;
-    this.globalData.projectInterface.currentFrame = num;
-    this.globalData._mdf = false;
-    var i, len = this.layers.length;
-    if(!this.completeLayers){
-        this.checkLayers(num);
-    }
-    for (i = len - 1; i >= 0; i--) {
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(num - this.layers[i].st);
-        }
-    }
-    if(this.globalData._mdf) {
-        for (i = 0; i < len; i += 1) {
-            if(this.completeLayers || this.elements[i]){
-                this.elements[i].renderFrame();
-            }
-        }
-    }
-};
-
-SVGRenderer.prototype.appendElementInPos = function(element, pos){
-    var newElement = element.getBaseElement();
-    if(!newElement){
-        return;
-    }
-    var i = 0;
-    var nextElement;
-    while(i<pos){
-        if(this.elements[i] && this.elements[i]!== true && this.elements[i].getBaseElement()){
-            nextElement = this.elements[i].getBaseElement();
+SVGRenderer.prototype.checkPendingElements = function () {
+  while (this.pendingElements.length) {
+    var element = this.pendingElements.pop();
+    element.checkParenting();
+    if (element.data.tt) {
+      var i = 0;
+      var len = this.elements.length;
+      while (i < len) {
+        if (this.elements[i] === element) {
+          element.setMatte(this.elements[i - 1].layerId);
+          break;
         }
         i += 1;
+      }
     }
-    if(nextElement){
-        this.layerElement.insertBefore(newElement, nextElement);
+  }
+};
+
+SVGRenderer.prototype.renderFrame = function (num) {
+  if (this.renderedFrame === num || this.destroyed) {
+    return;
+  }
+  if (num === null) {
+    num = this.renderedFrame;
+  } else {
+    this.renderedFrame = num;
+  }
+  // console.log('-------');
+  // console.log('FRAME ',num);
+  this.globalData.frameNum = num;
+  this.globalData.frameId += 1;
+  this.globalData.projectInterface.currentFrame = num;
+  this.globalData._mdf = false;
+  var i;
+  var len = this.layers.length;
+  if (!this.completeLayers) {
+    this.checkLayers(num);
+  }
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(num - this.layers[i].st);
+    }
+  }
+  if (this.globalData._mdf) {
+    for (i = 0; i < len; i += 1) {
+      if (this.completeLayers || this.elements[i]) {
+        this.elements[i].renderFrame();
+      }
+    }
+  }
+};
+
+SVGRenderer.prototype.appendElementInPos = function (element, pos) {
+  var newElement = element.getBaseElement();
+  if (!newElement) {
+    return;
+  }
+  var i = 0;
+  var nextElement;
+  while (i < pos) {
+    if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
+      nextElement = this.elements[i].getBaseElement();
+    }
+    i += 1;
+  }
+  if (nextElement) {
+    this.layerElement.insertBefore(newElement, nextElement);
+  } else {
+    this.layerElement.appendChild(newElement);
+  }
+};
+
+SVGRenderer.prototype.hide = function () {
+  this.layerElement.style.display = 'none';
+};
+
+SVGRenderer.prototype.show = function () {
+  this.layerElement.style.display = 'block';
+};
+
+/* global createSizedArray, createElementID, PropertyFactory, ShapePropertyFactory, createNS, locationHref */
+
+function MaskElement(data, element, globalData) {
+  this.data = data;
+  this.element = element;
+  this.globalData = globalData;
+  this.storedData = [];
+  this.masksProperties = this.data.masksProperties || [];
+  this.maskElement = null;
+  var defs = this.globalData.defs;
+  var i;
+  var len = this.masksProperties ? this.masksProperties.length : 0;
+  this.viewData = createSizedArray(len);
+  this.solidPath = '';
+
+  var path;
+  var properties = this.masksProperties;
+  var count = 0;
+  var currentMasks = [];
+  var j;
+  var jLen;
+  var layerId = createElementID();
+  var rect;
+  var expansor;
+  var feMorph;
+  var x;
+  var maskType = 'clipPath';
+  var maskRef = 'clip-path';
+  for (i = 0; i < len; i += 1) {
+    if ((properties[i].mode !== 'a' && properties[i].mode !== 'n') || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
+      maskType = 'mask';
+      maskRef = 'mask';
+    }
+
+    if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
+      rect = createNS('rect');
+      rect.setAttribute('fill', '#ffffff');
+      rect.setAttribute('width', this.element.comp.data.w || 0);
+      rect.setAttribute('height', this.element.comp.data.h || 0);
+      currentMasks.push(rect);
     } else {
-        this.layerElement.appendChild(newElement);
-    }
-};
-
-SVGRenderer.prototype.hide = function(){
-    this.layerElement.style.display = 'none';
-};
-
-SVGRenderer.prototype.show = function(){
-    this.layerElement.style.display = 'block';
-};
-
-function MaskElement(data,element,globalData) {
-    this.data = data;
-    this.element = element;
-    this.globalData = globalData;
-    this.storedData = [];
-    this.masksProperties = this.data.masksProperties || [];
-    this.maskElement = null;
-    var defs = this.globalData.defs;
-    var i, len = this.masksProperties ? this.masksProperties.length : 0;
-    this.viewData = createSizedArray(len);
-    this.solidPath = '';
-
-
-    var path, properties = this.masksProperties;
-    var count = 0;
-    var currentMasks = [];
-    var j, jLen;
-    var layerId = createElementID();
-    var rect, expansor, feMorph,x;
-    var maskType = 'clipPath', maskRef = 'clip-path';
-    for (i = 0; i < len; i++) {
-        if((properties[i].mode !== 'a' && properties[i].mode !== 'n')|| properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x){
-            maskType = 'mask';
-            maskRef = 'mask';
-        }
-
-        if((properties[i].mode == 's' || properties[i].mode == 'i') && count === 0){
-            rect = createNS( 'rect');
-            rect.setAttribute('fill', '#ffffff');
-            rect.setAttribute('width', this.element.comp.data.w || 0);
-            rect.setAttribute('height', this.element.comp.data.h || 0);
-            currentMasks.push(rect);
-        } else {
-            rect = null;
-        }
-
-        path = createNS( 'path');
-        if(properties[i].mode == 'n') {
-            // TODO move this to a factory or to a constructor
-            this.viewData[i] = {
-                op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-                prop: ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-                elem: path,
-                lastPath: ''
-            };
-            defs.appendChild(path);
-            continue;
-        }
-        count += 1;
-
-        path.setAttribute('fill', properties[i].mode === 's' ? '#000000':'#ffffff');
-        path.setAttribute('clip-rule','nonzero');
-        var filterID;
-
-        if (properties[i].x.k !== 0) {
-            maskType = 'mask';
-            maskRef = 'mask';
-            x = PropertyFactory.getProp(this.element,properties[i].x,0,null,this.element);
-            filterID = createElementID();
-            expansor = createNS('filter');
-            expansor.setAttribute('id',filterID);
-            feMorph = createNS('feMorphology');
-            feMorph.setAttribute('operator','erode');
-            feMorph.setAttribute('in','SourceGraphic');
-            feMorph.setAttribute('radius','0');
-            expansor.appendChild(feMorph);
-            defs.appendChild(expansor);
-            path.setAttribute('stroke', properties[i].mode === 's' ? '#000000':'#ffffff');
-        } else {
-            feMorph = null;
-            x = null;
-        }
-
-        // TODO move this to a factory or to a constructor
-        this.storedData[i] = {
-             elem: path,
-             x: x,
-             expan: feMorph,
-            lastPath: '',
-            lastOperator:'',
-            filterId:filterID,
-            lastRadius:0
-        };
-        if(properties[i].mode == 'i'){
-            jLen = currentMasks.length;
-            var g = createNS('g');
-            for(j=0;j<jLen;j+=1){
-                g.appendChild(currentMasks[j]);
-            }
-            var mask = createNS('mask');
-            mask.setAttribute('mask-type','alpha');
-            mask.setAttribute('id',layerId+'_'+count);
-            mask.appendChild(path);
-            defs.appendChild(mask);
-            g.setAttribute('mask','url(' + locationHref + '#'+layerId+'_'+count+')');
-
-            currentMasks.length = 0;
-            currentMasks.push(g);
-        }else{
-            currentMasks.push(path);
-        }
-        if(properties[i].inv && !this.solidPath){
-            this.solidPath = this.createLayerSolidPath();
-        }
-        // TODO move this to a factory or to a constructor
-        this.viewData[i] = {
-            elem: path,
-            lastPath: '',
-            op: PropertyFactory.getProp(this.element,properties[i].o,0,0.01,this.element),
-            prop:ShapePropertyFactory.getShapeProp(this.element,properties[i],3),
-            invRect: rect
-        };
-        if(!this.viewData[i].prop.k){
-            this.drawPath(properties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
+      rect = null;
     }
 
-    this.maskElement = createNS( maskType);
+    path = createNS('path');
+    if (properties[i].mode === 'n') {
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        elem: path,
+        lastPath: '',
+      };
+      defs.appendChild(path);
+    } else {
+      count += 1;
 
-    len = currentMasks.length;
-    for(i=0;i<len;i+=1){
-        this.maskElement.appendChild(currentMasks[i]);
-    }
+      path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      path.setAttribute('clip-rule', 'nonzero');
+      var filterID;
 
-    if(count > 0){
-        this.maskElement.setAttribute('id', layerId);
-        this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")");
-        defs.appendChild(this.maskElement);
-    }
-    if (this.viewData.length) {
-        this.element.addRenderableComponent(this);
-    }
+      if (properties[i].x.k !== 0) {
+        maskType = 'mask';
+        maskRef = 'mask';
+        x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
+        filterID = createElementID();
+        expansor = createNS('filter');
+        expansor.setAttribute('id', filterID);
+        feMorph = createNS('feMorphology');
+        feMorph.setAttribute('operator', 'erode');
+        feMorph.setAttribute('in', 'SourceGraphic');
+        feMorph.setAttribute('radius', '0');
+        expansor.appendChild(feMorph);
+        defs.appendChild(expansor);
+        path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
+      } else {
+        feMorph = null;
+        x = null;
+      }
 
+      // TODO move this to a factory or to a constructor
+      this.storedData[i] = {
+        elem: path,
+        x: x,
+        expan: feMorph,
+        lastPath: '',
+        lastOperator: '',
+        filterId: filterID,
+        lastRadius: 0,
+      };
+      if (properties[i].mode === 'i') {
+        jLen = currentMasks.length;
+        var g = createNS('g');
+        for (j = 0; j < jLen; j += 1) {
+          g.appendChild(currentMasks[j]);
+        }
+        var mask = createNS('mask');
+        mask.setAttribute('mask-type', 'alpha');
+        mask.setAttribute('id', layerId + '_' + count);
+        mask.appendChild(path);
+        defs.appendChild(mask);
+        g.setAttribute('mask', 'url(' + locationHref + '#' + layerId + '_' + count + ')');
+
+        currentMasks.length = 0;
+        currentMasks.push(g);
+      } else {
+        currentMasks.push(path);
+      }
+      if (properties[i].inv && !this.solidPath) {
+        this.solidPath = this.createLayerSolidPath();
+      }
+      // TODO move this to a factory or to a constructor
+      this.viewData[i] = {
+        elem: path,
+        lastPath: '',
+        op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
+        prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
+        invRect: rect,
+      };
+      if (!this.viewData[i].prop.k) {
+        this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
+      }
+    }
+  }
+
+  this.maskElement = createNS(maskType);
+
+  len = currentMasks.length;
+  for (i = 0; i < len; i += 1) {
+    this.maskElement.appendChild(currentMasks[i]);
+  }
+
+  if (count > 0) {
+    this.maskElement.setAttribute('id', layerId);
+    this.element.maskedElement.setAttribute(maskRef, 'url(' + locationHref + '#' + layerId + ')');
+    defs.appendChild(this.maskElement);
+  }
+  if (this.viewData.length) {
+    this.element.addRenderableComponent(this);
+  }
 }
 
-MaskElement.prototype.getMaskProperty = function(pos){
-    return this.viewData[pos].prop;
+MaskElement.prototype.getMaskProperty = function (pos) {
+  return this.viewData[pos].prop;
 };
 
 MaskElement.prototype.renderFrame = function (isFirstFrame) {
-    var finalMat = this.element.finalTransform.mat;
-    var i, len = this.masksProperties.length;
-    for (i = 0; i < len; i++) {
-        if(this.viewData[i].prop._mdf || isFirstFrame){
-            this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]);
-        }
-        if(this.viewData[i].op._mdf || isFirstFrame){
-            this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v);
-        }
-        if(this.masksProperties[i].mode !== 'n'){
-            if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){
-                this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS())
-            }
-            if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){
-                var feMorph = this.storedData[i].expan;
-                if(this.storedData[i].x.v < 0){
-                    if(this.storedData[i].lastOperator !== 'erode'){
-                        this.storedData[i].lastOperator = 'erode';
-                        this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')');
-                    }
-                    feMorph.setAttribute('radius',-this.storedData[i].x.v);
-                }else{
-                    if(this.storedData[i].lastOperator !== 'dilate'){
-                        this.storedData[i].lastOperator = 'dilate';
-                        this.storedData[i].elem.setAttribute('filter',null);
-                    }
-                    this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2);
-
-                }
-            }
-        }
+  var finalMat = this.element.finalTransform.mat;
+  var i;
+  var len = this.masksProperties.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.viewData[i].prop._mdf || isFirstFrame) {
+      this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
     }
+    if (this.viewData[i].op._mdf || isFirstFrame) {
+      this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
+    }
+    if (this.masksProperties[i].mode !== 'n') {
+      if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
+        this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
+      }
+      if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
+        var feMorph = this.storedData[i].expan;
+        if (this.storedData[i].x.v < 0) {
+          if (this.storedData[i].lastOperator !== 'erode') {
+            this.storedData[i].lastOperator = 'erode';
+            this.storedData[i].elem.setAttribute('filter', 'url(' + locationHref + '#' + this.storedData[i].filterId + ')');
+          }
+          feMorph.setAttribute('radius', -this.storedData[i].x.v);
+        } else {
+          if (this.storedData[i].lastOperator !== 'dilate') {
+            this.storedData[i].lastOperator = 'dilate';
+            this.storedData[i].elem.setAttribute('filter', null);
+          }
+          this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
+        }
+      }
+    }
+  }
 };
 
 MaskElement.prototype.getMaskelement = function () {
-    return this.maskElement;
+  return this.maskElement;
 };
 
-MaskElement.prototype.createLayerSolidPath = function(){
-    var path = 'M0,0 ';
-    path += ' h' + this.globalData.compSize.w ;
-    path += ' v' + this.globalData.compSize.h ;
-    path += ' h-' + this.globalData.compSize.w ;
-    path += ' v-' + this.globalData.compSize.h + ' ';
-    return path;
+MaskElement.prototype.createLayerSolidPath = function () {
+  var path = 'M0,0 ';
+  path += ' h' + this.globalData.compSize.w;
+  path += ' v' + this.globalData.compSize.h;
+  path += ' h-' + this.globalData.compSize.w;
+  path += ' v-' + this.globalData.compSize.h + ' ';
+  return path;
 };
 
-MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){
-    var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1];
-    var i, len;
-    len = pathNodes._length;
-    for(i=1;i<len;i+=1){
-        //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];
-        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];
-    }
-        //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];
-    if(pathNodes.c && len > 1){
-        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];
-    }
-    //pathNodes.__renderedString = pathString;
+MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
+  var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
+  var i;
+  var len;
+  len = pathNodes._length;
+  for (i = 1; i < len; i += 1) {
+    // 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];
+    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];
+  }
+  // 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];
+  if (pathNodes.c && len > 1) {
+    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];
+  }
+  // pathNodes.__renderedString = pathString;
 
-    if(viewData.lastPath !== pathString){
-        var pathShapeValue = '';
-        if(viewData.elem){
-            if(pathNodes.c){
-                pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
-            }
-            viewData.elem.setAttribute('d',pathShapeValue);
-        }
-        viewData.lastPath = pathString;
+  if (viewData.lastPath !== pathString) {
+    var pathShapeValue = '';
+    if (viewData.elem) {
+      if (pathNodes.c) {
+        pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
+      }
+      viewData.elem.setAttribute('d', pathShapeValue);
     }
+    viewData.lastPath = pathString;
+  }
 };
 
-MaskElement.prototype.destroy = function(){
-    this.element = null;
-    this.globalData = null;
-    this.maskElement = null;
-    this.data = null;
-    this.masksProperties = null;
+MaskElement.prototype.destroy = function () {
+  this.element = null;
+  this.globalData = null;
+  this.maskElement = null;
+  this.data = null;
+  this.masksProperties = null;
 };
 
 /**
- * @file 
+ * @file
  * Handles AE's layer parenting property.
  *
  */
 
-function HierarchyElement(){}
+function HierarchyElement() {}
 
 HierarchyElement.prototype = {
-	/**
-     * @function 
+  /**
+     * @function
      * Initializes hierarchy properties
      *
      */
-	initHierarchy: function() {
-		//element's parent list
-	    this.hierarchy = [];
-	    //if element is parent of another layer _isParent will be true
-	    this._isParent = false;
-	    this.checkParenting();
-	},
-	/**
-     * @function 
+  initHierarchy: function () {
+    // element's parent list
+    this.hierarchy = [];
+    // if element is parent of another layer _isParent will be true
+    this._isParent = false;
+    this.checkParenting();
+  },
+  /**
+     * @function
      * Sets layer's hierarchy.
      * @param {array} hierarch
      * layer's parent list
      *
-     */ 
-	setHierarchy: function(hierarchy){
-	    this.hierarchy = hierarchy;
-	},
-	/**
-     * @function 
+     */
+  setHierarchy: function (hierarchy) {
+    this.hierarchy = hierarchy;
+  },
+  /**
+     * @function
      * Sets layer as parent.
      *
-     */ 
-	setAsParent: function() {
-	    this._isParent = true;
-	},
-	/**
-     * @function 
+     */
+  setAsParent: function () {
+    this._isParent = true;
+  },
+  /**
+     * @function
      * Searches layer's parenting chain
      *
-     */ 
-	checkParenting: function(){
-	    if (this.data.parent !== undefined){
-	        this.comp.buildElementParenting(this, this.data.parent, []);
-	    }
-	}
+     */
+  checkParenting: function () {
+    if (this.data.parent !== undefined) {
+      this.comp.buildElementParenting(this, this.data.parent, []);
+    }
+  },
 };
+
 /**
- * @file 
+ * @file
  * Handles element's layer frame update.
  * Checks layer in point and out point
  *
  */
 
-function FrameElement(){}
+function FrameElement() {}
 
 FrameElement.prototype = {
-    /**
-     * @function 
+  /**
+     * @function
      * Initializes frame related properties.
      *
      */
-    initFrame: function(){
-        //set to true when inpoint is rendered
-        this._isFirstFrame = false;
-        //list of animated properties
-        this.dynamicProperties = [];
-        // If layer has been modified in current tick this will be true
-        this._mdf = false;
-    },
-    /**
-     * @function 
+  initFrame: function () {
+    // set to true when inpoint is rendered
+    this._isFirstFrame = false;
+    // list of animated properties
+    this.dynamicProperties = [];
+    // If layer has been modified in current tick this will be true
+    this._mdf = false;
+  },
+  /**
+     * @function
      * Calculates all dynamic values
      *
      * @param {number} num
      * current frame number in Layer's time
      * @param {boolean} isVisible
      * if layers is currently in range
-     * 
+     *
      */
-    prepareProperties: function(num, isVisible) {
-        var i, len = this.dynamicProperties.length;
-        for (i = 0;i < len; i += 1) {
-            if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
-                this.dynamicProperties[i].getValue();
-                if (this.dynamicProperties[i]._mdf) {
-                    this.globalData._mdf = true;
-                    this._mdf = true;
-                }
-            }
+  prepareProperties: function (num, isVisible) {
+    var i;
+    var len = this.dynamicProperties.length;
+    for (i = 0; i < len; i += 1) {
+      if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
+        this.dynamicProperties[i].getValue();
+        if (this.dynamicProperties[i]._mdf) {
+          this.globalData._mdf = true;
+          this._mdf = true;
         }
-    },
-    addDynamicProperty: function(prop) {
-        if(this.dynamicProperties.indexOf(prop) === -1) {
-            this.dynamicProperties.push(prop);
-        }
+      }
     }
+  },
+  addDynamicProperty: function (prop) {
+    if (this.dynamicProperties.indexOf(prop) === -1) {
+      this.dynamicProperties.push(prop);
+    }
+  },
 };
-function TransformElement(){}
+
+/* global TransformPropertyFactory, Matrix */
+
+function TransformElement() {}
 
 TransformElement.prototype = {
-    initTransform: function() {
-        this.finalTransform = {
-            mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0},
-            _matMdf: false,
-            _opMdf: false,
-            mat: new Matrix()
-        };
-        if (this.data.ao) {
-            this.finalTransform.mProp.autoOriented = true;
-        }
+  initTransform: function () {
+    this.finalTransform = {
+      mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : { o: 0 },
+      _matMdf: false,
+      _opMdf: false,
+      mat: new Matrix(),
+    };
+    if (this.data.ao) {
+      this.finalTransform.mProp.autoOriented = true;
+    }
 
-        //TODO: check TYPE 11: Guided elements
-        if (this.data.ty !== 11) {
-            //this.createElements();
-        }
-    },
-    renderTransform: function() {
+    // TODO: check TYPE 11: Guided elements
+    if (this.data.ty !== 11) {
+      // this.createElements();
+    }
+  },
+  renderTransform: function () {
+    this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
+    this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
 
-        this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
-        this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
+    if (this.hierarchy) {
+      var mat;
+      var finalMat = this.finalTransform.mat;
+      var i = 0;
+      var len = this.hierarchy.length;
+      // Checking if any of the transformation matrices in the hierarchy chain has changed.
+      if (!this.finalTransform._matMdf) {
+        while (i < len) {
+          if (this.hierarchy[i].finalTransform.mProp._mdf) {
+            this.finalTransform._matMdf = true;
+            break;
+          }
+          i += 1;
+        }
+      }
 
-        if (this.hierarchy) {
-            var mat;
-            var finalMat = this.finalTransform.mat;
-            var i = 0, len = this.hierarchy.length;
-            //Checking if any of the transformation matrices in the hierarchy chain has changed.
-            if (!this.finalTransform._matMdf) {
-                while (i < len) {
-                    if (this.hierarchy[i].finalTransform.mProp._mdf) {
-                        this.finalTransform._matMdf = true;
-                        break;
-                    }
-                    i += 1;
-                }
-            }
-            
-            if (this.finalTransform._matMdf) {
-                mat = this.finalTransform.mProp.v.props;
-                finalMat.cloneFromProps(mat);
-                for (i = 0; i < len; i += 1) {
-                    mat = this.hierarchy[i].finalTransform.mProp.v.props;
-                    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]);
-                }
-            }
-        }
-    },
-    globalToLocal: function(pt) {
-        var transforms = [];
-        transforms.push(this.finalTransform);
-        var flag = true;
-        var comp = this.comp;
-        while (flag) {
-            if (comp.finalTransform) {
-                if (comp.data.hasMask) {
-                    transforms.splice(0, 0, comp.finalTransform);
-                }
-                comp = comp.comp;
-            } else {
-                flag = false;
-            }
-        }
-        var i, len = transforms.length,ptNew;
+      if (this.finalTransform._matMdf) {
+        mat = this.finalTransform.mProp.v.props;
+        finalMat.cloneFromProps(mat);
         for (i = 0; i < len; i += 1) {
-            ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
-            //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
-            pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+          mat = this.hierarchy[i].finalTransform.mProp.v.props;
+          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]);
         }
-        return pt;
-    },
-    mHelper: new Matrix()
+      }
+    }
+  },
+  globalToLocal: function (pt) {
+    var transforms = [];
+    transforms.push(this.finalTransform);
+    var flag = true;
+    var comp = this.comp;
+    while (flag) {
+      if (comp.finalTransform) {
+        if (comp.data.hasMask) {
+          transforms.splice(0, 0, comp.finalTransform);
+        }
+        comp = comp.comp;
+      } else {
+        flag = false;
+      }
+    }
+    var i;
+    var len = transforms.length;
+    var ptNew;
+    for (i = 0; i < len; i += 1) {
+      ptNew = transforms[i].mat.applyToPointArray(0, 0, 0);
+      // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
+      pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
+    }
+    return pt;
+  },
+  mHelper: new Matrix(),
 };
-function RenderableElement(){
+
+function RenderableElement() {
 
 }
 
 RenderableElement.prototype = {
-    initRenderable: function() {
-        //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
-        this.isInRange = false;
-        //layer's display state
-        this.hidden = false;
-        // If layer's transparency equals 0, it can be hidden
-        this.isTransparent = false;
-        //list of animated components
-        this.renderableComponents = [];
-    },
-    addRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) === -1) {
-            this.renderableComponents.push(component);
-        }
-    },
-    removeRenderableComponent: function(component) {
-        if(this.renderableComponents.indexOf(component) !== -1) {
-            this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
-        }
-    },
-    prepareRenderableFrame: function(num) {
-        this.checkLayerLimits(num);
-    },
-    checkTransparency: function(){
-        if(this.finalTransform.mProp.o.v <= 0) {
-            if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){
-                this.isTransparent = true;
-                this.hide();
-            }
-        } else if(this.isTransparent) {
-            this.isTransparent = false;
-            this.show();
-        }
-    },
-    /**
-     * @function 
+  initRenderable: function () {
+    // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
+    this.isInRange = false;
+    // layer's display state
+    this.hidden = false;
+    // If layer's transparency equals 0, it can be hidden
+    this.isTransparent = false;
+    // list of animated components
+    this.renderableComponents = [];
+  },
+  addRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) === -1) {
+      this.renderableComponents.push(component);
+    }
+  },
+  removeRenderableComponent: function (component) {
+    if (this.renderableComponents.indexOf(component) !== -1) {
+      this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
+    }
+  },
+  prepareRenderableFrame: function (num) {
+    this.checkLayerLimits(num);
+  },
+  checkTransparency: function () {
+    if (this.finalTransform.mProp.o.v <= 0) {
+      if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
+        this.isTransparent = true;
+        this.hide();
+      }
+    } else if (this.isTransparent) {
+      this.isTransparent = false;
+      this.show();
+    }
+  },
+  /**
+     * @function
      * Initializes frame related properties.
      *
      * @param {number} num
      * current frame number in Layer's time
-     * 
+     *
      */
-    checkLayerLimits: function(num) {
-        if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num)
-        {
-            if(this.isInRange !== true){
-                this.globalData._mdf = true;
-                this._mdf = true;
-                this.isInRange = true;
-                this.show();
-            }
-        } else {
-            if(this.isInRange !== false){
-                this.globalData._mdf = true;
-                this.isInRange = false;
-                this.hide();
-            }
-        }
-    },
-    renderRenderable: function() {
-        var i, len = this.renderableComponents.length;
-        for(i = 0; i < len; i += 1) {
-            this.renderableComponents[i].renderFrame(this._isFirstFrame);
-        }
-        /*this.maskManager.renderFrame(this.finalTransform.mat);
-        this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/
-    },
-    sourceRectAtTime: function(){
-        return {
-            top:0,
-            left:0,
-            width:100,
-            height:100
-        };
-    },
-    getLayerSize: function(){
-        if(this.data.ty === 5){
-            return {w:this.data.textData.width,h:this.data.textData.height};
-        }else{
-            return {w:this.data.width,h:this.data.height};
-        }
+  checkLayerLimits: function (num) {
+    if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
+      if (this.isInRange !== true) {
+        this.globalData._mdf = true;
+        this._mdf = true;
+        this.isInRange = true;
+        this.show();
+      }
+    } else if (this.isInRange !== false) {
+      this.globalData._mdf = true;
+      this.isInRange = false;
+      this.hide();
     }
+  },
+  renderRenderable: function () {
+    var i;
+    var len = this.renderableComponents.length;
+    for (i = 0; i < len; i += 1) {
+      this.renderableComponents[i].renderFrame(this._isFirstFrame);
+    }
+    /* this.maskManager.renderFrame(this.finalTransform.mat);
+        this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
+  },
+  sourceRectAtTime: function () {
+    return {
+      top: 0,
+      left: 0,
+      width: 100,
+      height: 100,
+    };
+  },
+  getLayerSize: function () {
+    if (this.data.ty === 5) {
+      return { w: this.data.textData.width, h: this.data.textData.height };
+    }
+    return { w: this.data.width, h: this.data.height };
+  },
 };
+
+/* global extendPrototype, RenderableElement, createProxyFunction */
+
 function RenderableDOMElement() {}
 
-(function(){
-    var _prototype = {
-        initElement: function(data,globalData,comp) {
-            this.initFrame();
-            this.initBaseData(data, globalData, comp);
-            this.initTransform(data, globalData, comp);
-            this.initHierarchy();
-            this.initRenderable();
-            this.initRendererElement();
-            this.createContainerElements();
-            this.createRenderableComponents();
-            this.createContent();
-            this.hide();
-        },
-        hide: function(){
-            if (!this.hidden && (!this.isInRange || this.isTransparent)) {
-                var elem = this.baseElement || this.layerElement;
-                elem.style.display = 'none';
-                this.hidden = true;
-            }
-        },
-        show: function(){
-            if (this.isInRange && !this.isTransparent){
-                if (!this.data.hd) {
-                    var elem = this.baseElement || this.layerElement;
-                    elem.style.display = 'block';
-                }
-                this.hidden = false;
-                this._isFirstFrame = true;
-            }
-        },
-        renderFrame: function() {
-            //If it is exported as hidden (data.hd === true) no need to render
-            //If it is not visible no need to render
-            if (this.data.hd || this.hidden) {
-                return;
-            }
-            this.renderTransform();
-            this.renderRenderable();
-            this.renderElement();
-            this.renderInnerContent();
-            if (this._isFirstFrame) {
-                this._isFirstFrame = false;
-            }
-        },
-        renderInnerContent: function() {},
-        prepareFrame: function(num) {
-            this._mdf = false;
-            this.prepareRenderableFrame(num);
-            this.prepareProperties(num, this.isInRange);
-            this.checkTransparency();
-        },
-        destroy: function(){
-            this.innerElem =  null;
-            this.destroyBaseElement();
+(function () {
+  var _prototype = {
+    initElement: function (data, globalData, comp) {
+      this.initFrame();
+      this.initBaseData(data, globalData, comp);
+      this.initTransform(data, globalData, comp);
+      this.initHierarchy();
+      this.initRenderable();
+      this.initRendererElement();
+      this.createContainerElements();
+      this.createRenderableComponents();
+      this.createContent();
+      this.hide();
+    },
+    hide: function () {
+      if (!this.hidden && (!this.isInRange || this.isTransparent)) {
+        var elem = this.baseElement || this.layerElement;
+        elem.style.display = 'none';
+        this.hidden = true;
+      }
+    },
+    show: function () {
+      if (this.isInRange && !this.isTransparent) {
+        if (!this.data.hd) {
+          var elem = this.baseElement || this.layerElement;
+          elem.style.display = 'block';
         }
-    };
-    extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
+        this.hidden = false;
+        this._isFirstFrame = true;
+      }
+    },
+    renderFrame: function () {
+      // If it is exported as hidden (data.hd === true) no need to render
+      // If it is not visible no need to render
+      if (this.data.hd || this.hidden) {
+        return;
+      }
+      this.renderTransform();
+      this.renderRenderable();
+      this.renderElement();
+      this.renderInnerContent();
+      if (this._isFirstFrame) {
+        this._isFirstFrame = false;
+      }
+    },
+    renderInnerContent: function () {},
+    prepareFrame: function (num) {
+      this._mdf = false;
+      this.prepareRenderableFrame(num);
+      this.prepareProperties(num, this.isInRange);
+      this.checkTransparency();
+    },
+    destroy: function () {
+      this.innerElem = null;
+      this.destroyBaseElement();
+    },
+  };
+  extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
 }());
+
+/* exported ProcessedElement */
+
 function ProcessedElement(element, position) {
-	this.elem = element;
-	this.pos = position;
+  this.elem = element;
+  this.pos = position;
 }
+
+/* global createNS */
+
 function SVGStyleData(data, level) {
-	this.data = data;
-	this.type = data.ty;
-	this.d = '';
-	this.lvl = level;
-	this._mdf = false;
-	this.closed = data.hd === true;
-	this.pElem = createNS('path');
-	this.msElem = null;
+  this.data = data;
+  this.type = data.ty;
+  this.d = '';
+  this.lvl = level;
+  this._mdf = false;
+  this.closed = data.hd === true;
+  this.pElem = createNS('path');
+  this.msElem = null;
 }
 
-SVGStyleData.prototype.reset = function() {
-	this.d = '';
-	this._mdf = false;
+SVGStyleData.prototype.reset = function () {
+  this.d = '';
+  this._mdf = false;
 };
+
 function SVGShapeData(transformers, level, shape) {
-    this.caches = [];
-    this.styles = [];
-    this.transformers = transformers;
-    this.lStr = '';
-    this.sh = shape;
-    this.lvl = level;
-    //TODO find if there are some cases where _isAnimated can be false. 
-    // For now, since shapes add up with other shapes. They have to be calculated every time.
-    // One way of finding out is checking if all styles associated to this shape depend only of this shape
-    this._isAnimated = !!shape.k;
-    // TODO: commenting this for now since all shapes are animated
-    var i = 0, len = transformers.length;
-    while(i < len) {
-    	if(transformers[i].mProps.dynamicProperties.length) {
-    		this._isAnimated = true;
-    		break;
-    	}
-    	i += 1;
+  this.caches = [];
+  this.styles = [];
+  this.transformers = transformers;
+  this.lStr = '';
+  this.sh = shape;
+  this.lvl = level;
+  // TODO find if there are some cases where _isAnimated can be false.
+  // For now, since shapes add up with other shapes. They have to be calculated every time.
+  // One way of finding out is checking if all styles associated to this shape depend only of this shape
+  this._isAnimated = !!shape.k;
+  // TODO: commenting this for now since all shapes are animated
+  var i = 0;
+  var len = transformers.length;
+  while (i < len) {
+    if (transformers[i].mProps.dynamicProperties.length) {
+      this._isAnimated = true;
+      break;
     }
+    i += 1;
+  }
 }
 
-SVGShapeData.prototype.setAsAnimated = function() {
-    this._isAnimated = true;
-}
+SVGShapeData.prototype.setAsAnimated = function () {
+  this._isAnimated = true;
+};
+
+/* exported SVGTransformData */
+
 function SVGTransformData(mProps, op, container) {
-	this.transform = {
-		mProps: mProps,
-		op: op,
-		container: container
-	};
-	this.elements = [];
-    this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
+  this.transform = {
+    mProps: mProps,
+    op: op,
+    container: container,
+  };
+  this.elements = [];
+  this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
 }
-function SVGStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
-    this._isAnimated = !!this._isAnimated;
+
+/* global DashProperty, PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
-function SVGFillStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-	this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
-	this.style = styleOb;
+
+/* global PropertyFactory, extendPrototype, DynamicPropertyContainer */
+
+function SVGFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
+  this.style = styleOb;
 }
 
 extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
-function SVGGradientFillStyleData(elem, data, styleOb){
-    this.initDynamicPropertyContainer(elem);
-    this.getValue = this.iterateDynamicProperties;
-    this.initGradientData(elem, data, styleOb);
+
+/* global PropertyFactory, degToRads, GradientProperty, createElementID, createNS, locationHref,
+extendPrototype, DynamicPropertyContainer */
+
+function SVGGradientFillStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.initGradientData(elem, data, styleOb);
 }
 
-SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){
-    this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
-    this.s = PropertyFactory.getProp(elem,data.s,1,null,this);
-    this.e = PropertyFactory.getProp(elem,data.e,1,null,this);
-    this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this);
-    this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this);
-    this.g = new GradientProperty(elem,data.g,this);
-    this.style = styleOb;
-    this.stops = [];
-    this.setGradientData(styleOb.pElem, data);
-    this.setGradientOpacity(data, styleOb);
-    this._isAnimated = !!this._isAnimated;
-
+SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) {
+  this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
+  this.s = PropertyFactory.getProp(elem, data.s, 1, null, this);
+  this.e = PropertyFactory.getProp(elem, data.e, 1, null, this);
+  this.h = PropertyFactory.getProp(elem, data.h || { k: 0 }, 0, 0.01, this);
+  this.a = PropertyFactory.getProp(elem, data.a || { k: 0 }, 0, degToRads, this);
+  this.g = new GradientProperty(elem, data.g, this);
+  this.style = styleOb;
+  this.stops = [];
+  this.setGradientData(styleOb.pElem, data);
+  this.setGradientOpacity(data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 };
 
-SVGGradientFillStyleData.prototype.setGradientData = function(pathElement,data){
+SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) {
+  var gradientId = createElementID();
+  var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+  gfill.setAttribute('id', gradientId);
+  gfill.setAttribute('spreadMethod', 'pad');
+  gfill.setAttribute('gradientUnits', 'userSpaceOnUse');
+  var stops = [];
+  var stop;
+  var j;
+  var jLen;
+  jLen = data.g.p * 4;
+  for (j = 0; j < jLen; j += 4) {
+    stop = createNS('stop');
+    gfill.appendChild(stop);
+    stops.push(stop);
+  }
+  pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + gradientId + ')');
 
-    var gradientId = createElementID();
-    var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-    gfill.setAttribute('id',gradientId);
-    gfill.setAttribute('spreadMethod','pad');
-    gfill.setAttribute('gradientUnits','userSpaceOnUse');
-    var stops = [];
-    var stop, j, jLen;
-    jLen = data.g.p*4;
-    for(j=0;j<jLen;j+=4){
-        stop = createNS('stop');
-        gfill.appendChild(stop);
-        stops.push(stop);
-    }
-    pathElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+gradientId+')');
-    
-    this.gf = gfill;
-    this.cst = stops;
+  this.gf = gfill;
+  this.cst = stops;
 };
 
-SVGGradientFillStyleData.prototype.setGradientOpacity = function(data, styleOb){
-    if(this.g._hasOpacity && !this.g._collapsable){
-        var stop, j, jLen;
-        var mask = createNS("mask");
-        var maskElement = createNS( 'path');
-        mask.appendChild(maskElement);
-        var opacityId = createElementID();
-        var maskId = createElementID();
-        mask.setAttribute('id',maskId);
-        var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
-        opFill.setAttribute('id',opacityId);
-        opFill.setAttribute('spreadMethod','pad');
-        opFill.setAttribute('gradientUnits','userSpaceOnUse');
-        jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
-        var stops = this.stops;
-        for(j=data.g.p*4;j<jLen;j+=2){
-            stop = createNS('stop');
-            stop.setAttribute('stop-color','rgb(255,255,255)');
-            opFill.appendChild(stop);
-            stops.push(stop);
-        }
-        maskElement.setAttribute( data.ty === 'gf' ? 'fill':'stroke','url(' + locationHref + '#'+opacityId+')');
-        this.of = opFill;
-        this.ms = mask;
-        this.ost = stops;
-        this.maskId = maskId;
-        styleOb.msElem = maskElement;
+SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) {
+  if (this.g._hasOpacity && !this.g._collapsable) {
+    var stop;
+    var j;
+    var jLen;
+    var mask = createNS('mask');
+    var maskElement = createNS('path');
+    mask.appendChild(maskElement);
+    var opacityId = createElementID();
+    var maskId = createElementID();
+    mask.setAttribute('id', maskId);
+    var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
+    opFill.setAttribute('id', opacityId);
+    opFill.setAttribute('spreadMethod', 'pad');
+    opFill.setAttribute('gradientUnits', 'userSpaceOnUse');
+    jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
+    var stops = this.stops;
+    for (j = data.g.p * 4; j < jLen; j += 2) {
+      stop = createNS('stop');
+      stop.setAttribute('stop-color', 'rgb(255,255,255)');
+      opFill.appendChild(stop);
+      stops.push(stop);
     }
+    maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + locationHref + '#' + opacityId + ')');
+    this.of = opFill;
+    this.ms = mask;
+    this.ost = stops;
+    this.maskId = maskId;
+    styleOb.msElem = maskElement;
+  }
 };
 
 extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
-function SVGGradientStrokeStyleData(elem, data, styleOb){
-	this.initDynamicPropertyContainer(elem);
-	this.getValue = this.iterateDynamicProperties;
-	this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
-	this.d = new DashProperty(elem,data.d||{},'svg',this);
-    this.initGradientData(elem, data, styleOb);
-    this._isAnimated = !!this._isAnimated;
+
+/* global PropertyFactory, DashProperty, extendPrototype, SVGGradientFillStyleData, DynamicPropertyContainer */
+
+function SVGGradientStrokeStyleData(elem, data, styleOb) {
+  this.initDynamicPropertyContainer(elem);
+  this.getValue = this.iterateDynamicProperties;
+  this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
+  this.d = new DashProperty(elem, data.d || {}, 'svg', this);
+  this.initGradientData(elem, data, styleOb);
+  this._isAnimated = !!this._isAnimated;
 }
 
 extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
+
+/* global createNS */
+/* exported ShapeGroupData */
+
 function ShapeGroupData() {
-	this.it = [];
-    this.prevViewData = [];
-    this.gr = createNS('g');
+  this.it = [];
+  this.prevViewData = [];
+  this.gr = createNS('g');
 }
-var SVGElementsRenderer = (function() {
-	var _identityMatrix = new Matrix();
-	var _matrixHelper = new Matrix();
 
-	var ob = {
-		createRenderFunction: createRenderFunction
-	}
+/* global Matrix, buildShapeString, bmFloor */
+/* exported SVGElementsRenderer */
 
-	function createRenderFunction(data) {
-	    var ty = data.ty;
-	    switch(data.ty) {
-	        case 'fl':
-	        return renderFill;
-	        case 'gf':
-	        return renderGradient;
-	        case 'gs':
-	        return renderGradientStroke;
-	        case 'st':
-	        return renderStroke;
-	        case 'sh':
-	        case 'el':
-	        case 'rc':
-	        case 'sr':
-	        return renderPath;
-	        case 'tr':
-	        return renderContentTransform;
-	    }
-	}
+var SVGElementsRenderer = (function () {
+  var _identityMatrix = new Matrix();
+  var _matrixHelper = new Matrix();
 
-	function renderContentTransform(styleData, itemData, isFirstFrame) {
-	    if(isFirstFrame || itemData.transform.op._mdf){
-	        itemData.transform.container.setAttribute('opacity',itemData.transform.op.v);
-	    }
-	    if(isFirstFrame || itemData.transform.mProps._mdf){
-	        itemData.transform.container.setAttribute('transform',itemData.transform.mProps.v.to2dCSS());
-	    }
-	}
+  var ob = {
+    createRenderFunction: createRenderFunction,
+  };
 
-	function renderPath(styleData, itemData, isFirstFrame) {
-	    var j, jLen,pathStringTransformed,redraw,pathNodes,l, lLen = itemData.styles.length;
-	    var lvl = itemData.lvl;
-	    var paths, mat, props, iterations, k;
-	    for(l=0;l<lLen;l+=1){
-	        redraw = itemData.sh._mdf || isFirstFrame;
-	        if(itemData.styles[l].lvl < lvl){
-	            mat = _matrixHelper.reset();
-	            iterations = lvl - itemData.styles[l].lvl;
-	            k = itemData.transformers.length-1;
-	            while(!redraw && iterations > 0) {
-	                redraw = itemData.transformers[k].mProps._mdf || redraw;
-	                iterations --;
-	                k --;
-	            }
-	            if(redraw) {
-	                iterations = lvl - itemData.styles[l].lvl;
-	                k = itemData.transformers.length-1;
-	                while(iterations > 0) {
-	                    props = itemData.transformers[k].mProps.v.props;
-	                    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]);
-	                    iterations --;
-	                    k --;
-	                }
-	            }
-	        } else {
-	            mat = _identityMatrix;
-	        }
-	        paths = itemData.sh.paths;
-	        jLen = paths._length;
-	        if(redraw){
-	            pathStringTransformed = '';
-	            for(j=0;j<jLen;j+=1){
-	                pathNodes = paths.shapes[j];
-	                if(pathNodes && pathNodes._length){
-	                    pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
-	                }
-	            }
-	            itemData.caches[l] = pathStringTransformed;
-	        } else {
-	            pathStringTransformed = itemData.caches[l];
-	        }
-	        itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
-	        itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
-	    }
-	}
+  function createRenderFunction(data) {
+    switch (data.ty) {
+      case 'fl':
+        return renderFill;
+      case 'gf':
+        return renderGradient;
+      case 'gs':
+        return renderGradientStroke;
+      case 'st':
+        return renderStroke;
+      case 'sh':
+      case 'el':
+      case 'rc':
+      case 'sr':
+        return renderPath;
+      case 'tr':
+        return renderContentTransform;
+      default:
+        return null;
+    }
+  }
 
-	function renderFill (styleData,itemData, isFirstFrame){
-	    var styleElem = itemData.style;
+  function renderContentTransform(styleData, itemData, isFirstFrame) {
+    if (isFirstFrame || itemData.transform.op._mdf) {
+      itemData.transform.container.setAttribute('opacity', itemData.transform.op.v);
+    }
+    if (isFirstFrame || itemData.transform.mProps._mdf) {
+      itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS());
+    }
+  }
 
-	    if(itemData.c._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill','rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('fill-opacity',itemData.o.v);
-	    }
-	};
+  function renderPath(styleData, itemData, isFirstFrame) {
+    var j;
+    var jLen;
+    var pathStringTransformed;
+    var redraw;
+    var pathNodes;
+    var l;
+    var lLen = itemData.styles.length;
+    var lvl = itemData.lvl;
+    var paths;
+    var mat;
+    var props;
+    var iterations;
+    var k;
+    for (l = 0; l < lLen; l += 1) {
+      redraw = itemData.sh._mdf || isFirstFrame;
+      if (itemData.styles[l].lvl < lvl) {
+        mat = _matrixHelper.reset();
+        iterations = lvl - itemData.styles[l].lvl;
+        k = itemData.transformers.length - 1;
+        while (!redraw && iterations > 0) {
+          redraw = itemData.transformers[k].mProps._mdf || redraw;
+          iterations -= 1;
+          k -= 1;
+        }
+        if (redraw) {
+          iterations = lvl - itemData.styles[l].lvl;
+          k = itemData.transformers.length - 1;
+          while (iterations > 0) {
+            props = itemData.transformers[k].mProps.v.props;
+            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]);
+            iterations -= 1;
+            k -= 1;
+          }
+        }
+      } else {
+        mat = _identityMatrix;
+      }
+      paths = itemData.sh.paths;
+      jLen = paths._length;
+      if (redraw) {
+        pathStringTransformed = '';
+        for (j = 0; j < jLen; j += 1) {
+          pathNodes = paths.shapes[j];
+          if (pathNodes && pathNodes._length) {
+            pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
+          }
+        }
+        itemData.caches[l] = pathStringTransformed;
+      } else {
+        pathStringTransformed = itemData.caches[l];
+      }
+      itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
+      itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
+    }
+  }
 
-	function renderGradientStroke (styleData, itemData, isFirstFrame) {
-	    renderGradient(styleData, itemData, isFirstFrame);
-	    renderStroke(styleData, itemData, isFirstFrame);
-	}
+  function renderFill(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
 
-	function renderGradient(styleData, itemData, isFirstFrame) {
-	    var gfill = itemData.gf;
-	    var hasOpacity = itemData.g._hasOpacity;
-	    var pt1 = itemData.s.v, pt2 = itemData.e.v;
+    if (itemData.c._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('fill-opacity', itemData.o.v);
+    }
+  }
 
-	    if (itemData.o._mdf || isFirstFrame) {
-	        var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
-	        itemData.style.pElem.setAttribute(attr, itemData.o.v);
-	    }
-	    if (itemData.s._mdf || isFirstFrame) {
-	        var attr1 = styleData.t === 1 ? 'x1' : 'cx';
-	        var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
-	        gfill.setAttribute(attr1, pt1[0]);
-	        gfill.setAttribute(attr2, pt1[1]);
-	        if (hasOpacity && !itemData.g._collapsable) {
-	            itemData.of.setAttribute(attr1, pt1[0]);
-	            itemData.of.setAttribute(attr2, pt1[1]);
-	        }
-	    }
-	    var stops, i, len, stop;
-	    if (itemData.g._cmdf || isFirstFrame) {
-	        stops = itemData.cst;
-	        var cValues = itemData.g.c;
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1){
-	            stop = stops[i];
-	            stop.setAttribute('offset', cValues[i * 4] + '%');
-	            stop.setAttribute('stop-color','rgb('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ')');
-	        }
-	    }
-	    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
-	        var oValues = itemData.g.o;
-	        if(itemData.g._collapsable) {
-	            stops = itemData.cst;
-	        } else {
-	            stops = itemData.ost;
-	        }
-	        len = stops.length;
-	        for (i = 0; i < len; i += 1) {
-	            stop = stops[i];
-	            if(!itemData.g._collapsable) {
-	                stop.setAttribute('offset', oValues[i * 2] + '%');
-	            }
-	            stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
-	        }
-	    }
-	    if (styleData.t === 1) {
-	        if (itemData.e._mdf  || isFirstFrame) {
-	            gfill.setAttribute('x2', pt2[0]);
-	            gfill.setAttribute('y2', pt2[1]);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('x2', pt2[0]);
-	                itemData.of.setAttribute('y2', pt2[1]);
-	            }
-	        }
-	    } else {
-	        var rad;
-	        if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
-	            rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            gfill.setAttribute('r', rad);
-	            if(hasOpacity && !itemData.g._collapsable){
-	                itemData.of.setAttribute('r', rad);
-	            }
-	        }
-	        if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
-	            if (!rad) {
-	                rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
-	            }
-	            var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
+  function renderGradientStroke(styleData, itemData, isFirstFrame) {
+    renderGradient(styleData, itemData, isFirstFrame);
+    renderStroke(styleData, itemData, isFirstFrame);
+  }
 
-	            var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v;
-	            var dist = rad * percent;
-	            var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
-	            var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
-	            gfill.setAttribute('fx', x);
-	            gfill.setAttribute('fy', y);
-	            if (hasOpacity && !itemData.g._collapsable) {
-	                itemData.of.setAttribute('fx', x);
-	                itemData.of.setAttribute('fy', y);
-	            }
-	        }
-	        //gfill.setAttribute('fy','200');
-	    }
-	};
+  function renderGradient(styleData, itemData, isFirstFrame) {
+    var gfill = itemData.gf;
+    var hasOpacity = itemData.g._hasOpacity;
+    var pt1 = itemData.s.v;
+    var pt2 = itemData.e.v;
 
-	function renderStroke(styleData, itemData, isFirstFrame) {
-	    var styleElem = itemData.style;
-	    var d = itemData.d;
-	    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
-	        styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
-	        styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
-	    }
-	    if(itemData.c && (itemData.c._mdf || isFirstFrame)){
-	        styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')');
-	    }
-	    if(itemData.o._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
-	    }
-	    if(itemData.w._mdf || isFirstFrame){
-	        styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
-	        if(styleElem.msElem){
-	            styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
-	        }
-	    }
-	};
+    if (itemData.o._mdf || isFirstFrame) {
+      var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
+      itemData.style.pElem.setAttribute(attr, itemData.o.v);
+    }
+    if (itemData.s._mdf || isFirstFrame) {
+      var attr1 = styleData.t === 1 ? 'x1' : 'cx';
+      var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
+      gfill.setAttribute(attr1, pt1[0]);
+      gfill.setAttribute(attr2, pt1[1]);
+      if (hasOpacity && !itemData.g._collapsable) {
+        itemData.of.setAttribute(attr1, pt1[0]);
+        itemData.of.setAttribute(attr2, pt1[1]);
+      }
+    }
+    var stops;
+    var i;
+    var len;
+    var stop;
+    if (itemData.g._cmdf || isFirstFrame) {
+      stops = itemData.cst;
+      var cValues = itemData.g.c;
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        stop.setAttribute('offset', cValues[i * 4] + '%');
+        stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')');
+      }
+    }
+    if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
+      var oValues = itemData.g.o;
+      if (itemData.g._collapsable) {
+        stops = itemData.cst;
+      } else {
+        stops = itemData.ost;
+      }
+      len = stops.length;
+      for (i = 0; i < len; i += 1) {
+        stop = stops[i];
+        if (!itemData.g._collapsable) {
+          stop.setAttribute('offset', oValues[i * 2] + '%');
+        }
+        stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
+      }
+    }
+    if (styleData.t === 1) {
+      if (itemData.e._mdf || isFirstFrame) {
+        gfill.setAttribute('x2', pt2[0]);
+        gfill.setAttribute('y2', pt2[1]);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('x2', pt2[0]);
+          itemData.of.setAttribute('y2', pt2[1]);
+        }
+      }
+    } else {
+      var rad;
+      if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
+        rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        gfill.setAttribute('r', rad);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('r', rad);
+        }
+      }
+      if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
+        if (!rad) {
+          rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
+        }
+        var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
 
-	return ob;
-}())
+        var percent = itemData.h.v;
+        if (percent >= 1) {
+          percent = 0.99;
+        } else if (percent <= -1) {
+          percent = -0.99;
+        }
+        var dist = rad * percent;
+        var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
+        var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
+        gfill.setAttribute('fx', x);
+        gfill.setAttribute('fy', y);
+        if (hasOpacity && !itemData.g._collapsable) {
+          itemData.of.setAttribute('fx', x);
+          itemData.of.setAttribute('fy', y);
+        }
+      }
+      // gfill.setAttribute('fy','200');
+    }
+  }
+
+  function renderStroke(styleData, itemData, isFirstFrame) {
+    var styleElem = itemData.style;
+    var d = itemData.d;
+    if (d && (d._mdf || isFirstFrame) && d.dashStr) {
+      styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
+      styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
+    }
+    if (itemData.c && (itemData.c._mdf || isFirstFrame)) {
+      styleElem.pElem.setAttribute('stroke', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
+    }
+    if (itemData.o._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
+    }
+    if (itemData.w._mdf || isFirstFrame) {
+      styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
+      if (styleElem.msElem) {
+        styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
+      }
+    }
+  }
+
+  return ob;
+}());
+
+/* global Matrix */
+
 function ShapeTransformManager() {
-	this.sequences = {};
-	this.sequenceList = [];
-    this.transform_key_count = 0;
+  this.sequences = {};
+  this.sequenceList = [];
+  this.transform_key_count = 0;
 }
 
 ShapeTransformManager.prototype = {
-	addTransformSequence: function(transforms) {
-		var i, len = transforms.length;
-		var key = '_';
-		for(i = 0; i < len; i += 1) {
-			key += transforms[i].transform.key + '_';
-		}
-		var sequence = this.sequences[key];
-		if(!sequence) {
-			sequence = {
-				transforms: [].concat(transforms),
-				finalTransform: new Matrix(),
-				_mdf: false
-			};
-			this.sequences[key] = sequence;
-			this.sequenceList.push(sequence);
-		}
-		return sequence;
-	},
-	processSequence: function(sequence, isFirstFrame) {
-		var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame;
-		while (i < len && !isFirstFrame) {
-			if (sequence.transforms[i].transform.mProps._mdf) {
-				_mdf = true;
-				break;
-			}
-			i += 1
-		}
-		if (_mdf) {
-			var props;
-			sequence.finalTransform.reset();
-			for (i = len - 1; i >= 0; i -= 1) {
-		        props = sequence.transforms[i].transform.mProps.v.props;
-		        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]);
-			}
-		}
-		sequence._mdf = _mdf;
-		
-	},
-	processSequences: function(isFirstFrame) {
-		var i, len = this.sequenceList.length;
-		for (i = 0; i < len; i += 1) {
-			this.processSequence(this.sequenceList[i], isFirstFrame);
-		}
+  addTransformSequence: function (transforms) {
+    var i;
+    var len = transforms.length;
+    var key = '_';
+    for (i = 0; i < len; i += 1) {
+      key += transforms[i].transform.key + '_';
+    }
+    var sequence = this.sequences[key];
+    if (!sequence) {
+      sequence = {
+        transforms: [].concat(transforms),
+        finalTransform: new Matrix(),
+        _mdf: false,
+      };
+      this.sequences[key] = sequence;
+      this.sequenceList.push(sequence);
+    }
+    return sequence;
+  },
+  processSequence: function (sequence, isFirstFrame) {
+    var i = 0;
+    var len = sequence.transforms.length;
+    var _mdf = isFirstFrame;
+    while (i < len && !isFirstFrame) {
+      if (sequence.transforms[i].transform.mProps._mdf) {
+        _mdf = true;
+        break;
+      }
+      i += 1;
+    }
+    if (_mdf) {
+      var props;
+      sequence.finalTransform.reset();
+      for (i = len - 1; i >= 0; i -= 1) {
+        props = sequence.transforms[i].transform.mProps.v.props;
+        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]);
+      }
+    }
+    sequence._mdf = _mdf;
+  },
+  processSequences: function (isFirstFrame) {
+    var i;
+    var len = this.sequenceList.length;
+    for (i = 0; i < len; i += 1) {
+      this.processSequence(this.sequenceList[i], isFirstFrame);
+    }
+  },
+  getNewKey: function () {
+    this.transform_key_count += 1;
+    return '_' + this.transform_key_count;
+  },
+};
 
-	},
-	getNewKey: function() {
-		return '_' + this.transform_key_count++;
-	}
-}
-function BaseElement(){
+/* global LayerExpressionInterface, EffectsExpressionInterface, CompExpressionInterface, ShapeExpressionInterface,
+TextExpressionInterface, getBlendMode,createElementID, EffectsManager */
+
+function BaseElement() {
 }
 
 BaseElement.prototype = {
-    checkMasks: function(){
-        if(!this.data.hasMask){
-            return false;
-        }
-        var i = 0, len = this.data.masksProperties.length;
-        while(i<len) {
-            if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
-                return true;
-            }
-            i += 1;
-        }
-        return false;
-    },
-    initExpressions: function(){
-        this.layerInterface = LayerExpressionInterface(this);
-        if(this.data.hasMask && this.maskManager) {
-            this.layerInterface.registerMaskInterface(this.maskManager);
-        }
-        var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
-        this.layerInterface.registerEffectsInterface(effectsInterface);
-
-        if(this.data.ty === 0 || this.data.xt){
-            this.compInterface = CompExpressionInterface(this);
-        } else if(this.data.ty === 4){
-            this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
-            this.layerInterface.content = this.layerInterface.shapeInterface;
-        } else if(this.data.ty === 5){
-            this.layerInterface.textInterface = TextExpressionInterface(this);
-            this.layerInterface.text = this.layerInterface.textInterface;
-        }
-    },
-    setBlendMode: function(){
-        var blendModeValue = getBlendMode(this.data.bm);
-        var elem = this.baseElement || this.layerElement;
-
-        elem.style['mix-blend-mode'] = blendModeValue;
-    },
-    initBaseData: function(data, globalData, comp){
-        this.globalData = globalData;
-        this.comp = comp;
-        this.data = data;
-        this.layerId = createElementID();
-        
-        //Stretch factor for old animations missing this property.
-        if(!this.data.sr){
-            this.data.sr = 1;
-        }
-        // effects manager
-        this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-        
-    },
-    getType: function(){
-        return this.type;
+  checkMasks: function () {
+    if (!this.data.hasMask) {
+      return false;
     }
-    ,sourceRectAtTime: function(){}
-}
-function NullElement(data,globalData,comp){
-    this.initFrame();
-	this.initBaseData(data, globalData, comp);
-    this.initFrame();
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
+    var i = 0;
+    var len = this.data.masksProperties.length;
+    while (i < len) {
+      if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+        return true;
+      }
+      i += 1;
+    }
+    return false;
+  },
+  initExpressions: function () {
+    this.layerInterface = LayerExpressionInterface(this);
+    if (this.data.hasMask && this.maskManager) {
+      this.layerInterface.registerMaskInterface(this.maskManager);
+    }
+    var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
+    this.layerInterface.registerEffectsInterface(effectsInterface);
+
+    if (this.data.ty === 0 || this.data.xt) {
+      this.compInterface = CompExpressionInterface(this);
+    } else if (this.data.ty === 4) {
+      this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
+      this.layerInterface.content = this.layerInterface.shapeInterface;
+    } else if (this.data.ty === 5) {
+      this.layerInterface.textInterface = TextExpressionInterface(this);
+      this.layerInterface.text = this.layerInterface.textInterface;
+    }
+  },
+  setBlendMode: function () {
+    var blendModeValue = getBlendMode(this.data.bm);
+    var elem = this.baseElement || this.layerElement;
+
+    elem.style['mix-blend-mode'] = blendModeValue;
+  },
+  initBaseData: function (data, globalData, comp) {
+    this.globalData = globalData;
+    this.comp = comp;
+    this.data = data;
+    this.layerId = createElementID();
+
+    // Stretch factor for old animations missing this property.
+    if (!this.data.sr) {
+      this.data.sr = 1;
+    }
+    // effects manager
+    this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
+  },
+  getType: function () {
+    return this.type;
+  },
+  sourceRectAtTime: function () {},
+};
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement */
+
+function NullElement(data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initFrame();
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
 }
 
-NullElement.prototype.prepareFrame = function(num) {
-    this.prepareProperties(num, true);
+NullElement.prototype.prepareFrame = function (num) {
+  this.prepareProperties(num, true);
 };
 
-NullElement.prototype.renderFrame = function() {
+NullElement.prototype.renderFrame = function () {
 };
 
-NullElement.prototype.getBaseElement = function() {
-	return null;
+NullElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-NullElement.prototype.destroy = function() {
+NullElement.prototype.destroy = function () {
 };
 
-NullElement.prototype.sourceRectAtTime = function() {
+NullElement.prototype.sourceRectAtTime = function () {
 };
 
-NullElement.prototype.hide = function() {
+NullElement.prototype.hide = function () {
 };
 
-extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement], NullElement);
+extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
 
-function SVGBaseElement(){
+/* global filtersFactory, featureSupport, filtersFactory, createElementID, createNS, MaskElement, SVGEffects, locationHref */
+
+function SVGBaseElement() {
 }
 
 SVGBaseElement.prototype = {
-    initRendererElement: function() {
-        this.layerElement = createNS('g');
-    },
-    createContainerElements: function(){
-        this.matteElement = createNS('g');
-        this.transformedElement = this.layerElement;
-        this.maskedElement = this.layerElement;
-        this._sizeChanged = false;
-        var layerElementParent = null;
-        //If this layer acts as a mask for the following layer
-        var filId, fil, gg;
-        if (this.data.td) {
-            if (this.data.td == 3 || this.data.td == 1) {
-                var masker = createNS('mask');
-                masker.setAttribute('id', this.layerId);
-                masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha');
-                masker.appendChild(this.layerElement);
-                layerElementParent = masker;
-                this.globalData.defs.appendChild(masker);
-                // This is only for IE and Edge when mask if of type alpha
-                if (!featureSupport.maskType && this.data.td == 1) {
-                    masker.setAttribute('mask-type', 'luminance');
-                    filId = createElementID();
-                    fil = filtersFactory.createFilter(filId);
-                    this.globalData.defs.appendChild(fil);
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    masker.appendChild(gg);
-                    gg.setAttribute('filter','url(' + locationHref + '#' + filId + ')');
-                }
-            } else if(this.data.td == 2) {
-                var maskGroup = createNS('mask');
-                maskGroup.setAttribute('id', this.layerId);
-                maskGroup.setAttribute('mask-type','alpha');
-                var maskGrouper = createNS('g');
-                maskGroup.appendChild(maskGrouper);
-                filId = createElementID();
-                fil = filtersFactory.createFilter(filId);
-                ////
+  initRendererElement: function () {
+    this.layerElement = createNS('g');
+  },
+  createContainerElements: function () {
+    this.matteElement = createNS('g');
+    this.transformedElement = this.layerElement;
+    this.maskedElement = this.layerElement;
+    this._sizeChanged = false;
+    var layerElementParent = null;
+    // If this layer acts as a mask for the following layer
+    var filId;
+    var fil;
+    var gg;
+    if (this.data.td) {
+      if (this.data.td == 3 || this.data.td == 1) { // eslint-disable-line eqeqeq
+        var masker = createNS('mask');
+        masker.setAttribute('id', this.layerId);
+        masker.setAttribute('mask-type', this.data.td == 3 ? 'luminance' : 'alpha'); // eslint-disable-line eqeqeq
+        masker.appendChild(this.layerElement);
+        layerElementParent = masker;
+        this.globalData.defs.appendChild(masker);
+        // This is only for IE and Edge when mask if of type alpha
+        if (!featureSupport.maskType && this.data.td == 1) { // eslint-disable-line eqeqeq
+          masker.setAttribute('mask-type', 'luminance');
+          filId = createElementID();
+          fil = filtersFactory.createFilter(filId);
+          this.globalData.defs.appendChild(fil);
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          masker.appendChild(gg);
+          gg.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        }
+      } else if (this.data.td == 2) { // eslint-disable-line eqeqeq
+        var maskGroup = createNS('mask');
+        maskGroup.setAttribute('id', this.layerId);
+        maskGroup.setAttribute('mask-type', 'alpha');
+        var maskGrouper = createNS('g');
+        maskGroup.appendChild(maskGrouper);
+        filId = createElementID();
+        fil = filtersFactory.createFilter(filId);
+        /// /
 
-                // This solution doesn't work on Android when meta tag with viewport attribute is set
-                /*var feColorMatrix = createNS('feColorMatrix');
+        // This solution doesn't work on Android when meta tag with viewport attribute is set
+        /* var feColorMatrix = createNS('feColorMatrix');
                 feColorMatrix.setAttribute('type', 'matrix');
                 feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
                 feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 -1 1');
-                fil.appendChild(feColorMatrix);*/
-                ////
-                var feCTr = createNS('feComponentTransfer');
-                feCTr.setAttribute('in','SourceGraphic');
-                fil.appendChild(feCTr);
-                var feFunc = createNS('feFuncA');
-                feFunc.setAttribute('type','table');
-                feFunc.setAttribute('tableValues','1.0 0.0');
-                feCTr.appendChild(feFunc);
-                ////
-                this.globalData.defs.appendChild(fil);
-                var alphaRect = createNS('rect');
-                alphaRect.setAttribute('width',  this.comp.data.w);
-                alphaRect.setAttribute('height', this.comp.data.h);
-                alphaRect.setAttribute('x','0');
-                alphaRect.setAttribute('y','0');
-                alphaRect.setAttribute('fill','#ffffff');
-                alphaRect.setAttribute('opacity','0');
-                maskGrouper.setAttribute('filter', 'url(' + locationHref + '#'+filId+')');
-                maskGrouper.appendChild(alphaRect);
-                maskGrouper.appendChild(this.layerElement);
-                layerElementParent = maskGrouper;
-                if (!featureSupport.maskType) {
-                    maskGroup.setAttribute('mask-type', 'luminance');
-                    fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
-                    gg = createNS('g');
-                    maskGrouper.appendChild(alphaRect);
-                    gg.appendChild(this.layerElement);
-                    layerElementParent = gg;
-                    maskGrouper.appendChild(gg);
-                }
-                this.globalData.defs.appendChild(maskGroup);
-            }
-        } else if (this.data.tt) {
-            this.matteElement.appendChild(this.layerElement);
-            layerElementParent = this.matteElement;
-            this.baseElement = this.matteElement;
-        } else {
-            this.baseElement = this.layerElement;
+                fil.appendChild(feColorMatrix); */
+        /// /
+        var feCTr = createNS('feComponentTransfer');
+        feCTr.setAttribute('in', 'SourceGraphic');
+        fil.appendChild(feCTr);
+        var feFunc = createNS('feFuncA');
+        feFunc.setAttribute('type', 'table');
+        feFunc.setAttribute('tableValues', '1.0 0.0');
+        feCTr.appendChild(feFunc);
+        /// /
+        this.globalData.defs.appendChild(fil);
+        var alphaRect = createNS('rect');
+        alphaRect.setAttribute('width', this.comp.data.w);
+        alphaRect.setAttribute('height', this.comp.data.h);
+        alphaRect.setAttribute('x', '0');
+        alphaRect.setAttribute('y', '0');
+        alphaRect.setAttribute('fill', '#ffffff');
+        alphaRect.setAttribute('opacity', '0');
+        maskGrouper.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+        maskGrouper.appendChild(alphaRect);
+        maskGrouper.appendChild(this.layerElement);
+        layerElementParent = maskGrouper;
+        if (!featureSupport.maskType) {
+          maskGroup.setAttribute('mask-type', 'luminance');
+          fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
+          gg = createNS('g');
+          maskGrouper.appendChild(alphaRect);
+          gg.appendChild(this.layerElement);
+          layerElementParent = gg;
+          maskGrouper.appendChild(gg);
         }
-        if (this.data.ln) {
-            this.layerElement.setAttribute('id', this.data.ln);
-        }
-        if (this.data.cl) {
-            this.layerElement.setAttribute('class', this.data.cl);
-        }
-        //Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
-        if (this.data.ty === 0 && !this.data.hd) {
-            var cp = createNS( 'clipPath');
-            var pt = createNS('path');
-            pt.setAttribute('d','M0,0 L' + this.data.w + ',0' + ' L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
-            var clipId = createElementID();
-            cp.setAttribute('id',clipId);
-            cp.appendChild(pt);
-            this.globalData.defs.appendChild(cp);
-
-            if (this.checkMasks()) {
-                var cpGroup = createNS('g');
-                cpGroup.setAttribute('clip-path','url(' + locationHref + '#'+clipId + ')');
-                cpGroup.appendChild(this.layerElement);
-                this.transformedElement = cpGroup;
-                if (layerElementParent) {
-                    layerElementParent.appendChild(this.transformedElement);
-                } else {
-                    this.baseElement = this.transformedElement;
-                }
-            } else {
-                this.layerElement.setAttribute('clip-path','url(' + locationHref + '#'+clipId+')');
-            }
-            
-        }
-        if (this.data.bm !== 0) {
-            this.setBlendMode();
-        }
-
-    },
-    renderElement: function() {
-        if (this.finalTransform._matMdf) {
-            this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
-        }
-        if (this.finalTransform._opMdf) {
-            this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
-        }
-    },
-    destroyBaseElement: function() {
-        this.layerElement = null;
-        this.matteElement = null;
-        this.maskManager.destroy();
-    },
-    getBaseElement: function() {
-        if (this.data.hd) {
-            return null;
-        }
-        return this.baseElement;
-    },
-    createRenderableComponents: function() {
-        this.maskManager = new MaskElement(this.data, this, this.globalData);
-        this.renderableEffectsManager = new SVGEffects(this);
-    },
-    setMatte: function(id) {
-        if (!this.matteElement) {
-            return;
-        }
-        this.matteElement.setAttribute("mask", "url(" + locationHref + "#" + id + ")");
+        this.globalData.defs.appendChild(maskGroup);
+      }
+    } else if (this.data.tt) {
+      this.matteElement.appendChild(this.layerElement);
+      layerElementParent = this.matteElement;
+      this.baseElement = this.matteElement;
+    } else {
+      this.baseElement = this.layerElement;
     }
+    if (this.data.ln) {
+      this.layerElement.setAttribute('id', this.data.ln);
+    }
+    if (this.data.cl) {
+      this.layerElement.setAttribute('class', this.data.cl);
+    }
+    // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
+    if (this.data.ty === 0 && !this.data.hd) {
+      var cp = createNS('clipPath');
+      var pt = createNS('path');
+      pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
+      var clipId = createElementID();
+      cp.setAttribute('id', clipId);
+      cp.appendChild(pt);
+      this.globalData.defs.appendChild(cp);
+
+      if (this.checkMasks()) {
+        var cpGroup = createNS('g');
+        cpGroup.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+        cpGroup.appendChild(this.layerElement);
+        this.transformedElement = cpGroup;
+        if (layerElementParent) {
+          layerElementParent.appendChild(this.transformedElement);
+        } else {
+          this.baseElement = this.transformedElement;
+        }
+      } else {
+        this.layerElement.setAttribute('clip-path', 'url(' + locationHref + '#' + clipId + ')');
+      }
+    }
+    if (this.data.bm !== 0) {
+      this.setBlendMode();
+    }
+  },
+  renderElement: function () {
+    if (this.finalTransform._matMdf) {
+      this.transformedElement.setAttribute('transform', this.finalTransform.mat.to2dCSS());
+    }
+    if (this.finalTransform._opMdf) {
+      this.transformedElement.setAttribute('opacity', this.finalTransform.mProp.o.v);
+    }
+  },
+  destroyBaseElement: function () {
+    this.layerElement = null;
+    this.matteElement = null;
+    this.maskManager.destroy();
+  },
+  getBaseElement: function () {
+    if (this.data.hd) {
+      return null;
+    }
+    return this.baseElement;
+  },
+  createRenderableComponents: function () {
+    this.maskManager = new MaskElement(this.data, this, this.globalData);
+    this.renderableEffectsManager = new SVGEffects(this);
+  },
+  setMatte: function (id) {
+    if (!this.matteElement) {
+      return;
+    }
+    this.matteElement.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+  },
 };
-function IShapeElement(){
+
+/* global ProcessedElement */
+
+function IShapeElement() {
 }
 
 IShapeElement.prototype = {
-    addShapeToModifiers: function(data) {
-        var i, len = this.shapeModifiers.length;
-        for(i=0;i<len;i+=1){
-            this.shapeModifiers[i].addShape(data);
-        }
-    },
-    isShapeInAnimatedModifiers: function(data) {
-        var i = 0, len = this.shapeModifiers.length;
-        while(i < len) {
-            if(this.shapeModifiers[i].isAnimatedWithShape(data)) {
-                return true;
-            }
-        }
-        return false;
-    },
-    renderModifiers: function() {
-        if(!this.shapeModifiers.length){
-            return;
-        }
-        var i, len = this.shapes.length;
-        for(i=0;i<len;i+=1){
-            this.shapes[i].sh.reset();
-        }
-
-        len = this.shapeModifiers.length;
-        for(i=len-1;i>=0;i-=1){
-            this.shapeModifiers[i].processShapes(this._isFirstFrame);
-        }
-    },
-    lcEnum: {
-        '1': 'butt',
-        '2': 'round',
-        '3': 'square'
-    },
-    ljEnum: {
-        '1': 'miter',
-        '2': 'round',
-        '3': 'bevel'
-    },
-    searchProcessedElement: function(elem){
-        var elements = this.processedElements;
-        var i = 0, len = elements.length;
-        while (i < len) {
-            if (elements[i].elem === elem) {
-                return elements[i].pos;
-            }
-            i += 1;
-        }
-        return 0;
-    },
-    addProcessedElement: function(elem, pos){
-        var elements = this.processedElements;
-        var i = elements.length;
-        while(i) {
-            i -= 1;
-            if (elements[i].elem === elem) {
-                elements[i].pos = pos;
-                return;
-            }
-        }
-        elements.push(new ProcessedElement(elem, pos));
-    },
-    prepareFrame: function(num) {
-        this.prepareRenderableFrame(num);
-        this.prepareProperties(num, this.isInRange);
+  addShapeToModifiers: function (data) {
+    var i;
+    var len = this.shapeModifiers.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapeModifiers[i].addShape(data);
     }
-};
-function ITextElement(){
-}
+  },
+  isShapeInAnimatedModifiers: function (data) {
+    var i = 0;
+    var len = this.shapeModifiers.length;
+    while (i < len) {
+      if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
+        return true;
+      }
+    }
+    return false;
+  },
+  renderModifiers: function () {
+    if (!this.shapeModifiers.length) {
+      return;
+    }
+    var i;
+    var len = this.shapes.length;
+    for (i = 0; i < len; i += 1) {
+      this.shapes[i].sh.reset();
+    }
 
-ITextElement.prototype.initElement = function(data,globalData,comp){
-    this.lettersChangedFlag = true;
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
-    this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
-    this.initTransform(data, globalData, comp);
-    this.initHierarchy();
-    this.initRenderable();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    this.createContent();
-    this.hide();
-    this.textAnimator.searchProperties(this.dynamicProperties);
-};
-
-ITextElement.prototype.prepareFrame = function(num) {
-    this._mdf = false;
+    len = this.shapeModifiers.length;
+    for (i = len - 1; i >= 0; i -= 1) {
+      this.shapeModifiers[i].processShapes(this._isFirstFrame);
+    }
+  },
+  lcEnum: {
+    1: 'butt',
+    2: 'round',
+    3: 'square',
+  },
+  ljEnum: {
+    1: 'miter',
+    2: 'round',
+    3: 'bevel',
+  },
+  searchProcessedElement: function (elem) {
+    var elements = this.processedElements;
+    var i = 0;
+    var len = elements.length;
+    while (i < len) {
+      if (elements[i].elem === elem) {
+        return elements[i].pos;
+      }
+      i += 1;
+    }
+    return 0;
+  },
+  addProcessedElement: function (elem, pos) {
+    var elements = this.processedElements;
+    var i = elements.length;
+    while (i) {
+      i -= 1;
+      if (elements[i].elem === elem) {
+        elements[i].pos = pos;
+        return;
+      }
+    }
+    elements.push(new ProcessedElement(elem, pos));
+  },
+  prepareFrame: function (num) {
     this.prepareRenderableFrame(num);
     this.prepareProperties(num, this.isInRange);
-    if(this.textProperty._mdf || this.textProperty._isFirstFrame) {
-        this.buildNewText();
-        this.textProperty._isFirstFrame = false;
-        this.textProperty._mdf = false;
-    }
+  },
 };
 
-ITextElement.prototype.createPathShape = function(matrixHelper, shapes) {
-    var j,jLen = shapes.length;
-    var k, kLen, pathNodes;
-    var shapeStr = '';
-    for(j=0;j<jLen;j+=1){
-        pathNodes = shapes[j].ks.k;
-        shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
-    }
-    return shapeStr;
+/* global TextProperty, TextAnimatorProperty, buildShapeString, LetterProps */
+
+function ITextElement() {
+}
+
+ITextElement.prototype.initElement = function (data, globalData, comp) {
+  this.lettersChangedFlag = true;
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
+  this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
+  this.initTransform(data, globalData, comp);
+  this.initHierarchy();
+  this.initRenderable();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  this.createContent();
+  this.hide();
+  this.textAnimator.searchProperties(this.dynamicProperties);
 };
 
-ITextElement.prototype.updateDocumentData = function(newData, index) {
-    this.textProperty.updateDocumentData(newData, index);
+ITextElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
+    this.buildNewText();
+    this.textProperty._isFirstFrame = false;
+    this.textProperty._mdf = false;
+  }
 };
 
-ITextElement.prototype.canResizeFont = function(_canResize) {
-    this.textProperty.canResizeFont(_canResize);
+ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
+  var j;
+  var jLen = shapes.length;
+  var pathNodes;
+  var shapeStr = '';
+  for (j = 0; j < jLen; j += 1) {
+    pathNodes = shapes[j].ks.k;
+    shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
+  }
+  return shapeStr;
 };
 
-ITextElement.prototype.setMinimumFontSize = function(_fontSize) {
-    this.textProperty.setMinimumFontSize(_fontSize);
+ITextElement.prototype.updateDocumentData = function (newData, index) {
+  this.textProperty.updateDocumentData(newData, index);
 };
 
-ITextElement.prototype.applyTextPropertiesToMatrix = function(documentData, matrixHelper, lineNumber, xPos, yPos) {
-    if(documentData.ps){
-        matrixHelper.translate(documentData.ps[0],documentData.ps[1] + documentData.ascent,0);
-    }
-    matrixHelper.translate(0,-documentData.ls,0);
-    switch(documentData.j){
-        case 1:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]),0,0);
-            break;
-        case 2:
-            matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber] )/2,0,0);
-            break;
-    }
-    matrixHelper.translate(xPos, yPos, 0);
+ITextElement.prototype.canResizeFont = function (_canResize) {
+  this.textProperty.canResizeFont(_canResize);
 };
 
+ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
+  this.textProperty.setMinimumFontSize(_fontSize);
+};
 
-ITextElement.prototype.buildColor = function(colorData) {
-    return 'rgb(' + Math.round(colorData[0]*255) + ',' + Math.round(colorData[1]*255) + ',' + Math.round(colorData[2]*255) + ')';
+ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
+  if (documentData.ps) {
+    matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
+  }
+  matrixHelper.translate(0, -documentData.ls, 0);
+  switch (documentData.j) {
+    case 1:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
+      break;
+    case 2:
+      matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
+      break;
+    default:
+      break;
+  }
+  matrixHelper.translate(xPos, yPos, 0);
+};
+
+ITextElement.prototype.buildColor = function (colorData) {
+  return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
 };
 
 ITextElement.prototype.emptyProp = new LetterProps();
 
-ITextElement.prototype.destroy = function(){
-    
+ITextElement.prototype.destroy = function () {
+
 };
-function ICompElement(){}
+
+/* global extendPrototype, BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement */
+
+function ICompElement() {}
 
 extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
 
-ICompElement.prototype.initElement = function(data,globalData,comp) {
-    this.initFrame();
-    this.initBaseData(data, globalData, comp);
-    this.initTransform(data, globalData, comp);
-    this.initRenderable();
-    this.initHierarchy();
-    this.initRendererElement();
-    this.createContainerElements();
-    this.createRenderableComponents();
-    if(this.data.xt || !globalData.progressiveLoad){
-        this.buildAllItems();
-    }
-    this.hide();
+ICompElement.prototype.initElement = function (data, globalData, comp) {
+  this.initFrame();
+  this.initBaseData(data, globalData, comp);
+  this.initTransform(data, globalData, comp);
+  this.initRenderable();
+  this.initHierarchy();
+  this.initRendererElement();
+  this.createContainerElements();
+  this.createRenderableComponents();
+  if (this.data.xt || !globalData.progressiveLoad) {
+    this.buildAllItems();
+  }
+  this.hide();
 };
 
-/*ICompElement.prototype.hide = function(){
+/* ICompElement.prototype.hide = function(){
     if(!this.hidden){
         this.hideElement();
         var i,len = this.elements.length;
@@ -7815,1141 +8272,1206 @@
             }
         }
     }
-};*/
+}; */
 
-ICompElement.prototype.prepareFrame = function(num){
-    this._mdf = false;
-    this.prepareRenderableFrame(num);
-    this.prepareProperties(num, this.isInRange);
-    if(!this.isInRange && !this.data.xt){
-        return;
-    }
+ICompElement.prototype.prepareFrame = function (num) {
+  this._mdf = false;
+  this.prepareRenderableFrame(num);
+  this.prepareProperties(num, this.isInRange);
+  if (!this.isInRange && !this.data.xt) {
+    return;
+  }
 
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        if(timeRemapped === this.data.op){
-            timeRemapped = this.data.op - 1;
-        }
-        this.renderedFrame = timeRemapped;
-    } else {
-        this.renderedFrame = num/this.data.sr;
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    if (timeRemapped === this.data.op) {
+      timeRemapped = this.data.op - 1;
     }
-    var i,len = this.elements.length;
-    if(!this.completeLayers){
-        this.checkLayers(this.renderedFrame);
+    this.renderedFrame = timeRemapped;
+  } else {
+    this.renderedFrame = num / this.data.sr;
+  }
+  var i;
+  var len = this.elements.length;
+  if (!this.completeLayers) {
+    this.checkLayers(this.renderedFrame);
+  }
+  // This iteration needs to be backwards because of how expressions connect between each other
+  for (i = len - 1; i >= 0; i -= 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
+      if (this.elements[i]._mdf) {
+        this._mdf = true;
+      }
     }
-    //This iteration needs to be backwards because of how expressions connect between each other
-    for( i = len - 1; i >= 0; i -= 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
-            if(this.elements[i]._mdf) {
-                this._mdf = true;
-            }
-        }
-    }
+  }
 };
 
-ICompElement.prototype.renderInnerContent = function() {
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i += 1 ){
-        if(this.completeLayers || this.elements[i]){
-            this.elements[i].renderFrame();
-        }
+ICompElement.prototype.renderInnerContent = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.completeLayers || this.elements[i]) {
+      this.elements[i].renderFrame();
     }
+  }
 };
 
-ICompElement.prototype.setElements = function(elems){
-    this.elements = elems;
+ICompElement.prototype.setElements = function (elems) {
+  this.elements = elems;
 };
 
-ICompElement.prototype.getElements = function(){
-    return this.elements;
+ICompElement.prototype.getElements = function () {
+  return this.elements;
 };
 
-ICompElement.prototype.destroyElements = function(){
-    var i,len = this.layers.length;
-    for( i = 0; i < len; i+=1 ){
-        if(this.elements[i]){
-            this.elements[i].destroy();
-        }
+ICompElement.prototype.destroyElements = function () {
+  var i;
+  var len = this.layers.length;
+  for (i = 0; i < len; i += 1) {
+    if (this.elements[i]) {
+      this.elements[i].destroy();
     }
+  }
 };
 
-ICompElement.prototype.destroy = function(){
-    this.destroyElements();
-    this.destroyBaseElement();
+ICompElement.prototype.destroy = function () {
+  this.destroyElements();
+  this.destroyBaseElement();
 };
 
-function IImageElement(data,globalData,comp){
-    this.assetData = globalData.getAssetData(data.refId);
-    this.initElement(data,globalData,comp);
-    this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h};
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, createNS */
+
+function IImageElement(data, globalData, comp) {
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initElement(data, globalData, comp);
+  this.sourceRect = {
+    top: 0, left: 0, width: this.assetData.w, height: this.assetData.h,
+  };
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
 
-IImageElement.prototype.createContent = function(){
+IImageElement.prototype.createContent = function () {
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
 
-    var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.innerElem = createNS('image');
+  this.innerElem.setAttribute('width', this.assetData.w + 'px');
+  this.innerElem.setAttribute('height', this.assetData.h + 'px');
+  this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
+  this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
 
-    this.innerElem = createNS('image');
-    this.innerElem.setAttribute('width',this.assetData.w+"px");
-    this.innerElem.setAttribute('height',this.assetData.h+"px");
-    this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
-    this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath);
-    
-    this.layerElement.appendChild(this.innerElem);
+  this.layerElement.appendChild(this.innerElem);
 };
 
-IImageElement.prototype.sourceRectAtTime = function() {
-	return this.sourceRect;
-}
-function ISolidElement(data,globalData,comp){
-    this.initElement(data,globalData,comp);
+IImageElement.prototype.sourceRectAtTime = function () {
+  return this.sourceRect;
+};
+
+/* global extendPrototype, IImageElement, createNS */
+
+function ISolidElement(data, globalData, comp) {
+  this.initElement(data, globalData, comp);
 }
 extendPrototype([IImageElement], ISolidElement);
 
-ISolidElement.prototype.createContent = function(){
-
-    var rect = createNS('rect');
-    ////rect.style.width = this.data.sw;
-    ////rect.style.height = this.data.sh;
-    ////rect.style.fill = this.data.sc;
-    rect.setAttribute('width',this.data.sw);
-    rect.setAttribute('height',this.data.sh);
-    rect.setAttribute('fill',this.data.sc);
-    this.layerElement.appendChild(rect);
+ISolidElement.prototype.createContent = function () {
+  var rect = createNS('rect');
+  /// /rect.style.width = this.data.sw;
+  /// /rect.style.height = this.data.sh;
+  /// /rect.style.fill = this.data.sc;
+  rect.setAttribute('width', this.data.sw);
+  rect.setAttribute('height', this.data.sh);
+  rect.setAttribute('fill', this.data.sc);
+  this.layerElement.appendChild(rect);
 };
-function AudioElement(data,globalData,comp){
-    this.initFrame();
-    this.initRenderable();
-    this.assetData = globalData.getAssetData(data.refId);
-	this.initBaseData(data, globalData, comp);
-	this._isPlaying = false;
-	this._canPlay = false;
-	var assetPath = this.globalData.getAssetsPath(this.assetData);
-    this.audio = this.globalData.audioController.createAudio(assetPath);
-    this._currentTime = 0;
-    this.globalData.audioController.addAudio(this);
-    this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate,this) : {_placeholder:true};
+
+/* global PropertyFactory, extendPrototype, RenderableElement, BaseElement, FrameElement */
+
+function AudioElement(data, globalData, comp) {
+  this.initFrame();
+  this.initRenderable();
+  this.assetData = globalData.getAssetData(data.refId);
+  this.initBaseData(data, globalData, comp);
+  this._isPlaying = false;
+  this._canPlay = false;
+  var assetPath = this.globalData.getAssetsPath(this.assetData);
+  this.audio = this.globalData.audioController.createAudio(assetPath);
+  this._currentTime = 0;
+  this.globalData.audioController.addAudio(this);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
-AudioElement.prototype.prepareFrame = function(num) {
-    this.prepareRenderableFrame(num, true);
-    this.prepareProperties(num, true);
-    if (!this.tm._placeholder) {
-        var timeRemapped = this.tm.v;
-        this._currentTime = timeRemapped;
-    } else {
-        this._currentTime = num / this.data.sr;
+AudioElement.prototype.prepareFrame = function (num) {
+  this.prepareRenderableFrame(num, true);
+  this.prepareProperties(num, true);
+  if (!this.tm._placeholder) {
+    var timeRemapped = this.tm.v;
+    this._currentTime = timeRemapped;
+  } else {
+    this._currentTime = num / this.data.sr;
+  }
+};
+
+extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
+
+AudioElement.prototype.renderFrame = function () {
+  if (this.isInRange && this._canPlay) {
+    if (!this._isPlaying) {
+      this.audio.play();
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
+      this._isPlaying = true;
+    } else if (!this.audio.playing()
+      || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
+    ) {
+      this.audio.seek(this._currentTime / this.globalData.frameRate);
     }
+  }
 };
 
-extendPrototype([RenderableElement,BaseElement,FrameElement], AudioElement);
-
-AudioElement.prototype.renderFrame = function() {
-	if (this.isInRange && this._canPlay) {
-		if (!this._isPlaying) {
-			this.audio.play();
-			this.audio.seek(this._currentTime / this.globalData.frameRate);
-			this._isPlaying = true;
-		} else if (!this.audio.playing()
-			|| Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1
-		) {
-			this.audio.seek(this._currentTime / this.globalData.frameRate)
-		}
-	}
+AudioElement.prototype.show = function () {
+  // this.audio.play()
 };
 
-AudioElement.prototype.show = function() {
-	// this.audio.play()
+AudioElement.prototype.hide = function () {
+  this.audio.pause();
+  this._isPlaying = false;
 };
 
-AudioElement.prototype.hide = function() {
-	this.audio.pause();
-	this._isPlaying = false;
+AudioElement.prototype.pause = function () {
+  this.audio.pause();
+  this._isPlaying = false;
+  this._canPlay = false;
 };
 
-AudioElement.prototype.pause = function() {
-	this.audio.pause();
-	this._isPlaying = false;
-	this._canPlay = false;
+AudioElement.prototype.resume = function () {
+  this._canPlay = true;
 };
 
-AudioElement.prototype.resume = function() {
-	this._canPlay = true;
+AudioElement.prototype.setRate = function (rateValue) {
+  this.audio.rate(rateValue);
 };
 
-AudioElement.prototype.setRate = function(rateValue) {
-	this.audio.rate(rateValue);
+AudioElement.prototype.volume = function (volumeValue) {
+  this.audio.volume(volumeValue);
 };
 
-AudioElement.prototype.volume = function(volumeValue) {
-	this.audio.volume(volumeValue);
+AudioElement.prototype.getBaseElement = function () {
+  return null;
 };
 
-AudioElement.prototype.getBaseElement = function() {
-	return null;
+AudioElement.prototype.destroy = function () {
 };
 
-AudioElement.prototype.destroy = function() {
+AudioElement.prototype.sourceRectAtTime = function () {
 };
 
-AudioElement.prototype.sourceRectAtTime = function() {
+AudioElement.prototype.initExpressions = function () {
 };
 
-AudioElement.prototype.initExpressions = function() {
-};
+/* global createSizedArray, PropertyFactory, extendPrototype, SVGRenderer, ICompElement, SVGBaseElement */
 
-
-function SVGCompElement(data,globalData,comp){
-    this.layers = data.layers;
-    this.supports3d = true;
-    this.completeLayers = false;
-    this.pendingElements = [];
-    this.elements = this.layers ? createSizedArray(this.layers.length) : [];
-    //this.layerElement = createNS('g');
-    this.initElement(data,globalData,comp);
-    this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true};
+function SVGCompElement(data, globalData, comp) {
+  this.layers = data.layers;
+  this.supports3d = true;
+  this.completeLayers = false;
+  this.pendingElements = [];
+  this.elements = this.layers ? createSizedArray(this.layers.length) : [];
+  // this.layerElement = createNS('g');
+  this.initElement(data, globalData, comp);
+  this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
 }
 
 extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement);
-function SVGTextElement(data,globalData,comp){
-    this.textSpans = [];
-    this.renderType = 'svg';
-    this.initElement(data,globalData,comp);
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement,
+RenderableDOMElement, ITextElement, createSizedArray, createNS */
+
+function SVGTextLottieElement(data, globalData, comp) {
+  this.textSpans = [];
+  this.renderType = 'svg';
+  this.initElement(data, globalData, comp);
 }
 
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], SVGTextElement);
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement);
 
-SVGTextElement.prototype.createContent = function(){
-
-    if (this.data.singleShape && !this.globalData.fontManager.chars) {
-        this.textContainer = createNS('text');
-    }
+SVGTextLottieElement.prototype.createContent = function () {
+  if (this.data.singleShape && !this.globalData.fontManager.chars) {
+    this.textContainer = createNS('text');
+  }
 };
 
-SVGTextElement.prototype.buildTextContents = function(textArray) {
-    var i = 0, len = textArray.length;
-    var textContents = [], currentTextContent = '';
-    while (i < len) {
-        if(textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
-            textContents.push(currentTextContent);
-            currentTextContent = '';
+SVGTextLottieElement.prototype.buildTextContents = function (textArray) {
+  var i = 0;
+  var len = textArray.length;
+  var textContents = [];
+  var currentTextContent = '';
+  while (i < len) {
+    if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
+      textContents.push(currentTextContent);
+      currentTextContent = '';
+    } else {
+      currentTextContent += textArray[i];
+    }
+    i += 1;
+  }
+  textContents.push(currentTextContent);
+  return textContents;
+};
+
+SVGTextLottieElement.prototype.buildNewText = function () {
+  var i;
+  var len;
+
+  var documentData = this.textProperty.currentData;
+  this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
+  if (documentData.fc) {
+    this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
+  } else {
+    this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
+  }
+  if (documentData.sc) {
+    this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
+    this.layerElement.setAttribute('stroke-width', documentData.sw);
+  }
+  this.layerElement.setAttribute('font-size', documentData.finalSize);
+  var fontData = this.globalData.fontManager.getFontByName(documentData.f);
+  if (fontData.fClass) {
+    this.layerElement.setAttribute('class', fontData.fClass);
+  } else {
+    this.layerElement.setAttribute('font-family', fontData.fFamily);
+    var fWeight = documentData.fWeight;
+    var fStyle = documentData.fStyle;
+    this.layerElement.setAttribute('font-style', fStyle);
+    this.layerElement.setAttribute('font-weight', fWeight);
+  }
+  this.layerElement.setAttribute('aria-label', documentData.t);
+
+  var letters = documentData.l || [];
+  var usesGlyphs = !!this.globalData.fontManager.chars;
+  len = letters.length;
+
+  var tSpan;
+  var matrixHelper = this.mHelper;
+  var shapes;
+  var shapeStr = '';
+  var singleShape = this.data.singleShape;
+  var xPos = 0;
+  var yPos = 0;
+  var firstLine = true;
+  var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
+  if (singleShape && !usesGlyphs && !documentData.sz) {
+    var tElement = this.textContainer;
+    var justify = 'start';
+    switch (documentData.j) {
+      case 1:
+        justify = 'end';
+        break;
+      case 2:
+        justify = 'middle';
+        break;
+      default:
+        justify = 'start';
+        break;
+    }
+    tElement.setAttribute('text-anchor', justify);
+    tElement.setAttribute('letter-spacing', trackingOffset);
+    var textContent = this.buildTextContents(documentData.finalText);
+    len = textContent.length;
+    yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
+    for (i = 0; i < len; i += 1) {
+      tSpan = this.textSpans[i] || createNS('tspan');
+      tSpan.textContent = textContent[i];
+      tSpan.setAttribute('x', 0);
+      tSpan.setAttribute('y', yPos);
+      tSpan.style.display = 'inherit';
+      tElement.appendChild(tSpan);
+      this.textSpans[i] = tSpan;
+      yPos += documentData.finalLineHeight;
+    }
+
+    this.layerElement.appendChild(tElement);
+  } else {
+    var cachedSpansLength = this.textSpans.length;
+    var shapeData;
+    var charData;
+    for (i = 0; i < len; i += 1) {
+      if (!usesGlyphs || !singleShape || i === 0) {
+        tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs ? 'path' : 'text');
+        if (cachedSpansLength <= i) {
+          tSpan.setAttribute('stroke-linecap', 'butt');
+          tSpan.setAttribute('stroke-linejoin', 'round');
+          tSpan.setAttribute('stroke-miterlimit', '4');
+          this.textSpans[i] = tSpan;
+          this.layerElement.appendChild(tSpan);
+        }
+        tSpan.style.display = 'inherit';
+      }
+
+      matrixHelper.reset();
+      matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
+      if (singleShape) {
+        if (letters[i].n) {
+          xPos = -trackingOffset;
+          yPos += documentData.yOffset;
+          yPos += firstLine ? 1 : 0;
+          firstLine = false;
+        }
+        this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
+        xPos += letters[i].l || 0;
+        // xPos += letters[i].val === ' ' ? 0 : trackingOffset;
+        xPos += trackingOffset;
+      }
+      if (usesGlyphs) {
+        charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
+        shapeData = (charData && charData.data) || {};
+        shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
+        if (!singleShape) {
+          tSpan.setAttribute('d', this.createPathShape(matrixHelper, shapes));
         } else {
-            currentTextContent += textArray[i];
+          shapeStr += this.createPathShape(matrixHelper, shapes);
         }
-        i += 1;
+      } else {
+        if (singleShape) {
+          tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')');
+        }
+        tSpan.textContent = letters[i].val;
+        tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
+      }
+      //
     }
-    textContents.push(currentTextContent);
-    return textContents;
+    if (singleShape && tSpan) {
+      tSpan.setAttribute('d', shapeStr);
+    }
+  }
+  while (i < this.textSpans.length) {
+    this.textSpans[i].style.display = 'none';
+    i += 1;
+  }
+
+  this._sizeChanged = true;
+};
+
+SVGTextLottieElement.prototype.sourceRectAtTime = function () {
+  this.prepareFrame(this.comp.renderedFrame - this.data.st);
+  this.renderInnerContent();
+  if (this._sizeChanged) {
+    this._sizeChanged = false;
+    var textBox = this.layerElement.getBBox();
+    this.bbox = {
+      top: textBox.y,
+      left: textBox.x,
+      width: textBox.width,
+      height: textBox.height,
+    };
+  }
+  return this.bbox;
+};
+
+SVGTextLottieElement.prototype.renderInnerContent = function () {
+  if (!this.data.singleShape) {
+    this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
+    if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
+      this._sizeChanged = true;
+      var i;
+      var len;
+      var renderedLetters = this.textAnimator.renderedLetters;
+
+      var letters = this.textProperty.currentData.l;
+
+      len = letters.length;
+      var renderedLetter;
+      var textSpan;
+      for (i = 0; i < len; i += 1) {
+        if (!letters[i].n) {
+          renderedLetter = renderedLetters[i];
+          textSpan = this.textSpans[i];
+          if (renderedLetter._mdf.m) {
+            textSpan.setAttribute('transform', renderedLetter.m);
+          }
+          if (renderedLetter._mdf.o) {
+            textSpan.setAttribute('opacity', renderedLetter.o);
+          }
+          if (renderedLetter._mdf.sw) {
+            textSpan.setAttribute('stroke-width', renderedLetter.sw);
+          }
+          if (renderedLetter._mdf.sc) {
+            textSpan.setAttribute('stroke', renderedLetter.sc);
+          }
+          if (renderedLetter._mdf.fc) {
+            textSpan.setAttribute('fill', renderedLetter.fc);
+          }
+        }
+      }
+    }
+  }
+};
+
+/* global extendPrototype, BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement,
+FrameElement, RenderableDOMElement, Matrix, SVGStyleData, SVGStrokeStyleData, SVGFillStyleData,
+SVGGradientFillStyleData, SVGGradientStrokeStyleData, locationHref, getBlendMode, ShapeGroupData,
+TransformPropertyFactory, SVGTransformData, ShapePropertyFactory, SVGShapeData, SVGElementsRenderer, ShapeModifiers */
+
+function SVGShapeElement(data, globalData, comp) {
+  // List of drawable elements
+  this.shapes = [];
+  // Full shape data
+  this.shapesData = data.shapes;
+  // List of styles that will be applied to shapes
+  this.stylesList = [];
+  // List of modifiers that will be applied to shapes
+  this.shapeModifiers = [];
+  // List of items in shape tree
+  this.itemsData = [];
+  // List of items in previous shape tree
+  this.processedElements = [];
+  // List of animated components
+  this.animatedContents = [];
+  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.
+  // List of elements that have been created
+  this.prevViewData = [];
+  // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
 }
 
-SVGTextElement.prototype.buildNewText = function(){
-    var i, len;
+extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
 
-    var documentData = this.textProperty.currentData;
-    this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
-    if(documentData.fc) {
-        this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
-    }else{
-        this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
-    }
-    if(documentData.sc){
-        this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
-        this.layerElement.setAttribute('stroke-width', documentData.sw);
-    }
-    this.layerElement.setAttribute('font-size', documentData.finalSize);
-    var fontData = this.globalData.fontManager.getFontByName(documentData.f);
-    if(fontData.fClass){
-        this.layerElement.setAttribute('class',fontData.fClass);
-    } else {
-        this.layerElement.setAttribute('font-family', fontData.fFamily);
-        var fWeight = documentData.fWeight, fStyle = documentData.fStyle;
-        this.layerElement.setAttribute('font-style', fStyle);
-        this.layerElement.setAttribute('font-weight', fWeight);
-    }
-    this.layerElement.setAttribute('aria-label', documentData.t);
-
-    var letters = documentData.l || [];
-    var usesGlyphs = !!this.globalData.fontManager.chars;
-    len = letters.length;
-
-    var tSpan;
-    var matrixHelper = this.mHelper;
-    var shapes, shapeStr = '', singleShape = this.data.singleShape;
-    var xPos = 0, yPos = 0, firstLine = true;
-    var trackingOffset = documentData.tr/1000*documentData.finalSize;
-    if(singleShape && !usesGlyphs && !documentData.sz) {
-        var tElement = this.textContainer;
-        var justify = 'start';
-        switch(documentData.j) {
-            case 1:
-                justify = 'end';
-                break;
-            case 2:
-                justify = 'middle';
-                break;
-        }
-        tElement.setAttribute('text-anchor',justify);
-        tElement.setAttribute('letter-spacing',trackingOffset);
-        var textContent = this.buildTextContents(documentData.finalText);
-        len = textContent.length;
-        yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
-        for ( i = 0; i < len; i += 1) {
-            tSpan = this.textSpans[i] || createNS('tspan');
-            tSpan.textContent = textContent[i];
-            tSpan.setAttribute('x', 0);
-            tSpan.setAttribute('y', yPos);
-            tSpan.style.display = 'inherit';
-            tElement.appendChild(tSpan);
-            this.textSpans[i] = tSpan;
-            yPos += documentData.finalLineHeight;
-        }
-        
-        this.layerElement.appendChild(tElement);
-    } else {
-        var cachedSpansLength = this.textSpans.length;
-        var shapeData, charData;
-        for (i = 0; i < len; i += 1) {
-            if(!usesGlyphs || !singleShape || i === 0){
-                tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs?'path':'text');
-                if (cachedSpansLength <= i) {
-                    tSpan.setAttribute('stroke-linecap', 'butt');
-                    tSpan.setAttribute('stroke-linejoin','round');
-                    tSpan.setAttribute('stroke-miterlimit','4');
-                    this.textSpans[i] = tSpan;
-                    this.layerElement.appendChild(tSpan);
-                }
-                tSpan.style.display = 'inherit';
-            }
-            
-            matrixHelper.reset();
-            matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
-            if (singleShape) {
-                if(letters[i].n) {
-                    xPos = -trackingOffset;
-                    yPos += documentData.yOffset;
-                    yPos += firstLine ? 1 : 0;
-                    firstLine = false;
-                }
-                this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
-                xPos += letters[i].l || 0;
-                //xPos += letters[i].val === ' ' ? 0 : trackingOffset;
-                xPos += trackingOffset;
-            }
-            if(usesGlyphs) {
-                charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
-                shapeData = charData && charData.data || {};
-                shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
-                if(!singleShape){
-                    tSpan.setAttribute('d',this.createPathShape(matrixHelper,shapes));
-                } else {
-                    shapeStr += this.createPathShape(matrixHelper,shapes);
-                }
-            } else {
-                if(singleShape) {
-                    tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")");
-                }
-                tSpan.textContent = letters[i].val;
-                tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
-            }
-            //
-        }
-        if (singleShape && tSpan) {
-            tSpan.setAttribute('d',shapeStr);
-        }
-    }
-    while (i < this.textSpans.length){
-        this.textSpans[i].style.display = 'none';
-        i += 1;
-    }
-    
-    this._sizeChanged = true;
-};
-
-SVGTextElement.prototype.sourceRectAtTime = function(time){
-    this.prepareFrame(this.comp.renderedFrame - this.data.st);
-    this.renderInnerContent();
-    if(this._sizeChanged){
-        this._sizeChanged = false;
-        var textBox = this.layerElement.getBBox();
-        this.bbox = {
-            top: textBox.y,
-            left: textBox.x,
-            width: textBox.width,
-            height: textBox.height
-        };
-    }
-    return this.bbox;
-};
-
-SVGTextElement.prototype.renderInnerContent = function(){
-
-    if(!this.data.singleShape){
-        this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
-        if(this.lettersChangedFlag || this.textAnimator.lettersChangedFlag){
-            this._sizeChanged = true;
-            var  i,len;
-            var renderedLetters = this.textAnimator.renderedLetters;
-
-            var letters = this.textProperty.currentData.l;
-
-            len = letters.length;
-            var renderedLetter, textSpan;
-            for(i=0;i<len;i+=1){
-                if(letters[i].n){
-                    continue;
-                }
-                renderedLetter = renderedLetters[i];
-                textSpan = this.textSpans[i];
-                if(renderedLetter._mdf.m) {
-                    textSpan.setAttribute('transform',renderedLetter.m);
-                }
-                if(renderedLetter._mdf.o) {
-                    textSpan.setAttribute('opacity',renderedLetter.o);
-                }
-                if(renderedLetter._mdf.sw){
-                    textSpan.setAttribute('stroke-width',renderedLetter.sw);
-                }
-                if(renderedLetter._mdf.sc){
-                    textSpan.setAttribute('stroke',renderedLetter.sc);
-                }
-                if(renderedLetter._mdf.fc){
-                    textSpan.setAttribute('fill',renderedLetter.fc);
-                }
-            }
-        }
-    }
-};
-
-function SVGShapeElement(data,globalData,comp){
-    //List of drawable elements
-    this.shapes = [];
-    // Full shape data
-    this.shapesData = data.shapes;
-    //List of styles that will be applied to shapes
-    this.stylesList = [];
-    //List of modifiers that will be applied to shapes
-    this.shapeModifiers = [];
-    //List of items in shape tree
-    this.itemsData = [];
-    //List of items in previous shape tree
-    this.processedElements = [];
-    // List of animated components
-    this.animatedContents = [];
-    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.
-    // List of elements that have been created
-    this.prevViewData = [];
-    //Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
-}
-
-extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement], SVGShapeElement);
-
-SVGShapeElement.prototype.initSecondaryElement = function() {
+SVGShapeElement.prototype.initSecondaryElement = function () {
 };
 
 SVGShapeElement.prototype.identityMatrix = new Matrix();
 
-SVGShapeElement.prototype.buildExpressionInterface = function(){};
+SVGShapeElement.prototype.buildExpressionInterface = function () {};
 
-SVGShapeElement.prototype.createContent = function(){
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
+SVGShapeElement.prototype.createContent = function () {
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
 };
 
 /*
 This method searches for multiple shapes that affect a single element and one of them is animated
 */
-SVGShapeElement.prototype.filterUniqueShapes = function(){
-    var i, len = this.shapes.length, shape;
-    var j, jLen = this.stylesList.length;
-    var style, count = 0;
-    var tempShapes = [];
-    var areAnimated = false;
-    for(j = 0; j < jLen; j += 1) {
-        style = this.stylesList[j];
-        areAnimated = false;
-        tempShapes.length = 0;
-        for(i = 0; i < len; i += 1) {
-            shape = this.shapes[i];
-            if(shape.styles.indexOf(style) !== -1) {
-                tempShapes.push(shape);
-                areAnimated = shape._isAnimated || areAnimated;
-            }
-        }
-        if(tempShapes.length > 1 && areAnimated) {
-            this.setShapesAsAnimated(tempShapes);
-        }
-    }
-}
-
-SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){
-    var i, len = shapes.length;
-    for(i = 0; i < len; i += 1) {
-        shapes[i].setAsAnimated();
-    }
-}
-
-SVGShapeElement.prototype.createStyleElement = function(data, level){
-    //TODO: prevent drawing of hidden styles
-    var elementData;
-    var styleOb = new SVGStyleData(data, level);
-
-    var pathElement = styleOb.pElem;
-    if(data.ty === 'st') {
-        elementData = new SVGStrokeStyleData(this, data, styleOb);
-    } else if(data.ty === 'fl') {
-        elementData = new SVGFillStyleData(this, data, styleOb);
-    } else if(data.ty === 'gf' || data.ty === 'gs') {
-        var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
-        elementData = new gradientConstructor(this, data, styleOb);
-        this.globalData.defs.appendChild(elementData.gf);
-        if (elementData.maskId) {
-            this.globalData.defs.appendChild(elementData.ms);
-            this.globalData.defs.appendChild(elementData.of);
-            pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')');
-        }
-    }
-    
-    if(data.ty === 'st' || data.ty === 'gs') {
-        pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
-        pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round');
-        pathElement.setAttribute('fill-opacity','0');
-        if(data.lj === 1) {
-            pathElement.setAttribute('stroke-miterlimit',data.ml);
-        }
-    }
-
-    if(data.r === 2) {
-        pathElement.setAttribute('fill-rule', 'evenodd');
-    }
-
-    if(data.ln){
-        pathElement.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        pathElement.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    this.stylesList.push(styleOb);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createGroupElement = function(data) {
-    var elementData = new ShapeGroupData();
-    if(data.ln){
-        elementData.gr.setAttribute('id',data.ln);
-    }
-    if(data.cl){
-        elementData.gr.setAttribute('class',data.cl);
-    }
-    if(data.bm){
-        elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
-    }
-    return elementData;
-};
-
-SVGShapeElement.prototype.createTransformElement = function(data, container) {
-    var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this);
-    var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) {
-    var ty = 4;
-    if(data.ty === 'rc'){
-        ty = 5;
-    }else if(data.ty === 'el'){
-        ty = 6;
-    }else if(data.ty === 'sr'){
-        ty = 7;
-    }
-    var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this);
-    var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
-    this.shapes.push(elementData);
-    this.addShapeToModifiers(elementData);
-    this.addToAnimatedContents(data, elementData);
-    return elementData;
-};
-
-SVGShapeElement.prototype.addToAnimatedContents = function(data, element) {
-    var i = 0, len = this.animatedContents.length;
-    while(i < len) {
-        if(this.animatedContents[i].element === element) {
-            return;
-        }
-        i += 1;
-    }
-    this.animatedContents.push({
-        fn: SVGElementsRenderer.createRenderFunction(data),
-        element: element,
-        data: data
-    });
-};
-
-SVGShapeElement.prototype.setElementStyles = function(elementData){
-    var arr = elementData.styles;
-    var j, jLen = this.stylesList.length;
-    for (j = 0; j < jLen; j += 1) {
-        if (!this.stylesList[j].closed) {
-            arr.push(this.stylesList[j]);
-        }
-    }
-};
-
-SVGShapeElement.prototype.reloadShapes = function(){
-    this._isFirstFrame = true;
-    var i, len = this.itemsData.length;
-    for( i = 0; i < len; i += 1) {
-        this.prevViewData[i] = this.itemsData[i];
-    }
-    this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true);
-    this.filterUniqueShapes();
-    len = this.dynamicProperties.length;
-    for(i = 0; i < len; i += 1) {
-        this.dynamicProperties[i].getValue();
-    }
-    this.renderModifiers();
-};
-
-SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){
-    var ownTransformers = [].concat(transformers);
-    var i, len = arr.length - 1;
-    var j, jLen;
-    var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos;
-    for(i=len;i>=0;i-=1){
-        processedPos = this.searchProcessedElement(arr[i]);
-        if(!processedPos){
-            arr[i]._render = render;
-        } else {
-            itemsData[i] = prevViewData[processedPos - 1];
-        }
-        if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){
-            if(!processedPos){
-                itemsData[i] = this.createStyleElement(arr[i], level);
-            } else {
-                itemsData[i].style.closed = false;
-            }
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].style.pElem);
-            }
-            ownStyles.push(itemsData[i].style);
-        }else if(arr[i].ty == 'gr'){
-            if(!processedPos){
-                itemsData[i] = this.createGroupElement(arr[i]);
-            } else {
-                jLen = itemsData[i].it.length;
-                for(j=0;j<jLen;j+=1){
-                    itemsData[i].prevViewData[j] = itemsData[i].it[j];
-                }
-            }
-            this.searchShapes(arr[i].it,itemsData[i].it,itemsData[i].prevViewData,itemsData[i].gr, level + 1, ownTransformers, render);
-            if(arr[i]._render){
-                container.appendChild(itemsData[i].gr);
-            }
-        }else if(arr[i].ty == 'tr'){
-            if(!processedPos){
-                itemsData[i] = this.createTransformElement(arr[i], container);
-            }
-            currentTransform = itemsData[i].transform;
-            ownTransformers.push(currentTransform);
-        }else if(arr[i].ty == 'sh' || arr[i].ty == 'rc' || arr[i].ty == 'el' || arr[i].ty == 'sr'){
-            if(!processedPos){
-                itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
-            }
-            this.setElementStyles(itemsData[i]);
-
-        }else if(arr[i].ty == 'tm' || arr[i].ty == 'rd' || arr[i].ty == 'ms' || arr[i].ty == 'pb'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                modifier.init(this,arr[i]);
-                itemsData[i] = modifier;
-                this.shapeModifiers.push(modifier);
-            } else {
-                modifier = itemsData[i];
-                modifier.closed = false;
-            }
-            ownModifiers.push(modifier);
-        }else if(arr[i].ty == 'rp'){
-            if(!processedPos){
-                modifier = ShapeModifiers.getModifier(arr[i].ty);
-                itemsData[i] = modifier;
-                modifier.init(this,arr,i,itemsData);
-                this.shapeModifiers.push(modifier);
-                render = false;
-            }else{
-                modifier = itemsData[i];
-                modifier.closed = true;
-            }
-            ownModifiers.push(modifier);
-        }
-        this.addProcessedElement(arr[i], i + 1);
-    }
-    len = ownStyles.length;
-    for(i=0;i<len;i+=1){
-        ownStyles[i].closed = true;
-    }
-    len = ownModifiers.length;
-    for(i=0;i<len;i+=1){
-        ownModifiers[i].closed = true;
-    }
-};
-
-SVGShapeElement.prototype.renderInnerContent = function() {
-    this.renderModifiers();
-    var i, len = this.stylesList.length;
-    for(i=0;i<len;i+=1){
-        this.stylesList[i].reset();
-    }
-    this.renderShape();
-
+SVGShapeElement.prototype.filterUniqueShapes = function () {
+  var i;
+  var len = this.shapes.length;
+  var shape;
+  var j;
+  var jLen = this.stylesList.length;
+  var style;
+  var tempShapes = [];
+  var areAnimated = false;
+  for (j = 0; j < jLen; j += 1) {
+    style = this.stylesList[j];
+    areAnimated = false;
+    tempShapes.length = 0;
     for (i = 0; i < len; i += 1) {
-        if (this.stylesList[i]._mdf || this._isFirstFrame) {
-            if(this.stylesList[i].msElem){
-                this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
-                //Adding M0 0 fixes same mask bug on all browsers
-                this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
-            }
-            this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
-        }
+      shape = this.shapes[i];
+      if (shape.styles.indexOf(style) !== -1) {
+        tempShapes.push(shape);
+        areAnimated = shape._isAnimated || areAnimated;
+      }
     }
+    if (tempShapes.length > 1 && areAnimated) {
+      this.setShapesAsAnimated(tempShapes);
+    }
+  }
 };
 
-SVGShapeElement.prototype.renderShape = function() {
-    var i, len = this.animatedContents.length;
-    var animatedContent;
-    for(i = 0; i < len; i += 1) {
-        animatedContent = this.animatedContents[i];
-        if((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
-            animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
-        }
-    }
-}
-
-SVGShapeElement.prototype.destroy = function(){
-    this.destroyBaseElement();
-    this.shapesData = null;
-    this.itemsData = null;
+SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
+  var i;
+  var len = shapes.length;
+  for (i = 0; i < len; i += 1) {
+    shapes[i].setAsAnimated();
+  }
 };
 
-function SVGTintFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    feColorMatrix.setAttribute('result','f2');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-    if(filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k){
-        var feMerge = createNS('feMerge');
-        filter.appendChild(feMerge);
-        var feMergeNode;
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','SourceGraphic');
-        feMerge.appendChild(feMergeNode);
-        feMergeNode = createNS('feMergeNode');
-        feMergeNode.setAttribute('in','f2');
-        feMerge.appendChild(feMergeNode);
-    }
-}
+SVGShapeElement.prototype.createStyleElement = function (data, level) {
+  // TODO: prevent drawing of hidden styles
+  var elementData;
+  var styleOb = new SVGStyleData(data, level);
 
-SVGTintFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var colorBlack = this.filterManager.effectElements[0].p.v;
-        var colorWhite = this.filterManager.effectElements[1].p.v;
-        var opacity = this.filterManager.effectElements[2].p.v/100;
-        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 ' + opacity + ' 0');
+  var pathElement = styleOb.pElem;
+  if (data.ty === 'st') {
+    elementData = new SVGStrokeStyleData(this, data, styleOb);
+  } else if (data.ty === 'fl') {
+    elementData = new SVGFillStyleData(this, data, styleOb);
+  } else if (data.ty === 'gf' || data.ty === 'gs') {
+    var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
+    elementData = new GradientConstructor(this, data, styleOb);
+    this.globalData.defs.appendChild(elementData.gf);
+    if (elementData.maskId) {
+      this.globalData.defs.appendChild(elementData.ms);
+      this.globalData.defs.appendChild(elementData.of);
+      pathElement.setAttribute('mask', 'url(' + locationHref + '#' + elementData.maskId + ')');
     }
+  }
+
+  if (data.ty === 'st' || data.ty === 'gs') {
+    pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round');
+    pathElement.setAttribute('stroke-linejoin', this.ljEnum[data.lj] || 'round');
+    pathElement.setAttribute('fill-opacity', '0');
+    if (data.lj === 1) {
+      pathElement.setAttribute('stroke-miterlimit', data.ml);
+    }
+  }
+
+  if (data.r === 2) {
+    pathElement.setAttribute('fill-rule', 'evenodd');
+  }
+
+  if (data.ln) {
+    pathElement.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    pathElement.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  this.stylesList.push(styleOb);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
 };
-function SVGFillFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
-    feColorMatrix.setAttribute('values','1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
-    filter.appendChild(feColorMatrix);
-    this.matrixFilter = feColorMatrix;
-}
-SVGFillFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color = this.filterManager.effectElements[2].p.v;
-        var opacity = this.filterManager.effectElements[6].p.v;
-        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');
-    }
+
+SVGShapeElement.prototype.createGroupElement = function (data) {
+  var elementData = new ShapeGroupData();
+  if (data.ln) {
+    elementData.gr.setAttribute('id', data.ln);
+  }
+  if (data.cl) {
+    elementData.gr.setAttribute('class', data.cl);
+  }
+  if (data.bm) {
+    elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
+  }
+  return elementData;
 };
-function SVGGaussianBlurEffect(filter, filterManager){
-    // Outset the filter region by 100% on all sides to accommodate blur expansion.
-    filter.setAttribute('x','-100%');
-    filter.setAttribute('y','-100%');
-    filter.setAttribute('width','300%');
-    filter.setAttribute('height','300%');
 
-    this.filterManager = filterManager;
-    var feGaussianBlur = createNS('feGaussianBlur');
-    filter.appendChild(feGaussianBlur);
-    this.feGaussianBlur = feGaussianBlur;
-}
+SVGShapeElement.prototype.createTransformElement = function (data, container) {
+  var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
+  var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-SVGGaussianBlurEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        // Empirical value, matching AE's blur appearance.
-        var kBlurrinessToSigma = 0.3;
-        var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
+  var ty = 4;
+  if (data.ty === 'rc') {
+    ty = 5;
+  } else if (data.ty === 'el') {
+    ty = 6;
+  } else if (data.ty === 'sr') {
+    ty = 7;
+  }
+  var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
+  var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
+  this.shapes.push(elementData);
+  this.addShapeToModifiers(elementData);
+  this.addToAnimatedContents(data, elementData);
+  return elementData;
+};
 
-        // Dimensions mapping:
-        //
-        //   1 -> horizontal & vertical
-        //   2 -> horizontal only
-        //   3 -> vertical only
-        //
-        var dimensions = this.filterManager.effectElements[1].p.v;
-        var sigmaX = (dimensions == 3) ? 0 : sigma;
-        var sigmaY = (dimensions == 2) ? 0 : sigma;
-
-        this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + " " + sigmaY);
-
-        // Repeat edges mapping:
-        //
-        //   0 -> off -> duplicate
-        //   1 -> on  -> wrap
-        var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate';
-        this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
+  var i = 0;
+  var len = this.animatedContents.length;
+  while (i < len) {
+    if (this.animatedContents[i].element === element) {
+      return;
     }
-}
-function SVGStrokeEffect(elem, filterManager){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.elem = elem;
-    this.paths = [];
-}
+    i += 1;
+  }
+  this.animatedContents.push({
+    fn: SVGElementsRenderer.createRenderFunction(data),
+    element: element,
+    data: data,
+  });
+};
 
-SVGStrokeEffect.prototype.initialize = function(){
+SVGShapeElement.prototype.setElementStyles = function (elementData) {
+  var arr = elementData.styles;
+  var j;
+  var jLen = this.stylesList.length;
+  for (j = 0; j < jLen; j += 1) {
+    if (!this.stylesList[j].closed) {
+      arr.push(this.stylesList[j]);
+    }
+  }
+};
 
-    var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-    var path,groupPath, i, len;
-    if(this.filterManager.effectElements[1].p.v === 1){
-        len = this.elem.maskManager.masksProperties.length;
-        i = 0;
+SVGShapeElement.prototype.reloadShapes = function () {
+  this._isFirstFrame = true;
+  var i;
+  var len = this.itemsData.length;
+  for (i = 0; i < len; i += 1) {
+    this.prevViewData[i] = this.itemsData[i];
+  }
+  this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
+  this.filterUniqueShapes();
+  len = this.dynamicProperties.length;
+  for (i = 0; i < len; i += 1) {
+    this.dynamicProperties[i].getValue();
+  }
+  this.renderModifiers();
+};
+
+SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
+  var ownTransformers = [].concat(transformers);
+  var i;
+  var len = arr.length - 1;
+  var j;
+  var jLen;
+  var ownStyles = [];
+  var ownModifiers = [];
+  var currentTransform;
+  var modifier;
+  var processedPos;
+  for (i = len; i >= 0; i -= 1) {
+    processedPos = this.searchProcessedElement(arr[i]);
+    if (!processedPos) {
+      arr[i]._render = render;
     } else {
-        i = this.filterManager.effectElements[0].p.v - 1;
-        len = i + 1;
+      itemsData[i] = prevViewData[processedPos - 1];
     }
-    groupPath = createNS('g'); 
-    groupPath.setAttribute('fill','none');
-    groupPath.setAttribute('stroke-linecap','round');
-    groupPath.setAttribute('stroke-dashoffset',1);
-    for(i;i<len;i+=1){
-        path = createNS('path');
-        groupPath.appendChild(path);
-        this.paths.push({p:path,m:i});
-    }
-    if(this.filterManager.effectElements[10].p.v === 3){
-        var mask = createNS('mask');
-        var id = createElementID();
-        mask.setAttribute('id',id);
-        mask.setAttribute('mask-type','alpha');
-        mask.appendChild(groupPath);
-        this.elem.globalData.defs.appendChild(mask);
-        var g = createNS('g');
-        g.setAttribute('mask','url(' + locationHref + '#'+id+')');
-        while (elemChildren[0]) {
-            g.appendChild(elemChildren[0]);
+    if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
+      if (!processedPos) {
+        itemsData[i] = this.createStyleElement(arr[i], level);
+      } else {
+        itemsData[i].style.closed = false;
+      }
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].style.pElem);
+      }
+      ownStyles.push(itemsData[i].style);
+    } else if (arr[i].ty === 'gr') {
+      if (!processedPos) {
+        itemsData[i] = this.createGroupElement(arr[i]);
+      } else {
+        jLen = itemsData[i].it.length;
+        for (j = 0; j < jLen; j += 1) {
+          itemsData[i].prevViewData[j] = itemsData[i].it[j];
         }
-        this.elem.layerElement.appendChild(g);
-        this.masker = mask;
-        groupPath.setAttribute('stroke','#fff');
-    } else if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(this.filterManager.effectElements[10].p.v === 2){
-            elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
-            while(elemChildren.length){
-                this.elem.layerElement.removeChild(elemChildren[0]);
-            }
-        }
-        this.elem.layerElement.appendChild(groupPath);
-        this.elem.layerElement.removeAttribute('mask');
-        groupPath.setAttribute('stroke','#fff');
+      }
+      this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
+      if (arr[i]._render) {
+        container.appendChild(itemsData[i].gr);
+      }
+    } else if (arr[i].ty === 'tr') {
+      if (!processedPos) {
+        itemsData[i] = this.createTransformElement(arr[i], container);
+      }
+      currentTransform = itemsData[i].transform;
+      ownTransformers.push(currentTransform);
+    } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
+      if (!processedPos) {
+        itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
+      }
+      this.setElementStyles(itemsData[i]);
+    } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        modifier.init(this, arr[i]);
+        itemsData[i] = modifier;
+        this.shapeModifiers.push(modifier);
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = false;
+      }
+      ownModifiers.push(modifier);
+    } else if (arr[i].ty === 'rp') {
+      if (!processedPos) {
+        modifier = ShapeModifiers.getModifier(arr[i].ty);
+        itemsData[i] = modifier;
+        modifier.init(this, arr, i, itemsData);
+        this.shapeModifiers.push(modifier);
+        render = false;
+      } else {
+        modifier = itemsData[i];
+        modifier.closed = true;
+      }
+      ownModifiers.push(modifier);
     }
-    this.initialized = true;
-    this.pathMasker = groupPath;
+    this.addProcessedElement(arr[i], i + 1);
+  }
+  len = ownStyles.length;
+  for (i = 0; i < len; i += 1) {
+    ownStyles[i].closed = true;
+  }
+  len = ownModifiers.length;
+  for (i = 0; i < len; i += 1) {
+    ownModifiers[i].closed = true;
+  }
 };
 
-SVGStrokeEffect.prototype.renderFrame = function(forceRender){
-    if(!this.initialized){
-        this.initialize();
-    }
-    var i, len = this.paths.length;
-    var mask, path;
-    for(i=0;i<len;i+=1){
-        if(this.paths[i].m === -1) {
-            continue;
-        }
-        mask = this.elem.maskManager.viewData[this.paths[i].m];
-        path = this.paths[i].p;
-        if(forceRender || this.filterManager._mdf || mask.prop._mdf){
-            path.setAttribute('d',mask.lastPath);
-        }
-        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){
-            var dasharrayValue;
-            if(this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100){
-                var s = Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var e = Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100;
-                var l = path.getTotalLength();
-                dasharrayValue = '0 0 0 ' + l*s + ' ';
-                var lineLength = l*(e-s);
-                var segment = 1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-                var units = Math.floor(lineLength/segment);
-                var j;
-                for(j=0;j<units;j+=1){
-                    dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100 + ' ';
-                }
-                dasharrayValue += '0 ' + l*10 + ' 0 0';
-            } else {
-                dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v/100;
-            }
-            path.setAttribute('stroke-dasharray',dasharrayValue);
-        }
-    }
-    if(forceRender || this.filterManager.effectElements[4].p._mdf){
-        this.pathMasker.setAttribute('stroke-width',this.filterManager.effectElements[4].p.v*2);
-    }
-    
-    if(forceRender || this.filterManager.effectElements[6].p._mdf){
-        this.pathMasker.setAttribute('opacity',this.filterManager.effectElements[6].p.v);
-    }
-    if(this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2){
-        if(forceRender || this.filterManager.effectElements[3].p._mdf){
-            var color = this.filterManager.effectElements[3].p.v;
-            this.pathMasker.setAttribute('stroke','rgb('+bm_floor(color[0]*255)+','+bm_floor(color[1]*255)+','+bm_floor(color[2]*255)+')');
-        }
-    }
-};
-function SVGTritoneFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var feColorMatrix = createNS('feColorMatrix');
-    feColorMatrix.setAttribute('type','matrix');
-    feColorMatrix.setAttribute('color-interpolation-filters','linearRGB');
-    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');
-    feColorMatrix.setAttribute('result','f1');
-    filter.appendChild(feColorMatrix);
-    var feComponentTransfer = createNS('feComponentTransfer');
-    feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-    filter.appendChild(feComponentTransfer);
-    this.matrixFilter = feComponentTransfer;
-    var feFuncR = createNS('feFuncR');
-    feFuncR.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncR);
-    this.feFuncR = feFuncR;
-    var feFuncG = createNS('feFuncG');
-    feFuncG.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncG);
-    this.feFuncG = feFuncG;
-    var feFuncB = createNS('feFuncB');
-    feFuncB.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFuncB);
-    this.feFuncB = feFuncB;
-}
+SVGShapeElement.prototype.renderInnerContent = function () {
+  this.renderModifiers();
+  var i;
+  var len = this.stylesList.length;
+  for (i = 0; i < len; i += 1) {
+    this.stylesList[i].reset();
+  }
+  this.renderShape();
 
-SVGTritoneFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var color1 = this.filterManager.effectElements[0].p.v;
-        var color2 = this.filterManager.effectElements[1].p.v;
-        var color3 = this.filterManager.effectElements[2].p.v;
-        var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
-        var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
-        var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
-        this.feFuncR.setAttribute('tableValues', tableR);
-        this.feFuncG.setAttribute('tableValues', tableG);
-        this.feFuncB.setAttribute('tableValues', tableB);
-        //var opacity = this.filterManager.effectElements[2].p.v/100;
-        //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 ' + opacity + ' 0');
+  for (i = 0; i < len; i += 1) {
+    if (this.stylesList[i]._mdf || this._isFirstFrame) {
+      if (this.stylesList[i].msElem) {
+        this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
+        // Adding M0 0 fixes same mask bug on all browsers
+        this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
+      }
+      this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
     }
-};
-function SVGProLevelsFilter(filter, filterManager){
-    this.filterManager = filterManager;
-    var effectElements = this.filterManager.effectElements;
-    var feComponentTransfer = createNS('feComponentTransfer');
-    var feFuncR, feFuncG, feFuncB;
-    
-    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){
-        this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
-    }
-    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){
-        this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
-    }
-    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){
-        this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-    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){
-        this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
-    }
-    
-    if(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA){
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        feComponentTransfer = createNS('feComponentTransfer');
-    }
-
-    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){
-
-        feComponentTransfer.setAttribute('color-interpolation-filters','sRGB');
-        filter.appendChild(feComponentTransfer);
-        this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
-        this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
-        this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
-    }
-}
-
-SVGProLevelsFilter.prototype.createFeFunc = function(type, feComponentTransfer) {
-    var feFunc = createNS(type);
-    feFunc.setAttribute('type','table');
-    feComponentTransfer.appendChild(feFunc);
-    return feFunc;
+  }
 };
 
-SVGProLevelsFilter.prototype.getTableValue = function(inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
-    var cnt = 0;
-    var segments = 256;
-    var perc;
-    var min = Math.min(inputBlack, inputWhite);
-    var max = Math.max(inputBlack, inputWhite);
-    var table = Array.call(null,{length:segments});
-    var colorValue;
-    var pos = 0;
-    var outputDelta = outputWhite - outputBlack; 
-    var inputDelta = inputWhite - inputBlack; 
-    while(cnt <= 256) {
-        perc = cnt/256;
-        if(perc <= min){
-            colorValue = inputDelta < 0 ? outputWhite : outputBlack;
-        } else if(perc >= max){
-            colorValue = inputDelta < 0 ? outputBlack : outputWhite;
-        } else {
-            colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
-        }
-        table[pos++] = colorValue;
-        cnt += 256/(segments-1);
+SVGShapeElement.prototype.renderShape = function () {
+  var i;
+  var len = this.animatedContents.length;
+  var animatedContent;
+  for (i = 0; i < len; i += 1) {
+    animatedContent = this.animatedContents[i];
+    if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
+      animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
     }
-    return table.join(' ');
+  }
 };
 
-SVGProLevelsFilter.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        var val, cnt, perc, bezier;
-        var effectElements = this.filterManager.effectElements;
-        if(this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)){
-            val = this.getTableValue(effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v,effectElements[7].p.v);
-            this.feFuncRComposed.setAttribute('tableValues',val);
-            this.feFuncGComposed.setAttribute('tableValues',val);
-            this.feFuncBComposed.setAttribute('tableValues',val);
-        }
-
-
-        if(this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)){
-            val = this.getTableValue(effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v,effectElements[14].p.v);
-            this.feFuncR.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)){
-            val = this.getTableValue(effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v,effectElements[21].p.v);
-            this.feFuncG.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)){
-            val = this.getTableValue(effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v,effectElements[28].p.v);
-            this.feFuncB.setAttribute('tableValues',val);
-        }
-
-        if(this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)){
-            val = this.getTableValue(effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v,effectElements[35].p.v);
-            this.feFuncA.setAttribute('tableValues',val);
-        }
-        
-    }
+SVGShapeElement.prototype.destroy = function () {
+  this.destroyBaseElement();
+  this.shapesData = null;
+  this.itemsData = null;
 };
-function SVGDropShadowEffect(filter, filterManager) {
-    var filterSize = filterManager.container.globalData.renderConfig.filterSize
-    filter.setAttribute('x', filterSize.x);
-    filter.setAttribute('y', filterSize.y);
-    filter.setAttribute('width', filterSize.width);
-    filter.setAttribute('height', filterSize.height);
-    this.filterManager = filterManager;
 
-    var feGaussianBlur = createNS('feGaussianBlur');
-    feGaussianBlur.setAttribute('in','SourceAlpha');
-    feGaussianBlur.setAttribute('result','drop_shadow_1');
-    feGaussianBlur.setAttribute('stdDeviation','0');
-    this.feGaussianBlur = feGaussianBlur;
-    filter.appendChild(feGaussianBlur);
+/* global createNS */
 
-    var feOffset = createNS('feOffset');
-    feOffset.setAttribute('dx','25');
-    feOffset.setAttribute('dy','0');
-    feOffset.setAttribute('in','drop_shadow_1');
-    feOffset.setAttribute('result','drop_shadow_2');
-    this.feOffset = feOffset;
-    filter.appendChild(feOffset);
-    var feFlood = createNS('feFlood');
-    feFlood.setAttribute('flood-color','#00ff00');
-    feFlood.setAttribute('flood-opacity','1');
-    feFlood.setAttribute('result','drop_shadow_3');
-    this.feFlood = feFlood;
-    filter.appendChild(feFlood);
-
-    var feComposite = createNS('feComposite');
-    feComposite.setAttribute('in','drop_shadow_3');
-    feComposite.setAttribute('in2','drop_shadow_2');
-    feComposite.setAttribute('operator','in');
-    feComposite.setAttribute('result','drop_shadow_4');
-    filter.appendChild(feComposite);
-
-
+function SVGTintFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  feColorMatrix.setAttribute('result', 'f2');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+  if (filterManager.effectElements[2].p.v !== 100 || filterManager.effectElements[2].p.k) {
     var feMerge = createNS('feMerge');
     filter.appendChild(feMerge);
     var feMergeNode;
     feMergeNode = createNS('feMergeNode');
+    feMergeNode.setAttribute('in', 'SourceGraphic');
     feMerge.appendChild(feMergeNode);
     feMergeNode = createNS('feMergeNode');
-    feMergeNode.setAttribute('in','SourceGraphic');
-    this.feMergeNode = feMergeNode;
-    this.feMerge = feMerge;
-    this.originalNodeAdded = false;
+    feMergeNode.setAttribute('in', 'f2');
     feMerge.appendChild(feMergeNode);
+  }
 }
 
-SVGDropShadowEffect.prototype.renderFrame = function(forceRender){
-    if(forceRender || this.filterManager._mdf){
-        if(forceRender || this.filterManager.effectElements[4].p._mdf){
-            this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+SVGTintFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var colorBlack = this.filterManager.effectElements[0].p.v;
+    var colorWhite = this.filterManager.effectElements[1].p.v;
+    var opacity = this.filterManager.effectElements[2].p.v / 100;
+    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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGFillFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
+  feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
+  filter.appendChild(feColorMatrix);
+  this.matrixFilter = feColorMatrix;
+}
+SVGFillFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color = this.filterManager.effectElements[2].p.v;
+    var opacity = this.filterManager.effectElements[6].p.v;
+    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');
+  }
+};
+
+/* global createNS */
+
+function SVGGaussianBlurEffect(filter, filterManager) {
+  // Outset the filter region by 100% on all sides to accommodate blur expansion.
+  filter.setAttribute('x', '-100%');
+  filter.setAttribute('y', '-100%');
+  filter.setAttribute('width', '300%');
+  filter.setAttribute('height', '300%');
+
+  this.filterManager = filterManager;
+  var feGaussianBlur = createNS('feGaussianBlur');
+  filter.appendChild(feGaussianBlur);
+  this.feGaussianBlur = feGaussianBlur;
+}
+
+SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    // Empirical value, matching AE's blur appearance.
+    var kBlurrinessToSigma = 0.3;
+    var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma;
+
+    // Dimensions mapping:
+    //
+    //   1 -> horizontal & vertical
+    //   2 -> horizontal only
+    //   3 -> vertical only
+    //
+    var dimensions = this.filterManager.effectElements[1].p.v;
+    var sigmaX = (dimensions == 3) ? 0 : sigma; // eslint-disable-line eqeqeq
+    var sigmaY = (dimensions == 2) ? 0 : sigma; // eslint-disable-line eqeqeq
+
+    this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + ' ' + sigmaY);
+
+    // Repeat edges mapping:
+    //
+    //   0 -> off -> duplicate
+    //   1 -> on  -> wrap
+    var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate'; // eslint-disable-line eqeqeq
+    this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
+  }
+};
+
+/* global createNS, createElementID, locationHref, bmFloor */
+
+function SVGStrokeEffect(elem, filterManager) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.elem = elem;
+  this.paths = [];
+}
+
+SVGStrokeEffect.prototype.initialize = function () {
+  var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+  var path;
+  var groupPath;
+  var i;
+  var len;
+  if (this.filterManager.effectElements[1].p.v === 1) {
+    len = this.elem.maskManager.masksProperties.length;
+    i = 0;
+  } else {
+    i = this.filterManager.effectElements[0].p.v - 1;
+    len = i + 1;
+  }
+  groupPath = createNS('g');
+  groupPath.setAttribute('fill', 'none');
+  groupPath.setAttribute('stroke-linecap', 'round');
+  groupPath.setAttribute('stroke-dashoffset', 1);
+  for (i; i < len; i += 1) {
+    path = createNS('path');
+    groupPath.appendChild(path);
+    this.paths.push({ p: path, m: i });
+  }
+  if (this.filterManager.effectElements[10].p.v === 3) {
+    var mask = createNS('mask');
+    var id = createElementID();
+    mask.setAttribute('id', id);
+    mask.setAttribute('mask-type', 'alpha');
+    mask.appendChild(groupPath);
+    this.elem.globalData.defs.appendChild(mask);
+    var g = createNS('g');
+    g.setAttribute('mask', 'url(' + locationHref + '#' + id + ')');
+    while (elemChildren[0]) {
+      g.appendChild(elemChildren[0]);
+    }
+    this.elem.layerElement.appendChild(g);
+    this.masker = mask;
+    groupPath.setAttribute('stroke', '#fff');
+  } else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (this.filterManager.effectElements[10].p.v === 2) {
+      elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
+      while (elemChildren.length) {
+        this.elem.layerElement.removeChild(elemChildren[0]);
+      }
+    }
+    this.elem.layerElement.appendChild(groupPath);
+    this.elem.layerElement.removeAttribute('mask');
+    groupPath.setAttribute('stroke', '#fff');
+  }
+  this.initialized = true;
+  this.pathMasker = groupPath;
+};
+
+SVGStrokeEffect.prototype.renderFrame = function (forceRender) {
+  if (!this.initialized) {
+    this.initialize();
+  }
+  var i;
+  var len = this.paths.length;
+  var mask;
+  var path;
+  for (i = 0; i < len; i += 1) {
+    if (this.paths[i].m !== -1) {
+      mask = this.elem.maskManager.viewData[this.paths[i].m];
+      path = this.paths[i].p;
+      if (forceRender || this.filterManager._mdf || mask.prop._mdf) {
+        path.setAttribute('d', mask.lastPath);
+      }
+      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) {
+        var dasharrayValue;
+        if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) {
+          var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
+          var l = path.getTotalLength();
+          dasharrayValue = '0 0 0 ' + l * s + ' ';
+          var lineLength = l * (e - s);
+          var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
+          var units = Math.floor(lineLength / segment);
+          var j;
+          for (j = 0; j < units; j += 1) {
+            dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' ';
+          }
+          dasharrayValue += '0 ' + l * 10 + ' 0 0';
+        } else {
+          dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
         }
-        if(forceRender || this.filterManager.effectElements[0].p._mdf){
-            var col = this.filterManager.effectElements[0].p.v;
-            this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255)));
-        }
-        if(forceRender || this.filterManager.effectElements[1].p._mdf){
-            this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255);
-        }
-        if(forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf){
-            var distance = this.filterManager.effectElements[3].p.v;
-            var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
-            var x = distance * Math.cos(angle);
-            var y = distance * Math.sin(angle);
-            this.feOffset.setAttribute('dx', x);
-            this.feOffset.setAttribute('dy', y);
-        }
-        /*if(forceRender || this.filterManager.effectElements[5].p._mdf){
+        path.setAttribute('stroke-dasharray', dasharrayValue);
+      }
+    }
+  }
+  if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+    this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2);
+  }
+
+  if (forceRender || this.filterManager.effectElements[6].p._mdf) {
+    this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v);
+  }
+  if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
+    if (forceRender || this.filterManager.effectElements[3].p._mdf) {
+      var color = this.filterManager.effectElements[3].p.v;
+      this.pathMasker.setAttribute('stroke', 'rgb(' + bmFloor(color[0] * 255) + ',' + bmFloor(color[1] * 255) + ',' + bmFloor(color[2] * 255) + ')');
+    }
+  }
+};
+
+/* global createNS */
+
+function SVGTritoneFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var feColorMatrix = createNS('feColorMatrix');
+  feColorMatrix.setAttribute('type', 'matrix');
+  feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
+  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');
+  feColorMatrix.setAttribute('result', 'f1');
+  filter.appendChild(feColorMatrix);
+  var feComponentTransfer = createNS('feComponentTransfer');
+  feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+  filter.appendChild(feComponentTransfer);
+  this.matrixFilter = feComponentTransfer;
+  var feFuncR = createNS('feFuncR');
+  feFuncR.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncR);
+  this.feFuncR = feFuncR;
+  var feFuncG = createNS('feFuncG');
+  feFuncG.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncG);
+  this.feFuncG = feFuncG;
+  var feFuncB = createNS('feFuncB');
+  feFuncB.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFuncB);
+  this.feFuncB = feFuncB;
+}
+
+SVGTritoneFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var color1 = this.filterManager.effectElements[0].p.v;
+    var color2 = this.filterManager.effectElements[1].p.v;
+    var color3 = this.filterManager.effectElements[2].p.v;
+    var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
+    var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
+    var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
+    this.feFuncR.setAttribute('tableValues', tableR);
+    this.feFuncG.setAttribute('tableValues', tableG);
+    this.feFuncB.setAttribute('tableValues', tableB);
+    // var opacity = this.filterManager.effectElements[2].p.v/100;
+    // 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 ' + opacity + ' 0');
+  }
+};
+
+/* global createNS */
+
+function SVGProLevelsFilter(filter, filterManager) {
+  this.filterManager = filterManager;
+  var effectElements = this.filterManager.effectElements;
+  var feComponentTransfer = createNS('feComponentTransfer');
+
+  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) {
+    this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
+  }
+  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) {
+    this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
+  }
+  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) {
+    this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+  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) {
+    this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
+  }
+
+  if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    feComponentTransfer = createNS('feComponentTransfer');
+  }
+
+  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) {
+    feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
+    filter.appendChild(feComponentTransfer);
+    this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
+    this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
+    this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
+  }
+}
+
+SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) {
+  var feFunc = createNS(type);
+  feFunc.setAttribute('type', 'table');
+  feComponentTransfer.appendChild(feFunc);
+  return feFunc;
+};
+
+SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
+  var cnt = 0;
+  var segments = 256;
+  var perc;
+  var min = Math.min(inputBlack, inputWhite);
+  var max = Math.max(inputBlack, inputWhite);
+  var table = Array.call(null, { length: segments });
+  var colorValue;
+  var pos = 0;
+  var outputDelta = outputWhite - outputBlack;
+  var inputDelta = inputWhite - inputBlack;
+  while (cnt <= 256) {
+    perc = cnt / 256;
+    if (perc <= min) {
+      colorValue = inputDelta < 0 ? outputWhite : outputBlack;
+    } else if (perc >= max) {
+      colorValue = inputDelta < 0 ? outputBlack : outputWhite;
+    } else {
+      colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma));
+    }
+    table[pos] = colorValue;
+    pos += 1;
+    cnt += 256 / (segments - 1);
+  }
+  return table.join(' ');
+};
+
+SVGProLevelsFilter.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    var val;
+    var effectElements = this.filterManager.effectElements;
+    if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) {
+      val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v);
+      this.feFuncRComposed.setAttribute('tableValues', val);
+      this.feFuncGComposed.setAttribute('tableValues', val);
+      this.feFuncBComposed.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) {
+      val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v);
+      this.feFuncR.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) {
+      val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v);
+      this.feFuncG.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) {
+      val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v);
+      this.feFuncB.setAttribute('tableValues', val);
+    }
+
+    if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) {
+      val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v);
+      this.feFuncA.setAttribute('tableValues', val);
+    }
+  }
+};
+
+/* global createNS, rgbToHex, degToRads */
+
+function SVGDropShadowEffect(filter, filterManager) {
+  var filterSize = filterManager.container.globalData.renderConfig.filterSize;
+  filter.setAttribute('x', filterSize.x);
+  filter.setAttribute('y', filterSize.y);
+  filter.setAttribute('width', filterSize.width);
+  filter.setAttribute('height', filterSize.height);
+  this.filterManager = filterManager;
+
+  var feGaussianBlur = createNS('feGaussianBlur');
+  feGaussianBlur.setAttribute('in', 'SourceAlpha');
+  feGaussianBlur.setAttribute('result', 'drop_shadow_1');
+  feGaussianBlur.setAttribute('stdDeviation', '0');
+  this.feGaussianBlur = feGaussianBlur;
+  filter.appendChild(feGaussianBlur);
+
+  var feOffset = createNS('feOffset');
+  feOffset.setAttribute('dx', '25');
+  feOffset.setAttribute('dy', '0');
+  feOffset.setAttribute('in', 'drop_shadow_1');
+  feOffset.setAttribute('result', 'drop_shadow_2');
+  this.feOffset = feOffset;
+  filter.appendChild(feOffset);
+  var feFlood = createNS('feFlood');
+  feFlood.setAttribute('flood-color', '#00ff00');
+  feFlood.setAttribute('flood-opacity', '1');
+  feFlood.setAttribute('result', 'drop_shadow_3');
+  this.feFlood = feFlood;
+  filter.appendChild(feFlood);
+
+  var feComposite = createNS('feComposite');
+  feComposite.setAttribute('in', 'drop_shadow_3');
+  feComposite.setAttribute('in2', 'drop_shadow_2');
+  feComposite.setAttribute('operator', 'in');
+  feComposite.setAttribute('result', 'drop_shadow_4');
+  filter.appendChild(feComposite);
+
+  var feMerge = createNS('feMerge');
+  filter.appendChild(feMerge);
+  var feMergeNode;
+  feMergeNode = createNS('feMergeNode');
+  feMerge.appendChild(feMergeNode);
+  feMergeNode = createNS('feMergeNode');
+  feMergeNode.setAttribute('in', 'SourceGraphic');
+  this.feMergeNode = feMergeNode;
+  this.feMerge = feMerge;
+  this.originalNodeAdded = false;
+  feMerge.appendChild(feMergeNode);
+}
+
+SVGDropShadowEffect.prototype.renderFrame = function (forceRender) {
+  if (forceRender || this.filterManager._mdf) {
+    if (forceRender || this.filterManager.effectElements[4].p._mdf) {
+      this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
+    }
+    if (forceRender || this.filterManager.effectElements[0].p._mdf) {
+      var col = this.filterManager.effectElements[0].p.v;
+      this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255)));
+    }
+    if (forceRender || this.filterManager.effectElements[1].p._mdf) {
+      this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255);
+    }
+    if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {
+      var distance = this.filterManager.effectElements[3].p.v;
+      var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
+      var x = distance * Math.cos(angle);
+      var y = distance * Math.sin(angle);
+      this.feOffset.setAttribute('dx', x);
+      this.feOffset.setAttribute('dy', y);
+    }
+    /* if(forceRender || this.filterManager.effectElements[5].p._mdf){
             if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) {
                 this.feMerge.removeChild(this.feMergeNode);
                 this.originalNodeAdded = false;
@@ -8957,3672 +9479,3881 @@
                 this.feMerge.appendChild(this.feMergeNode);
                 this.originalNodeAdded = true;
             }
-        }*/
-    }
+        } */
+  }
 };
+
+/* global createElementID, createNS */
+
 var _svgMatteSymbols = [];
 
-function SVGMatte3Effect(filterElem, filterManager, elem){
-    this.initialized = false;
-    this.filterManager = filterManager;
-    this.filterElem = filterElem;
-    this.elem = elem;
-    elem.matteElement = createNS('g');
-    elem.matteElement.appendChild(elem.layerElement);
-    elem.matteElement.appendChild(elem.transformedElement);
-    elem.baseElement = elem.matteElement;
+function SVGMatte3Effect(filterElem, filterManager, elem) {
+  this.initialized = false;
+  this.filterManager = filterManager;
+  this.filterElem = filterElem;
+  this.elem = elem;
+  elem.matteElement = createNS('g');
+  elem.matteElement.appendChild(elem.layerElement);
+  elem.matteElement.appendChild(elem.transformedElement);
+  elem.baseElement = elem.matteElement;
 }
 
-SVGMatte3Effect.prototype.findSymbol = function(mask) {
-    var i = 0, len = _svgMatteSymbols.length;
-    while(i < len) {
-        if(_svgMatteSymbols[i] === mask) {
-            return _svgMatteSymbols[i];
-        }
-        i += 1;
+SVGMatte3Effect.prototype.findSymbol = function (mask) {
+  var i = 0;
+  var len = _svgMatteSymbols.length;
+  while (i < len) {
+    if (_svgMatteSymbols[i] === mask) {
+      return _svgMatteSymbols[i];
     }
-    return null;
+    i += 1;
+  }
+  return null;
 };
 
-SVGMatte3Effect.prototype.replaceInParent = function(mask, symbolId) {
-    var parentNode = mask.layerElement.parentNode;
-    if(!parentNode) {
-        return;
+SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) {
+  var parentNode = mask.layerElement.parentNode;
+  if (!parentNode) {
+    return;
+  }
+  var children = parentNode.children;
+  var i = 0;
+  var len = children.length;
+  while (i < len) {
+    if (children[i] === mask.layerElement) {
+      break;
     }
-    var children = parentNode.children;
-    var i = 0, len = children.length;
-    while (i < len) {
-        if (children[i] === mask.layerElement) {
-            break;
-        }
-        i += 1;
-    }
-    var nextChild;
-    if (i <= len - 2) {
-        nextChild = children[i + 1];
-    }
+    i += 1;
+  }
+  var nextChild;
+  if (i <= len - 2) {
+    nextChild = children[i + 1];
+  }
+  var useElem = createNS('use');
+  useElem.setAttribute('href', '#' + symbolId);
+  if (nextChild) {
+    parentNode.insertBefore(useElem, nextChild);
+  } else {
+    parentNode.appendChild(useElem);
+  }
+};
+
+SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) {
+  if (!this.findSymbol(mask)) {
+    var symbolId = createElementID();
+    var masker = createNS('mask');
+    masker.setAttribute('id', mask.layerId);
+    masker.setAttribute('mask-type', 'alpha');
+    _svgMatteSymbols.push(mask);
+    var defs = elem.globalData.defs;
+    defs.appendChild(masker);
+    var symbol = createNS('symbol');
+    symbol.setAttribute('id', symbolId);
+    this.replaceInParent(mask, symbolId);
+    symbol.appendChild(mask.layerElement);
+    defs.appendChild(symbol);
     var useElem = createNS('use');
     useElem.setAttribute('href', '#' + symbolId);
-    if(nextChild) {
-        parentNode.insertBefore(useElem, nextChild);
-    } else {
-        parentNode.appendChild(useElem);
-    }
+    masker.appendChild(useElem);
+    mask.data.hd = false;
+    mask.show();
+  }
+  elem.setMatte(mask.layerId);
 };
 
-SVGMatte3Effect.prototype.setElementAsMask = function(elem, mask) {
-    if(!this.findSymbol(mask)) {
-        var symbolId = createElementID();
-        var masker = createNS('mask');
-        masker.setAttribute('id', mask.layerId);
-        masker.setAttribute('mask-type', 'alpha');
-        _svgMatteSymbols.push(mask);
-        var defs = elem.globalData.defs;
-        defs.appendChild(masker);
-        var symbol = createNS('symbol');
-        symbol.setAttribute('id', symbolId);
-        this.replaceInParent(mask, symbolId);
-        symbol.appendChild(mask.layerElement);
-        defs.appendChild(symbol);
-        var useElem = createNS('use');
-        useElem.setAttribute('href', '#' + symbolId);
-        masker.appendChild(useElem);
-        mask.data.hd = false;
-        mask.show();
+SVGMatte3Effect.prototype.initialize = function () {
+  var ind = this.filterManager.effectElements[0].p.v;
+  var elements = this.elem.comp.elements;
+  var i = 0;
+  var len = elements.length;
+  while (i < len) {
+    if (elements[i] && elements[i].data.ind === ind) {
+      this.setElementAsMask(this.elem, elements[i]);
     }
-    elem.setMatte(mask.layerId);
+    i += 1;
+  }
+  this.initialized = true;
 };
 
-SVGMatte3Effect.prototype.initialize = function() {
-    var ind = this.filterManager.effectElements[0].p.v;
-    var elements = this.elem.comp.elements;
-    var i = 0, len = elements.length;
-    while (i < len) {
-    	if (elements[i] && elements[i].data.ind === ind) {
-    		this.setElementAsMask(this.elem, elements[i]);
-    	}
-    	i += 1;
-    }
-    this.initialized = true;
+SVGMatte3Effect.prototype.renderFrame = function () {
+  if (!this.initialized) {
+    this.initialize();
+  }
 };
 
-SVGMatte3Effect.prototype.renderFrame = function() {
-	if(!this.initialized) {
-		this.initialize();
-	}
-};
-function SVGEffects(elem){
-    var i, len = elem.data.ef ? elem.data.ef.length : 0;
-    var filId = createElementID();
-    var fil = filtersFactory.createFilter(filId);
-    var count = 0;
-    this.filters = [];
-    var filterManager;
-    for(i=0;i<len;i+=1){
-        filterManager = null;
-        if(elem.data.ef[i].ty === 20){
-            count += 1;
-            filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 21){
-            count += 1;
-            filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 22){
-            filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 23){
-            count += 1;
-            filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 24){
-            count += 1;
-            filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 25){
-            count += 1;
-            filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
-        }else if(elem.data.ef[i].ty === 28){
-            //count += 1;
-            filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
-        }else if(elem.data.ef[i].ty === 29){
-            count += 1;
-            filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
-        }
-        if(filterManager) {
-            this.filters.push(filterManager);
-        }
+/* global createElementID, filtersFactory, SVGTintFilter, SVGFillFilter, SVGStrokeEffect, SVGTritoneFilter,
+SVGProLevelsFilter, SVGDropShadowEffect, SVGMatte3Effect, SVGGaussianBlurEffect, locationHref */
+
+function SVGEffects(elem) {
+  var i;
+  var len = elem.data.ef ? elem.data.ef.length : 0;
+  var filId = createElementID();
+  var fil = filtersFactory.createFilter(filId);
+  var count = 0;
+  this.filters = [];
+  var filterManager;
+  for (i = 0; i < len; i += 1) {
+    filterManager = null;
+    if (elem.data.ef[i].ty === 20) {
+      count += 1;
+      filterManager = new SVGTintFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 21) {
+      count += 1;
+      filterManager = new SVGFillFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 22) {
+      filterManager = new SVGStrokeEffect(elem, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 23) {
+      count += 1;
+      filterManager = new SVGTritoneFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 24) {
+      count += 1;
+      filterManager = new SVGProLevelsFilter(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 25) {
+      count += 1;
+      filterManager = new SVGDropShadowEffect(fil, elem.effectsManager.effectElements[i]);
+    } else if (elem.data.ef[i].ty === 28) {
+      // count += 1;
+      filterManager = new SVGMatte3Effect(fil, elem.effectsManager.effectElements[i], elem);
+    } else if (elem.data.ef[i].ty === 29) {
+      count += 1;
+      filterManager = new SVGGaussianBlurEffect(fil, elem.effectsManager.effectElements[i]);
     }
-    if(count){
-        elem.globalData.defs.appendChild(fil);
-        elem.layerElement.setAttribute('filter','url(' + locationHref + '#'+filId+')');
+    if (filterManager) {
+      this.filters.push(filterManager);
     }
-    if (this.filters.length) {
-        elem.addRenderableComponent(this);
-    }
+  }
+  if (count) {
+    elem.globalData.defs.appendChild(fil);
+    elem.layerElement.setAttribute('filter', 'url(' + locationHref + '#' + filId + ')');
+  }
+  if (this.filters.length) {
+    elem.addRenderableComponent(this);
+  }
 }
 
-SVGEffects.prototype.renderFrame = function(_isFirstFrame){
-    var i, len = this.filters.length;
-    for(i=0;i<len;i+=1){
-        this.filters[i].renderFrame(_isFirstFrame);
-    }
+SVGEffects.prototype.renderFrame = function (_isFirstFrame) {
+  var i;
+  var len = this.filters.length;
+  for (i = 0; i < len; i += 1) {
+    this.filters[i].renderFrame(_isFirstFrame);
+  }
 };
-var animationManager = (function(){
-    var moduleOb = {};
-    var registeredAnimations = [];
-    var initTime = 0;
-    var len = 0;
-    var playingAnimationsNum = 0;
-    var _stopped = true;
-    var _isFrozen = false;
 
-    function removeElement(ev){
-        var i = 0;
-        var animItem = ev.target;
-        while(i<len) {
-            if (registeredAnimations[i].animation === animItem) {
-                registeredAnimations.splice(i, 1);
-                i -= 1;
-                len -= 1;
-                if(!animItem.isPaused){
-                    subtractPlayingCount();
-                }
-            }
-            i += 1;
+/* global createTag, AnimationItem */
+/* exported animationManager */
+
+var animationManager = (function () {
+  var moduleOb = {};
+  var registeredAnimations = [];
+  var initTime = 0;
+  var len = 0;
+  var playingAnimationsNum = 0;
+  var _stopped = true;
+  var _isFrozen = false;
+
+  function removeElement(ev) {
+    var i = 0;
+    var animItem = ev.target;
+    while (i < len) {
+      if (registeredAnimations[i].animation === animItem) {
+        registeredAnimations.splice(i, 1);
+        i -= 1;
+        len -= 1;
+        if (!animItem.isPaused) {
+          subtractPlayingCount();
         }
+      }
+      i += 1;
     }
+  }
 
-    function registerAnimation(element, animationData){
-        if(!element){
-            return null;
-        }
-        var i=0;
-        while(i<len){
-            if(registeredAnimations[i].elem == element && registeredAnimations[i].elem !== null ){
-                return registeredAnimations[i].animation;
-            }
-            i+=1;
-        }
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, element);
-        animItem.setData(element, animationData);
-        return animItem;
+  function registerAnimation(element, animationData) {
+    if (!element) {
+      return null;
     }
-
-    function getRegisteredAnimations() {
-        var i, len = registeredAnimations.length;
-        var animations = [];
-        for(i = 0; i < len; i += 1) {
-            animations.push(registeredAnimations[i].animation);
-        }
-        return animations;
+    var i = 0;
+    while (i < len) {
+      if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
+        return registeredAnimations[i].animation;
+      }
+      i += 1;
     }
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, element);
+    animItem.setData(element, animationData);
+    return animItem;
+  }
 
-    function addPlayingCount(){
-        playingAnimationsNum += 1;
-        activate();
+  function getRegisteredAnimations() {
+    var i;
+    var lenAnims = registeredAnimations.length;
+    var animations = [];
+    for (i = 0; i < lenAnims; i += 1) {
+      animations.push(registeredAnimations[i].animation);
     }
+    return animations;
+  }
 
-    function subtractPlayingCount(){
-        playingAnimationsNum -= 1;
+  function addPlayingCount() {
+    playingAnimationsNum += 1;
+    activate();
+  }
+
+  function subtractPlayingCount() {
+    playingAnimationsNum -= 1;
+  }
+
+  function setupAnimation(animItem, element) {
+    animItem.addEventListener('destroy', removeElement);
+    animItem.addEventListener('_active', addPlayingCount);
+    animItem.addEventListener('_idle', subtractPlayingCount);
+    registeredAnimations.push({ elem: element, animation: animItem });
+    len += 1;
+  }
+
+  function loadAnimation(params) {
+    var animItem = new AnimationItem();
+    setupAnimation(animItem, null);
+    animItem.setParams(params);
+    return animItem;
+  }
+
+  function setSpeed(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setSpeed(val, animation);
     }
+  }
 
-    function setupAnimation(animItem, element){
-        animItem.addEventListener('destroy',removeElement);
-        animItem.addEventListener('_active',addPlayingCount);
-        animItem.addEventListener('_idle',subtractPlayingCount);
-        registeredAnimations.push({elem: element,animation:animItem});
-        len += 1;
+  function setDirection(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setDirection(val, animation);
     }
+  }
 
-    function loadAnimation(params){
-        var animItem = new AnimationItem();
-        setupAnimation(animItem, null);
-        animItem.setParams(params);
-        return animItem;
+  function play(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.play(animation);
     }
-
-
-    function setSpeed(val,animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setSpeed(val, animation);
-        }
+  }
+  function resume(nowTime) {
+    var elapsedTime = nowTime - initTime;
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.advanceTime(elapsedTime);
     }
-
-    function setDirection(val, animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setDirection(val, animation);
-        }
+    initTime = nowTime;
+    if (playingAnimationsNum && !_isFrozen) {
+      window.requestAnimationFrame(resume);
+    } else {
+      _stopped = true;
     }
+  }
 
-    function play(animation){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.play(animation);
-        }
-    }
-    function resume(nowTime) {
-        var elapsedTime = nowTime - initTime;
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.advanceTime(elapsedTime);
-        }
-        initTime = nowTime;
-        if(playingAnimationsNum && !_isFrozen) {
-            window.requestAnimationFrame(resume);
-        } else {
-            _stopped = true;
-        }
-    }
+  function first(nowTime) {
+    initTime = nowTime;
+    window.requestAnimationFrame(resume);
+  }
 
-    function first(nowTime){
-        initTime = nowTime;
-        window.requestAnimationFrame(resume);
+  function pause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.pause(animation);
     }
+  }
 
-    function pause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.pause(animation);
-        }
+  function goToAndStop(value, isFrame, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
     }
+  }
 
-    function goToAndStop(value,isFrame,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.goToAndStop(value,isFrame,animation);
-        }
+  function stop(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.stop(animation);
     }
+  }
 
-    function stop(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.stop(animation);
-        }
+  function togglePause(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.togglePause(animation);
     }
+  }
 
-    function togglePause(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.togglePause(animation);
-        }
+  function destroy(animation) {
+    var i;
+    for (i = (len - 1); i >= 0; i -= 1) {
+      registeredAnimations[i].animation.destroy(animation);
     }
+  }
 
-    function destroy(animation) {
-        var i;
-        for(i=(len-1);i>=0;i-=1){
-            registeredAnimations[i].animation.destroy(animation);
-        }
+  function searchAnimations(animationData, standalone, renderer) {
+    var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
+      [].slice.call(document.getElementsByClassName('bodymovin')));
+    var i;
+    var lenAnims = animElements.length;
+    for (i = 0; i < lenAnims; i += 1) {
+      if (renderer) {
+        animElements[i].setAttribute('data-bm-type', renderer);
+      }
+      registerAnimation(animElements[i], animationData);
     }
-
-    function searchAnimations(animationData, standalone, renderer){
-        var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),
-                  [].slice.call(document.getElementsByClassName('bodymovin')));
-        var i, len = animElements.length;
-        for(i=0;i<len;i+=1){
-            if(renderer){
-                animElements[i].setAttribute('data-bm-type',renderer);
-            }
-            registerAnimation(animElements[i], animationData);
-        }
-        if(standalone && len === 0){
-            if(!renderer){
-                renderer = 'svg';
-            }
-            var body = document.getElementsByTagName('body')[0];
-            body.innerText = '';
-            var div = createTag('div');
-            div.style.width = '100%';
-            div.style.height = '100%';
-            div.setAttribute('data-bm-type',renderer);
-            body.appendChild(div);
-            registerAnimation(div, animationData);
-        }
+    if (standalone && lenAnims === 0) {
+      if (!renderer) {
+        renderer = 'svg';
+      }
+      var body = document.getElementsByTagName('body')[0];
+      body.innerText = '';
+      var div = createTag('div');
+      div.style.width = '100%';
+      div.style.height = '100%';
+      div.setAttribute('data-bm-type', renderer);
+      body.appendChild(div);
+      registerAnimation(div, animationData);
     }
+  }
 
-    function resize(){
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.resize();
-        }
+  function resize() {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.resize();
     }
+  }
 
-    function activate(){
-        if(!_isFrozen && playingAnimationsNum){
-            if(_stopped) {
-                window.requestAnimationFrame(first);
-                _stopped = false;
-            }
-        }
+  function activate() {
+    if (!_isFrozen && playingAnimationsNum) {
+      if (_stopped) {
+        window.requestAnimationFrame(first);
+        _stopped = false;
+      }
     }
+  }
 
-    function freeze() {
-        _isFrozen = true;
+  function freeze() {
+    _isFrozen = true;
+  }
+
+  function unfreeze() {
+    _isFrozen = false;
+    activate();
+  }
+
+  function setVolume(val, animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.setVolume(val, animation);
     }
+  }
 
-    function unfreeze() {
-        _isFrozen = false;
-        activate();
+  function mute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.mute(animation);
     }
+  }
 
-    function setVolume(val,animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.setVolume(val, animation);
-        }
+  function unmute(animation) {
+    var i;
+    for (i = 0; i < len; i += 1) {
+      registeredAnimations[i].animation.unmute(animation);
     }
+  }
 
-    function mute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.mute(animation);
-        }
-    }
-
-    function unmute(animation) {
-        var i;
-        for(i=0;i<len;i+=1){
-            registeredAnimations[i].animation.unmute(animation);
-        }
-    }
-
-    moduleOb.registerAnimation = registerAnimation;
-    moduleOb.loadAnimation = loadAnimation;
-    moduleOb.setSpeed = setSpeed;
-    moduleOb.setDirection = setDirection;
-    moduleOb.play = play;
-    moduleOb.pause = pause;
-    moduleOb.stop = stop;
-    moduleOb.togglePause = togglePause;
-    moduleOb.searchAnimations = searchAnimations;
-    moduleOb.resize = resize;
-    //moduleOb.start = start;
-    moduleOb.goToAndStop = goToAndStop;
-    moduleOb.destroy = destroy;
-    moduleOb.freeze = freeze;
-    moduleOb.unfreeze = unfreeze;
-    moduleOb.setVolume = setVolume;
-    moduleOb.mute = mute;
-    moduleOb.unmute = unmute;
-    moduleOb.getRegisteredAnimations = getRegisteredAnimations;
-    return moduleOb;
+  moduleOb.registerAnimation = registerAnimation;
+  moduleOb.loadAnimation = loadAnimation;
+  moduleOb.setSpeed = setSpeed;
+  moduleOb.setDirection = setDirection;
+  moduleOb.play = play;
+  moduleOb.pause = pause;
+  moduleOb.stop = stop;
+  moduleOb.togglePause = togglePause;
+  moduleOb.searchAnimations = searchAnimations;
+  moduleOb.resize = resize;
+  // moduleOb.start = start;
+  moduleOb.goToAndStop = goToAndStop;
+  moduleOb.destroy = destroy;
+  moduleOb.freeze = freeze;
+  moduleOb.unfreeze = unfreeze;
+  moduleOb.setVolume = setVolume;
+  moduleOb.mute = mute;
+  moduleOb.unmute = unmute;
+  moduleOb.getRegisteredAnimations = getRegisteredAnimations;
+  return moduleOb;
 }());
 
+/* global createElementID, subframeEnabled, ProjectInterface, ImagePreloader, audioControllerFactory, extendPrototype, BaseEvent,
+CanvasRenderer, SVGRenderer, HybridRenderer, assetLoader, dataManager, expressionsPlugin, BMEnterFrameEvent, BMCompleteLoopEvent,
+BMCompleteEvent, BMSegmentStartEvent, BMDestroyEvent, BMEnterFrameEvent, BMCompleteLoopEvent, BMCompleteEvent, BMSegmentStartEvent,
+BMDestroyEvent, BMRenderFrameErrorEvent, BMConfigErrorEvent */
+
 var AnimationItem = function () {
-    this._cbs = [];
-    this.name = '';
-    this.path = '';
-    this.isLoaded = false;
-    this.currentFrame = 0;
-    this.currentRawFrame = 0;
-    this.firstFrame = 0;
-    this.totalFrames = 0;
-    this.frameRate = 0;
-    this.frameMult = 0;
-    this.playSpeed = 1;
-    this.playDirection = 1;
-    this.playCount = 0;
-    this.animationData = {};
-    this.assets = [];
-    this.isPaused = true;
-    this.autoplay = false;
-    this.loop = true;
-    this.renderer = null;
-    this.animationID = createElementID();
-    this.assetsPath = '';
-    this.timeCompleted = 0;
-    this.segmentPos = 0;
-    this.isSubframeEnabled = subframeEnabled;
-    this.segments = [];
-    this._idle = true;
-    this._completedLoop = false;
-    this.projectInterface = ProjectInterface();
-    this.imagePreloader = new ImagePreloader();
-    this.audioController = audioControllerFactory();
+  this._cbs = [];
+  this.name = '';
+  this.path = '';
+  this.isLoaded = false;
+  this.currentFrame = 0;
+  this.currentRawFrame = 0;
+  this.firstFrame = 0;
+  this.totalFrames = 0;
+  this.frameRate = 0;
+  this.frameMult = 0;
+  this.playSpeed = 1;
+  this.playDirection = 1;
+  this.playCount = 0;
+  this.animationData = {};
+  this.assets = [];
+  this.isPaused = true;
+  this.autoplay = false;
+  this.loop = true;
+  this.renderer = null;
+  this.animationID = createElementID();
+  this.assetsPath = '';
+  this.timeCompleted = 0;
+  this.segmentPos = 0;
+  this.isSubframeEnabled = subframeEnabled;
+  this.segments = [];
+  this._idle = true;
+  this._completedLoop = false;
+  this.projectInterface = ProjectInterface();
+  this.imagePreloader = new ImagePreloader();
+  this.audioController = audioControllerFactory();
 };
 
 extendPrototype([BaseEvent], AnimationItem);
 
-AnimationItem.prototype.setParams = function(params) {
-    if(params.wrapper || params.container){
-        this.wrapper = params.wrapper || params.container;
-    }
-    var animType = params.animType ? params.animType : params.renderer ? params.renderer : 'svg';
-    switch(animType){
-        case 'canvas':
-            this.renderer = new CanvasRenderer(this, params.rendererSettings);
-            break;
-        case 'svg':
-            this.renderer = new SVGRenderer(this, params.rendererSettings);
-            break;
-        default:
-            this.renderer = new HybridRenderer(this, params.rendererSettings);
-            break;
-    }
-    this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
-    this.renderer.setProjectInterface(this.projectInterface);
-    this.animType = animType;
-    if (params.loop === ''
+AnimationItem.prototype.setParams = function (params) {
+  if (params.wrapper || params.container) {
+    this.wrapper = params.wrapper || params.container;
+  }
+  var animType = 'svg';
+  if (params.animType) {
+    animType = params.animType;
+  } else if (params.renderer) {
+    animType = params.renderer;
+  }
+  switch (animType) {
+    case 'canvas':
+      this.renderer = new CanvasRenderer(this, params.rendererSettings);
+      break;
+    case 'svg':
+      this.renderer = new SVGRenderer(this, params.rendererSettings);
+      break;
+    default:
+      this.renderer = new HybridRenderer(this, params.rendererSettings);
+      break;
+  }
+  this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
+  this.renderer.setProjectInterface(this.projectInterface);
+  this.animType = animType;
+  if (params.loop === ''
         || params.loop === null
         || params.loop === undefined
-        || params.loop === true)
-    {
-        this.loop = true;
-    } else if (params.loop === false) {
-        this.loop = false;
+        || params.loop === true) {
+    this.loop = true;
+  } else if (params.loop === false) {
+    this.loop = false;
+  } else {
+    this.loop = parseInt(params.loop, 10);
+  }
+  this.autoplay = 'autoplay' in params ? params.autoplay : true;
+  this.name = params.name ? params.name : '';
+  this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
+  this.assetsPath = params.assetsPath;
+  this.initialSegment = params.initialSegment;
+  if (params.audioFactory) {
+    this.audioController.setAudioFactory(params.audioFactory);
+  }
+  if (params.animationData) {
+    this.configAnimation(params.animationData);
+  } else if (params.path) {
+    if (params.path.lastIndexOf('\\') !== -1) {
+      this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
     } else {
-        this.loop = parseInt(params.loop);
+      this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
     }
-    this.autoplay = 'autoplay' in params ? params.autoplay : true;
-    this.name = params.name ? params.name :  '';
-    this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments :  true;
-    this.assetsPath = params.assetsPath;
-    this.initialSegment = params.initialSegment;
-    if (params.audioFactory) {
-        this.audioController.setAudioFactory(params.audioFactory);
-    }
-    if (params.animationData) {
-        this.configAnimation(params.animationData);
-    } else if(params.path){
+    this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
+    this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
 
-        if( params.path.lastIndexOf('\\') !== -1){
-            this.path = params.path.substr(0,params.path.lastIndexOf('\\')+1);
-        } else {
-            this.path = params.path.substr(0,params.path.lastIndexOf('/')+1);
-        }
-        this.fileName = params.path.substr(params.path.lastIndexOf('/')+1);
-        this.fileName = this.fileName.substr(0,this.fileName.lastIndexOf('.json'));
-
-        assetLoader.load(params.path, this.configAnimation.bind(this), function() {
-            this.trigger('data_failed');
-        }.bind(this));
-    }
-
+    assetLoader.load(params.path, this.configAnimation.bind(this), function () {
+      this.trigger('data_failed');
+    }.bind(this));
+  }
 };
 
 AnimationItem.prototype.setData = function (wrapper, animationData) {
-    var params = {
-        wrapper: wrapper,
-        animationData: animationData ? (typeof animationData  === "object") ? animationData : JSON.parse(animationData) : null
-    };
-    var wrapperAttributes = wrapper.attributes;
-
-    params.path = wrapperAttributes.getNamedItem('data-animation-path') ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') ? wrapperAttributes.getNamedItem('data-bm-path').value :  wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
-    params.animType = wrapperAttributes.getNamedItem('data-anim-type') ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') ? wrapperAttributes.getNamedItem('bm-type').value :  wrapperAttributes.getNamedItem('data-bm-renderer') ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : 'canvas';
-
-    var loop = wrapperAttributes.getNamedItem('data-anim-loop') ? wrapperAttributes.getNamedItem('data-anim-loop').value :  wrapperAttributes.getNamedItem('data-bm-loop') ? wrapperAttributes.getNamedItem('data-bm-loop').value :  wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
-    if(loop === ''){
-    }else if(loop === 'false'){
-        params.loop = false;
-    }else if(loop === 'true'){
-        params.loop = true;
-    }else{
-        params.loop = parseInt(loop);
+  if (animationData) {
+    if (typeof animationData !== 'object') {
+      animationData = JSON.parse(animationData);
     }
-    var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') ? wrapperAttributes.getNamedItem('data-anim-autoplay').value :  wrapperAttributes.getNamedItem('data-bm-autoplay') ? wrapperAttributes.getNamedItem('data-bm-autoplay').value :  wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
-    params.autoplay = autoplay !== "false";
+  }
+  var params = {
+    wrapper: wrapper,
+    animationData: animationData,
+  };
+  var wrapperAttributes = wrapper.attributes;
 
-    params.name = wrapperAttributes.getNamedItem('data-name') ? wrapperAttributes.getNamedItem('data-name').value :  wrapperAttributes.getNamedItem('data-bm-name') ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value :  '';
-    var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') ? wrapperAttributes.getNamedItem('data-anim-prerender').value :  wrapperAttributes.getNamedItem('data-bm-prerender') ? wrapperAttributes.getNamedItem('data-bm-prerender').value :  wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
+  params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-animation-path').value
+    : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-path').value
+      : wrapperAttributes.getNamedItem('bm-path')
+        ? wrapperAttributes.getNamedItem('bm-path').value
+        : '';
+  params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-type').value
+    : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-type').value
+      : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
+        ? wrapperAttributes.getNamedItem('bm-type').value
+        : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
+          ? wrapperAttributes.getNamedItem('data-bm-renderer').value
+          : wrapperAttributes.getNamedItem('bm-renderer')
+            ? wrapperAttributes.getNamedItem('bm-renderer').value
+            : 'canvas';
 
-    if(prerender === 'false'){
-        params.prerender = false;
-    }
-    this.setParams(params);
+  var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-loop').value
+    : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-loop').value
+      : wrapperAttributes.getNamedItem('bm-loop')
+        ? wrapperAttributes.getNamedItem('bm-loop').value
+        : '';
+  if (loop === 'false') {
+    params.loop = false;
+  } else if (loop === 'true') {
+    params.loop = true;
+  } else if (loop !== '') {
+    params.loop = parseInt(loop, 10);
+  }
+  var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-autoplay').value
+    : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-autoplay').value
+      : wrapperAttributes.getNamedItem('bm-autoplay')
+        ? wrapperAttributes.getNamedItem('bm-autoplay').value
+        : true;
+  params.autoplay = autoplay !== 'false';
+
+  params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-name').value
+    : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-name').value
+      : wrapperAttributes.getNamedItem('bm-name')
+        ? wrapperAttributes.getNamedItem('bm-name').value
+        : '';
+  var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
+    ? wrapperAttributes.getNamedItem('data-anim-prerender').value
+    : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
+      ? wrapperAttributes.getNamedItem('data-bm-prerender').value
+      : wrapperAttributes.getNamedItem('bm-prerender')
+        ? wrapperAttributes.getNamedItem('bm-prerender').value
+        : '';
+
+  if (prerender === 'false') {
+    params.prerender = false;
+  }
+  this.setParams(params);
 };
 
-AnimationItem.prototype.includeLayers = function(data) {
-    if(data.op > this.animationData.op){
-        this.animationData.op = data.op;
-        this.totalFrames = Math.floor(data.op - this.animationData.ip);
+AnimationItem.prototype.includeLayers = function (data) {
+  if (data.op > this.animationData.op) {
+    this.animationData.op = data.op;
+    this.totalFrames = Math.floor(data.op - this.animationData.ip);
+  }
+  var layers = this.animationData.layers;
+  var i;
+  var len = layers.length;
+  var newLayers = data.layers;
+  var j;
+  var jLen = newLayers.length;
+  for (j = 0; j < jLen; j += 1) {
+    i = 0;
+    while (i < len) {
+      if (layers[i].id === newLayers[j].id) {
+        layers[i] = newLayers[j];
+        break;
+      }
+      i += 1;
     }
-    var layers = this.animationData.layers;
-    var i, len = layers.length;
-    var newLayers = data.layers;
-    var j, jLen = newLayers.length;
-    for(j=0;j<jLen;j+=1){
-        i = 0;
-        while(i<len){
-            if(layers[i].id == newLayers[j].id){
-                layers[i] = newLayers[j];
-                break;
-            }
-            i += 1;
-        }
+  }
+  if (data.chars || data.fonts) {
+    this.renderer.globalData.fontManager.addChars(data.chars);
+    this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
+  }
+  if (data.assets) {
+    len = data.assets.length;
+    for (i = 0; i < len; i += 1) {
+      this.animationData.assets.push(data.assets[i]);
     }
-    if(data.chars || data.fonts){
-        this.renderer.globalData.fontManager.addChars(data.chars);
-        this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
-    }
-    if(data.assets){
-        len = data.assets.length;
-        for(i = 0; i < len; i += 1){
-            this.animationData.assets.push(data.assets[i]);
-        }
-    }
-    this.animationData.__complete = false;
-    dataManager.completeData(this.animationData,this.renderer.globalData.fontManager);
-    this.renderer.includeLayers(data.layers);
-    if(expressionsPlugin){
-        expressionsPlugin.initExpressions(this);
-    }
-    this.loadNextSegment();
+  }
+  this.animationData.__complete = false;
+  dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+  this.renderer.includeLayers(data.layers);
+  if (expressionsPlugin) {
+    expressionsPlugin.initExpressions(this);
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.loadNextSegment = function() {
-    var segments = this.animationData.segments;
-    if(!segments || segments.length === 0 || !this.autoloadSegments){
-        this.trigger('data_ready');
-        this.timeCompleted = this.totalFrames;
-        return;
-    }
-    var segment = segments.shift();
-    this.timeCompleted = segment.time * this.frameRate;
-    var segmentPath = this.path+this.fileName+'_' + this.segmentPos + '.json';
-    this.segmentPos += 1;
-    assetLoader.load(segmentPath, this.includeLayers.bind(this), function() {
-        this.trigger('data_failed');
-    }.bind(this));
+AnimationItem.prototype.loadNextSegment = function () {
+  var segments = this.animationData.segments;
+  if (!segments || segments.length === 0 || !this.autoloadSegments) {
+    this.trigger('data_ready');
+    this.timeCompleted = this.totalFrames;
+    return;
+  }
+  var segment = segments.shift();
+  this.timeCompleted = segment.time * this.frameRate;
+  var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
+  this.segmentPos += 1;
+  assetLoader.load(segmentPath, this.includeLayers.bind(this), function () {
+    this.trigger('data_failed');
+  }.bind(this));
 };
 
-AnimationItem.prototype.loadSegments = function() {
-    var segments = this.animationData.segments;
-    if(!segments) {
-        this.timeCompleted = this.totalFrames;
-    }
-    this.loadNextSegment();
+AnimationItem.prototype.loadSegments = function () {
+  var segments = this.animationData.segments;
+  if (!segments) {
+    this.timeCompleted = this.totalFrames;
+  }
+  this.loadNextSegment();
 };
 
-AnimationItem.prototype.imagesLoaded = function() {
-    this.trigger('loaded_images');
-    this.checkLoaded()
-}
+AnimationItem.prototype.imagesLoaded = function () {
+  this.trigger('loaded_images');
+  this.checkLoaded();
+};
 
-AnimationItem.prototype.preloadImages = function() {
-    this.imagePreloader.setAssetsPath(this.assetsPath);
-    this.imagePreloader.setPath(this.path);
-    this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
-}
+AnimationItem.prototype.preloadImages = function () {
+  this.imagePreloader.setAssetsPath(this.assetsPath);
+  this.imagePreloader.setPath(this.path);
+  this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
+};
 
 AnimationItem.prototype.configAnimation = function (animData) {
-    if(!this.renderer){
-        return;
-    }
-    try {
-        this.animationData = animData;
+  if (!this.renderer) {
+    return;
+  }
+  try {
+    this.animationData = animData;
 
-        if (this.initialSegment) {
-            this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
-            this.firstFrame = Math.round(this.initialSegment[0]);
-        } else {
-            this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
-            this.firstFrame = Math.round(this.animationData.ip);
-        }
-        this.renderer.configAnimation(animData);
-        if(!animData.assets){
-            animData.assets = [];
-        }
-
-        this.assets = this.animationData.assets;
-        this.frameRate = this.animationData.fr;
-        this.frameMult = this.animationData.fr / 1000;
-        this.renderer.searchExtraCompositions(animData.assets);
-        this.trigger('config_ready');
-        this.preloadImages();
-        this.loadSegments();
-        this.updaFrameModifier();
-        this.waitForFontsLoaded();
-        if (this.isPaused) {
-            this.audioController.pause();
-        }
-    } catch(error) {
-        this.triggerConfigError(error);
+    if (this.initialSegment) {
+      this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+      this.firstFrame = Math.round(this.initialSegment[0]);
+    } else {
+      this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+      this.firstFrame = Math.round(this.animationData.ip);
     }
+    this.renderer.configAnimation(animData);
+    if (!animData.assets) {
+      animData.assets = [];
+    }
+
+    this.assets = this.animationData.assets;
+    this.frameRate = this.animationData.fr;
+    this.frameMult = this.animationData.fr / 1000;
+    this.renderer.searchExtraCompositions(animData.assets);
+    this.trigger('config_ready');
+    this.preloadImages();
+    this.loadSegments();
+    this.updaFrameModifier();
+    this.waitForFontsLoaded();
+    if (this.isPaused) {
+      this.audioController.pause();
+    }
+  } catch (error) {
+    this.triggerConfigError(error);
+  }
 };
 
-AnimationItem.prototype.waitForFontsLoaded = function(){
-    if(!this.renderer) {
-        return;
-    }
-    if(this.renderer.globalData.fontManager.isLoaded){
-        this.checkLoaded();
-    }else{
-        setTimeout(this.waitForFontsLoaded.bind(this),20);
-    }
-}
+AnimationItem.prototype.waitForFontsLoaded = function () {
+  if (!this.renderer) {
+    return;
+  }
+  if (this.renderer.globalData.fontManager.isLoaded) {
+    this.checkLoaded();
+  } else {
+    setTimeout(this.waitForFontsLoaded.bind(this), 20);
+  }
+};
 
 AnimationItem.prototype.checkLoaded = function () {
-    if (!this.isLoaded 
+  if (!this.isLoaded
         && this.renderer.globalData.fontManager.isLoaded
         && (this.imagePreloader.loaded() || this.renderer.rendererType !== 'canvas')
-    ) {
-        this.isLoaded = true;
-        dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
-        if(expressionsPlugin){
-            expressionsPlugin.initExpressions(this);
-        }
-        this.renderer.initItems();
-        setTimeout(function() {
-            this.trigger('DOMLoaded');
-        }.bind(this), 0);
-        this.gotoFrame();
-        if(this.autoplay){
-            this.play();
-        }
+  ) {
+    this.isLoaded = true;
+    dataManager.completeData(this.animationData, this.renderer.globalData.fontManager);
+    if (expressionsPlugin) {
+      expressionsPlugin.initExpressions(this);
     }
+    this.renderer.initItems();
+    setTimeout(function () {
+      this.trigger('DOMLoaded');
+    }.bind(this), 0);
+    this.gotoFrame();
+    if (this.autoplay) {
+      this.play();
+    }
+  }
 };
 
 AnimationItem.prototype.resize = function () {
-    this.renderer.updateContainerSize();
+  this.renderer.updateContainerSize();
 };
 
-AnimationItem.prototype.setSubframe = function(flag){
-    this.isSubframeEnabled = !!flag;
+AnimationItem.prototype.setSubframe = function (flag) {
+  this.isSubframeEnabled = !!flag;
 };
 
 AnimationItem.prototype.gotoFrame = function () {
-    this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame;
+  this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
 
-    if(this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted){
-        this.currentFrame = this.timeCompleted;
-    }
-    this.trigger('enterFrame');
-    this.renderFrame();
+  if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
+    this.currentFrame = this.timeCompleted;
+  }
+  this.trigger('enterFrame');
+  this.renderFrame();
 };
 
 AnimationItem.prototype.renderFrame = function () {
-    if(this.isLoaded === false){
-        return;
-    }
-    try {
-        this.renderer.renderFrame(this.currentFrame + this.firstFrame);
-    } catch(error) {
-        this.triggerRenderFrameError(error);
-    }
+  if (this.isLoaded === false) {
+    return;
+  }
+  try {
+    this.renderer.renderFrame(this.currentFrame + this.firstFrame);
+  } catch (error) {
+    this.triggerRenderFrameError(error);
+  }
 };
 
 AnimationItem.prototype.play = function (name) {
-    if(name && this.name != name){
-        return;
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.isPaused = false;
+    this.audioController.resume();
+    if (this._idle) {
+      this._idle = false;
+      this.trigger('_active');
     }
-    if (this.isPaused === true) {
-        this.isPaused = false;
-        this.audioController.resume();
-        if(this._idle){
-            this._idle = false;
-            this.trigger('_active');
-        }
-    }
+  }
 };
 
 AnimationItem.prototype.pause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === false){
-        this.isPaused = true;
-        this._idle = true;
-        this.trigger('_idle');
-        this.audioController.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === false) {
+    this.isPaused = true;
+    this._idle = true;
+    this.trigger('_idle');
+    this.audioController.pause();
+  }
 };
 
 AnimationItem.prototype.togglePause = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(this.isPaused === true){
-        this.play();
-    }else{
-        this.pause();
-    }
+  if (name && this.name !== name) {
+    return;
+  }
+  if (this.isPaused === true) {
+    this.play();
+  } else {
+    this.pause();
+  }
 };
 
 AnimationItem.prototype.stop = function (name) {
-    if(name && this.name != name){
-        return;
-    }
-    this.pause();
-    this.playCount = 0;
-    this._completedLoop = false;
-    this.setCurrentRawFrameValue(0);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.pause();
+  this.playCount = 0;
+  this._completedLoop = false;
+  this.setCurrentRawFrameValue(0);
 };
 
 AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
-    if(name && this.name != name){
-        return;
-    }
-    if(isFrame){
-        this.setCurrentRawFrameValue(value);
-    }else{
-        this.setCurrentRawFrameValue(value * this.frameModifier);
-    }
-    this.pause();
+  if (name && this.name !== name) {
+    return;
+  }
+  if (isFrame) {
+    this.setCurrentRawFrameValue(value);
+  } else {
+    this.setCurrentRawFrameValue(value * this.frameModifier);
+  }
+  this.pause();
 };
 
 AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
-    this.goToAndStop(value, isFrame, name);
-    this.play();
+  this.goToAndStop(value, isFrame, name);
+  this.play();
 };
 
 AnimationItem.prototype.advanceTime = function (value) {
-    if (this.isPaused === true || this.isLoaded === false) {
-        return;
-    }
-    var nextValue = this.currentRawFrame + value * this.frameModifier;
-    var _isComplete = false;
-    // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
-    // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
-    if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
-        if (!this.loop || this.playCount === this.loop) {
-            if (!this.checkSegments(nextValue >  this.totalFrames ? nextValue % this.totalFrames : 0)) {
-                _isComplete = true;
-                nextValue = this.totalFrames - 1;
-            }
-        } else if (nextValue >= this.totalFrames) {
-            this.playCount += 1;
-            if (!this.checkSegments(nextValue % this.totalFrames)) {
-                this.setCurrentRawFrameValue(nextValue % this.totalFrames);
-                this._completedLoop = true;
-                this.trigger('loopComplete');
-            }
-        } else {
-            this.setCurrentRawFrameValue(nextValue);
-        }
-    } else if(nextValue < 0) {
-        if (!this.checkSegments(nextValue % this.totalFrames)) {
-            if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
-                this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
-                if(!this._completedLoop) {
-                    this._completedLoop = true;
-                } else {
-                    this.trigger('loopComplete');
-                }
-            } else {
-                _isComplete = true;
-                nextValue = 0;
-            }
-        }
+  if (this.isPaused === true || this.isLoaded === false) {
+    return;
+  }
+  var nextValue = this.currentRawFrame + value * this.frameModifier;
+  var _isComplete = false;
+  // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
+  // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
+  if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
+    if (!this.loop || this.playCount === this.loop) {
+      if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
+        _isComplete = true;
+        nextValue = this.totalFrames - 1;
+      }
+    } else if (nextValue >= this.totalFrames) {
+      this.playCount += 1;
+      if (!this.checkSegments(nextValue % this.totalFrames)) {
+        this.setCurrentRawFrameValue(nextValue % this.totalFrames);
+        this._completedLoop = true;
+        this.trigger('loopComplete');
+      }
     } else {
-        this.setCurrentRawFrameValue(nextValue);
+      this.setCurrentRawFrameValue(nextValue);
     }
-    if (_isComplete) {
-        this.setCurrentRawFrameValue(nextValue);
-        this.pause();
-        this.trigger('complete');
+  } else if (nextValue < 0) {
+    if (!this.checkSegments(nextValue % this.totalFrames)) {
+      if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) { // eslint-disable-line no-plusplus
+        this.setCurrentRawFrameValue(this.totalFrames + (nextValue % this.totalFrames));
+        if (!this._completedLoop) {
+          this._completedLoop = true;
+        } else {
+          this.trigger('loopComplete');
+        }
+      } else {
+        _isComplete = true;
+        nextValue = 0;
+      }
     }
+  } else {
+    this.setCurrentRawFrameValue(nextValue);
+  }
+  if (_isComplete) {
+    this.setCurrentRawFrameValue(nextValue);
+    this.pause();
+    this.trigger('complete');
+  }
 };
 
-AnimationItem.prototype.adjustSegment = function(arr, offset){
-    this.playCount = 0;
-    if(arr[1] < arr[0]){
-        if(this.frameModifier > 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(-1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[0] - arr[1];
-        this.firstFrame = arr[1];
-        this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
-    } else if(arr[1] > arr[0]){
-        if(this.frameModifier < 0){
-            if(this.playSpeed < 0){
-                this.setSpeed(-this.playSpeed);
-            } else {
-                this.setDirection(1);
-            }
-        }
-        this.timeCompleted = this.totalFrames = arr[1] - arr[0];
-        this.firstFrame = arr[0];
-        this.setCurrentRawFrameValue(0.001 + offset);
+AnimationItem.prototype.adjustSegment = function (arr, offset) {
+  this.playCount = 0;
+  if (arr[1] < arr[0]) {
+    if (this.frameModifier > 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(-1);
+      }
     }
-    this.trigger('segmentStart');
+    this.totalFrames = arr[0] - arr[1];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[1];
+    this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
+  } else if (arr[1] > arr[0]) {
+    if (this.frameModifier < 0) {
+      if (this.playSpeed < 0) {
+        this.setSpeed(-this.playSpeed);
+      } else {
+        this.setDirection(1);
+      }
+    }
+    this.totalFrames = arr[1] - arr[0];
+    this.timeCompleted = this.totalFrames;
+    this.firstFrame = arr[0];
+    this.setCurrentRawFrameValue(0.001 + offset);
+  }
+  this.trigger('segmentStart');
 };
-AnimationItem.prototype.setSegment = function (init,end) {
-    var pendingFrame = -1;
-    if(this.isPaused) {
-        if (this.currentRawFrame + this.firstFrame < init) {
-            pendingFrame = init;
-        } else if (this.currentRawFrame + this.firstFrame > end) {
-            pendingFrame = end - init;
-        }
+AnimationItem.prototype.setSegment = function (init, end) {
+  var pendingFrame = -1;
+  if (this.isPaused) {
+    if (this.currentRawFrame + this.firstFrame < init) {
+      pendingFrame = init;
+    } else if (this.currentRawFrame + this.firstFrame > end) {
+      pendingFrame = end - init;
     }
+  }
 
-    this.firstFrame = init;
-    this.timeCompleted = this.totalFrames = end - init;
-    if(pendingFrame !== -1) {
-        this.goToAndStop(pendingFrame,true);
-    }
+  this.firstFrame = init;
+  this.totalFrames = end - init;
+  this.timeCompleted = this.totalFrames;
+  if (pendingFrame !== -1) {
+    this.goToAndStop(pendingFrame, true);
+  }
 };
 
 AnimationItem.prototype.playSegments = function (arr, forceFlag) {
-    if (forceFlag) {
-        this.segments.length = 0;
+  if (forceFlag) {
+    this.segments.length = 0;
+  }
+  if (typeof arr[0] === 'object') {
+    var i;
+    var len = arr.length;
+    for (i = 0; i < len; i += 1) {
+      this.segments.push(arr[i]);
     }
-    if (typeof arr[0] === 'object') {
-        var i, len = arr.length;
-        for (i = 0; i < len; i += 1) {
-            this.segments.push(arr[i]);
-        }
-    } else {
-        this.segments.push(arr);
-    }
-    if (this.segments.length && forceFlag) {
-        this.adjustSegment(this.segments.shift(), 0);
-    }
-    if (this.isPaused) {
-        this.play();
-    }
+  } else {
+    this.segments.push(arr);
+  }
+  if (this.segments.length && forceFlag) {
+    this.adjustSegment(this.segments.shift(), 0);
+  }
+  if (this.isPaused) {
+    this.play();
+  }
 };
 
 AnimationItem.prototype.resetSegments = function (forceFlag) {
-    this.segments.length = 0;
-    this.segments.push([this.animationData.ip,this.animationData.op]);
-    //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
-    if (forceFlag) {
-        this.checkSegments(0);
-    }
+  this.segments.length = 0;
+  this.segments.push([this.animationData.ip, this.animationData.op]);
+  // this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+  if (forceFlag) {
+    this.checkSegments(0);
+  }
 };
-AnimationItem.prototype.checkSegments = function(offset) {
-    if (this.segments.length) {
-        this.adjustSegment(this.segments.shift(), offset);
-        return true;
-    }
-    return false;
+AnimationItem.prototype.checkSegments = function (offset) {
+  if (this.segments.length) {
+    this.adjustSegment(this.segments.shift(), offset);
+    return true;
+  }
+  return false;
 };
 
 AnimationItem.prototype.destroy = function (name) {
-    if ((name && this.name != name) || !this.renderer) {
-        return;
-    }
-    this.renderer.destroy();
-    this.imagePreloader.destroy();
-    this.trigger('destroy');
-    this._cbs = null;
-    this.onEnterFrame = this.onLoopComplete = this.onComplete = this.onSegmentStart = this.onDestroy = null;
-    this.renderer = null;
+  if ((name && this.name !== name) || !this.renderer) {
+    return;
+  }
+  this.renderer.destroy();
+  this.imagePreloader.destroy();
+  this.trigger('destroy');
+  this._cbs = null;
+  this.onEnterFrame = null;
+  this.onLoopComplete = null;
+  this.onComplete = null;
+  this.onSegmentStart = null;
+  this.onDestroy = null;
+  this.renderer = null;
+  this.renderer = null;
+  this.imagePreloader = null;
+  this.projectInterface = null;
 };
 
-AnimationItem.prototype.setCurrentRawFrameValue = function(value){
-    this.currentRawFrame = value;
-    this.gotoFrame();
+AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
+  this.currentRawFrame = value;
+  this.gotoFrame();
 };
 
 AnimationItem.prototype.setSpeed = function (val) {
-    this.playSpeed = val;
-    this.updaFrameModifier();
+  this.playSpeed = val;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setDirection = function (val) {
-    this.playDirection = val < 0 ? -1 : 1;
-    this.updaFrameModifier();
+  this.playDirection = val < 0 ? -1 : 1;
+  this.updaFrameModifier();
 };
 
 AnimationItem.prototype.setVolume = function (val, name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.setVolume(val);
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.setVolume(val);
 };
 
 AnimationItem.prototype.getVolume = function () {
-    return this.audioController.getVolume();
+  return this.audioController.getVolume();
 };
 
 AnimationItem.prototype.mute = function (name) {
-    if (name && this.name !== name) {
-        return;
-    }
-    this.audioController.mute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.mute();
 };
 
 AnimationItem.prototype.unmute = function (name) {
-    if(name && this.name !== name){
-        return;
-    }
-    this.audioController.unmute();
+  if (name && this.name !== name) {
+    return;
+  }
+  this.audioController.unmute();
 };
 
 AnimationItem.prototype.updaFrameModifier = function () {
-    this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
-    this.audioController.setRate(this.playSpeed * this.playDirection)
+  this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
+  this.audioController.setRate(this.playSpeed * this.playDirection);
 };
 
 AnimationItem.prototype.getPath = function () {
-    return this.path;
+  return this.path;
 };
 
 AnimationItem.prototype.getAssetsPath = function (assetData) {
-    var path = '';
-    if(assetData.e) {
-        path = assetData.p;
-    } else if(this.assetsPath){
-        var imagePath = assetData.p;
-        if(imagePath.indexOf('images/') !== -1){
-            imagePath = imagePath.split('/')[1];
-        }
-        path = this.assetsPath + imagePath;
-    } else {
-        path = this.path;
-        path += assetData.u ? assetData.u : '';
-        path += assetData.p;
+  var path = '';
+  if (assetData.e) {
+    path = assetData.p;
+  } else if (this.assetsPath) {
+    var imagePath = assetData.p;
+    if (imagePath.indexOf('images/') !== -1) {
+      imagePath = imagePath.split('/')[1];
     }
-    return path;
+    path = this.assetsPath + imagePath;
+  } else {
+    path = this.path;
+    path += assetData.u ? assetData.u : '';
+    path += assetData.p;
+  }
+  return path;
 };
 
 AnimationItem.prototype.getAssetData = function (id) {
-    var i = 0, len = this.assets.length;
-    while (i < len) {
-        if(id == this.assets[i].id){
-            return this.assets[i];
-        }
-        i += 1;
+  var i = 0;
+  var len = this.assets.length;
+  while (i < len) {
+    if (id === this.assets[i].id) {
+      return this.assets[i];
     }
+    i += 1;
+  }
+  return null;
 };
 
 AnimationItem.prototype.hide = function () {
-    this.renderer.hide();
+  this.renderer.hide();
 };
 
 AnimationItem.prototype.show = function () {
-    this.renderer.show();
+  this.renderer.show();
 };
 
 AnimationItem.prototype.getDuration = function (isFrame) {
-    return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
+  return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
 };
 
-AnimationItem.prototype.trigger = function(name){
-    if(this._cbs && this._cbs[name]){
-        switch(name){
-            case 'enterFrame':
-                this.triggerEvent(name,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameModifier));
-                break;
-            case 'loopComplete':
-                this.triggerEvent(name,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-                break;
-            case 'complete':
-                this.triggerEvent(name,new BMCompleteEvent(name,this.frameMult));
-                break;
-            case 'segmentStart':
-                this.triggerEvent(name,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-                break;
-            case 'destroy':
-                this.triggerEvent(name,new BMDestroyEvent(name,this));
-                break;
-            default:
-                this.triggerEvent(name);
-        }
+AnimationItem.prototype.trigger = function (name) {
+  if (this._cbs && this._cbs[name]) {
+    switch (name) {
+      case 'enterFrame':
+        this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
+        break;
+      case 'loopComplete':
+        this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+        break;
+      case 'complete':
+        this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
+        break;
+      case 'segmentStart':
+        this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+        break;
+      case 'destroy':
+        this.triggerEvent(name, new BMDestroyEvent(name, this));
+        break;
+      default:
+        this.triggerEvent(name);
     }
-    if(name === 'enterFrame' && this.onEnterFrame){
-        this.onEnterFrame.call(this,new BMEnterFrameEvent(name,this.currentFrame,this.totalFrames,this.frameMult));
-    }
-    if(name === 'loopComplete' && this.onLoopComplete){
-        this.onLoopComplete.call(this,new BMCompleteLoopEvent(name,this.loop,this.playCount,this.frameMult));
-    }
-    if(name === 'complete' && this.onComplete){
-        this.onComplete.call(this,new BMCompleteEvent(name,this.frameMult));
-    }
-    if(name === 'segmentStart' && this.onSegmentStart){
-        this.onSegmentStart.call(this,new BMSegmentStartEvent(name,this.firstFrame,this.totalFrames));
-    }
-    if(name === 'destroy' && this.onDestroy){
-        this.onDestroy.call(this,new BMDestroyEvent(name,this));
-    }
+  }
+  if (name === 'enterFrame' && this.onEnterFrame) {
+    this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
+  }
+  if (name === 'loopComplete' && this.onLoopComplete) {
+    this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
+  }
+  if (name === 'complete' && this.onComplete) {
+    this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
+  }
+  if (name === 'segmentStart' && this.onSegmentStart) {
+    this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
+  }
+  if (name === 'destroy' && this.onDestroy) {
+    this.onDestroy.call(this, new BMDestroyEvent(name, this));
+  }
 };
 
-AnimationItem.prototype.triggerRenderFrameError = function(nativeError) {
+AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
+  var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
 
-    var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
 
-    if (this.onError) {
-        this.onError.call(this, error);
+AnimationItem.prototype.triggerConfigError = function (nativeError) {
+  var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
+  this.triggerEvent('error', error);
+
+  if (this.onError) {
+    this.onError.call(this, error);
+  }
+};
+
+/* global CompExpressionInterface, expressionsPlugin: writable */
+/* exported expressionsPlugin */
+
+var Expressions = (function () {
+  var ob = {};
+  ob.initExpressions = initExpressions;
+
+  function initExpressions(animation) {
+    var stackCount = 0;
+    var registers = [];
+
+    function pushExpression() {
+      stackCount += 1;
     }
-}
 
-AnimationItem.prototype.triggerConfigError = function(nativeError) {
-
-    var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
-    this.triggerEvent('error', error);
-
-    if (this.onError) {
-        this.onError.call(this, error);
+    function popExpression() {
+      stackCount -= 1;
+      if (stackCount === 0) {
+        releaseInstances();
+      }
     }
-}
-var Expressions = (function(){
-    var ob = {};
-    ob.initExpressions = initExpressions;
 
-
-    function initExpressions(animation){
-
-    	var stackCount = 0;
-    	var registers = [];
-
-    	function pushExpression() {
-			stackCount += 1;
-    	}
-
-    	function popExpression() {
-			stackCount -= 1;
-			if (stackCount === 0) {
-				releaseInstances();
-			}
-    	}
-
-    	function registerExpressionProperty(expression) {
-    		if (registers.indexOf(expression) === -1) {
-				registers.push(expression)
-    		}
-    	}
-
-    	function releaseInstances() {
-    		var i, len = registers.length;
-    		for (i = 0; i < len; i += 1) {
-				registers[i].release();
-    		}
-    		registers.length = 0;
-    	}
-
-        animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
-        animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
-        animation.renderer.globalData.pushExpression = pushExpression;
-        animation.renderer.globalData.popExpression = popExpression;
-        animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+    function registerExpressionProperty(expression) {
+      if (registers.indexOf(expression) === -1) {
+        registers.push(expression);
+      }
     }
-   return ob;
+
+    function releaseInstances() {
+      var i;
+      var len = registers.length;
+      for (i = 0; i < len; i += 1) {
+        registers[i].release();
+      }
+      registers.length = 0;
+    }
+
+    animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
+    animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
+    animation.renderer.globalData.pushExpression = pushExpression;
+    animation.renderer.globalData.popExpression = popExpression;
+    animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
+  }
+  return ob;
 }());
 
 expressionsPlugin = Expressions;
 
-var ExpressionManager = (function(){
-    'use strict';
-    var ob = {};
-    var Math = BMMath;
-    var window = null;
-    var document = null;
+/* eslint-disable camelcase, no-unused-vars */
+/* global BMMath, BezierFactory, createTypedArray, degToRads, shapePool */
 
-    function $bm_isInstanceOfArray(arr) {
-        return arr.constructor === Array || arr.constructor === Float32Array;
+var ExpressionManager = (function () {
+  'use strict';
+
+  var ob = {};
+  var Math = BMMath;
+  var window = null;
+  var document = null;
+
+  function $bm_isInstanceOfArray(arr) {
+    return arr.constructor === Array || arr.constructor === Float32Array;
+  }
+
+  function isNumerable(tOfV, v) {
+    return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+  }
+
+  function $bm_neg(a) {
+    var tOfA = typeof a;
+    if (tOfA === 'number' || tOfA === 'boolean' || a instanceof Number) {
+      return -a;
+    }
+    if ($bm_isInstanceOfArray(a)) {
+      var i;
+      var lenA = a.length;
+      var retArr = [];
+      for (i = 0; i < lenA; i += 1) {
+        retArr[i] = -a[i];
+      }
+      return retArr;
+    }
+    if (a.propType) {
+      return a.v;
+    }
+    return -a;
+  }
+
+  var easeInBez = BezierFactory.getBezierEasing(0.333, 0, 0.833, 0.833, 'easeIn').get;
+  var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, 0.667, 1, 'easeOut').get;
+  var easeInOutBez = BezierFactory.getBezierEasing(0.33, 0, 0.667, 1, 'easeInOut').get;
+
+  function sum(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (tOfA === 'string' || tOfB === 'string') {
+      return a + b;
+    }
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a + b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] += b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a + b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] + b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+  var add = sum;
+
+  function sub(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      if (tOfA === 'string') {
+        a = parseInt(a, 10);
+      }
+      if (tOfB === 'string') {
+        b = parseInt(b, 10);
+      }
+      return a - b;
+    }
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      a = a.slice(0);
+      a[0] -= b;
+      return a;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      b = b.slice(0);
+      b[0] = a - b[0];
+      return b;
+    }
+    if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
+      var i = 0;
+      var lenA = a.length;
+      var lenB = b.length;
+      var retArr = [];
+      while (i < lenA || i < lenB) {
+        if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
+          retArr[i] = a[i] - b[i];
+        } else {
+          retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
+        }
+        i += 1;
+      }
+      return retArr;
+    }
+    return 0;
+  }
+
+  function mul(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a * b;
     }
 
-    function isNumerable(tOfV, v) {
-        return tOfV === 'number' || tOfV === 'boolean' || tOfV === 'string' || v instanceof Number;
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] * b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a * b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+
+  function div(a, b) {
+    var tOfA = typeof a;
+    var tOfB = typeof b;
+    var arr;
+    if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
+      return a / b;
+    }
+    var i;
+    var len;
+    if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
+      len = a.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a[i] / b;
+      }
+      return arr;
+    }
+    if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
+      len = b.length;
+      arr = createTypedArray('float32', len);
+      for (i = 0; i < len; i += 1) {
+        arr[i] = a / b[i];
+      }
+      return arr;
+    }
+    return 0;
+  }
+  function mod(a, b) {
+    if (typeof a === 'string') {
+      a = parseInt(a, 10);
+    }
+    if (typeof b === 'string') {
+      b = parseInt(b, 10);
+    }
+    return a % b;
+  }
+  var $bm_sum = sum;
+  var $bm_sub = sub;
+  var $bm_mul = mul;
+  var $bm_div = div;
+  var $bm_mod = mod;
+
+  function clamp(num, min, max) {
+    if (min > max) {
+      var mm = max;
+      max = min;
+      min = mm;
+    }
+    return Math.min(Math.max(num, min), max);
+  }
+
+  function radiansToDegrees(val) {
+    return val / degToRads;
+  }
+  var radians_to_degrees = radiansToDegrees;
+
+  function degreesToRadians(val) {
+    return val * degToRads;
+  }
+  var degrees_to_radians = radiansToDegrees;
+
+  var helperLengthArray = [0, 0, 0, 0, 0, 0];
+
+  function length(arr1, arr2) {
+    if (typeof arr1 === 'number' || arr1 instanceof Number) {
+      arr2 = arr2 || 0;
+      return Math.abs(arr1 - arr2);
+    }
+    if (!arr2) {
+      arr2 = helperLengthArray;
+    }
+    var i;
+    var len = Math.min(arr1.length, arr2.length);
+    var addedLength = 0;
+    for (i = 0; i < len; i += 1) {
+      addedLength += Math.pow(arr2[i] - arr1[i], 2);
+    }
+    return Math.sqrt(addedLength);
+  }
+
+  function normalize(vec) {
+    return div(vec, length(vec));
+  }
+
+  function rgbToHsl(val) {
+    var r = val[0]; var g = val[1]; var b = val[2];
+    var max = Math.max(r, g, b);
+    var min = Math.min(r, g, b);
+    var h;
+    var s;
+    var l = (max + min) / 2;
+
+    if (max === min) {
+      h = 0; // achromatic
+      s = 0; // achromatic
+    } else {
+      var d = max - min;
+      s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+      switch (max) {
+        case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+        case g: h = (b - r) / d + 2; break;
+        case b: h = (r - g) / d + 4; break;
+        default: break;
+      }
+      h /= 6;
     }
 
-    function $bm_neg(a){
-        var tOfA = typeof a;
-        if(tOfA === 'number' || tOfA === 'boolean'  || a instanceof Number ){
-            return -a;
-        }
-        if($bm_isInstanceOfArray(a)){
-            var i, lenA = a.length;
-            var retArr = [];
-            for(i=0;i<lenA;i+=1){
-                retArr[i] = -a[i];
-            }
-            return retArr;
-        }
-        if (a.propType) {
-            return a.v;
-        }
+    return [h, s, l, val[3]];
+  }
+
+  function hue2rgb(p, q, t) {
+    if (t < 0) t += 1;
+    if (t > 1) t -= 1;
+    if (t < 1 / 6) return p + (q - p) * 6 * t;
+    if (t < 1 / 2) return q;
+    if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
+    return p;
+  }
+
+  function hslToRgb(val) {
+    var h = val[0];
+    var s = val[1];
+    var l = val[2];
+
+    var r;
+    var g;
+    var b;
+
+    if (s === 0) {
+      r = l; // achromatic
+      b = l; // achromatic
+      g = l; // achromatic
+    } else {
+      var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+      var p = 2 * l - q;
+      r = hue2rgb(p, q, h + 1 / 3);
+      g = hue2rgb(p, q, h);
+      b = hue2rgb(p, q, h - 1 / 3);
     }
 
-    var easeInBez = BezierFactory.getBezierEasing(0.333,0,.833,.833, 'easeIn').get;
-    var easeOutBez = BezierFactory.getBezierEasing(0.167,0.167,.667,1, 'easeOut').get;
-    var easeInOutBez = BezierFactory.getBezierEasing(.33,0,.667,1, 'easeInOut').get;
+    return [r, g, b, val[3]];
+  }
 
-    function sum(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(tOfA === 'string' || tOfB === 'string'){
-            return a + b;
-        }
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a + b;
-        }
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] + b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a + b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] + b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+  function linear(t, tMin, tMax, value1, value2) {
+    if (value1 === undefined || value2 === undefined) {
+      value1 = tMin;
+      value2 = tMax;
+      tMin = 0;
+      tMax = 1;
     }
-    var add = sum;
-
-    function sub(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            if(tOfA === 'string') {
-                a = parseInt(a);
-            }
-            if(tOfB === 'string') {
-                b = parseInt(b);
-            }
-            return a - b;
-        }
-        if( $bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            a = a.slice(0);
-            a[0] = a[0] - b;
-            return a;
-        }
-        if(isNumerable(tOfA, a) &&  $bm_isInstanceOfArray(b)){
-            b = b.slice(0);
-            b[0] = a - b[0];
-            return b;
-        }
-        if($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)){
-            var i = 0, lenA = a.length, lenB = b.length;
-            var retArr = [];
-            while(i<lenA || i < lenB){
-                if((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)){
-                    retArr[i] = a[i] - b[i];
-                }else{
-                    retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
-                }
-                i += 1;
-            }
-            return retArr;
-        }
-        return 0;
+    if (tMax < tMin) {
+      var _tMin = tMax;
+      tMax = tMin;
+      tMin = _tMin;
     }
-
-    function mul(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a * b;
-        }
-
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] * b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a * b[i];
-            }
-            return arr;
-        }
-        return 0;
+    if (t <= tMin) {
+      return value1;
+    } if (t >= tMax) {
+      return value2;
     }
-
-    function div(a,b) {
-        var tOfA = typeof a;
-        var tOfB = typeof b;
-        var arr;
-        if(isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
-            return a / b;
-        }
-        var i, len;
-        if($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)){
-            len = a.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a[i] / b;
-            }
-            return arr;
-        }
-        if(isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)){
-            len = b.length;
-            arr = createTypedArray('float32', len);
-            for(i=0;i<len;i+=1){
-                arr[i] = a / b[i];
-            }
-            return arr;
-        }
-        return 0;
+    var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin);
+    if (!value1.length) {
+      return value1 + (value2 - value1) * perc;
     }
-    function mod(a,b) {
-        if(typeof a === 'string') {
-            a = parseInt(a);
-        }
-        if(typeof b === 'string') {
-            b = parseInt(b);
-        }
-        return a % b;
+    var i;
+    var len = value1.length;
+    var arr = createTypedArray('float32', len);
+    for (i = 0; i < len; i += 1) {
+      arr[i] = value1[i] + (value2[i] - value1[i]) * perc;
     }
-    var $bm_sum = sum;
-    var $bm_sub = sub;
-    var $bm_mul = mul;
-    var $bm_div = div;
-    var $bm_mod = mod;
-
-    function clamp(num, min, max) {
-        if(min > max){
-            var mm = max;
-            max = min;
-            min = mm;
-        }
-        return Math.min(Math.max(num, min), max);
+    return arr;
+  }
+  function random(min, max) {
+    if (max === undefined) {
+      if (min === undefined) {
+        min = 0;
+        max = 1;
+      } else {
+        max = min;
+        min = undefined;
+      }
     }
-
-    function radiansToDegrees(val) {
-        return val/degToRads;
+    if (max.length) {
+      var i;
+      var len = max.length;
+      if (!min) {
+        min = createTypedArray('float32', len);
+      }
+      var arr = createTypedArray('float32', len);
+      var rnd = BMMath.random();
+      for (i = 0; i < len; i += 1) {
+        arr[i] = min[i] + rnd * (max[i] - min[i]);
+      }
+      return arr;
     }
-    var radians_to_degrees = radiansToDegrees;
-
-    function degreesToRadians(val) {
-        return val*degToRads;
+    if (min === undefined) {
+      min = 0;
     }
-    var degrees_to_radians = radiansToDegrees;
+    var rndm = BMMath.random();
+    return min + rndm * (max - min);
+  }
 
-    var helperLengthArray = [0,0,0,0,0,0];
-
-    function length(arr1, arr2) {
-        if (typeof arr1 === 'number' || arr1 instanceof Number) {
-            arr2 = arr2 || 0;
-            return Math.abs(arr1 - arr2);
-        }
-        if(!arr2) {
-            arr2 = helperLengthArray;
-        }
-        var i, len = Math.min(arr1.length, arr2.length);
-        var addedLength = 0;
-        for (i = 0; i < len; i += 1) {
-            addedLength += Math.pow(arr2[i] - arr1[i], 2);
-        }
-        return Math.sqrt(addedLength);
+  function createPath(points, inTangents, outTangents, closed) {
+    var i;
+    var len = points.length;
+    var path = shapePool.newElement();
+    path.setPathData(!!closed, len);
+    var arrPlaceholder = [0, 0];
+    var inVertexPoint;
+    var outVertexPoint;
+    for (i = 0; i < len; i += 1) {
+      inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
+      outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
+      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);
     }
+    return path;
+  }
 
-    function normalize(vec) {
-        return div(vec, length(vec));
-    }
+  function initiateExpression(elem, data, property) {
+    var val = data.x;
+    var needsVelocity = /velocity(?![\w\d])/.test(val);
+    var _needsRandom = val.indexOf('random') !== -1;
+    var elemType = elem.data.ty;
+    var transform;
+    var $bm_transform;
+    var content;
+    var effect;
+    var thisProperty = property;
+    thisProperty.valueAtTime = thisProperty.getValueAtTime;
+    Object.defineProperty(thisProperty, 'value', {
+      get: function () {
+        return thisProperty.v;
+      },
+    });
+    elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate;
+    elem.comp.displayStartTime = 0;
+    var inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    var outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    var width = elem.data.sw ? elem.data.sw : 0;
+    var height = elem.data.sh ? elem.data.sh : 0;
+    var name = elem.data.nm;
+    var loopIn;
+    var loop_in;
+    var loopOut;
+    var loop_out;
+    var smooth;
+    var toWorld;
+    var fromWorld;
+    var fromComp;
+    var toComp;
+    var fromCompToSurface;
+    var position;
+    var rotation;
+    var anchorPoint;
+    var scale;
+    var thisLayer;
+    var thisComp;
+    var mask;
+    var valueAtTime;
+    var velocityAtTime;
 
-    function rgbToHsl(val) {
-        var r = val[0]; var g = val[1]; var b = val[2];
-        var max = Math.max(r, g, b), min = Math.min(r, g, b);
-        var h, s, l = (max + min) / 2;
+    var scoped_bm_rt;
+    var expression_function = eval('[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]')[0]; // eslint-disable-line no-eval
+    var numKeys = property.kf ? data.k.length : 0;
 
-        if(max == min){
-            h = s = 0; // achromatic
-        }else{
-            var d = max - min;
-            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
-            switch(max){
-                case r: h = (g - b) / d + (g < b ? 6 : 0); break;
-                case g: h = (b - r) / d + 2; break;
-                case b: h = (r - g) / d + 4; break;
-            }
-            h /= 6;
+    var active = !this.data || this.data.hd !== true;
+
+    var wiggle = function wiggle(freq, amp) {
+      var iWiggle;
+      var j;
+      var lenWiggle = this.pv.length ? this.pv.length : 1;
+      var addedAmps = createTypedArray('float32', lenWiggle);
+      freq = 5;
+      var iterations = Math.floor(time * freq);
+      iWiggle = 0;
+      j = 0;
+      while (iWiggle < iterations) {
+        // var rnd = BMMath.random();
+        for (j = 0; j < lenWiggle; j += 1) {
+          addedAmps[j] += -amp + amp * 2 * BMMath.random();
+          // addedAmps[j] += -amp + amp*2*rnd;
         }
-
-        return [h, s, l,val[3]];
-    }
-
-    function hue2rgb(p, q, t){
-        if(t < 0) t += 1;
-        if(t > 1) t -= 1;
-        if(t < 1/6) return p + (q - p) * 6 * t;
-        if(t < 1/2) return q;
-        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
-        return p;
-    }
-
-    function hslToRgb(val){
-        var h = val[0];
-        var s = val[1];
-        var l = val[2];
-
-        var r, g, b;
-
-        if(s === 0){
-            r = g = b = l; // achromatic
-        }else{
-
-            var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-            var p = 2 * l - q;
-            r = hue2rgb(p, q, h + 1/3);
-            g = hue2rgb(p, q, h);
-            b = hue2rgb(p, q, h - 1/3);
-        }
-
-        return [r, g , b, val[3]];
-    }
-
-    function linear(t, tMin, tMax, value1, value2){
-        if(value1 === undefined || value2 === undefined){
-            value1 = tMin;
-            value2 = tMax;
-            tMin = 0;
-            tMax = 1;
-        }
-        if(tMax < tMin) {
-            var _tMin = tMax;
-            tMax = tMin;
-            tMin = _tMin;
-        }
-        if(t <= tMin) {
-            return value1;
-        }else if(t >= tMax){
-            return value2;
-        }
-        var perc = tMax === tMin ? 0 : (t-tMin)/(tMax-tMin);
-        if(!value1.length){
-            return value1 + (value2-value1)*perc;
-        }
-        var i, len = value1.length;
-        var arr = createTypedArray('float32', len);
-        for(i=0;i<len;i+=1){
-            arr[i] = value1[i] + (value2[i]-value1[i])*perc;
+        iWiggle += 1;
+      }
+      // var rnd2 = BMMath.random();
+      var periods = time * freq;
+      var perc = periods - Math.floor(periods);
+      var arr = createTypedArray('float32', lenWiggle);
+      if (lenWiggle > 1) {
+        for (j = 0; j < lenWiggle; j += 1) {
+          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;
+          // arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
         }
         return arr;
-    }
-    function random(min,max){
-        if(max === undefined){
-            if(min === undefined){
-                min = 0;
-                max = 1;
-            } else {
-                max = min;
-                min = undefined;
-            }
-        }
-        if(max.length){
-            var i, len = max.length;
-            if(!min){
-                min = createTypedArray('float32', len);
-            }
-            var arr = createTypedArray('float32', len);
-            var rnd = BMMath.random();
-            for(i=0;i<len;i+=1){
-                arr[i] = min[i] + rnd*(max[i]-min[i]);
-            }
-            return arr;
-        }
-        if(min === undefined){
-            min = 0;
-        }
-        var rndm = BMMath.random();
-        return min + rndm*(max-min);
+      }
+      return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc;
+    }.bind(this);
+
+    if (thisProperty.loopIn) {
+      loopIn = thisProperty.loopIn.bind(thisProperty);
+      loop_in = loopIn;
     }
 
-    function createPath(points, inTangents, outTangents, closed) {
-        var i, len = points.length;
-        var path = shape_pool.newElement();
-        path.setPathData(!!closed, len);
-        var arrPlaceholder = [0,0], inVertexPoint, outVertexPoint;
-        for(i = 0; i < len; i += 1) {
-            inVertexPoint = (inTangents && inTangents[i]) ? inTangents[i] : arrPlaceholder;
-            outVertexPoint = (outTangents && outTangents[i]) ? outTangents[i] : arrPlaceholder;
-            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);
-        }
-        return path;
+    if (thisProperty.loopOut) {
+      loopOut = thisProperty.loopOut.bind(thisProperty);
+      loop_out = loopOut;
     }
 
-    function initiateExpression(elem,data,property){
-        var val = data.x;
-        var needsVelocity = /velocity(?![\w\d])/.test(val);
-        var _needsRandom = val.indexOf('random') !== -1;
-        var elemType = elem.data.ty;
-        var transform,$bm_transform,content,effect;
-        var thisProperty = property;
-        thisProperty.valueAtTime = thisProperty.getValueAtTime;
-        Object.defineProperty(thisProperty, 'value', {
-            get: function() {
-                return thisProperty.v
-            }
-        })
-        elem.comp.frameDuration = 1/elem.comp.globalData.frameRate;
-        elem.comp.displayStartTime = 0;
-        var inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        var outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        var width = elem.data.sw ? elem.data.sw : 0;
-        var height = elem.data.sh ? elem.data.sh : 0;
-        var name = elem.data.nm;
-        var loopIn, loop_in, loopOut, loop_out, smooth;
-        var toWorld,fromWorld,fromComp,toComp,fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp,mask,valueAtTime,velocityAtTime;
-        var __expression_functions = [];
-        if(data.xf) {
-            var i, len = data.xf.length;
-            for(i = 0; i < len; i += 1) {
-                __expression_functions[i] = eval('(function(){ return ' + data.xf[i] + '}())');
-            }
-        }
-
-        var scoped_bm_rt;
-        var expression_function = eval('[function _expression_function(){' + val+';scoped_bm_rt=$bm_rt}' + ']')[0];
-        var numKeys = property.kf ? data.k.length : 0;
-
-        var active = !this.data || this.data.hd !== true;
-
-        var wiggle = function wiggle(freq,amp){
-            var i,j, len = this.pv.length ? this.pv.length : 1;
-            var addedAmps = createTypedArray('float32', len);
-            freq = 5;
-            var iterations = Math.floor(time*freq);
-            i = 0;
-            j = 0;
-            while(i<iterations){
-                //var rnd = BMMath.random();
-                for(j=0;j<len;j+=1){
-                    addedAmps[j] += -amp + amp*2*BMMath.random();
-                    //addedAmps[j] += -amp + amp*2*rnd;
-                }
-                i += 1;
-            }
-            //var rnd2 = BMMath.random();
-            var periods = time*freq;
-            var perc = periods - Math.floor(periods);
-            var arr = createTypedArray('float32', len);
-            if(len>1){
-                for(j=0;j<len;j+=1){
-                    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;
-                    //arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
-                }
-                return arr;
-            } else {
-                return this.pv + addedAmps[0] + (-amp + amp*2*BMMath.random())*perc;
-            }
-        }.bind(this);
-
-        if(thisProperty.loopIn) {
-            loopIn = thisProperty.loopIn.bind(thisProperty);
-            loop_in = loopIn;
-        }
-
-        if(thisProperty.loopOut) {
-            loopOut = thisProperty.loopOut.bind(thisProperty);
-            loop_out = loopOut;
-        }
-
-        if(thisProperty.smooth) {
-            smooth = thisProperty.smooth.bind(thisProperty);
-        }
-
-        function loopInDuration(type,duration){
-            return loopIn(type,duration,true);
-        }
-
-        function loopOutDuration(type,duration){
-            return loopOut(type,duration,true);
-        }
-
-        if(this.getValueAtTime) {
-            valueAtTime = this.getValueAtTime.bind(this);
-        }
-
-        if(this.getVelocityAtTime) {
-            velocityAtTime = this.getVelocityAtTime.bind(this);
-        }
-
-        var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
-
-        function lookAt(elem1,elem2){
-            var fVec = [elem2[0]-elem1[0],elem2[1]-elem1[1],elem2[2]-elem1[2]];
-            var pitch = Math.atan2(fVec[0],Math.sqrt(fVec[1]*fVec[1]+fVec[2]*fVec[2]))/degToRads;
-            var yaw = -Math.atan2(fVec[1],fVec[2])/degToRads;
-            return [yaw,pitch,0];
-        }
-
-        function easeOut(t, tMin, tMax, val1, val2){
-            return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function easeIn(t, tMin, tMax, val1, val2){
-            return applyEase(easeInBez, t, tMin, tMax, val1, val2);
-        }
-
-        function ease(t, tMin, tMax, val1, val2){
-            return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
-        }
-
-        function applyEase(fn, t, tMin, tMax, val1, val2) {
-            if(val1 === undefined){
-                val1 = tMin;
-                val2 = tMax;
-            } else {
-                t = (t - tMin) / (tMax - tMin);
-            }
-            t = t > 1 ? 1 : t < 0 ? 0 : t;
-            var mult = fn(t);
-            if($bm_isInstanceOfArray(val1)) {
-                var i, len = val1.length;
-                var arr = createTypedArray('float32', len);
-                for (i = 0; i < len; i += 1) {
-                    arr[i] = (val2[i] - val1[i]) * mult + val1[i];
-                }
-                return arr;
-            } else {
-                return (val2 - val1) * mult + val1;
-            }
-        }
-
-        function nearestKey(time){
-            var i, len = data.k.length,index,keyTime;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                index = 0;
-                keyTime = 0;
-            } else {
-                index = -1;
-                time *= elem.comp.globalData.frameRate;
-                if (time < data.k[0].t) {
-                    index = 1;
-                    keyTime = data.k[0].t;
-                } else {
-                    for(i=0;i<len-1;i+=1){
-                        if(time === data.k[i].t){
-                            index = i + 1;
-                            keyTime = data.k[i].t;
-                            break;
-                        }else if(time>data.k[i].t && time<data.k[i+1].t){
-                            if(time-data.k[i].t > data.k[i+1].t - time){
-                                index = i + 2;
-                                keyTime = data.k[i+1].t;
-                            } else {
-                                index = i + 1;
-                                keyTime = data.k[i].t;
-                            }
-                            break;
-                        }
-                    }
-                    if(index === -1){
-                        index = i + 1;
-                        keyTime = data.k[i].t;
-                    }
-                }
-                
-            }
-            var ob = {};
-            ob.index = index;
-            ob.time = keyTime/elem.comp.globalData.frameRate;
-            return ob;
-        }
-
-        function key(ind){
-            var ob, i, len;
-            if(!data.k.length || typeof(data.k[0]) === 'number'){
-                throw new Error('The property has no keyframe at index ' + ind);
-            }
-            ind -= 1;
-            ob = {
-                time: data.k[ind].t/elem.comp.globalData.frameRate,
-                value: []
-            };
-            var arr = data.k[ind].hasOwnProperty('s') ? data.k[ind].s : data.k[ind - 1].e;
-
-            len = arr.length;
-            for(i=0;i<len;i+=1){
-                ob[i] = arr[i];
-                ob.value[i] = arr[i]
-            }
-            return ob;
-        }
-
-        function framesToTime(frames, fps) { 
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return frames / fps;
-        }
-
-        function timeToFrames(t, fps) {
-            if (!t && t !== 0) {
-                t = time;
-            }
-            if (!fps) {
-                fps = elem.comp.globalData.frameRate;
-            }
-            return t * fps;
-        }
-
-        function seedRandom(seed){
-            BMMath.seedrandom(randSeed + seed);
-        }
-
-        function sourceRectAtTime() {
-            return elem.sourceRectAtTime();
-        }
-
-        function substring(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substring(init)
-                }
-                return value.substring(init, end)
-            }
-            return '';
-        }
-
-        function substr(init, end) {
-            if(typeof value === 'string') {
-                if(end === undefined) {
-                return value.substr(init)
-                }
-                return value.substr(init, end)
-            }
-            return '';
-        }
-
-        function posterizeTime(framesPerSecond) {
-            time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond
-            value = valueAtTime(time)
-        }
-
-        var time, velocity, value, text, textIndex, textTotal, selectorValue;
-        var index = elem.data.ind;
-        var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-        var parent;
-        var randSeed = Math.floor(Math.random()*1000000);
-        var globalData = elem.globalData;
-        function executeExpression(_value) {
-            // globalData.pushExpression();
-            value = _value;
-            if (_needsRandom) {
-                seedRandom(randSeed);
-            }
-            if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
-                return value;
-            }
-            if(this.propType === 'textSelector'){
-                textIndex = this.textIndex;
-                textTotal = this.textTotal;
-                selectorValue = this.selectorValue;
-            }
-            if (!thisLayer) {
-                text = elem.layerInterface.text;
-                thisLayer = elem.layerInterface;
-                thisComp = elem.comp.compInterface;
-                toWorld = thisLayer.toWorld.bind(thisLayer);
-                fromWorld = thisLayer.fromWorld.bind(thisLayer);
-                fromComp = thisLayer.fromComp.bind(thisLayer);
-                toComp = thisLayer.toComp.bind(thisLayer);
-                mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
-                fromCompToSurface = fromComp;
-            }
-            if (!transform) {
-                transform = elem.layerInterface("ADBE Transform Group");
-                $bm_transform = transform;
-                if(transform) {
-                    anchorPoint = transform.anchorPoint;
-                    /*position = transform.position;
-                    rotation = transform.rotation;
-                    scale = transform.scale;*/
-                }
-            }
-            
-            if (elemType === 4 && !content) {
-                content = thisLayer("ADBE Root Vectors Group");
-            }
-            if (!effect) {
-                effect = thisLayer(4);
-            }
-            hasParent = !!(elem.hierarchy && elem.hierarchy.length);
-            if (hasParent && !parent) {
-                parent = elem.hierarchy[0].layerInterface;
-            }
-            time = this.comp.renderedFrame/this.comp.globalData.frameRate;
-            if (needsVelocity) {
-                velocity = velocityAtTime(time);
-            }
-            expression_function();
-            this.frameExpressionId = elem.globalData.frameId;
-
-            //TODO: Check if it's possible to return on ShapeInterface the .v value
-            if (scoped_bm_rt.propType === "shape") {
-                scoped_bm_rt = scoped_bm_rt.v;
-            }
-            // globalData.popExpression();
-            return scoped_bm_rt;
-        }
-        return executeExpression;
+    if (thisProperty.smooth) {
+      smooth = thisProperty.smooth.bind(thisProperty);
     }
 
-    ob.initiateExpression = initiateExpression;
-    return ob;
-}());
-var expressionHelpers = (function(){
-
-    function searchExpressions(elem,data,prop){
-        if(data.x){
-            prop.k = true;
-            prop.x = true;
-            prop.initiateExpression = ExpressionManager.initiateExpression;
-            prop.effectsSequence.push(prop.initiateExpression(elem,data,prop).bind(prop));
-        }
+    function loopInDuration(type, duration) {
+      return loopIn(type, duration, true);
     }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
+    function loopOutDuration(type, duration) {
+      return loopOut(type, duration, true);
     }
 
-    function getSpeedAtTime(frameNum) {
-        var delta = -0.01;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var speed = 0;
-        if(v1.length){
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                speed += Math.pow(v2[i] - v1[i], 2);
-            }
-            speed = Math.sqrt(speed) * 100;
+    if (this.getValueAtTime) {
+      valueAtTime = this.getValueAtTime.bind(this);
+    }
+
+    if (this.getVelocityAtTime) {
+      velocityAtTime = this.getVelocityAtTime.bind(this);
+    }
+
+    var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
+
+    function lookAt(elem1, elem2) {
+      var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]];
+      var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads;
+      var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads;
+      return [yaw, pitch, 0];
+    }
+
+    function easeOut(t, tMin, tMax, val1, val2) {
+      return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function easeIn(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInBez, t, tMin, tMax, val1, val2);
+    }
+
+    function ease(t, tMin, tMax, val1, val2) {
+      return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
+    }
+
+    function applyEase(fn, t, tMin, tMax, val1, val2) {
+      if (val1 === undefined) {
+        val1 = tMin;
+        val2 = tMax;
+      } else {
+        t = (t - tMin) / (tMax - tMin);
+      }
+      if (t > 1) {
+        t = 1;
+      } else if (t < 0) {
+        t = 0;
+      }
+      var mult = fn(t);
+      if ($bm_isInstanceOfArray(val1)) {
+        var iKey;
+        var lenKey = val1.length;
+        var arr = createTypedArray('float32', lenKey);
+        for (iKey = 0; iKey < lenKey; iKey += 1) {
+          arr[iKey] = (val2[iKey] - val1[iKey]) * mult + val1[iKey];
+        }
+        return arr;
+      }
+      return (val2 - val1) * mult + val1;
+    }
+
+    function nearestKey(time) {
+      var iKey;
+      var lenKey = data.k.length;
+      var index;
+      var keyTime;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        index = 0;
+        keyTime = 0;
+      } else {
+        index = -1;
+        time *= elem.comp.globalData.frameRate;
+        if (time < data.k[0].t) {
+          index = 1;
+          keyTime = data.k[0].t;
         } else {
-            speed = 0;
+          for (iKey = 0; iKey < lenKey - 1; iKey += 1) {
+            if (time === data.k[iKey].t) {
+              index = iKey + 1;
+              keyTime = data.k[iKey].t;
+              break;
+            } else if (time > data.k[iKey].t && time < data.k[iKey + 1].t) {
+              if (time - data.k[iKey].t > data.k[iKey + 1].t - time) {
+                index = iKey + 2;
+                keyTime = data.k[iKey + 1].t;
+              } else {
+                index = iKey + 1;
+                keyTime = data.k[iKey].t;
+              }
+              break;
+            }
+          }
+          if (index === -1) {
+            index = iKey + 1;
+            keyTime = data.k[iKey].t;
+          }
         }
-        return speed;
+      }
+      var obKey = {};
+      obKey.index = index;
+      obKey.time = keyTime / elem.comp.globalData.frameRate;
+      return obKey;
     }
 
-    function getVelocityAtTime(frameNum) {
-        if(this.vel !== undefined){
-            return this.vel;
-        }
-        var delta = -0.001;
-        //frameNum += this.elem.data.st;
-        var v1 = this.getValueAtTime(frameNum);
-        var v2 = this.getValueAtTime(frameNum + delta);
-        var velocity;
-        if(v1.length){
-            velocity = createTypedArray('float32', v1.length);
-            var i;
-            for(i=0;i<v1.length;i+=1){
-                //removing frameRate
-                //if needed, don't add it here
-                //velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
-                velocity[i] = (v2[i] - v1[i])/delta;
-            }
-        } else {
-            velocity = (v2 - v1)/delta;
-        }
-        return velocity;
+    function key(ind) {
+      var obKey;
+      var iKey;
+      var lenKey;
+      if (!data.k.length || typeof (data.k[0]) === 'number') {
+        throw new Error('The property has no keyframe at index ' + ind);
+      }
+      ind -= 1;
+      obKey = {
+        time: data.k[ind].t / elem.comp.globalData.frameRate,
+        value: [],
+      };
+      var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;
+
+      lenKey = arr.length;
+      for (iKey = 0; iKey < lenKey; iKey += 1) {
+        obKey[iKey] = arr[iKey];
+        obKey.value[iKey] = arr[iKey];
+      }
+      return obKey;
     }
 
-    function getStaticValueAtTime() {
-        return this.pv;
+    function framesToTime(frames, fps) {
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return frames / fps;
     }
 
-    function setGroupProperty(propertyGroup){
-        this.propertyGroup = propertyGroup;
+    function timeToFrames(t, fps) {
+      if (!t && t !== 0) {
+        t = time;
+      }
+      if (!fps) {
+        fps = elem.comp.globalData.frameRate;
+      }
+      return t * fps;
     }
 
-	return {
-		searchExpressions: searchExpressions,
-		getSpeedAtTime: getSpeedAtTime,
-		getVelocityAtTime: getVelocityAtTime,
-		getValueAtTime: getValueAtTime,
-		getStaticValueAtTime: getStaticValueAtTime,
-		setGroupProperty: setGroupProperty,
-	}
-}());
-(function addPropertyDecorator() {
-
-    function loopOut(type,duration,durationFlag){
-        if(!this.k || !this.keyframes){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var lastKeyFrame = keyframes[keyframes.length - 1].t;
-        if(currentFrame<=lastKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, firstKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,lastKeyFrame - this.elem.data.ip);
-                } else {
-                    cycleDuration = Math.abs(lastKeyFrame - elem.comp.globalData.frameRate*duration);
-                }
-                firstKeyFrame = lastKeyFrame - cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(iterations % 2 !== 0){
-                    return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((currentFrame - firstKeyFrame)/cycleDuration);
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = (endV[i]-initV[i])*repeats + current[i];
-                    }
-                    return ret;
-                }
-                return (endV-initV)*repeats + current;
-            } else if(type === 'continue'){
-                var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(lastValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = lastValue[i] + (lastValue[i]-nextLastValue[i])*((currentFrame - lastKeyFrame)/ this.comp.globalData.frameRate)/0.0005;
-                    }
-                    return ret;
-                }
-                return lastValue + (lastValue-nextLastValue)*(((currentFrame - lastKeyFrame))/0.001);
-            }
-            return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function seedRandom(seed) {
+      BMMath.seedrandom(randSeed + seed);
     }
 
-    function loopIn(type,duration, durationFlag) {
-        if(!this.k){
-            return this.pv;
-        }
-        type = type ? type.toLowerCase() : '';
-        var currentFrame = this.comp.renderedFrame;
-        var keyframes = this.keyframes;
-        var firstKeyFrame = keyframes[0].t;
-        if(currentFrame>=firstKeyFrame){
-            return this.pv;
-        }else{
-            var cycleDuration, lastKeyFrame;
-            if(!durationFlag){
-                if(!duration || duration > keyframes.length - 1){
-                    duration = keyframes.length - 1;
-                }
-                lastKeyFrame = keyframes[duration].t;
-                cycleDuration = lastKeyFrame - firstKeyFrame;
-            } else {
-                if(!duration){
-                    cycleDuration = Math.max(0,this.elem.data.op - firstKeyFrame);
-                } else {
-                    cycleDuration = Math.abs(elem.comp.globalData.frameRate*duration);
-                }
-                lastKeyFrame = firstKeyFrame + cycleDuration;
-            }
-            var i, len, ret;
-            if(type === 'pingpong') {
-                var iterations = Math.floor((firstKeyFrame - currentFrame)/cycleDuration);
-                if(iterations % 2 === 0){
-                    return this.getValueAtTime((((firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-                }
-            } else if(type === 'offset'){
-                var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
-                var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame)%cycleDuration +  firstKeyFrame) / this.comp.globalData.frameRate, 0);
-                var repeats = Math.floor((firstKeyFrame - currentFrame)/cycleDuration)+1;
-                if(this.pv.length){
-                    ret = new Array(initV.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = current[i]-(endV[i]-initV[i])*repeats;
-                    }
-                    return ret;
-                }
-                return current-(endV-initV)*repeats;
-            } else if(type === 'continue'){
-                var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
-                var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
-                if(this.pv.length){
-                    ret = new Array(firstValue.length);
-                    len = ret.length;
-                    for(i=0;i<len;i+=1){
-                        ret[i] = firstValue[i] + (firstValue[i]-nextFirstValue[i])*(firstKeyFrame - currentFrame)/0.001;
-                    }
-                    return ret;
-                }
-                return firstValue + (firstValue-nextFirstValue)*(firstKeyFrame - currentFrame)/0.001;
-            }
-            return this.getValueAtTime(((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration +  firstKeyFrame)) / this.comp.globalData.frameRate, 0);
-        }
+    function sourceRectAtTime() {
+      return elem.sourceRectAtTime();
     }
 
-    function smooth(width, samples) {
-        if (!this.k){
-            return this.pv;
+    function substring(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substring(init);
         }
-        width = (width || 0.4) * 0.5;
-        samples = Math.floor(samples || 5);
-        if (samples <= 1) {
-            return this.pv;
+        return value.substring(init, end);
+      }
+      return '';
+    }
+
+    function substr(init, end) {
+      if (typeof value === 'string') {
+        if (end === undefined) {
+          return value.substr(init);
         }
-        var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
-        var initFrame = currentTime - width;
-        var endFrame = currentTime + width;
-        var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
-        var i = 0, j = 0;
-        var value;
-        if (this.pv.length) {
-            value = createTypedArray('float32', this.pv.length);
-        } else {
-            value = 0;
-        }
-        var sampleValue;
-        while (i < samples) {
-            sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
-            if(this.pv.length) {
-                for (j = 0; j < this.pv.length; j += 1) {
-                    value[j] += sampleValue[j];
-                }
-            } else {
-                value += sampleValue;
-            }
-            i += 1;
-        }
-        if(this.pv.length) {
-            for (j = 0; j < this.pv.length; j += 1) {
-                value[j] /= samples;
-            }
-        } else {
-            value /= samples;
-        }
+        return value.substr(init, end);
+      }
+      return '';
+    }
+
+    function posterizeTime(framesPerSecond) {
+      time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond;
+      value = valueAtTime(time);
+    }
+
+    var time;
+    var velocity;
+    var value;
+    var text;
+    var textIndex;
+    var textTotal;
+    var selectorValue;
+    var index = elem.data.ind;
+    var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+    var parent;
+    var randSeed = Math.floor(Math.random() * 1000000);
+    var globalData = elem.globalData;
+    function executeExpression(_value) {
+      // globalData.pushExpression();
+      value = _value;
+      if (_needsRandom) {
+        seedRandom(randSeed);
+      }
+      if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
         return value;
+      }
+      if (this.propType === 'textSelector') {
+        textIndex = this.textIndex;
+        textTotal = this.textTotal;
+        selectorValue = this.selectorValue;
+      }
+      if (!thisLayer) {
+        text = elem.layerInterface.text;
+        thisLayer = elem.layerInterface;
+        thisComp = elem.comp.compInterface;
+        toWorld = thisLayer.toWorld.bind(thisLayer);
+        fromWorld = thisLayer.fromWorld.bind(thisLayer);
+        fromComp = thisLayer.fromComp.bind(thisLayer);
+        toComp = thisLayer.toComp.bind(thisLayer);
+        mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
+        fromCompToSurface = fromComp;
+      }
+      if (!transform) {
+        transform = elem.layerInterface('ADBE Transform Group');
+        $bm_transform = transform;
+        if (transform) {
+          anchorPoint = transform.anchorPoint;
+          /* position = transform.position;
+                    rotation = transform.rotation;
+                    scale = transform.scale; */
+        }
+      }
+
+      if (elemType === 4 && !content) {
+        content = thisLayer('ADBE Root Vectors Group');
+      }
+      if (!effect) {
+        effect = thisLayer(4);
+      }
+      hasParent = !!(elem.hierarchy && elem.hierarchy.length);
+      if (hasParent && !parent) {
+        parent = elem.hierarchy[0].layerInterface;
+      }
+      time = this.comp.renderedFrame / this.comp.globalData.frameRate;
+      if (needsVelocity) {
+        velocity = velocityAtTime(time);
+      }
+      expression_function();
+      this.frameExpressionId = elem.globalData.frameId;
+
+      // TODO: Check if it's possible to return on ShapeInterface the .v value
+      if (scoped_bm_rt.propType === 'shape') {
+        scoped_bm_rt = scoped_bm_rt.v;
+      }
+      // globalData.popExpression();
+      return scoped_bm_rt;
     }
+    return executeExpression;
+  }
 
-    function getValueAtTime(frameNum) {
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastFrame) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
-            this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
-            this._cachingAtTime.lastFrame = frameNum;
-        }
-        return this._cachingAtTime.value;
-
-    }
-
-    function getTransformValueAtTime(time) {
-        if (!this._transformCachingAtTime) {
-            this._transformCachingAtTime = {
-                v: new Matrix(),
-            };
-        }
-        ////
-        var matrix = this._transformCachingAtTime.v;
-        matrix.cloneFromProps(this.pre.props);
-        if (this.appliedTransformations < 1) {
-            var anchor = this.a.getValueAtTime(time);
-            matrix.translate(
-                -anchor[0] * this.a.mult,
-                -anchor[1] * this.a.mult,
-                anchor[2] * this.a.mult
-            );
-        }
-        if (this.appliedTransformations < 2) {
-            var scale = this.s.getValueAtTime(time);
-            matrix.scale(
-                scale[0] * this.s.mult,
-                scale[1] * this.s.mult,
-                scale[2] * this.s.mult
-            );
-        }
-        if (this.sk && this.appliedTransformations < 3) {
-            var skew = this.sk.getValueAtTime(time);
-            var skewAxis = this.sa.getValueAtTime(time);
-            matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
-        }
-        if (this.r && this.appliedTransformations < 4) {
-            var rotation = this.r.getValueAtTime(time);
-            matrix.rotate(-rotation * this.r.mult);
-        } else if (!this.r && this.appliedTransformations < 4){
-            var rotationZ = this.rz.getValueAtTime(time);
-            var rotationY = this.ry.getValueAtTime(time);
-            var rotationX = this.rx.getValueAtTime(time);
-            var orientation = this.or.getValueAtTime(time);
-            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);
-        }
-        if (this.data.p && this.data.p.s) {
-            var positionX = this.px.getValueAtTime(time);
-            var positionY = this.py.getValueAtTime(time);
-            if (this.data.p.z) {
-                var positionZ = this.pz.getValueAtTime(time);
-                matrix.translate(
-                    positionX * this.px.mult,
-                    positionY * this.py.mult,
-                    -positionZ * this.pz.mult
-                );
-            } else {
-                matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
-            }
-        } else {
-            var position = this.p.getValueAtTime(time);
-            matrix.translate(
-                position[0] * this.p.mult,
-                position[1] * this.p.mult,
-                -position[2] * this.p.mult
-            );
-        }
-        return matrix;
-        ////
-    }
-
-    function getTransformStaticValueAtTime(time) {
-        return this.v.clone(new Matrix());
-    }
-
-    var getTransformProperty = TransformPropertyFactory.getTransformProperty;
-    TransformPropertyFactory.getTransformProperty = function(elem, data, container) {
-        var prop = getTransformProperty(elem, data, container);
-        if(prop.dynamicProperties.length) {
-            prop.getValueAtTime = getTransformValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        return prop;
-    };
-
-    var propertyGetProp = PropertyFactory.getProp;
-    PropertyFactory.getProp = function(elem,data,type, mult, container){
-        var prop = propertyGetProp(elem,data,type, mult, container);
-        //prop.getVelocityAtTime = getVelocityAtTime;
-        //prop.loopOut = loopOut;
-        //prop.loopIn = loopIn;
-        if(prop.kf){
-            prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
-        } else {
-            prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
-        }
-        prop.setGroupProperty = expressionHelpers.setGroupProperty;
-        prop.loopOut = loopOut;
-        prop.loopIn = loopIn;
-        prop.smooth = smooth;
-        prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
-        prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
-        prop.numKeys = data.a === 1 ? data.k.length : 0;
-        prop.propertyIndex = data.ix;
-        var value = 0;
-        if(type !== 0) {
-            value = createTypedArray('float32', data.a === 1 ?  data.k[0].s.length : data.k.length);
-        }
-        prop._cachingAtTime = {
-            lastFrame: initialDefaultFrame,
-            lastIndex: 0,
-            value: value
-        };
-        expressionHelpers.searchExpressions(elem,data,prop);
-        if(prop.k){
-            container.addDynamicProperty(prop);
-        }
-
-        return prop;
-    };
-
-    function getShapeValueAtTime(frameNum) {
-        //For now this caching object is created only when needed instead of creating it when the shape is initialized.
-        if (!this._cachingAtTime) {
-            this._cachingAtTime = {
-                shapeValue: shape_pool.clone(this.pv),
-                lastIndex: 0,
-                lastTime: initialDefaultFrame
-            };
-        }
-        
-        frameNum *= this.elem.globalData.frameRate;
-        frameNum -= this.offsetTime;
-        if(frameNum !== this._cachingAtTime.lastTime) {
-            this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
-            this._cachingAtTime.lastTime = frameNum;
-            this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
-        }
-        return this._cachingAtTime.shapeValue;
-    }
-
-    var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
-    var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
-
-    function ShapeExpressions(){}
-    ShapeExpressions.prototype = {
-        vertices: function(prop, time){
-            if (this.k) {
-                this.getValue();
-            }
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            var i, len = shapePath._length;
-            var vertices = shapePath[prop];
-            var points = shapePath.v;
-            var arr = createSizedArray(len);
-            for(i = 0; i < len; i += 1) {
-                if(prop === 'i' || prop === 'o') {
-                    arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
-                } else {
-                    arr[i] = [vertices[i][0], vertices[i][1]];
-                }
-                
-            }
-            return arr;
-        },
-        points: function(time){
-            return this.vertices('v', time);
-        },
-        inTangents: function(time){
-            return this.vertices('i', time);
-        },
-        outTangents: function(time){
-            return this.vertices('o', time);
-        },
-        isClosed: function(){
-            return this.v.c;
-        },
-        pointOnPath: function(perc, time){
-            var shapePath = this.v;
-            if(time !== undefined) {
-                shapePath = this.getValueAtTime(time, 0);
-            }
-            if(!this._segmentsLength) {
-                this._segmentsLength = bez.getSegmentsLength(shapePath);
-            }
-
-            var segmentsLength = this._segmentsLength;
-            var lengths = segmentsLength.lengths;
-            var lengthPos = segmentsLength.totalLength * perc;
-            var i = 0, len = lengths.length;
-            var j = 0, jLen;
-            var accumulatedLength = 0, pt;
-            while(i < len) {
-                if(accumulatedLength + lengths[i].addedLength > lengthPos) {
-                    var initIndex = i;
-                    var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
-                    var segmentPerc = (lengthPos - accumulatedLength)/lengths[i].addedLength;
-                    pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
-                    break;
-                } else {
-                    accumulatedLength += lengths[i].addedLength;
-                }
-                i += 1;
-            }
-            if(!pt){
-                pt = shapePath.c ? [shapePath.v[0][0],shapePath.v[0][1]]:[shapePath.v[shapePath._length-1][0],shapePath.v[shapePath._length-1][1]];
-            }
-            return pt;
-        },
-        vectorOnPath: function(perc, time, vectorType){
-            //perc doesn't use triple equality because it can be a Number object as well as a primitive.
-            perc = perc == 1 ? this.v.c ? 0 : 0.999 : perc;
-            var pt1 = this.pointOnPath(perc, time);
-            var pt2 = this.pointOnPath(perc + 0.001, time);
-            var xLength = pt2[0] - pt1[0];
-            var yLength = pt2[1] - pt1[1];
-            var magnitude = Math.sqrt(Math.pow(xLength,2) + Math.pow(yLength,2));
-            if (magnitude === 0) {
-                return [0,0];
-            }
-            var unitVector = vectorType === 'tangent' ? [xLength/magnitude, yLength/magnitude] : [-yLength/magnitude, xLength/magnitude];
-            return unitVector;
-        },
-        tangentOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'tangent');
-        },
-        normalOnPath: function(perc, time){
-            return this.vectorOnPath(perc, time, 'normal');
-        },
-        setGroupProperty: expressionHelpers.setGroupProperty,
-        getValueAtTime: expressionHelpers.getStaticValueAtTime
-    };
-    extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
-    extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
-    KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
-    KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
-
-    var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
-    ShapePropertyFactory.getShapeProp = function(elem,data,type, arr, trims){
-        var prop = propertyGetShapeProp(elem,data,type, arr, trims);
-        prop.propertyIndex = data.ix;
-        prop.lock = false;
-        if(type === 3){
-            expressionHelpers.searchExpressions(elem,data.pt,prop);
-        } else if(type === 4){
-            expressionHelpers.searchExpressions(elem,data.ks,prop);
-        }
-        if(prop.k){
-            elem.addDynamicProperty(prop);
-        }
-        return prop;
-    };
+  ob.initiateExpression = initiateExpression;
+  return ob;
 }());
+
+/* global ExpressionManager, createTypedArray */
+/* exported expressionHelpers */
+
+var expressionHelpers = (function () {
+  function searchExpressions(elem, data, prop) {
+    if (data.x) {
+      prop.k = true;
+      prop.x = true;
+      prop.initiateExpression = ExpressionManager.initiateExpression;
+      prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop));
+    }
+  }
+
+  function getValueAtTime(frameNum) {
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastFrame) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
+      this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
+      this._cachingAtTime.lastFrame = frameNum;
+    }
+    return this._cachingAtTime.value;
+  }
+
+  function getSpeedAtTime(frameNum) {
+    var delta = -0.01;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var speed = 0;
+    if (v1.length) {
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        speed += Math.pow(v2[i] - v1[i], 2);
+      }
+      speed = Math.sqrt(speed) * 100;
+    } else {
+      speed = 0;
+    }
+    return speed;
+  }
+
+  function getVelocityAtTime(frameNum) {
+    if (this.vel !== undefined) {
+      return this.vel;
+    }
+    var delta = -0.001;
+    // frameNum += this.elem.data.st;
+    var v1 = this.getValueAtTime(frameNum);
+    var v2 = this.getValueAtTime(frameNum + delta);
+    var velocity;
+    if (v1.length) {
+      velocity = createTypedArray('float32', v1.length);
+      var i;
+      for (i = 0; i < v1.length; i += 1) {
+        // removing frameRate
+        // if needed, don't add it here
+        // velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
+        velocity[i] = (v2[i] - v1[i]) / delta;
+      }
+    } else {
+      velocity = (v2 - v1) / delta;
+    }
+    return velocity;
+  }
+
+  function getStaticValueAtTime() {
+    return this.pv;
+  }
+
+  function setGroupProperty(propertyGroup) {
+    this.propertyGroup = propertyGroup;
+  }
+
+  return {
+    searchExpressions: searchExpressions,
+    getSpeedAtTime: getSpeedAtTime,
+    getVelocityAtTime: getVelocityAtTime,
+    getValueAtTime: getValueAtTime,
+    getStaticValueAtTime: getStaticValueAtTime,
+    setGroupProperty: setGroupProperty,
+  };
+}());
+
+/* global createTypedArray, Matrix, TransformPropertyFactory, expressionHelpers, PropertyFactory, expressionHelpers,
+initialDefaultFrame, shapePool, ShapePropertyFactory, bez, extendPrototype, ExpressionManager, createSizedArray */
+
+(function addPropertyDecorator() {
+  function loopOut(type, duration, durationFlag) {
+    if (!this.k || !this.keyframes) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var lastKeyFrame = keyframes[keyframes.length - 1].t;
+    if (currentFrame <= lastKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var firstKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip);
+      } else {
+        cycleDuration = Math.abs(lastKeyFrame - this.elem.comp.globalData.frameRate * duration);
+      }
+      firstKeyFrame = lastKeyFrame - cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (iterations % 2 !== 0) {
+          return this.getValueAtTime(((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+        var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = (endV[i] - initV[i]) * repeats + current[i];
+        }
+        return ret;
+      }
+      return (endV - initV) * repeats + current;
+    } else if (type === 'continue') {
+      var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(lastValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+            ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005; // eslint-disable-line
+        }
+        return ret;
+      }
+      return lastValue + (lastValue - nextLastValue) * (((currentFrame - lastKeyFrame)) / 0.001);
+    }
+      return this.getValueAtTime((((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function loopIn(type, duration, durationFlag) {
+    if (!this.k) {
+      return this.pv;
+    }
+    type = type ? type.toLowerCase() : '';
+    var currentFrame = this.comp.renderedFrame;
+    var keyframes = this.keyframes;
+    var firstKeyFrame = keyframes[0].t;
+    if (currentFrame >= firstKeyFrame) {
+      return this.pv;
+    }
+    var cycleDuration;
+    var lastKeyFrame;
+    if (!durationFlag) {
+      if (!duration || duration > keyframes.length - 1) {
+        duration = keyframes.length - 1;
+      }
+      lastKeyFrame = keyframes[duration].t;
+      cycleDuration = lastKeyFrame - firstKeyFrame;
+    } else {
+      if (!duration) {
+        cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame);
+      } else {
+        cycleDuration = Math.abs(this.elem.comp.globalData.frameRate * duration);
+      }
+      lastKeyFrame = firstKeyFrame + cycleDuration;
+    }
+    var i;
+    var len;
+    var ret;
+    if (type === 'pingpong') {
+      var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration);
+      if (iterations % 2 === 0) {
+          return this.getValueAtTime((((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+      }
+    } else if (type === 'offset') {
+      var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
+      var current = this.getValueAtTime((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration) + firstKeyFrame) / this.comp.globalData.frameRate, 0);
+      var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1;
+      if (this.pv.length) {
+        ret = new Array(initV.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = current[i] - (endV[i] - initV[i]) * repeats;
+        }
+        return ret;
+      }
+      return current - (endV - initV) * repeats;
+    } else if (type === 'continue') {
+      var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
+      var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
+      if (this.pv.length) {
+        ret = new Array(firstValue.length);
+        len = ret.length;
+        for (i = 0; i < len; i += 1) {
+          ret[i] = firstValue[i] + ((firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame)) / 0.001;
+        }
+        return ret;
+      }
+      return firstValue + ((firstValue - nextFirstValue) * (firstKeyFrame - currentFrame)) / 0.001;
+    }
+      return this.getValueAtTime(((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame))) / this.comp.globalData.frameRate, 0); // eslint-disable-line
+
+  }
+
+  function smooth(width, samples) {
+    if (!this.k) {
+      return this.pv;
+    }
+    width = (width || 0.4) * 0.5;
+    samples = Math.floor(samples || 5);
+    if (samples <= 1) {
+      return this.pv;
+    }
+    var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
+    var initFrame = currentTime - width;
+    var endFrame = currentTime + width;
+    var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
+    var i = 0;
+    var j = 0;
+    var value;
+    if (this.pv.length) {
+      value = createTypedArray('float32', this.pv.length);
+    } else {
+      value = 0;
+    }
+    var sampleValue;
+    while (i < samples) {
+      sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
+      if (this.pv.length) {
+        for (j = 0; j < this.pv.length; j += 1) {
+          value[j] += sampleValue[j];
+        }
+      } else {
+        value += sampleValue;
+      }
+      i += 1;
+    }
+    if (this.pv.length) {
+      for (j = 0; j < this.pv.length; j += 1) {
+        value[j] /= samples;
+      }
+    } else {
+      value /= samples;
+    }
+    return value;
+  }
+
+  function getTransformValueAtTime(time) {
+    if (!this._transformCachingAtTime) {
+      this._transformCachingAtTime = {
+        v: new Matrix(),
+      };
+    }
+    /// /
+    var matrix = this._transformCachingAtTime.v;
+    matrix.cloneFromProps(this.pre.props);
+    if (this.appliedTransformations < 1) {
+      var anchor = this.a.getValueAtTime(time);
+      matrix.translate(
+        -anchor[0] * this.a.mult,
+        -anchor[1] * this.a.mult,
+        anchor[2] * this.a.mult
+      );
+    }
+    if (this.appliedTransformations < 2) {
+      var scale = this.s.getValueAtTime(time);
+      matrix.scale(
+        scale[0] * this.s.mult,
+        scale[1] * this.s.mult,
+        scale[2] * this.s.mult
+      );
+    }
+    if (this.sk && this.appliedTransformations < 3) {
+      var skew = this.sk.getValueAtTime(time);
+      var skewAxis = this.sa.getValueAtTime(time);
+      matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
+    }
+    if (this.r && this.appliedTransformations < 4) {
+      var rotation = this.r.getValueAtTime(time);
+      matrix.rotate(-rotation * this.r.mult);
+    } else if (!this.r && this.appliedTransformations < 4) {
+      var rotationZ = this.rz.getValueAtTime(time);
+      var rotationY = this.ry.getValueAtTime(time);
+      var rotationX = this.rx.getValueAtTime(time);
+      var orientation = this.or.getValueAtTime(time);
+      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);
+    }
+    if (this.data.p && this.data.p.s) {
+      var positionX = this.px.getValueAtTime(time);
+      var positionY = this.py.getValueAtTime(time);
+      if (this.data.p.z) {
+        var positionZ = this.pz.getValueAtTime(time);
+        matrix.translate(
+          positionX * this.px.mult,
+          positionY * this.py.mult,
+          -positionZ * this.pz.mult
+        );
+      } else {
+        matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
+      }
+    } else {
+      var position = this.p.getValueAtTime(time);
+      matrix.translate(
+        position[0] * this.p.mult,
+        position[1] * this.p.mult,
+        -position[2] * this.p.mult
+      );
+    }
+    return matrix;
+    /// /
+  }
+
+  function getTransformStaticValueAtTime() {
+    return this.v.clone(new Matrix());
+  }
+
+  var getTransformProperty = TransformPropertyFactory.getTransformProperty;
+  TransformPropertyFactory.getTransformProperty = function (elem, data, container) {
+    var prop = getTransformProperty(elem, data, container);
+    if (prop.dynamicProperties.length) {
+      prop.getValueAtTime = getTransformValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    return prop;
+  };
+
+  var propertyGetProp = PropertyFactory.getProp;
+  PropertyFactory.getProp = function (elem, data, type, mult, container) {
+    var prop = propertyGetProp(elem, data, type, mult, container);
+    // prop.getVelocityAtTime = getVelocityAtTime;
+    // prop.loopOut = loopOut;
+    // prop.loopIn = loopIn;
+    if (prop.kf) {
+      prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
+    } else {
+      prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
+    }
+    prop.setGroupProperty = expressionHelpers.setGroupProperty;
+    prop.loopOut = loopOut;
+    prop.loopIn = loopIn;
+    prop.smooth = smooth;
+    prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
+    prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
+    prop.numKeys = data.a === 1 ? data.k.length : 0;
+    prop.propertyIndex = data.ix;
+    var value = 0;
+    if (type !== 0) {
+      value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);
+    }
+    prop._cachingAtTime = {
+      lastFrame: initialDefaultFrame,
+      lastIndex: 0,
+      value: value,
+    };
+    expressionHelpers.searchExpressions(elem, data, prop);
+    if (prop.k) {
+      container.addDynamicProperty(prop);
+    }
+
+    return prop;
+  };
+
+  function getShapeValueAtTime(frameNum) {
+    // For now this caching object is created only when needed instead of creating it when the shape is initialized.
+    if (!this._cachingAtTime) {
+      this._cachingAtTime = {
+        shapeValue: shapePool.clone(this.pv),
+        lastIndex: 0,
+        lastTime: initialDefaultFrame,
+      };
+    }
+
+    frameNum *= this.elem.globalData.frameRate;
+    frameNum -= this.offsetTime;
+    if (frameNum !== this._cachingAtTime.lastTime) {
+      this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
+      this._cachingAtTime.lastTime = frameNum;
+      this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
+    }
+    return this._cachingAtTime.shapeValue;
+  }
+
+  var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
+  var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
+
+  function ShapeExpressions() {}
+  ShapeExpressions.prototype = {
+    vertices: function (prop, time) {
+      if (this.k) {
+        this.getValue();
+      }
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      var i;
+      var len = shapePath._length;
+      var vertices = shapePath[prop];
+      var points = shapePath.v;
+      var arr = createSizedArray(len);
+      for (i = 0; i < len; i += 1) {
+        if (prop === 'i' || prop === 'o') {
+          arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
+        } else {
+          arr[i] = [vertices[i][0], vertices[i][1]];
+        }
+      }
+      return arr;
+    },
+    points: function (time) {
+      return this.vertices('v', time);
+    },
+    inTangents: function (time) {
+      return this.vertices('i', time);
+    },
+    outTangents: function (time) {
+      return this.vertices('o', time);
+    },
+    isClosed: function () {
+      return this.v.c;
+    },
+    pointOnPath: function (perc, time) {
+      var shapePath = this.v;
+      if (time !== undefined) {
+        shapePath = this.getValueAtTime(time, 0);
+      }
+      if (!this._segmentsLength) {
+        this._segmentsLength = bez.getSegmentsLength(shapePath);
+      }
+
+      var segmentsLength = this._segmentsLength;
+      var lengths = segmentsLength.lengths;
+      var lengthPos = segmentsLength.totalLength * perc;
+      var i = 0;
+      var len = lengths.length;
+      var accumulatedLength = 0;
+      var pt;
+      while (i < len) {
+        if (accumulatedLength + lengths[i].addedLength > lengthPos) {
+          var initIndex = i;
+          var endIndex = (shapePath.c && i === len - 1) ? 0 : i + 1;
+          var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength;
+          pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
+          break;
+        } else {
+          accumulatedLength += lengths[i].addedLength;
+        }
+        i += 1;
+      }
+      if (!pt) {
+        pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]];
+      }
+      return pt;
+    },
+    vectorOnPath: function (perc, time, vectorType) {
+      // perc doesn't use triple equality because it can be a Number object as well as a primitive.
+      if (perc == 1) { // eslint-disable-line eqeqeq
+        perc = this.v.c;
+      } else if (perc == 0) { // eslint-disable-line eqeqeq
+        perc = 0.999;
+      }
+      var pt1 = this.pointOnPath(perc, time);
+      var pt2 = this.pointOnPath(perc + 0.001, time);
+      var xLength = pt2[0] - pt1[0];
+      var yLength = pt2[1] - pt1[1];
+      var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2));
+      if (magnitude === 0) {
+        return [0, 0];
+      }
+      var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude];
+      return unitVector;
+    },
+    tangentOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'tangent');
+    },
+    normalOnPath: function (perc, time) {
+      return this.vectorOnPath(perc, time, 'normal');
+    },
+    setGroupProperty: expressionHelpers.setGroupProperty,
+    getValueAtTime: expressionHelpers.getStaticValueAtTime,
+  };
+  extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
+  extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
+  KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
+  KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
+
+  var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
+  ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) {
+    var prop = propertyGetShapeProp(elem, data, type, arr, trims);
+    prop.propertyIndex = data.ix;
+    prop.lock = false;
+    if (type === 3) {
+      expressionHelpers.searchExpressions(elem, data.pt, prop);
+    } else if (type === 4) {
+      expressionHelpers.searchExpressions(elem, data.ks, prop);
+    }
+    if (prop.k) {
+      elem.addDynamicProperty(prop);
+    }
+    return prop;
+  };
+}());
+
+/* global ExpressionManager, TextProperty */
+
 (function addDecorator() {
-
-    function searchExpressions(){
-        if(this.data.d.x){
-            this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this);
-            this.addEffect(this.getExpressionValue.bind(this));
-            return true;
-        }
+  function searchExpressions() {
+    if (this.data.d.x) {
+      this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this);
+      this.addEffect(this.getExpressionValue.bind(this));
+      return true;
     }
+    return null;
+  }
 
-    TextProperty.prototype.getExpressionValue = function(currentValue, text) {
-        var newValue = this.calculateExpression(text);
-        if(currentValue.t !== newValue) {
-            var newData = {};
-            this.copyData(newData, currentValue);
-            newData.t = newValue.toString();
-            newData.__complete = false;
-            return newData;
-        }
-        return currentValue;
+  TextProperty.prototype.getExpressionValue = function (currentValue, text) {
+    var newValue = this.calculateExpression(text);
+    if (currentValue.t !== newValue) {
+      var newData = {};
+      this.copyData(newData, currentValue);
+      newData.t = newValue.toString();
+      newData.__complete = false;
+      return newData;
     }
+    return currentValue;
+  };
 
-    TextProperty.prototype.searchProperty = function(){
+  TextProperty.prototype.searchProperty = function () {
+    var isKeyframed = this.searchKeyframes();
+    var hasExpressions = this.searchExpressions();
+    this.kf = isKeyframed || hasExpressions;
+    return this.kf;
+  };
 
-        var isKeyframed = this.searchKeyframes();
-        var hasExpressions = this.searchExpressions();
-        this.kf = isKeyframed || hasExpressions;
-        return this.kf;
-    };
-
-    TextProperty.prototype.searchExpressions = searchExpressions;
-    
+  TextProperty.prototype.searchExpressions = searchExpressions;
 }());
+
+/* global propertyGroupFactory, PropertyInterface */
+/* exported ShapePathInterface */
+
 var ShapePathInterface = (
 
-	function() {
+  function () {
+    return function pathInterfaceFactory(shape, view, propertyGroup) {
+      var prop = view.sh;
 
-		return function pathInterfaceFactory(shape,view,propertyGroup){
-		    var prop = view.sh;
-
-		    function interfaceFunction(val){
-		        if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2){
-		            return interfaceFunction.path;
-		        }
-		    }
-
-		    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-		    prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
-		    Object.defineProperties(interfaceFunction, {
-		        'path': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        'shape': {
-		            get: function(){
-		                if(prop.k){
-		                    prop.getValue();
-		                }
-		                return prop;
-		            }
-		        },
-		        '_name': { value: shape.nm },
-		        'ix': { value: shape.ix },
-		        'propertyIndex': { value: shape.ix },
-		        'mn': { value: shape.mn },
-		        'propertyGroup': {value: propertyGroup},
-		    });
-		    return interfaceFunction;
-		}
-	}()
-)
-var propertyGroupFactory = (function() {
-	return function(interfaceFunction, parentPropertyGroup) {
-		return function(val) {
-			val = val === undefined ? 1 : val
-			if(val <= 0){
-			    return interfaceFunction;
-			} else{
-			    return parentPropertyGroup(val-1);
-			}
-		}
-	}
-}())
-var PropertyInterface = (function() {
-	return function(propertyName, propertyGroup) {
-
-		var interfaceFunction = {
-			_name: propertyName
-		}
-
-		function _propertyGroup(val){
-		    val = val === undefined ? 1 : val
-		    if(val <= 0){
-		        return interfaceFunction;
-		    } else {
-		        return propertyGroup(--val);
-		    }
-		}
-
-		return _propertyGroup;
-	}
-}())
-var ShapeExpressionInterface = (function(){
-
-    function iterateElements(shapes,view, propertyGroup){
-        var arr = [];
-        var i, len = shapes ? shapes.length : 0;
-        for(i=0;i<len;i+=1){
-            if(shapes[i].ty == 'gr'){
-                arr.push(groupInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'fl'){
-                arr.push(fillInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'st'){
-                arr.push(strokeInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tm'){
-                arr.push(trimInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'tr'){
-                //arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'el'){
-                arr.push(ellipseInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }else if(shapes[i].ty == 'sr'){
-                arr.push(starInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'sh'){
-                arr.push(ShapePathInterface(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rc'){
-                arr.push(rectInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rd'){
-                arr.push(roundedInterfaceFactory(shapes[i],view[i],propertyGroup));
-            } else if(shapes[i].ty == 'rp'){
-                arr.push(repeaterInterfaceFactory(shapes[i],view[i],propertyGroup));
-            }
+      function interfaceFunction(val) {
+        if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {
+          return interfaceFunction.path;
         }
-        return arr;
-    }
+        return null;
+      }
 
-    function contentsInterfaceFactory(shape,view, propertyGroup){
-       var interfaces;
-       var interfaceFunction = function _interfaceFunction(value){
-           var i = 0, len = interfaces.length;
-            while(i<len){
-                if(interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value){
-                   return interfaces[i];
-                }
-                i+=1;
+      var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+      prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
+      Object.defineProperties(interfaceFunction, {
+        path: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-            if(typeof value === 'number'){
-               return interfaces[value-1];
+            return prop;
+          },
+        },
+        shape: {
+          get: function () {
+            if (prop.k) {
+              prop.getValue();
             }
-       };
-
-       interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-       interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
-       interfaceFunction.numProperties = interfaces.length;
-       var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-       interfaceFunction.transform = transformInterface;
-       interfaceFunction.propertyIndex = shape.cix;
-       interfaceFunction._name = shape.nm;
-
-       return interfaceFunction;
-   }
-
-    function groupInterfaceFactory(shape,view, propertyGroup){
-        var interfaceFunction = function _interfaceFunction(value){
-            switch(value){
-                case 'ADBE Vectors Group':
-                case 'Contents':
-                case 2:
-                    return interfaceFunction.content;
-                //Not necessary for now. Keeping them here in case a new case appears
-                //case 'ADBE Vector Transform Group':
-                //case 3:
-                default:
-                    return interfaceFunction.transform;
-            }
-        };
-        interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var content = contentsInterfaceFactory(shape,view,interfaceFunction.propertyGroup);
-        var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1],view.it[view.it.length - 1],interfaceFunction.propertyGroup);
-        interfaceFunction.content = content;
-        interfaceFunction.transform = transformInterface;
-        Object.defineProperty(interfaceFunction, '_name', {
-            get: function(){
-                return shape.nm;
-            }
-        });
-        //interfaceFunction.content = interfaceFunction;
-        interfaceFunction.numProperties = shape.np;
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.nm = shape.nm;
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function fillInterfaceFactory(shape,view,propertyGroup){
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
-        return interfaceFunction;
-    }
-
-    function strokeInterfaceFactory(shape,view,propertyGroup){
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
-        function addPropertyToDashOb(i) {
-            Object.defineProperty(dashOb, shape.d[i].nm, {
-                get: ExpressionPropertyInterface(view.d.dataProps[i].p)
-            });
-        }
-        var i, len = shape.d ? shape.d.length : 0;
-        var dashOb = {};
-        for (i = 0; i < len; i += 1) {
-            addPropertyToDashOb(i);
-            view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
-        }
-
-        function interfaceFunction(val){
-            if(val === 'Color' || val === 'color'){
-                return interfaceFunction.color;
-            } else if(val === 'Opacity' || val === 'opacity'){
-                return interfaceFunction.opacity;
-            } else if(val === 'Stroke Width' || val === 'stroke width'){
-                return interfaceFunction.strokeWidth;
-            }
-        }
-        Object.defineProperties(interfaceFunction, {
-            'color': {
-                get: ExpressionPropertyInterface(view.c)
-            },
-            'opacity': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            'strokeWidth': {
-                get: ExpressionPropertyInterface(view.w)
-            },
-            'dash': {
-                get: function() {
-                    return dashOb;
-                }
-            },
-            '_name': { value: shape.nm },
-            'mn': { value: shape.mn }
-        });
-
-        view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
-        return interfaceFunction;
-    }
-
-    function trimInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(val){
-            if(val === shape.e.ix || val === 'End' || val === 'end'){
-                return interfaceFunction.end;
-            }
-            if(val === shape.s.ix){
-                return interfaceFunction.start;
-            }
-            if(val === shape.o.ix){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-
-        view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
-        view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
-        view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        interfaceFunction.propertyIndex = shape.ix;
-        interfaceFunction.propertyGroup = propertyGroup;
-
-        Object.defineProperties(interfaceFunction, {
-            'start': {
-                get: ExpressionPropertyInterface(view.s)
-            },
-            'end': {
-                get: ExpressionPropertyInterface(view.e)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(view.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function transformInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.a.ix === value || value === 'Anchor Point'){
-                return interfaceFunction.anchorPoint;
-            }
-            if(shape.o.ix === value || value === 'Opacity'){
-                return interfaceFunction.opacity;
-            }
-            if(shape.p.ix === value || value === 'Position'){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation'){
-                return interfaceFunction.rotation;
-            }
-            if(shape.s.ix === value || value === 'Scale'){
-                return interfaceFunction.scale;
-            }
-            if(shape.sk && shape.sk.ix === value || value === 'Skew'){
-                return interfaceFunction.skew;
-            }
-            if(shape.sa && shape.sa.ix === value || value === 'Skew Axis'){
-                return interfaceFunction.skewAxis;
-            }
-        }
-        
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
-        view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
-        view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(view.transform.mProps.sk){
-            view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
-            view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
-        }
-        view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'opacity': {
-                get: ExpressionPropertyInterface(view.transform.mProps.o)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(view.transform.mProps.p)
-            },
-            'anchorPoint': {
-                get: ExpressionPropertyInterface(view.transform.mProps.a)
-            },
-            'scale': {
-                get: ExpressionPropertyInterface(view.transform.mProps.s)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(view.transform.mProps.r)
-            },
-            'skew': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sk)
-            },
-            'skewAxis': {
-                get: ExpressionPropertyInterface(view.transform.mProps.sa)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.ty = 'tr';
-        interfaceFunction.mn = shape.mn;
-        interfaceFunction.propertyGroup = propertyGroup;
-        return interfaceFunction;
-    }
-
-    function ellipseInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.s.ix === value){
-                return interfaceFunction.size;
-            }
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        interfaceFunction.propertyIndex = shape.ix;
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function starInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.rotation;
-            }
-            if(shape.pt.ix === value){
-                return interfaceFunction.points;
-            }
-            if(shape.or.ix === value || 'ADBE Vector Star Outer Radius' === value){
-                return interfaceFunction.outerRadius;
-            }
-            if(shape.os.ix === value){
-                return interfaceFunction.outerRoundness;
-            }
-            if(shape.ir && (shape.ir.ix === value || 'ADBE Vector Star Inner Radius' === value)){
-                return interfaceFunction.innerRadius;
-            }
-            if(shape.is && shape.is.ix === value){
-                return interfaceFunction.innerRoundness;
-            }
-
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
-        prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
-        prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-        if(shape.ir){
-            prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
-            prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
-        }
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'rotation': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'points': {
-                get: ExpressionPropertyInterface(prop.pt)
-            },
-            'outerRadius': {
-                get: ExpressionPropertyInterface(prop.or)
-            },
-            'outerRoundness': {
-                get: ExpressionPropertyInterface(prop.os)
-            },
-            'innerRadius': {
-                get: ExpressionPropertyInterface(prop.ir)
-            },
-            'innerRoundness': {
-                get: ExpressionPropertyInterface(prop.is)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function rectInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.p.ix === value){
-                return interfaceFunction.position;
-            }
-            if(shape.r.ix === value){
-                return interfaceFunction.roundness;
-            }
-            if(shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size'){
-                return interfaceFunction.size;
-            }
-
-        }
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-
-        var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
-        prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
-        prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'position': {
-                get: ExpressionPropertyInterface(prop.p)
-            },
-            'roundness': {
-                get: ExpressionPropertyInterface(prop.r)
-            },
-            'size': {
-                get: ExpressionPropertyInterface(prop.s)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function roundedInterfaceFactory(shape,view,propertyGroup){
-       
-        function interfaceFunction(value){
-            if(shape.r.ix === value || 'Round Corners 1' === value){
-                return interfaceFunction.radius;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
-
-        Object.defineProperties(interfaceFunction, {
-            'radius': {
-                get: ExpressionPropertyInterface(prop.rd)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    function repeaterInterfaceFactory(shape,view,propertyGroup){
-
-        function interfaceFunction(value){
-            if(shape.c.ix === value || 'Copies' === value){
-                return interfaceFunction.copies;
-            } else if(shape.o.ix === value || 'Offset' === value){
-                return interfaceFunction.offset;
-            }
-        }
-
-        var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
-        var prop = view;
-        interfaceFunction.propertyIndex = shape.ix;
-        prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
-        prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
-        Object.defineProperties(interfaceFunction, {
-            'copies': {
-                get: ExpressionPropertyInterface(prop.c)
-            },
-            'offset': {
-                get: ExpressionPropertyInterface(prop.o)
-            },
-            '_name': { value: shape.nm }
-        });
-        interfaceFunction.mn = shape.mn;
-        return interfaceFunction;
-    }
-
-    return function(shapes,view,propertyGroup) {
-        var interfaces;
-        function _interfaceFunction(value){
-            if(typeof value === 'number'){
-                value = value === undefined ? 1 : value
-                if (value === 0) {
-                    return propertyGroup
-                } else {
-                    return interfaces[value-1];
-                }
-            } else {
-                var i = 0, len = interfaces.length;
-                while(i<len){
-                    if(interfaces[i]._name === value){
-                        return interfaces[i];
-                    }
-                    i+=1;
-                }
-            }
-        }
-        function parentGroupWrapper() {
-            return propertyGroup
-        }
-        _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
-        interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
-        _interfaceFunction.numProperties = interfaces.length;
-        _interfaceFunction._name = 'Contents';
-        return _interfaceFunction;
+            return prop;
+          },
+        },
+        _name: { value: shape.nm },
+        ix: { value: shape.ix },
+        propertyIndex: { value: shape.ix },
+        mn: { value: shape.mn },
+        propertyGroup: { value: propertyGroup },
+      });
+      return interfaceFunction;
     };
+  }()
+);
+
+/* exported propertyGroupFactory */
+
+var propertyGroupFactory = (function () {
+  return function (interfaceFunction, parentPropertyGroup) {
+    return function (val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return parentPropertyGroup(val - 1);
+    };
+  };
 }());
 
-var TextExpressionInterface = (function(){
-	return function(elem){
-        var _prevValue, _sourceText;
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Text Document":
-                    return _thisLayerFunction.sourceText;
-            }
-        }
-        Object.defineProperty(_thisLayerFunction, "sourceText", {
-            get: function(){
-                elem.textProperty.getValue()
-                var stringValue = elem.textProperty.currentData.t;
-                if(stringValue !== _prevValue) {
-                    elem.textProperty.currentData.t = _prevValue;
-                    _sourceText = new String(stringValue);
-                    //If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
-                    _sourceText.value = stringValue ? stringValue : new String(stringValue);
-                }
-                return _sourceText;
-            }
-        });
-        return _thisLayerFunction;
+/* exported PropertyInterface */
+
+var PropertyInterface = (function () {
+  return function (propertyName, propertyGroup) {
+    var interfaceFunction = {
+      _name: propertyName,
     };
+
+    function _propertyGroup(val) {
+      val = val === undefined ? 1 : val;
+      if (val <= 0) {
+        return interfaceFunction;
+      }
+      return propertyGroup(val - 1);
+    }
+
+    return _propertyGroup;
+  };
 }());
-var LayerExpressionInterface = (function (){
 
-    function getMatrix(time) {
-        var toWorldMat = new Matrix();
-        if (time !== undefined) {
-            var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
-            propMatrix.clone(toWorldMat);
-        } else {
-            var transformMat = this._elem.finalTransform.mProp;
-            transformMat.applyToMatrix(toWorldMat);
+/* global ExpressionPropertyInterface, PropertyInterface, propertyGroupFactory, ShapePathInterface */
+/* exported ShapeExpressionInterface */
+
+var ShapeExpressionInterface = (function () {
+  function iterateElements(shapes, view, propertyGroup) {
+    var arr = [];
+    var i;
+    var len = shapes ? shapes.length : 0;
+    for (i = 0; i < len; i += 1) {
+      if (shapes[i].ty === 'gr') {
+        arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'fl') {
+        arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'st') {
+        arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tm') {
+        arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'tr') {
+        // arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
+      } else if (shapes[i].ty === 'el') {
+        arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sr') {
+        arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'sh') {
+        arr.push(ShapePathInterface(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rc') {
+        arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rd') {
+        arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup));
+      } else if (shapes[i].ty === 'rp') {
+        arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup));
+      }
+    }
+    return arr;
+  }
+
+  function contentsInterfaceFactory(shape, view, propertyGroup) {
+    var interfaces;
+    var interfaceFunction = function _interfaceFunction(value) {
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) {
+          return interfaces[i];
         }
-        return toWorldMat;
-    }
-
-    function toWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function toWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.applyPoint(toWorldMat, arr);
-    }
-
-    function fromWorldVec(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        toWorldMat.props[12] = toWorldMat.props[13] = toWorldMat.props[14] = 0;
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function fromWorld(arr, time){
-        var toWorldMat = this.getMatrix(time);
-        return this.invertPoint(toWorldMat, arr);
-    }
-
-    function applyPoint(matrix, arr) {
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.applyToPointArray(arr[0],arr[1],arr[2]||0);
-    }
-
-    function invertPoint(matrix, arr) {
-        if (this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
-            }
-        }
-        return matrix.inversePoint(arr);
-    }
-
-    function fromComp(arr){
-        var toWorldMat = new Matrix();
-        toWorldMat.reset();
-        this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
-        if(this._elem.hierarchy && this._elem.hierarchy.length){
-            var i, len = this._elem.hierarchy.length;
-            for(i=0;i<len;i+=1){
-                this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
-            }
-            return toWorldMat.inversePoint(arr);
-        }
-        return toWorldMat.inversePoint(arr);
-    }
-
-    function sampleImage() {
-        return [1,1,1,1];
-    }
-
-
-    return function(elem){
-
-        var transformInterface;
-
-        function _registerMaskInterface(maskManager){
-            _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
-        }
-        function _registerEffectsInterface(effects){
-            _thisLayerFunction.effect = effects;
-        }
-
-        function _thisLayerFunction(name){
-            switch(name){
-                case "ADBE Root Vectors Group":
-                case "Contents":
-                case 2:
-                    return _thisLayerFunction.shapeInterface;
-                case 1:
-                case 6:
-                case "Transform":
-                case "transform":
-                case "ADBE Transform Group":
-                    return transformInterface;
-                case 4:
-                case "ADBE Effect Parade":
-                case "effects":
-                case "Effects":
-                    return _thisLayerFunction.effect;
-                case "ADBE Text Properties":
-                    return _thisLayerFunction.textInterface;
-            }
-        }
-        _thisLayerFunction.getMatrix = getMatrix;
-        _thisLayerFunction.invertPoint = invertPoint;
-        _thisLayerFunction.applyPoint = applyPoint;
-        _thisLayerFunction.toWorld = toWorld;
-        _thisLayerFunction.toWorldVec = toWorldVec;
-        _thisLayerFunction.fromWorld = fromWorld;
-        _thisLayerFunction.fromWorldVec = fromWorldVec;
-        _thisLayerFunction.toComp = toWorld;
-        _thisLayerFunction.fromComp = fromComp;
-        _thisLayerFunction.sampleImage = sampleImage;
-        _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
-        _thisLayerFunction._elem = elem;
-        transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
-        var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
-        Object.defineProperties(_thisLayerFunction,{
-            hasParent: {
-                get: function(){
-                    return elem.hierarchy.length;
-                }
-            },
-            parent: {
-                get: function(){
-                    return elem.hierarchy[0].layerInterface;
-                }
-            },
-            rotation: getDescriptor(transformInterface, 'rotation'),
-            scale: getDescriptor(transformInterface, 'scale'),
-            position: getDescriptor(transformInterface, 'position'),
-            opacity: getDescriptor(transformInterface, 'opacity'),
-            anchorPoint: anchorPointDescriptor,
-            anchor_point: anchorPointDescriptor,
-            transform: {
-                get: function () {
-                    return transformInterface;
-                }
-            },
-            active: {
-                get: function(){
-                    return elem.isInRange;
-                }
-            }
-        });
-
-        _thisLayerFunction.startTime = elem.data.st;
-        _thisLayerFunction.index = elem.data.ind;
-        _thisLayerFunction.source = elem.data.refId;
-        _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
-        _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
-        _thisLayerFunction.inPoint = elem.data.ip/elem.comp.globalData.frameRate;
-        _thisLayerFunction.outPoint = elem.data.op/elem.comp.globalData.frameRate;
-        _thisLayerFunction._name = elem.data.nm;
-
-        _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
-        _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
-        return _thisLayerFunction;
+        i += 1;
+      }
+      if (typeof value === 'number') {
+        return interfaces[value - 1];
+      }
+      return null;
     };
+
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
+    interfaceFunction.numProperties = interfaces.length;
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.transform = transformInterface;
+    interfaceFunction.propertyIndex = shape.cix;
+    interfaceFunction._name = shape.nm;
+
+    return interfaceFunction;
+  }
+
+  function groupInterfaceFactory(shape, view, propertyGroup) {
+    var interfaceFunction = function _interfaceFunction(value) {
+      switch (value) {
+        case 'ADBE Vectors Group':
+        case 'Contents':
+        case 2:
+          return interfaceFunction.content;
+          // Not necessary for now. Keeping them here in case a new case appears
+          // case 'ADBE Vector Transform Group':
+          // case 3:
+        default:
+          return interfaceFunction.transform;
+      }
+    };
+    interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup);
+    var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
+    interfaceFunction.content = content;
+    interfaceFunction.transform = transformInterface;
+    Object.defineProperty(interfaceFunction, '_name', {
+      get: function () {
+        return shape.nm;
+      },
+    });
+    // interfaceFunction.content = interfaceFunction;
+    interfaceFunction.numProperties = shape.np;
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.nm = shape.nm;
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function fillInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
+    return interfaceFunction;
+  }
+
+  function strokeInterfaceFactory(shape, view, propertyGroup) {
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
+    function addPropertyToDashOb(i) {
+      Object.defineProperty(dashOb, shape.d[i].nm, {
+        get: ExpressionPropertyInterface(view.d.dataProps[i].p),
+      });
+    }
+    var i;
+    var len = shape.d ? shape.d.length : 0;
+    var dashOb = {};
+    for (i = 0; i < len; i += 1) {
+      addPropertyToDashOb(i);
+      view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
+    }
+
+    function interfaceFunction(val) {
+      if (val === 'Color' || val === 'color') {
+        return interfaceFunction.color;
+      } if (val === 'Opacity' || val === 'opacity') {
+        return interfaceFunction.opacity;
+      } if (val === 'Stroke Width' || val === 'stroke width') {
+        return interfaceFunction.strokeWidth;
+      }
+      return null;
+    }
+    Object.defineProperties(interfaceFunction, {
+      color: {
+        get: ExpressionPropertyInterface(view.c),
+      },
+      opacity: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      strokeWidth: {
+        get: ExpressionPropertyInterface(view.w),
+      },
+      dash: {
+        get: function () {
+          return dashOb;
+        },
+      },
+      _name: { value: shape.nm },
+      mn: { value: shape.mn },
+    });
+
+    view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
+    return interfaceFunction;
+  }
+
+  function trimInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(val) {
+      if (val === shape.e.ix || val === 'End' || val === 'end') {
+        return interfaceFunction.end;
+      }
+      if (val === shape.s.ix) {
+        return interfaceFunction.start;
+      }
+      if (val === shape.o.ix) {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+
+    view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
+    view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
+    view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    interfaceFunction.propertyIndex = shape.ix;
+    interfaceFunction.propertyGroup = propertyGroup;
+
+    Object.defineProperties(interfaceFunction, {
+      start: {
+        get: ExpressionPropertyInterface(view.s),
+      },
+      end: {
+        get: ExpressionPropertyInterface(view.e),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(view.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function transformInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.a.ix === value || value === 'Anchor Point') {
+        return interfaceFunction.anchorPoint;
+      }
+      if (shape.o.ix === value || value === 'Opacity') {
+        return interfaceFunction.opacity;
+      }
+      if (shape.p.ix === value || value === 'Position') {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') {
+        return interfaceFunction.rotation;
+      }
+      if (shape.s.ix === value || value === 'Scale') {
+        return interfaceFunction.scale;
+      }
+      if ((shape.sk && shape.sk.ix === value) || value === 'Skew') {
+        return interfaceFunction.skew;
+      }
+      if ((shape.sa && shape.sa.ix === value) || value === 'Skew Axis') {
+        return interfaceFunction.skewAxis;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
+    view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
+    view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (view.transform.mProps.sk) {
+      view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
+      view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
+    }
+    view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      opacity: {
+        get: ExpressionPropertyInterface(view.transform.mProps.o),
+      },
+      position: {
+        get: ExpressionPropertyInterface(view.transform.mProps.p),
+      },
+      anchorPoint: {
+        get: ExpressionPropertyInterface(view.transform.mProps.a),
+      },
+      scale: {
+        get: ExpressionPropertyInterface(view.transform.mProps.s),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(view.transform.mProps.r),
+      },
+      skew: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sk),
+      },
+      skewAxis: {
+        get: ExpressionPropertyInterface(view.transform.mProps.sa),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.ty = 'tr';
+    interfaceFunction.mn = shape.mn;
+    interfaceFunction.propertyGroup = propertyGroup;
+    return interfaceFunction;
+  }
+
+  function ellipseInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.s.ix === value) {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    interfaceFunction.propertyIndex = shape.ix;
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function starInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.rotation;
+      }
+      if (shape.pt.ix === value) {
+        return interfaceFunction.points;
+      }
+      if (shape.or.ix === value || value === 'ADBE Vector Star Outer Radius') {
+        return interfaceFunction.outerRadius;
+      }
+      if (shape.os.ix === value) {
+        return interfaceFunction.outerRoundness;
+      }
+      if (shape.ir && (shape.ir.ix === value || value === 'ADBE Vector Star Inner Radius')) {
+        return interfaceFunction.innerRadius;
+      }
+      if (shape.is && shape.is.ix === value) {
+        return interfaceFunction.innerRoundness;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
+    prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
+    prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+    if (shape.ir) {
+      prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
+      prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
+    }
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      rotation: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      points: {
+        get: ExpressionPropertyInterface(prop.pt),
+      },
+      outerRadius: {
+        get: ExpressionPropertyInterface(prop.or),
+      },
+      outerRoundness: {
+        get: ExpressionPropertyInterface(prop.os),
+      },
+      innerRadius: {
+        get: ExpressionPropertyInterface(prop.ir),
+      },
+      innerRoundness: {
+        get: ExpressionPropertyInterface(prop.is),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function rectInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.p.ix === value) {
+        return interfaceFunction.position;
+      }
+      if (shape.r.ix === value) {
+        return interfaceFunction.roundness;
+      }
+      if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') {
+        return interfaceFunction.size;
+      }
+      return null;
+    }
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+
+    var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
+    prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
+    prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      position: {
+        get: ExpressionPropertyInterface(prop.p),
+      },
+      roundness: {
+        get: ExpressionPropertyInterface(prop.r),
+      },
+      size: {
+        get: ExpressionPropertyInterface(prop.s),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function roundedInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.r.ix === value || value === 'Round Corners 1') {
+        return interfaceFunction.radius;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
+
+    Object.defineProperties(interfaceFunction, {
+      radius: {
+        get: ExpressionPropertyInterface(prop.rd),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  function repeaterInterfaceFactory(shape, view, propertyGroup) {
+    function interfaceFunction(value) {
+      if (shape.c.ix === value || value === 'Copies') {
+        return interfaceFunction.copies;
+      } if (shape.o.ix === value || value === 'Offset') {
+        return interfaceFunction.offset;
+      }
+      return null;
+    }
+
+    var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
+    var prop = view;
+    interfaceFunction.propertyIndex = shape.ix;
+    prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
+    prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
+    Object.defineProperties(interfaceFunction, {
+      copies: {
+        get: ExpressionPropertyInterface(prop.c),
+      },
+      offset: {
+        get: ExpressionPropertyInterface(prop.o),
+      },
+      _name: { value: shape.nm },
+    });
+    interfaceFunction.mn = shape.mn;
+    return interfaceFunction;
+  }
+
+  return function (shapes, view, propertyGroup) {
+    var interfaces;
+    function _interfaceFunction(value) {
+      if (typeof value === 'number') {
+        value = value === undefined ? 1 : value;
+        if (value === 0) {
+          return propertyGroup;
+        }
+        return interfaces[value - 1];
+      }
+      var i = 0;
+      var len = interfaces.length;
+      while (i < len) {
+        if (interfaces[i]._name === value) {
+          return interfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    }
+    function parentGroupWrapper() {
+      return propertyGroup;
+    }
+    _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
+    interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
+    _interfaceFunction.numProperties = interfaces.length;
+    _interfaceFunction._name = 'Contents';
+    return _interfaceFunction;
+  };
 }());
 
+/* exported TextExpressionInterface */
+
+var TextExpressionInterface = (function () {
+  return function (elem) {
+    var _prevValue;
+    var _sourceText;
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Text Document':
+          return _thisLayerFunction.sourceText;
+        default:
+          return null;
+      }
+    }
+    Object.defineProperty(_thisLayerFunction, 'sourceText', {
+      get: function () {
+        elem.textProperty.getValue();
+        var stringValue = elem.textProperty.currentData.t;
+        if (stringValue !== _prevValue) {
+          elem.textProperty.currentData.t = _prevValue;
+          _sourceText = new String(stringValue); // eslint-disable-line no-new-wrappers
+          // If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
+          _sourceText.value = stringValue || new String(stringValue); // eslint-disable-line no-new-wrappers
+        }
+        return _sourceText;
+      },
+    });
+    return _thisLayerFunction;
+  };
+}());
+
+/* global Matrix, MaskManagerInterface, TransformExpressionInterface, getDescriptor */
+/* exported LayerExpressionInterface */
+
+var LayerExpressionInterface = (function () {
+  function getMatrix(time) {
+    var toWorldMat = new Matrix();
+    if (time !== undefined) {
+      var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
+      propMatrix.clone(toWorldMat);
+    } else {
+      var transformMat = this._elem.finalTransform.mProp;
+      transformMat.applyToMatrix(toWorldMat);
+    }
+    return toWorldMat;
+  }
+
+  function toWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function toWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.applyPoint(toWorldMat, arr);
+  }
+
+  function fromWorldVec(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    toWorldMat.props[12] = 0;
+    toWorldMat.props[13] = 0;
+    toWorldMat.props[14] = 0;
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function fromWorld(arr, time) {
+    var toWorldMat = this.getMatrix(time);
+    return this.invertPoint(toWorldMat, arr);
+  }
+
+  function applyPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.applyToPointArray(arr[0], arr[1], arr[2] || 0);
+  }
+
+  function invertPoint(matrix, arr) {
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
+      }
+    }
+    return matrix.inversePoint(arr);
+  }
+
+  function fromComp(arr) {
+    var toWorldMat = new Matrix();
+    toWorldMat.reset();
+    this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
+    if (this._elem.hierarchy && this._elem.hierarchy.length) {
+      var i;
+      var len = this._elem.hierarchy.length;
+      for (i = 0; i < len; i += 1) {
+        this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
+      }
+      return toWorldMat.inversePoint(arr);
+    }
+    return toWorldMat.inversePoint(arr);
+  }
+
+  function sampleImage() {
+    return [1, 1, 1, 1];
+  }
+
+  return function (elem) {
+    var transformInterface;
+
+    function _registerMaskInterface(maskManager) {
+      _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
+    }
+    function _registerEffectsInterface(effects) {
+      _thisLayerFunction.effect = effects;
+    }
+
+    function _thisLayerFunction(name) {
+      switch (name) {
+        case 'ADBE Root Vectors Group':
+        case 'Contents':
+        case 2:
+          return _thisLayerFunction.shapeInterface;
+        case 1:
+        case 6:
+        case 'Transform':
+        case 'transform':
+        case 'ADBE Transform Group':
+          return transformInterface;
+        case 4:
+        case 'ADBE Effect Parade':
+        case 'effects':
+        case 'Effects':
+          return _thisLayerFunction.effect;
+        case 'ADBE Text Properties':
+          return _thisLayerFunction.textInterface;
+        default:
+          return null;
+      }
+    }
+    _thisLayerFunction.getMatrix = getMatrix;
+    _thisLayerFunction.invertPoint = invertPoint;
+    _thisLayerFunction.applyPoint = applyPoint;
+    _thisLayerFunction.toWorld = toWorld;
+    _thisLayerFunction.toWorldVec = toWorldVec;
+    _thisLayerFunction.fromWorld = fromWorld;
+    _thisLayerFunction.fromWorldVec = fromWorldVec;
+    _thisLayerFunction.toComp = toWorld;
+    _thisLayerFunction.fromComp = fromComp;
+    _thisLayerFunction.sampleImage = sampleImage;
+    _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
+    _thisLayerFunction._elem = elem;
+    transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
+    var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
+    Object.defineProperties(_thisLayerFunction, {
+      hasParent: {
+        get: function () {
+          return elem.hierarchy.length;
+        },
+      },
+      parent: {
+        get: function () {
+          return elem.hierarchy[0].layerInterface;
+        },
+      },
+      rotation: getDescriptor(transformInterface, 'rotation'),
+      scale: getDescriptor(transformInterface, 'scale'),
+      position: getDescriptor(transformInterface, 'position'),
+      opacity: getDescriptor(transformInterface, 'opacity'),
+      anchorPoint: anchorPointDescriptor,
+      anchor_point: anchorPointDescriptor,
+      transform: {
+        get: function () {
+          return transformInterface;
+        },
+      },
+      active: {
+        get: function () {
+          return elem.isInRange;
+        },
+      },
+    });
+
+    _thisLayerFunction.startTime = elem.data.st;
+    _thisLayerFunction.index = elem.data.ind;
+    _thisLayerFunction.source = elem.data.refId;
+    _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
+    _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
+    _thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate;
+    _thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate;
+    _thisLayerFunction._name = elem.data.nm;
+
+    _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
+    _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
+    return _thisLayerFunction;
+  };
+}());
+
+/* exported CompExpressionInterface */
+
 var CompExpressionInterface = (function () {
-    return function(comp) {
-        function _thisLayerFunction(name) {
-            var i = 0, len = comp.layers.length;
-            while ( i < len) {
-                if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
-                    return comp.elements[i].layerInterface;
-                }
-                i += 1;
-            }
-            return null;
-            //return {active:false};
+  return function (comp) {
+    function _thisLayerFunction(name) {
+      var i = 0;
+      var len = comp.layers.length;
+      while (i < len) {
+        if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
+          return comp.elements[i].layerInterface;
         }
-        Object.defineProperty(_thisLayerFunction, "_name", { value: comp.data.nm });
-        _thisLayerFunction.layer = _thisLayerFunction;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
-        _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
-        _thisLayerFunction.pixelAspect = 1;
-        _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
-        _thisLayerFunction.displayStartTime = 0;
-        _thisLayerFunction.numLayers = comp.layers.length;
-        return _thisLayerFunction;
-    };
-}());
-var TransformExpressionInterface = (function (){
-    return function(transform){
-        function _thisFunction(name){
-            switch(name){
-                case "scale":
-                case "Scale":
-                case "ADBE Scale":
-                case 6:
-                    return _thisFunction.scale;
-                case "rotation":
-                case "Rotation":
-                case "ADBE Rotation":
-                case "ADBE Rotate Z":
-                case 10:
-                    return _thisFunction.rotation;
-                case "ADBE Rotate X":
-                    return _thisFunction.xRotation;
-                case "ADBE Rotate Y":
-                    return _thisFunction.yRotation;
-                case "position":
-                case "Position":
-                case "ADBE Position":
-                case 2:
-                    return _thisFunction.position;
-                case 'ADBE Position_0':
-                    return _thisFunction.xPosition;
-                case 'ADBE Position_1':
-                    return _thisFunction.yPosition;
-                case 'ADBE Position_2':
-                    return _thisFunction.zPosition;
-                case "anchorPoint":
-                case "AnchorPoint":
-                case "Anchor Point":
-                case "ADBE AnchorPoint":
-                case 1:
-                    return _thisFunction.anchorPoint;
-                case "opacity":
-                case "Opacity":
-                case 11:
-                    return _thisFunction.opacity;
-            }
-        }
-        Object.defineProperty(_thisFunction, "rotation", {
-            get: ExpressionPropertyInterface(transform.r || transform.rz)
-        });
-
-        Object.defineProperty(_thisFunction, "zRotation", {
-            get: ExpressionPropertyInterface(transform.rz || transform.r)
-        });
-
-        Object.defineProperty(_thisFunction, "xRotation", {
-            get: ExpressionPropertyInterface(transform.rx)
-        });
-
-        Object.defineProperty(_thisFunction, "yRotation", {
-            get: ExpressionPropertyInterface(transform.ry)
-        });
-        Object.defineProperty(_thisFunction, "scale", {
-            get: ExpressionPropertyInterface(transform.s)
-        });
-
-        if(transform.p) {
-            var _transformFactory = ExpressionPropertyInterface(transform.p);
-        } else {
-            var _px = ExpressionPropertyInterface(transform.px);
-            var _py = ExpressionPropertyInterface(transform.py);
-            var _pz;
-            if (transform.pz) {
-                _pz = ExpressionPropertyInterface(transform.pz);
-            }
-        }
-        Object.defineProperty(_thisFunction, "position", {
-            get: function () {
-                if(transform.p) {
-                    return _transformFactory();
-                } else {
-                    return [
-                        _px(),
-                        _py(),
-                        _pz ? _pz() : 0];
-                }
-            }
-        });
-
-        Object.defineProperty(_thisFunction, "xPosition", {
-            get: ExpressionPropertyInterface(transform.px)
-        });
-
-        Object.defineProperty(_thisFunction, "yPosition", {
-            get: ExpressionPropertyInterface(transform.py)
-        });
-
-        Object.defineProperty(_thisFunction, "zPosition", {
-            get: ExpressionPropertyInterface(transform.pz)
-        });
-
-        Object.defineProperty(_thisFunction, "anchorPoint", {
-            get: ExpressionPropertyInterface(transform.a)
-        });
-
-        Object.defineProperty(_thisFunction, "opacity", {
-            get: ExpressionPropertyInterface(transform.o)
-        });
-
-        Object.defineProperty(_thisFunction, "skew", {
-            get: ExpressionPropertyInterface(transform.sk)
-        });
-
-        Object.defineProperty(_thisFunction, "skewAxis", {
-            get: ExpressionPropertyInterface(transform.sa)
-        });
-
-        Object.defineProperty(_thisFunction, "orientation", {
-            get: ExpressionPropertyInterface(transform.or)
-        });
-
-        return _thisFunction;
-    };
-}());
-var ProjectInterface = (function (){
-
-    function registerComposition(comp){
-        this.compositions.push(comp);
+        i += 1;
+      }
+      return null;
+      // return {active:false};
     }
-
-    return function(){
-        function _thisProjectFunction(name){
-            var i = 0, len = this.compositions.length;
-            while(i<len){
-                if(this.compositions[i].data && this.compositions[i].data.nm === name){
-                    if(this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
-                        this.compositions[i].prepareFrame(this.currentFrame);
-                    }
-                    return this.compositions[i].compInterface;
-                }
-                i+=1;
-            }
-        }
-
-        _thisProjectFunction.compositions = [];
-        _thisProjectFunction.currentFrame = 0;
-
-        _thisProjectFunction.registerComposition = registerComposition;
-
-
-
-        return _thisProjectFunction;
-    };
+    Object.defineProperty(_thisLayerFunction, '_name', { value: comp.data.nm });
+    _thisLayerFunction.layer = _thisLayerFunction;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
+    _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
+    _thisLayerFunction.pixelAspect = 1;
+    _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
+    _thisLayerFunction.displayStartTime = 0;
+    _thisLayerFunction.numLayers = comp.layers.length;
+    return _thisLayerFunction;
+  };
 }());
-var EffectsExpressionInterface = (function (){
-    var ob = {
-        createEffectsInterface: createEffectsInterface
-    };
 
-    function createEffectsInterface(elem, propertyGroup){
-        if(elem.effectsManager){
+/* global ExpressionPropertyInterface */
+/* exported TransformExpressionInterface */
 
-            var effectElements = [];
-            var effectsData = elem.data.ef;
-            var i, len = elem.effectsManager.effectElements.length;
-            for(i=0;i<len;i+=1){
-                effectElements.push(createGroupInterface(effectsData[i],elem.effectsManager.effectElements[i],propertyGroup,elem));
-            }
-
-            var effects = elem.data.ef || [];
-            var groupInterface = function(name){
-                i = 0, len = effects.length;
-                while(i<len) {
-                    if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                        return effectElements[i];
-                    }
-                    i += 1;
-                }
-            };
-            Object.defineProperty(groupInterface, 'numProperties', {
-                get: function(){
-                    return effects.length;
-                }
-            });
-            return groupInterface
-        }
+var TransformExpressionInterface = (function () {
+  return function (transform) {
+    function _thisFunction(name) {
+      switch (name) {
+        case 'scale':
+        case 'Scale':
+        case 'ADBE Scale':
+        case 6:
+          return _thisFunction.scale;
+        case 'rotation':
+        case 'Rotation':
+        case 'ADBE Rotation':
+        case 'ADBE Rotate Z':
+        case 10:
+          return _thisFunction.rotation;
+        case 'ADBE Rotate X':
+          return _thisFunction.xRotation;
+        case 'ADBE Rotate Y':
+          return _thisFunction.yRotation;
+        case 'position':
+        case 'Position':
+        case 'ADBE Position':
+        case 2:
+          return _thisFunction.position;
+        case 'ADBE Position_0':
+          return _thisFunction.xPosition;
+        case 'ADBE Position_1':
+          return _thisFunction.yPosition;
+        case 'ADBE Position_2':
+          return _thisFunction.zPosition;
+        case 'anchorPoint':
+        case 'AnchorPoint':
+        case 'Anchor Point':
+        case 'ADBE AnchorPoint':
+        case 1:
+          return _thisFunction.anchorPoint;
+        case 'opacity':
+        case 'Opacity':
+        case 11:
+          return _thisFunction.opacity;
+        default:
+          return null;
+      }
     }
-
-    function createGroupInterface(data,elements, propertyGroup, elem){
-
-        function groupInterface(name){
-            var effects = data.ef, i = 0, len = effects.length;
-            while(i<len) {
-                if(name === effects[i].nm || name === effects[i].mn || name === effects[i].ix){
-                    if(effects[i].ty === 5){
-                        return effectElements[i];
-                    } else {
-                        return effectElements[i]();
-                    }
-                }
-                i += 1;
-            }
-            throw new Error();
-        };
-        var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
-
-        var effectElements = [];
-        var i, len = data.ef.length;
-        for(i=0;i<len;i+=1){
-            if(data.ef[i].ty === 5){
-                effectElements.push(createGroupInterface(data.ef[i],elements.effectElements[i],elements.effectElements[i].propertyGroup, elem));
-            } else {
-                effectElements.push(createValueInterface(elements.effectElements[i],data.ef[i].ty, elem, _propertyGroup));
-            }
-        }
-
-        if(data.mn === 'ADBE Color Control'){
-            Object.defineProperty(groupInterface, 'color', {
-                get: function(){
-                    return effectElements[0]();
-                }
-            });
-        }
-        Object.defineProperties(groupInterface, {
-            numProperties: {
-                get: function(){
-                    return data.np;
-                }
-            },
-            _name: { value: data.nm },
-            propertyGroup: {value: _propertyGroup},
-        });
-        groupInterface.active = groupInterface.enabled = data.en !== 0;
-        return groupInterface;
-    }
-
-    function createValueInterface(element, type, elem, propertyGroup){
-        var expressionProperty = ExpressionPropertyInterface(element.p);
-        function interfaceFunction(){
-            if(type === 10){
-                return elem.comp.compInterface(element.p.v);
-            }
-            return expressionProperty();
-        }
-
-        if(element.p.setGroupProperty) {
-            element.p.setGroupProperty(PropertyInterface('', propertyGroup));
-        }
-
-        return interfaceFunction;
-    }
-
-    return ob;
-
-}());
-var MaskManagerInterface = (function(){
-
-	function MaskInterface(mask, data){
-		this._mask = mask;
-		this._data = data;
-	}
-	Object.defineProperty(MaskInterface.prototype, 'maskPath', {
-        get: function(){
-            if(this._mask.prop.k){
-                this._mask.prop.getValue();
-            }
-            return this._mask.prop;
-        }
-    });
-	Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
-        get: function(){
-            if(this._mask.op.k){
-                this._mask.op.getValue();
-            }
-            return this._mask.op.v * 100;
-        }
+    Object.defineProperty(_thisFunction, 'rotation', {
+      get: ExpressionPropertyInterface(transform.r || transform.rz),
     });
 
-	var MaskManager = function(maskManager, elem){
-		var _maskManager = maskManager;
-		var _elem = elem;
-		var _masksInterfaces = createSizedArray(maskManager.viewData.length);
-		var i, len = maskManager.viewData.length;
-		for(i = 0; i < len; i += 1) {
-			_masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
-		}
+    Object.defineProperty(_thisFunction, 'zRotation', {
+      get: ExpressionPropertyInterface(transform.rz || transform.r),
+    });
 
-		var maskFunction = function(name){
-			i = 0;
-		    while(i<len){
-		        if(maskManager.masksProperties[i].nm === name){
-		            return _masksInterfaces[i];
-		        }
-		        i += 1;
-		    }
-		};
-		return maskFunction;
-	};
-	return MaskManager;
+    Object.defineProperty(_thisFunction, 'xRotation', {
+      get: ExpressionPropertyInterface(transform.rx),
+    });
+
+    Object.defineProperty(_thisFunction, 'yRotation', {
+      get: ExpressionPropertyInterface(transform.ry),
+    });
+    Object.defineProperty(_thisFunction, 'scale', {
+      get: ExpressionPropertyInterface(transform.s),
+    });
+    var _px;
+    var _py;
+    var _pz;
+    var _transformFactory;
+    if (transform.p) {
+      _transformFactory = ExpressionPropertyInterface(transform.p);
+    } else {
+      _px = ExpressionPropertyInterface(transform.px);
+      _py = ExpressionPropertyInterface(transform.py);
+      if (transform.pz) {
+        _pz = ExpressionPropertyInterface(transform.pz);
+      }
+    }
+    Object.defineProperty(_thisFunction, 'position', {
+      get: function () {
+        if (transform.p) {
+          return _transformFactory();
+        }
+        return [
+          _px(),
+          _py(),
+          _pz ? _pz() : 0];
+      },
+    });
+
+    Object.defineProperty(_thisFunction, 'xPosition', {
+      get: ExpressionPropertyInterface(transform.px),
+    });
+
+    Object.defineProperty(_thisFunction, 'yPosition', {
+      get: ExpressionPropertyInterface(transform.py),
+    });
+
+    Object.defineProperty(_thisFunction, 'zPosition', {
+      get: ExpressionPropertyInterface(transform.pz),
+    });
+
+    Object.defineProperty(_thisFunction, 'anchorPoint', {
+      get: ExpressionPropertyInterface(transform.a),
+    });
+
+    Object.defineProperty(_thisFunction, 'opacity', {
+      get: ExpressionPropertyInterface(transform.o),
+    });
+
+    Object.defineProperty(_thisFunction, 'skew', {
+      get: ExpressionPropertyInterface(transform.sk),
+    });
+
+    Object.defineProperty(_thisFunction, 'skewAxis', {
+      get: ExpressionPropertyInterface(transform.sa),
+    });
+
+    Object.defineProperty(_thisFunction, 'orientation', {
+      get: ExpressionPropertyInterface(transform.or),
+    });
+
+    return _thisFunction;
+  };
 }());
 
-var ExpressionPropertyInterface = (function() {
+/* exported ProjectInterface */
 
-    var defaultUnidimensionalValue = {pv:0, v:0, mult: 1}
-    var defaultMultidimensionalValue = {pv:[0,0,0], v:[0,0,0], mult: 1}
+var ProjectInterface = (function () {
+  function registerComposition(comp) {
+    this.compositions.push(comp);
+  }
 
-    function completeProperty(expressionValue, property, type) {
-        Object.defineProperty(expressionValue, 'velocity', {
-            get: function(){
-                return property.getVelocityAtTime(property.comp.currentFrame);
-            }
-        });
-        expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
-        expressionValue.key = function(pos) {
-            if (!expressionValue.numKeys) {
-                return 0;
-            } else {
-                var value = '';
-                if ('s' in property.keyframes[pos-1]) {
-                    value = property.keyframes[pos-1].s;
-                } else if ('e' in property.keyframes[pos-2]) {
-                    value = property.keyframes[pos-2].e;
-                } else {
-                    value = property.keyframes[pos-2].s;
-                }
-                var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value);
-                valueProp.time = property.keyframes[pos-1].t / property.elem.comp.globalData.frameRate;
-                valueProp.value = type === 'unidimensional' ? value[0] : value;
-                return valueProp;
-            }
-        };
-        expressionValue.valueAtTime = property.getValueAtTime;
-        expressionValue.speedAtTime = property.getSpeedAtTime;
-        expressionValue.velocityAtTime = property.getVelocityAtTime;
-        expressionValue.propertyGroup = property.propertyGroup;
+  return function () {
+    function _thisProjectFunction(name) {
+      var i = 0;
+      var len = this.compositions.length;
+      while (i < len) {
+        if (this.compositions[i].data && this.compositions[i].data.nm === name) {
+          if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
+            this.compositions[i].prepareFrame(this.currentFrame);
+          }
+          return this.compositions[i].compInterface;
+        }
+        i += 1;
+      }
+      return null;
     }
 
-    function UnidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultUnidimensionalValue;
+    _thisProjectFunction.compositions = [];
+    _thisProjectFunction.currentFrame = 0;
+
+    _thisProjectFunction.registerComposition = registerComposition;
+
+    return _thisProjectFunction;
+  };
+}());
+
+/* global propertyGroupFactory, ExpressionPropertyInterface, PropertyInterface */
+/* exported EffectsExpressionInterface */
+
+var EffectsExpressionInterface = (function () {
+  var ob = {
+    createEffectsInterface: createEffectsInterface,
+  };
+
+  function createEffectsInterface(elem, propertyGroup) {
+    if (elem.effectsManager) {
+      var effectElements = [];
+      var effectsData = elem.data.ef;
+      var i;
+      var len = elem.effectsManager.effectElements.length;
+      for (i = 0; i < len; i += 1) {
+        effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem));
+      }
+
+      var effects = elem.data.ef || [];
+      var groupInterface = function (name) {
+        i = 0;
+        len = effects.length;
+        while (i < len) {
+          if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+            return effectElements[i];
+          }
+          i += 1;
         }
-        var mult = 1 / property.mult;
-        var val = property.pv * mult;
-        var expressionValue = new Number(val);
+        return null;
+      };
+      Object.defineProperty(groupInterface, 'numProperties', {
+        get: function () {
+          return effects.length;
+        },
+      });
+      return groupInterface;
+    }
+    return null;
+  }
+
+  function createGroupInterface(data, elements, propertyGroup, elem) {
+    function groupInterface(name) {
+      var effects = data.ef;
+      var i = 0;
+      var len = effects.length;
+      while (i < len) {
+        if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
+          if (effects[i].ty === 5) {
+            return effectElements[i];
+          }
+          return effectElements[i]();
+        }
+        i += 1;
+      }
+      throw new Error();
+    }
+    var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
+
+    var effectElements = [];
+    var i;
+    var len = data.ef.length;
+    for (i = 0; i < len; i += 1) {
+      if (data.ef[i].ty === 5) {
+        effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem));
+      } else {
+        effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup));
+      }
+    }
+
+    if (data.mn === 'ADBE Color Control') {
+      Object.defineProperty(groupInterface, 'color', {
+        get: function () {
+          return effectElements[0]();
+        },
+      });
+    }
+    Object.defineProperties(groupInterface, {
+      numProperties: {
+        get: function () {
+          return data.np;
+        },
+      },
+      _name: { value: data.nm },
+      propertyGroup: { value: _propertyGroup },
+    });
+    groupInterface.enabled = data.en !== 0;
+    groupInterface.active = groupInterface.enabled;
+    return groupInterface;
+  }
+
+  function createValueInterface(element, type, elem, propertyGroup) {
+    var expressionProperty = ExpressionPropertyInterface(element.p);
+    function interfaceFunction() {
+      if (type === 10) {
+        return elem.comp.compInterface(element.p.v);
+      }
+      return expressionProperty();
+    }
+
+    if (element.p.setGroupProperty) {
+      element.p.setGroupProperty(PropertyInterface('', propertyGroup));
+    }
+
+    return interfaceFunction;
+  }
+
+  return ob;
+}());
+
+/* global createSizedArray */
+/* exported MaskManagerInterface */
+
+var MaskManagerInterface = (function () {
+  function MaskInterface(mask, data) {
+    this._mask = mask;
+    this._data = data;
+  }
+  Object.defineProperty(MaskInterface.prototype, 'maskPath', {
+    get: function () {
+      if (this._mask.prop.k) {
+        this._mask.prop.getValue();
+      }
+      return this._mask.prop;
+    },
+  });
+  Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
+    get: function () {
+      if (this._mask.op.k) {
+        this._mask.op.getValue();
+      }
+      return this._mask.op.v * 100;
+    },
+  });
+
+  var MaskManager = function (maskManager) {
+    var _masksInterfaces = createSizedArray(maskManager.viewData.length);
+    var i;
+    var len = maskManager.viewData.length;
+    for (i = 0; i < len; i += 1) {
+      _masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
+    }
+
+    var maskFunction = function (name) {
+      i = 0;
+      while (i < len) {
+        if (maskManager.masksProperties[i].nm === name) {
+          return _masksInterfaces[i];
+        }
+        i += 1;
+      }
+      return null;
+    };
+    return maskFunction;
+  };
+  return MaskManager;
+}());
+
+/* global createTypedArray */
+/* exported ExpressionPropertyInterface */
+
+var ExpressionPropertyInterface = (function () {
+  var defaultUnidimensionalValue = { pv: 0, v: 0, mult: 1 };
+  var defaultMultidimensionalValue = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 };
+
+  function completeProperty(expressionValue, property, type) {
+    Object.defineProperty(expressionValue, 'velocity', {
+      get: function () {
+        return property.getVelocityAtTime(property.comp.currentFrame);
+      },
+    });
+    expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
+    expressionValue.key = function (pos) {
+      if (!expressionValue.numKeys) {
+        return 0;
+      }
+      var value = '';
+      if ('s' in property.keyframes[pos - 1]) {
+        value = property.keyframes[pos - 1].s;
+      } else if ('e' in property.keyframes[pos - 2]) {
+        value = property.keyframes[pos - 2].e;
+      } else {
+        value = property.keyframes[pos - 2].s;
+      }
+      var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value); // eslint-disable-line no-new-wrappers
+      valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate;
+      valueProp.value = type === 'unidimensional' ? value[0] : value;
+      return valueProp;
+    };
+    expressionValue.valueAtTime = property.getValueAtTime;
+    expressionValue.speedAtTime = property.getSpeedAtTime;
+    expressionValue.velocityAtTime = property.getVelocityAtTime;
+    expressionValue.propertyGroup = property.propertyGroup;
+  }
+
+  function UnidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultUnidimensionalValue;
+    }
+    var mult = 1 / property.mult;
+    var val = property.pv * mult;
+    var expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
+    expressionValue.value = val;
+    completeProperty(expressionValue, property, 'unidimensional');
+
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      val = property.v * mult;
+      if (expressionValue.value !== val) {
+        expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
         expressionValue.value = val;
         completeProperty(expressionValue, property, 'unidimensional');
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            val = property.v * mult;
-            if(expressionValue.value !== val) {
-                expressionValue = new Number(val);
-                expressionValue.value = val;
-                completeProperty(expressionValue, property, 'unidimensional');
-            }
-            return expressionValue;
-        }
+  function MultidimensionalPropertyInterface(property) {
+    if (!property || !('pv' in property)) {
+      property = defaultMultidimensionalValue;
     }
+    var mult = 1 / property.mult;
+    var len = (property.data && property.data.l) || property.pv.length;
+    var expressionValue = createTypedArray('float32', len);
+    var arrValue = createTypedArray('float32', len);
+    expressionValue.value = arrValue;
+    completeProperty(expressionValue, property, 'multidimensional');
 
-    function MultidimensionalPropertyInterface(property) {
-        if(!property || !('pv' in property)) {
-            property = defaultMultidimensionalValue;
-        }
-        var mult = 1 / property.mult;
-        var len = (property.data && property.data.l) || property.pv.length;
-        var expressionValue = createTypedArray('float32', len);
-        var arrValue = createTypedArray('float32', len);
-        expressionValue.value = arrValue;
-        completeProperty(expressionValue, property, 'multidimensional');
+    return function () {
+      if (property.k) {
+        property.getValue();
+      }
+      for (var i = 0; i < len; i += 1) {
+        arrValue[i] = property.v[i] * mult;
+        expressionValue[i] = arrValue[i];
+      }
+      return expressionValue;
+    };
+  }
 
-        return function() {
-            if (property.k) {
-                property.getValue();
-            }
-            for (var i = 0; i < len; i += 1) {
-                expressionValue[i] = arrValue[i] = property.v[i] * mult;
-            }
-            return expressionValue;
-        }
-    }
+  // TODO: try to avoid using this getter
+  function defaultGetter() {
+    return defaultUnidimensionalValue;
+  }
 
-    //TODO: try to avoid using this getter
-    function defaultGetter() {
-        return defaultUnidimensionalValue;
+  return function (property) {
+    if (!property) {
+      return defaultGetter;
+    } if (property.propType === 'unidimensional') {
+      return UnidimensionalPropertyInterface(property);
     }
-    
-    return function(property) {
-        if(!property) {
-            return defaultGetter;
-        } else if (property.propType === 'unidimensional') {
-            return UnidimensionalPropertyInterface(property);
-        } else {
-            return MultidimensionalPropertyInterface(property);
-        }
-    }
+    return MultidimensionalPropertyInterface(property);
+  };
 }());
 
-(function(){
+/* global expressionHelpers, TextSelectorProp, ExpressionManager */
+/* exported TextExpressionSelectorProp */
 
-    var TextExpressionSelectorProp = (function(){
-
-        function getValueProxy(index,total){
-            this.textIndex = index+1;
-            this.textTotal = total;
-            this.v = this.getValue() * this.mult;
-            return this.v;
-        }
-
-        return function TextExpressionSelectorProp(elem,data){
-            this.pv = 1;
-            this.comp = elem.comp;
-            this.elem = elem;
-            this.mult = 0.01;
-            this.propType = 'textSelector';
-            this.textTotal = data.totalChars;
-            this.selectorValue = 100;
-            this.lastValue = [1,1,1];
-            this.k = true;
-            this.x = true;
-            this.getValue = ExpressionManager.initiateExpression.bind(this)(elem,data,this);
-            this.getMult = getValueProxy;
-            this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
-            if(this.kf){
-                this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
-            } else {
-                this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
-            }
-            this.setGroupProperty = expressionHelpers.setGroupProperty;
-        };
-    }());
-
-	var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
-	TextSelectorProp.getTextSelectorProp = function(elem, data,arr){
-	    if(data.t === 1){
-	        return new TextExpressionSelectorProp(elem, data,arr);
-	    } else {
-	        return propertyGetTextProp(elem,data,arr);
-	    }
-	};
-}());
-function SliderEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function AngleEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function ColorEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function PointEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,1,0,container);
-}
-function LayerIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function MaskIndexEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function CheckboxEffect(data,elem, container){
-    this.p = PropertyFactory.getProp(elem,data.v,0,0,container);
-}
-function NoValueEffect(){
-    this.p = {};
-}
-function EffectsManager(data,element){
-    var effects = data.ef || [];
-    this.effectElements = [];
-    var i,len = effects.length;
-    var effectItem;
-    for(i=0;i<len;i++) {
-        effectItem = new GroupEffect(effects[i],element);
-        this.effectElements.push(effectItem);
+(function () {
+  var TextExpressionSelectorProp = (function () { // eslint-disable-line no-unused-vars
+    function getValueProxy(index, total) {
+      this.textIndex = index + 1;
+      this.textTotal = total;
+      this.v = this.getValue() * this.mult;
+      return this.v;
     }
+
+    return function TextExpressionSelectorPropFactory(elem, data) {
+      this.pv = 1;
+      this.comp = elem.comp;
+      this.elem = elem;
+      this.mult = 0.01;
+      this.propType = 'textSelector';
+      this.textTotal = data.totalChars;
+      this.selectorValue = 100;
+      this.lastValue = [1, 1, 1];
+      this.k = true;
+      this.x = true;
+      this.getValue = ExpressionManager.initiateExpression.bind(this)(elem, data, this);
+      this.getMult = getValueProxy;
+      this.getVelocityAtTime = expressionHelpers.getVelocityAtTime;
+      if (this.kf) {
+        this.getValueAtTime = expressionHelpers.getValueAtTime.bind(this);
+      } else {
+        this.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(this);
+      }
+      this.setGroupProperty = expressionHelpers.setGroupProperty;
+    };
+  }());
+
+  var propertyGetTextProp = TextSelectorProp.getTextSelectorProp;
+  TextSelectorProp.getTextSelectorProp = function (elem, data, arr) {
+    if (data.t === 1) {
+      return new TextExpressionSelectorPropFactory(elem, data, arr); // eslint-disable-line no-undef
+    }
+    return propertyGetTextProp(elem, data, arr);
+  };
+}());
+
+/* global PropertyFactory */
+/* exported SliderEffect, AngleEffect, ColorEffect, PointEffect, LayerIndexEffect, MaskIndexEffect, CheckboxEffect, NoValueEffect */
+
+function SliderEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function AngleEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function ColorEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function PointEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
+}
+function LayerIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function MaskIndexEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function CheckboxEffect(data, elem, container) {
+  this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
+}
+function NoValueEffect() {
+  this.p = {};
 }
 
-function GroupEffect(data,element){
-    this.init(data,element);
+/* global extendPrototype, SliderEffect, AngleEffect, ColorEffect, PointEffect, CheckboxEffect, LayerIndexEffect,
+MaskIndexEffect, NoValueEffect, DynamicPropertyContainer */
+
+function EffectsManager(data, element) {
+  var effects = data.ef || [];
+  this.effectElements = [];
+  var i;
+  var len = effects.length;
+  var effectItem;
+  for (i = 0; i < len; i += 1) {
+    effectItem = new GroupEffect(effects[i], element);
+    this.effectElements.push(effectItem);
+  }
+}
+
+function GroupEffect(data, element) {
+  this.init(data, element);
 }
 
 extendPrototype([DynamicPropertyContainer], GroupEffect);
 
 GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
 
-GroupEffect.prototype.init = function(data,element){
-    this.data = data;
-    this.effectElements = [];
-    this.initDynamicPropertyContainer(element);
-    var i, len = this.data.ef.length;
-    var eff, effects = this.data.ef;
-    for(i=0;i<len;i+=1){
-        eff = null;
-        switch(effects[i].ty){
-            case 0:
-                eff = new SliderEffect(effects[i],element,this);
-                break;
-            case 1:
-                eff = new AngleEffect(effects[i],element,this);
-                break;
-            case 2:
-                eff = new ColorEffect(effects[i],element,this);
-                break;
-            case 3:
-                eff = new PointEffect(effects[i],element,this);
-                break;
-            case 4:
-            case 7:
-                eff = new CheckboxEffect(effects[i],element,this);
-                break;
-            case 10:
-                eff = new LayerIndexEffect(effects[i],element,this);
-                break;
-            case 11:
-                eff = new MaskIndexEffect(effects[i],element,this);
-                break;
-            case 5:
-                eff = new EffectsManager(effects[i],element,this);
-                break;
-            //case 6:
-            default:
-                eff = new NoValueEffect(effects[i],element,this);
-                break;
-        }
-        if(eff) {
-            this.effectElements.push(eff);
-        }
+GroupEffect.prototype.init = function (data, element) {
+  this.data = data;
+  this.effectElements = [];
+  this.initDynamicPropertyContainer(element);
+  var i;
+  var len = this.data.ef.length;
+  var eff;
+  var effects = this.data.ef;
+  for (i = 0; i < len; i += 1) {
+    eff = null;
+    switch (effects[i].ty) {
+      case 0:
+        eff = new SliderEffect(effects[i], element, this);
+        break;
+      case 1:
+        eff = new AngleEffect(effects[i], element, this);
+        break;
+      case 2:
+        eff = new ColorEffect(effects[i], element, this);
+        break;
+      case 3:
+        eff = new PointEffect(effects[i], element, this);
+        break;
+      case 4:
+      case 7:
+        eff = new CheckboxEffect(effects[i], element, this);
+        break;
+      case 10:
+        eff = new LayerIndexEffect(effects[i], element, this);
+        break;
+      case 11:
+        eff = new MaskIndexEffect(effects[i], element, this);
+        break;
+      case 5:
+        eff = new EffectsManager(effects[i], element, this);
+        break;
+        // case 6:
+      default:
+        eff = new NoValueEffect(effects[i], element, this);
+        break;
     }
+    if (eff) {
+      this.effectElements.push(eff);
+    }
+  }
 };
 
+
 var lottie = {};
 
-var _isFrozen = false;
-
-function setLocationHref (href) {
-    locationHref = href;
+function setLocationHref(href) {
+  locationHref = href;
 }
 
 function searchAnimations() {
-    if (standalone === true) {
-        animationManager.searchAnimations(animationData, standalone, renderer);
-    } else {
-        animationManager.searchAnimations();
-    }
+  if (standalone === true) {
+    animationManager.searchAnimations(animationData, standalone, renderer);
+  } else {
+    animationManager.searchAnimations();
+  }
 }
 
 function setSubframeRendering(flag) {
-    subframeEnabled = flag;
+  subframeEnabled = flag;
 }
 
 function loadAnimation(params) {
-    if (standalone === true) {
-        params.animationData = JSON.parse(animationData);
-    }
-    return animationManager.loadAnimation(params);
+  if (standalone === true) {
+    params.animationData = JSON.parse(animationData);
+  }
+  return animationManager.loadAnimation(params);
 }
 
 function setQuality(value) {
-    if (typeof value === 'string') {
-        switch (value) {
-            case 'high':
-                defaultCurveSegments = 200;
-                break;
-            case 'medium':
-                defaultCurveSegments = 50;
-                break;
-            case 'low':
-                defaultCurveSegments = 10;
-                break;
-        }
-    } else if (!isNaN(value) && value > 1) {
-        defaultCurveSegments = value;
+  if (typeof value === 'string') {
+    switch (value) {
+      case 'high':
+        defaultCurveSegments = 200;
+        break;
+      default:
+      case 'medium':
+        defaultCurveSegments = 50;
+        break;
+      case 'low':
+        defaultCurveSegments = 10;
+        break;
     }
-    if (defaultCurveSegments >= 50) {
-        roundValues(false);
-    } else {
-        roundValues(true);
-    }
+  } else if (!isNaN(value) && value > 1) {
+    defaultCurveSegments = value;
+  }
+  if (defaultCurveSegments >= 50) {
+    roundValues(false);
+  } else {
+    roundValues(true);
+  }
 }
 
 function inBrowser() {
-    return typeof navigator !== 'undefined';
+  return typeof navigator !== 'undefined';
 }
 
 function installPlugin(type, plugin) {
-    if (type === 'expressions') {
-        expressionsPlugin = plugin;
-    }
+  if (type === 'expressions') {
+    expressionsPlugin = plugin;
+  }
 }
 
 function getFactory(name) {
-    switch (name) {
-        case "propertyFactory":
-            return PropertyFactory;
-        case "shapePropertyFactory":
-            return ShapePropertyFactory;
-        case "matrix":
-            return Matrix;
-    }
+  switch (name) {
+    case 'propertyFactory':
+      return PropertyFactory;
+    case 'shapePropertyFactory':
+      return ShapePropertyFactory;
+    case 'matrix':
+      return Matrix;
+    default:
+      return null;
+  }
 }
 
 lottie.play = animationManager.play;
@@ -12637,7 +13368,7 @@
 lottie.loadAnimation = loadAnimation;
 lottie.setSubframeRendering = setSubframeRendering;
 lottie.resize = animationManager.resize;
-//lottie.start = start;
+// lottie.start = start;
 lottie.goToAndStop = animationManager.goToAndStop;
 lottie.destroy = animationManager.destroy;
 lottie.setQuality = setQuality;
@@ -12650,35 +13381,37 @@
 lottie.unmute = animationManager.unmute;
 lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
 lottie.__getFactory = getFactory;
-lottie.version = '5.7.5';
+lottie.version = '5.7.6';
 
 function checkReady() {
-    if (document.readyState === "complete") {
-        clearInterval(readyStateCheckInterval);
-        searchAnimations();
-    }
+  if (document.readyState === 'complete') {
+    clearInterval(readyStateCheckInterval);
+    searchAnimations();
+  }
 }
 
 function getQueryVariable(variable) {
-    var vars = queryString.split('&');
-    for (var i = 0; i < vars.length; i++) {
-        var pair = vars[i].split('=');
-        if (decodeURIComponent(pair[0]) == variable) {
-            return decodeURIComponent(pair[1]);
-        }
+  var vars = queryString.split('&');
+  for (var i = 0; i < vars.length; i += 1) {
+    var pair = vars[i].split('=');
+    if (decodeURIComponent(pair[0]) == variable) { // eslint-disable-line eqeqeq
+      return decodeURIComponent(pair[1]);
     }
+  }
+  return null;
 }
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
+var queryString;
 if (standalone) {
-    var scripts = document.getElementsByTagName('script');
-    var index = scripts.length - 1;
-    var myScript = scripts[index] || {
-        src: ''
-    };
-    var queryString = myScript.src.replace(/^[^\?]+\??/, '');
-    renderer = getQueryVariable('renderer');
+  var scripts = document.getElementsByTagName('script');
+  var index = scripts.length - 1;
+  var myScript = scripts[index] || {
+    src: '',
+  };
+  queryString = myScript.src.replace(/^[^\?]+\??/, ''); // eslint-disable-line no-useless-escape
+  renderer = getQueryVariable('renderer');
 }
 var readyStateCheckInterval = setInterval(checkReady, 100);
 
diff --git a/build/player/lottie_svg.min.js b/build/player/lottie_svg.min.js
index 5dcc4ca..43987ce 100644
--- a/build/player/lottie_svg.min.js
+++ b/build/player/lottie_svg.min.js
@@ -10,6 +10,6 @@
         root.bodymovin = root.lottie;
     }
 }((window || {}), function(window) {
-	"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin=t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility=t.style.webkitBackfaceVisibility="visible",t.style.transformStyle=t.style.webkitTransformStyle=t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e,this.currentTime=currentTime}roundValues(!1);var createElementID=(G=0,function(){return"__lottie_element_"+ ++G}),G;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,p,l;switch(h=r*(1-e),p=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),l=r*(1-(1-o)*e),n%6){case 0:i=r,s=l,a=h;break;case 1:i=p,s=r,a=h;break;case 2:i=h,s=r,a=l;break;case 3:i=h,s=p,a=r;break;case 4:i=l,s=h,a=r;break;case 5:i=r,s=h,a=p}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1==e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i++)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray="function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):void 0}:function(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s};function createSizedArray(t){return Array.apply(null,{length:t})}function createNS(t){return document.createElementNS(svgNS,t)}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Pa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Pa[t]||""}),Pa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function p(t,e){return this._t(1,e,t,1,0,0)}function l(t,e){return this.shear(n(t),n(e))}function f(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function m(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,p,l,f,m,c,u,d){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=p,this.props[10]=l,this.props[11]=f,this.props[12]=m,this.props[13]=c,this.props[14]=u,this.props[15]=d,this}function u(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function d(t,e,r,i,s,a,n,o,h,p,l,f,m,c,u,d){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===p&&1===l&&0===f)return y[12]=y[12]*t+y[15]*m,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*l+y[15]*u,y[15]=y[15]*d,this._identityCalculated=!1,this;var g=y[0],v=y[1],b=y[2],P=y[3],_=y[4],A=y[5],S=y[6],x=y[7],E=y[8],k=y[9],T=y[10],M=y[11],I=y[12],F=y[13],C=y[14],D=y[15];return y[0]=g*t+v*s+b*h+P*m,y[1]=g*e+v*a+b*p+P*c,y[2]=g*r+v*n+b*l+P*u,y[3]=g*i+v*o+b*f+P*d,y[4]=_*t+A*s+S*h+x*m,y[5]=_*e+A*a+S*p+x*c,y[6]=_*r+A*n+S*l+x*u,y[7]=_*i+A*o+S*f+x*d,y[8]=E*t+k*s+T*h+M*m,y[9]=E*e+k*a+T*p+M*c,y[10]=E*r+k*n+T*l+M*u,y[11]=E*i+k*o+T*f+M*d,y[12]=I*t+F*s+C*h+D*m,y[13]=I*e+F*a+C*p+D*c,y[14]=I*r+F*n+C*l+D*u,y[15]=I*i+F*o+C*f+D*d,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function b(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function P(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function _(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function A(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function S(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function x(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function E(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function k(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=E(t[e]);return i}function T(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],p=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+p,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+p,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+p}return i}function M(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function I(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function F(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function C(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function D(){var t=this.props;return"matrix("+C(t[0])+","+C(t[1])+","+C(t[4])+","+C(t[5])+","+C(t[12])+","+C(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=l,this.skewFromAxis=f,this.shear=p,this.scale=m,this.setTransform=c,this.translate=u,this.transform=d,this.applyToPoint=P,this.applyToX=_,this.applyToY=A,this.applyToZ=S,this.applyToPointArray=M,this.applyToTriplePoints=T,this.applyToPointStringified=I,this.toCSS=F,this.to2dCSS=D,this.clone=v,this.cloneFromProps=b,this.equals=g,this.inversePoints=k,this.inversePoint=E,this.getInverseMatrix=x,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var p,l=this,f=256,m=6,c="random",u=h.pow(f,m),d=h.pow(2,52),y=2*d,g=f-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<f;)a[i]=i++;for(i=0;i<f;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*f+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function P(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return _(e)}function _(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=P(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,_(o)]:null===t?function(){try{if(p)return _(p.randomBytes(f));var t=new Uint8Array(f);return(l.crypto||l.msCrypto).getRandomValues(t),_(t)}catch(t){var e=l.navigator,r=e&&e.plugins;return[+new Date,l,r,l.screen,_(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(m),e=u,r=0;t<d;)t=(t+r)*f,e*=f,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,P(_(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&b(i,a),t.state=function(){return b(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},P(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var p=11,l=1/(p-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function f(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function m(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(p):new Array(p),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:f(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<p;++r)this._mSampleValues[r]=f(r*l,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=p-1;a!==n&&i[a]<=t;++a)s+=l;var o=s+(t-i[--a])/(i[a+1]-i[a])*l,h=m(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=m(e,r,i);if(0===a)return e;e-=(f(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=f(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+l,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)i.hasOwnProperty(a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var l=function(t,e,r,i){var s,a,n,o,h,p,l=defaultCurveSegments,f=0,m=[],c=[],u=bezier_length_pool.newElement();for(n=r.length,s=0;s<l;s+=1){for(h=s/(l-1),a=p=0;a<n;a+=1)o=bm_pow(1-h,3)*t[a]+3*bm_pow(1-h,2)*h*r[a]+3*(1-h)*bm_pow(h,2)*i[a]+bm_pow(h,3)*e[a],m[a]=o,null!==c[a]&&(p+=bm_pow(m[a]-c[a],2)),c[a]=m[a];p&&(f+=p=bm_sqrt(p)),u.percents[s]=h,u.lengths[s]=f}return u.addedLength=f,u};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var b,t=(b={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!b[s]){var a,n,o,h,p,l,f,m=defaultCurveSegments,c=0,u=null;2===t.length&&(t[0]!=e[0]||t[1]!=e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var d=new g(m);for(o=r.length,a=0;a<m;a+=1){for(f=createSizedArray(o),p=a/(m-1),n=l=0;n<o;n+=1)h=bm_pow(1-p,3)*t[n]+3*bm_pow(1-p,2)*p*(t[n]+r[n])+3*(1-p)*bm_pow(p,2)*(e[n]+i[n])+bm_pow(p,3)*e[n],f[n]=h,null!==u&&(l+=bm_pow(f[n]-u[n],2));c+=l=bm_sqrt(l),d.points[a]=new v(l,f),u=f}d.segmentLength=c,b[s]=d}return b[s]});function I(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bm_floor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,p=!0;p;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),p=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];p=!1}return r[a]+(r[a+1]-r[a])*o}var F=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segments_length_pool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,p=0;for(e=0;e<o-1;e+=1)h[e]=l(s[e],s[e+1],a[e],n[e+1]),p+=h[e].addedLength;return i&&o&&(h[e]=l(s[e],s[0],a[e],n[0]),p+=h[e].addedLength),r.totalLength=p,r},getNewSegment:function(t,e,r,i,s,a,n){var o,h=I(s=s<0?0:1<s?1:s,n),p=I(a=1<a?1:a,n),l=t.length,f=1-h,m=1-p,c=f*f*f,u=h*f*f*3,d=h*h*f*3,y=h*h*h,g=f*f*m,v=h*f*m+f*h*m+f*f*p,b=h*h*m+f*h*p+h*f*p,P=h*h*p,_=f*m*m,A=h*m*m+f*p*m+f*m*p,S=h*p*m+f*p*p+h*m*p,x=h*p*p,E=m*m*m,k=p*m*m+m*p*m+m*m*p,T=p*p*m+m*p*p+p*m*p,M=p*p*p;for(o=0;o<l;o+=1)F[4*o]=Math.round(1e3*(c*t[o]+u*r[o]+d*i[o]+y*e[o]))/1e3,F[4*o+1]=Math.round(1e3*(g*t[o]+v*r[o]+b*i[o]+P*e[o]))/1e3,F[4*o+2]=Math.round(1e3*(_*t[o]+A*r[o]+S*i[o]+x*e[o]))/1e3,F[4*o+3]=Math.round(1e3*(E*t[o]+k*r[o]+T*i[o]+M*e[o]))/1e3;return F},getPointInSegment:function(t,e,r,i,s,a){var n=I(s,a),o=1-n;return[Math.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,Math.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var p,l=Math.sqrt(Math.pow(i-t,2)+Math.pow(s-e,2)+Math.pow(a-r,2)),f=Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)+Math.pow(h-r,2)),m=Math.sqrt(Math.pow(n-i,2)+Math.pow(o-s,2)+Math.pow(h-a,2));return-1e-4<(p=f<l?m<l?l-f-m:m-f-l:f<m?m-f-l:f-l-m)&&p<1e-4}}}!function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var r=(new Date).getTime(),i=Math.max(0,16-(r-a)),s=setTimeout(function(){t(r+i)},i);return a=r+i,s}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function f(t,e,r){var i,s,a,n,o,h,p=t.length;for(s=0;s<p;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),[],-1,i.hasMask){var l=i.masksProperties;for(n=l.length,a=0;a<n;a+=1)if(l[a].pt.k.i)u(l[a].pt.k);else for(h=l[a].pt.k.length,o=0;o<h;o+=1)l[a].pt.k[o].s&&u(l[a].pt.k[o].s[0]),l[a].pt.k[o].e&&u(l[a].pt.k[o].e[0])}0===i.ty?(i.layers=m(i.refId,e),f(i.layers,e,r)):4===i.ty?c(i.shapes):5==i.ty&&d(i,r)}}function m(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)u(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&u(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&u(t[e].ks.k[r].e[0]);!0}else"gr"==t[e].ty&&c(t[e].it)}function u(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&void 0))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(u(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function p(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"==t[e].ty){if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);!0}else"gr"==t[e].ty&&p(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&p(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function d(t,e){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),f(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=f,t}var dataManager=dataFunctionManager(),FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function d(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=function(t){var e,r=t.split(","),i=r.length,s=[];for(e=0;e<i;e+=1)"sans-serif"!==r[e]&&"monospace"!==r[e]&&s.push(r[e]);return s.join(",")}(t)+", "+e,{node:i,w:s,parent:r}}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){this.chars||(this.chars=[]);var e,r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i,s,a,n=t.list,o=n.length,h=o;for(r=0;r<o;r+=1){var p,l,f=!0;if(n[r].loaded=!1,n[r].monoCase=d(n[r].fFamily,"monospace"),n[r].sansCase=d(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){if(0<(p=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[r].fFamily+'"], style[f-origin="3"][f-family="'+n[r].fFamily+'"]')).length&&(f=!1),f){var m=createTag("style");m.setAttribute("f-forigin",n[r].fOrigin),m.setAttribute("f-origin",n[r].origin),m.setAttribute("f-family",n[r].fFamily),m.type="text/css",m.innerText="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",e.appendChild(m)}}else if("g"===n[r].fOrigin||1===n[r].origin){for(p=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),l=0;l<p.length;l++)-1!==p[l].href.indexOf(n[r].fPath)&&(f=!1);if(f){var c=createTag("link");c.setAttribute("f-forigin",n[r].fOrigin),c.setAttribute("f-origin",n[r].origin),c.type="text/css",c.rel="stylesheet",c.href=n[r].fPath,document.body.appendChild(c)}}else if("t"===n[r].fOrigin||2===n[r].origin){for(p=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),l=0;l<p.length;l++)n[r].fPath===p[l].src&&(f=!1);if(f){var u=createTag("link");u.setAttribute("f-forigin",n[r].fOrigin),u.setAttribute("f-origin",n[r].origin),u.setAttribute("rel","stylesheet"),u.setAttribute("href",n[r].fPath),e.appendChild(u)}}}else n[r].loaded=!0,h-=1;n[r].helper=(i=e,s=n[r],a=void 0,(a=createNS("text")).style.fontSize="100px",a.setAttribute("font-family",s.fFamily),a.setAttribute("font-style",s.fStyle),a.setAttribute("font-weight",s.fWeight),a.textContent="1",s.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",s.fClass)):a.style.fontFamily=s.fFamily,i.appendChild(a),createTag("canvas").getContext("2d").font=s.fWeight+" "+s.fStyle+" 100px "+s.fFamily,a),n[r].cache={},this.fonts.push(n[r])}0===h?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,r)),a},getFontByName:function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},checkLoadedFonts:function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),PropertyFactory=function(){var f=initialDefaultFrame,s=Math.abs;function m(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,p,l,f,m=e.lastIndex,c=m,u=this.keyframes.length-1,d=!0;d;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===u-1&&t>=a.t-i){s.h&&(s=a),m=0;break}if(a.t-i>t){m=c;break}c<u-1?c+=1:(m=0,d=!1)}var y,g,v,b,P,_,A,S,x,E,k=a.t-i,T=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var M=s.bezierData;if(k<=t||t<T){var I=k<=t?M.points.length-1:0;for(o=M.points[I].point.length,n=0;n<o;n+=1)r[n]=M.points[I].point[n]}else{s.__fnct?f=s.__fnct:(f=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=f),h=f((t-T)/(k-T));var F,C=M.segmentLength*h,D=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(l=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,d=!0,p=M.points.length;d;){if(D+=M.points[l].partialLength,0===C||0===h||l===M.points.length-1){for(o=M.points[l].point.length,n=0;n<o;n+=1)r[n]=M.points[l].point[n];break}if(D<=C&&C<D+M.points[l+1].partialLength){for(F=(C-D)/M.points[l+1].partialLength,o=M.points[l].point.length,n=0;n<o;n+=1)r[n]=M.points[l].point[n]+(M.points[l+1].point[n]-M.points[l].point[n])*F;break}l<p-1?l+=1:d=!1}e._lastPoint=l,e._lastAddedLength=D-M.points[l].partialLength,e._lastKeyframeIndex=c}}else{var w,V,R,G,L;if(u=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(k<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=T)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var B=z(s.s),N=z(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],p=t[0],l=t[1],f=t[2],m=t[3],c=e[0],u=e[1],d=e[2],y=e[3];(s=p*c+l*u+f*d+m*y)<0&&(s=-s,c=-c,u=-u,d=-d,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*p+o*c,h[1]=n*l+o*u,h[2]=n*f+o*d,h[3]=n*m+o*y,h}(B,N,(t-T)/(k-T)),b=v[0],P=v[1],_=v[2],A=v[3],S=Math.atan2(2*P*A-2*b*_,1-2*P*P-2*_*_),x=Math.asin(2*b*P+2*_*A),E=Math.atan2(2*b*A-2*P*_,1-2*b*b-2*_*_),g[0]=S/degToRads,g[1]=x/degToRads,g[2]=E/degToRads}else for(c=0;c<u;c+=1)1!==s.h&&(h=k<=t?1:t<T?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?f=s.__fnct[c]:(w=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],V=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],R=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],G=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],f=BezierFactory.getBezierEasing(w,V,R,G).get,s.__fnct[c]=f)):s.__fnct?f=s.__fnct:(w=s.o.x,V=s.o.y,R=s.i.x,G=s.i.y,f=BezierFactory.getBezierEasing(w,V,R,G).get,s.__fnct=f),f((t-T)/(k-T)))),y=a.s||s.e,L=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=L:r=L}return e.lastIndex=m,r}function z(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),p=Math.sin(i/2);return[o*h*n+s*a*p,o*a*n+s*h*p,s*h*n-o*a*p,s*a*n-o*h*p]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function u(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function d(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=d,this.setVValue=u,this.addEffect=y}function o(t,e,r,i){this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,a=e.k.length;this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a);createTypedArray("float32",a);for(this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=d,this.setVValue=u,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=d,this.setVValue=u,this.interpolateValue=m,this.effectsSequence=[c.bind(this)],this.addEffect=y}function p(t,e,r,i){this.propType="multidimensional";var s,a,n,o,h,p=e.k.length;for(s=0;s<p-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=d,this.setVValue=u,this.interpolateValue=m,this.frameId=-1;var l=e.k[0].s.length;for(this.v=createTypedArray("float32",l),this.pv=createTypedArray("float32",l),s=0;s<l;s+=1)this.v[s]=f,this.pv[s]=f;this._caching={lastFrame:f,lastIndex:0,value:createTypedArray("float32",l)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new p(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var e,r,i=this.elem.globalData.frameRate;if(this.p&&this.p.keyframes&&this.p.getValueAtTime)r=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(e=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],r=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(e[0]=s.getValueAtTime((s.keyframes[0].t+.01)/i,0),e[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=s.getValueAtTime(s.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(e[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/i,0),e[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(e=[s.pv,a.pv],r[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/i,s.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else e=r=n;this.v.rotate(-Math.atan2(e[1]-r[1],e[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=point_pool.newElement(),this.o[r]=point_pool.newElement(),this.i[r]=point_pool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o}(!a[i]||a[i]&&!s)&&(a[i]=point_pool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,p,l,f,m=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,m=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var u,d,y=m,g=c.length-1,v=!0;v&&(u=c[y],!((d=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(m=y,!(a=1===u.h)){if(t>=d.t-this.offsetTime)l=1;else if(t<u.t-this.offsetTime)l=0;else{var b;u.__fnct?b=u.__fnct:(b=BezierFactory.getBezierEasing(u.o.x,u.o.y,u.i.x,u.i.y).get,u.__fnct=b),l=b((t-(u.t-this.offsetTime))/(d.t-this.offsetTime-(u.t-this.offsetTime)))}s=d.s?d.s[0]:u.e[0]}i=u.s[0]}for(h=e._length,p=i.i[0].length,r.lastIndex=m,n=0;n<h;n+=1)for(o=0;o<p;o+=1)f=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*l,e.i[n][o]=f,f=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*l,e.o[n][o]=f,f=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*l,e.v[n][o]=f}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shape_pool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{this.lock=!0,this._mdf=!1;var t,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k,r=this.effectsSequence.length;for(t=0;t<r;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shape_pool.clone(i),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.keyframes[0].s[0].i[0].length;this.v=shape_pool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shape_pool.clone(this.v),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,p=this.os.v,l=this.is.v,f=2*Math.PI*o/(2*s),m=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var u=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?p:l,i=n?f:m;var d=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===d&&0===y?0:y/Math.sqrt(d*d+y*y),v=0===d&&0===y?0:-d/Math.sqrt(d*d+y*y);d+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(d,y,d-g*i*r*u,y-v*i*r*u,d+g*i*r*u,y+v*i*r*u,t,!0),n=!n,c+=a*u}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),p=i*Math.sin(n),l=0===h&&0===p?0:p/Math.sqrt(h*h+p*p),f=0===h&&0===p?0:-h/Math.sqrt(h*h+p*p);h+=+this.p.v[0],p+=+this.p.v[1],this.v.setTripleAt(h,p,h-l*a*s*o,p-f*a*s*o,h+l*a*s*o,p+f*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shape_pool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollection_pool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bm_min(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(t){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var f={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new l(t,e):6===r?i=new h(t,e):7===r&&(i=new p(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return f}(),ShapeModifiers=(fs={},gs={},fs.registerModifier=function(t,e){gs[t]||(gs[t]=e)},fs.getModifier=function(t,e,r){return new gs[t](e,r)},fs),fs,gs;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var s,a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollection_pool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],p=a.length;for(n=0;n<p;n+=1){var l,f;if((o=a[n]).e*s<i||o.s*s>i+r);else l=o.s*s<=i?0:(o.s*s-i)/r,f=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([l,f])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segments_length_pool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i;if(this._mdf||t){var s=this.o.v%360/360;if(s<0&&(s+=1),e=(1<this.s.v?1:this.s.v<0?0:this.s.v)+s,(r=(1<this.e.v?1:this.e.v<0?0:this.e.v)+s)<e){var a=e;e=r,r=a}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var n,o,h,p,l,f,m=this.shapes.length,c=0;if(r===e)for(n=0;n<m;n+=1)this.shapes[n].localShapeCollection.releaseShapes(),this.shapes[n].shape._mdf=!0,this.shapes[n].shape.paths=this.shapes[n].localShapeCollection,this._mdf&&(this.shapes[n].pathsData.length=0);else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(n=0;n<m;n+=1)this.shapes[n].pathsData.length=0,this.shapes[n].shape._mdf=!0}else{var u,d,y=[];for(n=0;n<m;n+=1)if((u=this.shapes[n]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=u.shape.paths)._length,f=0,!u.shape._mdf&&u.pathsData.length)f=u.totalShapeLength;else{for(p=this.releasePathsData(u.pathsData),o=0;o<h;o+=1)l=bez.getSegmentsLength(i.shapes[o]),p.push(l),f+=l.totalLength;u.totalShapeLength=f,u.pathsData=p}c+=f,u.shape._mdf=!0}else u.shape.paths=u.localShapeCollection;var g,v=e,b=r,P=0;for(n=m-1;0<=n;n-=1)if((u=this.shapes[n]).shape._mdf){for((d=u.localShapeCollection).releaseShapes(),2===this.m&&1<m?(g=this.calculateShapeEdges(e,r,u.totalShapeLength,P,c),P+=u.totalShapeLength):g=[[v,b]],h=g.length,o=0;o<h;o+=1){v=g[o][0],b=g[o][1],y.length=0,b<=1?y.push({s:u.totalShapeLength*v,e:u.totalShapeLength*b}):1<=v?y.push({s:u.totalShapeLength*(v-1),e:u.totalShapeLength*(b-1)}):(y.push({s:u.totalShapeLength*v,e:u.totalShapeLength}),y.push({s:0,e:u.totalShapeLength*(b-1)}));var _=this.addShapes(u,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(u.shape.paths.shapes[u.shape.paths._length-1].c){var A=_.pop();this.addPaths(_,d),_=this.addShapes(u,y[1],A)}else this.addPaths(_,d),_=this.addShapes(u,y[1]);this.addPaths(_,d)}}u.shape.paths=d}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,p,l,f=t.pathsData,m=t.shape.paths.shapes,c=t.shape.paths._length,u=0,d=[],y=!0;for(l=r?(o=r._length,r._length):(r=shape_pool.newElement(),o=0),d.push(r),i=0;i<c;i+=1){for(h=f[i].lengths,r.c=m[i].c,a=m[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(u+(n=h[s-1]).addedLength<e.s)u+=n.addedLength,r.c=!1;else{if(u>e.e){r.c=!1;break}e.s<=u&&e.e>=u+n.addedLength?(this.addSegment(m[i].v[s-1],m[i].o[s-1],m[i].i[s],m[i].v[s],r,o,y),y=!1):(p=bez.getNewSegment(m[i].v[s-1],m[i].v[s],m[i].o[s-1],m[i].i[s],(e.s-u)/n.addedLength,(e.e-u)/n.addedLength,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1),u+=n.addedLength,o+=1}if(m[i].c&&h.length){if(n=h[s-1],u<=e.e){var g=h[s-1].addedLength;e.s<=u&&e.e>=u+g?(this.addSegment(m[i].v[s-1],m[i].o[s-1],m[i].i[0],m[i].v[0],r,o,y),y=!1):(p=bez.getNewSegment(m[i].v[s-1],m[i].v[0],m[i].o[s-1],m[i].i[0],(e.s-u)/g,(e.e-u)/g,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1)}else r.c=!1;u+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[l][0],r.v[l][1],"i",l),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),u>e.e)break;i<c-1&&(r=shape_pool.newElement(),y=!0,d.push(r),o=0)}return d},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r=shape_pool.newElement();r.c=t.c;var i,s,a,n,o,h,p,l,f,m,c,u,d,y=t._length,g=0;for(i=0;i<y;i+=1)s=t.v[i],n=t.o[i],a=t.i[i],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==i&&i!==y-1||t.c?(o=0===i?t.v[y-1]:t.v[i-1],p=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,l=u=s[0]+(o[0]-s[0])*p,f=d=s[1]-(s[1]-o[1])*p,m=l-(l-s[0])*roundCorner,c=f-(f-s[1])*roundCorner,r.setTripleAt(l,f,m,c,u,d,g),g+=1,o=i===y-1?t.v[0]:t.v[i+1],p=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,l=m=s[0]+(o[0]-s[0])*p,f=c=s[1]+(o[1]-s[1])*p,u=l-(l-s[0])*roundCorner,d=f-(f-s[1])*roundCorner,r.setTripleAt(l,f,m,c,u,d,g)):r.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):r.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],g),g+=1;return r},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if((a=this.shapes[r]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var r=e/100,i=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)i[0]+=t.v[a][0],i[1]+=t.v[a][1];i[0]/=s,i[1]/=s;var n,o,h,p,l,f,m=shape_pool.newElement();for(m.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(i[0]-t.v[a][0])*r,o=t.v[a][1]+(i[1]-t.v[a][1])*r,h=t.o[a][0]+(i[0]-t.o[a][0])*-r,p=t.o[a][1]+(i[1]-t.o[a][1])*-r,l=t.i[a][0]+(i[0]-t.i[a][0])*-r,f=t.i[a][1]+(i[1]-t.i[a][1])*-r,m.setTripleAt(n,o,h,p,l,f,a);return m},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(r=0;r<o;r+=1){if((a=this.shapes[r]).shape.paths,n=a.localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);for(;0<r;)r-=1,this._elements.unshift(e[r]),1;this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){t.length;var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var p=this.o.v,l=p%1,f=0<p?Math.floor(p):Math.ceil(p),m=(this.tr.v.props,this.pMatrix.props),c=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var d,y,g=0;if(0<p){for(;g<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,l,!1),g+=l)}else if(p<0){for(;f<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;l&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-l,!0),g-=l)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),d=0;d<y;d+=1)r[d]=this.matrix.props[d];this.matrix.reset()}else for(this.matrix.reset(),d=0;d<y;d+=1)r[d]=this.matrix.props[d];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shape_pool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(t){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,r){var i="";if(t.e)i=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),i=e+s}else i=r,i+=t.u?t.u:"",i+=t.p;return i}function t(t){this._imageLoaded=e.bind(this),this.testImageLoaded=function(t){var e=0,r=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(r)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return t.prototype={loadAssets:function(t,e){this.imagesLoadedCb=e;var r,i=t.length;for(r=0;r<i;r+=1)t[r].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[r])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,r=this.images.length;e<r;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}},createImgData:function(t){var e=a(t,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.src=e;var i={img:r,assetData:t};return i},createImageData:function(t){var e=a(t,this.assetsPath,this.path),r=createNS("image");isSafari?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(r);var i={img:r,assetData:t};return i},imageLoaded:e,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},t}(),featureSupport=(Ax={maskType:!0},(/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))&&(Ax.maskType=!1),Ax),Ax,filtersFactory=(Bx={},Bx.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},Bx.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},Bx),Bx,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):void 0}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}();function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,p,l,f,m,c,u,d,y,g,v,b,P,_=this._moreOptions.alignment.v,A=this._animatorsData,S=this._textData,x=this.mHelper,E=this._renderType,k=this.renderedLetters.length,T=(this.data,t.l);if(this._hasMaskedPath){if(P=this._pathData.m,!this._pathData.n||this._pathData._mdf){var M,I=P.v;for(this._pathData.r&&(I=I.reverse()),n={tLength:0,segments:[]},a=I._length-1,s=g=0;s<a;s+=1)M=bez.buildBezierData(I.v[s],I.v[s+1],[I.o[s][0]-I.v[s][0],I.o[s][1]-I.v[s][1]],[I.i[s+1][0]-I.v[s+1][0],I.i[s+1][1]-I.v[s+1][1]]),n.tLength+=M.segmentLength,n.segments.push(M),g+=M.segmentLength;s=a,P.v.c&&(M=bez.buildBezierData(I.v[s],I.v[0],[I.o[s][0]-I.v[s][0],I.o[s][1]-I.v[s][1]],[I.i[0][0]-I.v[0][0],I.i[0][1]-I.v[0][1]]),n.tLength+=M.segmentLength,n.segments.push(M),g+=M.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,f=1,l=!(p=m=0),d=n.segments,o<0&&P.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),f=(u=d[m=d.length-1].points).length-1;o<0;)o+=u[f].partialLength,(f-=1)<0&&(f=(u=d[m-=1].points).length-1);c=(u=d[m].points)[f-1],y=(h=u[f]).partialLength}a=T.length,i=r=0;var F,C,D,w,V=1.2*t.finalSize*.714,R=!0;D=A.length;var G,L,B,N,z,O,j,q,H,W,X,Y,$,K=-1,J=o,U=m,Z=f,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(T[s].n){for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(C=0;C<D;C+=1)(F=A[C].a).t.propType&&(nt&&2===t.j&&(it+=F.t.v*st),(G=A[C].s.getMult(T[s].anIndexes[C],S.a[C].s.totalChars)).length?rt+=F.t.v*G[0]*st:rt+=F.t.v*G*st);nt=!1}for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(x.reset(),z=1,T[s].n)r=0,i+=t.yOffset,i+=R?1:0,o=J,R=!1,0,this._hasMaskedPath&&(f=Z,c=(u=d[m=U].points)[f-1],y=(h=u[f]).partialLength,p=0),$=W=Y=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==T[s].line){switch(t.j){case 1:o+=g-t.lineWidths[T[s].line];break;case 2:o+=(g-t.lineWidths[T[s].line])/2}Q=T[s].line}K!==T[s].ind&&(T[K]&&(o+=T[K].extra),o+=T[s].an/2,K=T[s].ind),o+=_[0]*T[s].an/200;var ot=0;for(C=0;C<D;C+=1)(F=A[C].a).p.propType&&((G=A[C].s.getMult(T[s].anIndexes[C],S.a[C].s.totalChars)).length?ot+=F.p.v[0]*G[0]:ot+=F.p.v[0]*G),F.a.propType&&((G=A[C].s.getMult(T[s].anIndexes[C],S.a[C].s.totalChars)).length?ot+=F.a.v[0]*G[0]:ot+=F.a.v[0]*G);for(l=!0;l;)o+ot<=p+y||!u?(v=(o+ot-p)/h.partialLength,B=c.point[0]+(h.point[0]-c.point[0])*v,N=c.point[1]+(h.point[1]-c.point[1])*v,x.translate(-_[0]*T[s].an/200,-_[1]*V/100),l=!1):u&&(p+=h.partialLength,(f+=1)>=u.length&&(f=0,u=d[m+=1]?d[m].points:P.v.c?d[m=f=0].points:(p-=h.partialLength,null)),u&&(c=h,y=(h=u[f]).partialLength));L=T[s].an/2-T[s].add,x.translate(-L,0,0)}else L=T[s].an/2-T[s].add,x.translate(-L,0,0),x.translate(-_[0]*T[s].an/200,-_[1]*V/100,0);for(T[s].l/2,C=0;C<D;C+=1)(F=A[C].a).t.propType&&(G=A[C].s.getMult(T[s].anIndexes[C],S.a[C].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?G.length?o+=F.t.v*G[0]:o+=F.t.v*G:G.length?r+=F.t.v*G[0]:r+=F.t.v*G));for(T[s].l/2,t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(O=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(q=[t.fc[0],t.fc[1],t.fc[2]]),C=0;C<D;C+=1)(F=A[C].a).a.propType&&((G=A[C].s.getMult(T[s].anIndexes[C],S.a[C].s.totalChars)).length?x.translate(-F.a.v[0]*G[0],-F.a.v[1]*G[1],F.a.v[2]*G[2]):x.translate(-F.a.v[0]*G,-F.a.v[1]*G,F.a.v[2]*G));for(C=0;C<D;C+=1)(F=A[C].a).s.propType&&((G=A[C].s.getMult(T[s].anIndexes[C],S.a[C].s.totalChars)).length?x.scale(1+(F.s.v[0]-1)*G[0],1+(F.s.v[1]-1)*G[1],1):x.scale(1+(F.s.v[0]-1)*G,1+(F.s.v[1]-1)*G,1));for(C=0;C<D;C+=1){if(F=A[C].a,G=A[C].s.getMult(T[s].anIndexes[C],S.a[C].s.totalChars),F.sk.propType&&(G.length?x.skewFromAxis(-F.sk.v*G[0],F.sa.v*G[1]):x.skewFromAxis(-F.sk.v*G,F.sa.v*G)),F.r.propType&&(G.length?x.rotateZ(-F.r.v*G[2]):x.rotateZ(-F.r.v*G)),F.ry.propType&&(G.length?x.rotateY(F.ry.v*G[1]):x.rotateY(F.ry.v*G)),F.rx.propType&&(G.length?x.rotateX(F.rx.v*G[0]):x.rotateX(F.rx.v*G)),F.o.propType&&(G.length?z+=(F.o.v*G[0]-z)*G[0]:z+=(F.o.v*G-z)*G),t.strokeWidthAnim&&F.sw.propType&&(G.length?j+=F.sw.v*G[0]:j+=F.sw.v*G),t.strokeColorAnim&&F.sc.propType)for(H=0;H<3;H+=1)G.length?O[H]=O[H]+(F.sc.v[H]-O[H])*G[0]:O[H]=O[H]+(F.sc.v[H]-O[H])*G;if(t.fillColorAnim&&t.fc){if(F.fc.propType)for(H=0;H<3;H+=1)G.length?q[H]=q[H]+(F.fc.v[H]-q[H])*G[0]:q[H]=q[H]+(F.fc.v[H]-q[H])*G;F.fh.propType&&(q=G.length?addHueToRGB(q,F.fh.v*G[0]):addHueToRGB(q,F.fh.v*G)),F.fs.propType&&(q=G.length?addSaturationToRGB(q,F.fs.v*G[0]):addSaturationToRGB(q,F.fs.v*G)),F.fb.propType&&(q=G.length?addBrightnessToRGB(q,F.fb.v*G[0]):addBrightnessToRGB(q,F.fb.v*G))}}for(C=0;C<D;C+=1)(F=A[C].a).p.propType&&(G=A[C].s.getMult(T[s].anIndexes[C],S.a[C].s.totalChars),this._hasMaskedPath?G.length?x.translate(0,F.p.v[1]*G[0],-F.p.v[2]*G[1]):x.translate(0,F.p.v[1]*G,-F.p.v[2]*G):G.length?x.translate(F.p.v[0]*G[0],F.p.v[1]*G[1],-F.p.v[2]*G[2]):x.translate(F.p.v[0]*G,F.p.v[1]*G,-F.p.v[2]*G));if(t.strokeWidthAnim&&(W=j<0?0:j),t.strokeColorAnim&&(X="rgb("+Math.round(255*O[0])+","+Math.round(255*O[1])+","+Math.round(255*O[2])+")"),t.fillColorAnim&&t.fc&&(Y="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(x.translate(0,-t.ls),x.translate(0,_[1]*V/100+i,0),S.p.p){b=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(b)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),x.rotate(-ht*Math.PI/180)}x.translate(B,N,0),o-=_[0]*T[s].an/200,T[s+1]&&K!==T[s+1].ind&&(o+=T[s].an/2,o+=t.tr/1e3*t.finalSize)}else{switch(x.translate(r,i,0),t.ps&&x.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:x.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line]),0,0);break;case 2:x.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line])/2,0,0)}x.translate(0,-t.ls),x.translate(L,0,0),x.translate(_[0]*T[s].an/200,_[1]*V/100,0),r+=T[s].l+t.tr/1e3*t.finalSize}"html"===E?tt=x.toCSS():"svg"===E?tt=x.to2dCSS():et=[x.props[0],x.props[1],x.props[2],x.props[3],x.props[4],x.props[5],x.props[6],x.props[7],x.props[8],x.props[9],x.props[10],x.props[11],x.props[12],x.props[13],x.props[14],x.props[15]],$=z}this.lettersChangedFlag=k<=s?(w=new LetterProps($,W,X,Y,tt,et),this.renderedLetters.push(w),k+=1,!0):(w=this.renderedLetters[s]).update($,W,X,Y,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{this.lock=!0,this._mdf=!1;var i,s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.pv=this.v=this.currentData,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&(t[r].s,!(r===i-1||t[r+1].t>e));)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),++s):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,p=this.data,l=[],f=0,m=p.m.g,c=0,u=0,d=0,y=[],g=0,v=0,b=h.getFontByName(t.f),P=0,_=b.fStyle?b.fStyle.split(" "):[],A="normal",S="normal";for(r=_.length,e=0;e<r;e+=1)switch(_[e].toLowerCase()){case"italic":S="italic";break;case"bold":A="700";break;case"black":A="900";break;case"medium":A="500";break;case"regular":case"normal":A="400";break;case"light":case"thin":A="200"}t.fWeight=b.fWeight||A,t.fStyle=S,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var x,E=t.tr/1e3*t.finalSize;if(t.sz)for(var k,T,M=!0,I=t.sz[0],F=t.sz[1];M;){g=k=0,r=(T=this.buildFinalText(t.t)).length,E=t.tr/1e3*t.finalSize;var C=-1;for(e=0;e<r;e+=1)x=T[e].charCodeAt(0),i=!1," "===T[e]?C=e:13!==x&&3!==x||(i=!(g=0),k+=t.finalLineHeight||1.2*t.finalSize),I<g+(P=h.chars?(o=h.getCharData(T[e],b.fStyle,b.fFamily),i?0:o.w*t.finalSize/100):h.measureText(T[e],t.f,t.finalSize))&&" "!==T[e]?(-1===C?r+=1:e=C,k+=t.finalLineHeight||1.2*t.finalSize,T.splice(e,C===e?1:0,"\r"),C=-1,g=0):(g+=P,g+=E);k+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&F<k?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=T,r=t.finalText.length,M=!1)}g=-E;var D,w=P=0;for(e=0;e<r;e+=1)if(i=!1,13===(x=(D=t.finalText[e]).charCodeAt(0))||3===x?(w=0,y.push(g),v=v<g?g:v,g=-2*E,i=!(s=""),d+=1):s=D,P=h.chars?(o=h.getCharData(D,b.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===D?w+=P+E:(g+=P+E+w,w=0),l.push({l:P,an:P,add:c,n:i,anIndexes:[],val:s,line:d,animatorJustifyOffset:0}),2==m){if(c+=P,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=P);u<=e;)l[u].an=c,l[u].ind=f,l[u].extra=P,u+=1;f+=1,c=0}}else if(3==m){if(c+=P,""===s||e===r-1){for(""===s&&(c-=P);u<=e;)l[u].an=c,l[u].ind=f,l[u].extra=P,u+=1;c=0,f+=1}}else l[f].ind=f,l[f].extra=0,f+=1;if(t.l=l,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var V,R,G=p.a;n=G.length;var L,B,N=[];for(a=0;a<n;a+=1){for((V=G[a]).a.sc&&(t.strokeColorAnim=!0),V.a.sw&&(t.strokeWidthAnim=!0),(V.a.fc||V.a.fh||V.a.fs||V.a.fb)&&(t.fillColorAnim=!0),B=0,L=V.s.b,e=0;e<r;e+=1)(R=l[e]).anIndexes[a]=B,(1==L&&""!==R.val||2==L&&""!==R.val&&" "!==R.val||3==L&&(R.n||" "==R.val||e==r-1)||4==L&&(R.n||e==r-1))&&(1===V.s.rn&&N.push(B),B+=1);p.a[a].s.totalChars=B;var z,O=-1;if(1===V.s.rn)for(e=0;e<r;e+=1)O!=(R=l[e]).anIndexes[a]&&(O=R.anIndexes[a],z=N.splice(Math.floor(Math.random()*N.length),1)[0]),R.anIndexes[a]=z}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,u=Math.min,d=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,p=this.data.sh;if(2===p)n=a(n=h===o?h<=t?1:0:c(0,u(.5/(h-o)+(t-o)/(h-o),1)));else if(3===p)n=a(n=h===o?h<=t?0:1:1-c(0,u(.5/(h-o)+(t-o)/(h-o),1)));else if(4===p)h===o?n=0:(n=c(0,u(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===p){if(h===o)n=0;else{var l=h-o,f=-l/2+(t=u(c(0,t+.5-o),h-o)),m=l/2;n=Math.sqrt(1-f*f/(m*m))}n=a(n)}else n=6===p?a(n=h===o?0:(t=u(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=d(o)&&(n=c(0,u(t-o<0?u(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),pool_factory=function(t,e,r,i){var s=0,a=t,n=createSizedArray(a);function o(){return s?n[s-=1]:e()}return{newElement:o,release:function(t){s===a&&(n=pooling.double(n),a*=2),r&&r(t),n[s]=t,s+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},point_pool=pool_factory(8,function(){return createTypedArray("float32",2)}),shape_pool=(SB=pool_factory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)point_pool.release(t.v[e]),point_pool.release(t.i[e]),point_pool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),SB.clone=function(t){var e,r=SB.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},SB),SB,shapeCollection_pool=(_B={newShapeCollection:function(){var t;t=aC?cC[aC-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shape_pool.release(t.shapes[e]);t._length=0,aC===bC&&(cC=pooling.double(cC),bC*=2);cC[aC]=t,aC+=1}},aC=0,bC=4,cC=createSizedArray(bC),_B),_B,aC,bC,cC,segments_length_pool=pool_factory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezier_length_pool.release(t.lengths[e]);t.lengths.length=0}),bezier_length_pool=pool_factory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!e||!1!==e.hideOnTransparent,viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var n,o,h,p,l,f,m,c=this.masksProperties,u=0,d=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<a;i++)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!=c[i].mode&&"i"!=c[i].mode||0!==u?p=null:((p=createNS("rect")).setAttribute("fill","#ffffff"),p.setAttribute("width",this.element.comp.data.w||0),p.setAttribute("height",this.element.comp.data.h||0),d.push(p)),n=createNS("path"),"n"!=c[i].mode){var b;if(u+=1,n.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),n.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",m=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),b=createElementID(),(l=createNS("filter")).setAttribute("id",b),(f=createNS("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),l.appendChild(f),s.appendChild(l),n.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:n,x:m,expan:f,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==c[i].mode){h=d.length;var P=createNS("g");for(o=0;o<h;o+=1)P.appendChild(d[o]);var _=createNS("mask");_.setAttribute("mask-type","alpha"),_.setAttribute("id",y+"_"+u),_.appendChild(n),s.appendChild(_),P.setAttribute("mask","url("+locationHref+"#"+y+"_"+u+")"),d.length=0,d.push(P)}else d.push(n);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:n,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:p},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:n,lastPath:""},s.appendChild(n);for(this.maskElement=createNS(g),a=d.length,i=0;i<a;i+=1)this.maskElement.appendChild(d[i]);0<u&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function SVGTransformData(t,e,r){this.transform={mProps:t,op:e,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function SVGStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r}function SVGGradientFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,r)}function SVGGradientStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e--)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t)}return this.createNull(t)},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){this.completeLayers=!1;var e,r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id==t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;t<e;t++)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!=this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var e,r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e--)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e++)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r=!0,i=this.comp;r;)i.finalTransform?(i.data.hasMask&&e.splice(0,0,i.finalTransform),i=i.comp):r=!1;var s,a,n=e.length;for(s=0;s<n;s+=1)a=e[s].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,r){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,e),this.setGradientOpacity(e,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var r=createElementID(),i=createNS(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",r),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var s,a,n,o=[];for(n=4*e.g.p,a=0;a<n;a+=4)s=createNS("stop"),i.appendChild(s),o.push(s);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+locationHref+"#"+r+")"),this.gf=i,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var r,i,s,a=createNS("mask"),n=createNS("path");a.appendChild(n);var o=createElementID(),h=createElementID();a.setAttribute("id",h);var p=createNS(1===t.t?"linearGradient":"radialGradient");p.setAttribute("id",o),p.setAttribute("spreadMethod","pad"),p.setAttribute("gradientUnits","userSpaceOnUse"),s=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var l=this.stops;for(i=4*t.g.p;i<s;i+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),p.appendChild(r),l.push(r);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+locationHref+"#"+o+")"),this.of=p,this.ms=a,this.ost=l,this.maskId=h,e.msElem=n}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var SVGElementsRenderer=function(){var y=new Matrix,g=new Matrix;function e(t,e,r){(r||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(r||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function r(t,e,r){var i,s,a,n,o,h,p,l,f,m,c,u=e.styles.length,d=e.lvl;for(h=0;h<u;h+=1){if(n=e.sh._mdf||r,e.styles[h].lvl<d){for(l=g.reset(),m=d-e.styles[h].lvl,c=e.transformers.length-1;!n&&0<m;)n=e.transformers[c].mProps._mdf||n,m--,c--;if(n)for(m=d-e.styles[h].lvl,c=e.transformers.length-1;0<m;)f=e.transformers[c].mProps.v.props,l.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),m--,c--}else l=y;if(s=(p=e.sh.paths)._length,n){for(a="",i=0;i<s;i+=1)(o=p.shapes[i])&&o._length&&(a+=buildShapeString(o,o._length,o.c,l));e.caches[h]=a}else a=e.caches[h];e.styles[h].d+=!0===t.hd?"":a,e.styles[h]._mdf=n||e.styles[h]._mdf}}function i(t,e,r){var i=e.style;(e.c._mdf||r)&&i.pElem.setAttribute("fill","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function s(t,e,r){a(t,e,r),n(t,e,r)}function a(t,e,r){var i,s,a,n,o,h=e.gf,p=e.g._hasOpacity,l=e.s.v,f=e.e.v;if(e.o._mdf||r){var m="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(m,e.o.v)}if(e.s._mdf||r){var c=1===t.t?"x1":"cx",u="x1"===c?"y1":"cy";h.setAttribute(c,l[0]),h.setAttribute(u,l[1]),p&&!e.g._collapsable&&(e.of.setAttribute(c,l[0]),e.of.setAttribute(u,l[1]))}if(e.g._cmdf||r){i=e.cst;var d=e.g.c;for(a=i.length,s=0;s<a;s+=1)(n=i[s]).setAttribute("offset",d[4*s]+"%"),n.setAttribute("stop-color","rgb("+d[4*s+1]+","+d[4*s+2]+","+d[4*s+3]+")")}if(p&&(e.g._omdf||r)){var y=e.g.o;for(a=(i=e.g._collapsable?e.cst:e.ost).length,s=0;s<a;s+=1)n=i[s],e.g._collapsable||n.setAttribute("offset",y[2*s]+"%"),n.setAttribute("stop-opacity",y[2*s+1])}if(1===t.t)(e.e._mdf||r)&&(h.setAttribute("x2",f[0]),h.setAttribute("y2",f[1]),p&&!e.g._collapsable&&(e.of.setAttribute("x2",f[0]),e.of.setAttribute("y2",f[1])));else if((e.s._mdf||e.e._mdf||r)&&(o=Math.sqrt(Math.pow(l[0]-f[0],2)+Math.pow(l[1]-f[1],2)),h.setAttribute("r",o),p&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.e._mdf||e.h._mdf||e.a._mdf||r){o||(o=Math.sqrt(Math.pow(l[0]-f[0],2)+Math.pow(l[1]-f[1],2)));var g=Math.atan2(f[1]-l[1],f[0]-l[0]),v=o*(1<=e.h.v?.99:e.h.v<=-1?-.99:e.h.v),b=Math.cos(g+e.a.v)*v+l[0],P=Math.sin(g+e.a.v)*v+l[1];h.setAttribute("fx",b),h.setAttribute("fy",P),p&&!e.g._collapsable&&(e.of.setAttribute("fx",b),e.of.setAttribute("fy",P))}}function n(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||r)&&s.dashStr&&(i.pElem.setAttribute("stroke-dasharray",s.dashStr),i.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||r)&&i.pElem.setAttribute("stroke","rgb("+bm_floor(e.c.v[0])+","+bm_floor(e.c.v[1])+","+bm_floor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||r)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){t.ty;switch(t.ty){case"fl":return i;case"gf":return a;case"gs":return s;case"st":return n;case"sh":case"el":case"rc":case"sr":return r;case"tr":return e}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function AudioElement(t,e,r){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,r),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGCompElement(t,e,r){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGTextElement(t,e,r){this.textSpans=[],this.renderType="svg",this.initElement(t,e,r)}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function SVGTintFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");if(r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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.setAttribute("result","f1"),t.appendChild(r),(r=createNS("feColorMatrix")).setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result","f2"),t.appendChild(r),this.matrixFilter=r,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var i,s=createNS("feMerge");t.appendChild(s),(i=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),s.appendChild(i),(i=createNS("feMergeNode")).setAttribute("in","f2"),s.appendChild(i)}}function SVGFillFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(r),this.matrixFilter=r}function SVGGaussianBlurEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var r=createNS("feGaussianBlur");t.appendChild(r),this.feGaussianBlur=r}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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.setAttribute("result","f1"),t.appendChild(r);var i=createNS("feComponentTransfer");i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.matrixFilter=i;var s=createNS("feFuncR");s.setAttribute("type","table"),i.appendChild(s),this.feFuncR=s;var a=createNS("feFuncG");a.setAttribute("type","table"),i.appendChild(a),this.feFuncG=a;var n=createNS("feFuncB");n.setAttribute("type","table"),i.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var r=this.filterManager.effectElements,i=createNS("feComponentTransfer");(r[10].p.k||0!==r[10].p.v||r[11].p.k||1!==r[11].p.v||r[12].p.k||1!==r[12].p.v||r[13].p.k||0!==r[13].p.v||r[14].p.k||1!==r[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",i)),(r[17].p.k||0!==r[17].p.v||r[18].p.k||1!==r[18].p.v||r[19].p.k||1!==r[19].p.v||r[20].p.k||0!==r[20].p.v||r[21].p.k||1!==r[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",i)),(r[24].p.k||0!==r[24].p.v||r[25].p.k||1!==r[25].p.v||r[26].p.k||1!==r[26].p.v||r[27].p.k||0!==r[27].p.v||r[28].p.k||1!==r[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",i)),(r[31].p.k||0!==r[31].p.v||r[32].p.k||1!==r[32].p.v||r[33].p.k||1!==r[33].p.v||r[34].p.k||0!==r[34].p.v||r[35].p.k||1!==r[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",i)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),i=createNS("feComponentTransfer")),(r[3].p.k||0!==r[3].p.v||r[4].p.k||1!==r[4].p.v||r[5].p.k||1!==r[5].p.v||r[6].p.k||0!==r[6].p.v||r[7].p.k||1!==r[7].p.v)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.feFuncRComposed=this.createFeFunc("feFuncR",i),this.feFuncGComposed=this.createFeFunc("feFuncG",i),this.feFuncBComposed=this.createFeFunc("feFuncB",i))}function SVGDropShadowEffect(t,e){var r=e.container.globalData.renderConfig.filterSize;t.setAttribute("x",r.x),t.setAttribute("y",r.y),t.setAttribute("width",r.width),t.setAttribute("height",r.height),this.filterManager=e;var i=createNS("feGaussianBlur");i.setAttribute("in","SourceAlpha"),i.setAttribute("result","drop_shadow_1"),i.setAttribute("stdDeviation","0"),this.feGaussianBlur=i,t.appendChild(i);var s=createNS("feOffset");s.setAttribute("dx","25"),s.setAttribute("dy","0"),s.setAttribute("in","drop_shadow_1"),s.setAttribute("result","drop_shadow_2"),this.feOffset=s,t.appendChild(s);var a=createNS("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var n=createNS("feComposite");n.setAttribute("in","drop_shadow_3"),n.setAttribute("in2","drop_shadow_2"),n.setAttribute("operator","in"),n.setAttribute("result","drop_shadow_4"),t.appendChild(n);var o,h=createNS("feMerge");t.appendChild(h),o=createNS("feMergeNode"),h.appendChild(o),(o=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=h,this.originalNodeAdded=!1,h.appendChild(o)}ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return"_"+this.transform_key_count++}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var p=createNS("rect");p.setAttribute("width",this.comp.data.w),p.setAttribute("height",this.comp.data.h),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("fill","#ffffff"),p.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(p),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(p),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var l=createNS("clipPath"),f=createNS("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=createElementID();if(l.setAttribute("id",m),l.appendChild(f),this.globalData.defs.appendChild(l),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+m+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextElement),SVGTextElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextElement.prototype.buildTextContents=function(t){for(var e=0,r=t.length,i=[],s="";e<r;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(s),s=""):s+=t[e],e+=1;return i.push(s),i},SVGTextElement.prototype.buildNewText=function(){var t,e,r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var i=this.globalData.fontManager.getFontByName(r.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var s=r.fWeight,a=r.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",s)}this.layerElement.setAttribute("aria-label",r.t);var n,o=r.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var p,l=this.mHelper,f="",m=this.data.singleShape,c=0,u=0,d=!0,y=r.tr/1e3*r.finalSize;if(!m||h||r.sz){var g,v,b=this.textSpans.length;for(t=0;t<e;t+=1)h&&m&&0!==t||(n=t<b?this.textSpans[t]:createNS(h?"path":"text"),b<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),l.reset(),l.scale(r.finalSize/100,r.finalSize/100),m&&(o[t].n&&(c=-y,u+=r.yOffset,u+=d?1:0,d=!1),this.applyTextPropertiesToMatrix(r,l,o[t].line,c,u),c+=o[t].l||0,c+=y),h?(p=(g=(v=this.globalData.fontManager.getCharData(r.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily))&&v.data||{}).shapes?g.shapes[0].it:[],m?f+=this.createPathShape(l,p):n.setAttribute("d",this.createPathShape(l,p))):(m&&n.setAttribute("transform","translate("+l.props[12]+","+l.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&n&&n.setAttribute("d",f)}else{var P=this.textContainer,_="start";switch(r.j){case 1:_="end";break;case 2:_="middle"}P.setAttribute("text-anchor",_),P.setAttribute("letter-spacing",y);var A=this.buildTextContents(r.finalText);for(e=A.length,u=r.ps?r.ps[1]+r.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||createNS("tspan")).textContent=A[t],n.setAttribute("x",0),n.setAttribute("y",u),n.style.display="inherit",P.appendChild(n),this.textSpans[t]=n,u+=r.finalLineHeight;this.layerElement.appendChild(P)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},SVGTextElement.prototype.sourceRectAtTime=function(t){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextElement.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var r,i,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(r=s[t],i=this.textSpans[t],r._mdf.m&&i.setAttribute("transform",r.m),r._mdf.o&&i.setAttribute("opacity",r.o),r._mdf.sw&&i.setAttribute("stroke-width",r.sw),r._mdf.sc&&i.setAttribute("stroke",r.sc),r._mdf.fc&&i.setAttribute("fill",r.fc))}},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,p,l,f,m,c=[].concat(a),u=t.length-1,d=[],y=[];for(o=u;0<=o;o-=1){if((m=this.searchProcessedElement(t[o]))?e[o]=r[m-1]:t[o]._render=n,"fl"==t[o].ty||"st"==t[o].ty||"gf"==t[o].ty||"gs"==t[o].ty)m?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),d.push(e[o].style);else if("gr"==t[o].ty){if(m)for(p=e[o].it.length,h=0;h<p;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"==t[o].ty?(m||(e[o]=this.createTransformElement(t[o],i)),l=e[o].transform,c.push(l)):"sh"==t[o].ty||"rc"==t[o].ty||"el"==t[o].ty||"sr"==t[o].ty?(m||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"==t[o].ty||"rd"==t[o].ty||"ms"==t[o].ty||"pb"==t[o].ty?(m?(f=e[o]).closed=!1:((f=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=f,this.shapeModifiers.push(f)),y.push(f)):"rp"==t[o].ty&&(m?(f=e[o]).closed=!0:(f=ShapeModifiers.getModifier(t[o].ty),(e[o]=f).init(this,t,o,e),this.shapeModifiers.push(f),n=!1),y.push(f));this.addProcessedElement(t[o],o+1)}for(u=d.length,o=0;o<u;o+=1)d[o].closed=!0;for(u=y.length,o=0;o<u;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var t,e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",r[0]-e[0]+" 0 0 0 "+e[0]+" "+(r[1]-e[1])+" 0 0 0 "+e[1]+" "+(r[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGGaussianBlurEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=3==r?0:e,s=2==r?0:e;this.feGaussianBlur.setAttribute("stdDeviation",i+" "+s);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},SVGStrokeEffect.prototype.initialize=function(){var t,e,r,i,s=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(i=this.elem.maskManager.masksProperties.length,r=0):i=(r=this.filterManager.effectElements[0].p.v-1)+1,(e=createNS("g")).setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1);r<i;r+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:r});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),n=createElementID();a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+locationHref+"#"+n+")");s[0];)o.appendChild(s[0]);this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(s=this.elem.layerElement.children||this.elem.layerElement.childNodes;s.length;)this.elem.layerElement.removeChild(s[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){this.initialized||this.initialize();var e,r,i,s=this.paths.length;for(e=0;e<s;e+=1)if(-1!==this.paths[e].m&&(r=this.elem.maskManager.viewData[this.paths[e].m],i=this.paths[e].p,(t||this.filterManager._mdf||r.prop._mdf)&&i.setAttribute("d",r.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,o=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)/100,h=i.getTotalLength();a="0 0 0 "+h*n+" ";var p,l=h*(o-n),f=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100,m=Math.floor(l/f);for(p=0;p<m;p+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v/100;i.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bm_floor(255*c[0])+","+bm_floor(255*c[1])+","+bm_floor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v,s=i[0]+" "+r[0]+" "+e[0],a=i[1]+" "+r[1]+" "+e[1],n=i[2]+" "+r[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",s),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var r=createNS(t);return r.setAttribute("type","table"),e.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(t,e,r,i,s){for(var a,n,o=0,h=Math.min(t,e),p=Math.max(t,e),l=Array.call(null,{length:256}),f=0,m=s-i,c=e-t;o<=256;)n=(a=o/256)<=h?c<0?s:i:p<=a?c<0?i:s:i+m*Math.pow((a-t)/c,1/r),l[f++]=n,o+=256/255;return l.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(t||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(e=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(e=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(e=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(e=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(e=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=r*Math.cos(i),a=r*Math.sin(i);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,r){this.initialized=!1,this.filterManager=e,this.filterElem=t,(this.elem=r).matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGEffects(t){var e,r,i=t.data.ef?t.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s),n=0;for(this.filters=[],e=0;e<i;e+=1)r=null,20===t.data.ef[e].ty?(n+=1,r=new SVGTintFilter(a,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(n+=1,r=new SVGFillFilter(a,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?r=new SVGStrokeEffect(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(n+=1,r=new SVGTritoneFilter(a,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(n+=1,r=new SVGProLevelsFilter(a,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(n+=1,r=new SVGDropShadowEffect(a,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty?r=new SVGMatte3Effect(a,t.effectsManager.effectElements[e],t):29===t.data.ef[e].ty&&(n+=1,r=new SVGGaussianBlurEffect(a,t.effectsManager.effectElements[e])),r&&this.filters.push(r);n&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+locationHref+"#"+s+")")),this.filters.length&&t.addRenderableComponent(this)}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,r=_svgMatteSymbols.length;e<r;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var r=t.layerElement.parentNode;if(r){for(var i,s=r.children,a=0,n=s.length;a<n&&s[a]!==t.layerElement;)a+=1;a<=n-2&&(i=s[a+1]);var o=createNS("use");o.setAttribute("href","#"+e),i?r.insertBefore(o,i):r.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var r=createElementID(),i=createNS("mask");i.setAttribute("id",e.layerId),i.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var s=t.globalData.defs;s.appendChild(i);var a=createNS("symbol");a.setAttribute("id",r),this.replaceInParent(e,r),a.appendChild(e.layerElement),s.appendChild(a);var n=createNS("use");n.setAttribute("href","#"+r),i.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,r=0,i=e.length;r<i;)e[r]&&e[r].data.ind===t&&this.setElementAsMask(this.elem,e[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGEffects.prototype.renderFrame=function(t){var e,r=this.filters.length;for(e=0;e<r;e+=1)this.filters[e].renderFrame(t)};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||f()),e+=1}function p(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem==t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return m(i,t),i.setData(t,e),i}function l(){n+=1,u()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",l),t.addEventListener("_idle",f),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function u(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=p,t.loadAnimation=function(t){var e=new AnimationItem;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),p(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),p(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,u()},t.setVolume=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!t.hasOwnProperty("autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){var r={wrapper:t,animationData:e?"object"==typeof e?e:JSON.parse(e):null},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";""===s||(r.loop="false"!==s&&("true"===s||parseInt(s)));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id==a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!=r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.timeCompleted=this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=this.onLoopComplete=this.onComplete=this.onSegmentStart=this.onDestroy=null,this.renderer=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t==this.assets[e].id)return this.assets[e];e+=1}},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(oQ={},oQ.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},oQ),oQ;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:void 0}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]=t[0]+e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t)),"string"===i&&(e=parseInt(e)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]=t[0]-e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t)),"string"==typeof e&&(e=parseInt(e)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var r,i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n==o)e=r=0;else{var p=n-o;switch(r=.5<h?p/(2-n-o):p/(n+o),n){case i:e=(s-a)/p+(s<a?6:0);break;case s:e=(a-i)/p+2;break;case a:e=(i-s)/p+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)e=r=i=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*n;var o,h=i.length,p=createTypedArray("float32",h);for(o=0;o<h;o+=1)p[o]=i[o]+(s[o]-i[o])*n;return p}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shape_pool.newElement();n.setPathData(!!i,a);var o,h,p=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:p,h=r&&r[s]?r[s]:p,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,__expression_functions=[],scoped_bm_rt;if(data.xf){var i,len=data.xf.length;for(i=0;i<len;i+=1)__expression_functions[i]=eval("(function(){ return "+data.xf[i]+"}())")}var expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),p=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)p[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return p}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r);var n=t(e=1<e?1:e<0?0:e);if($bm_isInstanceOfArray(s)){var o,h=s.length,p=createTypedArray("float32",h);for(o=0;o<h;o+=1)p[o]=(a[o]-s[o])*n+s[o];return p}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=data.k[t].hasOwnProperty("s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,p=this.keyframes,l=p[p.length-1].t;if(h<=l)return this.pv;if(r?s=l-(i=e?Math.abs(l-elem.comp.globalData.frameRate*e):Math.max(0,l-this.elem.data.ip)):((!e||e>p.length-1)&&(e=p.length-1),i=l-(s=p[p.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),m=this.getValueAtTime(l/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),u=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a<n;a+=1)o[a]=(m[a]-f[a])*u+c[a];return o}return(m-f)*u+c}if("continue"===t){var d=this.getValueAtTime(l/this.comp.globalData.frameRate,0),y=this.getValueAtTime((l-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(d.length)).length,a=0;a<n;a+=1)o[a]=d[a]+(d[a]-y[a])*((h-l)/this.comp.globalData.frameRate)/5e-4;return o}return d+(h-l)/.001*(d-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,p=this.keyframes,l=p[0].t;if(l<=h)return this.pv;if(r?s=l+(i=e?Math.abs(elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-l)):((!e||e>p.length-1)&&(e=p.length-1),i=(s=p[e].t)-l),"pingpong"===t){if(Math.floor((l-h)/i)%2==0)return this.getValueAtTime(((l-h)%i+l)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(l/this.comp.globalData.frameRate,0),m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(l-h)%i+l)/this.comp.globalData.frameRate,0),u=Math.floor((l-h)/i)+1;if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(m[a]-f[a])*u;return o}return c-(m-f)*u}if("continue"===t){var d=this.getValueAtTime(l/this.comp.globalData.frameRate,0),y=this.getValueAtTime((l+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(d.length)).length,a=0;a<n;a+=1)o[a]=d[a]+(d[a]-y[a])*(l-h)/.001;return o}return d+(d-y)*(l-h)/.001}}return this.getValueAtTime((i-(l-h)%i+l)/this.comp.globalData.frameRate,0)}function p(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(t);e.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var i=this.s.getValueAtTime(t);e.scale(i[0]*this.s.mult,i[1]*this.s.mult,i[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),p=this.rx.getValueAtTime(t),l=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(p*this.rx.mult).rotateZ(-l[2]*this.or.mult).rotateY(l[1]*this.or.mult).rotateX(l[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var f=this.px.getValueAtTime(t),m=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(f*this.px.mult,m*this.py.mult,-c*this.pz.mult)}else e.translate(f*this.px.mult,m*this.py.mult,0)}else{var u=this.p.getValueAtTime(t);e.translate(u[0]*this.p.mult,u[1]*this.p.mult,-u[2]*this.p.mult)}return e}.bind(i):i.getValueAtTime=function(t){return this.v.clone(new Matrix)}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var l=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=l(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=p,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0));var i,s=r._length,a=r[t],n=r.v,o=createSizedArray(s);for(i=0;i<s;i+=1)o[i]="i"===t||"o"===t?[a[i][0]-n[i][0],a[i][1]-n[i][1]]:[a[i][0],a[i][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,p=0;o<h;){if(p+a[o].addedLength>n){var l=o,f=r.c&&o===h-1?0:o+1,m=(n-p)/a[o].addedLength;i=bez.getPointInSegment(r.v[l],r.v[f],r.o[l],r.i[f],m,a[o]);break}p+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){t=1==t?this.v.c?0:.999:t;var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){if(this.data.d.x)return this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0};var ShapePathInterface=function(t,e,r){var i=e.sh;function s(t){if("Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t)return s.path}var a=propertyGroupFactory(s,r);return i.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:r}}),s},propertyGroupFactory=function(e,r){return function(t){return(t=void 0===t?1:t)<=0?e:r(t-1)}},PropertyInterface=function(t,e){var r={_name:t};return function(t){return(t=void 0===t?1:t)<=0?r:e(--t)}},ShapeExpressionInterface=function(){function n(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"==t[i].ty?s.push(o(t[i],e[i],r)):"fl"==t[i].ty?s.push(h(t[i],e[i],r)):"st"==t[i].ty?s.push(p(t[i],e[i],r)):"tm"==t[i].ty?s.push(l(t[i],e[i],r)):"tr"==t[i].ty||("el"==t[i].ty?s.push(m(t[i],e[i],r)):"sr"==t[i].ty?s.push(c(t[i],e[i],r)):"sh"==t[i].ty?s.push(ShapePathInterface(t[i],e[i],r)):"rc"==t[i].ty?s.push(u(t[i],e[i],r)):"rd"==t[i].ty?s.push(d(t[i],e[i],r)):"rp"==t[i].ty&&s.push(y(t[i],e[i],r)));return s}function o(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,e,r){var i,s=function(t){for(var e=0,r=i.length;e<r;){if(i[e]._name===t||i[e].mn===t||i[e].propertyIndex===t||i[e].ix===t||i[e].ind===t)return i[e];e+=1}if("number"==typeof t)return i[t-1]};s.propertyGroup=propertyGroupFactory(s,r),i=n(t.it,e.it,s.propertyGroup),s.numProperties=i.length;var a=f(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,i.propertyGroup),a=f(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function h(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:void 0}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),i}function p(t,e,r){var i=propertyGroupFactory(p,r),s=propertyGroupFactory(h,i);var a,n,o=t.d?t.d.length:0,h={};for(a=0;a<o;a+=1)n=a,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[a].p.setGroupProperty(s);function p(t){return"Color"===t||"color"===t?p.color:"Opacity"===t||"opacity"===t?p.opacity:"Stroke Width"===t||"stroke width"===t?p.strokeWidth:void 0}return Object.defineProperties(p,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",i)),e.o.setGroupProperty(PropertyInterface("Opacity",i)),e.w.setGroupProperty(PropertyInterface("Stroke Width",i)),p}function l(e,t,r){function i(t){return t===e.e.ix||"End"===t||"end"===t?i.end:t===e.s.ix?i.start:t===e.o.ix?i.offset:void 0}var s=propertyGroupFactory(i,r);return i.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),i.propertyIndex=e.ix,i.propertyGroup=r,Object.defineProperties(i,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),i.mn=e.mn,i}function f(e,t,r){function i(t){return e.a.ix===t||"Anchor Point"===t?i.anchorPoint:e.o.ix===t||"Opacity"===t?i.opacity:e.p.ix===t||"Position"===t?i.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?i.rotation:e.s.ix===t||"Scale"===t?i.scale:e.sk&&e.sk.ix===t||"Skew"===t?i.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?i.skewAxis:void 0}var s=propertyGroupFactory(i,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(i,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),i.ty="tr",i.mn=e.mn,i.propertyGroup=r,i}function m(e,t,r){function i(t){return e.p.ix===t?i.position:e.s.ix===t?i.size:void 0}var s=propertyGroupFactory(i,r);i.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(i,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),i.mn=e.mn,i}function c(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.rotation:e.pt.ix===t?i.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?i.outerRadius:e.os.ix===t?i.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?i.innerRoundness:void 0:i.innerRadius}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),i.mn=e.mn,i}function u(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?i.size:void 0}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),i.mn=e.mn,i}function d(e,t,r){function i(t){if(e.r.ix===t||"Round Corners 1"===t)return i.radius}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(i,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),i.mn=e.mn,i}function y(e,t,r){function i(t){return e.c.ix===t||"Copies"===t?i.copies:e.o.ix===t||"Offset"===t?i.offset:void 0}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(i,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),i.mn=e.mn,i}return function(t,e,i){var s;function r(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,r=s.length;e<r;){if(s[e]._name===t)return s[e];e+=1}}return r.propertyGroup=propertyGroupFactory(r,function(){return i}),s=n(t,e,r.propertyGroup),r.numProperties=s.length,r._name="Contents",r}}(),TextExpressionInterface=function(e){var r;function i(t){switch(t){case"ADBE Text Document":return i.sourceText}}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),i},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var r=this.getMatrix(e);return r.props[12]=r.props[13]=r.props[14]=0,this.applyPoint(r,t)}function n(t,e){var r=this.getMatrix(e);return this.applyPoint(r,t)}function o(t,e){var r=this.getMatrix(e);return r.props[12]=r.props[13]=r.props[14]=0,this.invertPoint(r,t)}function h(t,e){var r=this.getMatrix(e);return this.invertPoint(r,t)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function f(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function m(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect;case"ADBE Text Properties":return i.textInterface}}i.getMatrix=s,i.invertPoint=l,i.applyPoint=p,i.toWorld=n,i.toWorldVec=a,i.fromWorld=h,i.fromWorldVec=o,i.toComp=n,i.fromComp=f,i.sampleImage=m,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity}}if(Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p)var r=ExpressionPropertyInterface(t.p);else{var i,s=ExpressionPropertyInterface(t.px),a=ExpressionPropertyInterface(t.py);t.pz&&(i=ExpressionPropertyInterface(t.pz))}return Object.defineProperty(e,"position",{get:function(){return t.p?r():[s(),a(),i?i():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function p(s,t,e,r){function i(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?o[r]:o[r]();r+=1}throw new Error}var a,n=propertyGroupFactory(i,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(p(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,r)):o.push(l(t.effectElements[a],s.ef[a].ty,r,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(i,"color",{get:function(){return o[0]()}}),Object.defineProperties(i,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),i.active=i.enabled=0!==s.en,i}function l(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",i)),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(p(s[r],t.effectsManager.effectElements[r],e,t));var n=t.data.ef||[],o=function(t){for(r=0,a=n.length;r<a;){if(t===n[r].nm||t===n[r].mn||t===n[r].ix)return i[r];r+=1}};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}}}}(),MaskManagerInterface=function(){function a(t,e){this._mask=t,this._data=e}Object.defineProperty(a.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(a.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e,t){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new a(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(i.numKeys){var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r.value="unidimensional"===a?e[0]:e,r}return 0},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)s[t]=a[t]=e.v[t]*r;return s}}(t):e}}(),C_,D_;function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var r=t.ef||[];this.effectElements=[];var i,s,a=r.length;for(i=0;i<a;i++)s=new GroupEffect(r[i],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}C_=function(){function r(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}return function(t,e){this.pv=1,this.comp=t.comp,this.elem=t,this.mult=.01,this.propType="textSelector",this.textTotal=e.totalChars,this.selectorValue=100,this.lastValue=[1,1,1],this.k=!0,this.x=!0,this.getValue=ExpressionManager.initiateExpression.bind(this)(t,e,this),this.getMult=r,this.getVelocityAtTime=expressionHelpers.getVelocityAtTime,this.kf?this.getValueAtTime=expressionHelpers.getValueAtTime.bind(this):this.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(this),this.setGroupProperty=expressionHelpers.setGroupProperty}}(),D_=TextSelectorProp.getTextSelectorProp,TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new C_(t,e,r):D_(t,e,r)},extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var r,i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottie={},_isFrozen=!1;function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r<e.length;r++){var i=e[r].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.7.5";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""},queryString=myScript.src.replace(/^[^\?]+\??/,"");renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
+	"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bmRnd,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["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=e.length;for(t=0;t<r;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===typeof t&&t.length){var e,r=createSizedArray(t.length),i=t.length;for(e=0;e<i;e+=1)r[e]=Math.abs(t[e]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){bmRnd=t?Math.round:function(t){return t}}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e}roundValues(!1);var createElementID=(F=0,function(){return"__lottie_element_"+(F+=1)}),F;function HSVtoRGB(t,e,r){var i,s,a,n,o,h,l,p;switch(h=r*(1-e),l=r*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=r*(1-(1-o)*e),n%6){case 0:i=r,s=p,a=h;break;case 1:i=l,s=r,a=h;break;case 2:i=h,s=r,a=p;break;case 3:i=h,s=l,a=r;break;case 4:i=p,s=h,a=r;break;case 5:i=r,s=h,a=l}return[i,s,a]}function RGBtoHSV(t,e,r){var i,s=Math.max(t,e,r),a=Math.min(t,e,r),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:i=0;break;case t:i=e-r+n*(e<r?6:0),i/=6*n;break;case e:i=r-t+2*n,i/=6*n;break;case r:i=t-e+4*n,i/=6*n}return[i,o,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[1]+=e,1<r[1]?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,1<r[2]?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,1<r[0]?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t].length,i=0;i<r;i+=1)this._cbs[t][i](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var createTypedArray=function(){function r(t,e){var r,i=0,s=[];switch(t){case"int16":case"uint8c":r=1;break;default:r=1.1}for(i=0;i<e;i+=1)s.push(r);return s}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):r(t,e)}:r}();function createSizedArray(t){return Array.apply(null,{length:t})}function createNS(t){return document.createElementNS(svgNS,t)}function createTag(t){return document.createElement(t)}function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var getBlendMode=(Oa={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(t){return Oa[t]||""}),Oa,Matrix=function(){var s=Math.cos,a=Math.sin,n=Math.tan,i=Math.round;function t(){return 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,this}function e(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function r(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1)}function o(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1)}function h(t){if(0===t)return this;var e=s(t),r=a(t);return this._t(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function p(t,e){return this.shear(n(t),n(e))}function f(t,e){var r=s(e),i=a(e);return this._t(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,n(t),1,0,0,0,0,1,0,0,0,0,1)._t(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1)}function m(t,e,r){return r||0===r||(r=1),1===t&&1===e&&1===r?this:this._t(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1)}function c(t,e,r,i,s,a,n,o,h,l,p,f,m,c,u,d){return this.props[0]=t,this.props[1]=e,this.props[2]=r,this.props[3]=i,this.props[4]=s,this.props[5]=a,this.props[6]=n,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=p,this.props[11]=f,this.props[12]=m,this.props[13]=c,this.props[14]=u,this.props[15]=d,this}function u(t,e,r){return r=r||0,0!==t||0!==e||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1):this}function d(t,e,r,i,s,a,n,o,h,l,p,f,m,c,u,d){var y=this.props;if(1===t&&0===e&&0===r&&0===i&&0===s&&1===a&&0===n&&0===o&&0===h&&0===l&&1===p&&0===f)return y[12]=y[12]*t+y[15]*m,y[13]=y[13]*a+y[15]*c,y[14]=y[14]*p+y[15]*u,y[15]*=d,this._identityCalculated=!1,this;var g=y[0],v=y[1],P=y[2],b=y[3],A=y[4],S=y[5],x=y[6],_=y[7],E=y[8],k=y[9],T=y[10],M=y[11],F=y[12],I=y[13],D=y[14],C=y[15];return y[0]=g*t+v*s+P*h+b*m,y[1]=g*e+v*a+P*l+b*c,y[2]=g*r+v*n+P*p+b*u,y[3]=g*i+v*o+P*f+b*d,y[4]=A*t+S*s+x*h+_*m,y[5]=A*e+S*a+x*l+_*c,y[6]=A*r+S*n+x*p+_*u,y[7]=A*i+S*o+x*f+_*d,y[8]=E*t+k*s+T*h+M*m,y[9]=E*e+k*a+T*l+M*c,y[10]=E*r+k*n+T*p+M*u,y[11]=E*i+k*o+T*f+M*d,y[12]=F*t+I*s+D*h+C*m,y[13]=F*e+I*a+D*l+C*c,y[14]=F*r+I*n+D*p+C*u,y[15]=F*i+I*o+D*f+C*d,this._identityCalculated=!1,this}function y(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function g(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function v(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function P(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function b(t,e,r){return{x:t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}}function A(t,e,r){return t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12]}function S(t,e,r){return t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13]}function x(t,e,r){return t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]}function _(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,r=-this.props[1]/t,i=-this.props[4]/t,s=this.props[0]/t,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,n=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Matrix;return o.props[0]=e,o.props[1]=r,o.props[4]=i,o.props[5]=s,o.props[12]=a,o.props[13]=n,o}function E(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function k(t){var e,r=t.length,i=[];for(e=0;e<r;e+=1)i[e]=E(t[e]);return i}function T(t,e,r){var i=createTypedArray("float32",6);if(this.isIdentity())i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],i[4]=r[0],i[5]=r[1];else{var s=this.props[0],a=this.props[1],n=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];i[0]=t[0]*s+t[1]*n+h,i[1]=t[0]*a+t[1]*o+l,i[2]=e[0]*s+e[1]*n+h,i[3]=e[0]*a+e[1]*o+l,i[4]=r[0]*s+r[1]*n+h,i[5]=r[0]*a+r[1]*o+l}return i}function M(t,e,r){return this.isIdentity()?[t,e,r]:[t*this.props[0]+e*this.props[4]+r*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+r*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+r*this.props[10]+this.props[14]]}function F(t,e){if(this.isIdentity())return t+","+e;var r=this.props;return Math.round(100*(t*r[0]+e*r[4]+r[12]))/100+","+Math.round(100*(t*r[1]+e*r[5]+r[13]))/100}function I(){for(var t=0,e=this.props,r="matrix3d(";t<16;)r+=i(1e4*e[t])/1e4,r+=15===t?")":",",t+=1;return r}function D(t){return t<1e-6&&0<t||-1e-6<t&&t<0?i(1e4*t)/1e4:t}function C(){var t=this.props;return"matrix("+D(t[0])+","+D(t[1])+","+D(t[4])+","+D(t[5])+","+D(t[12])+","+D(t[13])+")"}return function(){this.reset=t,this.rotate=e,this.rotateX=r,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=c,this.translate=u,this.transform=d,this.applyToPoint=b,this.applyToX=A,this.applyToY=S,this.applyToZ=x,this.applyToPointArray=M,this.applyToTriplePoints=T,this.applyToPointStringified=F,this.toCSS=I,this.to2dCSS=C,this.clone=v,this.cloneFromProps=P,this.equals=g,this.inversePoints=k,this.inversePoint=E,this.getInverseMatrix=_,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(o,h){var l,p=this,f=256,m=6,c="random",u=h.pow(f,m),d=h.pow(2,52),y=2*d,g=f-1;function v(t){var e,r=t.length,n=this,i=0,s=n.i=n.j=0,a=n.S=[];for(r||(t=[r++]);i<f;)a[i]=i++;for(i=0;i<f;i++)a[i]=a[s=g&s+t[i%r]+(e=a[i])],a[s]=e;n.g=function(t){for(var e,r=0,i=n.i,s=n.j,a=n.S;t--;)e=a[i=g&i+1],r=r*f+a[g&(a[i]=a[s=g&s+e])+(a[s]=e)];return n.i=i,n.j=s,r}}function P(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function b(t,e){for(var r,i=t+"",s=0;s<i.length;)e[g&s]=g&(r^=19*e[g&s])+i.charCodeAt(s++);return A(e)}function A(t){return String.fromCharCode.apply(0,t)}h["seed"+c]=function(t,e,r){var i=[],s=b(function t(e,r){var i,s=[],a=typeof e;if(r&&"object"==a)for(i in e)try{s.push(t(e[i],r-1))}catch(t){}return s.length?s:"string"==a?e:e+"\0"}((e=!0===e?{entropy:!0}:e||{}).entropy?[t,A(o)]:null===t?function(){try{if(l)return A(l.randomBytes(f));var t=new Uint8Array(f);return(p.crypto||p.msCrypto).getRandomValues(t),A(t)}catch(t){var e=p.navigator,r=e&&e.plugins;return[+new Date,p,r,p.screen,A(o)]}}():t,3),i),a=new v(i),n=function(){for(var t=a.g(m),e=u,r=0;t<d;)t=(t+r)*f,e*=f,r=a.g(1);for(;y<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,b(A(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&P(i,a),t.state=function(){return P(a,{})}),r?(h[c]=t,e):t})(n,s,"global"in e?e.global:this==h,e.state)},b(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||("bez_"+t+"_"+e+"_"+r+"_"+i).replace(/\./g,"p");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var l=11,p=1/(l-1),e="function"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function f(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function m(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(l):new Array(l),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:f(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;r<l;++r)this._mSampleValues[r]=f(r*p,t,e)},_getTForX:function(t){for(var e=this._p[0],r=this._p[2],i=this._mSampleValues,s=0,a=1,n=l-1;a!==n&&i[a]<=t;++a)s+=p;var o=s+(t-i[--a])/(i[a+1]-i[a])*p,h=m(o,e,r);return.001<=h?function(t,e,r,i){for(var s=0;s<4;++s){var a=m(e,r,i);if(0===a)return e;e-=(f(e,r,i)-t)/a}return e}(t,o,e,r):0===h?o:function(t,e,r,i,s){for(var a,n,o=0;0<(a=f(n=e+(r-e)/2,i,s)-t)?r=n:e=n,1e-7<Math.abs(a)&&++o<10;);return n}(t,s,s+p,e,r)}},t}();function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r<s;r+=1)for(var a in i=t[r].prototype)Object.prototype.hasOwnProperty.call(i,a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}function bezFunction(){var F=Math;function y(t,e,r,i,s,a){var n=t*i+e*s+r*a-s*i-a*t-r*e;return-.001<n&&n<.001}var p=function(t,e,r,i){var s,a,n,o,h,l,p=defaultCurveSegments,f=0,m=[],c=[],u=bezierLengthPool.newElement();for(n=r.length,s=0;s<p;s+=1){for(h=s/(p-1),a=l=0;a<n;a+=1)o=bmPow(1-h,3)*t[a]+3*bmPow(1-h,2)*h*r[a]+3*(1-h)*bmPow(h,2)*i[a]+bmPow(h,3)*e[a],m[a]=o,null!==c[a]&&(l+=bmPow(m[a]-c[a],2)),c[a]=m[a];l&&(f+=l=bmSqrt(l)),u.percents[s]=h,u.lengths[s]=f}return u.addedLength=f,u};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}var P,t=(P={},function(t,e,r,i){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+i[0]+"_"+i[1]).replace(/\./g,"p");if(!P[s]){var a,n,o,h,l,p,f,m=defaultCurveSegments,c=0,u=null;2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&y(t[0],t[1],e[0],e[1],t[0]+r[0],t[1]+r[1])&&y(t[0],t[1],e[0],e[1],e[0]+i[0],e[1]+i[1])&&(m=2);var d=new g(m);for(o=r.length,a=0;a<m;a+=1){for(f=createSizedArray(o),l=a/(m-1),n=p=0;n<o;n+=1)h=bmPow(1-l,3)*t[n]+3*bmPow(1-l,2)*l*(t[n]+r[n])+3*(1-l)*bmPow(l,2)*(e[n]+i[n])+bmPow(l,3)*e[n],f[n]=h,null!==u&&(p+=bmPow(f[n]-u[n],2));c+=p=bmSqrt(p),d.points[a]=new v(p,f),u=f}d.segmentLength=c,P[s]=d}return P[s]});function I(t,e){var r=e.percents,i=e.lengths,s=r.length,a=bmFloor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===i[a])return r[a];for(var h=i[a]>n?-1:1,l=!0;l;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),l=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];l=!1}return r[a]+(r[a+1]-r[a])*o}var D=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segmentsLengthPool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,l=0;for(e=0;e<o-1;e+=1)h[e]=p(s[e],s[e+1],a[e],n[e+1]),l+=h[e].addedLength;return i&&o&&(h[e]=p(s[e],s[0],a[e],n[0]),l+=h[e].addedLength),r.totalLength=l,r},getNewSegment:function(t,e,r,i,s,a,n){s<0?s=0:1<s&&(s=1);var o,h=I(s,n),l=I(a=1<a?1:a,n),p=t.length,f=1-h,m=1-l,c=f*f*f,u=h*f*f*3,d=h*h*f*3,y=h*h*h,g=f*f*m,v=h*f*m+f*h*m+f*f*l,P=h*h*m+f*h*l+h*f*l,b=h*h*l,A=f*m*m,S=h*m*m+f*l*m+f*m*l,x=h*l*m+f*l*l+h*m*l,_=h*l*l,E=m*m*m,k=l*m*m+m*l*m+m*m*l,T=l*l*m+m*l*l+l*m*l,M=l*l*l;for(o=0;o<p;o+=1)D[4*o]=F.round(1e3*(c*t[o]+u*r[o]+d*i[o]+y*e[o]))/1e3,D[4*o+1]=F.round(1e3*(g*t[o]+v*r[o]+P*i[o]+b*e[o]))/1e3,D[4*o+2]=F.round(1e3*(A*t[o]+S*r[o]+x*i[o]+_*e[o]))/1e3,D[4*o+3]=F.round(1e3*(E*t[o]+k*r[o]+T*i[o]+M*e[o]))/1e3;return D},getPointInSegment:function(t,e,r,i,s,a){var n=I(s,a),o=1-n;return[F.round(1e3*(o*o*o*t[0]+(n*o*o+o*n*o+o*o*n)*r[0]+(n*n*o+o*n*n+n*o*n)*i[0]+n*n*n*e[0]))/1e3,F.round(1e3*(o*o*o*t[1]+(n*o*o+o*n*o+o*o*n)*r[1]+(n*n*o+o*n*n+n*o*n)*i[1]+n*n*n*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,r,i,s,a,n,o,h){if(0===r&&0===a&&0===h)return y(t,e,i,s,n,o);var l,p=F.sqrt(F.pow(i-t,2)+F.pow(s-e,2)+F.pow(a-r,2)),f=F.sqrt(F.pow(n-t,2)+F.pow(o-e,2)+F.pow(h-r,2)),m=F.sqrt(F.pow(n-i,2)+F.pow(o-s,2)+F.pow(h-a,2));return-1e-4<(l=f<p?m<p?p-f-m:m-f-p:f<m?m-f-p:f-p-m)&&l<1e-4}}}!function(){for(var s=0,t=["ms","moz","webkit","o"],e=0;e<t.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[t[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[e]+"CancelAnimationFrame"]||window[t[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var e=(new Date).getTime(),r=Math.max(0,16-(e-s)),i=setTimeout(function(){t(e+r)},r);return s=e+r,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction();function dataFunctionManager(){function f(t,e,r){var i,s,a,n,o,h,l=t.length;for(s=0;s<l;s+=1)if("ks"in(i=t[s])&&!i.completed){if(i.completed=!0,i.tt&&(t[s-1].td=i.tt),i.hasMask){var p=i.masksProperties;for(n=p.length,a=0;a<n;a+=1)if(p[a].pt.k.i)u(p[a].pt.k);else for(h=p[a].pt.k.length,o=0;o<h;o+=1)p[a].pt.k[o].s&&u(p[a].pt.k[o].s[0]),p[a].pt.k[o].e&&u(p[a].pt.k[o].e[0])}0===i.ty?(i.layers=m(i.refId,e),f(i.layers,e,r)):4===i.ty?c(i.shapes):5===i.ty&&d(i)}}function m(t,e){for(var r=0,i=e.length;r<i;){if(e[r].id===t)return e[r].layers.__used?JSON.parse(JSON.stringify(e[r].layers)):(e[r].layers.__used=!0,e[r].layers);r+=1}return null}function c(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)u(t[e].ks.k);else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&u(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&u(t[e].ks.k[r].e[0]);else"gr"===t[e].ty&&c(t[e].it)}function u(t){var e,r=t.i.length;for(e=0;e<r;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function o(t,e){var r=e?e.split("."):[100,100,100];return t[0]>r[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&null))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)5===t[e].ty&&(r=t[e],void 0,i=r.t.d,r.t.d={k:[{s:i,t:0}]})}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),i=(h=[4,7,99],function(t){if(t.chars&&!o(h,t.v)){var e,r,i,s,a,n=t.chars.length;for(e=0;e<n;e+=1)if(t.chars[e].data&&t.chars[e].data.shapes)for(i=(a=t.chars[e].data.shapes[0].it).length,r=0;r<i;r+=1)(s=a[r].ks.k).__converted||(u(a[r].ks.k),s.__converted=!0)}}),s=function(){var i=[4,1,9];function a(t){var e,r,i,s=t.length;for(e=0;e<s;e+=1)if("gr"===t[e].ty)a(t[e].it);else if("fl"===t[e].ty||"st"===t[e].ty)if(t[e].c.k&&t[e].c.k[0].i)for(i=t[e].c.k.length,r=0;r<i;r+=1)t[e].c.k[r].s&&(t[e].c.k[r].s[0]/=255,t[e].c.k[r].s[1]/=255,t[e].c.k[r].s[2]/=255,t[e].c.k[r].s[3]/=255),t[e].c.k[r].e&&(t[e].c.k[r].e[0]/=255,t[e].c.k[r].e[1]/=255,t[e].c.k[r].e[2]/=255,t[e].c.k[r].e[3]/=255);else t[e].c.k[0]/=255,t[e].c.k[1]/=255,t[e].c.k[2]/=255,t[e].c.k[3]/=255}function s(t){var e,r=t.length;for(e=0;e<r;e+=1)4===t[e].ty&&a(t[e].shapes)}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}(),a=function(){var i=[4,4,18];function l(t){var e,r,i;for(e=t.length-1;0<=e;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)t[e].ks.k.c=t[e].closed;else for(i=t[e].ks.k.length,r=0;r<i;r+=1)t[e].ks.k[r].s&&(t[e].ks.k[r].s[0].c=t[e].closed),t[e].ks.k[r].e&&(t[e].ks.k[r].e[0].c=t[e].closed);else"gr"===t[e].ty&&l(t[e].it)}function s(t){var e,r,i,s,a,n,o=t.length;for(r=0;r<o;r+=1){if((e=t[r]).hasMask){var h=e.masksProperties;for(s=h.length,i=0;i<s;i+=1)if(h[i].pt.k.i)h[i].pt.k.c=h[i].cl;else for(n=h[i].pt.k.length,a=0;a<n;a+=1)h[i].pt.k[a].s&&(h[i].pt.k[a].s[0].c=h[i].cl),h[i].pt.k[a].e&&(h[i].pt.k[a].e[0].c=h[i].cl)}4===e.ty&&l(e.shapes)}}return function(t){if(o(i,t.v)&&(s(t.layers),t.assets)){var e,r=t.assets.length;for(e=0;e<r;e+=1)t.assets[e].layers&&s(t.assets[e].layers)}}}();function d(t){0!==t.t.a.length||"m"in t.t.p||(t.singleShape=!0)}var t={completeData:function(t,e){t.__complete||(s(t),r(t),i(t),a(t),f(t.layers,t.assets,e),t.__complete=!0)}};return t.checkColors=s,t.checkChars=i,t.checkShapes=a,t.completeLayers=f,t}var dataManager=dataFunctionManager();function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],r="normal",i="normal",s=e.length,a=0;a<s;a+=1)switch(e[a].toLowerCase()){case"italic":i="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:i,weight:t.fWeight||r}}var FontManager=function(){var a={w:0,size:0,shapes:[]},t=[];function m(t,e){var r=createTag("span");r.style.fontFamily=e;var i=createTag("span");i.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(i),document.body.appendChild(r);var s=i.offsetWidth;return i.style.fontFamily=function(t){var e,r=t.split(","),i=r.length,s=[];for(e=0;e<i;e+=1)"sans-serif"!==r[e]&&"monospace"!==r[e]&&s.push(r[e]);return s.join(",")}(t)+", "+e,{node:i,w:s,parent:r}}function c(t,e){var r=createNS("text");r.style.fontSize="100px";var i=getFontProperties(e);return r.setAttribute("font-family",e.fFamily),r.setAttribute("font-style",i.style),r.setAttribute("font-weight",i.weight),r.textContent="1",e.fClass?(r.style.fontFamily="inherit",r.setAttribute("class",e.fClass)):r.style.fontFamily=e.fFamily,t.appendChild(r),createTag("canvas").getContext("2d").font=e.fWeight+" "+e.fStyle+" 100px "+e.fFamily,r}t=t.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]);var e=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return e.getCombinedCharacterCodes=function(){return t},e.prototype={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var r,i,s=t.length,a=this.chars.length;for(e=0;e<s;e+=1){for(r=0,i=!1;r<a;)this.chars[r].style===t[e].style&&this.chars[r].fFamily===t[e].fFamily&&this.chars[r].ch===t[e].ch&&(i=!0),r+=1;i||(this.chars.push(t[e]),a+=1)}}},addFonts:function(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);var r,i=t.list,s=i.length,a=s;for(r=0;r<s;r+=1){var n,o,h=!0;if(i[r].loaded=!1,i[r].monoCase=m(i[r].fFamily,"monospace"),i[r].sansCase=m(i[r].fFamily,"sans-serif"),i[r].fPath){if("p"===i[r].fOrigin||3===i[r].origin){if(0<(n=document.querySelectorAll('style[f-forigin="p"][f-family="'+i[r].fFamily+'"], style[f-origin="3"][f-family="'+i[r].fFamily+'"]')).length&&(h=!1),h){var l=createTag("style");l.setAttribute("f-forigin",i[r].fOrigin),l.setAttribute("f-origin",i[r].origin),l.setAttribute("f-family",i[r].fFamily),l.type="text/css",l.innerText="@font-face {font-family: "+i[r].fFamily+"; font-style: normal; src: url('"+i[r].fPath+"');}",e.appendChild(l)}}else if("g"===i[r].fOrigin||1===i[r].origin){for(n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),o=0;o<n.length;o+=1)-1!==n[o].href.indexOf(i[r].fPath)&&(h=!1);if(h){var p=createTag("link");p.setAttribute("f-forigin",i[r].fOrigin),p.setAttribute("f-origin",i[r].origin),p.type="text/css",p.rel="stylesheet",p.href=i[r].fPath,document.body.appendChild(p)}}else if("t"===i[r].fOrigin||2===i[r].origin){for(n=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),o=0;o<n.length;o+=1)i[r].fPath===n[o].src&&(h=!1);if(h){var f=createTag("link");f.setAttribute("f-forigin",i[r].fOrigin),f.setAttribute("f-origin",i[r].origin),f.setAttribute("rel","stylesheet"),f.setAttribute("href",i[r].fPath),e.appendChild(f)}}}else i[r].loaded=!0,a-=1;i[r].helper=c(e,i[r]),i[r].cache={},this.fonts.push(i[r])}0===a?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,e,r){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===r)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,e,r)),a},getFontByName:function(t){for(var e=0,r=this.fonts.length;e<r;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]},measureText:function(t,e,r){var i=this.getFontByName(e),s=t.charCodeAt(0);if(!i.cache[s+1]){var a=i.helper;if(" "===t){a.textContent="|"+t+"|";var n=a.getComputedTextLength();a.textContent="||";var o=a.getComputedTextLength();i.cache[s+1]=(n-o)/100}else a.textContent=t,i.cache[s+1]=a.getComputedTextLength()/100}return i.cache[s+1]*r},checkLoadedFonts:function(){var t,e,r,i=this.fonts.length,s=i;for(t=0;t<i;t+=1)this.fonts[t].loaded?s-=1:"n"===this.fonts[t].fOrigin||0===this.fonts[t].origin?this.fonts[t].loaded=!0:(e=this.fonts[t].monoCase.node,r=this.fonts[t].monoCase.w,e.offsetWidth!==r?(s-=1,this.fonts[t].loaded=!0):(e=this.fonts[t].sansCase.node,r=this.fonts[t].sansCase.w,e.offsetWidth!==r&&(s-=1,this.fonts[t].loaded=!0)),this.fonts[t].loaded&&(this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent),this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));0!==s&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}},e}(),PropertyFactory=function(){var f=initialDefaultFrame,s=Math.abs;function m(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,l,p,f,m=e.lastIndex,c=m,u=this.keyframes.length-1,d=!0;d;){if(s=this.keyframes[c],a=this.keyframes[c+1],c===u-1&&t>=a.t-i){s.h&&(s=a),m=0;break}if(a.t-i>t){m=c;break}c<u-1?c+=1:(m=0,d=!1)}var y,g,v,P,b,A,S,x,_,E,k=a.t-i,T=s.t-i;if(s.to){s.bezierData||(s.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var M=s.bezierData;if(k<=t||t<T){var F=k<=t?M.points.length-1:0;for(o=M.points[F].point.length,n=0;n<o;n+=1)r[n]=M.points[F].point[n]}else{s.__fnct?f=s.__fnct:(f=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,s.__fnct=f),h=f((t-T)/(k-T));var I,D=M.segmentLength*h,C=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===c?e._lastPoint:0,d=!0,l=M.points.length;d;){if(C+=M.points[p].partialLength,0===D||0===h||p===M.points.length-1){for(o=M.points[p].point.length,n=0;n<o;n+=1)r[n]=M.points[p].point[n];break}if(C<=D&&D<C+M.points[p+1].partialLength){for(I=(D-C)/M.points[p+1].partialLength,o=M.points[p].point.length,n=0;n<o;n+=1)r[n]=M.points[p].point[n]+(M.points[p+1].point[n]-M.points[p].point[n])*I;break}p<l-1?p+=1:d=!1}e._lastPoint=p,e._lastAddedLength=C-M.points[p].partialLength,e._lastKeyframeIndex=c}}else{var w,V,R,L,G;if(u=s.s.length,y=a.s||s.e,this.sh&&1!==s.h)if(k<=t)r[0]=y[0],r[1]=y[1],r[2]=y[2];else if(t<=T)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var B=z(s.s),N=z(y);g=r,v=function(t,e,r){var i,s,a,n,o,h=[],l=t[0],p=t[1],f=t[2],m=t[3],c=e[0],u=e[1],d=e[2],y=e[3];(s=l*c+p*u+f*d+m*y)<0&&(s=-s,c=-c,u=-u,d=-d,y=-y);o=1e-6<1-s?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,Math.sin(r*i)/a):(n=1-r,r);return h[0]=n*l+o*c,h[1]=n*p+o*u,h[2]=n*f+o*d,h[3]=n*m+o*y,h}(B,N,(t-T)/(k-T)),P=v[0],b=v[1],A=v[2],S=v[3],x=Math.atan2(2*b*S-2*P*A,1-2*b*b-2*A*A),_=Math.asin(2*P*b+2*A*S),E=Math.atan2(2*P*S-2*b*A,1-2*P*P-2*A*A),g[0]=x/degToRads,g[1]=_/degToRads,g[2]=E/degToRads}else for(c=0;c<u;c+=1)1!==s.h&&(h=k<=t?1:t<T?0:(s.o.x.constructor===Array?(s.__fnct||(s.__fnct=[]),s.__fnct[c]?f=s.__fnct[c]:(w=void 0===s.o.x[c]?s.o.x[0]:s.o.x[c],V=void 0===s.o.y[c]?s.o.y[0]:s.o.y[c],R=void 0===s.i.x[c]?s.i.x[0]:s.i.x[c],L=void 0===s.i.y[c]?s.i.y[0]:s.i.y[c],f=BezierFactory.getBezierEasing(w,V,R,L).get,s.__fnct[c]=f)):s.__fnct?f=s.__fnct:(w=s.o.x,V=s.o.y,R=s.i.x,L=s.i.y,f=BezierFactory.getBezierEasing(w,V,R,L).get,s.__fnct=f),f((t-T)/(k-T)))),y=a.s||s.e,G=1===s.h?s.s[c]:s.s[c]+(y[c]-s.s[c])*h,"multidimensional"===this.propType?r[c]=G:r=G}return e.lastIndex=m,r}function z(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),h=Math.sin(r/2),l=Math.sin(i/2);return[o*h*n+s*a*l,o*a*n+s*h*l,s*h*n-o*a*l,s*a*n-o*h*l]}function c(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==f&&(this._caching.lastFrame>=r&&r<=t||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function u(t){var e;if("unidimensional"===this.propType)e=t*this.mult,1e-5<s(this.v-e)&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r<i;)e=t[r]*this.mult,1e-5<s(this.v[r]-e)&&(this.v[r]=e,this._mdf=!0),r+=1}function d(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function y(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function n(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=d,this.setVValue=u,this.addEffect=y}function o(t,e,r,i){var s;this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=d,this.setVValue=u,this.addEffect=y}function h(t,e,r,i){this.propType="unidimensional",this.keyframes=e.k,this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:f,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.v=f,this.pv=f,this._isFirstFrame=!0,this.getValue=d,this.setVValue=u,this.interpolateValue=m,this.effectsSequence=[c.bind(this)],this.addEffect=y}function l(t,e,r,i){var s;this.propType="multidimensional";var a,n,o,h,l=e.k.length;for(s=0;s<l-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(a=e.k[s].s,n=e.k[s+1].s,o=e.k[s].to,h=e.k[s].ti,(2===a.length&&(a[0]!==n[0]||a[1]!==n[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&bez.pointOnLine2D(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===a.length&&(a[0]!==n[0]||a[1]!==n[1]||a[2]!==n[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],a[0]+o[0],a[1]+o[1],a[2]+o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[s].to=null,e.k[s].ti=null),a[0]===n[0]&&a[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===a.length||a[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[c.bind(this)],this.data=e,this.keyframes=e.k,this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=t,this.container=i,this.comp=t.comp,this.getValue=d,this.setVValue=u,this.interpolateValue=m,this.frameId=-1;var p=e.k[0].s.length;for(this.v=createTypedArray("float32",p),this.pv=createTypedArray("float32",p),s=0;s<p;s+=1)this.v[s]=f,this.pv[s]=f;this._caching={lastFrame:f,lastIndex:0,value:createTypedArray("float32",p)},this.addEffect=y}return{getProp:function(t,e,r,i,s){var a;if(e.k.length)if("number"==typeof e.k[0])a=new o(t,e,i,s);else switch(r){case 0:a=new h(t,e,i,s);break;case 1:a=new l(t,e,i,s)}else a=new n(t,e,i,s);return a.effectsSequence.length&&s.addDynamicProperty(a),a}}}(),TransformPropertyFactory=function(){var n=[0,0];function i(t,e,r){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var i,s=e.or.k.length;for(i=0;i<s;i+=1)e.or.k[i].to=null,e.or.k[i].ti=null}this.or=PropertyFactory.getProp(t,e.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(t,e.r||{k:0},0,degToRads,this);e.sk&&(this.sk=PropertyFactory.getProp(t,e.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(t,e.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=PropertyFactory.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return i.prototype={applyToMatrix:function(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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]),this.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var e;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&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]),this.autoOriented){var r,i;if(e=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)i=this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(r=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/e,0),this.p.getValueAtTime(this.p.keyframes[0].t/e,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/e,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/e,0)):(r=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/e,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(r[0]=s.getValueAtTime((s.keyframes[0].t+.01)/e,0),r[1]=a.getValueAtTime((a.keyframes[0].t+.01)/e,0),i[0]=s.getValueAtTime(s.keyframes[0].t/e,0),i[1]=a.getValueAtTime(a.keyframes[0].t/e,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(r[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/e,0),r[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/e,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/e,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/e,0)):(r=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/e,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/e,a.offsetTime))}else r=i=n;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(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]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r<e;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(t,e,r,i,s){var a;switch(this._length=Math.max(this._length,i+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[i]||a[i]&&!s)&&(a[i]=pointPool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a<o;a+=1)t.setTripleAt(e[n][0],e[n][1],i[n][0],i[n][1],r[n][0],r[n][1],a,!1),n-=1;return t};var ShapePropertyFactory=function(){var s=-999999;function t(t,e,r){var i,s,a,n,o,h,l,p,f,m=r.lastIndex,c=this.keyframes;if(t<c[0].t-this.offsetTime)i=c[0].s[0],a=!0,m=0;else if(t>=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var u,d,y=m,g=c.length-1,v=!0;v&&(u=c[y],!((d=c[y+1]).t-this.offsetTime>t));)y<g-1?y+=1:v=!1;if(m=y,!(a=1===u.h)){if(t>=d.t-this.offsetTime)p=1;else if(t<u.t-this.offsetTime)p=0;else{var P;u.__fnct?P=u.__fnct:(P=BezierFactory.getBezierEasing(u.o.x,u.o.y,u.i.x,u.i.y).get,u.__fnct=P),p=P((t-(u.t-this.offsetTime))/(d.t-this.offsetTime-(u.t-this.offsetTime)))}s=d.s?d.s[0]:u.e[0]}i=u.s[0]}for(h=e._length,l=i.i[0].length,r.lastIndex=m,n=0;n<h;n+=1)for(o=0;o<l;o+=1)f=a?i.i[n][o]:i.i[n][o]+(s.i[n][o]-i.i[n][o])*p,e.i[n][o]=f,f=a?i.o[n][o]:i.o[n][o]+(s.o[n][o]-i.o[n][o])*p,e.o[n][o]=f,f=a?i.v[n][o]:i.v[n][o]+(s.v[n][o]-i.v[n][o])*p,e.v[n][o]=f}function a(){this.paths=this.localShapeCollection}function e(t){(function(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var r,i=t._length;for(r=0;r<i;r+=1)if(t.v[r][0]!==e.v[r][0]||t.v[r][1]!==e.v[r][1]||t.o[r][0]!==e.o[r][0]||t.o[r][1]!==e.o[r][1]||t.i[r][0]!==e.i[r][0]||t.i[r][1]!==e.i[r][1])return!1;return!0})(this.v,t)||(this.v=shapePool.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function r(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(e=0;e<r;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function n(t,e,r){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?e.pt.k:e.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=a,this.effectsSequence=[]}function i(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function o(t,e,r){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===r?e.pt.k:e.ks.k,this.k=!0,this.kf=!0;var i=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=s,this.reset=a,this._caching={lastFrame:s,lastIndex:0},this.effectsSequence=[function(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==s&&(i<e&&t<e||r<i&&r<t)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}.bind(this)]}n.prototype.interpolateShape=t,n.prototype.getValue=r,n.prototype.setVValue=e,n.prototype.addEffect=i,o.prototype.getValue=r,o.prototype.interpolateShape=t,o.prototype.setVValue=e,o.prototype.addEffect=i;var h=function(){var n=roundCorner;function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=e-i,a.v[1][0]=s?t+r:t-r,a.v[1][1]=e,a.v[2][0]=t,a.v[2][1]=e+i,a.v[3][0]=s?t-r:t+r,a.v[3][1]=e,a.i[0][0]=s?t-r*n:t+r*n,a.i[0][1]=e-i,a.i[1][0]=s?t+r:t-r,a.i[1][1]=e-i*n,a.i[2][0]=s?t+r*n:t-r*n,a.i[2][1]=e+i,a.i[3][0]=s?t-r:t+r,a.i[3][1]=e+i*n,a.o[0][0]=s?t+r*n:t-r*n,a.o[0][1]=e-i,a.o[1][0]=s?t+r:t-r,a.o[1][1]=e+i*n,a.o[2][0]=s?t-r*n:t+r*n,a.o[2][1]=e+i,a.o[3][0]=s?t-r:t+r,a.o[3][1]=e-i*n}},extendPrototype([DynamicPropertyContainer],t),t}(),l=function(){function t(t,e){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=PropertyFactory.getProp(t,e.ir,0,0,this),this.is=PropertyFactory.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(t,e.pt,0,0,this),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,degToRads,this),this.or=PropertyFactory.getProp(t,e.or,0,0,this),this.os=PropertyFactory.getProp(t,e.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:a,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,r,i,s=2*Math.floor(this.pt.v),a=2*Math.PI/s,n=!0,o=this.or.v,h=this.ir.v,l=this.os.v,p=this.is.v,f=2*Math.PI*o/(2*s),m=2*Math.PI*h/(2*s),c=-Math.PI/2;c+=this.r.v;var u=3===this.data.d?-1:1;for(t=this.v._length=0;t<s;t+=1){r=n?l:p,i=n?f:m;var d=(e=n?o:h)*Math.cos(c),y=e*Math.sin(c),g=0===d&&0===y?0:y/Math.sqrt(d*d+y*y),v=0===d&&0===y?0:-d/Math.sqrt(d*d+y*y);d+=+this.p.v[0],y+=+this.p.v[1],this.v.setTripleAt(d,y,d-g*i*r*u,y-v*i*r*u,d+g*i*r*u,y+v*i*r*u,t,!0),n=!n,c+=a*u}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),r=2*Math.PI/e,i=this.or.v,s=this.os.v,a=2*Math.PI*i/(4*e),n=.5*-Math.PI,o=3===this.data.d?-1:1;for(n+=this.r.v,t=this.v._length=0;t<e;t+=1){var h=i*Math.cos(n),l=i*Math.sin(n),p=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),f=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-p*a*s*o,l-f*a*s*o,h+p*a*s*o,l+f*a*s*o,t,!0),n+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],t),t}(),p=function(){function t(t,e){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=PropertyFactory.getProp(t,e.p,1,0,this),this.s=PropertyFactory.getProp(t,e.s,1,0,this),this.r=PropertyFactory.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],r=this.s.v[0]/2,i=this.s.v[1]/2,s=bmMin(r,i,this.r.v),a=s*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+s,t+r,e-i+a,0,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-a,t+r,e+i-s,1,!0),0!==s?(this.v.setTripleAt(t+r-s,e+i,t+r-s,e+i,t+r-a,e+i,2,!0),this.v.setTripleAt(t-r+s,e+i,t-r+a,e+i,t-r+s,e+i,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-s,t-r,e+i-a,4,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+a,t-r,e-i+s,5,!0),this.v.setTripleAt(t-r+s,e-i,t-r+s,e-i,t-r+a,e-i,6,!0),this.v.setTripleAt(t+r-s,e-i,t+r-a,e-i,t+r-s,e-i,7,!0)):(this.v.setTripleAt(t-r,e+i,t-r+a,e+i,t-r,e+i,2),this.v.setTripleAt(t-r,e-i,t-r,e-i+a,t-r,e-i,3))):(this.v.setTripleAt(t+r,e-i+s,t+r,e-i+a,t+r,e-i+s,0,!0),0!==s?(this.v.setTripleAt(t+r-s,e-i,t+r-s,e-i,t+r-a,e-i,1,!0),this.v.setTripleAt(t-r+s,e-i,t-r+a,e-i,t-r+s,e-i,2,!0),this.v.setTripleAt(t-r,e-i+s,t-r,e-i+s,t-r,e-i+a,3,!0),this.v.setTripleAt(t-r,e+i-s,t-r,e+i-a,t-r,e+i-s,4,!0),this.v.setTripleAt(t-r+s,e+i,t-r+s,e+i,t-r+a,e+i,5,!0),this.v.setTripleAt(t+r-s,e+i,t+r-a,e+i,t+r-s,e+i,6,!0),this.v.setTripleAt(t+r,e+i-s,t+r,e+i-s,t+r,e+i-a,7,!0)):(this.v.setTripleAt(t-r,e-i,t-r+a,e-i,t-r,e-i,1,!0),this.v.setTripleAt(t-r,e+i,t-r,e+i-a,t-r,e+i,2,!0),this.v.setTripleAt(t+r,e+i,t+r-a,e+i,t+r,e+i,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:a},extendPrototype([DynamicPropertyContainer],t),t}();var f={getShapeProp:function(t,e,r){var i;return 3===r||4===r?i=(3===r?e.pt:e.ks).k.length?new o(t,e,r):new n(t,e,r):5===r?i=new p(t,e):6===r?i=new h(t,e):7===r&&(i=new l(t,e)),i.k&&t.addDynamicProperty(i),i},getConstructorFunction:function(){return n},getKeyframedConstructorFunction:function(){return o}};return f}(),ShapeModifiers=(Yr={},Zr={},Yr.registerModifier=function(t,e){Zr[t]||(Zr[t]=e)},Yr.getModifier=function(t,e,r){return new Zr[t](e,r)},Yr),Yr,Zr;function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function PuckerAndBloatModifier(){}function RepeaterModifier(){}function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}function DashProperty(t,e,r,i){var s;this.elem=t,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(i);var a,n=e.length||0;for(s=0;s<n;s+=1)a=PropertyFactory.getProp(t,e[s].v,0,0,this),this.k=a.k||this.k,this.dataProps[s]={n:e[s].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function GradientProperty(t,e,r){this.data=e,this.c=createTypedArray("uint8c",4*e.p);var i=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=createTypedArray("float32",i),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=i,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(t,e,r,i,s){var a=[];e<=1?a.push({s:t,e:e}):1<=t?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;n<l;n+=1){var p,f;if(!((o=a[n]).e*s<i||o.s*s>i+r))p=o.s*s<=i?0:(o.s*s-i)/r,f=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([p,f])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e<r;e+=1)segmentsLengthPool.release(t[e]);return t.length=0,t},TrimModifier.prototype.processShapes=function(t){var e,r,i,s;if(this._mdf||t){var a=this.o.v%360/360;if(a<0&&(a+=1),e=1<this.s.v?1+a:this.s.v<0?0+a:this.s.v+a,(r=1<this.e.v?1+a:this.e.v<0?0+a:this.e.v+a)<e){var n=e;e=r,r=n}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var o,h,l,p,f,m=this.shapes.length,c=0;if(r===e)for(s=0;s<m;s+=1)this.shapes[s].localShapeCollection.releaseShapes(),this.shapes[s].shape._mdf=!0,this.shapes[s].shape.paths=this.shapes[s].localShapeCollection,this._mdf&&(this.shapes[s].pathsData.length=0);else if(1===r&&0===e||0===r&&1===e){if(this._mdf)for(s=0;s<m;s+=1)this.shapes[s].pathsData.length=0,this.shapes[s].shape._mdf=!0}else{var u,d,y=[];for(s=0;s<m;s+=1)if((u=this.shapes[s]).shape._mdf||this._mdf||t||2===this.m){if(h=(i=u.shape.paths)._length,f=0,!u.shape._mdf&&u.pathsData.length)f=u.totalShapeLength;else{for(l=this.releasePathsData(u.pathsData),o=0;o<h;o+=1)p=bez.getSegmentsLength(i.shapes[o]),l.push(p),f+=p.totalLength;u.totalShapeLength=f,u.pathsData=l}c+=f,u.shape._mdf=!0}else u.shape.paths=u.localShapeCollection;var g,v=e,P=r,b=0;for(s=m-1;0<=s;s-=1)if((u=this.shapes[s]).shape._mdf){for((d=u.localShapeCollection).releaseShapes(),2===this.m&&1<m?(g=this.calculateShapeEdges(e,r,u.totalShapeLength,b,c),b+=u.totalShapeLength):g=[[v,P]],h=g.length,o=0;o<h;o+=1){v=g[o][0],P=g[o][1],y.length=0,P<=1?y.push({s:u.totalShapeLength*v,e:u.totalShapeLength*P}):1<=v?y.push({s:u.totalShapeLength*(v-1),e:u.totalShapeLength*(P-1)}):(y.push({s:u.totalShapeLength*v,e:u.totalShapeLength}),y.push({s:0,e:u.totalShapeLength*(P-1)}));var A=this.addShapes(u,y[0]);if(y[0].s!==y[0].e){if(1<y.length)if(u.shape.paths.shapes[u.shape.paths._length-1].c){var S=A.pop();this.addPaths(A,d),A=this.addShapes(u,y[1],S)}else this.addPaths(A,d),A=this.addShapes(u,y[1]);this.addPaths(A,d)}}u.shape.paths=d}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)e.addShape(t[r])},TrimModifier.prototype.addSegment=function(t,e,r,i,s,a,n){s.setXYAt(e[0],e[1],"o",a),s.setXYAt(r[0],r[1],"i",a+1),n&&s.setXYAt(t[0],t[1],"v",a),s.setXYAt(i[0],i[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(t,e,r,i){e.setXYAt(t[1],t[5],"o",r),e.setXYAt(t[2],t[6],"i",r+1),i&&e.setXYAt(t[0],t[4],"v",r),e.setXYAt(t[3],t[7],"v",r+1)},TrimModifier.prototype.addShapes=function(t,e,r){var i,s,a,n,o,h,l,p,f=t.pathsData,m=t.shape.paths.shapes,c=t.shape.paths._length,u=0,d=[],y=!0;for(p=r?(o=r._length,r._length):(r=shapePool.newElement(),o=0),d.push(r),i=0;i<c;i+=1){for(h=f[i].lengths,r.c=m[i].c,a=m[i].c?h.length:h.length+1,s=1;s<a;s+=1)if(u+(n=h[s-1]).addedLength<e.s)u+=n.addedLength,r.c=!1;else{if(u>e.e){r.c=!1;break}e.s<=u&&e.e>=u+n.addedLength?(this.addSegment(m[i].v[s-1],m[i].o[s-1],m[i].i[s],m[i].v[s],r,o,y),y=!1):(l=bez.getNewSegment(m[i].v[s-1],m[i].v[s],m[i].o[s-1],m[i].i[s],(e.s-u)/n.addedLength,(e.e-u)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1),u+=n.addedLength,o+=1}if(m[i].c&&h.length){if(n=h[s-1],u<=e.e){var g=h[s-1].addedLength;e.s<=u&&e.e>=u+g?(this.addSegment(m[i].v[s-1],m[i].o[s-1],m[i].i[0],m[i].v[0],r,o,y),y=!1):(l=bez.getNewSegment(m[i].v[s-1],m[i].v[0],m[i].o[s-1],m[i].i[0],(e.s-u)/g,(e.e-u)/g,h[s-1]),this.addSegmentFromArray(l,r,o,y),y=!1,r.c=!1)}else r.c=!1;u+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[p][0],r.v[p][1],"i",p),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),u>e.e)break;i<c-1&&(r=shapePool.newElement(),y=!0,d.push(r),o=0)}return d},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(t,e){var r,i=shapePool.newElement();i.c=t.c;var s,a,n,o,h,l,p,f,m,c,u,d,y=t._length,g=0;for(r=0;r<y;r+=1)s=t.v[r],n=t.o[r],a=t.i[r],s[0]===n[0]&&s[1]===n[1]&&s[0]===a[0]&&s[1]===a[1]?0!==r&&r!==y-1||t.c?(o=0===r?t.v[y-1]:t.v[r-1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=u=s[0]+(o[0]-s[0])*l,f=d=s[1]-(s[1]-o[1])*l,m=p-(p-s[0])*roundCorner,c=f-(f-s[1])*roundCorner,i.setTripleAt(p,f,m,c,u,d,g),g+=1,o=r===y-1?t.v[0]:t.v[r+1],l=(h=Math.sqrt(Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)))?Math.min(h/2,e)/h:0,p=m=s[0]+(o[0]-s[0])*l,f=c=s[1]+(o[1]-s[1])*l,u=p-(p-s[0])*roundCorner,d=f-(f-s[1])*roundCorner,i.setTripleAt(p,f,m,c,u,d,g)):i.setTripleAt(s[0],s[1],n[0],n[1],a[0],a[1],g):i.setTripleAt(t.v[r][0],t.v[r][1],t.o[r][0],t.o[r][1],t.i[r][0],t.i[r][1],g),g+=1;return i},RoundCornersModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.rd.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(t,e){var r=e/100,i=[0,0],s=t._length,a=0;for(a=0;a<s;a+=1)i[0]+=t.v[a][0],i[1]+=t.v[a][1];i[0]/=s,i[1]/=s;var n,o,h,l,p,f,m=shapePool.newElement();for(m.c=t.c,a=0;a<s;a+=1)n=t.v[a][0]+(i[0]-t.v[a][0])*r,o=t.v[a][1]+(i[1]-t.v[a][1])*r,h=t.o[a][0]+(i[0]-t.o[a][0])*-r,l=t.o[a][1]+(i[1]-t.o[a][1])*-r,p=t.i[a][0]+(i[0]-t.i[a][0])*-r,f=t.i[a][1]+(i[1]-t.i[a][1])*-r,m.setTripleAt(n,o,h,l,p,f,a);return m},PuckerAndBloatModifier.prototype.processShapes=function(t){var e,r,i,s,a,n,o=this.shapes.length,h=this.amount.v;if(0!==h)for(r=0;r<o;r+=1){if(n=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||t)for(n.releaseShapes(),a.shape._mdf=!0,e=a.shape.paths.shapes,s=a.shape.paths._length,i=0;i<s;i+=1)n.addShape(this.processPath(e[i],h));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(t,e.c,0,null,this),this.o=PropertyFactory.getProp(t,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(t,e.tr,this),this.so=PropertyFactory.getProp(t,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(t,e,r,i,s,a){var n=a?-1:1,o=i.s.v[0]+(1-i.s.v[0])*(1-s),h=i.s.v[1]+(1-i.s.v[1])*(1-s);t.translate(i.p.v[0]*n*s,i.p.v[1]*n*s,i.p.v[2]),e.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),e.rotate(-i.r.v*n*s),e.translate(i.a.v[0],i.a.v[1],i.a.v[2]),r.translate(-i.a.v[0],-i.a.v[1],i.a.v[2]),r.scale(a?1/o:o,a?1/h:h),r.translate(i.a.v[0],i.a.v[1],i.a.v[2])},RepeaterModifier.prototype.init=function(t,e,r,i){for(this.elem=t,this.arr=e,this.pos=r,this.elemsData=i,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[r]);0<r;)r-=1,this._elements.unshift(e[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},RepeaterModifier.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(t,e){var r,i=t.length;for(r=0;r<i;r+=1)t[r]._render=e,"gr"===t[r].ty&&this.changeGroupRender(t[r].it,e)},RepeaterModifier.prototype.processShapes=function(t){var e,r,i,s,a;if(this._mdf||t){var n,o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var h={it:this.cloneElements(this._elements),ty:"gr"};h.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,h),this._groups.splice(0,0,h),this._currentCopies+=1}this.elem.reloadShapes()}for(i=a=0;i<=this._groups.length-1;i+=1)n=a<o,this._groups[i]._render=n,this.changeGroupRender(this._groups[i].it,n),a+=1;this._currentCopies=o;var l=this.o.v,p=l%1,f=0<l?Math.floor(l):Math.ceil(l),m=this.pMatrix.props,c=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var d,y,g=0;if(0<l){for(;g<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),g+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),g+=p)}else if(l<0){for(;f<g;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),g-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),g-=p)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(y=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==g){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),d=0;d<y;d+=1)r[d]=this.matrix.props[d];this.matrix.reset()}else for(this.matrix.reset(),d=0;d<y;d+=1)r[d]=this.matrix.props[d];g+=1,a-=1,i+=s}}else for(a=this._currentCopies,i=0,s=1;a;)r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,i+=s},RepeaterModifier.prototype.addShape=function(){},ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeCollection.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)shapePool.release(this.shapes[t]);this._length=0},DashProperty.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<r;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),GradientProperty.prototype.comparePoints=function(t,e){for(var r=0,i=this.o.length/2;r<i;){if(.01<Math.abs(t[4*r]-t[4*e+2*r]))return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,r,i,s=4*this.data.p;for(e=0;e<s;e+=1)r=e%4==0?100:255,i=Math.round(this.prop.v[e]*r),this.c[e]!==i&&(this.c[e]=i,this._cmdf=!t);if(this.o.length)for(s=this.prop.v.length,e=4*this.data.p;e<s;e+=1)r=e%2==0?100:1,i=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==i&&(this.o[e-4*this.data.p]=i,this._omdf=!t);this._mdf=!t}},extendPrototype([DynamicPropertyContainer],GradientProperty);var buildShapeString=function(t,e,r,i){if(0===e)return"";var s,a=t.o,n=t.i,o=t.v,h=" M"+i.applyToPointStringified(o[0][0],o[0][1]);for(s=1;s<e;s+=1)h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[s][0],n[s][1])+" "+i.applyToPointStringified(o[s][0],o[s][1]);return r&&e&&(h+=" C"+i.applyToPointStringified(a[s-1][0],a[s-1][1])+" "+i.applyToPointStringified(n[0][0],n[0][1])+" "+i.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},audioControllerFactory=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):Howl?new Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),ImagePreloader=function(){var s=function(){var t=createTag("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,r){var i="";if(t.e)i=t.p;else if(e){var s=t.p;-1!==s.indexOf("images/")&&(s=s.split("/")[1]),i=e+s}else i=r,i+=t.u?t.u:"",i+=t.p;return i}function e(){this._imageLoaded=t.bind(this),this.testImageLoaded=function(t){var e=0,r=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(r)),e+=1}.bind(this),50)}.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.loadedAssets=0,this.imagesLoadedCb=null,this.images=[]}return e.prototype={loadAssets:function(t,e){var r;this.imagesLoadedCb=e;var i=t.length;for(r=0;r<i;r+=1)t[r].layers||(this.totalImages+=1,this.images.push(this._createImageData(t[r])))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loaded:function(){return this.totalImages===this.loadedAssets},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getImage:function(t){for(var e=0,r=this.images.length;e<r;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function(t){var e=a(t,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.src=e;var i={img:r,assetData:t};return i},createImageData:function(t){var e=a(t,this.assetsPath,this.path),r=createNS("image");isSafari?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){i.img=s,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append(r);var i={img:r,assetData:t};return i},imageLoaded:t,setCacheType:function(t,e){this._createImageData="svg"===t?(this._elementHelper=e,this.createImageData.bind(this)):this.createImgData.bind(this)}},e}(),featureSupport=(fx={maskType:!0},(/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))&&(fx.maskType=!1),fx),fx,filtersFactory=(gx={},gx.createFilter=function(t){var e=createNS("filter");return e.setAttribute("id",t),e.setAttribute("filterUnits","objectBoundingBox"),e.setAttribute("x","0%"),e.setAttribute("y","0%"),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e},gx.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),t},gx),gx,assetLoader=function(){function a(t){return t.response&&"object"==typeof t.response?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}return{load:function(t,e,r){var i,s=new XMLHttpRequest;s.open("GET",t,!0);try{s.responseType="json"}catch(t){}s.send(),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)i=a(s),e(i);else try{i=a(s),e(i)}catch(t){r&&r(t)}}}}}();function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t<r;t+=1)e=this._textData.a[t],this._animatorsData[t]=new TextAnimatorDataProperty(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={f:i(this._elem,this._textData.p.f,0,0,this),l:i(this._elem,this._textData.p.l,0,0,this),r:this._textData.p.r,m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=i(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,i,s,a,n,o,h,l,p,f,m,c,u,d,y,g,v,P,b,A=this._moreOptions.alignment.v,S=this._animatorsData,x=this._textData,_=this.mHelper,E=this._renderType,k=this.renderedLetters.length,T=t.l;if(this._hasMaskedPath){if(b=this._pathData.m,!this._pathData.n||this._pathData._mdf){var M,F=b.v;for(this._pathData.r&&(F=F.reverse()),n={tLength:0,segments:[]},a=F._length-1,s=g=0;s<a;s+=1)M=bez.buildBezierData(F.v[s],F.v[s+1],[F.o[s][0]-F.v[s][0],F.o[s][1]-F.v[s][1]],[F.i[s+1][0]-F.v[s+1][0],F.i[s+1][1]-F.v[s+1][1]]),n.tLength+=M.segmentLength,n.segments.push(M),g+=M.segmentLength;s=a,b.v.c&&(M=bez.buildBezierData(F.v[s],F.v[0],[F.o[s][0]-F.v[s][0],F.o[s][1]-F.v[s][1]],[F.i[0][0]-F.v[0][0],F.i[0][1]-F.v[0][1]]),n.tLength+=M.segmentLength,n.segments.push(M),g+=M.segmentLength),this._pathData.pi=n}if(n=this._pathData.pi,o=this._pathData.f.v,f=1,p=!(l=m=0),d=n.segments,o<0&&b.v.c)for(n.tLength<Math.abs(o)&&(o=-Math.abs(o)%n.tLength),f=(u=d[m=d.length-1].points).length-1;o<0;)o+=u[f].partialLength,(f-=1)<0&&(f=(u=d[m-=1].points).length-1);c=(u=d[m].points)[f-1],y=(h=u[f]).partialLength}a=T.length,i=r=0;var I,D,C,w,V,R=1.2*t.finalSize*.714,L=!0;C=S.length;var G,B,N,z,O,j,q,H,W,Y,X,$,K=-1,Z=o,J=m,U=f,Q=-1,tt="",et=this.defaultPropsArray;if(2===t.j||1===t.j){var rt=0,it=0,st=2===t.j?-.5:-1,at=0,nt=!0;for(s=0;s<a;s+=1)if(T[s].n){for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1;nt=!(rt=0)}else{for(D=0;D<C;D+=1)(I=S[D].a).t.propType&&(nt&&2===t.j&&(it+=I.t.v*st),(V=S[D].s.getMult(T[s].anIndexes[D],x.a[D].s.totalChars)).length?rt+=I.t.v*V[0]*st:rt+=I.t.v*V*st);nt=!1}for(rt&&(rt+=it);at<s;)T[at].animatorJustifyOffset=rt,at+=1}for(s=0;s<a;s+=1){if(_.reset(),z=1,T[s].n)r=0,i+=t.yOffset,i+=L?1:0,o=Z,L=!1,this._hasMaskedPath&&(f=U,c=(u=d[m=J].points)[f-1],y=(h=u[f]).partialLength,l=0),$=W=X=tt="",et=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Q!==T[s].line){switch(t.j){case 1:o+=g-t.lineWidths[T[s].line];break;case 2:o+=(g-t.lineWidths[T[s].line])/2}Q=T[s].line}K!==T[s].ind&&(T[K]&&(o+=T[K].extra),o+=T[s].an/2,K=T[s].ind),o+=A[0]*T[s].an*.005;var ot=0;for(D=0;D<C;D+=1)(I=S[D].a).p.propType&&((V=S[D].s.getMult(T[s].anIndexes[D],x.a[D].s.totalChars)).length?ot+=I.p.v[0]*V[0]:ot+=I.p.v[0]*V),I.a.propType&&((V=S[D].s.getMult(T[s].anIndexes[D],x.a[D].s.totalChars)).length?ot+=I.a.v[0]*V[0]:ot+=I.a.v[0]*V);for(p=!0;p;)o+ot<=l+y||!u?(v=(o+ot-l)/h.partialLength,B=c.point[0]+(h.point[0]-c.point[0])*v,N=c.point[1]+(h.point[1]-c.point[1])*v,_.translate(-A[0]*T[s].an*.005,-A[1]*R*.01),p=!1):u&&(l+=h.partialLength,(f+=1)>=u.length&&(f=0,u=d[m+=1]?d[m].points:b.v.c?d[m=f=0].points:(l-=h.partialLength,null)),u&&(c=h,y=(h=u[f]).partialLength));G=T[s].an/2-T[s].add,_.translate(-G,0,0)}else G=T[s].an/2-T[s].add,_.translate(-G,0,0),_.translate(-A[0]*T[s].an*.005,-A[1]*R*.01,0);for(D=0;D<C;D+=1)(I=S[D].a).t.propType&&(V=S[D].s.getMult(T[s].anIndexes[D],x.a[D].s.totalChars),0===r&&0===t.j||(this._hasMaskedPath?V.length?o+=I.t.v*V[0]:o+=I.t.v*V:V.length?r+=I.t.v*V[0]:r+=I.t.v*V));for(t.strokeWidthAnim&&(j=t.sw||0),t.strokeColorAnim&&(O=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(q=[t.fc[0],t.fc[1],t.fc[2]]),D=0;D<C;D+=1)(I=S[D].a).a.propType&&((V=S[D].s.getMult(T[s].anIndexes[D],x.a[D].s.totalChars)).length?_.translate(-I.a.v[0]*V[0],-I.a.v[1]*V[1],I.a.v[2]*V[2]):_.translate(-I.a.v[0]*V,-I.a.v[1]*V,I.a.v[2]*V));for(D=0;D<C;D+=1)(I=S[D].a).s.propType&&((V=S[D].s.getMult(T[s].anIndexes[D],x.a[D].s.totalChars)).length?_.scale(1+(I.s.v[0]-1)*V[0],1+(I.s.v[1]-1)*V[1],1):_.scale(1+(I.s.v[0]-1)*V,1+(I.s.v[1]-1)*V,1));for(D=0;D<C;D+=1){if(I=S[D].a,V=S[D].s.getMult(T[s].anIndexes[D],x.a[D].s.totalChars),I.sk.propType&&(V.length?_.skewFromAxis(-I.sk.v*V[0],I.sa.v*V[1]):_.skewFromAxis(-I.sk.v*V,I.sa.v*V)),I.r.propType&&(V.length?_.rotateZ(-I.r.v*V[2]):_.rotateZ(-I.r.v*V)),I.ry.propType&&(V.length?_.rotateY(I.ry.v*V[1]):_.rotateY(I.ry.v*V)),I.rx.propType&&(V.length?_.rotateX(I.rx.v*V[0]):_.rotateX(I.rx.v*V)),I.o.propType&&(V.length?z+=(I.o.v*V[0]-z)*V[0]:z+=(I.o.v*V-z)*V),t.strokeWidthAnim&&I.sw.propType&&(V.length?j+=I.sw.v*V[0]:j+=I.sw.v*V),t.strokeColorAnim&&I.sc.propType)for(H=0;H<3;H+=1)V.length?O[H]+=(I.sc.v[H]-O[H])*V[0]:O[H]+=(I.sc.v[H]-O[H])*V;if(t.fillColorAnim&&t.fc){if(I.fc.propType)for(H=0;H<3;H+=1)V.length?q[H]+=(I.fc.v[H]-q[H])*V[0]:q[H]+=(I.fc.v[H]-q[H])*V;I.fh.propType&&(q=V.length?addHueToRGB(q,I.fh.v*V[0]):addHueToRGB(q,I.fh.v*V)),I.fs.propType&&(q=V.length?addSaturationToRGB(q,I.fs.v*V[0]):addSaturationToRGB(q,I.fs.v*V)),I.fb.propType&&(q=V.length?addBrightnessToRGB(q,I.fb.v*V[0]):addBrightnessToRGB(q,I.fb.v*V))}}for(D=0;D<C;D+=1)(I=S[D].a).p.propType&&(V=S[D].s.getMult(T[s].anIndexes[D],x.a[D].s.totalChars),this._hasMaskedPath?V.length?_.translate(0,I.p.v[1]*V[0],-I.p.v[2]*V[1]):_.translate(0,I.p.v[1]*V,-I.p.v[2]*V):V.length?_.translate(I.p.v[0]*V[0],I.p.v[1]*V[1],-I.p.v[2]*V[2]):_.translate(I.p.v[0]*V,I.p.v[1]*V,-I.p.v[2]*V));if(t.strokeWidthAnim&&(W=j<0?0:j),t.strokeColorAnim&&(Y="rgb("+Math.round(255*O[0])+","+Math.round(255*O[1])+","+Math.round(255*O[2])+")"),t.fillColorAnim&&t.fc&&(X="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(_.translate(0,-t.ls),_.translate(0,A[1]*R*.01+i,0),x.p.p){P=(h.point[1]-c.point[1])/(h.point[0]-c.point[0]);var ht=180*Math.atan(P)/Math.PI;h.point[0]<c.point[0]&&(ht+=180),_.rotate(-ht*Math.PI/180)}_.translate(B,N,0),o-=A[0]*T[s].an*.005,T[s+1]&&K!==T[s+1].ind&&(o+=T[s].an/2,o+=.001*t.tr*t.finalSize)}else{switch(_.translate(r,i,0),t.ps&&_.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:_.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line]),0,0);break;case 2:_.translate(T[s].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[T[s].line])/2,0,0)}_.translate(0,-t.ls),_.translate(G,0,0),_.translate(A[0]*T[s].an*.005,A[1]*R*.01,0),r+=T[s].l+.001*t.tr*t.finalSize}"html"===E?tt=_.toCSS():"svg"===E?tt=_.to2dCSS():et=[_.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]],$=z}this.lettersChangedFlag=k<=s?(w=new LetterProps($,W,Y,X,tt,et),this.renderedLetters.push(w),k+=1,!0):(w=this.renderedLetters[s]).update($,W,Y,X,tt,et)||this.lettersChangedFlag}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),LetterProps.prototype.update=function(t,e,r,i,s,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1;var n=this._mdf.p=!1;return this.o!==t&&(this.o=t,n=this._mdf.o=!0),this.sw!==e&&(this.sw=e,n=this._mdf.sw=!0),this.sc!==r&&(this.sc=r,n=this._mdf.sc=!0),this.fc!==i&&(this.fc=i,n=this._mdf.fc=!0),this.m!==s&&(this.m=s,n=this._mdf.m=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,n=this._mdf.p=!0),n},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},TextProperty.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=1<this.data.d.k.length,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;i<s;i+=1)a=r!==this.keysIndex?this.effectsSequence[i](a,a.t):this.effectsSequence[i](this.currentData,a.t);e!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,r=0,i=t.length;r<=i-1&&!(r===i-1||t[r+1].t>e);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;s<a;)e=t.charCodeAt(s),-1!==r.indexOf(e)?i[i.length-1]+=t.charAt(s):55296<=e&&e<=56319&&56320<=(e=t.charCodeAt(s+1))&&e<=57343?(i.push(t.substr(s,2)),s+=1):i.push(t.charAt(s)),s+=1;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,c=0,u=0,d=0,y=[],g=0,v=0,P=h.getFontByName(t.f),b=0,A=getFontProperties(P);t.fWeight=A.weight,t.fStyle=A.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var S,x=t.tr/1e3*t.finalSize;if(t.sz)for(var _,E,k=!0,T=t.sz[0],M=t.sz[1];k;){g=_=0,r=(E=this.buildFinalText(t.t)).length,x=t.tr/1e3*t.finalSize;var F=-1;for(e=0;e<r;e+=1)S=E[e].charCodeAt(0),i=!1," "===E[e]?F=e:13!==S&&3!==S||(i=!(g=0),_+=t.finalLineHeight||1.2*t.finalSize),T<g+(b=h.chars?(o=h.getCharData(E[e],P.fStyle,P.fFamily),i?0:o.w*t.finalSize/100):h.measureText(E[e],t.f,t.finalSize))&&" "!==E[e]?(-1===F?r+=1:e=F,_+=t.finalLineHeight||1.2*t.finalSize,E.splice(e,F===e?1:0,"\r"),F=-1,g=0):(g+=b,g+=x);_+=P.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&M<_?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=E,r=t.finalText.length,k=!1)}g=-x;var I,D=b=0;for(e=0;e<r;e+=1)if(i=!1,13===(S=(I=t.finalText[e]).charCodeAt(0))||3===S?(D=0,y.push(g),v=v<g?g:v,g=-2*x,i=!(s=""),d+=1):s=I,b=h.chars?(o=h.getCharData(I,P.fStyle,h.getFontByName(t.f).fFamily),i?0:o.w*t.finalSize/100):h.measureText(s,t.f,t.finalSize)," "===I?D+=b+x:(g+=b+x+D,D=0),p.push({l:b,an:b,add:c,n:i,anIndexes:[],val:s,line:d,animatorJustifyOffset:0}),2==m){if(c+=b,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(c-=b);u<=e;)p[u].an=c,p[u].ind=f,p[u].extra=b,u+=1;f+=1,c=0}}else if(3==m){if(c+=b,""===s||e===r-1){for(""===s&&(c-=b);u<=e;)p[u].an=c,p[u].ind=f,p[u].extra=b,u+=1;c=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=v<g?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var C,w,V,R,L=l.a;n=L.length;var G=[];for(a=0;a<n;a+=1){for((C=L[a]).a.sc&&(t.strokeColorAnim=!0),C.a.sw&&(t.strokeWidthAnim=!0),(C.a.fc||C.a.fh||C.a.fs||C.a.fb)&&(t.fillColorAnim=!0),R=0,V=C.s.b,e=0;e<r;e+=1)(w=p[e]).anIndexes[a]=R,(1==V&&""!==w.val||2==V&&""!==w.val&&" "!==w.val||3==V&&(w.n||" "==w.val||e==r-1)||4==V&&(w.n||e==r-1))&&(1===C.s.rn&&G.push(R),R+=1);l.a[a].s.totalChars=R;var B,N=-1;if(1===C.s.rn)for(e=0;e<r;e+=1)N!=(w=p[e]).anIndexes[a]&&(N=w.anIndexes[a],B=G.splice(Math.floor(Math.random()*G.length),1)[0]),w.anIndexes[a]=B}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=P.ascent*t.finalSize/100},TextProperty.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var r=this.copyData({},this.data.d.k[e].s);r=this.copyData(r,t),this.data.d.k[e].s=r,this.recalculate(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var c=Math.max,u=Math.min,d=Math.floor;function i(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=PropertyFactory.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?PropertyFactory.getProp(t,e.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(t,e.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(t,e.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(t,e.ne||{k:0},0,0,this),this.a=PropertyFactory.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return i.prototype={getMult:function(t){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var e=0,r=0,i=1,s=1;0<this.ne.v?e=this.ne.v/100:r=-this.ne.v/100,0<this.xe.v?i=1-this.xe.v/100:s=1+this.xe.v/100;var a=BezierFactory.getBezierEasing(e,r,i,s).get,n=0,o=this.finalS,h=this.finalE,l=this.data.sh;if(2===l)n=a(n=h===o?h<=t?1:0:c(0,u(.5/(h-o)+(t-o)/(h-o),1)));else if(3===l)n=a(n=h===o?h<=t?0:1:1-c(0,u(.5/(h-o)+(t-o)/(h-o),1)));else if(4===l)h===o?n=0:(n=c(0,u(.5/(h-o)+(t-o)/(h-o),1)))<.5?n*=2:n=1-2*(n-.5),n=a(n);else if(5===l){if(h===o)n=0;else{var p=h-o,f=-p/2+(t=u(c(0,t+.5-o),h-o)),m=p/2;n=Math.sqrt(1-f*f/(m*m))}n=a(n)}else n=6===l?a(n=h===o?0:(t=u(c(0,t+.5-o),h-o),(1+Math.cos(Math.PI+2*Math.PI*t/(h-o)))/2)):(t>=d(o)&&(n=c(0,u(t-o<0?u(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(s<i){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}(),poolFactory=function(t,e,r){var i=0,s=t,a=createSizedArray(s);return{newElement:function(){return i?a[i-=1]:e()},release:function(t){i===s&&(a=pooling.double(a),s*=2),r&&r(t),a[i]=t,i+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},pointPool=poolFactory(8,function(){return createTypedArray("float32",2)}),shapePool=(mB=poolFactory(4,function(){return new ShapePath},function(t){var e,r=t._length;for(e=0;e<r;e+=1)pointPool.release(t.v[e]),pointPool.release(t.i[e]),pointPool.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}),mB.clone=function(t){var e,r=mB.newElement(),i=void 0===t._length?t.v.length:t._length;for(r.setLength(i),r.c=t.c,e=0;e<i;e+=1)r.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return r},mB),mB,shapeCollectionPool=(uB={newShapeCollection:function(){var t;t=vB?xB[vB-=1]:new ShapeCollection;return t},release:function(t){var e,r=t._length;for(e=0;e<r;e+=1)shapePool.release(t.shapes[e]);t._length=0,vB===wB&&(xB=pooling.double(xB),wB*=2);xB[vB]=t,vB+=1}},vB=0,wB=4,xB=createSizedArray(wB),uB),uB,vB,wB,xB,segmentsLengthPool=poolFactory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,r=t.lengths.length;for(e=0;e<r;e+=1)bezierLengthPool.release(t.lengths[e]);t.lengths.length=0}),bezierLengthPool=poolFactory(8,function(){return{addedLength:0,percents:createTypedArray("float32",defaultCurveSegments),lengths:createTypedArray("float32",defaultCurveSegments)}});function BaseRenderer(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(e&&e.title){var i=createNS("title"),s=createElementID();i.setAttribute("id",s),i.textContent=e.title,this.svgElement.appendChild(i),r+=s}if(e&&e.description){var a=createNS("desc"),n=createElementID();a.setAttribute("id",n),a.textContent=e.description,this.svgElement.appendChild(a),r+=" "+n}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var h=createNS("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"}},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function MaskElement(t,e,r){this.data=t,this.element=e,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var i,s,a=this.globalData.defs,n=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(n),this.solidPath="";var o,h,l,p,f,m,c=this.masksProperties,u=0,d=[],y=createElementID(),g="clipPath",v="clip-path";for(i=0;i<n;i+=1)if(("a"!==c[i].mode&&"n"!==c[i].mode||c[i].inv||100!==c[i].o.k||c[i].o.x)&&(v=g="mask"),"s"!==c[i].mode&&"i"!==c[i].mode||0!==u?l=null:((l=createNS("rect")).setAttribute("fill","#ffffff"),l.setAttribute("width",this.element.comp.data.w||0),l.setAttribute("height",this.element.comp.data.h||0),d.push(l)),s=createNS("path"),"n"===c[i].mode)this.viewData[i]={op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),elem:s,lastPath:""},a.appendChild(s);else{var P;if(u+=1,s.setAttribute("fill","s"===c[i].mode?"#000000":"#ffffff"),s.setAttribute("clip-rule","nonzero"),0!==c[i].x.k?(v=g="mask",m=PropertyFactory.getProp(this.element,c[i].x,0,null,this.element),P=createElementID(),(p=createNS("filter")).setAttribute("id",P),(f=createNS("feMorphology")).setAttribute("operator","erode"),f.setAttribute("in","SourceGraphic"),f.setAttribute("radius","0"),p.appendChild(f),a.appendChild(p),s.setAttribute("stroke","s"===c[i].mode?"#000000":"#ffffff")):m=f=null,this.storedData[i]={elem:s,x:m,expan:f,lastPath:"",lastOperator:"",filterId:P,lastRadius:0},"i"===c[i].mode){h=d.length;var b=createNS("g");for(o=0;o<h;o+=1)b.appendChild(d[o]);var A=createNS("mask");A.setAttribute("mask-type","alpha"),A.setAttribute("id",y+"_"+u),A.appendChild(s),a.appendChild(A),b.setAttribute("mask","url("+locationHref+"#"+y+"_"+u+")"),d.length=0,d.push(b)}else d.push(s);c[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:s,lastPath:"",op:PropertyFactory.getProp(this.element,c[i].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,c[i],3),invRect:l},this.viewData[i].prop.k||this.drawPath(c[i],this.viewData[i].prop.v,this.viewData[i])}for(this.maskElement=createNS(g),n=d.length,i=0;i<n;i+=1)this.maskElement.appendChild(d[i]);0<u&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+y+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,r){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=r,this.lvl=e,this._isAnimated=!!r.k;for(var i=0,s=t.length;i<s;){if(t[i].mProps.dynamicProperties.length){this._isAnimated=!0;break}i+=1}}function SVGTransformData(t,e,r){this.transform={mProps:t,op:e,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}function SVGStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.c=PropertyFactory.getProp(t,e.c,1,255,this),this.style=r}function SVGGradientFillStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,r)}function SVGGradientStrokeStyleData(t,e,r){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(t,e.w,0,null,this),this.d=new DashProperty(t,e.d||{},"svg",this),this.initGradientData(t,e,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;0<=e;e-=1)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var r,i=t.length,s=this.layers.length;for(e=0;e<i;e+=1)for(r=0;r<s;){if(this.layers[r].id===t[e].id){this.layers[r]=t[e];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(t,e,r){for(var i=this.elements,s=this.layers,a=0,n=s.length;a<n;)s[a].ind==e&&(i[a]&&!0!==i[a]?(r.push(i[a]),i[a].setAsParent(),void 0!==s[a].parent?this.buildElementParenting(t,s[a].parent,r):t.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(t))),a+=1},BaseRenderer.prototype.addPendingElement=function(t){this.pendingElements.push(t)},BaseRenderer.prototype.searchExtraCompositions=function(t){var e,r=t.length;for(e=0;e<r;e+=1)if(t[e].xt){var i=this.createComp(t[e]);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},BaseRenderer.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}},extendPrototype([BaseRenderer],SVGRenderer),SVGRenderer.prototype.createNull=function(t){return new NullElement(t,this.globalData,this)},SVGRenderer.prototype.createShape=function(t){return new SVGShapeElement(t,this.globalData,this)},SVGRenderer.prototype.createText=function(t){return new SVGTextLottieElement(t,this.globalData,this)},SVGRenderer.prototype.createImage=function(t){return new IImageElement(t,this.globalData,this)},SVGRenderer.prototype.createComp=function(t){return new SVGCompElement(t,this.globalData,this)},SVGRenderer.prototype.createSolid=function(t){return new ISolidElement(t,this.globalData,this)},SVGRenderer.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)"),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var r=createNS("clipPath"),i=createNS("rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var s=createElementID();r.setAttribute("id",s),r.appendChild(i),this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+s+")"),e.appendChild(r),this.layers=t.layers,this.elements=createSizedArray(t.layers.length)},SVGRenderer.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRenderer.prototype.updateContainerSize=function(){},SVGRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var r=this.createItem(this.layers[t]);e[t]=r,expressionsPlugin&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,t),this.layers[t].tt&&(this.elements[t-1]&&!0!==this.elements[t-1]?r.setMatte(e[t-1].layerId):(this.buildItem(t-1),this.addPendingElement(r)))}},SVGRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,r=this.elements.length;e<r;){if(this.elements[e]===t){t.setMatte(this.elements[e-1].layerId);break}e+=1}}},SVGRenderer.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=r-1;0<=e;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<r;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRenderer.prototype.appendElementInPos=function(t,e){var r=t.getBaseElement();if(r){for(var i,s=0;s<e;)this.elements[s]&&!0!==this.elements[s]&&this.elements[s].getBaseElement()&&(i=this.elements[s].getBaseElement()),s+=1;i?this.layerElement.insertBefore(r,i):this.layerElement.appendChild(r)}},SVGRenderer.prototype.hide=function(){this.layerElement.style.display="none"},SVGRenderer.prototype.show=function(){this.layerElement.style.display="block"},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e,r=this.element.finalTransform.mat,i=this.masksProperties.length;for(e=0;e<i;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var s=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+locationHref+"#"+this.storedData[e].filterId+")")),s.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(t,e,r){var i,s,a=" M"+e.v[0][0]+","+e.v[0][1];for(s=e._length,i=1;i<s;i+=1)a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[i][0]+","+e.i[i][1]+" "+e.v[i][0]+","+e.v[i][1];if(e.c&&1<s&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var r,i=this.dynamicProperties.length;for(r=0;r<i;r+=1)(e||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<i;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),r=0;r<i;r+=1)t=this.hierarchy[r].finalTransform.mProp.v.props,e.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var r,i=!0,s=this.comp;i;)s.finalTransform?(s.data.hasMask&&e.splice(0,0,s.finalTransform),s=s.comp):i=!1;var a,n=e.length;for(r=0;r<n;r+=1)a=e[r].mat.applyToPointArray(0,0,0),t=[t[0]-a[0],t[1]-a[1],0];return t},mHelper:new Matrix},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),SVGGradientFillStyleData.prototype.initGradientData=function(t,e,r){this.o=PropertyFactory.getProp(t,e.o,0,.01,this),this.s=PropertyFactory.getProp(t,e.s,1,null,this),this.e=PropertyFactory.getProp(t,e.e,1,null,this),this.h=PropertyFactory.getProp(t,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(t,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(t,e.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,e),this.setGradientOpacity(e,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(t,e){var r=createElementID(),i=createNS(1===e.t?"linearGradient":"radialGradient");i.setAttribute("id",r),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var s,a,n,o=[];for(n=4*e.g.p,a=0;a<n;a+=4)s=createNS("stop"),i.appendChild(s),o.push(s);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+locationHref+"#"+r+")"),this.gf=i,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var r,i,s,a=createNS("mask"),n=createNS("path");a.appendChild(n);var o=createElementID(),h=createElementID();a.setAttribute("id",h);var l=createNS(1===t.t?"linearGradient":"radialGradient");l.setAttribute("id",o),l.setAttribute("spreadMethod","pad"),l.setAttribute("gradientUnits","userSpaceOnUse"),s=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(i=4*t.g.p;i<s;i+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),l.appendChild(r),p.push(r);n.setAttribute("gf"===t.ty?"fill":"stroke","url("+locationHref+"#"+o+")"),this.of=l,this.ms=a,this.ost=p,this.maskId=h,e.msElem=n}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var SVGElementsRenderer=function(){var y=new Matrix,g=new Matrix;function e(t,e,r){(r||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(r||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function r(t,e,r){var i,s,a,n,o,h,l,p,f,m,c,u=e.styles.length,d=e.lvl;for(h=0;h<u;h+=1){if(n=e.sh._mdf||r,e.styles[h].lvl<d){for(p=g.reset(),m=d-e.styles[h].lvl,c=e.transformers.length-1;!n&&0<m;)n=e.transformers[c].mProps._mdf||n,m-=1,c-=1;if(n)for(m=d-e.styles[h].lvl,c=e.transformers.length-1;0<m;)f=e.transformers[c].mProps.v.props,p.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),m-=1,c-=1}else p=y;if(s=(l=e.sh.paths)._length,n){for(a="",i=0;i<s;i+=1)(o=l.shapes[i])&&o._length&&(a+=buildShapeString(o,o._length,o.c,p));e.caches[h]=a}else a=e.caches[h];e.styles[h].d+=!0===t.hd?"":a,e.styles[h]._mdf=n||e.styles[h]._mdf}}function i(t,e,r){var i=e.style;(e.c._mdf||r)&&i.pElem.setAttribute("fill","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("fill-opacity",e.o.v)}function s(t,e,r){a(t,e,r),n(t,e,r)}function a(t,e,r){var i,s,a,n,o,h=e.gf,l=e.g._hasOpacity,p=e.s.v,f=e.e.v;if(e.o._mdf||r){var m="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(m,e.o.v)}if(e.s._mdf||r){var c=1===t.t?"x1":"cx",u="x1"===c?"y1":"cy";h.setAttribute(c,p[0]),h.setAttribute(u,p[1]),l&&!e.g._collapsable&&(e.of.setAttribute(c,p[0]),e.of.setAttribute(u,p[1]))}if(e.g._cmdf||r){i=e.cst;var d=e.g.c;for(a=i.length,s=0;s<a;s+=1)(n=i[s]).setAttribute("offset",d[4*s]+"%"),n.setAttribute("stop-color","rgb("+d[4*s+1]+","+d[4*s+2]+","+d[4*s+3]+")")}if(l&&(e.g._omdf||r)){var y=e.g.o;for(a=(i=e.g._collapsable?e.cst:e.ost).length,s=0;s<a;s+=1)n=i[s],e.g._collapsable||n.setAttribute("offset",y[2*s]+"%"),n.setAttribute("stop-opacity",y[2*s+1])}if(1===t.t)(e.e._mdf||r)&&(h.setAttribute("x2",f[0]),h.setAttribute("y2",f[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",f[0]),e.of.setAttribute("y2",f[1])));else if((e.s._mdf||e.e._mdf||r)&&(o=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)),h.setAttribute("r",o),l&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.e._mdf||e.h._mdf||e.a._mdf||r){o||(o=Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)));var g=Math.atan2(f[1]-p[1],f[0]-p[0]),v=e.h.v;1<=v?v=.99:v<=-1&&(v=-.99);var P=o*v,b=Math.cos(g+e.a.v)*P+p[0],A=Math.sin(g+e.a.v)*P+p[1];h.setAttribute("fx",b),h.setAttribute("fy",A),l&&!e.g._collapsable&&(e.of.setAttribute("fx",b),e.of.setAttribute("fy",A))}}function n(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||r)&&s.dashStr&&(i.pElem.setAttribute("stroke-dasharray",s.dashStr),i.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||r)&&i.pElem.setAttribute("stroke","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||r)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return i;case"gf":return a;case"gs":return s;case"st":return n;case"sh":case"el":case"rc":case"sr":return r;case"tr":return e;default:return null}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function BaseElement(){}function NullElement(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initFrame(),this.initTransform(t,e,r),this.initHierarchy()}function SVGBaseElement(){}function IShapeElement(){}function ITextElement(){}function ICompElement(){}function IImageElement(t,e,r){this.assetData=e.getAssetData(t.refId),this.initElement(t,e,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ISolidElement(t,e,r){this.initElement(t,e,r)}function AudioElement(t,e,r){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,r),this._isPlaying=!1,this._canPlay=!1;var i=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(i),this._currentTime=0,this.globalData.audioController.addAudio(this),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGCompElement(t,e,r){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(t,e,r),this.tm=t.tm?PropertyFactory.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function SVGTextLottieElement(t,e,r){this.textSpans=[],this.renderType="svg",this.initElement(t,e,r)}function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function SVGTintFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");if(r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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.setAttribute("result","f1"),t.appendChild(r),(r=createNS("feColorMatrix")).setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result","f2"),t.appendChild(r),this.matrixFilter=r,100!==e.effectElements[2].p.v||e.effectElements[2].p.k){var i,s=createNS("feMerge");t.appendChild(s),(i=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),s.appendChild(i),(i=createNS("feMergeNode")).setAttribute("in","f2"),s.appendChild(i)}}function SVGFillFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),t.appendChild(r),this.matrixFilter=r}function SVGGaussianBlurEffect(t,e){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var r=createNS("feGaussianBlur");t.appendChild(r),this.feGaussianBlur=r}function SVGStrokeEffect(t,e){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}function SVGTritoneFilter(t,e){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.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.setAttribute("result","f1"),t.appendChild(r);var i=createNS("feComponentTransfer");i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.matrixFilter=i;var s=createNS("feFuncR");s.setAttribute("type","table"),i.appendChild(s),this.feFuncR=s;var a=createNS("feFuncG");a.setAttribute("type","table"),i.appendChild(a),this.feFuncG=a;var n=createNS("feFuncB");n.setAttribute("type","table"),i.appendChild(n),this.feFuncB=n}function SVGProLevelsFilter(t,e){this.filterManager=e;var r=this.filterManager.effectElements,i=createNS("feComponentTransfer");(r[10].p.k||0!==r[10].p.v||r[11].p.k||1!==r[11].p.v||r[12].p.k||1!==r[12].p.v||r[13].p.k||0!==r[13].p.v||r[14].p.k||1!==r[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",i)),(r[17].p.k||0!==r[17].p.v||r[18].p.k||1!==r[18].p.v||r[19].p.k||1!==r[19].p.v||r[20].p.k||0!==r[20].p.v||r[21].p.k||1!==r[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",i)),(r[24].p.k||0!==r[24].p.v||r[25].p.k||1!==r[25].p.v||r[26].p.k||1!==r[26].p.v||r[27].p.k||0!==r[27].p.v||r[28].p.k||1!==r[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",i)),(r[31].p.k||0!==r[31].p.v||r[32].p.k||1!==r[32].p.v||r[33].p.k||1!==r[33].p.v||r[34].p.k||0!==r[34].p.v||r[35].p.k||1!==r[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",i)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),i=createNS("feComponentTransfer")),(r[3].p.k||0!==r[3].p.v||r[4].p.k||1!==r[4].p.v||r[5].p.k||1!==r[5].p.v||r[6].p.k||0!==r[6].p.v||r[7].p.k||1!==r[7].p.v)&&(i.setAttribute("color-interpolation-filters","sRGB"),t.appendChild(i),this.feFuncRComposed=this.createFeFunc("feFuncR",i),this.feFuncGComposed=this.createFeFunc("feFuncG",i),this.feFuncBComposed=this.createFeFunc("feFuncB",i))}function SVGDropShadowEffect(t,e){var r=e.container.globalData.renderConfig.filterSize;t.setAttribute("x",r.x),t.setAttribute("y",r.y),t.setAttribute("width",r.width),t.setAttribute("height",r.height),this.filterManager=e;var i=createNS("feGaussianBlur");i.setAttribute("in","SourceAlpha"),i.setAttribute("result","drop_shadow_1"),i.setAttribute("stdDeviation","0"),this.feGaussianBlur=i,t.appendChild(i);var s=createNS("feOffset");s.setAttribute("dx","25"),s.setAttribute("dy","0"),s.setAttribute("in","drop_shadow_1"),s.setAttribute("result","drop_shadow_2"),this.feOffset=s,t.appendChild(s);var a=createNS("feFlood");a.setAttribute("flood-color","#00ff00"),a.setAttribute("flood-opacity","1"),a.setAttribute("result","drop_shadow_3"),this.feFlood=a,t.appendChild(a);var n=createNS("feComposite");n.setAttribute("in","drop_shadow_3"),n.setAttribute("in2","drop_shadow_2"),n.setAttribute("operator","in"),n.setAttribute("result","drop_shadow_4"),t.appendChild(n);var o,h=createNS("feMerge");t.appendChild(h),o=createNS("feMergeNode"),h.appendChild(o),(o=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=o,this.feMerge=h,this.originalNodeAdded=!1,h.appendChild(o)}ShapeTransformManager.prototype={addTransformSequence:function(t){var e,r=t.length,i="_";for(e=0;e<r;e+=1)i+=t[e].transform.key+"_";var s=this.sequences[i];return s||(s={transforms:[].concat(t),finalTransform:new Matrix,_mdf:!1},this.sequences[i]=s,this.sequenceList.push(s)),s},processSequence:function(t,e){for(var r,i=0,s=t.transforms.length,a=e;i<s&&!e;){if(t.transforms[i].transform.mProps._mdf){a=!0;break}i+=1}if(a)for(t.finalTransform.reset(),i=s-1;0<=i;i-=1)r=t.transforms[i].transform.mProps.v.props,t.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);t._mdf=a},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e<r;e+=1)this.processSequence(this.sequenceList[e],t)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){this.layerInterface=LayerExpressionInterface(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var t=EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(t),0===this.data.ty||this.data.xt?this.compInterface=CompExpressionInterface(this):4===this.data.ty?(this.layerInterface.shapeInterface=ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=TextExpressionInterface(this),this.layerInterface.text=this.layerInterface.textInterface)},setBlendMode:function(){var t=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,r){this.globalData=e,this.comp=r,this.data=t,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},NullElement.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t,e,r,i=null;if(this.data.td){if(3==this.data.td||1==this.data.td){var s=createNS("mask");s.setAttribute("id",this.layerId),s.setAttribute("mask-type",3==this.data.td?"luminance":"alpha"),s.appendChild(this.layerElement),i=s,this.globalData.defs.appendChild(s),featureSupport.maskType||1!=this.data.td||(s.setAttribute("mask-type","luminance"),t=createElementID(),e=filtersFactory.createFilter(t),this.globalData.defs.appendChild(e),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(r=createNS("g")).appendChild(this.layerElement),i=r,s.appendChild(r),r.setAttribute("filter","url("+locationHref+"#"+t+")"))}else if(2==this.data.td){var a=createNS("mask");a.setAttribute("id",this.layerId),a.setAttribute("mask-type","alpha");var n=createNS("g");a.appendChild(n),t=createElementID(),e=filtersFactory.createFilter(t);var o=createNS("feComponentTransfer");o.setAttribute("in","SourceGraphic"),e.appendChild(o);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),o.appendChild(h),this.globalData.defs.appendChild(e);var l=createNS("rect");l.setAttribute("width",this.comp.data.w),l.setAttribute("height",this.comp.data.h),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("fill","#ffffff"),l.setAttribute("opacity","0"),n.setAttribute("filter","url("+locationHref+"#"+t+")"),n.appendChild(l),n.appendChild(this.layerElement),i=n,featureSupport.maskType||(a.setAttribute("mask-type","luminance"),e.appendChild(filtersFactory.createAlphaToLuminanceFilter()),r=createNS("g"),n.appendChild(l),r.appendChild(this.layerElement),i=r,n.appendChild(r)),this.globalData.defs.appendChild(a)}}else this.data.tt?(this.matteElement.appendChild(this.layerElement),i=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var p=createNS("clipPath"),f=createNS("path");f.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var m=createElementID();if(p.setAttribute("id",m),p.appendChild(f),this.globalData.defs.appendChild(p),this.checkMasks()){var c=createNS("g");c.setAttribute("clip-path","url("+locationHref+"#"+m+")"),c.appendChild(this.layerElement),this.transformedElement=c,i?i.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+locationHref+"#"+m+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+locationHref+"#"+t+")")}},IShapeElement.prototype={addShapeToModifiers:function(t){var e,r=this.shapeModifiers.length;for(e=0;e<r;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=this.shapeModifiers.length;0<e;)if(this.shapeModifiers[0].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;0<=t;t-=1)this.shapeModifiers[t].processShapes(this._isFirstFrame)}},lcEnum:{1:"butt",2:"round",3:"square"},ljEnum:{1:"miter",2:"round",3:"bevel"},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r<i;){if(e[r].elem===t)return e[r].pos;r+=1}return 0},addProcessedElement:function(t,e){for(var r=this.processedElements,i=r.length;i;)if(r[i-=1].elem===t)return void(r[i].pos=e);r.push(new ProcessedElement(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}},ITextElement.prototype.initElement=function(t,e,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,r),this.textProperty=new TextProperty(this,t.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(t.t,this.renderType,this),this.initTransform(t,e,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(t,e){var r,i,s=e.length,a="";for(r=0;r<s;r+=1)i=e[r].ks.k,a+=buildShapeString(i,i.i.length,!0,t);return a},ITextElement.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},ITextElement.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},ITextElement.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},ITextElement.prototype.applyTextPropertiesToMatrix=function(t,e,r,i,s){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[r])/2,0,0)}e.translate(i,s,0)},ITextElement.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(t,e,r){this.initFrame(),this.initBaseData(t,e,r),this.initTransform(t,e,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var r,i=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=i-1;0<=r;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var t=createNS("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},AudioElement.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||.1<Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek()))&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(t){for(var e=0,r=t.length,i=[],s="";e<r;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(i.push(s),s=""):s+=t[e],e+=1;return i.push(s),i},SVGTextLottieElement.prototype.buildNewText=function(){var t,e,r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var i=this.globalData.fontManager.getFontByName(r.f);if(i.fClass)this.layerElement.setAttribute("class",i.fClass);else{this.layerElement.setAttribute("font-family",i.fFamily);var s=r.fWeight,a=r.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",s)}this.layerElement.setAttribute("aria-label",r.t);var n,o=r.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var l,p=this.mHelper,f="",m=this.data.singleShape,c=0,u=0,d=!0,y=.001*r.tr*r.finalSize;if(!m||h||r.sz){var g,v,P=this.textSpans.length;for(t=0;t<e;t+=1)h&&m&&0!==t||(n=t<P?this.textSpans[t]:createNS(h?"path":"text"),P<=t&&(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=n,this.layerElement.appendChild(n)),n.style.display="inherit"),p.reset(),p.scale(r.finalSize/100,r.finalSize/100),m&&(o[t].n&&(c=-y,u+=r.yOffset,u+=d?1:0,d=!1),this.applyTextPropertiesToMatrix(r,p,o[t].line,c,u),c+=o[t].l||0,c+=y),h?(l=(g=(v=this.globalData.fontManager.getCharData(r.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily))&&v.data||{}).shapes?g.shapes[0].it:[],m?f+=this.createPathShape(p,l):n.setAttribute("d",this.createPathShape(p,l))):(m&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));m&&n&&n.setAttribute("d",f)}else{var b=this.textContainer,A="start";switch(r.j){case 1:A="end";break;case 2:A="middle";break;default:A="start"}b.setAttribute("text-anchor",A),b.setAttribute("letter-spacing",y);var S=this.buildTextContents(r.finalText);for(e=S.length,u=r.ps?r.ps[1]+r.ascent:0,t=0;t<e;t+=1)(n=this.textSpans[t]||createNS("tspan")).textContent=S[t],n.setAttribute("x",0),n.setAttribute("y",u),n.style.display="inherit",b.appendChild(n),this.textSpans[t]=n,u+=r.finalLineHeight;this.layerElement.appendChild(b)}for(;t<this.textSpans.length;)this.textSpans[t].style.display="none",t+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var t=this.layerElement.getBBox();this.bbox={top:t.y,left:t.x,width:t.width,height:t.height}}return this.bbox},SVGTextLottieElement.prototype.renderInnerContent=function(){if(!this.data.singleShape&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var r,i,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(r=s[t],i=this.textSpans[t],r._mdf.m&&i.setAttribute("transform",r.m),r._mdf.o&&i.setAttribute("opacity",r.o),r._mdf.sw&&i.setAttribute("stroke-width",r.sw),r._mdf.sc&&i.setAttribute("stroke",r.sc),r._mdf.fc&&i.setAttribute("fill",r.fc))}},extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r<a;r+=1){for(i=this.stylesList[r],o=!1,t=n.length=0;t<s;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(i)&&(n.push(e),o=e._isAnimated||o);1<n.length&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e<r;e+=1)t[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(t,e){var r,i=new SVGStyleData(t,e),s=i.pElem;if("st"===t.ty)r=new SVGStrokeStyleData(this,t,i);else if("fl"===t.ty)r=new SVGFillStyleData(this,t,i);else if("gf"===t.ty||"gs"===t.ty){r=new("gf"===t.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,t,i),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),s.setAttribute("mask","url("+locationHref+"#"+r.maskId+")"))}return"st"!==t.ty&&"gs"!==t.ty||(s.setAttribute("stroke-linecap",this.lcEnum[t.lc]||"round"),s.setAttribute("stroke-linejoin",this.ljEnum[t.lj]||"round"),s.setAttribute("fill-opacity","0"),1===t.lj&&s.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&s.setAttribute("fill-rule","evenodd"),t.ln&&s.setAttribute("id",t.ln),t.cl&&s.setAttribute("class",t.cl),t.bm&&(s.style["mix-blend-mode"]=getBlendMode(t.bm)),this.stylesList.push(i),this.addToAnimatedContents(t,r),r},SVGShapeElement.prototype.createGroupElement=function(t){var e=new ShapeGroupData;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(t.bm)),e},SVGShapeElement.prototype.createTransformElement=function(t,e){var r=TransformPropertyFactory.getTransformProperty(this,t,this),i=new SVGTransformData(r,r.o,e);return this.addToAnimatedContents(t,i),i},SVGShapeElement.prototype.createShapeElement=function(t,e,r){var i=4;"rc"===t.ty?i=5:"el"===t.ty?i=6:"sr"===t.ty&&(i=7);var s=new SVGShapeData(e,r,ShapePropertyFactory.getShapeProp(this,t,i,this));return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(t,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(t,e){for(var r=0,i=this.animatedContents.length;r<i;){if(this.animatedContents[r].element===e)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(t),element:e,data:t})},SVGShapeElement.prototype.setElementStyles=function(t){var e,r=t.styles,i=this.stylesList.length;for(e=0;e<i;e+=1)this.stylesList[e].closed||r.push(this.stylesList[e])},SVGShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(t,e,r,i,s,a,n){var o,h,l,p,f,m,c=[].concat(a),u=t.length-1,d=[],y=[];for(o=u;0<=o;o-=1){if((m=this.searchProcessedElement(t[o]))?e[o]=r[m-1]:t[o]._render=n,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty)m?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&i.appendChild(e[o].style.pElem),d.push(e[o].style);else if("gr"===t[o].ty){if(m)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,s+1,c,n),t[o]._render&&i.appendChild(e[o].gr)}else"tr"===t[o].ty?(m||(e[o]=this.createTransformElement(t[o],i)),p=e[o].transform,c.push(p)):"sh"===t[o].ty||"rc"===t[o].ty||"el"===t[o].ty||"sr"===t[o].ty?(m||(e[o]=this.createShapeElement(t[o],c,s)),this.setElementStyles(e[o])):"tm"===t[o].ty||"rd"===t[o].ty||"ms"===t[o].ty||"pb"===t[o].ty?(m?(f=e[o]).closed=!1:((f=ShapeModifiers.getModifier(t[o].ty)).init(this,t[o]),e[o]=f,this.shapeModifiers.push(f)),y.push(f)):"rp"===t[o].ty&&(m?(f=e[o]).closed=!0:(f=ShapeModifiers.getModifier(t[o].ty),(e[o]=f).init(this,t,o,e),this.shapeModifiers.push(f),n=!1),y.push(f));this.addProcessedElement(t[o],o+1)}for(u=d.length,o=0;o<u;o+=1)d[o].closed=!0;for(u=y.length,o=0;o<u;o+=1)y[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var t,e,r=this.animatedContents.length;for(t=0;t<r;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},SVGTintFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",r[0]-e[0]+" 0 0 0 "+e[0]+" "+(r[1]-e[1])+" 0 0 0 "+e[1]+" "+(r[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 "+i+" 0")}},SVGFillFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+r+" 0")}},SVGGaussianBlurEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=3==r?0:e,s=2==r?0:e;this.feGaussianBlur.setAttribute("stdDeviation",i+" "+s);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},SVGStrokeEffect.prototype.initialize=function(){var t,e,r,i,s=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(i=this.elem.maskManager.masksProperties.length,r=0):i=(r=this.filterManager.effectElements[0].p.v-1)+1,(e=createNS("g")).setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-dashoffset",1);r<i;r+=1)t=createNS("path"),e.appendChild(t),this.paths.push({p:t,m:r});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),n=createElementID();a.setAttribute("id",n),a.setAttribute("mask-type","alpha"),a.appendChild(e),this.elem.globalData.defs.appendChild(a);var o=createNS("g");for(o.setAttribute("mask","url("+locationHref+"#"+n+")");s[0];)o.appendChild(s[0]);this.elem.layerElement.appendChild(o),this.masker=a,e.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(s=this.elem.layerElement.children||this.elem.layerElement.childNodes;s.length;)this.elem.layerElement.removeChild(s[0]);this.elem.layerElement.appendChild(e),this.elem.layerElement.removeAttribute("mask"),e.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=e},SVGStrokeEffect.prototype.renderFrame=function(t){var e;this.initialized||this.initialize();var r,i,s=this.paths.length;for(e=0;e<s;e+=1)if(-1!==this.paths[e].m&&(r=this.elem.maskManager.viewData[this.paths[e].m],i=this.paths[e].p,(t||this.filterManager._mdf||r.prop._mdf)&&i.setAttribute("d",r.lastPath),t||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var n=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),o=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),h=i.getTotalLength();a="0 0 0 "+h*n+" ";var l,p=h*(o-n),f=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,m=Math.floor(p/f);for(l=0;l<m;l+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";a+="0 "+10*h+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;i.setAttribute("stroke-dasharray",a)}if((t||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(t||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(t||this.filterManager.effectElements[3].p._mdf)){var c=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*c[0])+","+bmFloor(255*c[1])+","+bmFloor(255*c[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,i=this.filterManager.effectElements[2].p.v,s=i[0]+" "+r[0]+" "+e[0],a=i[1]+" "+r[1]+" "+e[1],n=i[2]+" "+r[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",s),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",n)}},SVGProLevelsFilter.prototype.createFeFunc=function(t,e){var r=createNS(t);return r.setAttribute("type","table"),e.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(t,e,r,i,s){for(var a,n,o=0,h=Math.min(t,e),l=Math.max(t,e),p=Array.call(null,{length:256}),f=0,m=s-i,c=e-t;o<=256;)n=(a=o/256)<=h?c<0?s:i:l<=a?c<0?i:s:i+m*Math.pow((a-t)/c,1/r),p[f]=n,f+=1,o+=256/255;return p.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(t||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(e=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(e=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(e=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(e=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(e=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=r*Math.cos(i),a=r*Math.sin(i);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,r){this.initialized=!1,this.filterManager=e,this.filterElem=t,(this.elem=r).matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGEffects(t){var e,r,i=t.data.ef?t.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s),n=0;for(this.filters=[],e=0;e<i;e+=1)r=null,20===t.data.ef[e].ty?(n+=1,r=new SVGTintFilter(a,t.effectsManager.effectElements[e])):21===t.data.ef[e].ty?(n+=1,r=new SVGFillFilter(a,t.effectsManager.effectElements[e])):22===t.data.ef[e].ty?r=new SVGStrokeEffect(t,t.effectsManager.effectElements[e]):23===t.data.ef[e].ty?(n+=1,r=new SVGTritoneFilter(a,t.effectsManager.effectElements[e])):24===t.data.ef[e].ty?(n+=1,r=new SVGProLevelsFilter(a,t.effectsManager.effectElements[e])):25===t.data.ef[e].ty?(n+=1,r=new SVGDropShadowEffect(a,t.effectsManager.effectElements[e])):28===t.data.ef[e].ty?r=new SVGMatte3Effect(a,t.effectsManager.effectElements[e],t):29===t.data.ef[e].ty&&(n+=1,r=new SVGGaussianBlurEffect(a,t.effectsManager.effectElements[e])),r&&this.filters.push(r);n&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+locationHref+"#"+s+")")),this.filters.length&&t.addRenderableComponent(this)}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,r=_svgMatteSymbols.length;e<r;){if(_svgMatteSymbols[e]===t)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(t,e){var r=t.layerElement.parentNode;if(r){for(var i,s=r.children,a=0,n=s.length;a<n&&s[a]!==t.layerElement;)a+=1;a<=n-2&&(i=s[a+1]);var o=createNS("use");o.setAttribute("href","#"+e),i?r.insertBefore(o,i):r.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(t,e){if(!this.findSymbol(e)){var r=createElementID(),i=createNS("mask");i.setAttribute("id",e.layerId),i.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var s=t.globalData.defs;s.appendChild(i);var a=createNS("symbol");a.setAttribute("id",r),this.replaceInParent(e,r),a.appendChild(e.layerElement),s.appendChild(a);var n=createNS("use");n.setAttribute("href","#"+r),i.appendChild(n),e.data.hd=!1,e.show()}t.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var t=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,r=0,i=e.length;r<i;)e[r]&&e[r].data.ind===t&&this.setElementAsMask(this.elem,e[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGEffects.prototype.renderFrame=function(t){var e,r=this.filters.length;for(e=0;e<r;e+=1)this.filters[e].renderFrame(t)};var animationManager=function(){var t={},s=[],i=0,a=0,n=0,o=!0,h=!1;function r(t){for(var e=0,r=t.target;e<a;)s[e].animation===r&&(s.splice(e,1),e-=1,a-=1,r.isPaused||f()),e+=1}function l(t,e){if(!t)return null;for(var r=0;r<a;){if(s[r].elem===t&&null!==s[r].elem)return s[r].animation;r+=1}var i=new AnimationItem;return m(i,t),i.setData(t,e),i}function p(){n+=1,u()}function f(){n-=1}function m(t,e){t.addEventListener("destroy",r),t.addEventListener("_active",p),t.addEventListener("_idle",f),s.push({elem:e,animation:t}),a+=1}function c(t){var e,r=t-i;for(e=0;e<a;e+=1)s[e].animation.advanceTime(r);i=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){i=t,window.requestAnimationFrame(c)}function u(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new AnimationItem;return m(e,null),e.setParams(t),e},t.setSpeed=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setSpeed(t,e)},t.setDirection=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setDirection(t,e)},t.play=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,r){var i,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length;for(i=0;i<a;i+=1)r&&s[i].setAttribute("data-bm-type",r),l(s[i],t);if(e&&0===a){r||(r="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),n.appendChild(o),l(o,t)}},t.resize=function(){var t;for(t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,r){var i;for(i=0;i<a;i+=1)s[i].animation.goToAndStop(t,e,r)},t.destroy=function(t){var e;for(e=a-1;0<=e;e-=1)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,u()},t.setVolume=function(t,e){var r;for(r=0;r<a;r+=1)s[r].animation.setVolume(t,e)},t.mute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){var e;for(e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){var t,e=s.length,r=[];for(t=0;t<e;t+=1)r.push(s[t].animation);return r},t}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=subframeEnabled,this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";switch(t.animType?e=t.animType:t.renderer&&(e=t.renderer),e){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;default:this.renderer=new HybridRenderer(this,t.rendererSettings)}this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.configAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),assetLoader.load(t.path,this.configAnimation.bind(this),function(){this.trigger("data_failed")}.bind(this)))},AnimationItem.prototype.setData=function(t,e){e&&"object"!=typeof e&&(e=JSON.parse(e));var r={wrapper:t,animationData:e},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:"canvas";var s=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";"false"===s?r.loop=!1:"true"===s?r.loop=!0:""!==s&&(r.loop=parseInt(s,10));var a=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:!i.getNamedItem("bm-autoplay")||i.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"","false"===(i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;r<n;r+=1)for(e=0;e<s;){if(i[e].id===a[r].id){i[e]=a[r];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(s=t.assets.length,e=0;e<s;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,assetLoader.load(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){this.isLoaded||!this.renderer.globalData.fontManager.isLoaded||!this.imagePreloader.loaded()&&"canvas"===this.renderer.rendererType||(this.isLoaded=!0,dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!==r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),e=this.assetsPath+r}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var Expressions=(xP={},xP.initExpressions=function(t){var e=0,r=[];function i(){var t,e=r.length;for(t=0;t<e;t+=1)r[t].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=function(){e+=1},t.renderer.globalData.popExpression=function(){0==(e-=1)&&i()},t.renderer.globalData.registerExpressionProperty=function(t){-1===r.indexOf(t)&&r.push(t)}},xP),xP;expressionsPlugin=Expressions;var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null;function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||"boolean"===t||"string"===t||e instanceof Number}function $bm_neg(t){var e=typeof t;if("number"===e||"boolean"===e||t instanceof Number)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;r<i;r+=1)s[r]=-t[r];return s}return t.propType?t.v:-t}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(t,e){var r=typeof t,i=typeof e;if("string"===r||"string"===i)return t+e;if(isNumerable(r,t)&&isNumerable(i,e))return t+e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]+=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t+e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]+e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}var add=sum;function sub(t,e){var r=typeof t,i=typeof e;if(isNumerable(r,t)&&isNumerable(i,e))return"string"===r&&(t=parseInt(t,10)),"string"===i&&(e=parseInt(e,10)),t-e;if($bm_isInstanceOfArray(t)&&isNumerable(i,e))return(t=t.slice(0))[0]-=e,t;if(isNumerable(r,t)&&$bm_isInstanceOfArray(e))return(e=e.slice(0))[0]=t-e[0],e;if($bm_isInstanceOfArray(t)&&$bm_isInstanceOfArray(e)){for(var s=0,a=t.length,n=e.length,o=[];s<a||s<n;)("number"==typeof t[s]||t[s]instanceof Number)&&("number"==typeof e[s]||e[s]instanceof Number)?o[s]=t[s]-e[s]:o[s]=void 0===e[s]?t[s]:t[s]||e[s],s+=1;return o}return 0}function mul(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t*e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]*e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t*e[i];return r}return 0}function div(t,e){var r,i,s,a=typeof t,n=typeof e;if(isNumerable(a,t)&&isNumerable(n,e))return t/e;if($bm_isInstanceOfArray(t)&&isNumerable(n,e)){for(s=t.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t[i]/e;return r}if(isNumerable(a,t)&&$bm_isInstanceOfArray(e)){for(s=e.length,r=createTypedArray("float32",s),i=0;i<s;i+=1)r[i]=t/e[i];return r}return 0}function mod(t,e){return"string"==typeof t&&(t=parseInt(t,10)),"string"==typeof e&&(e=parseInt(e,10)),t%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(t,e,r){if(r<e){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var r;e||(e=helperLengthArray);var i=Math.min(t.length,e.length),s=0;for(r=0;r<i;r+=1)s+=Math.pow(e[r]-t[r],2);return Math.sqrt(s)}function normalize(t){return div(t,length(t))}function rgbToHsl(t){var e,r,i=t[0],s=t[1],a=t[2],n=Math.max(i,s,a),o=Math.min(i,s,a),h=(n+o)/2;if(n===o)r=e=0;else{var l=n-o;switch(r=.5<h?l/(2-n-o):l/(n+o),n){case i:e=(s-a)/l+(s<a?6:0);break;case s:e=(a-i)/l+2;break;case a:e=(i-s)/l+4}e/=6}return[e,r,h,t[3]]}function hue2rgb(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)r=i=e=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),r=hue2rgb(h,o,s),i=hue2rgb(h,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r<e){var a=r;r=e,e=a}if(t<=e)return i;if(r<=t)return s;var n,o=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*o;var h=i.length,l=createTypedArray("float32",h);for(n=0;n<h;n+=1)l[n]=i[n]+(s[n]-i[n])*o;return l}function random(t,e){if(void 0===e&&(void 0===t?(t=0,e=1):(e=t,t=void 0)),e.length){var r,i=e.length;t||(t=createTypedArray("float32",i));var s=createTypedArray("float32",i),a=BMMath.random();for(r=0;r<i;r+=1)s[r]=t[r]+a*(e[r]-t[r]);return s}return void 0===t&&(t=0),t+BMMath.random()*(e-t)}function createPath(t,e,r,i){var s,a=t.length,n=shapePool.newElement();n.setPathData(!!i,a);var o,h,l=[0,0];for(s=0;s<a;s+=1)o=e&&e[s]?e[s]:l,h=r&&r[s]?r[s]:l,n.setTripleAt(t[s][0],t[s][1],h[0]+t[s][0],h[1]+t[s][1],o[0]+t[s][0],o[1]+t[s][1],s,!0);return n}function initiateExpression(elem,data,property){var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(t,e){var r,i,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);var n=Math.floor(5*time);for(i=r=0;r<n;){for(i=0;i<s;i+=1)a[i]+=-e+2*e*BMMath.random();r+=1}var o=5*time,h=o-Math.floor(o),l=createTypedArray("float32",s);if(1<s){for(i=0;i<s;i+=1)l[i]=this.pv[i]+a[i]+(-e+2*e*BMMath.random())*h;return l}return this.pv+a[0]+(-e+2*e*BMMath.random())*h}.bind(this);function loopInDuration(t,e){return loopIn(t,e,!0)}function loopOutDuration(t,e){return loopOut(t,e,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(t,e){var r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,i,0]}function easeOut(t,e,r,i,s){return applyEase(easeOutBez,t,e,r,i,s)}function easeIn(t,e,r,i,s){return applyEase(easeInBez,t,e,r,i,s)}function ease(t,e,r,i,s){return applyEase(easeInOutBez,t,e,r,i,s)}function applyEase(t,e,r,i,s,a){void 0===s?(s=r,a=i):e=(e-r)/(i-r),1<e?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(s)){var o,h=s.length,l=createTypedArray("float32",h);for(o=0;o<h;o+=1)l[o]=(a[o]-s[o])*n+s[o];return l}return(a-s)*n+s}function nearestKey(t){var e,r,i,s=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(t*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,i=data.k[0].t;else{for(e=0;e<s-1;e+=1){if(t===data.k[e].t){r=e+1,i=data.k[e].t;break}if(t>data.k[e].t&&t<data.k[e+1].t){i=t-data.k[e].t>data.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;r<i;r+=1)e[r]=s[r],e.value[r]=s[r];return e}function framesToTime(t,e){return e||(e=elem.comp.globalData.frameRate),t/e}function timeToFrames(t,e){return t||0===t||(t=time),e||(e=elem.comp.globalData.frameRate),t*e}function seedRandom(t){BMMath.seedrandom(randSeed+t)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(t,e){return"string"==typeof value?void 0===e?value.substring(t):value.substring(t,e):""}function substr(t,e){return"string"==typeof value?void 0===e?value.substr(t):value.substr(t,e):""}function posterizeTime(t){time=0===t?0:Math.floor(time*t)/t,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(t){return value=t,_needsRandom&&seedRandom(randSeed),this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),($bm_transform=transform)&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,"shape"===scoped_bm_rt.propType&&(scoped_bm_rt=scoped_bm_rt.v),scoped_bm_rt)}return executeExpression}return ob.initiateExpression=initiateExpression,ob}(),expressionHelpers={searchExpressions:function(t,e,r){e.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(t,e,r).bind(r)))},getSpeedAtTime:function(t){var e=this.getValueAtTime(t),r=this.getValueAtTime(t+-.01),i=0;if(e.length){var s;for(s=0;s<e.length;s+=1)i+=Math.pow(r[s]-e[s],2);i=100*Math.sqrt(i)}else i=0;return i},getVelocityAtTime:function(t){if(void 0!==this.vel)return this.vel;var e,r,i=this.getValueAtTime(t),s=this.getValueAtTime(t+-.001);if(i.length)for(e=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)e[r]=(s[r]-i[r])/-.001;else e=(s-i)/-.001;return e},getValueAtTime:function(t){return t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<t?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(t,this._cachingAtTime),this._cachingAtTime.lastFrame=t),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(t){this.propertyGroup=t}};!function(){function o(t,e,r){if(!this.k||!this.keyframes)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[l.length-1].t;if(h<=p)return this.pv;if(r?s=p-(i=e?Math.abs(p-this.elem.comp.globalData.frameRate*e):Math.max(0,p-this.elem.data.ip)):((!e||e>l.length-1)&&(e=l.length-1),i=p-(s=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),m=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),u=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a<n;a+=1)o[a]=(m[a]-f[a])*u+c[a];return o}return(m-f)*u+c}if("continue"===t){var d=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(d.length)).length,a=0;a<n;a+=1)o[a]=d[a]+(d[a]-y[a])*((h-p)/this.comp.globalData.frameRate)/5e-4;return o}return d+(h-p)/.001*(d-y)}}return this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0)}function h(t,e,r){if(!this.k)return this.pv;t=t?t.toLowerCase():"";var i,s,a,n,o,h=this.comp.renderedFrame,l=this.keyframes,p=l[0].t;if(p<=h)return this.pv;if(r?s=p+(i=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>l.length-1)&&(e=l.length-1),i=(s=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/i)%2==0)return this.getValueAtTime(((p-h)%i+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(p-h)%i+p)/this.comp.globalData.frameRate,0),u=Math.floor((p-h)/i)+1;if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a<n;a+=1)o[a]=c[a]-(m[a]-f[a])*u;return o}return c-(m-f)*u}if("continue"===t){var d=this.getValueAtTime(p/this.comp.globalData.frameRate,0),y=this.getValueAtTime((p+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(n=(o=new Array(d.length)).length,a=0;a<n;a+=1)o[a]=d[a]+(d[a]-y[a])*(p-h)/.001;return o}return d+(d-y)*(p-h)/.001}}return this.getValueAtTime((i-((p-h)%i+p))/this.comp.globalData.frameRate,0)}function l(t,e){if(!this.k)return this.pv;if(t=.5*(t||.4),(e=Math.floor(e||5))<=1)return this.pv;var r,i,s=this.comp.renderedFrame/this.comp.globalData.frameRate,a=s-t,n=1<e?(s+t-a)/(e-1):1,o=0,h=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<e;){if(i=this.getValueAtTime(a+o*n),this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]+=i[h];else r+=i;o+=1}if(this.pv.length)for(h=0;h<this.pv.length;h+=1)r[h]/=e;else r/=e;return r}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(t,e,r){var i=s(t,e,r);return i.dynamicProperties.length?i.getValueAtTime=function(t){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var e=this._transformCachingAtTime.v;if(e.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(t);e.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var i=this.s.getValueAtTime(t);e.scale(i[0]*this.s.mult,i[1]*this.s.mult,i[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var s=this.sk.getValueAtTime(t),a=this.sa.getValueAtTime(t);e.skewFromAxis(-s*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var n=this.r.getValueAtTime(t);e.rotate(-n*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(t),h=this.ry.getValueAtTime(t),l=this.rx.getValueAtTime(t),p=this.or.getValueAtTime(t);e.rotateZ(-o*this.rz.mult).rotateY(h*this.ry.mult).rotateX(l*this.rx.mult).rotateZ(-p[2]*this.or.mult).rotateY(p[1]*this.or.mult).rotateX(p[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var f=this.px.getValueAtTime(t),m=this.py.getValueAtTime(t);if(this.data.p.z){var c=this.pz.getValueAtTime(t);e.translate(f*this.px.mult,m*this.py.mult,-c*this.pz.mult)}else e.translate(f*this.px.mult,m*this.py.mult,0)}else{var u=this.p.getValueAtTime(t);e.translate(u[0]*this.p.mult,u[1]*this.p.mult,-u[2]*this.p.mult)}return e}.bind(i):i.getValueAtTime=function(){return this.v.clone(new Matrix)}.bind(i),i.setGroupProperty=expressionHelpers.setGroupProperty,i};var p=PropertyFactory.getProp;PropertyFactory.getProp=function(t,e,r,i,s){var a=p(t,e,r,i,s);a.kf?a.getValueAtTime=expressionHelpers.getValueAtTime.bind(a):a.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a.loopOut=o,a.loopIn=h,a.smooth=l,a.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(a),a.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(a),a.numKeys=1===e.a?e.k.length:0,a.propertyIndex=e.ix;var n=0;return 0!==r&&(n=createTypedArray("float32",1===e.a?e.k[0].s.length:e.k.length)),a._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:n},expressionHelpers.searchExpressions(t,e,a),a.k&&s.addDynamicProperty(a),a};var t=ShapePropertyFactory.getConstructorFunction(),e=ShapePropertyFactory.getKeyframedConstructorFunction();function r(){}r.prototype={vertices:function(t,e){this.k&&this.getValue();var r,i=this.v;void 0!==e&&(i=this.getValueAtTime(e,0));var s=i._length,a=i[t],n=i.v,o=createSizedArray(s);for(r=0;r<s;r+=1)o[r]="i"===t||"o"===t?[a[r][0]-n[r][0],a[r][1]-n[r][1]]:[a[r][0],a[r][1]];return o},points:function(t){return this.vertices("v",t)},inTangents:function(t){return this.vertices("i",t)},outTangents:function(t){return this.vertices("o",t)},isClosed:function(){return this.v.c},pointOnPath:function(t,e){var r=this.v;void 0!==e&&(r=this.getValueAtTime(e,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var i,s=this._segmentsLength,a=s.lengths,n=s.totalLength*t,o=0,h=a.length,l=0;o<h;){if(l+a[o].addedLength>n){var p=o,f=r.c&&o===h-1?0:o+1,m=(n-l)/a[o].addedLength;i=bez.getPointInSegment(r.v[p],r.v[f],r.o[p],r.i[f],m,a[o]);break}l+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){1==t?t=this.v.c:0==t&&(t=.999);var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<t?this._caching.lastIndex:0,this._cachingAtTime.lastTime=t,this.interpolateShape(t,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},e.prototype.initiateExpression=ExpressionManager.initiateExpression;var n=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,r,i,s){var a=n(t,e,r,i,s);return a.propertyIndex=e.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(t,e.pt,a):4===r&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}(),TextProperty.prototype.getExpressionValue=function(t,e){var r=this.calculateExpression(e);if(t.t===r)return t;var i={};return this.copyData(i,t),i.t=r.toString(),i.__complete=!1,i},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null};var ShapePathInterface=function(t,e,r){var i=e.sh;function s(t){return"Shape"===t||"shape"===t||"Path"===t||"path"===t||"ADBE Vector Shape"===t||2===t?s.path:null}var a=propertyGroupFactory(s,r);return i.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return i.k&&i.getValue(),i}},shape:{get:function(){return i.k&&i.getValue(),i}},_name:{value:t.nm},ix:{value:t.ix},propertyIndex:{value:t.ix},mn:{value:t.mn},propertyGroup:{value:r}}),s},propertyGroupFactory=function(e,r){return function(t){return(t=void 0===t?1:t)<=0?e:r(t-1)}},PropertyInterface=function(t,e){var r={_name:t};return function(t){return(t=void 0===t?1:t)<=0?r:e(t-1)}},ShapeExpressionInterface=function(){function n(t,e,r){var i,s=[],a=t?t.length:0;for(i=0;i<a;i+=1)"gr"===t[i].ty?s.push(o(t[i],e[i],r)):"fl"===t[i].ty?s.push(h(t[i],e[i],r)):"st"===t[i].ty?s.push(l(t[i],e[i],r)):"tm"===t[i].ty?s.push(p(t[i],e[i],r)):"tr"===t[i].ty||("el"===t[i].ty?s.push(m(t[i],e[i],r)):"sr"===t[i].ty?s.push(c(t[i],e[i],r)):"sh"===t[i].ty?s.push(ShapePathInterface(t[i],e[i],r)):"rc"===t[i].ty?s.push(u(t[i],e[i],r)):"rd"===t[i].ty?s.push(d(t[i],e[i],r)):"rp"===t[i].ty&&s.push(y(t[i],e[i],r)));return s}function o(t,e,r){var i=function(t){switch(t){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,r);var s=function(t,e,r){var i,s=function(t){for(var e=0,r=i.length;e<r;){if(i[e]._name===t||i[e].mn===t||i[e].propertyIndex===t||i[e].ix===t||i[e].ind===t)return i[e];e+=1}return"number"==typeof t?i[t-1]:null};s.propertyGroup=propertyGroupFactory(s,r),i=n(t.it,e.it,s.propertyGroup),s.numProperties=i.length;var a=f(t.it[t.it.length-1],e.it[e.it.length-1],s.propertyGroup);return s.transform=a,s.propertyIndex=t.cix,s._name=t.nm,s}(t,e,i.propertyGroup),a=f(t.it[t.it.length-1],e.it[e.it.length-1],i.propertyGroup);return i.content=s,i.transform=a,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function h(t,e,r){function i(t){return"Color"===t||"color"===t?i.color:"Opacity"===t||"opacity"===t?i.opacity:null}return Object.defineProperties(i,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",r)),e.o.setGroupProperty(PropertyInterface("Opacity",r)),i}function l(t,e,r){var i,s=propertyGroupFactory(l,r),a=propertyGroupFactory(h,s);var n,o=t.d?t.d.length:0,h={};for(i=0;i<o;i+=1)n=i,Object.defineProperty(h,t.d[n].nm,{get:ExpressionPropertyInterface(e.d.dataProps[n].p)}),e.d.dataProps[i].p.setGroupProperty(a);function l(t){return"Color"===t||"color"===t?l.color:"Opacity"===t||"opacity"===t?l.opacity:"Stroke Width"===t||"stroke width"===t?l.strokeWidth:null}return Object.defineProperties(l,{color:{get:ExpressionPropertyInterface(e.c)},opacity:{get:ExpressionPropertyInterface(e.o)},strokeWidth:{get:ExpressionPropertyInterface(e.w)},dash:{get:function(){return h}},_name:{value:t.nm},mn:{value:t.mn}}),e.c.setGroupProperty(PropertyInterface("Color",s)),e.o.setGroupProperty(PropertyInterface("Opacity",s)),e.w.setGroupProperty(PropertyInterface("Stroke Width",s)),l}function p(e,t,r){function i(t){return t===e.e.ix||"End"===t||"end"===t?i.end:t===e.s.ix?i.start:t===e.o.ix?i.offset:null}var s=propertyGroupFactory(i,r);return i.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",s)),t.e.setGroupProperty(PropertyInterface("End",s)),t.o.setGroupProperty(PropertyInterface("Offset",s)),i.propertyIndex=e.ix,i.propertyGroup=r,Object.defineProperties(i,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),i.mn=e.mn,i}function f(e,t,r){function i(t){return e.a.ix===t||"Anchor Point"===t?i.anchorPoint:e.o.ix===t||"Opacity"===t?i.opacity:e.p.ix===t||"Position"===t?i.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?i.rotation:e.s.ix===t||"Scale"===t?i.scale:e.sk&&e.sk.ix===t||"Skew"===t?i.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?i.skewAxis:null}var s=propertyGroupFactory(i,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",s)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",s)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",s)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",s)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",s)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",s)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",s))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",s)),Object.defineProperties(i,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),i.ty="tr",i.mn=e.mn,i.propertyGroup=r,i}function m(e,t,r){function i(t){return e.p.ix===t?i.position:e.s.ix===t?i.size:null}var s=propertyGroupFactory(i,r);i.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),Object.defineProperties(i,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),i.mn=e.mn,i}function c(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.rotation:e.pt.ix===t?i.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?i.outerRadius:e.os.ix===t?i.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?i.innerRoundness:null:i.innerRadius}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",s)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",s)),a.pt.setGroupProperty(PropertyInterface("Points",s)),a.p.setGroupProperty(PropertyInterface("Position",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",s)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",s))),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),i.mn=e.mn,i}function u(e,t,r){function i(t){return e.p.ix===t?i.position:e.r.ix===t?i.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?i.size:null}var s=propertyGroupFactory(i,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return i.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",s)),a.s.setGroupProperty(PropertyInterface("Size",s)),a.r.setGroupProperty(PropertyInterface("Rotation",s)),Object.defineProperties(i,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),i.mn=e.mn,i}function d(e,t,r){function i(t){return e.r.ix===t||"Round Corners 1"===t?i.radius:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",s)),Object.defineProperties(i,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),i.mn=e.mn,i}function y(e,t,r){function i(t){return e.c.ix===t||"Copies"===t?i.copies:e.o.ix===t||"Offset"===t?i.offset:null}var s=propertyGroupFactory(i,r),a=t;return i.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",s)),a.o.setGroupProperty(PropertyInterface("Offset",s)),Object.defineProperties(i,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),i.mn=e.mn,i}return function(t,e,i){var s;function r(t){if("number"==typeof t)return 0===(t=void 0===t?1:t)?i:s[t-1];for(var e=0,r=s.length;e<r;){if(s[e]._name===t)return s[e];e+=1}return null}return r.propertyGroup=propertyGroupFactory(r,function(){return i}),s=n(t,e,r.propertyGroup),r.numProperties=s.length,r._name="Contents",r}}(),TextExpressionInterface=function(e){var r;function i(t){switch(t){case"ADBE Text Document":return i.sourceText;default:return null}}return Object.defineProperty(i,"sourceText",{get:function(){e.textProperty.getValue();var t=e.textProperty.currentData.t;return void 0!==t&&(e.textProperty.currentData.t=void 0,(r=new String(t)).value=t||new String(t)),r}}),i},LayerExpressionInterface=function(){function s(t){var e=new Matrix;void 0!==t?this._elem.finalTransform.mProp.getValueAtTime(t).clone(e):this._elem.finalTransform.mProp.applyToMatrix(e);return e}function a(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,t)}function n(t,e){var r=this.getMatrix(e);return this.applyPoint(r,t)}function o(t,e){var r=this.getMatrix(e);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,t)}function h(t,e){var r=this.getMatrix(e);return this.invertPoint(r,t)}function l(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.applyToPointArray(e[0],e[1],e[2]||0)}function p(t,e){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)}return t.inversePoint(e)}function f(t){var e=new Matrix;if(e.reset(),this._elem.finalTransform.mProp.applyToMatrix(e),this._elem.hierarchy&&this._elem.hierarchy.length){var r,i=this._elem.hierarchy.length;for(r=0;r<i;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);return e.inversePoint(t)}return e.inversePoint(t)}function m(){return[1,1,1,1]}return function(e){var r;function i(t){switch(t){case"ADBE Root Vectors Group":case"Contents":case 2:return i.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return r;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return i.effect;case"ADBE Text Properties":return i.textInterface;default:return null}}i.getMatrix=s,i.invertPoint=p,i.applyPoint=l,i.toWorld=n,i.toWorldVec=a,i.fromWorld=h,i.fromWorldVec=o,i.toComp=n,i.fromComp=f,i.sampleImage=m,i.sourceRectAtTime=e.sourceRectAtTime.bind(e);var t=getDescriptor(r=TransformExpressionInterface((i._elem=e).finalTransform.mProp),"anchorPoint");return Object.defineProperties(i,{hasParent:{get:function(){return e.hierarchy.length}},parent:{get:function(){return e.hierarchy[0].layerInterface}},rotation:getDescriptor(r,"rotation"),scale:getDescriptor(r,"scale"),position:getDescriptor(r,"position"),opacity:getDescriptor(r,"opacity"),anchorPoint:t,anchor_point:t,transform:{get:function(){return r}},active:{get:function(){return e.isInRange}}}),i.startTime=e.data.st,i.index=e.data.ind,i.source=e.data.refId,i.height=0===e.data.ty?e.data.h:100,i.width=0===e.data.ty?e.data.w:100,i.inPoint=e.data.ip/e.comp.globalData.frameRate,i.outPoint=e.data.op/e.comp.globalData.frameRate,i._name=e.data.nm,i.registerMaskInterface=function(t){i.mask=new MaskManagerInterface(t,e)},i.registerEffectsInterface=function(t){i.effect=t},i}}(),CompExpressionInterface=function(i){function t(t){for(var e=0,r=i.layers.length;e<r;){if(i.layers[e].nm===t||i.layers[e].ind===t)return i.elements[e].layerInterface;e+=1}return null}return Object.defineProperty(t,"_name",{value:i.data.nm}),(t.layer=t).pixelAspect=1,t.height=i.data.h||i.globalData.compSize.h,t.width=i.data.w||i.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/i.globalData.frameRate,t.displayStartTime=0,t.numLayers=i.layers.length,t},TransformExpressionInterface=function(t){function e(t){switch(t){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity;default:return null}}var r,i,s,a;return Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(t.r||t.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(t.rz||t.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(t.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(t.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(t.s)}),t.p?a=ExpressionPropertyInterface(t.p):(r=ExpressionPropertyInterface(t.px),i=ExpressionPropertyInterface(t.py),t.pz&&(s=ExpressionPropertyInterface(t.pz))),Object.defineProperty(e,"position",{get:function(){return t.p?a():[r(),i(),s?s():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(t.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(t.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(t.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(t.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(t.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(t.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(t.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(t.or)}),e},ProjectInterface=function(){function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,r=this.compositions.length;e<r;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),EffectsExpressionInterface=function(){function l(s,t,e,r){function i(t){for(var e=s.ef,r=0,i=e.length;r<i;){if(t===e[r].nm||t===e[r].mn||t===e[r].ix)return 5===e[r].ty?o[r]:o[r]();r+=1}throw new Error}var a,n=propertyGroupFactory(i,e),o=[],h=s.ef.length;for(a=0;a<h;a+=1)5===s.ef[a].ty?o.push(l(s.ef[a],t.effectElements[a],t.effectElements[a].propertyGroup,r)):o.push(p(t.effectElements[a],s.ef[a].ty,r,n));return"ADBE Color Control"===s.mn&&Object.defineProperty(i,"color",{get:function(){return o[0]()}}),Object.defineProperties(i,{numProperties:{get:function(){return s.np}},_name:{value:s.nm},propertyGroup:{value:n}}),i.enabled=0!==s.en,i.active=i.enabled,i}function p(t,e,r,i){var s=ExpressionPropertyInterface(t.p);return t.p.setGroupProperty&&t.p.setGroupProperty(PropertyInterface("",i)),function(){return 10===e?r.comp.compInterface(t.p.v):s()}}return{createEffectsInterface:function(t,e){if(t.effectsManager){var r,i=[],s=t.data.ef,a=t.effectsManager.effectElements.length;for(r=0;r<a;r+=1)i.push(l(s[r],t.effectsManager.effectElements[r],e,t));var n=t.data.ef||[],o=function(t){for(r=0,a=n.length;r<a;){if(t===n[r].nm||t===n[r].mn||t===n[r].ix)return i[r];r+=1}return null};return Object.defineProperty(o,"numProperties",{get:function(){return n.length}}),o}return null}}}(),MaskManagerInterface=function(){function t(t,e){this._mask=t,this._data=e}Object.defineProperty(t.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(t.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}});return function(e){var r,i=createSizedArray(e.viewData.length),s=e.viewData.length;for(r=0;r<s;r+=1)i[r]=new t(e.viewData[r],e.masksProperties[r]);return function(t){for(r=0;r<s;){if(e.masksProperties[r].nm===t)return i[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var s={pv:0,v:0,mult:1},n={pv:[0,0,0],v:[0,0,0],mult:1};function o(i,s,a){Object.defineProperty(i,"velocity",{get:function(){return s.getVelocityAtTime(s.comp.currentFrame)}}),i.numKeys=s.keyframes?s.keyframes.length:0,i.key=function(t){if(!i.numKeys)return 0;var e="";e="s"in s.keyframes[t-1]?s.keyframes[t-1].s:"e"in s.keyframes[t-2]?s.keyframes[t-2].e:s.keyframes[t-2].s;var r="unidimensional"===a?new Number(e):Object.assign({},e);return r.time=s.keyframes[t-1].t/s.elem.comp.globalData.frameRate,r.value="unidimensional"===a?e[0]:e,r},i.valueAtTime=s.getValueAtTime,i.speedAtTime=s.getSpeedAtTime,i.velocityAtTime=s.getVelocityAtTime,i.propertyGroup=s.propertyGroup}function e(){return s}return function(t){return t?"unidimensional"===t.propType?function(t){t&&"pv"in t||(t=s);var e=1/t.mult,r=t.pv*e,i=new Number(r);return i.value=r,o(i,t,"unidimensional"),function(){return t.k&&t.getValue(),r=t.v*e,i.value!==r&&((i=new Number(r)).value=r,o(i,t,"unidimensional")),i}}(t):function(e){e&&"pv"in e||(e=n);var r=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,o(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)a[t]=e.v[t]*r,s[t]=a[t];return s}}(t):e}}();function SliderEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function AngleEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function ColorEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function PointEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,1,0,r)}function LayerIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function MaskIndexEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function CheckboxEffect(t,e,r){this.p=PropertyFactory.getProp(e,t.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(t,e){var r,i=t.ef||[];this.effectElements=[];var s,a=i.length;for(r=0;r<a;r+=1)s=new GroupEffect(i[r],e),this.effectElements.push(s)}function GroupEffect(t,e){this.init(t,e)}!function(){!function(){function t(t,e){return this.textIndex=t+1,this.textTotal=e,this.v=this.getValue()*this.mult,this.v}}();var i=TextSelectorProp.getTextSelectorProp;TextSelectorProp.getTextSelectorProp=function(t,e,r){return 1===e.t?new TextExpressionSelectorPropFactory(t,e,r):i(t,e,r)}}(),extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(t,e){var r;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var i,s=this.data.ef.length,a=this.data.ef;for(r=0;r<s;r+=1){switch(i=null,a[r].ty){case 0:i=new SliderEffect(a[r],e,this);break;case 1:i=new AngleEffect(a[r],e,this);break;case 2:i=new ColorEffect(a[r],e,this);break;case 3:i=new PointEffect(a[r],e,this);break;case 4:case 7:i=new CheckboxEffect(a[r],e,this);break;case 10:i=new LayerIndexEffect(a[r],e,this);break;case 11:i=new MaskIndexEffect(a[r],e,this);break;case 5:i=new EffectsManager(a[r],e,this);break;default:i=new NoValueEffect(a[r],e,this)}i&&this.effectElements.push(i)}};var lottie={};function setLocationHref(t){locationHref=t}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){subframeEnabled=t}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":defaultCurveSegments=200;break;default:case"medium":defaultCurveSegments=50;break;case"low":defaultCurveSegments=10}else!isNaN(t)&&1<t&&(defaultCurveSegments=t);roundValues(!(50<=defaultCurveSegments))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r<e.length;r+=1){var i=e[r].split("=");if(decodeURIComponent(i[0])==t)return decodeURIComponent(i[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocationHref,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.__getFactory=getFactory,lottie.version="5.7.6";var standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="",queryString;if(standalone){var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src.replace(/^[^\?]+\??/,""),renderer=getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);
 return lottie;
 }));
\ No newline at end of file
diff --git a/package.json b/package.json
index e1acba2..be94162 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "lottie-web",
-  "version": "5.7.5",
+  "version": "5.7.6",
   "description": "After Effects plugin for exporting animations to SVG + JavaScript or canvas + JavaScript",
   "main": "./build/player/lottie.js",
   "repository": {
diff --git a/tasks/build.js b/tasks/build.js
index d0b7a36..d4720da 100644
--- a/tasks/build.js
+++ b/tasks/build.js
@@ -2,7 +2,7 @@
 const UglifyJS = require("uglify-js");
 
 const rootFolder = 'player/';
-const bm_version = '5.7.5';
+const bm_version = '5.7.6';
 const buildReducedVersion = process.argv[2] === 'reduced'
 const defaultBuilds = ['full','svg_light','svg','canvas','html', 'canvas_light', 'html_light', 'canvas_worker']